From 6ad14c1a157e707fd15c87816e8ad872f69790db Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 21 Feb 2014 18:33:39 +0000 Subject: [PATCH 01/11] Added VM test suite. Added TODO. Renamed old files. --- TODO | 21 ++++++++++ hexencodetest.txt => hexencodetest.json | 0 rlptest.txt => rlptest.json | 0 trietest.txt => trietest.json | 0 vmtests.json | 56 +++++++++++++++++++++++++ 5 files changed, 77 insertions(+) create mode 100644 TODO rename hexencodetest.txt => hexencodetest.json (100%) rename rlptest.txt => rlptest.json (100%) rename trietest.txt => trietest.json (100%) create mode 100644 vmtests.json diff --git a/TODO b/TODO new file mode 100644 index 000000000..08b816b2c --- /dev/null +++ b/TODO @@ -0,0 +1,21 @@ +- Move over to standard & clear JSON format: + +All files should be of the form: + +{ + "test1name": + { + "test1property1": ..., + "test1property2": ..., + ... + }, + "test2name": + { + "test2property1": ..., + "test2property2": ..., + ... + } +} + +Arrays are allowed, but don't use them for sets of properties - only use them for data that is clearly a continuous contiguous sequence of values. + diff --git a/hexencodetest.txt b/hexencodetest.json similarity index 100% rename from hexencodetest.txt rename to hexencodetest.json diff --git a/rlptest.txt b/rlptest.json similarity index 100% rename from rlptest.txt rename to rlptest.json diff --git a/trietest.txt b/trietest.json similarity index 100% rename from trietest.txt rename to trietest.json diff --git a/vmtests.json b/vmtests.json new file mode 100644 index 000000000..07f69a671 --- /dev/null +++ b/vmtests.json @@ -0,0 +1,56 @@ +{ + "suicide": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "feeMultiplier" : 1 + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 1000000000000000000, + "nonce" : 0, + "code" : "(suicide (txsender))" + } + }, + "exec" : [ + { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 1000000000000000000, + "data" : [ + ] + } + ] + }, + + "mktx": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "feeMultiplier" : 1 + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 1000000000000000000, + "nonce" : 0, + "code" : "(mktx (txsender) (txvalue) 0)" + } + }, + "exec" : [ + { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 1000000000000000000, + "data" : [ + ] + } + ] + } + +} From 660cd26f31b3979149950c1fdea995b85a774c1c Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 21 Feb 2014 18:35:51 +0000 Subject: [PATCH 02/11] More docs. --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 6ceeb19de..0f7dbe5a6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,26 @@ tests ===== + +Common tests for all clients to test against. + +All files should be of the form: + +``` +{ + "test1name": + { + "test1property1": ..., + "test1property2": ..., + ... + }, + "test2name": + { + "test2property1": ..., + "test2property2": ..., + ... + } +} +``` + +Arrays are allowed, but don't use them for sets of properties - only use them for data that is clearly a continuous contiguous sequence of values. + From a0ec84383218ea80b4c0b99e09710fae182a2379 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 21 Feb 2014 18:49:24 +0000 Subject: [PATCH 03/11] Moved over to new format, but RLP tests still need updating. --- hexencodetest.json | 68 +++++++++++++++--------------- rlptest.json | 100 +++++++++++++++++++++------------------------ trietest.json | 8 ++-- 3 files changed, 84 insertions(+), 92 deletions(-) diff --git a/hexencodetest.json b/hexencodetest.json index a6d18834c..6fe7891c3 100644 --- a/hexencodetest.json +++ b/hexencodetest.json @@ -1,34 +1,34 @@ -[ - [ - [ 1, 2, 3, 4, 5 ], - "112345" - ], - [ - [ 0, 1, 2, 3, 4, 5 ], - "00012345" - ], - [ - [ 6, 4, 6, 15, 6, 7, 6, 5, 16 ], - "20646f6765" - ], - [ - [ 7, 6, 5, 16 ], - "3765" - ], - [ - [ 16 ], - "20" - ], - [ - [ 0, 16 ], - "30" - ], - [ - [ 15, 1, 12, 11, 8, 16 ], - "3f1cb8" - ], - [ - [ 0, 15, 1, 12, 11, 8, 16 ], - "200f1cb8" - ] -] +{ + "nz,odd": { + "seq": [ 1, 2, 3, 4, 5 ], + "return": "112345" + }, + "z,even": { + "seq": [ 0, 1, 2, 3, 4, 5 ], + "return": "00012345" + }, + "long": { + "seq": [ 6, 4, 6, 15, 6, 7, 6, 5, 16 ], + "return": "20646f6765" + }, + "short": { + "seq": [ 7, 6, 5, 16 ], + "return": "3765" + }, + "nz,one": { + "seq": [ 16 ], + "return": "20" + }, + "z,two": { + "seq": [ 0, 16 ], + "return": "30" + }, + "nz,even": { + "seq": [ 15, 1, 12, 11, 8, 16 ], + "return": "3f1cb8" + }, + "z,odd": { + "seq": [ 0, 15, 1, 12, 11, 8, 16 ], + "return": "200f1cb8" + } +} diff --git a/rlptest.json b/rlptest.json index b443d65a4..ea74c2c9e 100644 --- a/rlptest.json +++ b/rlptest.json @@ -1,54 +1,46 @@ -[ - [ - "cat", - "43636174" - ], - [ - "dog", - "43646f67" - ], - [ - [ "cat", "dog" ], - "824363617443646f67" - ], - [ - [ "dog", "god", "cat" ], - "8343646f6743676f6443636174" - ], - [ - 1, - "01" - ], - [ - 10, - "0a" - ], - [ - 100, - "1864" - ], - [ - 1000, - "1903e8" - ], - [ - 115792089237316195423570985008687907853269984665640564039457584007913129639935, - "37ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ], - [ - 115792089237316195423570985008687907853269984665640564039457584007913129639936, - "3821010000000000000000000000000000000000000000000000000000000000000000" - ], - [ - [ 1, 2, [] ], - "83010280" - ], - [ - [ [ [], [] ], [] ], - "8282808080" - ], - [ - [ "zw", [ 4 ], "wz" ], - "83427a77810442777a" - ] -] +{ + "emptystring": { + "in": "", + "out": "00" + }, + "shortstring": { + "in": "dog", + "out": "43646f67" + }, + "longstring": { + "in": "Lorem ipsum dolor sit amet, consectetur adipisicing elit", + "out": "TODO" + }, + "zero": { + "in": 0, + "out": "80" + }, + "smallint": { + "in": 1, + "out": "01" + }, + "mediumint": { + "in": 1000, + "out": "8203e8" + }, + "bigint": { + "in": 115792089237316195423570985008687907853269984665640564039457584007913129639936, + "out": "3821010000000000000000000000000000000000000000000000000000000000000000" + }, + "emptylist": { + "in": [], + "out": "c0" + }, + "stringlist": { + "in": [ "dog", "god", "cat" ], + "out": "8343646f6743676f6443636174" + }, + "multilist": { + "in": [ "zw", [ 4 ], 1 ], + "out": "TODO" + }, + "listsoflists": { + "in": [ [ [], [] ], [] ], + "out": "c2c2c0c0c0" + } +} diff --git a/trietest.json b/trietest.json index 4a5c5ded5..e741a2012 100644 --- a/trietest.json +++ b/trietest.json @@ -1,5 +1,5 @@ -[ - { +{ + "doprefix": { "inputs": { "doe": "reindeer", "dog": "puppy", @@ -7,7 +7,7 @@ }, "expectation": "d85f9267d7ed5767fb1b48defa8eb20a1c007a87a07588135a74b40b55de2e67" }, - { + "multiprefix": { "inputs":{ "do": "verb", "horse": "stallion", @@ -16,4 +16,4 @@ }, "expectation": "cf7d318935b52db6e23d8c1f5e6b7e62f3606d4ed13783f4fdbd6e67a2085d04" } -] +} From 510ff563639e71224306d9af0e50a28a9d624b8f Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 21 Feb 2014 18:54:08 +0000 Subject: [PATCH 04/11] Updated the tests. --- vmtests.json | 155 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 101 insertions(+), 54 deletions(-) diff --git a/vmtests.json b/vmtests.json index 07f69a671..e344c7af8 100644 --- a/vmtests.json +++ b/vmtests.json @@ -1,56 +1,103 @@ { - "suicide": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", - "feeMultiplier" : 1 - }, - "pre" : { - "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { - "balance" : 1000000000000000000, - "nonce" : 0, - "code" : "(suicide (txsender))" - } - }, - "exec" : [ - { - "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", - "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", - "value" : 1000000000000000000, - "data" : [ - ] - } - ] - }, - - "mktx": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", - "feeMultiplier" : 1 - }, - "pre" : { - "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { - "balance" : 1000000000000000000, - "nonce" : 0, - "code" : "(mktx (txsender) (txvalue) 0)" - } - }, - "exec" : [ - { - "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", - "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", - "value" : 1000000000000000000, - "data" : [ - ] - } - ] - } - + "mktx" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "feeMultiplier" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae" + }, + "exec" : [ + { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "data" : [ + ], + "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 1000000000000000000 + } + ], + "post" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 999999999999999900, + "extroPrice" : 0, + "nonce" : 0, + "store" : { + "0" : [ + 48, + 0, + 18, + 17, + 61, + 0 + ] + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 1000000000000000000, + "extroPrice" : 0, + "nonce" : 0, + "store" : { + "0" : [ + 48, + 0, + 18, + 17, + 61 + ] + } + } + }, + "txs" : [ + { + "data" : [ + ], + "destination" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 1000000000000000000 + } + ] + }, + "suicide" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "feeMultiplier" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae" + }, + "exec" : [ + { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "data" : [ + ], + "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 1000000000000000000 + } + ], + "post" : { + "cd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : 1000000000000000010, + "extroPrice" : 0, + "nonce" : 0 + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 1000000000000000000, + "extroPrice" : 0, + "nonce" : 0, + "store" : { + "0" : [ + 17, + 63 + ] + } + } + }, + "txs" : [ + ] + } } From c006ed4ffd7d00124dbcb44d4e7ca05d6d9ddc12 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 24 Feb 2014 10:24:39 +0000 Subject: [PATCH 05/11] Tests fix. --- vmtests.json | 182 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 177 insertions(+), 5 deletions(-) diff --git a/vmtests.json b/vmtests.json index e344c7af8..a9cbf1786 100644 --- a/vmtests.json +++ b/vmtests.json @@ -1,4 +1,174 @@ { + "fan" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "feeMultiplier" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae" + }, + "exec" : [ + { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "data" : [ + "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + ], + "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 1000000000000000000 + } + ], + "post" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "115792089237316195423570985008687907853269984665640564039456684007913129639415", + "extroPrice" : 0, + "nonce" : 2, + "store" : { + "0" : [ + 48, + 8, + 48, + 100000000000000000, + 18, + 12, + 57, + 0, + 19, + 48, + 100000000000000000, + 18, + 3, + 4, + 48, + "53545048851664692004060005546177757518248266694338929000325674008596820525056", + 55, + 48, + 0, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 55, + 48, + 53, + 19, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 54, + 10, + 15, + 57, + 48, + 0, + 48, + "53545048851664692004060005546177757518248266694338929000325674008596820525056", + 54, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 54, + 20, + 61, + 48, + 1, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 54, + 1, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 55, + 48, + 22, + 56, + 0 + ], + "47492849101242970779199036819969649705442767148016637594308774690745619578880" : [ + 2 + ], + "53545048851664692004060005546177757518248266694338929000325674008596820525056" : [ + 450000000000000000 + ] + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 0, + "extroPrice" : 0, + "nonce" : 0, + "store" : { + "0" : [ + 48, + 8, + 48, + 100000000000000000, + 18, + 12, + 57, + 0, + 19, + 48, + 100000000000000000, + 18, + 3, + 4, + 48, + "53545048851664692004060005546177757518248266694338929000325674008596820525056", + 55, + 48, + 0, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 55, + 48, + 53, + 19, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 54, + 10, + 15, + 57, + 48, + 0, + 48, + "53545048851664692004060005546177757518248266694338929000325674008596820525056", + 54, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 54, + 20, + 61, + 48, + 1, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 54, + 1, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 55, + 48, + 22, + 56 + ] + } + } + }, + "txs" : [ + { + "data" : [ + ], + "destination" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 450000000000000000 + }, + { + "data" : [ + ], + "destination" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "value" : 450000000000000000 + } + ] + }, "mktx" : { "env" : { "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", @@ -19,14 +189,15 @@ ], "post" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { - "balance" : 999999999999999900, + "balance" : 499999999999999900, "extroPrice" : 0, - "nonce" : 0, + "nonce" : 1, "store" : { "0" : [ 48, 0, - 18, + 48, + 500000000000000000, 17, 61, 0 @@ -43,7 +214,8 @@ "0" : [ 48, 0, - 18, + 48, + 500000000000000000, 17, 61 ] @@ -55,7 +227,7 @@ "data" : [ ], "destination" : "cd1722f3947def4cf144679da39c4c32bdc35681", - "value" : 1000000000000000000 + "value" : 500000000000000000 } ] }, From f87ce15ad201a6d97e2654e5dc5a3181873d1719 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 27 Feb 2014 13:28:11 +0000 Subject: [PATCH 06/11] Fix empty string. --- rlptest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rlptest.json b/rlptest.json index ea74c2c9e..86464ff1d 100644 --- a/rlptest.json +++ b/rlptest.json @@ -1,7 +1,7 @@ { "emptystring": { "in": "", - "out": "00" + "out": "80" }, "shortstring": { "in": "dog", From e1f5e12abb38f8cedb4a589b1347fb01c3da902a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 28 Feb 2014 11:22:49 +0000 Subject: [PATCH 07/11] Fix RLP tests. --- rlptest.json | 22 +- vmtests.json | 1070 +++++++++++++++++++++++++++++++++++++------------- 2 files changed, 808 insertions(+), 284 deletions(-) diff --git a/rlptest.json b/rlptest.json index 86464ff1d..a6409558c 100644 --- a/rlptest.json +++ b/rlptest.json @@ -5,11 +5,11 @@ }, "shortstring": { "in": "dog", - "out": "43646f67" + "out": "83646f67" }, "longstring": { "in": "Lorem ipsum dolor sit amet, consectetur adipisicing elit", - "out": "TODO" + "out": "b8384c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e7365637465747572206164697069736963696e6720656c6974" }, "zero": { "in": 0, @@ -23,24 +23,24 @@ "in": 1000, "out": "8203e8" }, - "bigint": { - "in": 115792089237316195423570985008687907853269984665640564039457584007913129639936, - "out": "3821010000000000000000000000000000000000000000000000000000000000000000" - }, - "emptylist": { + "emptylist": { "in": [], "out": "c0" }, "stringlist": { "in": [ "dog", "god", "cat" ], - "out": "8343646f6743676f6443636174" + "out": "cc83646f6783676f6483636174" }, "multilist": { "in": [ "zw", [ 4 ], 1 ], - "out": "TODO" + "out": "c6827a77c10401" }, "listsoflists": { "in": [ [ [], [] ], [] ], - "out": "c2c2c0c0c0" - } + "out": "c4c2c0c0c0" + }, + "xbigint": { + "in": 115792089237316195423570985008687907853269984665640564039457584007913129639936, + "out": "3821010000000000000000000000000000000000000000000000000000000000000000" + } } diff --git a/vmtests.json b/vmtests.json index a9cbf1786..6e9467a11 100644 --- a/vmtests.json +++ b/vmtests.json @@ -1,275 +1,799 @@ { - "fan" : { - "env" : { - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "feeMultiplier" : 1, - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae" - }, - "exec" : [ - { - "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", - "data" : [ - "0xcd1722f3947def4cf144679da39c4c32bdc35681", - "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - ], - "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", - "value" : 1000000000000000000 - } - ], - "post" : { - "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { - "balance" : "115792089237316195423570985008687907853269984665640564039456684007913129639415", - "extroPrice" : 0, - "nonce" : 2, - "store" : { - "0" : [ - 48, - 8, - 48, - 100000000000000000, - 18, - 12, - 57, - 0, - 19, - 48, - 100000000000000000, - 18, - 3, - 4, - 48, - "53545048851664692004060005546177757518248266694338929000325674008596820525056", - 55, - 48, - 0, - 48, - "47492849101242970779199036819969649705442767148016637594308774690745619578880", - 55, - 48, - 53, - 19, - 48, - "47492849101242970779199036819969649705442767148016637594308774690745619578880", - 54, - 10, - 15, - 57, - 48, - 0, - 48, - "53545048851664692004060005546177757518248266694338929000325674008596820525056", - 54, - 48, - "47492849101242970779199036819969649705442767148016637594308774690745619578880", - 54, - 20, - 61, - 48, - 1, - 48, - "47492849101242970779199036819969649705442767148016637594308774690745619578880", - 54, - 1, - 48, - "47492849101242970779199036819969649705442767148016637594308774690745619578880", - 55, - 48, - 22, - 56, - 0 - ], - "47492849101242970779199036819969649705442767148016637594308774690745619578880" : [ - 2 - ], - "53545048851664692004060005546177757518248266694338929000325674008596820525056" : [ - 450000000000000000 - ] - } - } - }, - "pre" : { - "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { - "balance" : 0, - "extroPrice" : 0, - "nonce" : 0, - "store" : { - "0" : [ - 48, - 8, - 48, - 100000000000000000, - 18, - 12, - 57, - 0, - 19, - 48, - 100000000000000000, - 18, - 3, - 4, - 48, - "53545048851664692004060005546177757518248266694338929000325674008596820525056", - 55, - 48, - 0, - 48, - "47492849101242970779199036819969649705442767148016637594308774690745619578880", - 55, - 48, - 53, - 19, - 48, - "47492849101242970779199036819969649705442767148016637594308774690745619578880", - 54, - 10, - 15, - 57, - 48, - 0, - 48, - "53545048851664692004060005546177757518248266694338929000325674008596820525056", - 54, - 48, - "47492849101242970779199036819969649705442767148016637594308774690745619578880", - 54, - 20, - 61, - 48, - 1, - 48, - "47492849101242970779199036819969649705442767148016637594308774690745619578880", - 54, - 1, - 48, - "47492849101242970779199036819969649705442767148016637594308774690745619578880", - 55, - 48, - 22, - 56 - ] - } - } - }, - "txs" : [ - { - "data" : [ - ], - "destination" : "cd1722f3947def4cf144679da39c4c32bdc35681", - "value" : 450000000000000000 - }, - { - "data" : [ - ], - "destination" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", - "value" : 450000000000000000 - } - ] - }, - "mktx" : { - "env" : { - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "feeMultiplier" : 1, - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae" - }, - "exec" : [ - { - "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", - "data" : [ - ], - "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", - "value" : 1000000000000000000 - } - ], - "post" : { - "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { - "balance" : 499999999999999900, - "extroPrice" : 0, - "nonce" : 1, - "store" : { - "0" : [ - 48, - 0, - 48, - 500000000000000000, - 17, - 61, - 0 - ] - } - } - }, - "pre" : { - "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { - "balance" : 1000000000000000000, - "extroPrice" : 0, - "nonce" : 0, - "store" : { - "0" : [ - 48, - 0, - 48, - 500000000000000000, - 17, - 61 - ] - } - } - }, - "txs" : [ - { - "data" : [ - ], - "destination" : "cd1722f3947def4cf144679da39c4c32bdc35681", - "value" : 500000000000000000 - } - ] - }, - "suicide" : { - "env" : { - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "feeMultiplier" : 1, - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae" - }, - "exec" : [ - { - "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", - "data" : [ - ], - "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", - "value" : 1000000000000000000 - } - ], - "post" : { - "cd1722f3947def4cf144679da39c4c32bdc35681" : { - "balance" : 1000000000000000010, - "extroPrice" : 0, - "nonce" : 0 - } - }, - "pre" : { - "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { - "balance" : 1000000000000000000, - "extroPrice" : 0, - "nonce" : 0, - "store" : { - "0" : [ - 17, - 63 - ] - } - } - }, - "txs" : [ - ] - } + "arith" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "feeMultiplier" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae" + }, + "exec" : [ + { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "data" : [ + ], + "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 1000000000000000000 + } + ], + "post" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 999999999999999810, + "extroPrice" : 0, + "nonce" : 1, + "store" : { + "0" : [ + 48, + 0, + 48, + 2, + 48, + 2, + 1, + 48, + 4, + 48, + 4, + 2, + 48, + 4, + 2, + 1, + 48, + 2, + 48, + 2, + 4, + 1, + 48, + 3, + 48, + 2, + 6, + 1, + 48, + 8, + 48, + 2, + 3, + 48, + 2, + 3, + 1, + 17, + 61, + 0 + ] + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 1000000000000000000, + "extroPrice" : 0, + "nonce" : 0, + "store" : { + "0" : [ + 48, + 0, + 48, + 2, + 48, + 2, + 1, + 48, + 4, + 48, + 4, + 2, + 48, + 4, + 2, + 1, + 48, + 2, + 48, + 2, + 4, + 1, + 48, + 3, + 48, + 2, + 6, + 1, + 48, + 8, + 48, + 2, + 3, + 48, + 2, + 3, + 1, + 17, + 61 + ] + } + } + }, + "txs" : [ + { + "data" : [ + ], + "destination" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 79 + } + ] + }, + "boolean" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "feeMultiplier" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae" + }, + "exec" : [ + { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "data" : [ + ], + "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 1000000000000000000 + } + ], + "post" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 999999999999999490, + "extroPrice" : 0, + "nonce" : 4, + "store" : { + "0" : [ + 48, + 21, + 48, + 0, + 48, + 13, + 48, + 1, + 15, + 57, + 49, + 48, + 1, + 15, + 57, + 48, + 0, + 48, + 2, + 17, + 61, + 48, + 42, + 48, + 0, + 48, + 34, + 48, + 1, + 15, + 57, + 49, + 48, + 0, + 15, + 57, + 48, + 0, + 48, + 3, + 17, + 61, + 48, + 63, + 48, + 0, + 48, + 55, + 48, + 0, + 15, + 57, + 49, + 48, + 1, + 15, + 57, + 48, + 0, + 48, + 4, + 17, + 61, + 48, + 84, + 48, + 0, + 48, + 76, + 48, + 0, + 15, + 57, + 49, + 48, + 0, + 15, + 57, + 48, + 0, + 48, + 5, + 17, + 61, + 48, + 104, + 48, + 1, + 48, + 96, + 48, + 1, + 57, + 49, + 48, + 1, + 15, + 57, + 48, + 0, + 48, + 12, + 17, + 61, + 48, + 124, + 48, + 1, + 48, + 116, + 48, + 1, + 57, + 49, + 48, + 0, + 15, + 57, + 48, + 0, + 48, + 13, + 17, + 61, + 48, + 144, + 48, + 1, + 48, + 136, + 48, + 0, + 57, + 49, + 48, + 1, + 15, + 57, + 48, + 0, + 48, + 14, + 17, + 61, + 48, + 164, + 48, + 1, + 48, + 156, + 48, + 0, + 57, + 49, + 48, + 0, + 15, + 57, + 48, + 0, + 48, + 15, + 17, + 61, + 0 + ] + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 1000000000000000000, + "extroPrice" : 0, + "nonce" : 0, + "store" : { + "0" : [ + 48, + 21, + 48, + 0, + 48, + 13, + 48, + 1, + 15, + 57, + 49, + 48, + 1, + 15, + 57, + 48, + 0, + 48, + 2, + 17, + 61, + 48, + 42, + 48, + 0, + 48, + 34, + 48, + 1, + 15, + 57, + 49, + 48, + 0, + 15, + 57, + 48, + 0, + 48, + 3, + 17, + 61, + 48, + 63, + 48, + 0, + 48, + 55, + 48, + 0, + 15, + 57, + 49, + 48, + 1, + 15, + 57, + 48, + 0, + 48, + 4, + 17, + 61, + 48, + 84, + 48, + 0, + 48, + 76, + 48, + 0, + 15, + 57, + 49, + 48, + 0, + 15, + 57, + 48, + 0, + 48, + 5, + 17, + 61, + 48, + 104, + 48, + 1, + 48, + 96, + 48, + 1, + 57, + 49, + 48, + 1, + 15, + 57, + 48, + 0, + 48, + 12, + 17, + 61, + 48, + 124, + 48, + 1, + 48, + 116, + 48, + 1, + 57, + 49, + 48, + 0, + 15, + 57, + 48, + 0, + 48, + 13, + 17, + 61, + 48, + 144, + 48, + 1, + 48, + 136, + 48, + 0, + 57, + 49, + 48, + 1, + 15, + 57, + 48, + 0, + 48, + 14, + 17, + 61, + 48, + 164, + 48, + 1, + 48, + 156, + 48, + 0, + 57, + 49, + 48, + 0, + 15, + 57, + 48, + 0, + 48, + 15, + 17, + 61 + ] + } + } + }, + "txs" : [ + { + "data" : [ + ], + "destination" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 2 + }, + { + "data" : [ + ], + "destination" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 12 + }, + { + "data" : [ + ], + "destination" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 13 + }, + { + "data" : [ + ], + "destination" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 14 + } + ] + }, + "fan" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "feeMultiplier" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae" + }, + "exec" : [ + { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "data" : [ + "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + ], + "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 1000000000000000000 + } + ], + "post" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "115792089237316195423570985008687907853269984665640564039456684007913129639415", + "extroPrice" : 0, + "nonce" : 2, + "store" : { + "0" : [ + 48, + 8, + 48, + 100000000000000000, + 18, + 12, + 57, + 0, + 19, + 48, + 100000000000000000, + 18, + 3, + 4, + 48, + "53545048851664692004060005546177757518248266694338929000325674008596820525056", + 55, + 48, + 0, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 55, + 48, + 53, + 19, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 54, + 10, + 15, + 57, + 48, + 0, + 48, + "53545048851664692004060005546177757518248266694338929000325674008596820525056", + 54, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 54, + 20, + 61, + 48, + 1, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 54, + 1, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 55, + 48, + 22, + 56, + 0 + ], + "47492849101242970779199036819969649705442767148016637594308774690745619578880" : [ + 2 + ], + "53545048851664692004060005546177757518248266694338929000325674008596820525056" : [ + 450000000000000000 + ] + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 0, + "extroPrice" : 0, + "nonce" : 0, + "store" : { + "0" : [ + 48, + 8, + 48, + 100000000000000000, + 18, + 12, + 57, + 0, + 19, + 48, + 100000000000000000, + 18, + 3, + 4, + 48, + "53545048851664692004060005546177757518248266694338929000325674008596820525056", + 55, + 48, + 0, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 55, + 48, + 53, + 19, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 54, + 10, + 15, + 57, + 48, + 0, + 48, + "53545048851664692004060005546177757518248266694338929000325674008596820525056", + 54, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 54, + 20, + 61, + 48, + 1, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 54, + 1, + 48, + "47492849101242970779199036819969649705442767148016637594308774690745619578880", + 55, + 48, + 22, + 56 + ] + } + } + }, + "txs" : [ + { + "data" : [ + ], + "destination" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 450000000000000000 + }, + { + "data" : [ + ], + "destination" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "value" : 450000000000000000 + } + ] + }, + "mktx" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "feeMultiplier" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae" + }, + "exec" : [ + { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "data" : [ + ], + "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 1000000000000000000 + } + ], + "post" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 499999999999999900, + "extroPrice" : 0, + "nonce" : 1, + "store" : { + "0" : [ + 48, + 0, + 48, + 500000000000000000, + 17, + 61, + 0 + ] + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 1000000000000000000, + "extroPrice" : 0, + "nonce" : 0, + "store" : { + "0" : [ + 48, + 0, + 48, + 500000000000000000, + 17, + 61 + ] + } + } + }, + "txs" : [ + { + "data" : [ + ], + "destination" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 500000000000000000 + } + ] + }, + "suicide" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "feeMultiplier" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae" + }, + "exec" : [ + { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "data" : [ + ], + "sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : 1000000000000000000 + } + ], + "post" : { + "cd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : 1000000000000000010, + "extroPrice" : 0, + "nonce" : 0 + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : 1000000000000000000, + "extroPrice" : 0, + "nonce" : 0, + "store" : { + "0" : [ + 17, + 63 + ] + } + } + }, + "txs" : [ + ] + } } From 33f80fef211c2d51162c1856e50448be3d90c214 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 28 Feb 2014 11:39:35 +0000 Subject: [PATCH 08/11] Hex encode tests done. --- hexencodetest.json | 92 ++++++++++++++++++++++++++++++---------------- 1 file changed, 60 insertions(+), 32 deletions(-) diff --git a/hexencodetest.json b/hexencodetest.json index 6fe7891c3..26c5bc7ed 100644 --- a/hexencodetest.json +++ b/hexencodetest.json @@ -1,34 +1,62 @@ { - "nz,odd": { - "seq": [ 1, 2, 3, 4, 5 ], - "return": "112345" - }, - "z,even": { - "seq": [ 0, 1, 2, 3, 4, 5 ], - "return": "00012345" - }, - "long": { - "seq": [ 6, 4, 6, 15, 6, 7, 6, 5, 16 ], - "return": "20646f6765" - }, - "short": { - "seq": [ 7, 6, 5, 16 ], - "return": "3765" - }, - "nz,one": { - "seq": [ 16 ], - "return": "20" - }, - "z,two": { - "seq": [ 0, 16 ], - "return": "30" - }, - "nz,even": { - "seq": [ 15, 1, 12, 11, 8, 16 ], - "return": "3f1cb8" - }, - "z,odd": { - "seq": [ 0, 15, 1, 12, 11, 8, 16 ], - "return": "200f1cb8" - } + "zz,odd,open": { + "seq": [ 0, 0, 1, 2, 3, 4, 5 ], + "term": false, + "out": "10012345" + }, + "z,even,open": { + "seq": [ 0, 1, 2, 3, 4, 5 ], + "term": false, + "out": "00012345" + }, + "nz,odd,open": { + "seq": [ 1, 2, 3, 4, 5 ], + "term": false, + "out": "112345" + }, + "zz,even,open": { + "seq": [ 0, 0, 1, 2, 3, 4 ], + "term": false, + "out": "00001234" + }, + "z,odd,open": { + "seq": [ 0, 1, 2, 3, 4 ], + "term": false, + "out": "101234" + }, + "nz,even,open": { + "seq": [ 1, 2, 3, 4 ], + "term": false, + "out": "001234" + }, + "zz,odd,term": { + "seq": [ 0, 0, 1, 2, 3, 4, 5 ], + "term": true, + "out": "30012345" + }, + "z,even,term": { + "seq": [ 0, 1, 2, 3, 4, 5 ], + "term": true, + "out": "20012345" + }, + "nz,odd,term": { + "seq": [ 1, 2, 3, 4, 5 ], + "term": true, + "out": "312345" + }, + "zz,even,term": { + "seq": [ 0, 0, 1, 2, 3, 4 ], + "term": true, + "out": "20001234" + }, + "z,odd,term": { + "seq": [ 0, 1, 2, 3, 4 ], + "term": true, + "out": "301234" + }, + "nz,even,term": { + "seq": [ 1, 2, 3, 4 ], + "term": true, + "out": "201234" + } } From 15dd8fd794a0dc305ef7696d0c2a68e032bc9759 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 28 Feb 2014 12:54:47 +0000 Subject: [PATCH 09/11] RLP tests and Trie updates. --- rlptest.json | 6 ++--- trietest.json | 62 +++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/rlptest.json b/rlptest.json index a6409558c..e96447199 100644 --- a/rlptest.json +++ b/rlptest.json @@ -39,8 +39,8 @@ "in": [ [ [], [] ], [] ], "out": "c4c2c0c0c0" }, - "xbigint": { - "in": 115792089237316195423570985008687907853269984665640564039457584007913129639936, - "out": "3821010000000000000000000000000000000000000000000000000000000000000000" + "bigint": { + "in": "#115792089237316195423570985008687907853269984665640564039457584007913129639936", + "out": "a1010000000000000000000000000000000000000000000000000000000000000000" } } diff --git a/trietest.json b/trietest.json index e741a2012..4b2327e88 100644 --- a/trietest.json +++ b/trietest.json @@ -1,19 +1,47 @@ { - "doprefix": { - "inputs": { - "doe": "reindeer", - "dog": "puppy", - "dogglesworth": "cat" - }, - "expectation": "d85f9267d7ed5767fb1b48defa8eb20a1c007a87a07588135a74b40b55de2e67" - }, - "multiprefix": { - "inputs":{ - "do": "verb", - "horse": "stallion", - "doge": "coin", - "dog": "puppy" - }, - "expectation": "cf7d318935b52db6e23d8c1f5e6b7e62f3606d4ed13783f4fdbd6e67a2085d04" - } + "basic": { + "in": { + "a": "A", + "b": "B" + }, + "root": "300eab197a9d9e437aaeb9b0d7bd77d57e8d4e3eeca0b1e6a3fe28a84e2cd70c" + }, + "basic1": { + "in": { + "test": "test" + }, + "root": "85d106d4edff3b7a4889e91251d0a87d7c17a1dda648ebdba8c6060825be23b8" + }, + "basic2": { + "in": { + "test": "test", + "te": "testy" + }, + "root": "8452568af70d8d140f58d941338542f645fcca50094b20f3c3d8c3df49337928" + }, + "beprefix": { + "in": { + "be": "e", + "bed": "d", + "dog": "puppy" + }, + "root": "3f67c7a47520f79faa29255d2d3c084a7a6df0453116ed7232ff10277a8be68b" + }, + "doprefix": { + "in": { + "doe": "reindeer", + "dog": "puppy", + "dogglesworth": "cat" + }, + "root": "8aad789dff2f538bca5d8ea56e8abe10f4c7ba3a5dea95fea4cd6e7c3a1168d3" + }, + "multiprefix": { + "in": { + "do": "verb", + "horse": "stallion", + "doge": "coin", + "dog": "puppy" + }, + "root": "5991bb8c6514148a29db676a14ac506cd2cd5775ace63c30a4fe457715e9ac84" + } } From 4ba150954ef8ac72416a35f06fdad9c6d7ed461d Mon Sep 17 00:00:00 2001 From: Carl Allendorph Date: Sat, 19 Apr 2014 12:48:42 -0700 Subject: [PATCH 10/11] Converted spaces to tabs to be compliant with the coding standards defined in cpp-ethereum --- rlptest.json | 64 ++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/rlptest.json b/rlptest.json index e96447199..41cd64adb 100644 --- a/rlptest.json +++ b/rlptest.json @@ -1,42 +1,42 @@ { - "emptystring": { - "in": "", - "out": "80" - }, - "shortstring": { - "in": "dog", + "emptystring": { + "in": "", + "out": "80" + }, + "shortstring": { + "in": "dog", "out": "83646f67" - }, - "longstring": { - "in": "Lorem ipsum dolor sit amet, consectetur adipisicing elit", + }, + "longstring": { + "in": "Lorem ipsum dolor sit amet, consectetur adipisicing elit", "out": "b8384c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e7365637465747572206164697069736963696e6720656c6974" - }, - "zero": { - "in": 0, - "out": "80" - }, - "smallint": { - "in": 1, - "out": "01" - }, - "mediumint": { - "in": 1000, - "out": "8203e8" - }, + }, + "zero": { + "in": 0, + "out": "80" + }, + "smallint": { + "in": 1, + "out": "01" + }, + "mediumint": { + "in": 1000, + "out": "8203e8" + }, "emptylist": { - "in": [], - "out": "c0" - }, - "stringlist": { - "in": [ "dog", "god", "cat" ], + "in": [], + "out": "c0" + }, + "stringlist": { + "in": [ "dog", "god", "cat" ], "out": "cc83646f6783676f6483636174" }, - "multilist": { - "in": [ "zw", [ 4 ], 1 ], + "multilist": { + "in": [ "zw", [ 4 ], 1 ], "out": "c6827a77c10401" - }, - "listsoflists": { - "in": [ [ [], [] ], [] ], + }, + "listsoflists": { + "in": [ [ [], [] ], [] ], "out": "c4c2c0c0c0" }, "bigint": { From 5fd2a98fcb4f6a648160204d1b20b0f980d55b9d Mon Sep 17 00:00:00 2001 From: Carl Allendorph Date: Sat, 19 Apr 2014 13:26:14 -0700 Subject: [PATCH 11/11] Added some new test cases for the rlp encoding. --- rlptest.json | 110 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 105 insertions(+), 5 deletions(-) diff --git a/rlptest.json b/rlptest.json index 41cd64adb..19adbb8e2 100644 --- a/rlptest.json +++ b/rlptest.json @@ -6,11 +6,19 @@ "shortstring": { "in": "dog", "out": "83646f67" + }, + "shortstring2": { + "in": "Lorem ipsum dolor sit amet, consectetur adipisicing eli", + "out": "b74c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e7365637465747572206164697069736963696e6720656c69" }, "longstring": { "in": "Lorem ipsum dolor sit amet, consectetur adipisicing elit", "out": "b8384c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e7365637465747572206164697069736963696e6720656c6974" }, + "longstring2": { + "in": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur mauris magna, suscipit sed vehicula non, iaculis faucibus tortor. Proin suscipit ultricies malesuada. Duis tortor elit, dictum quis tristique eu, ultrices at risus. Morbi a est imperdiet mi ullamcorper aliquet suscipit nec lorem. Aenean quis leo mollis, vulputate elit varius, consequat enim. Nulla ultrices turpis justo, et posuere urna consectetur nec. Proin non convallis metus. Donec tempor ipsum in mauris congue sollicitudin. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse convallis sem vel massa faucibus, eget lacinia lacus tempor. Nulla quis ultricies purus. Proin auctor rhoncus nibh condimentum mollis. Aliquam consequat enim at metus luctus, a eleifend purus egestas. Curabitur at nibh metus. Nam bibendum, neque at auctor tristique, lorem libero aliquet arcu, non interdum tellus lectus sit amet eros. Cras rhoncus, metus ac ornare cursus, dolor justo ultrices metus, at ullamcorper volutpat", + "out": "b904004c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742e20437572616269747572206d6175726973206d61676e612c20737573636970697420736564207665686963756c61206e6f6e2c20696163756c697320666175636962757320746f72746f722e2050726f696e20737573636970697420756c74726963696573206d616c6573756164612e204475697320746f72746f7220656c69742c2064696374756d2071756973207472697374697175652065752c20756c7472696365732061742072697375732e204d6f72626920612065737420696d70657264696574206d6920756c6c616d636f7270657220616c6971756574207375736369706974206e6563206c6f72656d2e2041656e65616e2071756973206c656f206d6f6c6c69732c2076756c70757461746520656c6974207661726975732c20636f6e73657175617420656e696d2e204e756c6c6120756c74726963657320747572706973206a7573746f2c20657420706f73756572652075726e6120636f6e7365637465747572206e65632e2050726f696e206e6f6e20636f6e76616c6c6973206d657475732e20446f6e65632074656d706f7220697073756d20696e206d617572697320636f6e67756520736f6c6c696369747564696e2e20566573746962756c756d20616e746520697073756d207072696d697320696e206661756369627573206f726369206c756374757320657420756c74726963657320706f737565726520637562696c69612043757261653b2053757370656e646973736520636f6e76616c6c69732073656d2076656c206d617373612066617563696275732c2065676574206c6163696e6961206c616375732074656d706f722e204e756c6c61207175697320756c747269636965732070757275732e2050726f696e20617563746f722072686f6e637573206e69626820636f6e64696d656e74756d206d6f6c6c69732e20416c697175616d20636f6e73657175617420656e696d206174206d65747573206c75637475732c206120656c656966656e6420707572757320656765737461732e20437572616269747572206174206e696268206d657475732e204e616d20626962656e64756d2c206e6571756520617420617563746f72207472697374697175652c206c6f72656d206c696265726f20616c697175657420617263752c206e6f6e20696e74657264756d2074656c6c7573206c65637475732073697420616d65742065726f732e20437261732072686f6e6375732c206d65747573206163206f726e617265206375727375732c20646f6c6f72206a7573746f20756c747269636573206d657475732c20617420756c6c616d636f7270657220766f6c7574706174" + }, "zero": { "in": 0, "out": "80" @@ -19,26 +27,118 @@ "in": 1, "out": "01" }, - "mediumint": { - "in": 1000, - "out": "8203e8" + "smallint2": { + "in": 16, + "out": "10" + }, + "smallint3": { + "in": 79, + "out": "4f" + }, + "smallint4": { + "in": 127, + "out": "7f" + }, + "mediumint1": { + "in": 128, + "out": "8180" + }, + "mediumint2": { + "in": 1000, + "out": "8203e8" + }, + "mediumint3": { + "in": 100000, + "out": "830186a0" + }, + "mediumint4": { + "in": "#83729609699884896815286331701780722", + "out": "8F102030405060708090A0B0C0D0E0F2" + }, + "mediumint5": { + "in": "#105315505618206987246253880190783558935785933862974822347068935681", + "out": "9C0100020003000400050006000700080009000A000B000C000D000E01" }, "emptylist": { "in": [], - "out": "c0" + "out": "c0" }, "stringlist": { "in": [ "dog", "god", "cat" ], "out": "cc83646f6783676f6483636174" - }, + }, "multilist": { "in": [ "zw", [ 4 ], 1 ], "out": "c6827a77c10401" }, + "shortListMax1": { + "in": [ "asdf", "qwer", "zxcv", "asdf","qwer", "zxcv", "asdf", "qwer", "zxcv", "asdf", "qwer"], + "out": "F784617364668471776572847a78637684617364668471776572847a78637684617364668471776572847a78637684617364668471776572" + }, + "longList1" : { + "in" : [ + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"] + ], + "out": "F840CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376" + }, + "longList2" : { + "in" : [ + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"], + ["asdf","qwer","zxcv"] + ], + "out": "F90200CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376" + }, + "listsoflists": { "in": [ [ [], [] ], [] ], "out": "c4c2c0c0c0" }, + "listsoflists2": { + "in": [ [], [[]], [ [], [[]] ] ], + "out": "c7c0c1c0c3c0c1c0" + }, + "dictTest1" : { + "in" : [ + ["key1", "val1"], + ["key2", "val2"], + ["key3", "val3"], + ["key4", "val4"] + ], + "out" : "ECCA846b6579318476616c31CA846b6579328476616c32CA846b6579338476616c33CA846b6579348476616c34" + }, "bigint": { "in": "#115792089237316195423570985008687907853269984665640564039457584007913129639936", "out": "a1010000000000000000000000000000000000000000000000000000000000000000"