aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2017-07-04 21:48:14 +0800
committerYoichi Hirai <i@yoichihirai.com>2017-07-04 21:48:14 +0800
commit24dd562b3556d736f3083a9a3ea1db9286cd597d (patch)
treef5aff915e8947670bb26e8cf39bf97a23a15c470
parentf1de8c3b7fa2c2c0aa281b6b3a1ad7010356c5ff (diff)
downloadtangerine-tests-24dd562b3556d736f3083a9a3ea1db9286cd597d.tar
tangerine-tests-24dd562b3556d736f3083a9a3ea1db9286cd597d.tar.gz
tangerine-tests-24dd562b3556d736f3083a9a3ea1db9286cd597d.tar.bz2
tangerine-tests-24dd562b3556d736f3083a9a3ea1db9286cd597d.tar.lz
tangerine-tests-24dd562b3556d736f3083a9a3ea1db9286cd597d.tar.xz
tangerine-tests-24dd562b3556d736f3083a9a3ea1db9286cd597d.tar.zst
tangerine-tests-24dd562b3556d736f3083a9a3ea1db9286cd597d.zip
Price calculation when exp length > 256, and the first word of exponent is zero
-rw-r--r--GeneralStateTests/stPreCompiledContracts/modexp.json48
-rw-r--r--src/GeneralStateTestsFiller/stPreCompiledContracts/modexpFiller.json8
2 files changed, 52 insertions, 4 deletions
diff --git a/GeneralStateTests/stPreCompiledContracts/modexp.json b/GeneralStateTests/stPreCompiledContracts/modexp.json
index 7dccbc525..c5a8c75ce 100644
--- a/GeneralStateTests/stPreCompiledContracts/modexp.json
+++ b/GeneralStateTests/stPreCompiledContracts/modexp.json
@@ -1,5 +1,10 @@
{
"modexp" : {
+ "_info" : {
+ "comment" : "",
+ "filledwith" : "cpp-1.3.0+commit.bc18ce87.Linux.g++",
+ "source" : "/src/GeneralStateTestsFiller/stPreCompiledContracts/modexpFiller.json"
+ },
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x20000",
@@ -225,6 +230,14 @@
"gas" : 0,
"value" : 0
}
+ },
+ {
+ "hash" : "0x6105198fe46b16679fce14df3ac906734c6c371f0f4b2876aba7303b30868a75",
+ "indexes" : {
+ "data" : 27,
+ "gas" : 0,
+ "value" : 0
+ }
}
],
"EIP158" : [
@@ -443,6 +456,14 @@
"gas" : 0,
"value" : 0
}
+ },
+ {
+ "hash" : "0x6105198fe46b16679fce14df3ac906734c6c371f0f4b2876aba7303b30868a75",
+ "indexes" : {
+ "data" : 27,
+ "gas" : 0,
+ "value" : 0
+ }
}
],
"Frontier" : [
@@ -661,6 +682,14 @@
"gas" : 0,
"value" : 0
}
+ },
+ {
+ "hash" : "0xbbe41bbf20a3f2663091f141148c584776955f1ddfe40a9c56eeb43c63cf961f",
+ "indexes" : {
+ "data" : 27,
+ "gas" : 0,
+ "value" : 0
+ }
}
],
"Homestead" : [
@@ -879,6 +908,14 @@
"gas" : 0,
"value" : 0
}
+ },
+ {
+ "hash" : "0xbbe41bbf20a3f2663091f141148c584776955f1ddfe40a9c56eeb43c63cf961f",
+ "indexes" : {
+ "data" : 27,
+ "gas" : 0,
+ "value" : 0
+ }
}
],
"Metropolis" : [
@@ -1097,6 +1134,14 @@
"gas" : 0,
"value" : 0
}
+ },
+ {
+ "hash" : "0x54f7ac3ec3555bd7fbf119a986b26aa0ace72058b8126ac5479f22adef152c50",
+ "indexes" : {
+ "data" : 27,
+ "gas" : 0,
+ "value" : 0
+ }
}
]
},
@@ -1144,7 +1189,8 @@
"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000202",
"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002",
"0x000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001001001010010",
- "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000064"
+ "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000064",
+ "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030006"
],
"gasLimit" : [
"0x05f5e100"
diff --git a/src/GeneralStateTestsFiller/stPreCompiledContracts/modexpFiller.json b/src/GeneralStateTestsFiller/stPreCompiledContracts/modexpFiller.json
index 4074f49a1..842adfc4a 100644
--- a/src/GeneralStateTestsFiller/stPreCompiledContracts/modexpFiller.json
+++ b/src/GeneralStateTestsFiller/stPreCompiledContracts/modexpFiller.json
@@ -107,7 +107,7 @@
},
{
"indexes" : {
- "data" : [16],
+ "data" : [16,27],
"gas" : -1,
"value" : -1
},
@@ -179,7 +179,8 @@
"21,21,22,23 - Non-zero length exp & mod, but passed data has only base and part of exp / only base",
"24 - Non-zero length base & exp & mod and no values in input data - interpreted as all zeroes",
"25 - Price calculation when baseLength > modLength",
- "26 - bigint_expmod precompiled contract returns 1 for 0 ^ 0 mod 100"
+ "26 - bigint_expmod precompiled contract returns 1 for 0 ^ 0 mod 100",
+ "27 - 02 ** 03 % 06, but exp with 256 bytes of zero in front."
],
"data" : [
"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002003fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2efffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",
@@ -208,7 +209,8 @@
"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000202",
"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002",
"0x000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001001001010010",
-"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000064"
+"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000064",
+"0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030006"
],
"gasLimit" : [
"100000000"