From adf244188d10f93e8dffc2c1f6bf8350800b5974 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Thu, 30 Apr 2015 17:34:06 +0200 Subject: [PATCH] add wallet test --- .../StateTestsFiller/stWalletTestFiller.json | 59 +++++++++++++++++++ test/libethereum/state.cpp | 4 ++ 2 files changed, 63 insertions(+) create mode 100644 test/libethereum/StateTestsFiller/stWalletTestFiller.json diff --git a/test/libethereum/StateTestsFiller/stWalletTestFiller.json b/test/libethereum/StateTestsFiller/stWalletTestFiller.json new file mode 100644 index 000000000..4472a9120 --- /dev/null +++ b/test/libethereum/StateTestsFiller/stWalletTestFiller.json @@ -0,0 +1,59 @@ +{ + "multiOwnedConstructionNotEnoughGas" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "0x5b600160006000508190555060016001600050819055503360026000506001600050546101008110602c57005b90900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff0219169083021790555060016000505461010260005060003373ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055505b6109cd806100a16000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063173825d91461005b5780632f54bf6e1461006c5780637065cb4814610081578063ba51a6df14610092578063f00d4b5d146100a357005b6100666004356103a1565b60006000f35b610077600435610538565b8060005260206000f35b61008c600435610250565b60006000f35b61009d6004356104d1565b60006000f35b6100b16004356024356100b7565b60006000f35b60006040600036808284378201915050604090036040206100d78161057a565b6100e057610249565b61010260005060008573ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000505491506000821461012057610126565b5061024b565b61012f83610538565b6101385761013e565b5061024b565b82600260005083610100811061015057005b90900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690830217905550600061010260005060008673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055508161010260005060008573ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055507fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60408573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff168152602001604090036040a15b505b505050565b60406000368082843782019150506040900360402061026e8161057a565b6102775761039c565b61028082610538565b6102895761028f565b5061039e565b60fa60016000505410156102a2576102ac565b6102aa610714565b505b60fa60016000505410156102bf576102c5565b5061039e565b600160008181505480929190600101919050555081600260005060016000505461010081106102f057005b90900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff0219169083021790555060016000505461010260005060008473ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c360408373ffffffffffffffffffffffffffffffffffffffff168152602001604090036040a15b505b50565b60006040600036808284378201915050604090036040206103c18161057a565b6103ca576104cb565b61010260005060008473ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000505491506000821461040a57610410565b506104cd565b6000600260005083610100811061042357005b90900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690830217905550600061010260005060008573ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055507f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da60408473ffffffffffffffffffffffffffffffffffffffff168152602001604090036040a15b505b5050565b6040600036808284378201915050604090036040206104ef8161057a565b6104f857610533565b816000600050819055507facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da6040838152602001604090036040a15b505b50565b6000600061010260005060008473ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060005054119050610575565b919050565b6000600060006000600061010260005060003373ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050549350600084146105c4576105c9565b61070b565b6101036000506000878152602001908152602001600020600092509250600083835060000160005054146105fc5761061f565b600060005054838350600001600050819055506000838350600101600050819055505b8360020a905060008184845060010160005054161461063d5761070a565b7fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda60403373ffffffffffffffffffffffffffffffffffffffff168152602001878152602001604090036040a160018383506000016000505411156106cf578282506000016000818150548092919060019003919050555080838350600101600082828250541792505081905550610709565b610103600050600087815260200190815260200160002060006000820160005060009055600182016000506000905550506001945061070b565b5b5b50505050919050565b60006000600190505b6001600050548110156109c8575b6001600050548110801561078a57506000600260005082610100811061074d57005b90900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1561079c57808060010191505061072b565b5b600160016000505411801561080157506000600260005060016000505461010081106107c557005b90900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156108205760016000818150548092919060019003919050555061079d565b60016000505481108015610884575060006002600050600160005054610100811061084757005b90900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b80156108da57506000600260005082610100811061089e57005b90900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6108e3576109c3565b600260005060016000505461010081106108f957005b90900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260005082610100811061092e57005b90900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690830217905550806101026000506000600260005084610100811061097357005b90900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055505b61071d565b5b509056", + "gasLimit" : "0x041a8f", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "", + "value" : "0" + } + }, + + "multiOwnedConstruction2" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "10000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "0x5b600160006000508190555060016001600050819055503360026000506001600050546101008110602c57005b90900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff0219169083021790555060016000505461010260005060003373ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055505b6109cd806100a16000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063173825d91461005b5780632f54bf6e1461006c5780637065cb4814610081578063ba51a6df14610092578063f00d4b5d146100a357005b6100666004356103a1565b60006000f35b610077600435610538565b8060005260206000f35b61008c600435610250565b60006000f35b61009d6004356104d1565b60006000f35b6100b16004356024356100b7565b60006000f35b60006040600036808284378201915050604090036040206100d78161057a565b6100e057610249565b61010260005060008573ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000505491506000821461012057610126565b5061024b565b61012f83610538565b6101385761013e565b5061024b565b82600260005083610100811061015057005b90900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690830217905550600061010260005060008673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055508161010260005060008573ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055507fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60408573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff168152602001604090036040a15b505b505050565b60406000368082843782019150506040900360402061026e8161057a565b6102775761039c565b61028082610538565b6102895761028f565b5061039e565b60fa60016000505410156102a2576102ac565b6102aa610714565b505b60fa60016000505410156102bf576102c5565b5061039e565b600160008181505480929190600101919050555081600260005060016000505461010081106102f057005b90900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff0219169083021790555060016000505461010260005060008473ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c360408373ffffffffffffffffffffffffffffffffffffffff168152602001604090036040a15b505b50565b60006040600036808284378201915050604090036040206103c18161057a565b6103ca576104cb565b61010260005060008473ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000505491506000821461040a57610410565b506104cd565b6000600260005083610100811061042357005b90900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690830217905550600061010260005060008573ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055507f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da60408473ffffffffffffffffffffffffffffffffffffffff168152602001604090036040a15b505b5050565b6040600036808284378201915050604090036040206104ef8161057a565b6104f857610533565b816000600050819055507facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da6040838152602001604090036040a15b505b50565b6000600061010260005060008473ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060005054119050610575565b919050565b6000600060006000600061010260005060003373ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050549350600084146105c4576105c9565b61070b565b6101036000506000878152602001908152602001600020600092509250600083835060000160005054146105fc5761061f565b600060005054838350600001600050819055506000838350600101600050819055505b8360020a905060008184845060010160005054161461063d5761070a565b7fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda60403373ffffffffffffffffffffffffffffffffffffffff168152602001878152602001604090036040a160018383506000016000505411156106cf578282506000016000818150548092919060019003919050555080838350600101600082828250541792505081905550610709565b610103600050600087815260200190815260200160002060006000820160005060009055600182016000506000905550506001945061070b565b5b5b50505050919050565b60006000600190505b6001600050548110156109c8575b6001600050548110801561078a57506000600260005082610100811061074d57005b90900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1561079c57808060010191505061072b565b5b600160016000505411801561080157506000600260005060016000505461010081106107c557005b90900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156108205760016000818150548092919060019003919050555061079d565b60016000505481108015610884575060006002600050600160005054610100811061084757005b90900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b80156108da57506000600260005082610100811061089e57005b90900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6108e3576109c3565b600260005060016000505461010081106108f957005b90900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260005082610100811061092e57005b90900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690830217905550806101026000506000600260005084610100811061097357005b90900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055505b61071d565b5b509056", + "gasLimit" : "0x0bc2b7", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "", + "value" : "100" + } + } +} diff --git a/test/libethereum/state.cpp b/test/libethereum/state.cpp index 900f3060f..f89972383 100644 --- a/test/libethereum/state.cpp +++ b/test/libethereum/state.cpp @@ -183,6 +183,10 @@ BOOST_AUTO_TEST_CASE(stMemoryTest) dev::test::executeTests("stMemoryTest", "/StateTests",dev::test::getFolder(__FILE__) + "/StateTestsFiller", dev::test::doStateTests); } +BOOST_AUTO_TEST_CASE(stWalletTest) +{ + dev::test::executeTests("stWalletTest", "/StateTests",dev::test::getFolder(__FILE__) + "/StateTestsFiller", dev::test::doStateTests); +} BOOST_AUTO_TEST_CASE(stCreateTest) {