keeper

package
v0.1.1-ibc-go-v7.3-was... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 20 Imported by: 13

Documentation

Index

Constants

View Source
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

Checksums implements the Query/Checksums gRPC method. It returns a list of hex encoded checksums stored.

func (Keeper) Code

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

func (k Keeper) GetAuthority() string

GetAuthority returns the 08-wasm module's authority.

func (Keeper) GetWasmClientState

func (k Keeper) GetWasmClientState(ctx sdk.Context, clientID string) (*types.ClientState, error)

GetWasmClientState returns the 08-wasm client state for the given client identifier.

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState) error

InitGenesis initializes the 08-wasm module's state from a provided genesis state.

func (Keeper) MigrateContract

MigrateContract defines a rpc handler method for MsgMigrateContract

func (Keeper) RemoveChecksum

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL