[release/1.4.16] 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'.

(cherry picked from commit 1b7b2ba216)
This commit is contained in:
Felix Lange
2016-10-05 23:55:47 +02:00
parent 438efdab28
commit e97b30169b
746 changed files with 188558 additions and 65755 deletions

View File

@@ -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)
}