Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: moul <[email protected]>
  • Loading branch information
moul committed Oct 5, 2024
1 parent 302d730 commit f6dd011
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions contribs/gnodev/pkg/dev/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ func (n *Node) genesisTxResultHandler(ctx sdk.Context, tx std.Tx, res sdk.Result
return
}

func newNodeConfig(tmc *tmcfg.Config, chainid string, appstate gnoland.GnoGenesisState) *gnoland.InMemoryNodeConfig {
func newNodeConfig(tmc *tmcfg.Config, chainid, chaindomain string, appstate gnoland.GnoGenesisState) *gnoland.InMemoryNodeConfig {
// Create Mocked Identity
pv := gnoland.NewMockedPrivValidator()
genesis := gnoland.NewDefaultGenesisConfig(chainid)
Expand All @@ -564,10 +564,12 @@ func newNodeConfig(tmc *tmcfg.Config, chainid string, appstate gnoland.GnoGenesi
},
}

return &gnoland.InMemoryNodeConfig{
cfg := &gnoland.InMemoryNodeConfig{
PrivValidator: pv,
TMConfig: tmc,
Genesis: genesis,
GenesisMaxVMCycles: 100_000_000,
}
cfg.InitChainerConfig.ChainDomain = chaindomain
return cfg
}
5 changes: 3 additions & 2 deletions gnovm/stdlibs/std/native.gno
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ func AssertOriginCall() // injected
// MsgRun.
func IsOriginCall() bool // injected

func GetChainID() string // injected
func GetHeight() int64 // injected
func GetChainID() string // injected
func GetChainDomain() string // injected
func GetHeight() int64 // injected

func GetOrigSend() Coins {
den, amt := origSend()
Expand Down
4 changes: 4 additions & 0 deletions gnovm/stdlibs/std/native.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ func GetChainID(m *gno.Machine) string {
return GetContext(m).ChainID
}

func GetChainDomain(m *gno.Machine) string {
return GetContext(m).ChainDomain
}

func GetHeight(m *gno.Machine) int64 {
return GetContext(m).Height
}
Expand Down

0 comments on commit f6dd011

Please sign in to comment.