Skip to content

Commit 0ecde76

Browse files
upstream: fixed a few unit tests
1 parent 6f7df94 commit 0ecde76

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

accounts/abi/bind/backends/simulated.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
"github.com/ethereum/go-ethereum/common/math"
3434
"github.com/ethereum/go-ethereum/consensus/ethash"
3535
"github.com/ethereum/go-ethereum/core"
36+
"github.com/ethereum/go-ethereum/core/filtermaps"
3637
"github.com/ethereum/go-ethereum/core/rawdb"
3738
"github.com/ethereum/go-ethereum/core/state"
3839
"github.com/ethereum/go-ethereum/core/types"
@@ -99,6 +100,8 @@ func NewSimulatedBackendWithDatabase(database ethdb.Database, alloc types.Genesi
99100
config: genesis.Config,
100101
}
101102

103+
filterBackend := &filterBackend{database, blockchain, backend}
104+
backend.filterSystem = filters.NewFilterSystem(filterBackend, filters.Config{})
102105
backend.events = filters.NewEventSystem(backend.filterSystem)
103106

104107
header := backend.blockchain.CurrentBlock()
@@ -970,6 +973,10 @@ func (fb *filterBackend) CurrentHeader() *types.Header {
970973
panic("not supported")
971974
}
972975

976+
func (fb *filterBackend) NewMatcherBackend() filtermaps.MatcherBackend {
977+
panic("not supported")
978+
}
979+
973980
func nullSubscription() event.Subscription {
974981
return event.NewSubscription(func(quit <-chan struct{}) error {
975982
<-quit

consensus/misc/eip4844/eip4844_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@ import (
2727

2828
func TestCalcExcessBlobGas(t *testing.T) {
2929
var (
30-
config = params.MainnetChainConfig
30+
config = &params.ChainConfig{
31+
LondonBlock: big.NewInt(0),
32+
CancunBlock: big.NewInt(0),
33+
BlobScheduleConfig: &params.BlobScheduleConfig{
34+
Cancun: &params.BlobConfig{
35+
Target: 3,
36+
Max: 6,
37+
UpdateFraction: 3338477,
38+
},
39+
},
40+
}
3141
targetBlobs = targetBlobsPerBlock(config, uint64(0))
3242
targetBlobGas = uint64(targetBlobs) * params.BlobTxBlobGasPerBlob
3343
)

core/blockchain_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2292,7 +2292,7 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
22922292
mergeBlock = 0
22932293

22942294
// Set the terminal total difficulty in the config
2295-
gspec.Config.TerminalTotalDifficulty = big.NewInt(0)
2295+
chain.Config().TerminalTotalDifficulty = big.NewInt(0)
22962296
}
22972297
genDb, blocks, _ := GenerateChainWithGenesis(gspec, engine, 2*state.TriesInMemory, func(i int, gen *BlockGen) {
22982298
tx, err := types.SignTx(types.NewTransaction(nonce, common.HexToAddress("deadbeef"), big.NewInt(100), 21000, big.NewInt(int64(i+1)*params.GWei), nil), signer, key)
@@ -2329,7 +2329,7 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
23292329
// Set the terminal total difficulty in the config
23302330
ttd := big.NewInt(int64(len(blocks)))
23312331
ttd.Mul(ttd, params.GenesisDifficulty)
2332-
gspec.Config.TerminalTotalDifficulty = ttd
2332+
chain.Config().TerminalTotalDifficulty = ttd
23332333
mergeBlock = len(blocks)
23342334
}
23352335

0 commit comments

Comments
 (0)