diff options
author | Adrian Sutton <adrian.sutton@consensys.net> | 2018-11-12 07:50:39 +0800 |
---|---|---|
committer | Adrian Sutton <adrian.sutton@consensys.net> | 2018-11-12 07:50:39 +0800 |
commit | bd72064a878503191819b562ce0454f583fc0c81 (patch) | |
tree | a4995c66d0adb8b554e88f63cffb64636dcfada0 | |
parent | e98f0866a20839581ec3d3c79d8d6c2e81a2d1a4 (diff) | |
download | dexon-tests-bd72064a878503191819b562ce0454f583fc0c81.tar dexon-tests-bd72064a878503191819b562ce0454f583fc0c81.tar.gz dexon-tests-bd72064a878503191819b562ce0454f583fc0c81.tar.bz2 dexon-tests-bd72064a878503191819b562ce0454f583fc0c81.tar.lz dexon-tests-bd72064a878503191819b562ce0454f583fc0c81.tar.xz dexon-tests-bd72064a878503191819b562ce0454f583fc0c81.tar.zst dexon-tests-bd72064a878503191819b562ce0454f583fc0c81.zip |
Add test case for a contract executing EXTCODEHASH with a dynamic argument.
-rw-r--r-- | GeneralStateTests/stExtCodeHash/extCodeHashDynamicArgument.json | 126 | ||||
-rw-r--r-- | src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDynamicArgumentFiller.json | 93 |
2 files changed, 219 insertions, 0 deletions
diff --git a/GeneralStateTests/stExtCodeHash/extCodeHashDynamicArgument.json b/GeneralStateTests/stExtCodeHash/extCodeHashDynamicArgument.json new file mode 100644 index 000000000..3e1db65d5 --- /dev/null +++ b/GeneralStateTests/stExtCodeHash/extCodeHashDynamicArgument.json @@ -0,0 +1,126 @@ +{ + "extCodeHashDynamicArgument" : { + "_info" : { + "comment" : "EXTCODEHASH/EXTCODESIZE with address from a dynamic argument", + "filledwith" : "testeth 1.5.0-alpha.6-1+commit.19ad7d95.dirty", + "lllcversion" : "Version: 0.5.0-develop.2018.9.29+commit.c4b5101b.Darwin.appleclang", + "source" : "src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDynamicArgumentFiller.json", + "sourceHash" : "e2709b0f48dd2fe2d301ab2ec8be79e17c9670070d313fe974bcd0ecdd711c70" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Byzantium" : [ + { + "hash" : "0x2ffec9d4b7c1064dc9e9180bdcfe021b7f59cd0fee6c00767146407121f118e0", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ], + "Constantinople" : [ + { + "hash" : "0xa62cbeb822ef70fd8572382d509fa76186025e04643a288121f40294f377f504", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ], + "EIP150" : [ + { + "hash" : "0x2ffec9d4b7c1064dc9e9180bdcfe021b7f59cd0fee6c00767146407121f118e0", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ], + "EIP158" : [ + { + "hash" : "0x2ffec9d4b7c1064dc9e9180bdcfe021b7f59cd0fee6c00767146407121f118e0", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ], + "Frontier" : [ + { + "hash" : "0x2ffec9d4b7c1064dc9e9180bdcfe021b7f59cd0fee6c00767146407121f118e0", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ], + "Homestead" : [ + { + "hash" : "0x2ffec9d4b7c1064dc9e9180bdcfe021b7f59cd0fee6c00767146407121f118e0", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "", + "nonce" : "0x00", + "storage" : { + } + }, + "0xdeadbeef00000000000000000000000000000000" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x6000353f6000556000353b600155", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xdeadbeef" + } + }, + "0xdeadbeef00000000000000000000000000000001" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x1234", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x000000000000000000000000deadbeef00000000000000000000000000000001" + ], + "gasLimit" : [ + "0x061a80" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0xdeadbeef00000000000000000000000000000000", + "value" : [ + "0x01" + ] + } + } +}
\ No newline at end of file diff --git a/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDynamicArgumentFiller.json b/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDynamicArgumentFiller.json new file mode 100644 index 000000000..5ae89827e --- /dev/null +++ b/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDynamicArgumentFiller.json @@ -0,0 +1,93 @@ +{ + "extCodeHashDynamicArgument" : { + "_info" : { + "comment": "EXTCODEHASH/EXTCODESIZE with address from a dynamic argument" + }, + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect": [ + { + "indexes": { + "data": -1, + "gas": -1, + "value": -1 + }, + "network": [ + ">Byzantium" + ], + "result": { + "deadbeef00000000000000000000000000000000": { + "balance": "1000000000000000001", + "storage": { + "0x00": "0x56570de287d73cd1cb6092bb8fdee6173974955fdef345ae579ee9f475ea7432", + "0x01": "0x02" + } + } + } + }, + { + "indexes": { + "data": -1, + "gas": -1, + "value": -1 + }, + "network": [ + "<=Byzantium" + ], + "result": { + "deadbeef00000000000000000000000000000000": { + "balance": "1000000000000000000", + "storage": { + "0x00": "0xdeadbeef" + } + } + } + } + ], + "pre": { + "deadbeef00000000000000000000000000000000": { + "balance": "1000000000000000000", + "code": "{ [[0]] (EXTCODEHASH (CALLDATALOAD 0)) [[1]] (EXTCODESIZE (CALLDATALOAD 0)) }", + "nonce": "0", + "storage": { + "0x00": "0xdeadbeef" + } + }, + "deadbeef00000000000000000000000000000001" : { + "balance" : "1000000000000000000", + "code" : "0x1234", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "1000000000000000000", + "code": "0x", + "nonce": "0", + "storage": { + } + } + }, + "transaction": { + "data": [ + "0x000000000000000000000000deadbeef00000000000000000000000000000001" + ], + "gasLimit": [ + "400000" + ], + "gasPrice": "1", + "nonce": "0", + "secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to": "deadbeef00000000000000000000000000000000", + "value": [ + "1" + ] + } + } +} |