mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
eth/protocols/eth: remove use of ReceiptsRLPPacket in test
This commit is contained in:
parent
31b5d5aa3a
commit
dddcb3c023
1 changed files with 5 additions and 6 deletions
|
|
@ -586,16 +586,15 @@ func testGetBlockReceipts(t *testing.T, protocol uint) {
|
||||||
// Collect the hashes to request, and the response to expect
|
// Collect the hashes to request, and the response to expect
|
||||||
var (
|
var (
|
||||||
hashes []common.Hash
|
hashes []common.Hash
|
||||||
receipts []rlp.RawValue
|
receipts rlp.RawList[*ReceiptList]
|
||||||
)
|
)
|
||||||
for i := uint64(0); i <= backend.chain.CurrentBlock().Number.Uint64(); i++ {
|
for i := uint64(0); i <= backend.chain.CurrentBlock().Number.Uint64(); i++ {
|
||||||
block := backend.chain.GetBlockByNumber(i)
|
block := backend.chain.GetBlockByNumber(i)
|
||||||
hashes = append(hashes, block.Hash())
|
hashes = append(hashes, block.Hash())
|
||||||
|
|
||||||
receiptsRLP := backend.chain.GetReceiptsRLP(block.Hash())
|
receiptsRLP := backend.chain.GetReceiptsRLP(block.Hash())
|
||||||
bodyRLP := backend.chain.GetBodyRLP(block.Hash())
|
bodyRLP := backend.chain.GetBodyRLP(block.Hash())
|
||||||
tr, _ := encodeTypes(receiptsRLP, bodyRLP)
|
tr, _ := encodeTypes(receiptsRLP, bodyRLP)
|
||||||
receipts = append(receipts, tr)
|
receipts.AppendRaw(tr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send the hash request and verify the response
|
// Send the hash request and verify the response
|
||||||
|
|
@ -603,9 +602,9 @@ func testGetBlockReceipts(t *testing.T, protocol uint) {
|
||||||
RequestId: 123,
|
RequestId: 123,
|
||||||
GetReceiptsRequest: hashes,
|
GetReceiptsRequest: hashes,
|
||||||
})
|
})
|
||||||
if err := p2p.ExpectMsg(peer.app, ReceiptsMsg, &ReceiptsRLPPacket{
|
if err := p2p.ExpectMsg(peer.app, ReceiptsMsg, &ReceiptsPacket{
|
||||||
RequestId: 123,
|
RequestId: 123,
|
||||||
ReceiptsRLPResponse: receipts,
|
List: receipts,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
t.Errorf("receipts mismatch: %v", err)
|
t.Errorf("receipts mismatch: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue