MCPcopy Create free account
hub / github.com/CPChain/chain / GenesisBlockForTesting

Function GenesisBlockForTesting

core/genesis.go:287–291  ·  view source on GitHub ↗

GenesisBlockForTesting creates and writes a block in which addr has the given wei balance.

(db database.Database, addr common.Address, balance *big.Int)

Source from the content-addressed store, hash-verified

285
286// GenesisBlockForTesting creates and writes a block in which addr has the given wei balance.
287func GenesisBlockForTesting(db database.Database, addr common.Address, balance *big.Int) *types.Block {
288 g := DefaultGenesisBlock()
289 g.Alloc = GenesisAlloc{addr: {Balance: balance}}
290 return g.MustCommit(db)
291}
292
293// Genesis hashes to enforce below configs on.
294var MainnetGenesisHash = common.HexToHash("0xf70bf47d2629b1e9e9f900b0eb3b73e7e93c31b330d04c0029557d2ad065282a")

Callers 1

newCanonicalFunction · 0.85

Calls 2

DefaultGenesisBlockFunction · 0.85
MustCommitMethod · 0.80

Tested by 1

newCanonicalFunction · 0.68