aboutsummaryrefslogtreecommitdiffstats
path: root/tests/block_test_util.go
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-08-24 08:52:53 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-08-25 10:46:11 +0800
commit7324176f702a77fc331bf16a968d2eb4bccce021 (patch)
treea9fef3b9ee46fc382dde23cdd90209cc4298dd59 /tests/block_test_util.go
parentd51d0022cee91d6588186455afbe6e54fae2cbf7 (diff)
downloaddexon-7324176f702a77fc331bf16a968d2eb4bccce021.tar.gz
dexon-7324176f702a77fc331bf16a968d2eb4bccce021.tar.zst
dexon-7324176f702a77fc331bf16a968d2eb4bccce021.zip
Add tests for uncle timestamps and refactor timestamp type
Diffstat (limited to 'tests/block_test_util.go')
-rw-r--r--tests/block_test_util.go6
1 files changed, 3 insertions, 3 deletions
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