From 1b7b2ba2163c7b2b2acc0c4f107951ad873cd8a4 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 5 Oct 2016 23:55:47 +0200 Subject: tests: update test files from github.com/ethereum/tests @ 45bc1d21d3c1 Two new tests are skipped because they're buggy. Making some newer random state tests work required implementing the 'compressed return value encoding'. --- tests/state_test_util.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/state_test_util.go') diff --git a/tests/state_test_util.go b/tests/state_test_util.go index 67e4bf832..0f5042ecc 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" @@ -166,7 +167,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) } -- cgit v1.2.3