Skip to content

Commit

Permalink
feat: add tz param in gnodev genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelVallenet committed Nov 28, 2024
1 parent cc2bbe1 commit c3ecc97
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contribs/gnodev/pkg/dev/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,16 @@ func NewDevNode(ctx context.Context, cfg *NodeConfig) (*Node, error) {
currentStateIndex: len(cfg.InitialTxs),
}

var tzParam gnoland.Param

This comment has been minimized.

Copy link
@moul

moul Nov 28, 2024

Member

I suggest you follow my approach in #2911 by making the Genesis overrider a feature of gnoland.NewDefaultGenesisConfig, rather than something specific to gnodev. This configuration is used by both gnoland/pkg/integration and gnodev.

https://github.com/gnolang/gno/pull/2911/files#diff-345f5f01c3918dee1115248c835e207fa3e441d189292a912fb5f402ffa68882R39-R42

_ = tzParam.Parse("gno.land/r/sys/params.vm.chain_tz.string=" + cfg.ChainTz)

// generate genesis state
genesis := gnoland.GnoGenesisState{
Balances: cfg.BalancesList,
Txs: append(pkgsTxs, cfg.InitialTxs...),
Params: []gnoland.Param{
tzParam,
},
}

if err := devnode.rebuildNode(ctx, genesis); err != nil {
Expand Down

0 comments on commit c3ecc97

Please sign in to comment.