keeper

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 18 Imported by: 3

Documentation

Index

Constants

View Source
const FailuresQueryMaxLimit uint64 = query.DefaultLimit

Variables

This section is empty.

Functions

func NewMsgServerImpl added in v1.1.0

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func PrepareOpenAckCallbackMessage added in v1.1.0

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

func PrepareSudoCallbackMessage added in v1.1.0

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

func RedactError added in v1.1.0

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,
	storeKey,
	memKey storetypes.StoreKey,
	wasmKeeper types.WasmKeeper,
	authority string,
) *Keeper

func (Keeper) AddContractFailure

func (k Keeper) AddContractFailure(ctx sdk.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) AddressFailure added in v1.1.0

func (Keeper) AddressFailures

func (Keeper) GetAllFailures

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

GetAllFailures returns all failures

func (Keeper) GetAuthority added in v1.1.0

func (k Keeper) GetAuthority() string

func (Keeper) GetFailure added in v1.1.0

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

func (Keeper) GetNextFailureIDKey

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

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams get all parameters as types.Params

func (Keeper) HasContractInfo

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

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) ResubmitFailure added in v1.1.0

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 sdk.Context, params types.Params) error

SetParams set the params

func (Keeper) SudoKVQueryResult

func (k Keeper) SudoKVQueryResult(
	ctx sdk.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 sdk.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 added in v1.1.0

UpdateParams updates the module parameters

type Migrator added in v1.1.0

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

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

func NewMigrator added in v1.1.0

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2 added in v1.1.0

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