Skip to content

Commit

Permalink
Disable Cel2 fork for certain tests
Browse files Browse the repository at this point in the history
  • Loading branch information
palango committed Nov 21, 2023
1 parent 7028a23 commit eb3b79d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion eth/filters/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestFilters(t *testing.T) {
hash5 = common.BytesToHash([]byte("topic5"))

gspec = &core.Genesis{
Config: params.TestChainConfig,
Config: params.TestChainConfigNoCel2,
Alloc: core.GenesisAlloc{
addr: {Balance: big.NewInt(0).Mul(big.NewInt(100), big.NewInt(params.Ether))},
contract: {Balance: big.NewInt(0), Code: bytecode},
Expand Down
4 changes: 2 additions & 2 deletions internal/ethapi/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ func TestRPCGetBlockOrHeader(t *testing.T) {
acc1Addr = crypto.PubkeyToAddress(acc1Key.PublicKey)
acc2Addr = crypto.PubkeyToAddress(acc2Key.PublicKey)
genesis = &core.Genesis{
Config: params.TestChainConfig,
Config: params.TestChainConfigNoCel2,
Alloc: core.GenesisAlloc{
acc1Addr: {Balance: big.NewInt(params.Ether)},
acc2Addr: {Balance: big.NewInt(params.Ether)},
Expand Down Expand Up @@ -1485,7 +1485,7 @@ func TestRPCGetBlockOrHeader(t *testing.T) {
}

func setupReceiptBackend(t *testing.T, genBlocks int) (*testBackend, []common.Hash) {
config := *params.TestChainConfig
config := *params.TestChainConfigNoCel2
config.ShanghaiTime = new(uint64)
config.CancunTime = new(uint64)
var (
Expand Down
2 changes: 1 addition & 1 deletion les/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ func testTransactionStatus(t *testing.T, protocol int) {
test(tx3, false, light.TxStatus{Status: txpool.TxStatusPending})

// generate and add a block with tx1 and tx2 included
gchain, _ := core.GenerateChain(params.TestChainConfig, chain.GetBlockByNumber(0), ethash.NewFaker(), server.db, 1, func(i int, block *core.BlockGen) {
gchain, _ := core.GenerateChain(params.TestChainConfigNoCel2, chain.GetBlockByNumber(0), ethash.NewFaker(), server.db, 1, func(i int, block *core.BlockGen) {
block.AddTx(tx1)
block.AddTx(tx2)
})
Expand Down
31 changes: 31 additions & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,37 @@ var (
Clique: nil,
}

// TestChainConfigNoCel2 contains every protocol change (EIPs) introduced
// and accepted by the Ethereum core developers for testing proposes.
TestChainConfigNoCel2 = &ChainConfig{
ChainID: big.NewInt(1),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: nil,
DAOForkSupport: false,
EIP150Block: big.NewInt(0),
EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: big.NewInt(0),
PetersburgBlock: big.NewInt(0),
IstanbulBlock: big.NewInt(0),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ArrowGlacierBlock: big.NewInt(0),
GrayGlacierBlock: big.NewInt(0),
MergeNetsplitBlock: nil,
ShanghaiTime: nil,
CancunTime: nil,
PragueTime: nil,
VerkleTime: nil,
Cel2Time: nil,
TerminalTotalDifficulty: nil,
TerminalTotalDifficultyPassed: false,
Ethash: new(EthashConfig),
Clique: nil,
}

// NonActivatedConfig defines the chain configuration without activating
// any protocol change (EIPs).
NonActivatedConfig = &ChainConfig{
Expand Down

0 comments on commit eb3b79d

Please sign in to comment.