Commit 099e8e7f authored by protolambda's avatar protolambda

mipsevm: clean up solutil test logging

parent 748773f1
...@@ -158,7 +158,6 @@ func ParseSourceMap(sources []string, bytecode []byte, sourceMap string) (*Sourc ...@@ -158,7 +158,6 @@ func ParseSourceMap(sources []string, bytecode []byte, sourceMap string) (*Sourc
if instIndex >= len(instructions) { if instIndex >= len(instructions) {
// truncated source-map? Or some instruction that's longer than we accounted for? // truncated source-map? Or some instruction that's longer than we accounted for?
// probably the contract-metadata bytes that are not accounted for in source map // probably the contract-metadata bytes that are not accounted for in source map
fmt.Printf("out of instructions: %d\n", instIndex-len(instructions))
} else { } else {
instMapping = instructions[instIndex] instMapping = instructions[instIndex]
} }
......
package mipsevm package mipsevm
import ( import (
"fmt" "strings"
"testing" "testing"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
...@@ -13,6 +13,9 @@ func TestSourcemap(t *testing.T) { ...@@ -13,6 +13,9 @@ func TestSourcemap(t *testing.T) {
srcMap, err := contract.SourceMap([]string{"../contracts/src/MIPS.sol"}) srcMap, err := contract.SourceMap([]string{"../contracts/src/MIPS.sol"})
require.NoError(t, err) require.NoError(t, err)
for i := 0; i < len(contract.DeployedBytecode.Object); i++ { for i := 0; i < len(contract.DeployedBytecode.Object); i++ {
fmt.Println(srcMap.FormattedInfo(uint64(i)) + ": test") info := srcMap.FormattedInfo(uint64(i))
if !strings.HasPrefix(info, "generated:") && !strings.HasPrefix(info, "../contracts/src/MIPS.sol") {
t.Fatalf("unexpected info: %q", info)
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment