Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentRealm ¶
CurrentRealm retrieves the current realm's address and pkgPath. It's not a native binding; but is used as a helper function here and elsewhere to clarify usage.
Types ¶
type BankerInterface ¶
type BankerInterface interface {
GetCoins(addr crypto.Bech32Address) (dst std.Coins)
SendCoins(from, to crypto.Bech32Address, amt std.Coins)
TotalCoin(denom string) int64
IssueCoin(addr crypto.Bech32Address, denom string, amount int64)
RemoveCoin(addr crypto.Bech32Address, denom string, amount int64)
}
type ExecContext ¶
type ExecContext struct {
ChainID string
ChainDomain string
Height int64
Timestamp int64 // seconds
TimestampNano int64 // nanoseconds, only used for testing.
OriginCaller crypto.Bech32Address
OriginSend std.Coins
OriginSendSpent *std.Coins // mutable
Banker BankerInterface
Params ParamsInterface
EventLogger *sdk.EventLogger
SessionAccount std.DelegatedAccount // nil for master-key txs
}
func GetContext ¶
func GetContext(m *gno.Machine) ExecContext
GetContext returns the context from the Gno machine.
func (ExecContext) GetExecContext ¶
func (e ExecContext) GetExecContext() ExecContext
GetContext returns the execution context. This is used to allow extending the exec context using interfaces, for instance when testing.
func (ExecContext) GetOriginSend ¶
func (e ExecContext) GetOriginSend() std.Coins
GetOriginSend returns the OriginSend coins. This implements gno.OriginSendProvider to avoid import cycles.
type ExecContexter ¶
type ExecContexter interface {
GetExecContext() ExecContext
}
ExecContexter is a type capable of returning the parent ExecContext. When using these standard libraries, m.Context should always implement this interface. This can be obtained by embedding ExecContext.
type ParamsInterface ¶
type ParamsInterface interface {
SetString(key, val string)
SetBool(key string, val bool)
SetInt64(key string, val int64)
SetUint64(key string, val uint64)
SetBytes(key string, val []byte)
SetStrings(key string, val []string)
UpdateStrings(key string, val []string, add bool)
// GetXxx writes the stored value (if any) into *ptr and returns
// whether the key existed. A return of false leaves *ptr at its
// zero value, distinguishing "never set" from "set to zero" —
// which the in-memory backed types alone cannot.
GetString(key string, ptr *string) bool
GetBool(key string, ptr *bool) bool
GetInt64(key string, ptr *int64) bool
GetUint64(key string, ptr *uint64) bool
GetBytes(key string, ptr *[]byte) bool
GetStrings(key string, ptr *[]string) bool
}