mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-01 09:33:46 +00:00
add genesis alloc to hook
This commit is contained in:
parent
b692a68a3b
commit
2a59d24b73
3 changed files with 5 additions and 4 deletions
|
|
@ -162,7 +162,7 @@ type BlockchainLogger interface {
|
|||
// `td` is the total difficulty prior to `block`.
|
||||
OnBlockStart(block *types.Block, td *big.Int, finalized *types.Header, safe *types.Header)
|
||||
OnBlockEnd(err error)
|
||||
OnGenesisBlock(genesis *types.Block)
|
||||
OnGenesisBlock(genesis *types.Block, alloc GenesisAlloc)
|
||||
}
|
||||
|
||||
// BlockChain represents the canonical chain given a database with a genesis
|
||||
|
|
|
|||
|
|
@ -485,7 +485,7 @@ func (g *Genesis) Commit(db ethdb.Database, triedb *trie.Database, bcLogger Bloc
|
|||
return nil, errors.New("can't start clique chain without signers")
|
||||
}
|
||||
if bcLogger != nil {
|
||||
bcLogger.OnGenesisBlock(block)
|
||||
bcLogger.OnGenesisBlock(block, g.Alloc)
|
||||
}
|
||||
// All the checks has passed, flush the states derived from the genesis
|
||||
// specification as well as the specification itself into the provided
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
)
|
||||
|
|
@ -82,8 +83,8 @@ func (p *Printer) OnBlockEnd(err error) {
|
|||
fmt.Printf("OnBlockEnd: err=%v\n", err)
|
||||
}
|
||||
|
||||
func (p *Printer) OnGenesisBlock(b *types.Block) {
|
||||
fmt.Printf("OnGenesisBlock: b=%v\n", b.NumberU64())
|
||||
func (p *Printer) OnGenesisBlock(b *types.Block, alloc core.GenesisAlloc) {
|
||||
fmt.Printf("OnGenesisBlock: b=%v, allocLength=%d\n", b.NumberU64(), len(alloc))
|
||||
}
|
||||
|
||||
func (p *Printer) OnBalanceChange(a common.Address, prev, new *big.Int) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue