diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-01-31 18:46:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-31 18:46:38 +0800 |
commit | fdb34b7a7c87142cde48a2ec092f77a56d66f773 (patch) | |
tree | 6608a33f95d5067d23f01c6951eca3f983c3566d /eth/protocol_test.go | |
parent | 07d4a022573444eac0db2f5da500cc5ee1e940bb (diff) | |
parent | 566d5c0777c2c5ee1a8fe3c0aee1e5c8c69053e2 (diff) | |
download | go-tangerine-fdb34b7a7c87142cde48a2ec092f77a56d66f773.tar go-tangerine-fdb34b7a7c87142cde48a2ec092f77a56d66f773.tar.gz go-tangerine-fdb34b7a7c87142cde48a2ec092f77a56d66f773.tar.bz2 go-tangerine-fdb34b7a7c87142cde48a2ec092f77a56d66f773.tar.lz go-tangerine-fdb34b7a7c87142cde48a2ec092f77a56d66f773.tar.xz go-tangerine-fdb34b7a7c87142cde48a2ec092f77a56d66f773.tar.zst go-tangerine-fdb34b7a7c87142cde48a2ec092f77a56d66f773.zip |
Merge pull request #15996 from karalabe/drop-redundant-methods
core, eth, les, light: get rid of redundant methods
Diffstat (limited to 'eth/protocol_test.go')
-rw-r--r-- | eth/protocol_test.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/eth/protocol_test.go b/eth/protocol_test.go index d3a44ae91..7cbcba571 100644 --- a/eth/protocol_test.go +++ b/eth/protocol_test.go @@ -42,7 +42,11 @@ func TestStatusMsgErrors63(t *testing.T) { testStatusMsgErrors(t, 63) } func testStatusMsgErrors(t *testing.T, protocol int) { pm := newTestProtocolManagerMust(t, downloader.FullSync, 0, nil, nil) - td, currentBlock, genesis := pm.blockchain.Status() + var ( + genesis = pm.blockchain.Genesis() + head = pm.blockchain.CurrentHeader() + td = pm.blockchain.GetTd(head.Hash(), head.Number.Uint64()) + ) defer pm.Stop() tests := []struct { @@ -55,16 +59,16 @@ func testStatusMsgErrors(t *testing.T, protocol int) { wantError: errResp(ErrNoStatusMsg, "first msg has code 2 (!= 0)"), }, { - code: StatusMsg, data: statusData{10, DefaultConfig.NetworkId, td, currentBlock, genesis}, + code: StatusMsg, data: statusData{10, DefaultConfig.NetworkId, td, head.Hash(), genesis.Hash()}, wantError: errResp(ErrProtocolVersionMismatch, "10 (!= %d)", protocol), }, { - code: StatusMsg, data: statusData{uint32(protocol), 999, td, currentBlock, genesis}, + code: StatusMsg, data: statusData{uint32(protocol), 999, td, head.Hash(), genesis.Hash()}, wantError: errResp(ErrNetworkIdMismatch, "999 (!= 1)"), }, { - code: StatusMsg, data: statusData{uint32(protocol), DefaultConfig.NetworkId, td, currentBlock, common.Hash{3}}, - wantError: errResp(ErrGenesisBlockMismatch, "0300000000000000 (!= %x)", genesis[:8]), + code: StatusMsg, data: statusData{uint32(protocol), DefaultConfig.NetworkId, td, head.Hash(), common.Hash{3}}, + wantError: errResp(ErrGenesisBlockMismatch, "0300000000000000 (!= %x)", genesis.Hash().Bytes()[:8]), }, } |