mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 22:56:43 +00:00
upstream: fixed a few unit tests
This commit is contained in:
parent
6f7df946d3
commit
0ecde767da
3 changed files with 20 additions and 3 deletions
|
|
@ -33,6 +33,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/common/math"
|
"github.com/ethereum/go-ethereum/common/math"
|
||||||
"github.com/ethereum/go-ethereum/consensus/ethash"
|
"github.com/ethereum/go-ethereum/consensus/ethash"
|
||||||
"github.com/ethereum/go-ethereum/core"
|
"github.com/ethereum/go-ethereum/core"
|
||||||
|
"github.com/ethereum/go-ethereum/core/filtermaps"
|
||||||
"github.com/ethereum/go-ethereum/core/rawdb"
|
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||||
"github.com/ethereum/go-ethereum/core/state"
|
"github.com/ethereum/go-ethereum/core/state"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
|
|
@ -99,6 +100,8 @@ func NewSimulatedBackendWithDatabase(database ethdb.Database, alloc types.Genesi
|
||||||
config: genesis.Config,
|
config: genesis.Config,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filterBackend := &filterBackend{database, blockchain, backend}
|
||||||
|
backend.filterSystem = filters.NewFilterSystem(filterBackend, filters.Config{})
|
||||||
backend.events = filters.NewEventSystem(backend.filterSystem)
|
backend.events = filters.NewEventSystem(backend.filterSystem)
|
||||||
|
|
||||||
header := backend.blockchain.CurrentBlock()
|
header := backend.blockchain.CurrentBlock()
|
||||||
|
|
@ -970,6 +973,10 @@ func (fb *filterBackend) CurrentHeader() *types.Header {
|
||||||
panic("not supported")
|
panic("not supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fb *filterBackend) NewMatcherBackend() filtermaps.MatcherBackend {
|
||||||
|
panic("not supported")
|
||||||
|
}
|
||||||
|
|
||||||
func nullSubscription() event.Subscription {
|
func nullSubscription() event.Subscription {
|
||||||
return event.NewSubscription(func(quit <-chan struct{}) error {
|
return event.NewSubscription(func(quit <-chan struct{}) error {
|
||||||
<-quit
|
<-quit
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,17 @@ import (
|
||||||
|
|
||||||
func TestCalcExcessBlobGas(t *testing.T) {
|
func TestCalcExcessBlobGas(t *testing.T) {
|
||||||
var (
|
var (
|
||||||
config = params.MainnetChainConfig
|
config = ¶ms.ChainConfig{
|
||||||
|
LondonBlock: big.NewInt(0),
|
||||||
|
CancunBlock: big.NewInt(0),
|
||||||
|
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
||||||
|
Cancun: ¶ms.BlobConfig{
|
||||||
|
Target: 3,
|
||||||
|
Max: 6,
|
||||||
|
UpdateFraction: 3338477,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
targetBlobs = targetBlobsPerBlock(config, uint64(0))
|
targetBlobs = targetBlobsPerBlock(config, uint64(0))
|
||||||
targetBlobGas = uint64(targetBlobs) * params.BlobTxBlobGasPerBlob
|
targetBlobGas = uint64(targetBlobs) * params.BlobTxBlobGasPerBlob
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -2292,7 +2292,7 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
|
||||||
mergeBlock = 0
|
mergeBlock = 0
|
||||||
|
|
||||||
// Set the terminal total difficulty in the config
|
// Set the terminal total difficulty in the config
|
||||||
gspec.Config.TerminalTotalDifficulty = big.NewInt(0)
|
chain.Config().TerminalTotalDifficulty = big.NewInt(0)
|
||||||
}
|
}
|
||||||
genDb, blocks, _ := GenerateChainWithGenesis(gspec, engine, 2*state.TriesInMemory, func(i int, gen *BlockGen) {
|
genDb, blocks, _ := GenerateChainWithGenesis(gspec, engine, 2*state.TriesInMemory, func(i int, gen *BlockGen) {
|
||||||
tx, err := types.SignTx(types.NewTransaction(nonce, common.HexToAddress("deadbeef"), big.NewInt(100), 21000, big.NewInt(int64(i+1)*params.GWei), nil), signer, key)
|
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
|
||||||
// Set the terminal total difficulty in the config
|
// Set the terminal total difficulty in the config
|
||||||
ttd := big.NewInt(int64(len(blocks)))
|
ttd := big.NewInt(int64(len(blocks)))
|
||||||
ttd.Mul(ttd, params.GenesisDifficulty)
|
ttd.Mul(ttd, params.GenesisDifficulty)
|
||||||
gspec.Config.TerminalTotalDifficulty = ttd
|
chain.Config().TerminalTotalDifficulty = ttd
|
||||||
mergeBlock = len(blocks)
|
mergeBlock = len(blocks)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue