all: cleanup the APIs for initializing genesis (#25473)

* all: polish tests

* core: apply feedback from Guillaume

* core: fix comment
This commit is contained in:
rjl493456442
2022-08-09 12:44:39 +03:00
committed by GitHub
parent 86de2e516e
commit a41ea8a97c
26 changed files with 133 additions and 108 deletions
+2 -2
View File
@@ -403,7 +403,7 @@ func TestClique(t *testing.T) {
}
// Create a pristine blockchain with the genesis injected
db := rawdb.NewMemoryDatabase()
genesis.Commit(db)
genesisBlock := genesis.MustCommit(db)
// Assemble a chain of headers from the cast votes
config := *params.TestChainConfig
@@ -414,7 +414,7 @@ func TestClique(t *testing.T) {
engine := New(config.Clique, db)
engine.fakeDiff = true
blocks, _ := core.GenerateChain(&config, genesis.ToBlock(db), engine, db, len(tt.votes), func(j int, gen *core.BlockGen) {
blocks, _ := core.GenerateChain(&config, genesisBlock, engine, db, len(tt.votes), func(j int, gen *core.BlockGen) {
// Cast the vote contained in this block
gen.SetCoinbase(accounts.address(tt.votes[j].voted))
if tt.votes[j].auth {