diff --git a/gnovm/stdlibs/std/native.go b/gnovm/stdlibs/std/native.go index 3c1aec7de9f..9e61d69e8d7 100644 --- a/gnovm/stdlibs/std/native.go +++ b/gnovm/stdlibs/std/native.go @@ -22,15 +22,15 @@ func IsOriginCall(m *gno.Machine) bool { return n <= 2 && isMsgCall } -func GetChainID(m *gno.Machine) string { +func ChainID(m *gno.Machine) string { return GetContext(m).ChainID } -func GetChainDomain(m *gno.Machine) string { +func ChainDomain(m *gno.Machine) string { return GetContext(m).ChainDomain } -func GetHeight(m *gno.Machine) int64 { +func ChainHeight(m *gno.Machine) int64 { return GetContext(m).Height } diff --git a/tm2/pkg/sdk/context.go b/tm2/pkg/sdk/context.go index da89b7c62fe..f9d9949bfbe 100644 --- a/tm2/pkg/sdk/context.go +++ b/tm2/pkg/sdk/context.go @@ -66,7 +66,7 @@ func (c Context) ConsensusParams() *abci.ConsensusParams { // create a new context func NewContext(mode RunTxMode, ms store.MultiStore, header abci.Header, logger *slog.Logger) Context { - if header.ChainID() == "" { + if header.GetChainID() == "" { panic("header chain id cannot be empty") } return Context{ @@ -74,7 +74,7 @@ func NewContext(mode RunTxMode, ms store.MultiStore, header abci.Header, logger mode: mode, ms: ms, header: header, - chainID: header.ChainID(), + chainID: header.GetChainID(), logger: logger, gasMeter: store.NewInfiniteGasMeter(), minGasPrices: nil,