eth : Add node id to handlerConfig in test

This commit is contained in:
ucwong 2024-03-03 20:40:15 +08:00
parent 00905f7dc4
commit e317f978ef
2 changed files with 4 additions and 0 deletions

View file

@ -106,6 +106,7 @@ func testForkIDSplit(t *testing.T, protocol uint) {
_, blocksProFork, _ = core.GenerateChainWithGenesis(gspecProFork, engine, 2, nil)
ethNoFork, _ = newHandler(&handlerConfig{
NodeID: enode.ID{0, 0, 0, 0, 0, 0, 0, 128, 106, 217, 182, 31, 165, 174, 1, 67, 7, 235, 220, 150, 66, 83, 173, 205, 159, 44, 10, 57, 42, 161, 26, 188},
Database: dbNoFork,
Chain: chainNoFork,
TxPool: newTestTxPool(),
@ -115,6 +116,7 @@ func testForkIDSplit(t *testing.T, protocol uint) {
BloomCache: 1,
})
ethProFork, _ = newHandler(&handlerConfig{
NodeID: enode.ID{0, 0, 0, 0, 0, 0, 0, 128, 106, 217, 182, 31, 165, 174, 1, 67, 7, 235, 220, 150, 66, 83, 173, 205, 159, 44, 10, 57, 42, 161, 26, 188},
Database: dbProFork,
Chain: chainProFork,
TxPool: newTestTxPool(),

View file

@ -33,6 +33,7 @@ import (
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/params"
"github.com/holiman/uint256"
)
@ -161,6 +162,7 @@ func newTestHandlerWithBlocks(blocks int) *testHandler {
txpool := newTestTxPool()
handler, _ := newHandler(&handlerConfig{
NodeID: enode.ID{0, 0, 0, 0, 0, 0, 0, 128, 106, 217, 182, 31, 165, 174, 1, 67, 7, 235, 220, 150, 66, 83, 173, 205, 159, 44, 10, 57, 42, 161, 26, 188},
Database: db,
Chain: chain,
TxPool: txpool,