Navigation Menu

Skip to content

Commit

Permalink
Test for CALL to self (including EIP-1380)
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 committed Nov 7, 2019
1 parent 59490b4 commit b7dfd94
Show file tree
Hide file tree
Showing 2 changed files with 203 additions and 0 deletions.
93 changes: 93 additions & 0 deletions GeneralStateTests/stCallCodes/CallSelf_1.json
@@ -0,0 +1,93 @@
{
"CallSelf_1" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.8.0-alpha.0-22+commit.230d1d08.dirty",
"lllcversion" : "Version: 0.5.8-develop.2019.8.27+commit.db44bc77.Linux.g++",
"source" : "src/GeneralStateTestsFiller/stCallCodes/CallSelf_1Filler.json",
"sourceHash" : "e3f74477f505c20d95047891510a219a6562209e147b919330b59e1016260cda"
},
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x20000",
"currentGasLimit" : "0x989680",
"currentNumber" : "0x01",
"currentTimestamp" : "0x03e8",
"previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"post" : {
"Istanbul" : [
{
"hash" : "0x5d2130a19618006bbe0d1b68d9cc350e5d0320a21d6a8b446908e671915f010c",
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"hash" : "0x2828876ec0913e2bfcb9fdfa24dbfe46800aa9c6727f4a68261943d8cc657c37",
"indexes" : {
"data" : 0,
"gas" : 1,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"Istanbul+1380" : [
{
"hash" : "0xa35eed9a79394d750a3e6eac223b08d318ecdef6be7e3cbe6dd970e82a39b3cf",
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"hash" : "0x5d2cc452800e9e4822aa1e97a64f6b98b1364fcabbdea37dc1ecbbb22ae647f7",
"indexes" : {
"data" : 0,
"gas" : 1,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
]
},
"pre" : {
"0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x01312d00",
"code" : "0x6000361115601c5760006000600060006000305af16000555a6001555b",
"nonce" : "0x00",
"storage" : {
}
},
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : [
"0x600100"
],
"gasLimit" : [
"0x0592a8",
"0xf03c"
],
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : [
"0x00"
]
}
}
}
110 changes: 110 additions & 0 deletions src/GeneralStateTestsFiller/stCallCodes/CallSelf_1Filler.json
@@ -0,0 +1,110 @@
{
"CallSelf_1" : {
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x20000",
"currentGasLimit" : "10000000",
"currentNumber" : "1",
"currentTimestamp" : "1000",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"expect" : [
{
"indexes" : {
"data" : -1,
"gas" : 0,
"value" : -1
},
"network" : ["Istanbul"],
"result" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"storage" : {
"0x00" : "1",
"0x01" : "323415"
}
}
}
},
{
"indexes" : {
"data" : -1,
"gas" : 1,
"value" : -1
},
"network" : ["Istanbul"],
"result" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"storage" : {
}
}
}
},
{
"indexes" : {
"data" : -1,
"gas" : 0,
"value" : -1
},
"network" : ["Istanbul+1380"],
"result" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"storage" : {
"0x00" : "1",
"0x01" : "324075"
}
}
}
},
{
"indexes" : {
"data" : -1,
"gas" : 1,
"value" : -1
},
"network" : ["Istanbul+1380"],
"result" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"storage" : {
"0x00" : "1",
"0x01" : "20351"
}
}
}
}

],
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "20000000",
"//yul_src" : "if gt(calldatasize(), 0) { sstore(0, call(gas(), address(), 0, 0, 0, 0, 0)) sstore(1, gas()) }",
"code" : "0x6000361115601c5760006000600060006000305af16000555a6001555b",
"nonce" : "0",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "1000000000000000000",
"code" : "",
"nonce" : "0",
"storage" : {
}
}
},
"transaction" : {
"data" : [
"1"
],
"gasLimit" : [
"365224",
"61500"
],
"gasPrice" : "1",
"nonce" : "0",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : [
"0"
]
}
}
}

0 comments on commit b7dfd94

Please sign in to comment.