keeper

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const FailuresQueryMaxLimit uint64 = query.DefaultLimit

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

func PrepareOpenAckCallbackMessage

func PrepareOpenAckCallbackMessage(details types.OpenAckDetails) ([]byte, error)

func PrepareSudoCallbackMessage

func PrepareSudoCallbackMessage(request channeltypes.Packet, ack *channeltypes.Acknowledgement) ([]byte, error)

func RedactError

func RedactError(err error) error

RedactError removes non-determenistic details from the error returning just codespace and core of the error. Returns full error for system errors.

Copy+paste from https://github.com/neutron-org/wasmd/blob/5b59886e41ed55a7a4a9ae196e34b0852285503d/x/wasm/keeper/msg_dispatcher.go#L175-L190

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService store.KVStoreService,
	wasmKeeper types.WasmKeeper,
	authority string,
) *Keeper

func (Keeper) AddContractFailure

func (k Keeper) AddContractFailure(ctx context.Context, address string, sudoPayload []byte, errMsg string) types.Failure

AddContractFailure adds a specific failure to the store. The provided address is used to determine the failure ID and they both are used to create a storage key for the failure.

WARNING: The errMsg string parameter is expected to be deterministic. It means that the errMsg must be OS/library version agnostic and carry a concrete defined error message. One of the good ways to do so is to redact error using the RedactError func as it is done in SudoLimitWrapper Sudo method: https://github.com/neutron-org/neutron/blob/eb8b5ae50907439ff9af0527a42ef0cb448a78b5/x/contractmanager/ibc_middleware.go#L42. Another good way could be passing here some constant value.

func (Keeper) GetAllFailures

func (k Keeper) GetAllFailures(ctx context.Context) (list []types.Failure)

GetAllFailures returns all failures.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

func (Keeper) GetFailure

func (k Keeper) GetFailure(ctx sdk.Context, contractAddr sdk.AccAddress, id uint64) (*types.Failure, error)

func (Keeper) GetNextFailureIDKey

func (k Keeper) GetNextFailureIDKey(ctx context.Context, address string) uint64

func (Keeper) GetParams

func (k Keeper) GetParams(ctx context.Context) (params types.Params, err error)

GetParams get all parameters as types.Params.

func (Keeper) HasContractInfo

func (k Keeper) HasContractInfo(ctx context.Context, contractAddress sdk.AccAddress) bool

func (Keeper) Logger

func (k Keeper) Logger(ctx context.Context) log.Logger

func (Keeper) Params

func (Keeper) ResubmitFailure

func (k Keeper) ResubmitFailure(ctx sdk.Context, contractAddr sdk.AccAddress, failure *types.Failure) error

ResubmitFailure tries to call sudo handler for contract with same parameters as initially.

func (Keeper) SetParams

func (k Keeper) SetParams(ctx context.Context, params types.Params) error

SetParams set the params.

func (Keeper) SudoKVQueryResult

func (k Keeper) SudoKVQueryResult(
	ctx context.Context,
	contractAddress sdk.AccAddress,
	queryID uint64,
) ([]byte, error)

SudoKVQueryResult is used to pass a kv query id to the contract that registered the query when a query result is provided by the relayer.

func (Keeper) SudoTxQueryResult

func (k Keeper) SudoTxQueryResult(
	ctx context.Context,
	contractAddress sdk.AccAddress,
	queryID uint64,
	height ibcclienttypes.Height,
	data []byte,
) ([]byte, error)

SudoTxQueryResult is used to pass a tx query result to the contract that registered the query to:

  1. check whether the transaction actually satisfies the initial query arguments;
  2. execute business logic related to the tx query result / save the result to state.

func (Keeper) UpdateParams

UpdateParams updates the module parameters.

type Migrator

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Migrate1to2 migrates from version 1 to 2.

Jump to

Keyboard shortcuts

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