aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2015-02-25 02:39:47 +0800
committerCJentzsch <jentzsch.software@gmail.com>2015-02-25 21:18:50 +0800
commit4c3e1f7c4a56bcc2cc216e15fa05522e762f1d0e (patch)
treef0523e8869a75d20a46e00165c84f5090e126cea
parentedc5050a4b3fbb3f61f894ab7d737a5c80bfb6f6 (diff)
downloaddexon-solidity-4c3e1f7c4a56bcc2cc216e15fa05522e762f1d0e.tar.gz
dexon-solidity-4c3e1f7c4a56bcc2cc216e15fa05522e762f1d0e.tar.zst
dexon-solidity-4c3e1f7c4a56bcc2cc216e15fa05522e762f1d0e.zip
add test for quadratic complexity
remove file with wrong name
-rw-r--r--stQuadraticComplexityTestFiller.json49
-rw-r--r--stSystemOperationsTestFiller.json48
-rw-r--r--state.cpp5
-rw-r--r--stquadraticcomplexitytestfiller.json1
4 files changed, 102 insertions, 1 deletions
diff --git a/stQuadraticComplexityTestFiller.json b/stQuadraticComplexityTestFiller.json
new file mode 100644
index 00000000..f474cb21
--- /dev/null
+++ b/stQuadraticComplexityTestFiller.json
@@ -0,0 +1,49 @@
+{
+ "Call50000" : {
+ "env" : {
+ "currentCoinbase" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "0xffffffffffffffffffffffffffffffff",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "pre" :
+ {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0xffffffffffffffffffffffffffffffff",
+ "code" : "",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+
+ "aaaf5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "7000",
+ "code" : "",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+
+ "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1000",
+ "code" : "{ (for {} (< @i 100) [i](+ @i 1) [[ 0 ]](CALL 0xfffffffffff 0xaaaf5374fce5edbc8e2a8697c15331677e6ebf0b 1 0 50000 0 0) ) [[ 1 ]] @i}",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+
+ "transaction" :
+ {
+ "data" : "",
+ "gasLimit" : "0xffffffffffffffffffffffffffffff",
+ "gasPrice" : "1",
+ "nonce" : "",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "value" : "10"
+ }
+ }
+}
diff --git a/stSystemOperationsTestFiller.json b/stSystemOperationsTestFiller.json
index 9fbfbe25..3b08ca67 100644
--- a/stSystemOperationsTestFiller.json
+++ b/stSystemOperationsTestFiller.json
@@ -2268,5 +2268,53 @@
"secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"data": ""
}
+ },
+
+ "Call10" : {
+ "env" : {
+ "currentCoinbase" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "0xffffffffffffffffffffffffffffffff",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "pre" :
+ {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0xffffffffffffffffffffffffffffffff",
+ "code" : "",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+
+ "aaaf5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "7000",
+ "code" : "",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+
+ "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "1000",
+ "code" : "{ (for {} (< @i 10) [i](+ @i 1) [[ 0 ]](CALL 0xfffffffffff 0xaaaf5374fce5edbc8e2a8697c15331677e6ebf0b 1 0 50000 0 0) ) [[ 1 ]] @i}",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+
+ "transaction" :
+ {
+ "data" : "",
+ "gasLimit" : "0xffffffffffffffffffffffffffffff",
+ "gasPrice" : "1",
+ "nonce" : "",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "value" : "10"
+ }
}
}
diff --git a/state.cpp b/state.cpp
index 03f01d0f..4e955df4 100644
--- a/state.cpp
+++ b/state.cpp
@@ -159,6 +159,11 @@ BOOST_AUTO_TEST_CASE(stBlockHashTest)
dev::test::executeTests("stBlockHashTest", "/StateTests", dev::test::doStateTests);
}
+BOOST_AUTO_TEST_CASE(stQuadraticComplexityTest)
+{
+ dev::test::executeTests("stQuadraticComplexityTest", "/StateTests", dev::test::doStateTests);
+}
+
BOOST_AUTO_TEST_CASE(stSolidityTest)
{
dev::test::executeTests("stSolidityTest", "/StateTests", dev::test::doStateTests);
diff --git a/stquadraticcomplexitytestfiller.json b/stquadraticcomplexitytestfiller.json
deleted file mode 100644
index 8b137891..00000000
--- a/stquadraticcomplexitytestfiller.json
+++ /dev/null
@@ -1 +0,0 @@
-