Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ type SimulatedBackend struct {
func NewSimulatedBackendWithDatabase(database ethdb.Database, alloc core.GenesisAlloc, gasLimit uint64) *SimulatedBackend {
copyConfig := *params.TestChainConfig
copyConfig.ChainID = big.NewInt(1337)
copyConfig.FeeConfig.GasLimit = big.NewInt(int64(gasLimit))
genesis := core.Genesis{
Config: &copyConfig,
GasLimit: gasLimit,
Expand Down
5 changes: 2 additions & 3 deletions core/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,8 @@ func benchInsertChain(b *testing.B, disk bool, gen func(int, *BlockGen)) {
// Generate a chain of b.N blocks using the supplied block
// generator function.
gspec := &Genesis{
Config: params.TestChainConfig,
Alloc: GenesisAlloc{benchRootAddr: {Balance: benchRootFunds}},
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
Config: params.TestChainConfig,
Alloc: GenesisAlloc{benchRootAddr: {Balance: benchRootFunds}},
}
_, chain, _, _ := GenerateChainWithGenesis(gspec, dummy.NewCoinbaseFaker(), b.N, 10, gen)

Expand Down
7 changes: 3 additions & 4 deletions core/blockchain_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ func TestEmitLogsCorrectness(t *testing.T) {
addr1 = crypto.PubkeyToAddress(key1.PublicKey)
funds = new(big.Int).Mul(big.NewInt(100), big.NewInt(params.Ether))
gspec = &Genesis{
Config: params.TestChainConfig,
Alloc: GenesisAlloc{addr1: {Balance: funds}},
BaseFee: big.NewInt(params.TestInitialBaseFee),
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
Config: params.TestChainConfig,
Alloc: GenesisAlloc{addr1: {Balance: funds}},
BaseFee: big.NewInt(params.TestInitialBaseFee),
}
contractAddress = crypto.CreateAddress(addr1, 0)
signer = types.LatestSigner(gspec.Config)
Expand Down
5 changes: 2 additions & 3 deletions core/blockchain_repair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,8 @@ func testRepair(t *testing.T, tt *rewindTest, snapshots bool) {
// Initialize a fresh chain
var (
gspec = &Genesis{
BaseFee: big.NewInt(params.TestInitialBaseFee),
Config: params.TestChainConfig,
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
BaseFee: big.NewInt(params.TestInitialBaseFee),
Config: params.TestChainConfig,
}
engine = dummy.NewFullFaker()
config = &CacheConfig{
Expand Down
5 changes: 2 additions & 3 deletions core/blockchain_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ func (basic *snapshotTestBasic) prepare(t *testing.T) (*BlockChain, []*types.Blo
// Initialize a fresh chain
var (
gspec = &Genesis{
BaseFee: big.NewInt(params.TestInitialBaseFee),
Config: params.TestChainConfig,
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
BaseFee: big.NewInt(params.TestInitialBaseFee),
Config: params.TestChainConfig,
}
engine = dummy.NewFullFaker()

Expand Down
20 changes: 7 additions & 13 deletions core/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,8 @@ func testRepopulateMissingTriesParallel(t *testing.T, parallelism int) {
// Ensure that key1 has some funds in the genesis block.
genesisBalance := big.NewInt(1000000)
gspec := &Genesis{
Config: &params.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig},
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
Config: &params.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig},
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := createBlockChain(chainDB, pruningConfig, gspec, common.Hash{})
Expand Down Expand Up @@ -514,9 +513,8 @@ func TestUngracefulAsyncShutdown(t *testing.T) {
// Ensure that key1 has some funds in the genesis block.
genesisBalance := big.NewInt(1000000)
gspec := &Genesis{
Config: &params.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig},
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
Config: &params.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig},
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down Expand Up @@ -780,10 +778,9 @@ func TestCanonicalHashMarker(t *testing.T) {
for _, c := range cases {
var (
gspec = &Genesis{
Config: params.TestChainConfig,
Alloc: GenesisAlloc{},
BaseFee: big.NewInt(params.TestInitialBaseFee),
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
Config: params.TestChainConfig,
Alloc: GenesisAlloc{},
BaseFee: big.NewInt(params.TestInitialBaseFee),
}
engine = dummy.NewCoinbaseFaker()
)
Expand Down Expand Up @@ -924,7 +921,6 @@ func testCreateThenDelete(t *testing.T, config *params.ChainConfig) {
Alloc: GenesisAlloc{
address: {Balance: funds},
},
GasLimit: config.FeeConfig.GasLimit.Uint64(),
}
nonce := uint64(0)
signer := types.HomesteadSigner{}
Expand Down Expand Up @@ -1012,7 +1008,6 @@ func TestTransientStorageReset(t *testing.T) {
Alloc: GenesisAlloc{
address: {Balance: funds},
},
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
}
nonce := uint64(0)
signer := types.HomesteadSigner{}
Expand Down Expand Up @@ -1107,7 +1102,6 @@ func TestEIP3651(t *testing.T) {
Balance: big.NewInt(0),
},
},
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
}
)

Expand Down
5 changes: 2 additions & 3 deletions core/headerchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ func TestHeaderInsertion(t *testing.T) {
var (
db = rawdb.NewMemoryDatabase()
gspec = &Genesis{
BaseFee: big.NewInt(params.TestInitialBaseFee),
Config: params.TestChainConfig,
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
BaseFee: big.NewInt(params.TestInitialBaseFee),
Config: params.TestChainConfig,
}
)
genesis := gspec.ToBlock()
Expand Down
2 changes: 2 additions & 0 deletions core/state_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ func TestStateProcessorErrors(t *testing.T) {
gspec = &Genesis{
Config: &params.ChainConfig{
ChainID: big.NewInt(1),
FeeConfig: params.DefaultFeeConfig,
HomesteadBlock: big.NewInt(0),
EIP150Block: big.NewInt(0),
EIP150Hash: common.Hash{},
Expand All @@ -235,6 +236,7 @@ func TestStateProcessorErrors(t *testing.T) {
Nonce: 0,
},
},
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
}
blockchain, _ = NewBlockChain(db, DefaultCacheConfig, gspec, dummy.NewCoinbaseFaker(), vm.Config{}, common.Hash{}, false)
)
Expand Down
20 changes: 8 additions & 12 deletions core/test_blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1275,9 +1275,8 @@ func TestGenerateChainInvalidBlockFee(t *testing.T, create func(db ethdb.Databas
// Ensure that key1 has some funds in the genesis block.
genesisBalance := new(big.Int).Mul(big.NewInt(1000000), big.NewInt(params.Ether))
gspec := &Genesis{
Config: params.TestChainConfig,
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
Config: params.TestChainConfig,
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down Expand Up @@ -1325,9 +1324,8 @@ func TestInsertChainInvalidBlockFee(t *testing.T, create func(db ethdb.Database,
// Ensure that key1 has some funds in the genesis block.
genesisBalance := new(big.Int).Mul(big.NewInt(1000000), big.NewInt(params.Ether))
gspec := &Genesis{
Config: params.TestChainConfig,
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
Config: params.TestChainConfig,
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down Expand Up @@ -1382,9 +1380,8 @@ func TestInsertChainValidBlockFee(t *testing.T, create func(db ethdb.Database, g
// Ensure that key1 has some funds in the genesis block.
genesisBalance := new(big.Int).Mul(big.NewInt(1000000), big.NewInt(params.Ether))
gspec := &Genesis{
Config: params.TestChainConfig,
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
Config: params.TestChainConfig,
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down Expand Up @@ -1479,9 +1476,8 @@ func TestStatefulPrecompiles(t *testing.T, create func(db ethdb.Database, gspec
feemanager.ConfigKey: feemanager.NewConfig(utils.NewUint64(0), []common.Address{addr1}, nil, nil),
}
gspec := &Genesis{
Config: &config,
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: config.FeeConfig.GasLimit.Uint64(),
Config: &config,
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down
10 changes: 4 additions & 6 deletions eth/gasprice/gasprice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ func (b *testBackend) teardown() {

func newTestBackendFakerEngine(t *testing.T, config *params.ChainConfig, numBlocks int, genBlocks func(i int, b *core.BlockGen)) *testBackend {
var gspec = &core.Genesis{
Config: config,
Alloc: core.GenesisAlloc{addr: core.GenesisAccount{Balance: bal}},
GasLimit: config.FeeConfig.GasLimit.Uint64(),
Config: config,
Alloc: core.GenesisAlloc{addr: core.GenesisAccount{Balance: bal}},
}

engine := dummy.NewETHFaker()
Expand All @@ -128,9 +127,8 @@ func newTestBackendFakerEngine(t *testing.T, config *params.ChainConfig, numBloc
// after use, otherwise the blockchain instance will mem-leak via goroutines.
func newTestBackend(t *testing.T, config *params.ChainConfig, numBlocks int, genBlocks func(i int, b *core.BlockGen)) *testBackend {
var gspec = &core.Genesis{
Config: config,
Alloc: core.GenesisAlloc{addr: core.GenesisAccount{Balance: bal}},
GasLimit: config.FeeConfig.GasLimit.Uint64(),
Config: config,
Alloc: core.GenesisAlloc{addr: core.GenesisAccount{Balance: bal}},
}

engine := dummy.NewFaker()
Expand Down
5 changes: 0 additions & 5 deletions eth/tracers/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ func TestTraceCall(t *testing.T) {
accounts[1].addr: {Balance: big.NewInt(params.Ether)},
accounts[2].addr: {Balance: big.NewInt(params.Ether)},
},
GasLimit: params.TestSubnetEVMConfig.FeeConfig.GasLimit.Uint64(),
}
genBlocks := 10
signer := types.HomesteadSigner{}
Expand Down Expand Up @@ -352,7 +351,6 @@ func TestTraceTransaction(t *testing.T) {
accounts[0].addr: {Balance: big.NewInt(params.Ether)},
accounts[1].addr: {Balance: big.NewInt(params.Ether)},
},
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
}
target := common.Hash{}
signer := types.HomesteadSigner{}
Expand Down Expand Up @@ -403,7 +401,6 @@ func TestTraceBlock(t *testing.T) {
accounts[1].addr: {Balance: big.NewInt(params.Ether)},
accounts[2].addr: {Balance: big.NewInt(params.Ether)},
},
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
}
genBlocks := 10
signer := types.HomesteadSigner{}
Expand Down Expand Up @@ -493,7 +490,6 @@ func TestTracingWithOverrides(t *testing.T) {
},
},
},
GasLimit: params.TestSubnetEVMConfig.FeeConfig.GasLimit.Uint64(),
}
genBlocks := 10
signer := types.HomesteadSigner{}
Expand Down Expand Up @@ -855,7 +851,6 @@ func TestTraceChain(t *testing.T) {
accounts[1].addr: {Balance: big.NewInt(5 * params.Ether)},
accounts[2].addr: {Balance: big.NewInt(5 * params.Ether)},
},
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
}
genBlocks := 50
signer := types.HomesteadSigner{}
Expand Down