Skip to content

Commit

Permalink
tests: eip1283 JSON test and runner; testcase \#1
Browse files Browse the repository at this point in the history
  • Loading branch information
whilei committed Oct 4, 2018
1 parent c190b89 commit f859374
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tests/files/VMTests/SputnikVM/vmEIP1283/1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"eip1283_1": {
"callcreates": [],
"env": {
"currentCoinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty": "0x0100",
"currentGasLimit": "0x0f4240",
"currentNumber": "0x00",
"currentTimestamp": "0x01"
},
"exec": {
"address": "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller": "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code": "0x60006000556000600055",
"data": "0x",
"gas": "0x0186a0",
"gasPrice": "0x5af3107a4000",
"origin": "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value": "0x0de0b6b3a7640000"
},
"gas": "0x18504",
"logs": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out": "0x",
"post": {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6": {
"balance": "0xd3c21bcecceda1000000",
"code": "0x60006000556000600055",
"nonce": "0x00",
"storage": {
"0x00": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
}
},
"pre": {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6": {
"balance": "0xd3c21bcecceda1000000",
"code": "0x60006000556000600055",
"nonce": "0x00",
"storage": {}
}
}
}
}
9 changes: 9 additions & 0 deletions tests/vm2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ func TestSputnikVMTests(t *testing.T) {
}
}

func TestEIP1283VMTests(t *testing.T) {
fns, _ := filepath.Glob(filepath.Join(vmTestDir, "SputnikVM", "vmEIP1283", "*"))
for _, fn := range fns {
if err := RunVmTest2(fn, VmSkipTests); err != nil {
t.Error(err)
}
}
}

// RunVmTest2 reads input JSON and runs associated test.
func RunVmTest2(p string, skipTests []string) error {
tests := make(map[string]VmTest2)
Expand Down

0 comments on commit f859374

Please sign in to comment.