From a90c45a3ee4c937bac25b9dd4aace1160b9c3cc8 Mon Sep 17 00:00:00 2001 From: winsvega Date: Thu, 16 Apr 2015 16:32:15 +0300 Subject: [PATCH 01/22] RLP length with first zeros --- libdevcore/RLP.cpp | 4 ++-- libdevcore/RLP.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libdevcore/RLP.cpp b/libdevcore/RLP.cpp index 994aac265..2a1c34030 100644 --- a/libdevcore/RLP.cpp +++ b/libdevcore/RLP.cpp @@ -149,7 +149,7 @@ unsigned RLP::length() const return n - c_rlpDataImmLenStart; else if (n < c_rlpListStart) { - if ((int)m_data.size() <= n - c_rlpDataIndLenZero) + if ((int)m_data.size() <= n - c_rlpDataIndLenZero || m_data[1] == 0) BOOST_THROW_EXCEPTION(BadRLP()); for (int i = 0; i < n - c_rlpDataIndLenZero; ++i) ret = (ret << 8) | m_data[i + 1]; @@ -158,7 +158,7 @@ unsigned RLP::length() const return n - c_rlpListStart; else { - if ((int)m_data.size() <= n - c_rlpListIndLenZero) + if ((int)m_data.size() <= n - c_rlpListIndLenZero || m_data[1] == 0) BOOST_THROW_EXCEPTION(BadRLP()); for (int i = 0; i < n - c_rlpListIndLenZero; ++i) ret = (ret << 8) | m_data[i + 1]; diff --git a/libdevcore/RLP.h b/libdevcore/RLP.h index caaf10b6a..7e765d395 100644 --- a/libdevcore/RLP.h +++ b/libdevcore/RLP.h @@ -303,7 +303,7 @@ private: /// Single-byte data payload. bool isSingleByte() const { return !isNull() && m_data[0] < c_rlpDataImmLenStart; } - /// @returns the bytes used to encode the length of the data. Valid for all types. + /// @returns the amount of bytes used to encode the length of the data. Valid for all types. unsigned lengthSize() const { if (isData() && m_data[0] > c_rlpDataIndLenZero) return m_data[0] - c_rlpDataIndLenZero; if (isList() && m_data[0] > c_rlpListIndLenZero) return m_data[0] - c_rlpListIndLenZero; return 0; } /// @returns the size in bytes of the payload, as given by the RLP as opposed to as inferred from m_data. From 989891d775dc7eacba641224190629fcb41be1e0 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 17 Apr 2015 12:17:51 +0200 Subject: [PATCH 02/22] add JSON test Conflicts: test/bcJS_API_TestFiller.json --- test/JSON_test.sol | 131 ++++++ test/bcJS_API_TestFiller.json | 247 ----------- test/bcRPC_API_TestFiller.json | 744 +++++++++++++++++++++++++++++++++ test/blockchain.cpp | 4 +- 4 files changed, 877 insertions(+), 249 deletions(-) create mode 100644 test/JSON_test.sol delete mode 100644 test/bcJS_API_TestFiller.json create mode 100644 test/bcRPC_API_TestFiller.json diff --git a/test/JSON_test.sol b/test/JSON_test.sol new file mode 100644 index 000000000..91d8734b3 --- /dev/null +++ b/test/JSON_test.sol @@ -0,0 +1,131 @@ + contract JSON_Test { + event Log0(uint value); + event Log0Anonym (uint value) anonymous; + event Log1(bool indexed aBool, uint value); + event Log1Anonym(bool indexed aBool, uint value) anonymous; + event Log2(bool indexed aBool, address indexed aAddress, uint value); + event Log2Anonym(bool indexed aBool, address indexed aAddress, uint value) anonymous; + event Log3(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, uint value); + event Log3Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, uint value) anonymous; + event Log4(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value); + event Log4Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value) anonymous; + + function JSON_Test() { + + } + + function setBool(bool _bool) { + myBool = _bool; + } + + function setInt8(int8 _int8) { + myInt8 = _int8; + } + + function setUint8(uint8 _uint8) { + myUint8 = _uint8; + } + + function setInt256(int256 _int256) { + myInt256 = _int256; + } + + function setUint256(uint256 _uint256) { + myUint256 = _uint256; + } + + function setAddress(address _address) { + myAddress = _address; + } + + //function setBytes0(bytes0 _bytes0) { + // myBytes0 = _bytes0; + //} + + function setBytes32(bytes32 _bytes32) { + myBytes32 = _bytes32; + } + + function getBool() returns (bool ret) { + return myBool; + } + + function getInt8() returns (int8 ret) { + return myInt8; + } + + function getUint8() returns (uint8 ret) { + return myUint8; + } + + function getInt256() returns (int256 ret) { + return myInt256; + } + + function getUint256() returns (uint256 ret) { + return myUint256; + } + + function getAddress() returns (address ret) { + return myAddress; + } + + //function getBytes0() returns (bytes0 ret) { + // return myBytes0; + //} + + function getBytes32() returns (bytes32 ret) { + return myBytes32; + } + + function fireEventLog0() { + Log0(42); + } + + function fireEventLog0Anonym() { + Log0Anonym(42); + } + + function fireEventLog1() { + Log1(true, 42); + } + + function fireEventLog1Anonym() { + Log1Anonym(true, 42); + } + + function fireEventLog2() { + Log2(true, msg.sender, 42); + } + + function fireEventLog2Anonym() { + Log2Anonym(true, msg.sender, 42); + } + + function fireEventLog3() { + Log3(true, msg.sender, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, 42); + } + + function fireEventLog3Anonym() { + Log3Anonym(true, msg.sender, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, 42); + } + + function fireEventLog4() { + Log4(true, msg.sender, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, -23, 42); + } + + function fireEventLog4Anonym() { + Log4Anonym(true, msg.sender, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, -23, 42); + } + + bool myBool; + int8 myInt8; + uint8 myUint8; + int256 myInt256; + uint256 myUint256; + address myAddress; + //bytes0 myBytes0; + bytes32 myBytes32; + +} + diff --git a/test/bcJS_API_TestFiller.json b/test/bcJS_API_TestFiller.json deleted file mode 100644 index fe7396e59..000000000 --- a/test/bcJS_API_TestFiller.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "JS_API_Tests" : { - "genesisBlockHeader" : { - "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", - "difficulty" : "131072", - "extraData" : "0x42", - "gasLimit" : "3141592", - "gasUsed" : "0", - "number" : "0", - "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", - "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", - "timestamp" : "0x54c98c81", - "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "nonce" : "0x0102030405060708", - "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" - }, - "expect" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "70" - }, - "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { - "storage" : { - "0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0x01" : "0x42", - "0x02" : "0x23", - "0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0x04" : "0x01", - "0x05" : "0x55114a49" - } - } - }, - "pre" : { - "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { - "balance" : "10000000000000", - "nonce" : "0", - "code" : "", - "storage": {} - }, - "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { - "balance" : "100000", - "code" : "0x60003560e060020a9004806343d726d61461004257806391b7f5ed14610050578063d686f9ee14610061578063f5bade661461006f578063fcfff16f1461008057005b61004a6101de565b60006000f35b61005b6004356100bf565b60006000f35b610069610304565b60006000f35b61007a60043561008e565b60006000f35b6100886100f0565b60006000f35b600054600160a060020a031633600160a060020a031614156100af576100b4565b6100bc565b806001819055505b50565b600054600160a060020a031633600160a060020a031614156100e0576100e5565b6100ed565b806002819055505b50565b600054600160a060020a031633600160a060020a031614806101255750600354600160a060020a031633600160a060020a0316145b61012e57610161565b60016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a16101dc565b60045460011480610173575060015434105b6101b85760016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a142600581905550336003819055506101db565b33600160a060020a03166000346000600060006000848787f16101d757005b5050505b5b565b60006004546000146101ef576101f4565b610301565b600054600160a060020a031633600160a060020a031614801561022c5750600054600160a060020a0316600354600160a060020a0316145b61023557610242565b6000600481905550610301565b600354600160a060020a031633600160a060020a03161461026257610300565b600554420360025402905060015481116102c757600354600160a060020a0316600082600154036000600060006000848787f161029b57005b505050600054600160a060020a03166000826000600060006000848787f16102bf57005b5050506102ee565b600054600160a060020a031660006001546000600060006000848787f16102ea57005b5050505b60006004819055506000546003819055505b5b50565b6000600054600160a060020a031633600160a060020a031614156103275761032c565b61037e565b600554420360025402905060015481116103455761037d565b600054600160a060020a031660006001546000600060006000848787f161036857005b50505060006004819055506000546003819055505b5b5056", - "nonce" : "0", - "storage" : { - "0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0x01" : "0x42", - "0x02" : "0x23", - "0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0x05" : "0x54c98c81" - } - } - }, - "blocks" : [ - { - "transactions" : [ - { - "data" : "0x60406103ca600439600451602451336000819055506000600481905550816001819055508060028190555042600581905550336003819055505050610381806100496000396000f30060003560e060020a9004806343d726d61461004257806391b7f5ed14610050578063d686f9ee14610061578063f5bade661461006f578063fcfff16f1461008057005b61004a6101de565b60006000f35b61005b6004356100bf565b60006000f35b610069610304565b60006000f35b61007a60043561008e565b60006000f35b6100886100f0565b60006000f35b600054600160a060020a031633600160a060020a031614156100af576100b4565b6100bc565b806001819055505b50565b600054600160a060020a031633600160a060020a031614156100e0576100e5565b6100ed565b806002819055505b50565b600054600160a060020a031633600160a060020a031614806101255750600354600160a060020a031633600160a060020a0316145b61012e57610161565b60016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a16101dc565b60045460011480610173575060015434105b6101b85760016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a142600581905550336003819055506101db565b33600160a060020a03166000346000600060006000848787f16101d757005b5050505b5b565b60006004546000146101ef576101f4565b610301565b600054600160a060020a031633600160a060020a031614801561022c5750600054600160a060020a0316600354600160a060020a0316145b61023557610242565b6000600481905550610301565b600354600160a060020a031633600160a060020a03161461026257610300565b600554420360025402905060015481116102c757600354600160a060020a0316600082600154036000600060006000848787f161029b57005b505050600054600160a060020a03166000826000600060006000848787f16102bf57005b5050506102ee565b600054600160a060020a031660006001546000600060006000848787f16102ea57005b5050505b60006004819055506000546003819055505b5b50565b6000600054600160a060020a031633600160a060020a031614156103275761032c565b61037e565b600554420360025402905060015481116103455761037d565b600054600160a060020a031660006001546000600060006000848787f161036857005b50505060006004819055506000546003819055505b5b505600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000023", - "gasLimit" : "600000", - "gasPrice" : "1", - "nonce" : "0", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "", - "value" : "100000" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "1", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0xfcfff16f", - "gasLimit" : "600000", - "gasPrice" : "1", - "nonce" : "2", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "0x42" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "3", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } - ], - "uncleHeaders" : [ - { - "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "coinbase" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "difficulty" : "131072", - "extraData" : "0x", - "gasLimit" : "3141592", - "gasUsed" : "0", - "hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04", - "mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770", - "nonce" : "18a524c1790fa83b", - "number" : "2", - "parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae", - "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd", - "timestamp" : "0x54c98c82", - "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" - }, - { - "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "coinbase" : "bcde5374fce5edbc8e2a8697c15331677e6ebf0b", - "difficulty" : "131072", - "extraData" : "0x", - "gasLimit" : "3141592", - "gasUsed" : "0", - "hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04", - "mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770", - "nonce" : "18a524c1790fa83b", - "number" : "2", - "parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae", - "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd", - "timestamp" : "0x54c98c82", - "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" - } - ] - }, - { - "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "4", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "5", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } - ], - "uncleHeaders" : [ - { - "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "coinbase" : "bcde5374fce5edbc8e2a8697c15331677e6ebf0b", - "difficulty" : "131072", - "extraData" : "0x", - "gasLimit" : "314159", - "gasUsed" : "0", - "hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04", - "mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770", - "nonce" : "18a524c1790fa83b", - "number" : "2", - "parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae", - "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd", - "timestamp" : "0x54c98c82", - "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" - } - ] - }, - { - "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "6", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "7", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "8", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - } - ] - } -} diff --git a/test/bcRPC_API_TestFiller.json b/test/bcRPC_API_TestFiller.json new file mode 100644 index 000000000..00b3cc783 --- /dev/null +++ b/test/bcRPC_API_TestFiller.json @@ -0,0 +1,744 @@ +{ + "RPC_API_Test" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "3141592", + "gasUsed" : "0", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + }, + "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { + "balance" : "100000", + "code" : "0x60003560e060020a9004806343d726d61461004257806391b7f5ed14610050578063d686f9ee14610061578063f5bade661461006f578063fcfff16f1461008057005b61004a6101de565b60006000f35b61005b6004356100bf565b60006000f35b610069610304565b60006000f35b61007a60043561008e565b60006000f35b6100886100f0565b60006000f35b600054600160a060020a031633600160a060020a031614156100af576100b4565b6100bc565b806001819055505b50565b600054600160a060020a031633600160a060020a031614156100e0576100e5565b6100ed565b806002819055505b50565b600054600160a060020a031633600160a060020a031614806101255750600354600160a060020a031633600160a060020a0316145b61012e57610161565b60016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a16101dc565b60045460011480610173575060015434105b6101b85760016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a142600581905550336003819055506101db565b33600160a060020a03166000346000600060006000848787f16101d757005b5050505b5b565b60006004546000146101ef576101f4565b610301565b600054600160a060020a031633600160a060020a031614801561022c5750600054600160a060020a0316600354600160a060020a0316145b61023557610242565b6000600481905550610301565b600354600160a060020a031633600160a060020a03161461026257610300565b600554420360025402905060015481116102c757600354600160a060020a0316600082600154036000600060006000848787f161029b57005b505050600054600160a060020a03166000826000600060006000848787f16102bf57005b5050506102ee565b600054600160a060020a031660006001546000600060006000848787f16102ea57005b5050505b60006004819055506000546003819055505b5b50565b6000600054600160a060020a031633600160a060020a031614156103275761032c565b61037e565b600554420360025402905060015481116103455761037d565b600054600160a060020a031660006001546000600060006000848787f161036857005b50505060006004819055506000546003819055505b5b5056", + "nonce" : "0", + "storage" : { + "0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "0x01" : "0x42", + "0x02" : "0x23", + "0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "0x05" : "0x54c98c81" + } + } + }, + "blocks" : [ + { + "transactions" : [ + { + "data" : "0x60406103ca600439600451602451336000819055506000600481905550816001819055508060028190555042600581905550336003819055505050610381806100496000396000f30060003560e060020a9004806343d726d61461004257806391b7f5ed14610050578063d686f9ee14610061578063f5bade661461006f578063fcfff16f1461008057005b61004a6101de565b60006000f35b61005b6004356100bf565b60006000f35b610069610304565b60006000f35b61007a60043561008e565b60006000f35b6100886100f0565b60006000f35b600054600160a060020a031633600160a060020a031614156100af576100b4565b6100bc565b806001819055505b50565b600054600160a060020a031633600160a060020a031614156100e0576100e5565b6100ed565b806002819055505b50565b600054600160a060020a031633600160a060020a031614806101255750600354600160a060020a031633600160a060020a0316145b61012e57610161565b60016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a16101dc565b60045460011480610173575060015434105b6101b85760016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a142600581905550336003819055506101db565b33600160a060020a03166000346000600060006000848787f16101d757005b5050505b5b565b60006004546000146101ef576101f4565b610301565b600054600160a060020a031633600160a060020a031614801561022c5750600054600160a060020a0316600354600160a060020a0316145b61023557610242565b6000600481905550610301565b600354600160a060020a031633600160a060020a03161461026257610300565b600554420360025402905060015481116102c757600354600160a060020a0316600082600154036000600060006000848787f161029b57005b505050600054600160a060020a03166000826000600060006000848787f16102bf57005b5050506102ee565b600054600160a060020a031660006001546000600060006000848787f16102ea57005b5050505b60006004819055506000546003819055505b5b50565b6000600054600160a060020a031633600160a060020a031614156103275761032c565b61037e565b600554420360025402905060015481116103455761037d565b600054600160a060020a031660006001546000600060006000848787f161036857005b50505060006004819055506000546003819055505b5b505600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000023", + "gasLimit" : "600000", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "", + "value" : "100000" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "1", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0xfcfff16f", + "gasLimit" : "600000", + "gasPrice" : "1", + "nonce" : "2", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "0x42" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "3", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "difficulty" : "131072", + "extraData" : "0x", + "gasLimit" : "3141592", + "gasUsed" : "0", + "hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04", + "mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770", + "nonce" : "18a524c1790fa83b", + "number" : "2", + "parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae", + "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd", + "timestamp" : "0x54c98c82", + "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "bcde5374fce5edbc8e2a8697c15331677e6ebf0b", + "difficulty" : "131072", + "extraData" : "0x", + "gasLimit" : "3141592", + "gasUsed" : "0", + "hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04", + "mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770", + "nonce" : "18a524c1790fa83b", + "number" : "2", + "parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae", + "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd", + "timestamp" : "0x54c98c82", + "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "4", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "5", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "bcde5374fce5edbc8e2a8697c15331677e6ebf0b", + "difficulty" : "131072", + "extraData" : "0x", + "gasLimit" : "314159", + "gasUsed" : "0", + "hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04", + "mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770", + "nonce" : "18a524c1790fa83b", + "number" : "2", + "parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae", + "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd", + "timestamp" : "0x54c98c82", + "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "6", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "7", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "8", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "create contract: c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "data" : "0x5b5b6106e0806100106000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104b1565b60006000f35b610142610376565b8060005260206000f35b610157600435610301565b60006000f35b6101686004356102c9565b60006000f35b61017661041d565b8060005260206000f35b6101886103ae565b8060ff1660005260206000f35b61019d6103ee565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104a0565b60006000f35b6101d3610392565b8060000b60005260206000f35b6101e861042f565b60006000f35b6101f66103dc565b8060005260206000f35b6102086104fa565b60006000f35b6102196004356102e5565b60006000f35b61022761066e565b60006000f35b61023860043561031d565b60006000f35b61024661045f565b60006000f35b61025461046e565b60006000f35b610265600435610368565b60006000f35b61027660043561032b565b60006000f35b610287600435610339565b60006000f35b61029561058f565b60006000f35b6102a3610522565b60006000f35b6102b16103ca565b8060005260206000f35b6102c36105db565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff021916908302179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff16905061038f565b90565b6000600060019054906101000a900460ff1690506103ab565b90565b6000600060029054906101000a900460ff1690506103c7565b90565b600060016000505490506103d9565b90565b600060026000505490506103eb565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061041a565b90565b6000600460005054905061042c565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56", + "gasLimit" : "3141592", + "gasPrice" : "1", + "nonce" : "9", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getBool", + "data" : "0x12a7b914", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "10", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getInt8", + "data" : "0x57cb2fc4", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "11", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getUint8", + "data" : "0x343a875d", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "12", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getInt256", + "data" : "0xf5b53e17", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "13", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getUint256", + "data" : "0x68895979", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "14", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getAddress", + "data" : "0x38cc4831", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "15", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getBytes32", + "data" : "0x1f903037", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "16", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "setBool", + "data" : "0x1e26fd330000000000000000000000000000000000000000000000000000000000000001", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "17", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "setBool", + "data" : "0x1e26fd330000000000000000000000000000000000000000000000000000000000000001", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "18", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "setInt8", + "data" : "0x9a19a953000000000000000000000000000000000000000000000000fffffffffffffffa", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "19", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "setUint8", + "data" : "0x1774e6460000000000000000000000000000000000000000000000000000000000000008", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "20", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "setInt256", + "data" : "0xa53b1c1effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "21", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "setUint256", + "data" : "0xd2282dc5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "22", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "setAddress", + "data" : "0xe30081a0aabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "23", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "setBytes32", + "data" : "0xc2b12a73aabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "24", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getInt8", + "data" : "0x57cb2fc4", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "25", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getUint8", + "data" : "0x343a875d", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "26", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getInt256", + "data" : "0xf5b53e17", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "27", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getUint256", + "data" : "0x68895979", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "28", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getAddress", + "data" : "0x38cc4831", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "29", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "getBytes32", + "data" : "0x1f903037", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "30", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "log0", + "data" : "0x65538c73", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "31", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "log0a", + "data" : "0xa6780857", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "32", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "log1", + "data" : "0xb61c0503", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "33", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "log1a", + "data" : "0x4e7ad367", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "34", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "log2", + "data" : "0x102accc1", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "35", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "log2a", + "data" : "0x76bc21d9", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "36", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "log3", + "data" : "0xf38b0600", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "37", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "log3a", + "data" : "0xe8beef5b", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "38", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "log4", + "data" : "0xfd408767", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "39", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "log4a", + "data" : "0x9dc2c8f5", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "40", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + } + ] + } +} diff --git a/test/blockchain.cpp b/test/blockchain.cpp index b144abe62..7fb425ed6 100644 --- a/test/blockchain.cpp +++ b/test/blockchain.cpp @@ -663,9 +663,9 @@ BOOST_AUTO_TEST_CASE(bcInvalidRLPTest) dev::test::executeTests("bcInvalidRLPTest", "/BlockTests", dev::test::doBlockchainTests); } -BOOST_AUTO_TEST_CASE(bcJS_API_Test) +BOOST_AUTO_TEST_CASE(bcRPC_API_Test) { - dev::test::executeTests("bcJS_API_Test", "/BlockTests", dev::test::doBlockchainTests); + dev::test::executeTests("bcRPC_API_Test", "/BlockTests", dev::test::doBlockchainTests); } BOOST_AUTO_TEST_CASE(bcValidBlockTest) From b415eb1fd2e3f8b21b8eae5c725f6036ce629895 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 14 Apr 2015 12:35:32 +0200 Subject: [PATCH 03/22] remove old contract --- test/bcRPC_API_TestFiller.json | 305 ++++++++------------------------- 1 file changed, 70 insertions(+), 235 deletions(-) diff --git a/test/bcRPC_API_TestFiller.json b/test/bcRPC_API_TestFiller.json index 00b3cc783..2938178c2 100644 --- a/test/bcRPC_API_TestFiller.json +++ b/test/bcRPC_API_TestFiller.json @@ -23,31 +23,20 @@ "nonce" : "0", "code" : "", "storage": {} - }, - "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { - "balance" : "100000", - "code" : "0x60003560e060020a9004806343d726d61461004257806391b7f5ed14610050578063d686f9ee14610061578063f5bade661461006f578063fcfff16f1461008057005b61004a6101de565b60006000f35b61005b6004356100bf565b60006000f35b610069610304565b60006000f35b61007a60043561008e565b60006000f35b6100886100f0565b60006000f35b600054600160a060020a031633600160a060020a031614156100af576100b4565b6100bc565b806001819055505b50565b600054600160a060020a031633600160a060020a031614156100e0576100e5565b6100ed565b806002819055505b50565b600054600160a060020a031633600160a060020a031614806101255750600354600160a060020a031633600160a060020a0316145b61012e57610161565b60016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a16101dc565b60045460011480610173575060015434105b6101b85760016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a142600581905550336003819055506101db565b33600160a060020a03166000346000600060006000848787f16101d757005b5050505b5b565b60006004546000146101ef576101f4565b610301565b600054600160a060020a031633600160a060020a031614801561022c5750600054600160a060020a0316600354600160a060020a0316145b61023557610242565b6000600481905550610301565b600354600160a060020a031633600160a060020a03161461026257610300565b600554420360025402905060015481116102c757600354600160a060020a0316600082600154036000600060006000848787f161029b57005b505050600054600160a060020a03166000826000600060006000848787f16102bf57005b5050506102ee565b600054600160a060020a031660006001546000600060006000848787f16102ea57005b5050505b60006004819055506000546003819055505b5b50565b6000600054600160a060020a031633600160a060020a031614156103275761032c565b61037e565b600554420360025402905060015481116103455761037d565b600054600160a060020a031660006001546000600060006000848787f161036857005b50505060006004819055506000546003819055505b5b5056", - "nonce" : "0", - "storage" : { - "0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0x01" : "0x42", - "0x02" : "0x23", - "0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0x05" : "0x54c98c81" - } } }, "blocks" : [ { "transactions" : [ { - "data" : "0x60406103ca600439600451602451336000819055506000600481905550816001819055508060028190555042600581905550336003819055505050610381806100496000396000f30060003560e060020a9004806343d726d61461004257806391b7f5ed14610050578063d686f9ee14610061578063f5bade661461006f578063fcfff16f1461008057005b61004a6101de565b60006000f35b61005b6004356100bf565b60006000f35b610069610304565b60006000f35b61007a60043561008e565b60006000f35b6100886100f0565b60006000f35b600054600160a060020a031633600160a060020a031614156100af576100b4565b6100bc565b806001819055505b50565b600054600160a060020a031633600160a060020a031614156100e0576100e5565b6100ed565b806002819055505b50565b600054600160a060020a031633600160a060020a031614806101255750600354600160a060020a031633600160a060020a0316145b61012e57610161565b60016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a16101dc565b60045460011480610173575060015434105b6101b85760016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a142600581905550336003819055506101db565b33600160a060020a03166000346000600060006000848787f16101d757005b5050505b5b565b60006004546000146101ef576101f4565b610301565b600054600160a060020a031633600160a060020a031614801561022c5750600054600160a060020a0316600354600160a060020a0316145b61023557610242565b6000600481905550610301565b600354600160a060020a031633600160a060020a03161461026257610300565b600554420360025402905060015481116102c757600354600160a060020a0316600082600154036000600060006000848787f161029b57005b505050600054600160a060020a03166000826000600060006000848787f16102bf57005b5050506102ee565b600054600160a060020a031660006001546000600060006000848787f16102ea57005b5050505b60006004819055506000546003819055505b5b50565b6000600054600160a060020a031633600160a060020a031614156103275761032c565b61037e565b600554420360025402905060015481116103455761037d565b600054600160a060020a031660006001546000600060006000848787f161036857005b50505060006004819055506000546003819055505b5b505600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000023", - "gasLimit" : "600000", + "data" : "create contract: 6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "data" : "0x5b5b6106e0806100106000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104b1565b60006000f35b610142610376565b8060005260206000f35b610157600435610301565b60006000f35b6101686004356102c9565b60006000f35b61017661041d565b8060005260206000f35b6101886103ae565b8060ff1660005260206000f35b61019d6103ee565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104a0565b60006000f35b6101d3610392565b8060000b60005260206000f35b6101e861042f565b60006000f35b6101f66103dc565b8060005260206000f35b6102086104fa565b60006000f35b6102196004356102e5565b60006000f35b61022761066e565b60006000f35b61023860043561031d565b60006000f35b61024661045f565b60006000f35b61025461046e565b60006000f35b610265600435610368565b60006000f35b61027660043561032b565b60006000f35b610287600435610339565b60006000f35b61029561058f565b60006000f35b6102a3610522565b60006000f35b6102b16103ca565b8060005260206000f35b6102c36105db565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff021916908302179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff16905061038f565b90565b6000600060019054906101000a900460ff1690506103ab565b90565b6000600060029054906101000a900460ff1690506103c7565b90565b600060016000505490506103d9565b90565b600060026000505490506103eb565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061041a565b90565b6000600460005054905061042c565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56", + "gasLimit" : "3141592", "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "to" : "", - "value" : "100000" + "value" : "10" } ], "uncleHeaders" : [ @@ -56,12 +45,13 @@ { "transactions" : [ { - "data" : "", + "data" : "getBool", + "data" : "0x12a7b914", "gasLimit" : "314159", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -71,13 +61,14 @@ { "transactions" : [ { - "data" : "0xfcfff16f", - "gasLimit" : "600000", + "data" : "getInt8", + "data" : "0x57cb2fc4", + "gasLimit" : "314159", "gasPrice" : "1", "nonce" : "2", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "0x42" + "value" : "10" } ], "uncleHeaders" : [ @@ -86,12 +77,13 @@ { "transactions" : [ { - "data" : "", + "data" : "getUint8", + "data" : "0x343a875d", "gasLimit" : "314159", "gasPrice" : "1", "nonce" : "3", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -134,163 +126,6 @@ } ] }, - { - "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "4", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "5", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } - ], - "uncleHeaders" : [ - { - "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "coinbase" : "bcde5374fce5edbc8e2a8697c15331677e6ebf0b", - "difficulty" : "131072", - "extraData" : "0x", - "gasLimit" : "314159", - "gasUsed" : "0", - "hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04", - "mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770", - "nonce" : "18a524c1790fa83b", - "number" : "2", - "parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae", - "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd", - "timestamp" : "0x54c98c82", - "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" - } - ] - }, - { - "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "6", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "7", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "8", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "create contract: c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", - "data" : "0x5b5b6106e0806100106000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104b1565b60006000f35b610142610376565b8060005260206000f35b610157600435610301565b60006000f35b6101686004356102c9565b60006000f35b61017661041d565b8060005260206000f35b6101886103ae565b8060ff1660005260206000f35b61019d6103ee565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104a0565b60006000f35b6101d3610392565b8060000b60005260206000f35b6101e861042f565b60006000f35b6101f66103dc565b8060005260206000f35b6102086104fa565b60006000f35b6102196004356102e5565b60006000f35b61022761066e565b60006000f35b61023860043561031d565b60006000f35b61024661045f565b60006000f35b61025461046e565b60006000f35b610265600435610368565b60006000f35b61027660043561032b565b60006000f35b610287600435610339565b60006000f35b61029561058f565b60006000f35b6102a3610522565b60006000f35b6102b16103ca565b8060005260206000f35b6102c36105db565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff021916908302179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff16905061038f565b90565b6000600060019054906101000a900460ff1690506103ab565b90565b6000600060029054906101000a900460ff1690506103c7565b90565b600060016000505490506103d9565b90565b600060026000505490506103eb565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061041a565b90565b6000600460005054905061042c565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56", - "gasLimit" : "3141592", - "gasPrice" : "1", - "nonce" : "9", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "getBool", - "data" : "0x12a7b914", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "10", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "getInt8", - "data" : "0x57cb2fc4", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "11", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "getUint8", - "data" : "0x343a875d", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "12", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", - "value" : "10" - } - ], - "uncleHeaders" : [ - ] - }, { "transactions" : [ { @@ -298,9 +133,9 @@ "data" : "0xf5b53e17", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "13", + "nonce" : "4", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -314,9 +149,9 @@ "data" : "0x68895979", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "14", + "nonce" : "5", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -330,9 +165,9 @@ "data" : "0x38cc4831", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "15", + "nonce" : "6", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -346,9 +181,9 @@ "data" : "0x1f903037", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "16", + "nonce" : "7", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -362,9 +197,9 @@ "data" : "0x1e26fd330000000000000000000000000000000000000000000000000000000000000001", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "17", + "nonce" : "8", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -378,9 +213,9 @@ "data" : "0x1e26fd330000000000000000000000000000000000000000000000000000000000000001", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "18", + "nonce" : "9", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -394,9 +229,9 @@ "data" : "0x9a19a953000000000000000000000000000000000000000000000000fffffffffffffffa", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "19", + "nonce" : "10", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -410,9 +245,9 @@ "data" : "0x1774e6460000000000000000000000000000000000000000000000000000000000000008", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "20", + "nonce" : "11", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -426,9 +261,9 @@ "data" : "0xa53b1c1effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "21", + "nonce" : "12", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -442,9 +277,9 @@ "data" : "0xd2282dc5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "22", + "nonce" : "13", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -458,9 +293,9 @@ "data" : "0xe30081a0aabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "23", + "nonce" : "14", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -474,9 +309,9 @@ "data" : "0xc2b12a73aabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "24", + "nonce" : "15", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -490,9 +325,9 @@ "data" : "0x57cb2fc4", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "25", + "nonce" : "16", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -506,9 +341,9 @@ "data" : "0x343a875d", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "26", + "nonce" : "17", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -522,9 +357,9 @@ "data" : "0xf5b53e17", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "27", + "nonce" : "18", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -538,9 +373,9 @@ "data" : "0x68895979", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "28", + "nonce" : "19", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -554,9 +389,9 @@ "data" : "0x38cc4831", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "29", + "nonce" : "20", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -570,9 +405,9 @@ "data" : "0x1f903037", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "30", + "nonce" : "21", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -586,9 +421,9 @@ "data" : "0x65538c73", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "31", + "nonce" : "22", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -602,9 +437,9 @@ "data" : "0xa6780857", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "32", + "nonce" : "23", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -618,9 +453,9 @@ "data" : "0xb61c0503", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "33", + "nonce" : "24", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -634,9 +469,9 @@ "data" : "0x4e7ad367", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "34", + "nonce" : "25", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -650,9 +485,9 @@ "data" : "0x102accc1", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "35", + "nonce" : "26", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -666,9 +501,9 @@ "data" : "0x76bc21d9", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "36", + "nonce" : "27", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -682,9 +517,9 @@ "data" : "0xf38b0600", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "37", + "nonce" : "28", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -698,9 +533,9 @@ "data" : "0xe8beef5b", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "38", + "nonce" : "29", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -714,9 +549,9 @@ "data" : "0xfd408767", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "39", + "nonce" : "30", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], @@ -730,9 +565,9 @@ "data" : "0x9dc2c8f5", "gasLimit" : "314159", "gasPrice" : "1", - "nonce" : "40", + "nonce" : "31", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "c73a4c080ed74d5cad62e58d32dd8e5f0d78fe24", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "10" } ], From 70873c6d145a697cf3e7ffbfef79297faf154cb3 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Wed, 15 Apr 2015 09:25:46 +0200 Subject: [PATCH 04/22] update JSON_test.sol --- test/JSON_test.sol | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/JSON_test.sol b/test/JSON_test.sol index 91d8734b3..5cb7a48af 100644 --- a/test/JSON_test.sol +++ b/test/JSON_test.sol @@ -1,14 +1,14 @@ contract JSON_Test { event Log0(uint value); - event Log0Anonym (uint value) anonymous; + event Log0Anonym (uint value) ; event Log1(bool indexed aBool, uint value); - event Log1Anonym(bool indexed aBool, uint value) anonymous; + event Log1Anonym(bool indexed aBool, uint value) ; event Log2(bool indexed aBool, address indexed aAddress, uint value); - event Log2Anonym(bool indexed aBool, address indexed aAddress, uint value) anonymous; + event Log2Anonym(bool indexed aBool, address indexed aAddress, uint value) ; event Log3(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, uint value); - event Log3Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, uint value) anonymous; + event Log3Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, uint value) ; event Log4(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value); - event Log4Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value) anonymous; + event Log4Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value) ; function JSON_Test() { @@ -38,9 +38,9 @@ myAddress = _address; } - //function setBytes0(bytes0 _bytes0) { - // myBytes0 = _bytes0; - //} + function setBytes0(bytes0 _bytes0) { + myBytes0 = _bytes0; + } function setBytes32(bytes32 _bytes32) { myBytes32 = _bytes32; @@ -70,9 +70,9 @@ return myAddress; } - //function getBytes0() returns (bytes0 ret) { - // return myBytes0; - //} + function getBytes0() returns (bytes0 ret) { + return myBytes0; + } function getBytes32() returns (bytes32 ret) { return myBytes32; @@ -124,7 +124,7 @@ int256 myInt256; uint256 myUint256; address myAddress; - //bytes0 myBytes0; + bytes0 myBytes0; bytes32 myBytes32; } From e396efd3be2269d40328f6fefbdc21c638b88a50 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 17 Apr 2015 12:19:12 +0200 Subject: [PATCH 05/22] add sleep 1 second to avoid invalid blocks due to same timestamp during creation Conflicts: test/blockchain.cpp --- test/bcRPC_API_TestFiller.json | 2 +- test/blockchain.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/bcRPC_API_TestFiller.json b/test/bcRPC_API_TestFiller.json index 2938178c2..781bd5e7d 100644 --- a/test/bcRPC_API_TestFiller.json +++ b/test/bcRPC_API_TestFiller.json @@ -226,7 +226,7 @@ "transactions" : [ { "data" : "setInt8", - "data" : "0x9a19a953000000000000000000000000000000000000000000000000fffffffffffffffa", + "data" : "0x9a19a953fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa", "gasLimit" : "314159", "gasPrice" : "1", "nonce" : "10", diff --git a/test/blockchain.cpp b/test/blockchain.cpp index 7fb425ed6..8854a9705 100644 --- a/test/blockchain.cpp +++ b/test/blockchain.cpp @@ -289,6 +289,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) state = stateTemp; //revert state as if it was before executing this block } blArray.push_back(blObj); + sleep(1); } //for blocks if (o.count("expect") > 0) From fa50ff051f25f27b746f7a3f66e65685c24cdfbd Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Thu, 16 Apr 2015 15:16:39 +0200 Subject: [PATCH 06/22] style --- test/JSON_test.sol | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/JSON_test.sol b/test/JSON_test.sol index 5cb7a48af..2c67fc2e5 100644 --- a/test/JSON_test.sol +++ b/test/JSON_test.sol @@ -11,7 +11,6 @@ event Log4Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value) ; function JSON_Test() { - } function setBool(bool _bool) { @@ -125,7 +124,6 @@ uint256 myUint256; address myAddress; bytes0 myBytes0; - bytes32 myBytes32; - + bytes32 myBytes32; } From a84cdc08cf3f0b7a2bd2ccc434e238517df622ef Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 17 Apr 2015 14:51:01 +0200 Subject: [PATCH 07/22] retrigger build --- test/blockchain.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/test/blockchain.cpp b/test/blockchain.cpp index 8854a9705..8d8a67632 100644 --- a/test/blockchain.cpp +++ b/test/blockchain.cpp @@ -695,4 +695,3 @@ BOOST_AUTO_TEST_CASE(userDefinedFile) } BOOST_AUTO_TEST_SUITE_END() - From cf02b5f64b8444e2b71f237921a148a7f2f2f2b6 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 17 Apr 2015 15:08:42 +0200 Subject: [PATCH 08/22] use this_thread::sleep_for instead of sleep --- test/blockchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/blockchain.cpp b/test/blockchain.cpp index 8d8a67632..c525832dc 100644 --- a/test/blockchain.cpp +++ b/test/blockchain.cpp @@ -289,7 +289,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) state = stateTemp; //revert state as if it was before executing this block } blArray.push_back(blObj); - sleep(1); + this_thread::sleep_for(chrono::seconds(1)); } //for blocks if (o.count("expect") > 0) From b87032736ee518d104d81f18aeea6b6eeab47acf Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 17 Apr 2015 16:39:51 +0200 Subject: [PATCH 09/22] update test after solidity fix --- test/JSON_test.sol | 23 +++++++---------------- test/bcRPC_API_TestFiller.json | 2 +- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/test/JSON_test.sol b/test/JSON_test.sol index 2c67fc2e5..ffd7cdc40 100644 --- a/test/JSON_test.sol +++ b/test/JSON_test.sol @@ -1,14 +1,14 @@ contract JSON_Test { - event Log0(uint value); - event Log0Anonym (uint value) ; + event Log0(uint value) ; + event Log0Anonym (uint value) anonymous; event Log1(bool indexed aBool, uint value); - event Log1Anonym(bool indexed aBool, uint value) ; + event Log1Anonym(bool indexed aBool, uint value) anonymous; event Log2(bool indexed aBool, address indexed aAddress, uint value); - event Log2Anonym(bool indexed aBool, address indexed aAddress, uint value) ; + event Log2Anonym(bool indexed aBool, address indexed aAddress, uint value) anonymous; event Log3(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, uint value); - event Log3Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, uint value) ; + event Log3Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, uint value) anonymous; event Log4(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value); - event Log4Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value) ; + event Log4Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value) anonymous; function JSON_Test() { } @@ -36,11 +36,7 @@ function setAddress(address _address) { myAddress = _address; } - - function setBytes0(bytes0 _bytes0) { - myBytes0 = _bytes0; - } - + function setBytes32(bytes32 _bytes32) { myBytes32 = _bytes32; } @@ -69,10 +65,6 @@ return myAddress; } - function getBytes0() returns (bytes0 ret) { - return myBytes0; - } - function getBytes32() returns (bytes32 ret) { return myBytes32; } @@ -123,7 +115,6 @@ int256 myInt256; uint256 myUint256; address myAddress; - bytes0 myBytes0; bytes32 myBytes32; } diff --git a/test/bcRPC_API_TestFiller.json b/test/bcRPC_API_TestFiller.json index 781bd5e7d..b31f1fa48 100644 --- a/test/bcRPC_API_TestFiller.json +++ b/test/bcRPC_API_TestFiller.json @@ -30,7 +30,7 @@ "transactions" : [ { "data" : "create contract: 6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "data" : "0x5b5b6106e0806100106000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104b1565b60006000f35b610142610376565b8060005260206000f35b610157600435610301565b60006000f35b6101686004356102c9565b60006000f35b61017661041d565b8060005260206000f35b6101886103ae565b8060ff1660005260206000f35b61019d6103ee565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104a0565b60006000f35b6101d3610392565b8060000b60005260206000f35b6101e861042f565b60006000f35b6101f66103dc565b8060005260206000f35b6102086104fa565b60006000f35b6102196004356102e5565b60006000f35b61022761066e565b60006000f35b61023860043561031d565b60006000f35b61024661045f565b60006000f35b61025461046e565b60006000f35b610265600435610368565b60006000f35b61027660043561032b565b60006000f35b610287600435610339565b60006000f35b61029561058f565b60006000f35b6102a3610522565b60006000f35b6102b16103ca565b8060005260206000f35b6102c36105db565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff021916908302179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff16905061038f565b90565b6000600060019054906101000a900460ff1690506103ab565b90565b6000600060029054906101000a900460ff1690506103c7565b90565b600060016000505490506103d9565b90565b600060026000505490506103eb565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061041a565b90565b6000600460005054905061042c565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56", + "data" : "0x5b5b610705806100106000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104d6565b60006000f35b61014261039b565b8060005260206000f35b610157600435610326565b60006000f35b6101686004356102c9565b60006000f35b610176610442565b8060005260206000f35b6101886103d3565b8060ff1660005260206000f35b61019d610413565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104c5565b60006000f35b6101d36103b7565b8060000b60005260206000f35b6101e8610454565b60006000f35b6101f6610401565b8060005260206000f35b61020861051f565b60006000f35b6102196004356102e5565b60006000f35b610227610693565b60006000f35b610238600435610342565b60006000f35b610246610484565b60006000f35b610254610493565b60006000f35b61026560043561038d565b60006000f35b610276600435610350565b60006000f35b61028760043561035e565b60006000f35b6102956105b4565b60006000f35b6102a3610547565b60006000f35b6102b16103ef565b8060005260206000f35b6102c3610600565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff1690506103b4565b90565b6000600060019054906101000a900460000b90506103d0565b90565b6000600060029054906101000a900460ff1690506103ec565b90565b600060016000505490506103fe565b90565b60006002600050549050610410565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061043f565b90565b60006004600050549050610451565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56", "gasLimit" : "3141592", "gasPrice" : "1", "nonce" : "0", From e1caebe33115ebd2b9af946841d119d4d0a7c760 Mon Sep 17 00:00:00 2001 From: winsvega Date: Mon, 20 Apr 2015 11:27:11 +0300 Subject: [PATCH 10/22] first zeros in rlp m_data overflow percautions --- libdevcore/RLP.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libdevcore/RLP.cpp b/libdevcore/RLP.cpp index 2a1c34030..bceafd2b4 100644 --- a/libdevcore/RLP.cpp +++ b/libdevcore/RLP.cpp @@ -149,8 +149,11 @@ unsigned RLP::length() const return n - c_rlpDataImmLenStart; else if (n < c_rlpListStart) { - if ((int)m_data.size() <= n - c_rlpDataIndLenZero || m_data[1] == 0) + if ((int)m_data.size() <= n - c_rlpDataIndLenZero) BOOST_THROW_EXCEPTION(BadRLP()); + if ((int)m_data.size() > 1) + if (m_data[1] == 0) + BOOST_THROW_EXCEPTION(BadRLP()); for (int i = 0; i < n - c_rlpDataIndLenZero; ++i) ret = (ret << 8) | m_data[i + 1]; } @@ -158,8 +161,11 @@ unsigned RLP::length() const return n - c_rlpListStart; else { - if ((int)m_data.size() <= n - c_rlpListIndLenZero || m_data[1] == 0) + if ((int)m_data.size() <= n - c_rlpListIndLenZero) BOOST_THROW_EXCEPTION(BadRLP()); + if ((int)m_data.size() > 1) + if (m_data[1] == 0) + BOOST_THROW_EXCEPTION(BadRLP()); for (int i = 0; i < n - c_rlpListIndLenZero; ++i) ret = (ret << 8) | m_data[i + 1]; } From 4e4fc4d11cb20549e38ca90c2e0056f3d9a7d84e Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 20 Apr 2015 11:10:19 +0200 Subject: [PATCH 11/22] Fixes for reimporting. --- libethereum/BlockChain.cpp | 14 +++++++++----- libethereum/BlockChain.h | 4 ++-- libethereum/State.cpp | 8 ++++---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 2e089dd3b..4e3349a31 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -218,7 +218,11 @@ void BlockChain::rebuild(std::string const& _path, std::functionPut(m_writeOptions, toSlice(m_lastBlockHash, ExtraDetails), (ldb::Slice)dev::ref(m_details[m_lastBlockHash].rlp())); + + h256 lastHash = m_lastBlockHash; boost::timer t; for (unsigned d = 1; d < originalNumber; ++d) { @@ -240,7 +244,7 @@ void BlockChain::rebuild(std::string const& _path, std::function (u256)time(0)) { - clog(BlockChainNote) << bi.hash() << ": Future time " << bi.timestamp << " (now at " << time(0) << ")"; + clog(BlockChainChat) << bi.hash() << ": Future time " << bi.timestamp << " (now at " << time(0) << ")"; // Block has a timestamp in the future. This is no good. BOOST_THROW_EXCEPTION(FutureTime()); } - clog(BlockChainNote) << "Attempting import of " << bi.hash().abridged() << "..."; + clog(BlockChainChat) << "Attempting import of " << bi.hash().abridged() << "..."; #if ETH_TIMED_IMPORTS preliminaryChecks = t.elapsed(); @@ -609,7 +613,7 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import } else { - clog(BlockChainNote) << " Imported but not best (oTD:" << details(last).totalDifficulty << " > TD:" << td << ")"; + clog(BlockChainChat) << " Imported but not best (oTD:" << details(last).totalDifficulty << " > TD:" << td << ")"; } #if ETH_TIMED_IMPORTS diff --git a/libethereum/BlockChain.h b/libethereum/BlockChain.h index 70a9f93db..8061487d7 100644 --- a/libethereum/BlockChain.h +++ b/libethereum/BlockChain.h @@ -56,8 +56,8 @@ struct AlreadyHaveBlock: virtual Exception {}; struct UnknownParent: virtual Exception {}; struct FutureTime: virtual Exception {}; -struct BlockChainChat: public LogChannel { static const char* name() { return "-B-"; } static const int verbosity = 7; }; -struct BlockChainNote: public LogChannel { static const char* name() { return "=B="; } static const int verbosity = 4; }; +struct BlockChainChat: public LogChannel { static const char* name() { return "-B-"; } static const int verbosity = 5; }; +struct BlockChainNote: public LogChannel { static const char* name() { return "=B="; } static const int verbosity = 3; }; struct BlockChainWarn: public LogChannel { static const char* name() { return "=B="; } static const int verbosity = 1; }; struct BlockChainDebug: public LogChannel { static const char* name() { return "#B#"; } static const int verbosity = 0; }; diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 19cec8614..598dac37d 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -663,7 +663,7 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement uncle.verifyParent(uncleParent); nonces.insert(uncle.nonce); - tdIncrease += uncle.difficulty; +// tdIncrease += uncle.difficulty; rewarded.push_back(uncle); } @@ -704,15 +704,15 @@ void State::cleanup(bool _fullCommit) paranoia("immediately before database commit", true); // Commit the new trie to disk. - cnote << "Committing to disk: stateRoot" << m_currentBlock.stateRoot.abridged() << "=" << rootHash().abridged() << "=" << toHex(asBytes(m_db.lookup(rootHash()))); + clog(StateTrace) << "Committing to disk: stateRoot" << m_currentBlock.stateRoot.abridged() << "=" << rootHash().abridged() << "=" << toHex(asBytes(m_db.lookup(rootHash()))); m_db.commit(); - cnote << "Committed: stateRoot" << m_currentBlock.stateRoot.abridged() << "=" << rootHash().abridged() << "=" << toHex(asBytes(m_db.lookup(rootHash()))); + clog(StateTrace) << "Committed: stateRoot" << m_currentBlock.stateRoot.abridged() << "=" << rootHash().abridged() << "=" << toHex(asBytes(m_db.lookup(rootHash()))); paranoia("immediately after database commit", true); m_previousBlock = m_currentBlock; m_currentBlock.populateFromParent(m_previousBlock); - cdebug << "finalising enactment. current -> previous, hash is" << m_previousBlock.hash().abridged(); + clog(StateTrace) << "finalising enactment. current -> previous, hash is" << m_previousBlock.hash().abridged(); } else m_db.rollback(); From 30e42521b5a11e93e9581faf90ae82dc43651947 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 20 Apr 2015 11:10:51 +0200 Subject: [PATCH 12/22] Minor protocol version bump to force rebuilding DB. --- libethcore/Common.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethcore/Common.cpp b/libethcore/Common.cpp index a0ceb389e..56120471b 100644 --- a/libethcore/Common.cpp +++ b/libethcore/Common.cpp @@ -34,7 +34,7 @@ namespace eth { const unsigned c_protocolVersion = 60; -const unsigned c_minorProtocolVersion = 0; +const unsigned c_minorProtocolVersion = 1; const unsigned c_databaseBaseVersion = 9; #if ETH_FATDB const unsigned c_databaseVersionModifier = 1; From 43ca7292dec5bbff2c9e72709f74c22b7cf11af2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 20 Apr 2015 11:36:57 +0200 Subject: [PATCH 13/22] - Bugfix: #1672 - Return the right line nb in error (WebPreview.qml) --- mix/qml/LogsPane.qml | 7 +++++-- mix/qml/StatusPane.qml | 7 +++++++ mix/qml/WebPreview.qml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mix/qml/LogsPane.qml b/mix/qml/LogsPane.qml index eb8669df6..c9d0ef67e 100644 --- a/mix/qml/LogsPane.qml +++ b/mix/qml/LogsPane.qml @@ -6,12 +6,15 @@ import org.ethereum.qml.SortFilterProxyModel 1.0 Rectangle { + property variant statusPane property variant currentStatus property int contentXPos: logStyle.generic.layout.dateWidth + logStyle.generic.layout.typeWidth - 70 function clear() { logsModel.clear(); + statusPane.clear(); + currentStatus = undefined; } function push(_level, _type, _content) @@ -22,7 +25,7 @@ Rectangle onVisibleChanged: { - if (visible && (logsModel.count === 0 || (logsModel.get(0).date !== currentStatus.date && logsModel.get(0).content !== currentStatus.content))) + if (currentStatus && visible && (logsModel.count === 0 || logsModel.get(0).content !== currentStatus.content || logsModel.get(0).date !== currentStatus.date)) logsModel.insert(0, { "type": currentStatus.type, "date": currentStatus.date, "content": currentStatus.content, "level": currentStatus.level }); else if (!visible) { @@ -533,7 +536,7 @@ Rectangle enabled: logsModel.count > 0 tooltip: qsTr("Clear") onTriggered: { - logsModel.clear(); + logsPane.clear() } } } diff --git a/mix/qml/StatusPane.qml b/mix/qml/StatusPane.qml index d36b6fa75..0c01caeb1 100644 --- a/mix/qml/StatusPane.qml +++ b/mix/qml/StatusPane.qml @@ -55,6 +55,12 @@ Rectangle { currentStatus = { "type": type, "date": Qt.formatDateTime(new Date(), "hh:mm:ss"), "content": text, "level": "error" } } + function clear() + { + status.state = ""; + status.text = ""; + } + StatusPaneStyle { id: statusPaneStyle } @@ -359,6 +365,7 @@ Rectangle { LogsPane { id: logPane; + statusPane: statusHeader onContentXPosChanged: { parent.move(); diff --git a/mix/qml/WebPreview.qml b/mix/qml/WebPreview.qml index 6db727e3b..72cb88401 100644 --- a/mix/qml/WebPreview.qml +++ b/mix/qml/WebPreview.qml @@ -317,7 +317,7 @@ Item { experimental.settings.localContentCanAccessRemoteUrls: true onJavaScriptConsoleMessage: { console.log(sourceID + ":" + lineNumber + ": " + message); - webPreview.javaScriptMessage(level, sourceID, lineNumber, message); + webPreview.javaScriptMessage(level, sourceID, lineNumber - 1, message); } onLoadingChanged: { if (!loading) { From a1e0ea0df3f063bc7b85ef1990e45ecf5d5a5b81 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 20 Apr 2015 11:37:21 +0200 Subject: [PATCH 14/22] fix hex encoding blockheader and use tmp directories for stateDB --- test/blockchain.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/blockchain.cpp b/test/blockchain.cpp index 92912938e..73d4eb255 100644 --- a/test/blockchain.cpp +++ b/test/blockchain.cpp @@ -52,8 +52,10 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) BOOST_REQUIRE(o.count("pre")); ImportTest importer(o["pre"].get_obj()); - State state(OverlayDB(), BaseState::Empty, biGenesisBlock.coinbaseAddress); - State stateTemp(OverlayDB(), BaseState::Empty, biGenesisBlock.coinbaseAddress); + TransientDirectory td_stateDB; + TransientDirectory td_stateDB_tmp; + State state(OverlayDB(State::openDB(td_stateDB.path())), BaseState::Empty, biGenesisBlock.coinbaseAddress); + State stateTemp(OverlayDB(State::openDB(td_stateDB_tmp.path())), BaseState::Empty, biGenesisBlock.coinbaseAddress); importer.importState(o["pre"].get_obj(), state); o["pre"] = fillJsonWithState(state); state.commit(); @@ -626,11 +628,11 @@ void writeBlockHeaderToJson(mObject& _o, BlockInfo const& _bi) _o["transactionsTrie"] = toString(_bi.transactionsRoot); _o["receiptTrie"] = toString(_bi.receiptsRoot); _o["bloom"] = toString(_bi.logBloom); - _o["difficulty"] = "0x" + toHex(toCompactBigEndian(_bi.difficulty), 1); - _o["number"] = "0x" + toHex(toCompactBigEndian(_bi.number), 1); - _o["gasLimit"] = "0x" + toHex(toCompactBigEndian(_bi.gasLimit), 1); - _o["gasUsed"] = "0x" + toHex(toCompactBigEndian(_bi.gasUsed), 1); - _o["timestamp"] = "0x" + toHex(toCompactBigEndian(_bi.timestamp), 1); + _o["difficulty"] = "0x" + toHex(toCompactBigEndian(_bi.difficulty, 1)); + _o["number"] = "0x" + toHex(toCompactBigEndian(_bi.number, 1)); + _o["gasLimit"] = "0x" + toHex(toCompactBigEndian(_bi.gasLimit, 1)); + _o["gasUsed"] = "0x" + toHex(toCompactBigEndian(_bi.gasUsed, 1)); + _o["timestamp"] = "0x" + toHex(toCompactBigEndian(_bi.timestamp, 1)); _o["extraData"] ="0x" + toHex(_bi.extraData); _o["mixHash"] = toString(_bi.mixHash); _o["nonce"] = toString(_bi.nonce); From 8328220471475b2733a9f4a2cc4c3710ee2d7d5c Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 20 Apr 2015 11:49:37 +0200 Subject: [PATCH 15/22] Fixes for reimporting, make block availability atomic. --- alethzero/MainWin.cpp | 2 +- libethcore/EthashAux.cpp | 6 +++--- libethereum/BlockChain.cpp | 38 +++++++++++++++++++++++++++----------- libethereum/BlockChain.h | 3 ++- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 270996a30..3ec5febd2 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -164,7 +164,7 @@ Main::Main(QWidget *parent) : statusBar()->addPermanentWidget(ui->chainStatus); statusBar()->addPermanentWidget(ui->blockCount); - ui->blockCount->setText(QString("PV%2 D%3 %4-%5 v%6").arg(eth::c_protocolVersion).arg(c_databaseVersion).arg(QString::fromStdString(ProofOfWork::name())).arg(ProofOfWork::revision()).arg(dev::Version)); + ui->blockCount->setText(QString("PV%1.%2 D%3 %4-%5 v%6").arg(eth::c_protocolVersion).arg(eth::c_minorProtocolVersion).arg(c_databaseVersion).arg(QString::fromStdString(ProofOfWork::name())).arg(ProofOfWork::revision()).arg(dev::Version)); connect(ui->ourAccounts->model(), SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)), SLOT(ourAccountsRowsMoved())); diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 68c5f3057..750d80082 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -75,11 +75,11 @@ h256 EthashAux::seedHash(unsigned _number) n = get()->m_seedHashes.size() - 1; } get()->m_seedHashes.resize(epoch + 1); - cdebug << "Searching for seedHash of epoch " << epoch; +// cdebug << "Searching for seedHash of epoch " << epoch; for (; n <= epoch; ++n, ret = sha3(ret)) { get()->m_seedHashes[n] = ret; - cdebug << "Epoch" << n << "is" << ret.abridged(); +// cdebug << "Epoch" << n << "is" << ret.abridged(); } } return get()->m_seedHashes[epoch]; @@ -95,7 +95,7 @@ ethash_params EthashAux::params(h256 const& _seedHash) } catch (...) { - cdebug << "Searching for seedHash " << _seedHash.abridged(); +// cdebug << "Searching for seedHash " << _seedHash.abridged(); for (h256 h; h != _seedHash && epoch < 2048; ++epoch, h = sha3(h), get()->m_epochs[h] = epoch) {} if (epoch == 2048) { diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 4e3349a31..6705349f4 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -167,6 +167,7 @@ void BlockChain::open(std::string const& _path, WithExisting _we) std::string l; m_extrasDB->Get(m_readOptions, ldb::Slice("best"), &l); m_lastBlockHash = l.empty() ? m_genesisHash : *(h256*)l.data(); + m_lastBlockNumber = number(m_lastBlockHash); cnote << "Opened blockchain DB. Latest: " << currentHash(); } @@ -177,6 +178,7 @@ void BlockChain::close() delete m_extrasDB; delete m_blocksDB; m_lastBlockHash = m_genesisHash; + m_lastBlockNumber = 0; m_details.clear(); m_blocks.clear(); } @@ -191,8 +193,7 @@ void BlockChain::rebuild(std::string const& _path, std::functionPut(m_writeOptions, ldb::Slice("best"), ldb::Slice((char const*)&(bi.hash()), 32)); // Most of the time these two will be equal - only when we're doing a chain revert will they not be if (common != last) @@ -601,6 +597,14 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import m_extrasDB->Put(m_writeOptions, toSlice(h, ExtraTransactionAddress), (ldb::Slice)dev::ref(m_transactionAddresses[h].rlp())); } + // FINALLY! change our best hash. + { + WriteGuard l(x_lastBlockHash); + m_lastBlockHash = bi.hash(); + m_lastBlockNumber = (unsigned)bi.number; + m_extrasDB->Put(m_writeOptions, ldb::Slice("best"), ldb::Slice((char const*)&(bi.hash()), 32)); + } + clog(BlockChainNote) << " Imported and best" << td << " (#" << bi.number << "). Has" << (details(bi.parentHash).children.size() - 1) << "siblings. Route:" << toString(route); noteCanonChanged(); @@ -960,14 +964,26 @@ bool BlockChain::isKnown(h256 const& _hash) const { if (_hash == m_genesisHash) return true; + { ReadGuard l(x_blocks); - if (m_blocks.count(_hash)) - return true; + auto it = m_blocks.find(_hash); + if (it != m_blocks.end()) + { + noteUsed(_hash); + BlockInfo bi(it->second, CheckNothing, _hash); + return bi.number <= m_lastBlockNumber; // TODO: m_lastBlockNumber + } } + string d; m_blocksDB->Get(m_readOptions, toSlice(_hash), &d); - return !!d.size(); + + if (!d.size()) + return false; + + BlockInfo bi(bytesConstRef(&d), CheckNothing, _hash); + return bi.number <= m_lastBlockNumber; // TODO: m_lastBlockNumber } bytes BlockChain::block(h256 const& _hash) const diff --git a/libethereum/BlockChain.h b/libethereum/BlockChain.h index 8061487d7..be5b931ee 100644 --- a/libethereum/BlockChain.h +++ b/libethereum/BlockChain.h @@ -185,7 +185,7 @@ public: /// Get a number for the given hash (or the most recent mined if none given). Thread-safe. unsigned number(h256 const& _hash) const { return details(_hash).number; } - unsigned number() const { return number(currentHash()); } + unsigned number() const { return m_lastBlockNumber; } /// Get a given block (RLP format). Thread-safe. h256 currentHash() const { ReadGuard l(x_lastBlockHash); return m_lastBlockHash; } @@ -315,6 +315,7 @@ private: /// Hash of the last (valid) block on the longest chain. mutable boost::shared_mutex x_lastBlockHash; h256 m_lastBlockHash; + unsigned m_lastBlockNumber = 0; /// Genesis block info. h256 m_genesisHash; From 86804fedf1b81e2136b07e9f3d896f7cd6d80a6a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 20 Apr 2015 12:22:35 +0200 Subject: [PATCH 16/22] Fix deadlock. --- libethereum/BlockChain.cpp | 22 +++++++++++----------- libp2p/NodeTable.cpp | 6 +++--- libp2p/RLPxHandshake.cpp | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 6705349f4..6a483a228 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -965,24 +965,24 @@ bool BlockChain::isKnown(h256 const& _hash) const if (_hash == m_genesisHash) return true; + BlockInfo bi; + { ReadGuard l(x_blocks); auto it = m_blocks.find(_hash); if (it != m_blocks.end()) - { - noteUsed(_hash); - BlockInfo bi(it->second, CheckNothing, _hash); - return bi.number <= m_lastBlockNumber; // TODO: m_lastBlockNumber - } + bi = BlockInfo(it->second, CheckNothing, _hash); } - string d; - m_blocksDB->Get(m_readOptions, toSlice(_hash), &d); - - if (!d.size()) - return false; + if (!bi) + { + string d; + m_blocksDB->Get(m_readOptions, toSlice(_hash), &d); + if (!d.size()) + return false; + bi = BlockInfo(bytesConstRef(&d), CheckNothing, _hash); + } - BlockInfo bi(bytesConstRef(&d), CheckNothing, _hash); return bi.number <= m_lastBlockNumber; // TODO: m_lastBlockNumber } diff --git a/libp2p/NodeTable.cpp b/libp2p/NodeTable.cpp index 1f48d52b7..e65c6660b 100644 --- a/libp2p/NodeTable.cpp +++ b/libp2p/NodeTable.cpp @@ -382,7 +382,7 @@ void NodeTable::onReceived(UDPSocketFace*, bi::udp::endpoint const& _from, bytes // h256 + Signature + type + RLP (smallest possible packet is empty neighbours packet which is 3 bytes) if (_packet.size() < h256::size + Signature::size + 1 + 3) { - clog(NodeTableWarn) << "Invalid message size from " << _from.address().to_string() << ":" << _from.port(); + clog(NodeTableTriviaSummary) << "Invalid message size from " << _from.address().to_string() << ":" << _from.port(); return; } @@ -390,7 +390,7 @@ void NodeTable::onReceived(UDPSocketFace*, bi::udp::endpoint const& _from, bytes h256 hashSigned(sha3(hashedBytes)); if (!_packet.cropped(0, h256::size).contentsEqual(hashSigned.asBytes())) { - clog(NodeTableWarn) << "Invalid message hash from " << _from.address().to_string() << ":" << _from.port(); + clog(NodeTableTriviaSummary) << "Invalid message hash from " << _from.address().to_string() << ":" << _from.port(); return; } @@ -402,7 +402,7 @@ void NodeTable::onReceived(UDPSocketFace*, bi::udp::endpoint const& _from, bytes Public nodeid(dev::recover(*(Signature const*)sigBytes.data(), sha3(signedBytes))); if (!nodeid) { - clog(NodeTableWarn) << "Invalid message signature from " << _from.address().to_string() << ":" << _from.port(); + clog(NodeTableTriviaSummary) << "Invalid message signature from " << _from.address().to_string() << ":" << _from.port(); return; } diff --git a/libp2p/RLPxHandshake.cpp b/libp2p/RLPxHandshake.cpp index bb9af2ef7..fbf0d9fdf 100644 --- a/libp2p/RLPxHandshake.cpp +++ b/libp2p/RLPxHandshake.cpp @@ -249,7 +249,7 @@ void RLPXHandshake::transition(boost::system::error_code _ech) bytesRef frame(&m_handshakeInBuffer); if (!m_io->authAndDecryptFrame(frame)) { - clog(NetWarn) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "hello frame: decrypt failed"; + clog(NetTriviaSummary) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "hello frame: decrypt failed"; m_nextState = Error; transition(); return; @@ -258,13 +258,13 @@ void RLPXHandshake::transition(boost::system::error_code _ech) PacketType packetType = (PacketType)(frame[0] == 0x80 ? 0x0 : frame[0]); if (packetType != 0) { - clog(NetWarn) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "hello frame: invalid packet type"; + clog(NetTriviaSummary) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "hello frame: invalid packet type"; m_nextState = Error; transition(); return; } - clog(NetNote) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "hello frame: success. starting session."; + clog(NetTriviaSummary) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "hello frame: success. starting session."; RLP rlp(frame.cropped(1), RLP::ThrowOnFail | RLP::FailIfTooSmall); m_host->startPeerSession(m_remote, rlp, m_io, m_socket->remoteEndpoint()); } From 67f1cb513b7e076cd434a79e1233dfc654d1435e Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 20 Apr 2015 12:33:41 +0200 Subject: [PATCH 17/22] BigNumber object available to web preview --- mix/qml/WebPreview.qml | 2 +- mix/qml/html/WebContainer.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mix/qml/WebPreview.qml b/mix/qml/WebPreview.qml index 6db727e3b..1e76366da 100644 --- a/mix/qml/WebPreview.qml +++ b/mix/qml/WebPreview.qml @@ -186,7 +186,7 @@ Item { if (documentName === urlInput.text.replace(httpServer.url + "/", "")) { //root page, inject deployment script - content = "\n" + content; + content = "\n" + content; _request.setResponseContentType("text/html"); } _request.setResponse(content); diff --git a/mix/qml/html/WebContainer.html b/mix/qml/html/WebContainer.html index 30e203bed..9c458a4c7 100644 --- a/mix/qml/html/WebContainer.html +++ b/mix/qml/html/WebContainer.html @@ -21,6 +21,7 @@ updateContracts = function(contracts) { if (window.web3) { window.web3.reset(); window.contracts = {}; + window.BigNumber = require('bignumber.js'); for (var c in contracts) { var contractProto = window.web3.eth.contract(contracts[c].interface); var contract = new contractProto(contracts[c].address); From 6b0a6e1043beccf6f41d3f40694dee1e10c5b7b8 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 20 Apr 2015 13:16:58 +0200 Subject: [PATCH 18/22] Inject block data in AZ. --- alethzero/Main.ui | 6 ++++++ alethzero/MainWin.cpp | 19 +++++++++++++++++++ alethzero/MainWin.h | 1 + 3 files changed, 26 insertions(+) diff --git a/alethzero/Main.ui b/alethzero/Main.ui index 8e48793c9..1fd9669e9 100644 --- a/alethzero/Main.ui +++ b/alethzero/Main.ui @@ -176,6 +176,7 @@ + @@ -1685,6 +1686,11 @@ font-size: 14pt Retry Unknown Parent Blocks + + + In&ject Block + + diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 3ec5febd2..64fca6a05 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1448,6 +1448,25 @@ void Main::on_inject_triggered() } } +void Main::on_injectBlock_triggered() +{ + QString s = QInputDialog::getText(this, "Inject Block", "Enter block dump in hex"); + try + { + bytes b = fromHex(s.toStdString(), WhenError::Throw); + ethereum()->injectBlock(b); + } + catch (BadHexCharacter& _e) + { + cwarn << "invalid hex character, transaction rejected"; + cwarn << boost::diagnostic_information(_e); + } + catch (...) + { + cwarn << "block rejected"; + } +} + void Main::on_blocks_currentItemChanged() { ui->info->clear(); diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index a8579ed01..1a53ec62b 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -159,6 +159,7 @@ private slots: void on_killBlockchain_triggered(); void on_clearPending_triggered(); void on_inject_triggered(); + void on_injectBlock_triggered(); void on_forceMining_triggered(); void on_usePrivate_triggered(); void on_turboMining_triggered(); From 9aab3ea20826cf6936bd52f4767652f1bb45263f Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 20 Apr 2015 13:56:35 +0200 Subject: [PATCH 19/22] Extra diagnostics. --- libethereum/BlockChain.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 6a483a228..4d28cae7f 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -406,7 +406,10 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import auto pdata = pd.rlp(); clog(BlockChainDebug) << "Details is returning false despite block known:" << RLP(pdata); auto parentBlock = block(bi.parentHash); - clog(BlockChainDebug) << "Block:" << RLP(parentBlock); + clog(BlockChainDebug) << "isKnown:" << isKnown(bi.parentHash); + clog(BlockChainDebug) << "last/number:" << m_lastBlockNumber << m_lastBlockHash << bi.number; + clog(BlockChainDebug) << "Block:" << BlockInfo(parentBlock); + clog(BlockChainDebug) << "RLP:" << RLP(parentBlock); clog(BlockChainDebug) << "DATABASE CORRUPTION: CRITICAL FAILURE"; exit(-1); } From a02aab8c34d9c16ab6665ae71c0a1574dd57db8b Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 20 Apr 2015 14:47:13 +0200 Subject: [PATCH 20/22] Synchronisation safety for details/blocks in BlockChain. Avoid situation where block isKnown before details available. --- libethereum/BlockChain.cpp | 41 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 4d28cae7f..8dec48e96 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -485,14 +485,15 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import #endif { + ReadGuard l1(x_blocks); ReadGuard l2(x_details); ReadGuard l4(x_receipts); ReadGuard l5(x_logBlooms); - m_blocksDB->Put(m_writeOptions, toSlice(bi.hash()), (ldb::Slice)ref(_block)); m_extrasDB->Put(m_writeOptions, toSlice(bi.hash(), ExtraDetails), (ldb::Slice)dev::ref(m_details[bi.hash()].rlp())); m_extrasDB->Put(m_writeOptions, toSlice(bi.parentHash, ExtraDetails), (ldb::Slice)dev::ref(m_details[bi.parentHash].rlp())); m_extrasDB->Put(m_writeOptions, toSlice(bi.hash(), ExtraLogBlooms), (ldb::Slice)dev::ref(m_logBlooms[bi.hash()].rlp())); m_extrasDB->Put(m_writeOptions, toSlice(bi.hash(), ExtraReceipts), (ldb::Slice)dev::ref(m_receipts[bi.hash()].rlp())); + m_blocksDB->Put(m_writeOptions, toSlice(bi.hash()), (ldb::Slice)ref(_block)); } #if ETH_TIMED_IMPORTS @@ -968,25 +969,23 @@ bool BlockChain::isKnown(h256 const& _hash) const if (_hash == m_genesisHash) return true; - BlockInfo bi; - - { - ReadGuard l(x_blocks); - auto it = m_blocks.find(_hash); - if (it != m_blocks.end()) - bi = BlockInfo(it->second, CheckNothing, _hash); - } - - if (!bi) - { - string d; - m_blocksDB->Get(m_readOptions, toSlice(_hash), &d); - if (!d.size()) - return false; - bi = BlockInfo(bytesConstRef(&d), CheckNothing, _hash); - } - - return bi.number <= m_lastBlockNumber; // TODO: m_lastBlockNumber + ETH_READ_GUARDED(x_blocks) + if (!m_blocks.count(_hash)) + { + string d; + m_blocksDB->Get(m_readOptions, toSlice(_hash), &d); + if (d.empty()) + return false; + } + ETH_READ_GUARDED(x_details) + if (!m_details.count(_hash)) + { + string d; + m_extrasDB->Get(m_readOptions, toSlice(_hash, ExtraDetails), &d); + if (d.empty()) + return false; + } + return true; } bytes BlockChain::block(h256 const& _hash) const @@ -1004,7 +1003,7 @@ bytes BlockChain::block(h256 const& _hash) const string d; m_blocksDB->Get(m_readOptions, toSlice(_hash), &d); - if (!d.size()) + if (d.empty()) { cwarn << "Couldn't find requested block:" << _hash.abridged(); return bytes(); From ed5b2a5da6da5175ff68292ad31a514675947f0c Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 20 Apr 2015 14:54:55 +0200 Subject: [PATCH 21/22] Made font size adjustable Switched to inkpot colour scheme --- mix/qml/CodeEditorView.qml | 31 +++++++++++++++++ mix/qml/WebCodeEditor.qml | 9 +++++ mix/qml/html/cm/inkpot.css | 65 ++++++++++++++++++++++++++++++++++++ mix/qml/html/codeeditor.html | 3 +- mix/qml/html/codeeditor.js | 9 ++++- mix/web.qrc | 1 + 6 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 mix/qml/html/cm/inkpot.css diff --git a/mix/qml/CodeEditorView.qml b/mix/qml/CodeEditorView.qml index 7c4ef066f..956b71915 100644 --- a/mix/qml/CodeEditorView.qml +++ b/mix/qml/CodeEditorView.qml @@ -3,6 +3,7 @@ import QtQuick.Window 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.0 import QtQuick.Dialogs 1.1 +import Qt.labs.settings 1.0 Item { id: codeEditorView @@ -74,6 +75,7 @@ Item { } editor.document = document; editor.sourceName = document.documentId; + editor.setFontSize(editorSettings.fontSize); editor.setText(data, document.syntaxMode); editor.changeGeneration(); } @@ -158,6 +160,15 @@ Item { } } + function setFontSize(size) + { + if (size <= 10 || size >= 48) + return; + editorSettings.fontSize = size; + for (var i = 0; i < editors.count; i++) + editors.itemAt(i).item.setFontSize(size); + } + Component.onCompleted: projectModel.codeEditor = codeEditorView; Connections { @@ -317,4 +328,24 @@ Item { ListModel { id: editorListModel } + + + Action { + id: increaseFontSize + text: qsTr("Increase Font Size") + shortcut: "Ctrl+=" + onTriggered: setFontSize(editorSettings.fontSize + 1) + } + + Action { + id: decreaseFontSize + text: qsTr("Decrease Font Size") + shortcut: "Ctrl+-" + onTriggered: setFontSize(editorSettings.fontSize - 1) + } + + Settings { + id: editorSettings + property int fontSize: 12; + } } diff --git a/mix/qml/WebCodeEditor.qml b/mix/qml/WebCodeEditor.qml index 7c4a18492..9a9a3bea7 100644 --- a/mix/qml/WebCodeEditor.qml +++ b/mix/qml/WebCodeEditor.qml @@ -19,6 +19,7 @@ Item { property var currentBreakpoints: [] property string sourceName property var document + property int fontSize: 0 function setText(text, mode) { currentText = text; @@ -76,6 +77,13 @@ Item { editorBrowser.runJavaScript("goToCompilationError()", function(result) {}); } + function setFontSize(size) { + fontSize = size; + if (initialized && editorBrowser) + editorBrowser.runJavaScript("setFontSize(" + size + ")", function(result) {}); + } + + Clipboard { id: clipboard @@ -108,6 +116,7 @@ Item { { if (!loading && editorBrowser) { initialized = true; + setFontSize(fontSize); setText(currentText, currentMode); runJavaScript("getTextChanged()", function(result) { }); pollTimer.running = true; diff --git a/mix/qml/html/cm/inkpot.css b/mix/qml/html/cm/inkpot.css new file mode 100644 index 000000000..c6863e624 --- /dev/null +++ b/mix/qml/html/cm/inkpot.css @@ -0,0 +1,65 @@ +/* +Inkpot theme for code-mirror +https://github.com/ciaranm/inkpot +*/ + +/* Color scheme for code-mirror */ + +.cm-s-inkpot.CodeMirror { + color: #cfbfad; + text-shadow: #1e1e27 0 1px; + background-color: #1e1e27; + line-height: 1.45em; + color-profile: sRGB; + rendering-intent: auto; +} + +.cm-s-inkpot .CodeMirror-gutters { background: #2e2e2e; border-right: 0px solid #aaa; } +.cm-s-inkpot .CodeMirror-linenumber { color: #8b8bcd; } +.cm-s-inkpot .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-inkpot span.cm-comment { color: #cd8b00; } +.cm-s-inkpot span.cm-def { color: #cfbfad; font-weight:bold; } +.cm-s-inkpot span.cm-keyword { color: #808bed; } +.cm-s-inkpot span.cm-builtin { color: #cfbfad; } +.cm-s-inkpot span.cm-variable { color: #cfbfad; } +.cm-s-inkpot span.cm-string { color: #ffcd8b; } +.cm-s-inkpot span.cm-number { color: #f0ad6d; } +.cm-s-inkpot span.cm-atom { color: #cb6ecb; } +.cm-s-inkpot span.cm-variable-2 { color: #ffb8ff; } + +.cm-s-inkpot span.cm-meta { color: #409090; } +.cm-s-inkpot span.cm-qualifier { color: #808bed; } +.cm-s-inkpot span.cm-tag { color: #808bed; } +.cm-s-inkpot span.cm-attribute { color: #FF5555; } +.cm-s-inkpot span.cm-error { color: #f00; } + +.cm-s-inkpot .cm-bracket { color: #cb4b16; } +.cm-s-inkpot .CodeMirror-matchingbracket { color: #859900; } +.cm-s-inkpot .CodeMirror-nonmatchingbracket { color: #dc322f; } + +.cm-s-inkpot .CodeMirror-selected { background: #4e4e8f !important; } +span.CodeMirror-selectedtext { color: #ffffff !important; } + + +/* Code execution */ +.CodeMirror-exechighlight { + border-bottom: double 1px #94A2A2; +} + + +/* Error annotation */ +.CodeMirror-errorannotation { + border-bottom: 1px solid #DD3330; + margin-bottom: 4px; +} + +.CodeMirror-errorannotation-context { + font-family: monospace; + color: #EEE9D5; + background: #b58900; + padding: 2px; + text-shadow: none !important; + border-top: solid 2px #063742; +} + diff --git a/mix/qml/html/codeeditor.html b/mix/qml/html/codeeditor.html index c9d4ff96a..f368404fe 100644 --- a/mix/qml/html/codeeditor.html +++ b/mix/qml/html/codeeditor.html @@ -1,7 +1,8 @@ - + + diff --git a/mix/qml/html/codeeditor.js b/mix/qml/html/codeeditor.js index 501e0bd57..e8504fee0 100644 --- a/mix/qml/html/codeeditor.js +++ b/mix/qml/html/codeeditor.js @@ -9,7 +9,7 @@ var editor = CodeMirror(document.body, { }); var ternServer; -editor.setOption("theme", "solarized dark"); +editor.setOption("theme", "inkpot"); editor.setOption("indentUnit", 4); editor.setOption("indentWithTabs", true); editor.setOption("fullScreen", true); @@ -194,4 +194,11 @@ goToCompilationError = function() editor.setCursor(annotation.line, annotation.column) } +setFontSize = function(size) +{ + editor.getWrapperElement().style["font-size"] = size + "px"; + editor.refresh(); +} + editor.setOption("extraKeys", extraKeys); + diff --git a/mix/web.qrc b/mix/web.qrc index 6870411c5..a34fd0b67 100644 --- a/mix/web.qrc +++ b/mix/web.qrc @@ -32,6 +32,7 @@ qml/html/cm/show-hint.js qml/html/cm/signal.js qml/html/cm/solarized.css + qml/html/cm/inkpot.css qml/html/cm/solidity.js qml/html/cm/solidityToken.js qml/html/cm/tern.js From e4ee14bfad1a54da854ecc0f533ba66dce408de2 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 20 Apr 2015 14:57:49 +0200 Subject: [PATCH 22/22] style --- mix/qml/CodeEditorView.qml | 4 +--- mix/qml/WebCodeEditor.qml | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/mix/qml/CodeEditorView.qml b/mix/qml/CodeEditorView.qml index 956b71915..e4d62ed81 100644 --- a/mix/qml/CodeEditorView.qml +++ b/mix/qml/CodeEditorView.qml @@ -160,8 +160,7 @@ Item { } } - function setFontSize(size) - { + function setFontSize(size) { if (size <= 10 || size >= 48) return; editorSettings.fontSize = size; @@ -329,7 +328,6 @@ Item { id: editorListModel } - Action { id: increaseFontSize text: qsTr("Increase Font Size") diff --git a/mix/qml/WebCodeEditor.qml b/mix/qml/WebCodeEditor.qml index 9a9a3bea7..38f2327b1 100644 --- a/mix/qml/WebCodeEditor.qml +++ b/mix/qml/WebCodeEditor.qml @@ -83,7 +83,6 @@ Item { editorBrowser.runJavaScript("setFontSize(" + size + ")", function(result) {}); } - Clipboard { id: clipboard