aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vm_test_util.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-25 16:00:51 +0800
committerGitHub <noreply@github.com>2017-08-25 16:00:51 +0800
commit27a5622e995d762683dd1a79423d83fcf3e62ccf (patch)
tree49e6fc917ada2c4a5c3be6b96c7f73581d218c69 /tests/vm_test_util.go
parent8596fc59740e3563be5095b0d8c64411331605f0 (diff)
parentb872961ec82ec88a7ac6ef331cfb3eb685ce2c00 (diff)
downloaddexon-27a5622e995d762683dd1a79423d83fcf3e62ccf.tar
dexon-27a5622e995d762683dd1a79423d83fcf3e62ccf.tar.gz
dexon-27a5622e995d762683dd1a79423d83fcf3e62ccf.tar.bz2
dexon-27a5622e995d762683dd1a79423d83fcf3e62ccf.tar.lz
dexon-27a5622e995d762683dd1a79423d83fcf3e62ccf.tar.xz
dexon-27a5622e995d762683dd1a79423d83fcf3e62ccf.tar.zst
dexon-27a5622e995d762683dd1a79423d83fcf3e62ccf.zip
Merge pull request #15028 from karalabe/metropolis-iceage
consensus, core, tests: implement Metropolis EIP 649
Diffstat (limited to 'tests/vm_test_util.go')
-rw-r--r--tests/vm_test_util.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/vm_test_util.go b/tests/vm_test_util.go
index afdd896c3..0aa37955c 100644
--- a/tests/vm_test_util.go
+++ b/tests/vm_test_util.go
@@ -44,14 +44,14 @@ func (t *VMTest) UnmarshalJSON(data []byte) error {
}
type vmJSON struct {
- Env stEnv `json:"env"`
- Exec vmExec `json:"exec"`
- Logs []stLog `json:"logs"`
- GasRemaining *math.HexOrDecimal64 `json:"gas"`
- Out hexutil.Bytes `json:"out"`
- Pre core.GenesisAlloc `json:"pre"`
- Post core.GenesisAlloc `json:"post"`
- PostStateRoot common.Hash `json:"postStateRoot"`
+ Env stEnv `json:"env"`
+ Exec vmExec `json:"exec"`
+ Logs common.UnprefixedHash `json:"logs"`
+ GasRemaining *math.HexOrDecimal64 `json:"gas"`
+ Out hexutil.Bytes `json:"out"`
+ Pre core.GenesisAlloc `json:"pre"`
+ Post core.GenesisAlloc `json:"post"`
+ PostStateRoot common.Hash `json:"postStateRoot"`
}
//go:generate gencodec -type vmExec -field-override vmExecMarshaling -out gen_vmexec.go
@@ -109,7 +109,10 @@ func (t *VMTest) Run(vmconfig vm.Config) error {
// if root := statedb.IntermediateRoot(false); root != t.json.PostStateRoot {
// return fmt.Errorf("post state root mismatch, got %x, want %x", root, t.json.PostStateRoot)
// }
- return checkLogs(statedb.Logs(), t.json.Logs)
+ if logs := rlpHash(statedb.Logs()); logs != common.Hash(t.json.Logs) {
+ return fmt.Errorf("post state logs hash mismatch: got %x, want %x", logs, t.json.Logs)
+ }
+ return nil
}
func (t *VMTest) exec(statedb *state.StateDB, vmconfig vm.Config) ([]byte, uint64, error) {