diff options
author | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-08-24 08:52:53 +0800 |
---|---|---|
committer | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-08-25 10:46:11 +0800 |
commit | 7324176f702a77fc331bf16a968d2eb4bccce021 (patch) | |
tree | a9fef3b9ee46fc382dde23cdd90209cc4298dd59 /tests | |
parent | d51d0022cee91d6588186455afbe6e54fae2cbf7 (diff) | |
download | dexon-7324176f702a77fc331bf16a968d2eb4bccce021.tar dexon-7324176f702a77fc331bf16a968d2eb4bccce021.tar.gz dexon-7324176f702a77fc331bf16a968d2eb4bccce021.tar.bz2 dexon-7324176f702a77fc331bf16a968d2eb4bccce021.tar.lz dexon-7324176f702a77fc331bf16a968d2eb4bccce021.tar.xz dexon-7324176f702a77fc331bf16a968d2eb4bccce021.tar.zst dexon-7324176f702a77fc331bf16a968d2eb4bccce021.zip |
Add tests for uncle timestamps and refactor timestamp type
Diffstat (limited to 'tests')
-rw-r--r-- | tests/block_test.go | 7 | ||||
-rw-r--r-- | tests/block_test_util.go | 6 | ||||
-rwxr-xr-x | tests/files/BlockchainTests/bcUncleTest.json | 315 | ||||
-rw-r--r-- | tests/util.go | 6 |
4 files changed, 327 insertions, 7 deletions
diff --git a/tests/block_test.go b/tests/block_test.go index f42b474b7..b0db5fe56 100644 --- a/tests/block_test.go +++ b/tests/block_test.go @@ -35,6 +35,13 @@ func TestBcUncleHeaderValidityTests(t *testing.T) { } } +func TestBcUncleTests(t *testing.T) { + err := RunBlockTest(filepath.Join(blockTestDir, "bcUncleTest.json"), BlockSkipTests) + if err != nil { + t.Fatal(err) + } +} + func TestBcInvalidHeaderTests(t *testing.T) { err := RunBlockTest(filepath.Join(blockTestDir, "bcInvalidHeaderTest.json"), BlockSkipTests) if err != nil { diff --git a/tests/block_test_util.go b/tests/block_test_util.go index d47c2b101..2090afce7 100644 --- a/tests/block_test_util.go +++ b/tests/block_test_util.go @@ -365,8 +365,8 @@ func (s *BlockTest) validateBlockHeader(h *btHeader, h2 *types.Header) error { return fmt.Errorf("GasUsed: expected: %v, decoded: %v", expectedGasUsed, h2.GasUsed) } - expectedTimestamp := mustConvertUint(h.Timestamp, 16) - if expectedTimestamp != h2.Time { + expectedTimestamp := mustConvertBigInt(h.Timestamp, 16) + if expectedTimestamp.Cmp(h2.Time) != 0 { return fmt.Errorf("Timestamp: expected: %v, decoded: %v", expectedTimestamp, h2.Time) } @@ -461,7 +461,7 @@ func mustConvertHeader(in btHeader) *types.Header { GasUsed: mustConvertBigInt(in.GasUsed, 16), GasLimit: mustConvertBigInt(in.GasLimit, 16), Difficulty: mustConvertBigInt(in.Difficulty, 16), - Time: mustConvertUint(in.Timestamp, 16), + Time: mustConvertBigInt(in.Timestamp, 16), Nonce: types.EncodeNonce(mustConvertUint(in.Nonce, 16)), } return header diff --git a/tests/files/BlockchainTests/bcUncleTest.json b/tests/files/BlockchainTests/bcUncleTest.json index bd6326a88..0d0e83c0c 100755 --- a/tests/files/BlockchainTests/bcUncleTest.json +++ b/tests/files/BlockchainTests/bcUncleTest.json @@ -4543,5 +4543,318 @@ } } } + }, + "uncleTimestampTooBig" : { + "blocks" : [ + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020000", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x5208", + "hash" : "6bd328a10bb674cc758bd1bccb8afb584808766434c28b85580b422c75d4130e", + "mixHash" : "fefce638471ab6b66b1f1423ae574a99a6b2137229fe1846c508554d718d2bc1", + "nonce" : "f8cf2912afdd244d", + "number" : "0x01", + "parentHash" : "b964d0b68e5a3c7265e4087dc2a8aaf599f06b6d6c1316a1b1b6475587f569e2", + "receiptTrie" : "e9244cf7503b79c03d3a099e07a80d2dbc77bb0b502d8a89d51ac0d68dd31313", + "stateRoot" : "cb52de543653d86ccd13ba3ddf8b052525b04231c6884a4db3188a184681d878", + "timestamp" : "0x55d9d69f", + "transactionsTrie" : "5c9151c2413d1cd25c51ffb4ac38948acc1359bf08c6b49f283660e9bcf0f516", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "rlp" : "0xf90261f901f9a0b964d0b68e5a3c7265e4087dc2a8aaf599f06b6d6c1316a1b1b6475587f569e2a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0cb52de543653d86ccd13ba3ddf8b052525b04231c6884a4db3188a184681d878a05c9151c2413d1cd25c51ffb4ac38948acc1359bf08c6b49f283660e9bcf0f516a0e9244cf7503b79c03d3a099e07a80d2dbc77bb0b502d8a89d51ac0d68dd31313b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000001832fefd88252088455d9d69f80a0fefce638471ab6b66b1f1423ae574a99a6b2137229fe1846c508554d718d2bc188f8cf2912afdd244df862f86080018304cb2f94095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba077c7cd36820c71821c1aed59de46e70e701c4a8dd89c9ba508ab722210f60da8a03f29825d40c7c3f7bff3ca69267e0f3fb74b2d18b8c2c4e3c135b5d3b06e288dc0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x00", + "r" : "0x77c7cd36820c71821c1aed59de46e70e701c4a8dd89c9ba508ab722210f60da8", + "s" : "0x3f29825d40c7c3f7bff3ca69267e0f3fb74b2d18b8c2c4e3c135b5d3b06e288d", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1b", + "value" : "0x0a" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020040", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x5208", + "hash" : "4c179927c9b9897464c7133033b412c9b66ee2bb1fa4a4b2595a6006d4081e3f", + "mixHash" : "3449cf46635bab4ae7121dcd145e6ca12ac4337f79e88354c41bff1c48335b48", + "nonce" : "4376da5cd48ffb68", + "number" : "0x02", + "parentHash" : "6bd328a10bb674cc758bd1bccb8afb584808766434c28b85580b422c75d4130e", + "receiptTrie" : "5ea1a8b24652fed0ecab4738edd9211891eb8c4353c345973b78a02cc0f32f6b", + "stateRoot" : "e7e4760f75476ec7f51869d8bdce5c693058fd5a95c77ea9c0bf7ced1e50d70e", + "timestamp" : "0x55d9d6a1", + "transactionsTrie" : "c673e076264c4669a5c2e479f1757b78e42511efe33b5fd2c0a23b929c7f87f5", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "rlp" : "0xf90260f901f9a06bd328a10bb674cc758bd1bccb8afb584808766434c28b85580b422c75d4130ea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0e7e4760f75476ec7f51869d8bdce5c693058fd5a95c77ea9c0bf7ced1e50d70ea0c673e076264c4669a5c2e479f1757b78e42511efe33b5fd2c0a23b929c7f87f5a05ea1a8b24652fed0ecab4738edd9211891eb8c4353c345973b78a02cc0f32f6bb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302004002832fefd88252088455d9d6a180a03449cf46635bab4ae7121dcd145e6ca12ac4337f79e88354c41bff1c48335b48884376da5cd48ffb68f861f85f01018304cb2f94095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba033c86e64d708c97c6b135cadff79dbf45985aa0b53694789e90d15f756765f239f1d0f8caa2a16405148c9d85581be5814960010f3cba938b5501590cea1f7cfc0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x01", + "r" : "0x33c86e64d708c97c6b135cadff79dbf45985aa0b53694789e90d15f756765f23", + "s" : "0x1d0f8caa2a16405148c9d85581be5814960010f3cba938b5501590cea1f7cf", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1b", + "value" : "0x0a" + } + ], + "uncleHeaders" : [ + ] + }, + { + "rlp" : "0xf90459f901f9a04c179927c9b9897464c7133033b412c9b66ee2bb1fa4a4b2595a6006d4081e3fa0f4fd3b99eb9b343e87bc472fdcd6b18e5cbcb231b1e70f8948e97b02c008ac26948888f1f195afa192cfee860698584c030f4c9db1a0e9940294a09308406a3d2e09203aed11db40259fac0a25e639ad2b30b82d07dea01722b8a91bfc4f5614ce36ee77c7cce6620ab4af36d3c54baa66d7dbeb7bce1aa04ede0225773c7a517b91994aca65ade45124e7ef4b8be1e6097c9773a11920afb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302008003832fefd88252088455d9d6a680a0caf6f553d8c1394d291caaeabc61bc25f9126f4c313c829b2a51134cbd23d27188e6999e52421f5a38f862f86002018304cb2f94095e7baea6a6c7c4c2dfeb977efac326af552d870a801ca015eb1cc916728b9799e55c489857727669afb2986433d5f54cde11faaed9f0eea05d36f6d06c34aae8d0a2a5895c8ba4a17ad46a5fa59f361cb3e7e01a23030e38f901f6f901f3a06bd328a10bb674cc758bd1bccb8afb584808766434c28b85580b422c75d4130ea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794bcde5374fce5edbc8e2a8697c15331677e6ebf0ba0cb52de543653d86ccd13ba3ddf8b052525b04231c6884a4db3188a184681d878a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000002832fefd8808080a077355633b05269548d6b3bd8e80d334fcb1a31c566b980dfc56eb57d5c16acc388846c622f81a727e7" + } + ], + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020000", + "extraData" : "0x42", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x00", + "hash" : "b964d0b68e5a3c7265e4087dc2a8aaf599f06b6d6c1316a1b1b6475587f569e2", + "mixHash" : "b65f3c17c458ce015c087c3e4c0ffeeb010bf648a1faa2585c674d81ea7dcdfd", + "nonce" : "0b2ec3394d2421e3", + "number" : "0x00", + "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "7dba07d6b448a186e9612e5f737d1c909dce473e53199901a302c00646d523c1", + "timestamp" : "0x54c98c81", + "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "genesisRLP" : "0xf901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a07dba07d6b448a186e9612e5f737d1c909dce473e53199901a302c00646d523c1a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000080832fefd8808454c98c8142a0b65f3c17c458ce015c087c3e4c0ffeeb010bf648a1faa2585c674d81ea7dcdfd880b2ec3394d2421e3c0c0", + "lastblockhash" : "4c179927c9b9897464c7133033b412c9b66ee2bb1fa4a4b2595a6006d4081e3f", + "postState" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x14", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "8888f1f195afa192cfee860698584c030f4c9db1" : { + "balance" : "0x8ac7230489e8a410", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x09184e71fbdc", + "code" : "0x", + "nonce" : "0x02", + "storage" : { + } + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x09184e72a000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + } + }, + "uncleTimestampMaxUint256" : { + "blocks" : [ + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020000", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x5208", + "hash" : "19c900975f94fd78dc12ad13740200fbe0a2eba43fd070bedc65588b0c95438a", + "mixHash" : "4296af28ea723598c959f1cabc6f01fa0c75d126cfde89f13ccd9debcf3079c3", + "nonce" : "3213b3fd7789f5d5", + "number" : "0x01", + "parentHash" : "e688d736f1307c6f97b6777381b30556137b9d4ca5c43fbd5b30d6b5df315264", + "receiptTrie" : "e9244cf7503b79c03d3a099e07a80d2dbc77bb0b502d8a89d51ac0d68dd31313", + "stateRoot" : "cb52de543653d86ccd13ba3ddf8b052525b04231c6884a4db3188a184681d878", + "timestamp" : "0x55d9c571", + "transactionsTrie" : "5c9151c2413d1cd25c51ffb4ac38948acc1359bf08c6b49f283660e9bcf0f516", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "rlp" : "0xf90261f901f9a0e688d736f1307c6f97b6777381b30556137b9d4ca5c43fbd5b30d6b5df315264a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0cb52de543653d86ccd13ba3ddf8b052525b04231c6884a4db3188a184681d878a05c9151c2413d1cd25c51ffb4ac38948acc1359bf08c6b49f283660e9bcf0f516a0e9244cf7503b79c03d3a099e07a80d2dbc77bb0b502d8a89d51ac0d68dd31313b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000001832fefd88252088455d9c57180a04296af28ea723598c959f1cabc6f01fa0c75d126cfde89f13ccd9debcf3079c3883213b3fd7789f5d5f862f86080018304cb2f94095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba077c7cd36820c71821c1aed59de46e70e701c4a8dd89c9ba508ab722210f60da8a03f29825d40c7c3f7bff3ca69267e0f3fb74b2d18b8c2c4e3c135b5d3b06e288dc0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x00", + "r" : "0x77c7cd36820c71821c1aed59de46e70e701c4a8dd89c9ba508ab722210f60da8", + "s" : "0x3f29825d40c7c3f7bff3ca69267e0f3fb74b2d18b8c2c4e3c135b5d3b06e288d", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1b", + "value" : "0x0a" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020040", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x5208", + "hash" : "04e0807bea4d9766809afba8f4dbf2e5ab4e522aa4570bb915381c6593530e89", + "mixHash" : "782e9bf4a3427dee8cf2494f966830dd04a217eb5cf8769dba0ed6400212264f", + "nonce" : "e83b4878a0b9a46f", + "number" : "0x02", + "parentHash" : "19c900975f94fd78dc12ad13740200fbe0a2eba43fd070bedc65588b0c95438a", + "receiptTrie" : "5ea1a8b24652fed0ecab4738edd9211891eb8c4353c345973b78a02cc0f32f6b", + "stateRoot" : "e7e4760f75476ec7f51869d8bdce5c693058fd5a95c77ea9c0bf7ced1e50d70e", + "timestamp" : "0x55d9c573", + "transactionsTrie" : "c673e076264c4669a5c2e479f1757b78e42511efe33b5fd2c0a23b929c7f87f5", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "rlp" : "0xf90260f901f9a019c900975f94fd78dc12ad13740200fbe0a2eba43fd070bedc65588b0c95438aa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0e7e4760f75476ec7f51869d8bdce5c693058fd5a95c77ea9c0bf7ced1e50d70ea0c673e076264c4669a5c2e479f1757b78e42511efe33b5fd2c0a23b929c7f87f5a05ea1a8b24652fed0ecab4738edd9211891eb8c4353c345973b78a02cc0f32f6bb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302004002832fefd88252088455d9c57380a0782e9bf4a3427dee8cf2494f966830dd04a217eb5cf8769dba0ed6400212264f88e83b4878a0b9a46ff861f85f01018304cb2f94095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba033c86e64d708c97c6b135cadff79dbf45985aa0b53694789e90d15f756765f239f1d0f8caa2a16405148c9d85581be5814960010f3cba938b5501590cea1f7cfc0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x01", + "r" : "0x33c86e64d708c97c6b135cadff79dbf45985aa0b53694789e90d15f756765f23", + "s" : "0x1d0f8caa2a16405148c9d85581be5814960010f3cba938b5501590cea1f7cf", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1b", + "value" : "0x0a" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020080", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x5208", + "hash" : "eed1b4da708283370856fc76352d68f36d9766b7f366da372e2992ced9a1f663", + "mixHash" : "c250fe02a675a64e068023f48df2662ff2269d970f7689bde287228e200d5401", + "nonce" : "105781dacf8bcf41", + "number" : "0x03", + "parentHash" : "04e0807bea4d9766809afba8f4dbf2e5ab4e522aa4570bb915381c6593530e89", + "receiptTrie" : "4ede0225773c7a517b91994aca65ade45124e7ef4b8be1e6097c9773a11920af", + "stateRoot" : "e9940294a09308406a3d2e09203aed11db40259fac0a25e639ad2b30b82d07de", + "timestamp" : "0x55d9c577", + "transactionsTrie" : "1722b8a91bfc4f5614ce36ee77c7cce6620ab4af36d3c54baa66d7dbeb7bce1a", + "uncleHash" : "1e8797b712282d23d059df15e9082411499795fe2644bdfb35f310c10c78169b" + }, + "rlp" : "0xf90479f901f9a004e0807bea4d9766809afba8f4dbf2e5ab4e522aa4570bb915381c6593530e89a01e8797b712282d23d059df15e9082411499795fe2644bdfb35f310c10c78169b948888f1f195afa192cfee860698584c030f4c9db1a0e9940294a09308406a3d2e09203aed11db40259fac0a25e639ad2b30b82d07dea01722b8a91bfc4f5614ce36ee77c7cce6620ab4af36d3c54baa66d7dbeb7bce1aa04ede0225773c7a517b91994aca65ade45124e7ef4b8be1e6097c9773a11920afb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302008003832fefd88252088455d9c57780a0c250fe02a675a64e068023f48df2662ff2269d970f7689bde287228e200d540188105781dacf8bcf41f862f86002018304cb2f94095e7baea6a6c7c4c2dfeb977efac326af552d870a801ca015eb1cc916728b9799e55c489857727669afb2986433d5f54cde11faaed9f0eea05d36f6d06c34aae8d0a2a5895c8ba4a17ad46a5fa59f361cb3e7e01a23030e38f90216f90213a019c900975f94fd78dc12ad13740200fbe0a2eba43fd070bedc65588b0c95438aa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794bcde5374fce5edbc8e2a8697c15331677e6ebf0ba0cb52de543653d86ccd13ba3ddf8b052525b04231c6884a4db3188a184681d878a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000002832fefd880a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80a06868c784ca472bb16eb9b23029965a737713003d0da6c006e4923e400cd783fc88d99c24fcd2648302", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x02", + "r" : "0x15eb1cc916728b9799e55c489857727669afb2986433d5f54cde11faaed9f0ee", + "s" : "0x5d36f6d06c34aae8d0a2a5895c8ba4a17ad46a5fa59f361cb3e7e01a23030e38", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1c", + "value" : "0x0a" + } + ], + "uncleHeaders" : [ + { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "bcde5374fce5edbc8e2a8697c15331677e6ebf0b", + "difficulty" : "0x020000", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x00", + "hash" : "5264110fedc6f468e9b3c1fead10ee4bdd4957bcb6d193503f8ede6a0d478b95", + "mixHash" : "6868c784ca472bb16eb9b23029965a737713003d0da6c006e4923e400cd783fc", + "nonce" : "d99c24fcd2648302", + "number" : "0x02", + "parentHash" : "19c900975f94fd78dc12ad13740200fbe0a2eba43fd070bedc65588b0c95438a", + "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "cb52de543653d86ccd13ba3ddf8b052525b04231c6884a4db3188a184681d878", + "timestamp" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + } + ], + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020000", + "extraData" : "0x42", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x00", + "hash" : "e688d736f1307c6f97b6777381b30556137b9d4ca5c43fbd5b30d6b5df315264", + "mixHash" : "f35b4695bdfef02db19d255636bec7911667c7056df2b2f475053ea78dd1b0ff", + "nonce" : "5333c47f947590d8", + "number" : "0x00", + "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "7dba07d6b448a186e9612e5f737d1c909dce473e53199901a302c00646d523c1", + "timestamp" : "0x54c98c81", + "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "genesisRLP" : "0xf901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a07dba07d6b448a186e9612e5f737d1c909dce473e53199901a302c00646d523c1a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000080832fefd8808454c98c8142a0f35b4695bdfef02db19d255636bec7911667c7056df2b2f475053ea78dd1b0ff885333c47f947590d8c0c0", + "lastblockhash" : "eed1b4da708283370856fc76352d68f36d9766b7f366da372e2992ced9a1f663", + "postState" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x14", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "8888f1f195afa192cfee860698584c030f4c9db1" : { + "balance" : "0x8ac7230489e8a410", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x09184e71fbdc", + "code" : "0x", + "nonce" : "0x02", + "storage" : { + } + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x09184e72a000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + } } -}
\ No newline at end of file +} diff --git a/tests/util.go b/tests/util.go index 3b94effc8..a9b5011a9 100644 --- a/tests/util.go +++ b/tests/util.go @@ -135,7 +135,7 @@ type Env struct { coinbase common.Address number *big.Int - time uint64 + time *big.Int difficulty *big.Int gasLimit *big.Int @@ -165,7 +165,7 @@ func NewEnvFromMap(state *state.StateDB, envValues map[string]string, exeValues //env.parent = common.Hex2Bytes(envValues["previousHash"]) env.coinbase = common.HexToAddress(envValues["currentCoinbase"]) env.number = common.Big(envValues["currentNumber"]) - env.time = common.Big(envValues["currentTimestamp"]).Uint64() + env.time = common.Big(envValues["currentTimestamp"]) env.difficulty = common.Big(envValues["currentDifficulty"]) env.gasLimit = common.Big(envValues["currentGasLimit"]) env.Gas = new(big.Int) @@ -178,7 +178,7 @@ func (self *Env) BlockNumber() *big.Int { return self.number } //func (self *Env) PrevHash() []byte { return self.parent } func (self *Env) Coinbase() common.Address { return self.coinbase } -func (self *Env) Time() uint64 { return self.time } +func (self *Env) Time() *big.Int { return self.time } func (self *Env) Difficulty() *big.Int { return self.difficulty } func (self *Env) State() *state.StateDB { return self.state } func (self *Env) GasLimit() *big.Int { return self.gasLimit } |