diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-08-24 17:26:06 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-08-24 22:16:39 +0800 |
commit | b872961ec82ec88a7ac6ef331cfb3eb685ce2c00 (patch) | |
tree | 652d5bc27e4f95809637e6f76f6db3162b2e435e /tests/vm_test_util.go | |
parent | 3c48a25762dfab9382791c33a2f5832466077ac3 (diff) | |
download | dexon-b872961ec82ec88a7ac6ef331cfb3eb685ce2c00.tar dexon-b872961ec82ec88a7ac6ef331cfb3eb685ce2c00.tar.gz dexon-b872961ec82ec88a7ac6ef331cfb3eb685ce2c00.tar.bz2 dexon-b872961ec82ec88a7ac6ef331cfb3eb685ce2c00.tar.lz dexon-b872961ec82ec88a7ac6ef331cfb3eb685ce2c00.tar.xz dexon-b872961ec82ec88a7ac6ef331cfb3eb685ce2c00.tar.zst dexon-b872961ec82ec88a7ac6ef331cfb3eb685ce2c00.zip |
consensus, core, tests: implement Metropolis EIP 649
Diffstat (limited to 'tests/vm_test_util.go')
-rw-r--r-- | tests/vm_test_util.go | 21 |
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) { |