Documentation
¶
Index ¶
- Constants
- Variables
- func ErrInvalidExpr(msg string) error
- func ErrInvalidFile(msg string) error
- func ErrInvalidPackage(msg string) error
- func ErrInvalidPkgPath(msg string) error
- func ErrInvalidStmt(msg string) error
- func ErrObjectNotFound(msg string) error
- func ErrPkgAlreadyExists(msg string) error
- func ErrTypeCheck(err error) error
- func ErrUnauthorizedUser(msg string) error
- func NewHandler(vm *VMKeeper) vmHandler
- func ValidateGenesis(gs GenesisState) error
- type AccountKeeperI
- type BankKeeperI
- type FunctionSignature
- type FunctionSignatures
- type GenesisState
- type InvalidExprError
- func (InvalidExprError) AssertABCIError()
- func (e InvalidExprError) Error() string
- func (goo InvalidExprError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InvalidExprError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InvalidExprError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InvalidFileError
- func (InvalidFileError) AssertABCIError()
- func (e InvalidFileError) Error() string
- func (goo InvalidFileError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InvalidFileError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InvalidFileError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InvalidPackageError
- func (InvalidPackageError) AssertABCIError()
- func (e InvalidPackageError) Error() string
- func (goo InvalidPackageError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InvalidPackageError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InvalidPackageError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InvalidPkgPathError
- func (InvalidPkgPathError) AssertABCIError()
- func (e InvalidPkgPathError) Error() string
- func (goo InvalidPkgPathError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InvalidPkgPathError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InvalidPkgPathError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type InvalidStmtError
- func (InvalidStmtError) AssertABCIError()
- func (e InvalidStmtError) Error() string
- func (goo InvalidStmtError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo InvalidStmtError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *InvalidStmtError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type MsgAddPackage
- func (msg MsgAddPackage) GetReceived() std.Coins
- func (msg MsgAddPackage) GetSignBytes() []byte
- func (msg MsgAddPackage) GetSigners() []crypto.Address
- func (goo MsgAddPackage) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (msg MsgAddPackage) Route() string
- func (goo MsgAddPackage) SizeBinary2(cdc *amino.Codec) (int, error)
- func (msg MsgAddPackage) SpendForSigner(signer crypto.Address) std.Coins
- func (msg MsgAddPackage) Type() string
- func (goo *MsgAddPackage) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- func (msg MsgAddPackage) ValidateBasic() error
- type MsgCall
- func (msg MsgCall) GetPkgPath() string
- func (msg MsgCall) GetReceived() std.Coins
- func (msg MsgCall) GetSignBytes() []byte
- func (msg MsgCall) GetSigners() []crypto.Address
- func (goo MsgCall) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (msg MsgCall) Route() string
- func (goo MsgCall) SizeBinary2(cdc *amino.Codec) (int, error)
- func (msg MsgCall) SpendForSigner(signer crypto.Address) std.Coins
- func (msg MsgCall) Type() string
- func (goo *MsgCall) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- func (msg MsgCall) ValidateBasic() error
- type MsgRun
- func (msg MsgRun) GetReceived() std.Coins
- func (msg MsgRun) GetSignBytes() []byte
- func (msg MsgRun) GetSigners() []crypto.Address
- func (goo MsgRun) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (msg MsgRun) Route() string
- func (goo MsgRun) SizeBinary2(cdc *amino.Codec) (int, error)
- func (msg MsgRun) SpendForSigner(signer crypto.Address) std.Coins
- func (msg MsgRun) Type() string
- func (goo *MsgRun) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- func (msg MsgRun) ValidateBasic() error
- type NamedType
- type NoRenderDeclError
- func (NoRenderDeclError) AssertABCIError()
- func (e NoRenderDeclError) Error() string
- func (goo NoRenderDeclError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo NoRenderDeclError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *NoRenderDeclError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type ObjectNotFoundError
- func (ObjectNotFoundError) AssertABCIError()
- func (e ObjectNotFoundError) Error() string
- func (goo ObjectNotFoundError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo ObjectNotFoundError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *ObjectNotFoundError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type Params
- func (p Params) ApplyToGasConfig(cfg *store.GasConfig)
- func (p Params) Equals(p2 Params) bool
- func (goo Params) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo Params) SizeBinary2(cdc *amino.Codec) (int, error)
- func (p Params) String() string
- func (goo *Params) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- func (p Params) Validate() error
- type ParamsKeeperI
- type PkgExistError
- func (PkgExistError) AssertABCIError()
- func (e PkgExistError) Error() string
- func (goo PkgExistError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo PkgExistError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *PkgExistError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type SDKBanker
- func (bnk *SDKBanker) GetCoins(b32addr crypto.Bech32Address) (dst std.Coins)
- func (bnk *SDKBanker) IssueCoin(b32addr crypto.Bech32Address, denom string, amount int64)
- func (bnk *SDKBanker) RemoveCoin(b32addr crypto.Bech32Address, denom string, amount int64)
- func (bnk *SDKBanker) SendCoins(b32from, b32to crypto.Bech32Address, amt std.Coins)
- func (bnk *SDKBanker) TotalCoin(denom string) int64
- type SDKParams
- func (prm *SDKParams) GetBool(key string, ptr *bool) bool
- func (prm *SDKParams) GetBytes(key string, ptr *[]byte) bool
- func (prm *SDKParams) GetInt64(key string, ptr *int64) bool
- func (prm *SDKParams) GetString(key string, ptr *string) bool
- func (prm *SDKParams) GetStrings(key string, ptr *[]string) bool
- func (prm *SDKParams) GetUint64(key string, ptr *uint64) bool
- func (prm *SDKParams) SetBool(key string, value bool)
- func (prm *SDKParams) SetBytes(key string, value []byte)
- func (prm *SDKParams) SetInt64(key string, value int64)
- func (prm *SDKParams) SetString(key string, value string)
- func (prm *SDKParams) SetStrings(key string, value []string)
- func (prm *SDKParams) SetUint64(key string, value uint64)
- func (prm *SDKParams) UpdateStrings(key string, vals []string, add bool)
- type TypeCheckError
- func (TypeCheckError) AssertABCIError()
- func (e TypeCheckError) Error() string
- func (goo TypeCheckError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo TypeCheckError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *TypeCheckError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type UnauthorizedUserError
- func (UnauthorizedUserError) AssertABCIError()
- func (e UnauthorizedUserError) Error() string
- func (goo UnauthorizedUserError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)
- func (goo UnauthorizedUserError) SizeBinary2(cdc *amino.Codec) (int, error)
- func (goo *UnauthorizedUserError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
- type VMKeeper
- func (vm *VMKeeper) AddPackage(ctx sdk.Context, msg MsgAddPackage) (err error)
- func (vm *VMKeeper) Call(ctx sdk.Context, msg MsgCall) (res string, err error)
- func (vm *VMKeeper) CommitGnoTransactionStore(ctx sdk.Context)
- func (vm *VMKeeper) ExportGenesis(ctx sdk.Context) GenesisState
- func (vm *VMKeeper) GetParams(ctx sdk.Context) Params
- func (vm *VMKeeper) InitGenesis(ctx sdk.Context, gs GenesisState)
- func (vm *VMKeeper) Initialize(logger *slog.Logger, ms store.MultiStore)
- func (vm *VMKeeper) LoadStdlib(ctx sdk.Context, stdlibDir string)
- func (vm *VMKeeper) LoadStdlibCached(ctx sdk.Context, stdlibDir string)
- func (vm *VMKeeper) MakeGnoTransactionStore(ctx sdk.Context) sdk.Context
- func (vm *VMKeeper) PopulateStdlibCache()
- func (vm *VMKeeper) PopulateStdlibCacheFrom(ms store.MultiStore)
- func (vm *VMKeeper) QueryDoc(ctx sdk.Context, pkgPath string) (*doc.JSONDocumentation, error)
- func (vm *VMKeeper) QueryEval(ctx sdk.Context, pkgPath string, expr string) (res string, err error)
- func (vm *VMKeeper) QueryEvalJSON(ctx sdk.Context, pkgPath string, expr string) (res string, err error)
- func (vm *VMKeeper) QueryEvalString(ctx sdk.Context, pkgPath string, expr string) (res string, err error)
- func (vm *VMKeeper) QueryFile(ctx sdk.Context, filepath string) (res string, err error)
- func (vm *VMKeeper) QueryFuncs(ctx sdk.Context, pkgPath string) (fsigs FunctionSignatures, err error)
- func (vm *VMKeeper) QueryObjectBinary(ctx sdk.Context, oidStr string) (res []byte, err error)
- func (vm *VMKeeper) QueryObjectJSON(ctx sdk.Context, oidStr string) (res string, err error)
- func (vm *VMKeeper) QueryPaths(ctx sdk.Context, target string, limit int) ([]string, error)
- func (vm *VMKeeper) QueryStorage(ctx sdk.Context, pkgPath string) (string, error)
- func (vm *VMKeeper) Run(ctx sdk.Context, msg MsgRun) (res string, err error)
- func (vm *VMKeeper) SetParams(ctx sdk.Context, params Params) error
- func (vm *VMKeeper) WillSetParam(ctx sdk.Context, key string, value any)
- type VMKeeperI
Constants ¶
const ( ModuleName = "vm" RouterKey = ModuleName )
const ( QueryRender = "qrender" QueryFuncs = "qfuncs" QueryEval = "qeval" QueryEvalJSON = "qeval_json" QueryObjectJSON = "qobject_json" QueryObjectBinary = "qobject_binary" QueryFile = "qfile" QueryDoc = "qdoc" QueryPaths = "qpaths" QueryStorage = "qstorage" )
query paths
Variables ¶
var ASCIIDomain = regexp.MustCompile(`^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]{2,}$`)
var Package = amino.RegisterPackage(amino.NewPackage( "github.com/gnolang/gno/gno.land/pkg/sdk/vm", "vm", amino.GetCallersDirname(), ).WithDependencies( std.Package, params.Package, ).WithTypes( MsgCall{}, "m_call", MsgRun{}, "m_run", MsgAddPackage{}, "m_addpkg", InvalidPkgPathError{}, "InvalidPkgPathError", NoRenderDeclError{}, "NoRenderDeclError", PkgExistError{}, "PkgExistError", InvalidStmtError{}, "InvalidStmtError", InvalidExprError{}, "InvalidExprError", TypeCheckError{}, "TypeCheckError", UnauthorizedUserError{}, "UnauthorizedUserError", InvalidPackageError{}, "InvalidPackageError", InvalidFileError{}, "InvalidFileError", ObjectNotFoundError{}, "ObjectNotFoundError", GenesisState{}, "GenesisState", Params{}, "Params", ))
Functions ¶
func ErrInvalidExpr ¶
func ErrInvalidFile ¶
func ErrInvalidPackage ¶
func ErrInvalidPkgPath ¶
func ErrInvalidStmt ¶
func ErrObjectNotFound ¶
func ErrPkgAlreadyExists ¶
func ErrTypeCheck ¶
func ErrUnauthorizedUser ¶
func NewHandler ¶
func NewHandler(vm *VMKeeper) vmHandler
NewHandler returns a handler for "vm" type messages.
func ValidateGenesis ¶
func ValidateGenesis(gs GenesisState) error
ValidateGenesis performs basic validation of genesis data returning an error for any failed validation criteria. XXX refactor to .ValidateBasic() method.
Types ¶
type AccountKeeperI ¶
type AccountKeeperI interface {
GetAccount(ctx sdk.Context, addr crypto.Address) std.Account
SetSessionAccount(ctx sdk.Context, master crypto.Address, acc std.Account)
}
AccountKeeperI is the limited interface only needed for VM.
type BankKeeperI ¶
type BankKeeperI interface {
GetCoins(ctx sdk.Context, addr crypto.Address) std.Coins
SendCoins(ctx sdk.Context, fromAddr crypto.Address, toAddr crypto.Address, amt std.Coins) error
SendCoinsUnrestricted(ctx sdk.Context, fromAddr crypto.Address, toAddr crypto.Address, amt std.Coins) error
SubtractCoins(ctx sdk.Context, addr crypto.Address, amt std.Coins) (std.Coins, error)
AddCoins(ctx sdk.Context, addr crypto.Address, amt std.Coins) (std.Coins, error)
RestrictedDenoms(ctx sdk.Context) []string
}
BankKeeperI is the limited interface only needed for VM.
type FunctionSignature ¶
Public facing function signatures. See convertArgToGno() for supported types.
type FunctionSignatures ¶
type FunctionSignatures []FunctionSignature
func (FunctionSignatures) JSON ¶
func (fsigs FunctionSignatures) JSON() string
type GenesisState ¶
type GenesisState struct {
Params Params `json:"params" yaml:"params"`
RealmParams []params.Param `json:"realm_params" yaml:"realm_params"`
}
GenesisState - all state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - Return a default genesis state
func NewGenesisState ¶
func NewGenesisState(params Params) GenesisState
NewGenesisState - Create a new genesis state
func (GenesisState) MarshalBinary2 ¶
func (GenesisState) SizeBinary2 ¶
func (goo GenesisState) SizeBinary2(cdc *amino.Codec) (int, error)
func (*GenesisState) UnmarshalBinary2 ¶
type InvalidExprError ¶
type InvalidExprError struct {
// contains filtered or unexported fields
}
declare all script errors. NOTE: these are meant to be used in conjunction with pkgs/errors.
func (InvalidExprError) AssertABCIError ¶
func (InvalidExprError) AssertABCIError()
func (InvalidExprError) Error ¶
func (e InvalidExprError) Error() string
func (InvalidExprError) MarshalBinary2 ¶
func (InvalidExprError) SizeBinary2 ¶
func (goo InvalidExprError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InvalidExprError) UnmarshalBinary2 ¶
type InvalidFileError ¶
type InvalidFileError struct {
// contains filtered or unexported fields
}
declare all script errors. NOTE: these are meant to be used in conjunction with pkgs/errors.
func (InvalidFileError) AssertABCIError ¶
func (InvalidFileError) AssertABCIError()
func (InvalidFileError) Error ¶
func (e InvalidFileError) Error() string
func (InvalidFileError) MarshalBinary2 ¶
func (InvalidFileError) SizeBinary2 ¶
func (goo InvalidFileError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InvalidFileError) UnmarshalBinary2 ¶
type InvalidPackageError ¶
type InvalidPackageError struct {
// contains filtered or unexported fields
}
declare all script errors. NOTE: these are meant to be used in conjunction with pkgs/errors.
func (InvalidPackageError) AssertABCIError ¶
func (InvalidPackageError) AssertABCIError()
func (InvalidPackageError) Error ¶
func (e InvalidPackageError) Error() string
func (InvalidPackageError) MarshalBinary2 ¶
func (InvalidPackageError) SizeBinary2 ¶
func (goo InvalidPackageError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InvalidPackageError) UnmarshalBinary2 ¶
type InvalidPkgPathError ¶
type InvalidPkgPathError struct {
// contains filtered or unexported fields
}
declare all script errors. NOTE: these are meant to be used in conjunction with pkgs/errors.
func (InvalidPkgPathError) AssertABCIError ¶
func (InvalidPkgPathError) AssertABCIError()
func (InvalidPkgPathError) Error ¶
func (e InvalidPkgPathError) Error() string
func (InvalidPkgPathError) MarshalBinary2 ¶
func (InvalidPkgPathError) SizeBinary2 ¶
func (goo InvalidPkgPathError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InvalidPkgPathError) UnmarshalBinary2 ¶
type InvalidStmtError ¶
type InvalidStmtError struct {
// contains filtered or unexported fields
}
declare all script errors. NOTE: these are meant to be used in conjunction with pkgs/errors.
func (InvalidStmtError) AssertABCIError ¶
func (InvalidStmtError) AssertABCIError()
func (InvalidStmtError) Error ¶
func (e InvalidStmtError) Error() string
func (InvalidStmtError) MarshalBinary2 ¶
func (InvalidStmtError) SizeBinary2 ¶
func (goo InvalidStmtError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*InvalidStmtError) UnmarshalBinary2 ¶
type MsgAddPackage ¶
type MsgAddPackage struct {
Creator crypto.Address `json:"creator" yaml:"creator"`
Package *std.MemPackage `json:"package" yaml:"package"`
Send std.Coins `json:"send" yaml:"send"`
MaxDeposit std.Coins `json:"max_deposit" yaml:"max_deposit"`
}
MsgAddPackage - create and initialize new package
func NewMsgAddPackage ¶
NewMsgAddPackage - upload a package with files.
func (MsgAddPackage) GetReceived ¶
func (msg MsgAddPackage) GetReceived() std.Coins
Implements ReceiveMsg.
func (MsgAddPackage) GetSigners ¶
func (msg MsgAddPackage) GetSigners() []crypto.Address
Implements Msg.
func (MsgAddPackage) MarshalBinary2 ¶
func (MsgAddPackage) SizeBinary2 ¶
func (goo MsgAddPackage) SizeBinary2(cdc *amino.Codec) (int, error)
func (MsgAddPackage) SpendForSigner ¶
func (msg MsgAddPackage) SpendForSigner(signer crypto.Address) std.Coins
SpendForSigner implements std.SpendEstimator. Returns Send when signer is the creator, zero otherwise.
func (*MsgAddPackage) UnmarshalBinary2 ¶
type MsgCall ¶
type MsgCall struct {
Caller crypto.Address `json:"caller" yaml:"caller"`
Send std.Coins `json:"send" yaml:"send"`
MaxDeposit std.Coins `json:"max_deposit" yaml:"max_deposit"`
PkgPath string `json:"pkg_path" yaml:"pkg_path"`
Func string `json:"func" yaml:"func"`
Args []string `json:"args,omitempty" yaml:"args"`
}
MsgCall - executes a Gno statement.
func NewMsgCall ¶
func (MsgCall) GetPkgPath ¶
GetPkgPath returns the target package path.
func (MsgCall) MarshalBinary2 ¶
func (MsgCall) SpendForSigner ¶
SpendForSigner implements std.SpendEstimator. Returns Send when signer is the caller, zero otherwise.
func (*MsgCall) UnmarshalBinary2 ¶
type MsgRun ¶
type MsgRun struct {
Caller crypto.Address `json:"caller" yaml:"caller"`
Send std.Coins `json:"send" yaml:"send"`
MaxDeposit std.Coins `json:"max_deposit" yaml:"max_deposit"`
Package *std.MemPackage `json:"package" yaml:"package"`
}
MsgRun - executes arbitrary Gno code.
func (MsgRun) MarshalBinary2 ¶
func (MsgRun) SpendForSigner ¶
SpendForSigner implements std.SpendEstimator. Returns Send when signer is the caller, zero otherwise.
func (*MsgRun) UnmarshalBinary2 ¶
type NoRenderDeclError ¶
type NoRenderDeclError struct {
// contains filtered or unexported fields
}
declare all script errors. NOTE: these are meant to be used in conjunction with pkgs/errors.
func (NoRenderDeclError) AssertABCIError ¶
func (NoRenderDeclError) AssertABCIError()
func (NoRenderDeclError) Error ¶
func (e NoRenderDeclError) Error() string
func (NoRenderDeclError) MarshalBinary2 ¶
func (NoRenderDeclError) SizeBinary2 ¶
func (goo NoRenderDeclError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*NoRenderDeclError) UnmarshalBinary2 ¶
type ObjectNotFoundError ¶
type ObjectNotFoundError struct {
// contains filtered or unexported fields
}
declare all script errors. NOTE: these are meant to be used in conjunction with pkgs/errors.
func (ObjectNotFoundError) AssertABCIError ¶
func (ObjectNotFoundError) AssertABCIError()
func (ObjectNotFoundError) Error ¶
func (e ObjectNotFoundError) Error() string
func (ObjectNotFoundError) MarshalBinary2 ¶
func (ObjectNotFoundError) SizeBinary2 ¶
func (goo ObjectNotFoundError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*ObjectNotFoundError) UnmarshalBinary2 ¶
type Params ¶
type Params struct {
SysNamesPkgPath string `json:"sysnames_pkgpath" yaml:"sysnames_pkgpath"`
SysCLAPkgPath string `json:"syscla_pkgpath" yaml:"syscla_pkgpath"`
ChainDomain string `json:"chain_domain" yaml:"chain_domain"`
DefaultDeposit string `json:"default_deposit" yaml:"default_deposit"`
StoragePrice string `json:"storage_price" yaml:"storage_price"`
StorageFeeCollector crypto.Address `json:"storage_fee_collector" yaml:"storage_fee_collector"`
MinGetReadDepth100 int64 `json:"min_get_read_depth_100" yaml:"min_get_read_depth_100"`
MinSetReadDepth100 int64 `json:"min_set_read_depth_100" yaml:"min_set_read_depth_100"`
MinWriteDepth100 int64 `json:"min_write_depth_100" yaml:"min_write_depth_100"`
FixedGetReadDepth100 int64 `json:"fixed_get_read_depth_100" yaml:"fixed_get_read_depth_100"`
FixedSetReadDepth100 int64 `json:"fixed_set_read_depth_100" yaml:"fixed_set_read_depth_100"`
FixedWriteDepth100 int64 `json:"fixed_write_depth_100" yaml:"fixed_write_depth_100"`
// IterNextCostFlat must be > 0; Validate rejects zero. Asymmetric
// with the six depth fields above (where 0 legitimately means
// "no floor / use tree estimate") because zero iter-step cost
// would effectively disable iteration gas charging.
IterNextCostFlat int64 `json:"iter_next_cost_flat" yaml:"iter_next_cost_flat"`
}
Params defines the parameters for the vm module.
func NewParams ¶
func NewParams(namesPkgPath, claPkgPath, chainDomain, defaultDeposit, storagePrice string, storageFeeCollector crypto.Address, minGetReadDepth100, minSetReadDepth100, minWriteDepth100, iterNextCostFlat int64) Params
NewParams creates a new Params object
func (Params) ApplyToGasConfig ¶
ApplyToGasConfig overwrites the governed gas fields of cfg with the values in p. Shared by the anteHandler (tx path) and newGnoTransactionStore (query path) so the two never drift.
Every write is unconditional. For the six depth fields that's safe because store.DefaultGasConfig() initializes them to 0 and zero is a legitimate value ("no floor / use tree estimate"); overwriting 0 with 0 is a no-op. IterNextCostFlat is required to be positive (Validate rejects zero), so a Params that reached this code is guaranteed to have a meaningful value for it.
func (Params) MarshalBinary2 ¶
func (*Params) UnmarshalBinary2 ¶
type ParamsKeeperI ¶
type ParamsKeeperI interface {
params.ParamsKeeperI
IsRegistered(moduleName string) bool
}
ParamsKeeperI is the limited interface only needed for VM.
type PkgExistError ¶
type PkgExistError struct {
// contains filtered or unexported fields
}
declare all script errors. NOTE: these are meant to be used in conjunction with pkgs/errors.
func (PkgExistError) AssertABCIError ¶
func (PkgExistError) AssertABCIError()
func (PkgExistError) Error ¶
func (e PkgExistError) Error() string
func (PkgExistError) MarshalBinary2 ¶
func (PkgExistError) SizeBinary2 ¶
func (goo PkgExistError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*PkgExistError) UnmarshalBinary2 ¶
type SDKBanker ¶
type SDKBanker struct {
// contains filtered or unexported fields
}
func (*SDKBanker) GetCoins ¶
func (bnk *SDKBanker) GetCoins(b32addr crypto.Bech32Address) (dst std.Coins)
func (*SDKBanker) IssueCoin ¶
func (bnk *SDKBanker) IssueCoin(b32addr crypto.Bech32Address, denom string, amount int64)
func (*SDKBanker) RemoveCoin ¶
func (bnk *SDKBanker) RemoveCoin(b32addr crypto.Bech32Address, denom string, amount int64)
type SDKParams ¶
type SDKParams struct {
// contains filtered or unexported fields
}
func NewSDKParams ¶
func NewSDKParams(pmk ParamsKeeperI, ctx sdk.Context) *SDKParams
func (*SDKParams) SetStrings ¶
type TypeCheckError ¶
type TypeCheckError struct {
Errors []string `json:"errors"`
// contains filtered or unexported fields
}
declare all script errors. NOTE: these are meant to be used in conjunction with pkgs/errors.
func (TypeCheckError) AssertABCIError ¶
func (TypeCheckError) AssertABCIError()
func (TypeCheckError) Error ¶
func (e TypeCheckError) Error() string
func (TypeCheckError) MarshalBinary2 ¶
func (TypeCheckError) SizeBinary2 ¶
func (goo TypeCheckError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*TypeCheckError) UnmarshalBinary2 ¶
type UnauthorizedUserError ¶
type UnauthorizedUserError struct {
// contains filtered or unexported fields
}
declare all script errors. NOTE: these are meant to be used in conjunction with pkgs/errors.
func (UnauthorizedUserError) AssertABCIError ¶
func (UnauthorizedUserError) AssertABCIError()
func (UnauthorizedUserError) Error ¶
func (e UnauthorizedUserError) Error() string
func (UnauthorizedUserError) MarshalBinary2 ¶
func (UnauthorizedUserError) SizeBinary2 ¶
func (goo UnauthorizedUserError) SizeBinary2(cdc *amino.Codec) (int, error)
func (*UnauthorizedUserError) UnmarshalBinary2 ¶
type VMKeeper ¶
type VMKeeper struct {
// Needs to be explicitly set, like in the case of gnodev.
Output io.Writer
// contains filtered or unexported fields
}
VMKeeper holds all package code and store state.
func NewVMKeeper ¶
func NewVMKeeper( baseKey store.StoreKey, iavlKey store.StoreKey, acck AccountKeeperI, bank BankKeeperI, prmk ParamsKeeperI, ) *VMKeeper
NewVMKeeper returns a new VMKeeper. NOTE: prmk must be the root ParamsKeeper such that ExecContext.Params may set any module's parameter.
func (*VMKeeper) AddPackage ¶
func (vm *VMKeeper) AddPackage(ctx sdk.Context, msg MsgAddPackage) (err error)
AddPackage adds a package with given fileset.
func (*VMKeeper) CommitGnoTransactionStore ¶
func (*VMKeeper) ExportGenesis ¶
func (vm *VMKeeper) ExportGenesis(ctx sdk.Context) GenesisState
ExportGenesis returns a GenesisState for a given context and keeper
func (*VMKeeper) InitGenesis ¶
func (vm *VMKeeper) InitGenesis(ctx sdk.Context, gs GenesisState)
InitGenesis - Init store state from genesis data
func (*VMKeeper) Initialize ¶
func (vm *VMKeeper) Initialize( logger *slog.Logger, ms store.MultiStore, )
func (*VMKeeper) LoadStdlib ¶
LoadStdlib loads the Gno standard library into the given store. It will additionally execute type checking on the mempackages in the standard library.
func (*VMKeeper) LoadStdlibCached ¶
LoadStdlibCached loads the Gno standard library into the given store.
This works differently from VMKeeper.LoadStdlib as it performs an initial loading of the stdlib, which is then copied for future use.
LoadStdlibCached is more efficient for programs which have to load a fresh keeper many times (including tests and gnodev). For normal node execution, LoadStdlib should be used instead, for lower memory consumption and faster cold start.
func (*VMKeeper) MakeGnoTransactionStore ¶
func (*VMKeeper) PopulateStdlibCache ¶
func (vm *VMKeeper) PopulateStdlibCache()
PopulateStdlibCache populates the stdlib byte cache on the gno store.
func (*VMKeeper) PopulateStdlibCacheFrom ¶
func (vm *VMKeeper) PopulateStdlibCacheFrom(ms store.MultiStore)
PopulateStdlibCacheFrom populates the stdlib byte cache by reading from the given multistore. Needed at genesis when the persistent gnoStore's baseStore doesn't have stdlib objects yet (they're in the deliver state).
func (*VMKeeper) QueryEvalJSON ¶
func (vm *VMKeeper) QueryEvalJSON(ctx sdk.Context, pkgPath string, expr string) (res string, err error)
QueryEvalJSON evaluates a gno expression and returns JSON (Amino-encoded) results.
func (*VMKeeper) QueryEvalString ¶
func (vm *VMKeeper) QueryEvalString(ctx sdk.Context, pkgPath string, expr string) (res string, err error)
QueryEvalString evaluates a gno expression (readonly, for ABCI queries). The result is expected to be a single string (not a tuple).
func (*VMKeeper) QueryFuncs ¶
func (vm *VMKeeper) QueryFuncs(ctx sdk.Context, pkgPath string) (fsigs FunctionSignatures, err error)
QueryFuncs returns public facing function signatures.
func (*VMKeeper) QueryObjectBinary ¶
QueryObjectBinary retrieves an object by ObjectID and returns its Amino binary representation.
func (*VMKeeper) QueryObjectJSON ¶
QueryObjectJSON retrieves an object by ObjectID and returns its Amino JSON representation.
func (*VMKeeper) QueryPaths ¶
QueryPaths returns public facing function signatures. XXX: Implement pagination
func (*VMKeeper) QueryStorage ¶
QueryStorage returns storage and deposit for a realm.
type VMKeeperI ¶
type VMKeeperI interface {
AddPackage(ctx sdk.Context, msg MsgAddPackage) error
Call(ctx sdk.Context, msg MsgCall) (res string, err error)
QueryEval(ctx sdk.Context, pkgPath string, expr string) (res string, err error)
QueryEvalJSON(ctx sdk.Context, pkgPath string, expr string) (res string, err error)
QueryObjectJSON(ctx sdk.Context, oidStr string) (res string, err error)
QueryObjectBinary(ctx sdk.Context, oidStr string) (res []byte, err error)
Run(ctx sdk.Context, msg MsgRun) (res string, err error)
LoadStdlib(ctx sdk.Context, stdlibDir string)
LoadStdlibCached(ctx sdk.Context, stdlibDir string)
MakeGnoTransactionStore(ctx sdk.Context) sdk.Context
CommitGnoTransactionStore(ctx sdk.Context)
PopulateStdlibCache()
PopulateStdlibCacheFrom(ms store.MultiStore)
InitGenesis(ctx sdk.Context, data GenesisState)
}
vm.VMKeeperI defines a module interface that supports Gno smart contracts programming (scripting).