keeper

package
v7.0.1-wasm-client Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const SnapshotFormat = 1

SnapshotFormat format 1 is just gzipped wasm byte code for each item payload. No protobuf envelope, no metadata.

Variables

This section is empty.

Functions

func GzipIt

func GzipIt(input []byte) ([]byte, error)

GzipIt compresses the input ([]byte)

func IsGzip

func IsGzip(input []byte) bool

IsGzip returns checks if the file contents are gzip compressed

func IsWasm

func IsWasm(input []byte) bool

IsWasm checks if the file contents are of wasm binary

func LimitReader

func LimitReader(r io.Reader, n int64) io.Reader

LimitReader returns a Reader that reads from r but stops with types.ErrLimit after n bytes. The underlying implementation is a *io.LimitedReader.

func Uncompress

func Uncompress(gzipSrc []byte, limit uint64) ([]byte, error)

Uncompress expects a valid gzip source to unpack or fails. See IsGzip

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, authority string, homeDir string) Keeper

func (Keeper) AllWasmCodeID

AllWasmCodeID implements the IBC QueryServer interface

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState

func (Keeper) GetWasmByte

func (k Keeper) GetWasmByte(ctx sdk.Context, codeID string) ([]byte, error)

TODO: testing

func (Keeper) InitGenesis

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

func (Keeper) IterateCodeInfos

func (k Keeper) IterateCodeInfos(ctx sdk.Context, fn func(codeID string) (stop bool))

TODO: testing

func (Keeper) PushNewWasmCode

PushNewWasmCode defines a rpc handler method for MsgPushNewWasmCode

func (Keeper) WasmCode

WasmCode implements the IBC QueryServer interface

type LimitedReader

type LimitedReader struct {
	// contains filtered or unexported fields
}

func (*LimitedReader) Read

func (l *LimitedReader) Read(p []byte) (n int, err error)

type WasmSnapshotter

type WasmSnapshotter struct {
	// contains filtered or unexported fields
}

func NewWasmSnapshotter

func NewWasmSnapshotter(cms sdk.MultiStore, wasm *Keeper) *WasmSnapshotter

func (*WasmSnapshotter) RestoreExtension

func (ws *WasmSnapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader) error

func (*WasmSnapshotter) SnapshotExtension

func (ws *WasmSnapshotter) SnapshotExtension(height uint64, payloadWriter snapshot.ExtensionPayloadWriter) error

func (*WasmSnapshotter) SnapshotFormat

func (ws *WasmSnapshotter) SnapshotFormat() uint32

func (*WasmSnapshotter) SnapshotName

func (ws *WasmSnapshotter) SnapshotName() string

func (*WasmSnapshotter) SupportedFormats

func (ws *WasmSnapshotter) SupportedFormats() []uint32

Jump to

Keyboard shortcuts

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