aboutsummaryrefslogtreecommitdiffstats
path: root/tests/state_test_util.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-10-06 22:19:53 +0800
committerGitHub <noreply@github.com>2016-10-06 22:19:53 +0800
commiteeb2a1a6e3c7a0c77ee6836f3103708cff4102ad (patch)
tree092de74597c335d666af44b44f645b2ed597174f /tests/state_test_util.go
parent7335a70a020517cc9cebe7ae82c0e49ba133abf1 (diff)
parent1b7b2ba2163c7b2b2acc0c4f107951ad873cd8a4 (diff)
downloadgo-tangerine-eeb2a1a6e3c7a0c77ee6836f3103708cff4102ad.tar.gz
go-tangerine-eeb2a1a6e3c7a0c77ee6836f3103708cff4102ad.tar.zst
go-tangerine-eeb2a1a6e3c7a0c77ee6836f3103708cff4102ad.zip
Merge pull request #3094 from fjl/tests-update
tests: update test files from github.com/ethereum/tests @ 45bc1d21d3c1
Diffstat (limited to 'tests/state_test_util.go')
-rw-r--r--tests/state_test_util.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/state_test_util.go b/tests/state_test_util.go
index 3c4b42a18..985271500 100644
--- a/tests/state_test_util.go
+++ b/tests/state_test_util.go
@@ -23,6 +23,7 @@ import (
"io"
"math/big"
"strconv"
+ "strings"
"testing"
"github.com/ethereum/go-ethereum/common"
@@ -152,7 +153,13 @@ func runStateTest(ruleSet RuleSet, test VmTest) error {
ret, logs, _, _ = RunState(ruleSet, statedb, env, test.Transaction)
// Compare expected and actual return
- rexp := common.FromHex(test.Out)
+ var rexp []byte
+ if strings.HasPrefix(test.Out, "#") {
+ n, _ := strconv.Atoi(test.Out[1:])
+ rexp = make([]byte, n)
+ } else {
+ rexp = common.FromHex(test.Out)
+ }
if bytes.Compare(rexp, ret) != 0 {
return fmt.Errorf("return failed. Expected %x, got %x\n", rexp, ret)
}