Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 128b137

Browse files
committed
feat: use the dev genesis block
1 parent 4745578 commit 128b137

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cmd/state/stateless/stateless.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,11 @@ func Stateless(
224224
check(err)
225225
defer db.Close()
226226

227+
genesis = core.DeveloperGenesisBlock(0, core.DevnetEtherbase)
227228
chainConfig := genesis.Config
228229

230+
fmt.Printf("Genesis: %+v\n", genesis)
231+
229232
var preRoot common.Hash
230233
if blockNum == 1 {
231234
var gb *types.Block
@@ -372,6 +375,14 @@ func Stateless(
372375
statedb.GetBalance(common.HexToAddress("0x1234"))
373376
}
374377

378+
fmt.Println("> Checking the genesis state...")
379+
380+
balance1 := statedb.GetBalance(common.HexToAddress("0x67b1d87101671b127f5f8714789C7192f7ad340e"))
381+
fmt.Printf("Balance of 0x67b1d87101671b127f5f8714789C7192f7ad340e: %d\n", balance1)
382+
383+
balance2 := statedb.GetBalance(common.HexToAddress("0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B"))
384+
fmt.Printf("Balance of 0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B: %d\n", balance2)
385+
375386
fmt.Printf("current block number=%d hash=%s root=%s\n", block.Number().Uint64(), block.Hash().String(), block.Header().Root.String())
376387

377388
getHeader := func(hash common.Hash, number uint64) *types.Header {

0 commit comments

Comments
 (0)