Documentation ¶
Overview ¶
nolint:deadcode unused noalias
Index ¶
- func NewQuerier(keeper Keeper) sdk.Querier
- func TestHandler(k Keeper) sdk.Handler
- type InitMsg
- type Keeper
- func (k Keeper) CompileCode(ctx sdk.Context, wasmCode []byte) (codeHash []byte, err error)
- func (k Keeper) ExecuteContract(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, ...) ([]byte, error)
- func (k Keeper) GetByteCode(ctx sdk.Context, codeID uint64) ([]byte, error)
- func (k Keeper) GetCodeInfo(ctx sdk.Context, codeID uint64) (codeInfo types.CodeInfo, err error)
- func (k Keeper) GetContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) (contractInfo types.ContractInfo, err error)
- func (k Keeper) GetContractStoreIterator(ctx sdk.Context, contractAddress sdk.AccAddress) sdk.Iterator
- func (k Keeper) GetLastCodeID(ctx sdk.Context) (uint64, error)
- func (k Keeper) GetLastInstanceID(ctx sdk.Context) (uint64, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) InstantiateContract(ctx sdk.Context, codeID uint64, creator sdk.AccAddress, initMsg []byte, ...) (contractAddress sdk.AccAddress, err error)
- func (k Keeper) IterateContractInfo(ctx sdk.Context, cb func(types.ContractInfo) bool)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MaxContractGas(ctx sdk.Context) (res uint64)
- func (k Keeper) MaxContractMsgSize(ctx sdk.Context) (res uint64)
- func (k Keeper) MaxContractSize(ctx sdk.Context) (res uint64)
- func (k Keeper) MigrateContract(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, ...) ([]byte, error)
- func (k *Keeper) RegisterMsgParsers(parsers map[string]types.WasmMsgParserInterface)
- func (k *Keeper) RegisterQueriers(queriers map[string]types.WasmQuerierInterface)
- func (k Keeper) SetCodeInfo(ctx sdk.Context, codeID uint64, codeInfo types.CodeInfo)
- func (k Keeper) SetContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress, codeInfo types.ContractInfo)
- func (k Keeper) SetContractStore(ctx sdk.Context, contractAddress sdk.AccAddress, models []types.Model)
- func (k Keeper) SetLastCodeID(ctx sdk.Context, id uint64)
- func (k Keeper) SetLastInstanceID(ctx sdk.Context, id uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) StoreCode(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte) (codeID uint64, err error)
- func (k Keeper) StoreConfig()
- type TestInput
- type WasmMsgParser
- type WasmQuerier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestHandler ¶
TestHandler returns a wasm handler for tests (to avoid circular imports)
Types ¶
type InitMsg ¶
type InitMsg struct { Verifier sdk.AccAddress `json:"verifier"` Beneficiary sdk.AccAddress `json:"beneficiary"` }
InitMsg nolint
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper will have a reference to Wasmer with it's own data directory.
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, paramspace params.Subspace, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, supplyKeeper types.SupplyKeeper, treasuryKeeper types.TreasuryKeeper, router sdk.Router, supportedFeatures string, wasmConfig *config.Config) Keeper
NewKeeper creates a new contract Keeper instance
func (Keeper) CompileCode ¶
CompileCode uncompress the wasm code bytes and store the code to local file system
func (Keeper) ExecuteContract ¶
func (k Keeper) ExecuteContract(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, exeMsg []byte, coins sdk.Coins) ([]byte, error)
ExecuteContract executes the contract instance
func (Keeper) GetByteCode ¶
GetByteCode returns ByteCode of the given CodeHash
func (Keeper) GetCodeInfo ¶
GetCodeInfo returns CodeInfo for the given codeID
func (Keeper) GetContractInfo ¶
func (k Keeper) GetContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) (contractInfo types.ContractInfo, err error)
GetContractInfo returns contract info of the given address
func (Keeper) GetContractStoreIterator ¶
func (k Keeper) GetContractStoreIterator(ctx sdk.Context, contractAddress sdk.AccAddress) sdk.Iterator
GetContractStoreIterator returns iterator for a contract store
func (Keeper) GetLastCodeID ¶
GetLastCodeID return last code ID
func (Keeper) GetLastInstanceID ¶
GetLastInstanceID return last instance ID
func (Keeper) InstantiateContract ¶
func (k Keeper) InstantiateContract( ctx sdk.Context, codeID uint64, creator sdk.AccAddress, initMsg []byte, deposit sdk.Coins, migratable bool) (contractAddress sdk.AccAddress, err error)
InstantiateContract creates an instance of a WASM contract
func (Keeper) IterateContractInfo ¶
IterateContractInfo iterates all contract infos
func (Keeper) MaxContractGas ¶
MaxContractGas defines allowed maximum gas usage per each contract execution
func (Keeper) MaxContractMsgSize ¶
MaxContractMsgSize defines maximum bytes size of a contract
func (Keeper) MaxContractSize ¶
MaxContractSize defines maximum bytes size of a contract
func (Keeper) MigrateContract ¶
func (k Keeper) MigrateContract(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, newCodeID uint64, migrateMsg []byte) ([]byte, error)
MigrateContract allows to upgrade a contract to a new code with data migration.
func (*Keeper) RegisterMsgParsers ¶
func (k *Keeper) RegisterMsgParsers(parsers map[string]types.WasmMsgParserInterface)
RegisterMsgParsers register module msg parsers
func (*Keeper) RegisterQueriers ¶
func (k *Keeper) RegisterQueriers(queriers map[string]types.WasmQuerierInterface)
RegisterQueriers register module queriers
func (Keeper) SetCodeInfo ¶
SetCodeInfo stores CodeInfo for the given codeID
func (Keeper) SetContractInfo ¶
func (k Keeper) SetContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress, codeInfo types.ContractInfo)
SetContractInfo stores ContractInfo for the given contractAddress
func (Keeper) SetContractStore ¶
func (k Keeper) SetContractStore(ctx sdk.Context, contractAddress sdk.AccAddress, models []types.Model)
SetContractStore records all the Models on the contract store
func (Keeper) SetLastCodeID ¶
SetLastCodeID set last code id
func (Keeper) SetLastInstanceID ¶
SetLastInstanceID set last instance id
func (Keeper) StoreCode ¶
func (k Keeper) StoreCode(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte) (codeID uint64, err error)
StoreCode uploads and compiles a WASM contract bytecode, returning a short identifier for the stored code
func (Keeper) StoreConfig ¶
func (k Keeper) StoreConfig()
StoreConfig store wasm config to local config file
type TestInput ¶
type TestInput struct { Ctx sdk.Context Cdc *codec.Codec AccKeeper auth.AccountKeeper BankKeeper bank.Keeper SupplyKeeper supply.Keeper StakingKeeper staking.Keeper DistrKeeper distr.Keeper OracleKeeper oracle.Keeper MarketKeeper market.Keeper TreasuryKeeper treasury.Keeper WasmKeeper Keeper }
TestInput nolint
type WasmMsgParser ¶
type WasmMsgParser struct{}
WasmMsgParser - wasm msg parser for staking msgs
func NewWasmMsgParser ¶
func NewWasmMsgParser() WasmMsgParser
NewWasmMsgParser returns wasm msg parser
func (WasmMsgParser) Parse ¶
func (WasmMsgParser) Parse(contractAddr sdk.AccAddress, wasmMsg wasmTypes.CosmosMsg) ([]sdk.Msg, error)
Parse implements wasm staking msg parser
func (WasmMsgParser) ParseCustom ¶
func (parser WasmMsgParser) ParseCustom(contractAddr sdk.AccAddress, data json.RawMessage) ([]sdk.Msg, error)
ParseCustom implements custom parser
type WasmQuerier ¶
type WasmQuerier struct {
// contains filtered or unexported fields
}
WasmQuerier - wasm query interface for wasm contract
func NewWasmQuerier ¶
func NewWasmQuerier(keeper Keeper) WasmQuerier
NewWasmQuerier returns wasm querier
func (WasmQuerier) Query ¶
func (querier WasmQuerier) Query(ctx sdk.Context, request wasmTypes.QueryRequest) ([]byte, error)
Query - implement query function
func (WasmQuerier) QueryCustom ¶
func (WasmQuerier) QueryCustom(ctx sdk.Context, data json.RawMessage) ([]byte, error)
QueryCustom implements custom query interface