From 6a2d94e21548f92552a3e75663ff0e3321f669a5 Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Tue, 16 Jan 2024 16:40:47 +0530 Subject: [PATCH] fix : integration tests --- eth/ethconfig/config.go | 2 +- tests/bor/bor_test.go | 15 ++++++++------- tests/bor/helper.go | 5 +++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 6befe5a45d..e44d2877bd 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -67,7 +67,7 @@ var LightClientGPO = gasprice.Config{ // Defaults contains default settings for use on the Ethereum main net. var Defaults = Config{ - SyncMode: downloader.SnapSync, + SyncMode: downloader.FullSync, NetworkId: 0, // enable auto configuration of networkID == chainID TxLookupLimit: 2350000, TransactionHistory: 2350000, diff --git a/tests/bor/bor_test.go b/tests/bor/bor_test.go index 07c9ecc5dc..8e9d725429 100644 --- a/tests/bor/bor_test.go +++ b/tests/bor/bor_test.go @@ -41,6 +41,7 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/tests/bor/mocks" + "github.com/ethereum/go-ethereum/trie" ) var ( @@ -792,7 +793,7 @@ func TestEIP1559Transition(t *testing.T) { gspec.Config.BerlinBlock = common.Big0 gspec.Config.LondonBlock = common.Big0 - genesis := gspec.MustCommit(db) + genesis := gspec.MustCommit(db, trie.NewDatabase(db, trie.HashDefaults)) signer := types.LatestSigner(gspec.Config) blocks, _ := core.GenerateChain(gspec.Config, genesis, engine, db, 1, func(i int, b *core.BlockGen) { @@ -820,7 +821,7 @@ func TestEIP1559Transition(t *testing.T) { }) diskdb := rawdb.NewMemoryDatabase() - gspec.MustCommit(diskdb) + gspec.MustCommit(diskdb, trie.NewDatabase(diskdb, trie.HashDefaults)) chain, err := core.NewBlockChain(diskdb, nil, gspec, nil, engine, vm.Config{}, nil, nil, nil) if err != nil { @@ -1015,7 +1016,7 @@ func TestBurnContract(t *testing.T) { "2": "0x000000000000000000000000000000000000aaad", "3": "0x000000000000000000000000000000000000aaae", } - genesis := gspec.MustCommit(db) + genesis := gspec.MustCommit(db, trie.NewDatabase(db, trie.HashDefaults)) signer := types.LatestSigner(gspec.Config) blocks, _ := core.GenerateChain(gspec.Config, genesis, engine, db, 1, func(i int, b *core.BlockGen) { @@ -1043,7 +1044,7 @@ func TestBurnContract(t *testing.T) { }) diskdb := rawdb.NewMemoryDatabase() - gspec.MustCommit(diskdb) + gspec.MustCommit(diskdb, trie.NewDatabase(diskdb, trie.HashDefaults)) chain, err := core.NewBlockChain(diskdb, nil, gspec, nil, engine, vm.Config{}, nil, nil, nil) if err != nil { @@ -1292,7 +1293,7 @@ func TestEIP1559TransitionWithEIP155(t *testing.T) { } ) - genesis := gspec.MustCommit(db) + genesis := gspec.MustCommit(db, trie.NewDatabase(db, trie.HashDefaults)) // Use signer without chain ID signer := types.HomesteadSigner{} @@ -1365,7 +1366,7 @@ func TestTransitionWithoutEIP155(t *testing.T) { } ) - genesis := gspec.MustCommit(db) + genesis := gspec.MustCommit(db, trie.NewDatabase(db, trie.HashDefaults)) // Use signer without chain ID signer := types.HomesteadSigner{} @@ -1397,7 +1398,7 @@ func TestTransitionWithoutEIP155(t *testing.T) { }) diskdb := rawdb.NewMemoryDatabase() - gspec.MustCommit(diskdb) + gspec.MustCommit(diskdb, trie.NewDatabase(diskdb, trie.HashDefaults)) chain, err := core.NewBlockChain(diskdb, nil, gspec, nil, engine, vm.Config{}, nil, nil, nil) if err != nil { diff --git a/tests/bor/helper.go b/tests/bor/helper.go index cc17dc9647..471ac107e8 100644 --- a/tests/bor/helper.go +++ b/tests/bor/helper.go @@ -44,6 +44,7 @@ import ( "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/tests/bor/mocks" + "github.com/ethereum/go-ethereum/trie" ) var ( @@ -127,14 +128,14 @@ func buildEthereumInstance(t *testing.T, db ethdb.Database) *initializeData { BorLogs: true, } - ethConf.Genesis.MustCommit(db) + ethConf.Genesis.MustCommit(db, trie.NewDatabase(db, trie.HashDefaults)) ethereum := utils.CreateBorEthereum(ethConf) if err != nil { t.Fatalf("failed to register Ethereum protocol: %v", err) } - ethConf.Genesis.MustCommit(ethereum.ChainDb()) + ethConf.Genesis.MustCommit(ethereum.ChainDb(), trie.NewDatabase(ethereum.ChainDb(), trie.HashDefaults)) ethereum.Engine().(*bor.Bor).Authorize(addr, func(account accounts.Account, s string, data []byte) ([]byte, error) { return crypto.Sign(crypto.Keccak256(data), key)