aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2017-06-26 20:54:34 +0800
committerYoichi Hirai <i@yoichihirai.com>2017-06-26 20:58:31 +0800
commit1f9a25fdc7c68ab9e0d9b6587f90c2d62b820a67 (patch)
tree7f80e551ecf8c722866a99fda6fe874e57dfd3a9
parent182908905d69bf0a2b83d64c559aea8d1ac3a3e8 (diff)
downloadtangerine-tests-1f9a25fdc7c68ab9e0d9b6587f90c2d62b820a67.tar
tangerine-tests-1f9a25fdc7c68ab9e0d9b6587f90c2d62b820a67.tar.gz
tangerine-tests-1f9a25fdc7c68ab9e0d9b6587f90c2d62b820a67.tar.bz2
tangerine-tests-1f9a25fdc7c68ab9e0d9b6587f90c2d62b820a67.tar.lz
tangerine-tests-1f9a25fdc7c68ab9e0d9b6587f90c2d62b820a67.tar.xz
tangerine-tests-1f9a25fdc7c68ab9e0d9b6587f90c2d62b820a67.tar.zst
tangerine-tests-1f9a25fdc7c68ab9e0d9b6587f90c2d62b820a67.zip
Add a test about STATICCALL not inheriting the callvalue
This test failw on cpp-ethereum:develop but succeeds on cpp-ethereum:fix-staticcall
-rw-r--r--GeneralStateTests/stStaticCall/static_call_value_inherit.json108
-rw-r--r--src/GeneralStateTestsFiller/stStaticCall/static_call_value_inheritFiller.json70
2 files changed, 178 insertions, 0 deletions
diff --git a/GeneralStateTests/stStaticCall/static_call_value_inherit.json b/GeneralStateTests/stStaticCall/static_call_value_inherit.json
new file mode 100644
index 000000000..651d9074f
--- /dev/null
+++ b/GeneralStateTests/stStaticCall/static_call_value_inherit.json
@@ -0,0 +1,108 @@
+{
+ "static_call_value_inherit" : {
+ "_info" : {
+ "comment" : "",
+ "filledwith" : "cpp-1.3.0+commit.5bca1594.Linux.g++",
+ "source" : "/src/GeneralStateTestsFiller/stStaticCall/static_call_value_inheritFiller.json"
+ },
+ "env" : {
+ "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "0x020000",
+ "currentGasLimit" : "0x989680",
+ "currentNumber" : "0x01",
+ "currentTimestamp" : "0x03e8",
+ "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "post" : {
+ "EIP150" : [
+ {
+ "hash" : "0xc5d9e23a003e568560c82fdfd24f2bf6d127c46de7f72c54d9f778d62fa74fbf",
+ "indexes" : {
+ "data" : 0,
+ "gas" : 0,
+ "value" : 0
+ }
+ }
+ ],
+ "EIP158" : [
+ {
+ "hash" : "0xc5d9e23a003e568560c82fdfd24f2bf6d127c46de7f72c54d9f778d62fa74fbf",
+ "indexes" : {
+ "data" : 0,
+ "gas" : 0,
+ "value" : 0
+ }
+ }
+ ],
+ "Frontier" : [
+ {
+ "hash" : "0xc5d9e23a003e568560c82fdfd24f2bf6d127c46de7f72c54d9f778d62fa74fbf",
+ "indexes" : {
+ "data" : 0,
+ "gas" : 0,
+ "value" : 0
+ }
+ }
+ ],
+ "Homestead" : [
+ {
+ "hash" : "0xc5d9e23a003e568560c82fdfd24f2bf6d127c46de7f72c54d9f778d62fa74fbf",
+ "indexes" : {
+ "data" : 0,
+ "gas" : 0,
+ "value" : 0
+ }
+ }
+ ],
+ "Metropolis" : [
+ {
+ "hash" : "0x89ea1ffb32a55407e6ad55d9ec39a8a27edb0397a3c3a40ac2b84072cdea6f78",
+ "indexes" : {
+ "data" : 0,
+ "gas" : 0,
+ "value" : 0
+ }
+ }
+ ]
+ },
+ "pre" : {
+ "0x094f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0x01",
+ "code" : "0x602060006000600073c94f5374fce5edbc8e2a8697c15331677e6ebf0b61c350fa600055600051600155",
+ "nonce" : "0x00",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0xe8d4a51000",
+ "code" : "",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ },
+ "0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0x01",
+ "code" : "0x3460005260206000f3",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : [
+ ""
+ ],
+ "gasLimit" : [
+ "0x0704e0"
+ ],
+ "gasPrice" : "0x01",
+ "nonce" : "0x00",
+ "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "0x094f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "value" : [
+ "0x0a"
+ ]
+ }
+ }
+} \ No newline at end of file
diff --git a/src/GeneralStateTestsFiller/stStaticCall/static_call_value_inheritFiller.json b/src/GeneralStateTestsFiller/stStaticCall/static_call_value_inheritFiller.json
new file mode 100644
index 000000000..09c9a9748
--- /dev/null
+++ b/src/GeneralStateTestsFiller/stStaticCall/static_call_value_inheritFiller.json
@@ -0,0 +1,70 @@
+{
+ "static_call_value_inherit" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "0x020000",
+ "currentGasLimit" : "10000000",
+ "currentNumber" : "1",
+ "currentTimestamp" : "1000",
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "expect" : [
+ {
+ "indexes" : {
+ "data" : -1,
+ "gas" : -1,
+ "value" : -1
+ },
+ "network" : ["Metropolis"],
+ "result" : {
+ "094f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "storage" : {
+ "0x0" : "0x1",
+ "0x1" : "0x0"
+ }
+ }
+ }
+ }
+ ],
+ "pre" :
+ {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1000000000000",
+ "code" : "",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+ "094f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1",
+ "code" : "{ [[0]] (STATICCALL 50000 0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b 0 0 0 32) [[1]] (MLOAD 0) }",
+ "nonce" : "0",
+ "storage" : {
+ "0x1": "1"
+ }
+ },
+ "c94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1",
+ "code" : "{ (MSTORE 0 (CALLVALUE)) (RETURN 0 32) }",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" : {
+ "data" : [
+ ""
+ ],
+ "gasLimit" : [
+ "460000"
+ ],
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "094f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "value" : [
+ "10"
+ ]
+ }
+ }
+}