-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simulators/ethereum/engine: Add London non-zero-number test
- Loading branch information
Showing
5 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package suite_engine | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/ethereum/hive/simulators/ethereum/engine/clmock" | ||
"github.com/ethereum/hive/simulators/ethereum/engine/config" | ||
"github.com/ethereum/hive/simulators/ethereum/engine/test" | ||
) | ||
|
||
// Runs a sanity test on a post Merge fork where a previous fork's (London) number is not zero | ||
type NonZeroPreMergeFork struct { | ||
test.BaseSpec | ||
} | ||
|
||
func (s NonZeroPreMergeFork) WithMainFork(fork config.Fork) test.Spec { | ||
specCopy := s | ||
specCopy.MainFork = fork | ||
return specCopy | ||
} | ||
|
||
func (b NonZeroPreMergeFork) GetName() string { | ||
return "Pre-Merge Fork Number > 0" | ||
} | ||
|
||
func (s NonZeroPreMergeFork) GetForkConfig() *config.ForkConfig { | ||
forkConfig := s.BaseSpec.GetForkConfig() | ||
if forkConfig == nil { | ||
return nil | ||
} | ||
forkConfig.LondonNumber = common.Big1 | ||
return forkConfig | ||
} | ||
|
||
func (b NonZeroPreMergeFork) Execute(t *test.Env) { | ||
// Wait until TTD is reached by this client | ||
t.CLMock.WaitForTTD() | ||
|
||
// Simply produce a couple of blocks without transactions (if London is not active at genesis | ||
// we can't send type-2 transactions) and check that the chain progresses without issues | ||
t.CLMock.ProduceBlocks(5, clmock.BlockProcessCallbacks{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters