aboutsummaryrefslogtreecommitdiffstats
path: root/tests/block_test_util.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-06-30 08:22:19 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-06-30 08:22:19 +0800
commit7625b07dd9a2a7b5c5a504c1276eea04596ac871 (patch)
treece2a757cd4e0591fc15815b2dfae528ae517d36e /tests/block_test_util.go
parent72e2613a9fe3205fa5a67b72b832e03b2357ee88 (diff)
parent8f504063f465e0ca10c6bb53ee914d10a3d45c86 (diff)
downloadgo-tangerine-7625b07dd9a2a7b5c5a504c1276eea04596ac871.tar
go-tangerine-7625b07dd9a2a7b5c5a504c1276eea04596ac871.tar.gz
go-tangerine-7625b07dd9a2a7b5c5a504c1276eea04596ac871.tar.bz2
go-tangerine-7625b07dd9a2a7b5c5a504c1276eea04596ac871.tar.lz
go-tangerine-7625b07dd9a2a7b5c5a504c1276eea04596ac871.tar.xz
go-tangerine-7625b07dd9a2a7b5c5a504c1276eea04596ac871.tar.zst
go-tangerine-7625b07dd9a2a7b5c5a504c1276eea04596ac871.zip
Merge branch 'release/0.9.34'v0.9.34
Diffstat (limited to 'tests/block_test_util.go')
-rw-r--r--tests/block_test_util.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/block_test_util.go b/tests/block_test_util.go
index 5fdc6402e..450ef86a1 100644
--- a/tests/block_test_util.go
+++ b/tests/block_test_util.go
@@ -245,7 +245,7 @@ func (t *BlockTest) TryBlocksInsert(chainManager *core.ChainManager) error {
if b.BlockHeader == nil {
continue // OK - block is supposed to be invalid, continue with next block
} else {
- return fmt.Errorf("Block RLP decoding failed when expected to succeed: ", err)
+ return fmt.Errorf("Block RLP decoding failed when expected to succeed: %v", err)
}
}
// RLP decoding worked, try to insert into chain:
@@ -254,7 +254,7 @@ func (t *BlockTest) TryBlocksInsert(chainManager *core.ChainManager) error {
if b.BlockHeader == nil {
continue // OK - block is supposed to be invalid, continue with next block
} else {
- return fmt.Errorf("Block insertion into chain failed: ", err)
+ return fmt.Errorf("Block insertion into chain failed: %v", err)
}
}
if b.BlockHeader == nil {
@@ -262,7 +262,7 @@ func (t *BlockTest) TryBlocksInsert(chainManager *core.ChainManager) error {
}
err = t.validateBlockHeader(b.BlockHeader, cb.Header())
if err != nil {
- return fmt.Errorf("Block header validation failed: ", err)
+ return fmt.Errorf("Block header validation failed: %v", err)
}
}
return nil
@@ -286,7 +286,7 @@ func (s *BlockTest) validateBlockHeader(h *btHeader, h2 *types.Header) error {
expectedNonce := mustConvertBytes(h.Nonce)
if !bytes.Equal(expectedNonce, h2.Nonce[:]) {
- return fmt.Errorf("Nonce: expected: %v, decoded: %v", expectedNonce, h2.Nonce[:])
+ return fmt.Errorf("Nonce: expected: %v, decoded: %v", expectedNonce, h2.Nonce)
}
expectedNumber := mustConvertBigInt(h.Number, 16)
@@ -423,9 +423,8 @@ func mustConvertHeader(in btHeader) *types.Header {
GasLimit: mustConvertBigInt(in.GasLimit, 16),
Difficulty: mustConvertBigInt(in.Difficulty, 16),
Time: mustConvertUint(in.Timestamp, 16),
+ Nonce: types.EncodeNonce(mustConvertUint(in.Nonce, 16)),
}
- // XXX cheats? :-)
- header.SetNonce(mustConvertUint(in.Nonce, 16))
return header
}