aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2015-03-11 00:41:07 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2015-03-11 00:41:07 +0800
commit7e0c3f1342a87a82a82b515a364d1561f2509622 (patch)
treebf23835f9821d79472f1b9ac079bf101f8bfb0a2
parent223a102aff41ad44bf82b348643fd100ba5fa6a8 (diff)
parent2026871882e2ed988bde3a63b94f49b4206a8bfc (diff)
downloaddexon-solidity-7e0c3f1342a87a82a82b515a364d1561f2509622.tar.gz
dexon-solidity-7e0c3f1342a87a82a82b515a364d1561f2509622.tar.zst
dexon-solidity-7e0c3f1342a87a82a82b515a364d1561f2509622.zip
Merge branch 'develop' into new_jsonrpc
-rw-r--r--SolidityEndToEndTest.cpp11
-rw-r--r--stRefundTestFiller.json89
-rw-r--r--stTransactionTestFiller.json4
-rw-r--r--vmArithmeticTestFiller.json32
-rw-r--r--vmIOandFlowOperationsTestFiller.json225
5 files changed, 356 insertions, 5 deletions
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp
index ae241705..3205c038 100644
--- a/SolidityEndToEndTest.cpp
+++ b/SolidityEndToEndTest.cpp
@@ -1031,6 +1031,17 @@ BOOST_AUTO_TEST_CASE(blockchain)
BOOST_CHECK(callContractFunctionWithValue("someInfo()", 28) == encodeArgs(28, 0, 1));
}
+BOOST_AUTO_TEST_CASE(now)
+{
+ char const* sourceCode = "contract test {\n"
+ " function someInfo() returns (bool success) {\n"
+ " return block.timestamp == now && now > 0;\n"
+ " }\n"
+ "}\n";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("someInfo()") == encodeArgs(true));
+}
+
BOOST_AUTO_TEST_CASE(function_types)
{
char const* sourceCode = "contract test {\n"
diff --git a/stRefundTestFiller.json b/stRefundTestFiller.json
index 9e867a50..b0d0e174 100644
--- a/stRefundTestFiller.json
+++ b/stRefundTestFiller.json
@@ -304,6 +304,95 @@
"data" : ""
}
},
+
+ "refund_CallToSuicide" : {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "10000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "{ [[ 0 ]] (CALL 500 0xaaae7baea6a6c7c4c2dfeb977efac326af552aaa 0 0 0 0 0 )}",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "{ (SUICIDE 0x095e7baea6a6c7c4c2dfeb977efac326af552d87) }",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000000",
+ "nonce" : "0",
+ "code" : "",
+ "storage": {}
+ }
+ },
+ "transaction" : {
+ "nonce" : "0",
+ "gasPrice" : "1",
+ "gasLimit" : "10000000",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "10",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "data" : ""
+ }
+ },
+
+ "refund_CallToSuicideTwice" : {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "10000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "{ [[ 0 ]] (CALL 500 0xaaae7baea6a6c7c4c2dfeb977efac326af552aaa 0 0 0 0 0 ) (CALL 500 0xaaae7baea6a6c7c4c2dfeb977efac326af552aaa 0 0 0 0 0 )}",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "{ (SUICIDE 0x095e7baea6a6c7c4c2dfeb977efac326af552d87) }",
+ "storage" : {
+ "0x01" : "0x01"
+ }
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000000",
+ "nonce" : "0",
+ "code" : "",
+ "storage": {}
+ }
+ },
+ "transaction" : {
+ "nonce" : "0",
+ "gasPrice" : "1",
+ "gasLimit" : "10000000",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "10",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "data" : ""
+ }
+ },
+
"refund_CallA" : {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
diff --git a/stTransactionTestFiller.json b/stTransactionTestFiller.json
index 9bd7436b..8e22b126 100644
--- a/stTransactionTestFiller.json
+++ b/stTransactionTestFiller.json
@@ -709,7 +709,7 @@
"pre" :
{
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
- "balance" : "1000000",
+ "balance" : "180000",
"code" : "",
"nonce" : "0",
"storage" : {
@@ -737,7 +737,7 @@
"transaction" :
{
"data" : "",
- "gasLimit" : "50000",
+ "gasLimit" : "150000",
"gasPrice" : "1",
"nonce" : "",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
diff --git a/vmArithmeticTestFiller.json b/vmArithmeticTestFiller.json
index 3e453f8e..81dbf052 100644
--- a/vmArithmeticTestFiller.json
+++ b/vmArithmeticTestFiller.json
@@ -976,8 +976,36 @@
"caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000",
"data" : "",
- "gasPrice" : "100000000000000",
- "gas" : "10000"
+ "gasPrice" : "1",
+ "gas" : "1000000"
+ }
+ },
+
+ "sdiv_dejavu": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "{ asm PUSH1 0x05 PUSH1 0x09 PUSH1 0x00 SUB SDIV DUP PUSH1 0 SSTORE }",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "1",
+ "gas" : "10000000"
}
},
diff --git a/vmIOandFlowOperationsTestFiller.json b/vmIOandFlowOperationsTestFiller.json
index 995b9d6d..84a5188a 100644
--- a/vmIOandFlowOperationsTestFiller.json
+++ b/vmIOandFlowOperationsTestFiller.json
@@ -283,7 +283,7 @@
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
- "currentGasLimit" : "1000000",
+ "currentGasLimit" : "8390000000",
"currentDifficulty" : "256",
"currentTimestamp" : "1",
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
@@ -306,6 +306,229 @@
"gas" : "100000"
}
},
+ "mstore8MemExp": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "8390000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "100000000000000000000000",
+ "nonce" : "0",
+ "code" : "0x60f1630fffffff53",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "1",
+ "gas" : "8390000"
+ }
+ },
+
+ "mloadMemExp": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "8390000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "100000000000000000000000",
+ "nonce" : "0",
+ "code" : "0x630fffffff51",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "1",
+ "gas" : "8390000"
+ }
+ },
+
+ "mstoreMemExp": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "8390000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "100000000000000000000000",
+ "nonce" : "0",
+ "code" : "0x60f1630fffffff52",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "1",
+ "gas" : "8390000000"
+ }
+ },
+
+ "log1MemExp": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "8390000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "100000000000000000000000",
+ "nonce" : "0",
+ "code" : "0x60ff60ff630fffffffa1",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "1",
+ "gas" : "8390000000"
+ }
+ },
+
+ "extcodecopyMemExp": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "8390000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "100000000000000000000000",
+ "nonce" : "0",
+ "code" : "0x60ff60ff630fffffff630fffffff3c",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "1",
+ "gas" : "8390000000"
+ }
+ },
+
+ "codecopyMemExp": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "8390000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "100000000000000000000000",
+ "nonce" : "0",
+ "code" : "0x60ff60ff630fffffff630fffffff39",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "1",
+ "gas" : "8390000000"
+ }
+ },
+
+ "calldatacopyMemExp": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "8390000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "100000000000000000000000",
+ "nonce" : "0",
+ "code" : "0x60ff60ff630fffffff630fffffff37",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "1",
+ "gas" : "8390000000"
+ }
+ },
+
+ "sha3MemExp": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "8390000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "100000000000000000000000",
+ "nonce" : "0",
+ "code" : "0x60ff630fffffff20",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "1",
+ "gas" : "8390000000"
+ }
+ },
"mstore8WordToBigError": {
"env" : {