Skip to content

Commit

Permalink
refactor: refactor missing code
Browse files Browse the repository at this point in the history
  • Loading branch information
hieu.ha committed Jan 17, 2025
1 parent b994dde commit 9e78817
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions gnovm/stdlibs/std/native.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions tm2/pkg/sdk/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ 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{
ctx: context.Background(),
mode: mode,
ms: ms,
header: header,
chainID: header.ChainID(),
chainID: header.GetChainID(),
logger: logger,
gasMeter: store.NewInfiniteGasMeter(),
minGasPrices: nil,
Expand Down

0 comments on commit 9e78817

Please sign in to comment.