Documentation ¶
Index ¶
- Constants
- func InitializePinnedCodes(ctx sdk.Context, cdc codec.BinaryCodec) error
- func NewWasmSnapshotter(cms sdk.MultiStore, keeper *Keeper) snapshot.ExtensionSnapshotter
- type Keeper
- func (k Keeper) Checksums(goCtx context.Context, req *types.QueryChecksumsRequest) (*types.QueryChecksumsResponse, error)
- func (k Keeper) Code(goCtx context.Context, req *types.QueryCodeRequest) (*types.QueryCodeResponse, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetWasmClientState(ctx sdk.Context, clientID string) (*types.ClientState, error)
- func (k Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState) error
- func (k Keeper) MigrateContract(goCtx context.Context, msg *types.MsgMigrateContract) (*types.MsgMigrateContractResponse, error)
- func (k Keeper) RemoveChecksum(goCtx context.Context, msg *types.MsgRemoveChecksum) (*types.MsgRemoveChecksumResponse, error)
- func (k Keeper) StoreCode(goCtx context.Context, msg *types.MsgStoreCode) (*types.MsgStoreCodeResponse, error)
- type Option
- type WasmSnapshotter
- func (ws *WasmSnapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader) error
- func (ws *WasmSnapshotter) SnapshotExtension(height uint64, payloadWriter snapshot.ExtensionPayloadWriter) error
- func (*WasmSnapshotter) SnapshotFormat() uint32
- func (*WasmSnapshotter) SnapshotName() string
- func (*WasmSnapshotter) SupportedFormats() []uint32
Constants ¶
const SnapshotFormat = 1
SnapshotFormat defines the default snapshot extension encoding format. SnapshotFormat 1 is gzipped wasm byte code for each item payload. No protobuf envelope, no metadata.
Variables ¶
This section is empty.
Functions ¶
func InitializePinnedCodes ¶
func InitializePinnedCodes(ctx sdk.Context, cdc codec.BinaryCodec) error
InitializePinnedCodes updates wasmvm to pin to cache all contracts marked as pinned
func NewWasmSnapshotter ¶
func NewWasmSnapshotter(cms sdk.MultiStore, keeper *Keeper) snapshot.ExtensionSnapshotter
NewWasmSnapshotter creates and returns a new snapshot.ExtensionSnapshotter implementation for the 08-wasm module.
Types ¶
type Keeper ¶
type Keeper struct { // implements gRPC QueryServer interface types.QueryServer // contains filtered or unexported fields }
Keeper defines the 08-wasm keeper
func NewKeeperWithConfig ¶
func NewKeeperWithConfig( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, clientKeeper types.ClientKeeper, authority string, wasmConfig types.WasmConfig, queryRouter ibcwasm.QueryRouter, opts ...Option, ) Keeper
NewKeeperWithConfig creates a new Keeper instance with the provided Wasm configuration. This constructor function is meant to be used when the chain does not use x/wasm and a Wasm VM needs to be instantiated using the provided parameters.
func NewKeeperWithVM ¶
func NewKeeperWithVM( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, clientKeeper types.ClientKeeper, authority string, vm ibcwasm.WasmEngine, queryRouter ibcwasm.QueryRouter, opts ...Option, ) Keeper
NewKeeperWithVM creates a new Keeper instance with the provided Wasm VM. This constructor function is meant to be used when the chain uses x/wasm and the same Wasm VM instance should be shared with it.
func (Keeper) Checksums ¶
func (k Keeper) Checksums(goCtx context.Context, req *types.QueryChecksumsRequest) (*types.QueryChecksumsResponse, error)
Checksums implements the Query/Checksums gRPC method. It returns a list of hex encoded checksums stored.
func (Keeper) Code ¶
func (k Keeper) Code(goCtx context.Context, req *types.QueryCodeRequest) (*types.QueryCodeResponse, error)
Code implements the Query/Code gRPC method
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState
ExportGenesis returns the 08-wasm module's exported genesis. This includes the code for all contracts previously stored.
func (Keeper) GetAuthority ¶
GetAuthority returns the 08-wasm module's authority.
func (Keeper) GetWasmClientState ¶
GetWasmClientState returns the 08-wasm client state for the given client identifier.
func (Keeper) InitGenesis ¶
InitGenesis initializes the 08-wasm module's state from a provided genesis state.
func (Keeper) MigrateContract ¶
func (k Keeper) MigrateContract(goCtx context.Context, msg *types.MsgMigrateContract) (*types.MsgMigrateContractResponse, error)
MigrateContract defines a rpc handler method for MsgMigrateContract
func (Keeper) RemoveChecksum ¶
func (k Keeper) RemoveChecksum(goCtx context.Context, msg *types.MsgRemoveChecksum) (*types.MsgRemoveChecksumResponse, error)
RemoveChecksum defines a rpc handler method for MsgRemoveChecksum
func (Keeper) StoreCode ¶
func (k Keeper) StoreCode(goCtx context.Context, msg *types.MsgStoreCode) (*types.MsgStoreCodeResponse, error)
StoreCode defines a rpc handler method for MsgStoreCode
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is an extension point to instantiate keeper with non default values
func WithQueryPlugins ¶
func WithQueryPlugins(plugins *types.QueryPlugins) Option
WithQueryPlugins is an optional constructor parameter to pass custom query plugins for wasmVM requests. Missing fields will be filled with default queriers.
type WasmSnapshotter ¶
type WasmSnapshotter struct {
// contains filtered or unexported fields
}
WasmSnapshotter implements the snapshot.ExtensionSnapshotter interface and is used to import and export state maintained within the wasmvm cache. NOTE: The following ExtensionSnapshotter has been adapted from CosmWasm's x/wasm: https://github.com/CosmWasm/wasmd/blob/v0.43.0/x/wasm/keeper/snapshotter.go
func (*WasmSnapshotter) RestoreExtension ¶
func (ws *WasmSnapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader) error
RestoreExtension implements the snapshot.ExtensionSnapshotter interface. RestoreExtension is used to read data from an existing extension state snapshot into the 08-wasm module. The payload reader returns io.EOF when it has reached the end of the extension state snapshot.
func (*WasmSnapshotter) SnapshotExtension ¶
func (ws *WasmSnapshotter) SnapshotExtension(height uint64, payloadWriter snapshot.ExtensionPayloadWriter) error
SnapshotExtension implements the snapshot.ExntensionSnapshotter interface. SnapshotExtension is used to write data payloads into the underlying protobuf stream from the 08-wasm module.
func (*WasmSnapshotter) SnapshotFormat ¶
func (*WasmSnapshotter) SnapshotFormat() uint32
SnapshotFormat implements the snapshot.ExtensionSnapshotter interface. This is the default format used for encoding payloads when taking a snapshot.
func (*WasmSnapshotter) SnapshotName ¶
func (*WasmSnapshotter) SnapshotName() string
SnapshotName implements the snapshot.ExtensionSnapshotter interface. A unique name should be provided such that the implementation can be identified by the manager.
func (*WasmSnapshotter) SupportedFormats ¶
func (*WasmSnapshotter) SupportedFormats() []uint32
SupportedFormats implements the snapshot.ExtensionSnapshotter interface. This defines a list of supported formats the snapshotter extension can restore from.