Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
whilei committed Oct 24, 2018
1 parent 599775e commit 796c91c
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 42 deletions.
17 changes: 0 additions & 17 deletions tests/files/VMTests/ECIP1045/vmCreate2/00.tmp

This file was deleted.

44 changes: 44 additions & 0 deletions tests/files/VMTests/ECIP1045/vmCreate2/01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"create2_1": {
"callcreates": [],
"env": {
"currentCoinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty": "0x0100",
"currentGasLimit": "0x0f4240",
"currentNumber": "0x00",
"currentTimestamp": "0x01"
},
"exec": {
"address": "0xdeadbeef00000000000000000000000000000000",
"caller": "0xdeadbeef00000000000000000000000000000000",
"code": "0x6000600160006000f5600055",
"data": "0x00",
"gas": "0x0186a0",
"gasPrice": "0x5af3107a4000",
"origin": "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value": "0x0de0b6b3a7640000"
},
"gas": "0xbb68",
"logs": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out": "",
"post": {
"0xdeadbeef00000000000000000000000000000000": {
"balance": "0xd3c21bcecceda1000000",
"code": "0x6000600160006000f5600055",
"nonce": "0x00",
"storage": {
"0x00": "0xB928f69Bb1D91Cd65274e3c79d8986362984fDA3"
}
}
},
"pre": {
"0xdeadbeef00000000000000000000000000000000": {
"balance": "0xd3c21bcecceda1000000",
"code": "0x6000600160006000f5600055",
"nonce": "0x00",
"storage": {
}
}
}
}
}
44 changes: 44 additions & 0 deletions tests/files/VMTests/ECIP1045/vmCreate2/02.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"create2_2": {
"callcreates": [],
"env": {
"currentCoinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty": "0x0100",
"currentGasLimit": "0x0f4240",
"currentNumber": "0x00",
"currentTimestamp": "0x01"
},
"exec": {
"address": "0xdeadbeef00000000000000000000000000000000",
"caller": "0xdeadbeef00000000000000000000000000000000",
"code": "0x7f000000000000000000000000feed000000000000000000000000000000000000600160006000f5600055",
"data": "0x00",
"gas": "0x0186a0",
"gasPrice": "0x5af3107a4000",
"origin": "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value": "0x0de0b6b3a7640000"
},
"gas": "0xbb68",
"logs": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out": "",
"post": {
"0xdeadbeef00000000000000000000000000000000": {
"balance": "0xd3c21bcecceda1000000",
"code": "0x7f000000000000000000000000feed000000000000000000000000000000000000600160006000f5600055",
"nonce": "0x00",
"storage": {
"0x00": "0xD04116cDd17beBE565EB2422F2497E06cC1C9833"
}
}
},
"pre": {
"0xdeadbeef00000000000000000000000000000000": {
"balance": "0xd3c21bcecceda1000000",
"code": "0x7f000000000000000000000000feed000000000000000000000000000000000000600160006000f5600055",
"nonce": "0x00",
"storage": {
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"create2_4": {
"create2_3": {
"callcreates": [],
"env": {
"currentCoinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
Expand All @@ -10,30 +10,31 @@
},
"exec": {
"address": "0x0000000000000000000000000000000000000000",
"caller": "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code": "0x6000602c60006000f5",
"data": "0x",
"caller": "0x0000000000000000000000000000000000000000",
"code": "0x6000600160006000f5600055",
"data": "0xdeadbeef",
"gas": "0x0186a0",
"gasPrice": "0x5af3107a4000",
"origin": "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value": "0x0de0b6b3a7640000"
},
"gas": "0x10982",
"gas": "0xbb68",
"logs": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out": "0x",
"out": "",
"post": {
"0x0000000000000000000000000000000000000000": {
"balance": "0xd3c21bcecceda1000000",
"code": "0x6000602c60006000f5",
"code": "0x6000600160006000f5600055",
"nonce": "0x00",
"storage": {
"0x00": "0x70f2b2914A2a4b783FaEFb75f459A580616Fcb5e"
}
}
},
"pre": {
"0x0000000000000000000000000000000000000000": {
"balance": "0xd3c21bcecceda1000000",
"code": "0x6000602c60006000f5",
"code": "0x6000600160006000f5600055",
"nonce": "0x00",
"storage": {
}
Expand Down
17 changes: 0 additions & 17 deletions tests/files/VMTests/ECIP1045/vmCreate2/04.tmp

This file was deleted.

5 changes: 5 additions & 0 deletions tests/vm2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/ethereumproject/go-ethereum/core/vm"
"github.com/ethereumproject/go-ethereum/ethdb"
"github.com/ethereumproject/go-ethereum/logger/glog"
"log"
"math/big"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -107,6 +108,8 @@ func TestECIP1045CREATE2Tests(t *testing.T) {
}
if err := RunVmTest2(fn, VmSkipTests, rs); err != nil {
t.Error(err)
} else {
log.Println("----")
}
}
}
Expand Down Expand Up @@ -202,6 +205,8 @@ func runVmTest2(test VmTest2, rs RuleSet) error {
vexp := common.HexToHash(value)
if v != vexp {
return fmt.Errorf("(%x: %s) storage failed. Expected %x, got %x (%v %v)\n", obj.Address().Bytes()[0:4], addr, vexp, v, vexp.Big(), v.Big())
} else {
log.Printf("matcher: %v == %v", v.Hex(), vexp.Hex())
}
}
}
Expand Down

0 comments on commit 796c91c

Please sign in to comment.