keeper

package
v24.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Difference

func Difference[T comparable](a, b []T) []T

Difference returns the slice of elements that are elements of a but not elements of b. TODO: Placed here temporarily. Delete after releasing the new osmoutils version.

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func NewQueryServerImpl

func NewQueryServerImpl(keeper Keeper) types.QueryServer

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

Types

type ChangeAssetStatusResult

type ChangeAssetStatusResult struct {
	OldStatus types.AssetStatus
	NewStatus types.AssetStatus
}

type Keeper

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

func NewKeeper

func NewKeeper(
	storeKey storetypes.StoreKey,
	cdc codec.BinaryCodec,
	paramSpace paramtypes.Subspace,
	router *baseapp.MsgServiceRouter,
	accountKeeper types.AccountKeeper,
	govModuleAddr string,
) Keeper

NewKeeper returns a new instance of the x/bridge keeper.

func (Keeper) ChangeAssetStatus

func (k Keeper) ChangeAssetStatus(
	ctx sdk.Context,
	assetID types.AssetID,
	newStatus types.AssetStatus,
) (ChangeAssetStatusResult, error)

ChangeAssetStatus changes the status of the provided asset to newStatus. Returns error if the provided asset is not found in the module params.

func (Keeper) ExportGenesis

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

ExportGenesis returns the bridge module's exported genesis.

func (Keeper) GetInboundTransfer

func (k Keeper) GetInboundTransfer(ctx sdk.Context, externalID string, externalHeight uint64) (types.InboundTransfer, error)

GetInboundTransfer returns the transfer by the external id and height.

func (Keeper) GetLastTransferHeight

func (k Keeper) GetLastTransferHeight(ctx sdk.Context, assetID types.AssetID) (uint64, error)

GetLastTransferHeight returns the last transfer height for the given asset.

func (Keeper) GetParams

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

GetParams returns the total set params.

func (Keeper) InboundTransfer

func (k Keeper) InboundTransfer(
	ctx sdk.Context,
	externalID string,
	externalHeight uint64,
	sender string,
	destAddr string,
	assetID types.AssetID,
	amount math.Int,
) error

func (Keeper) InitGenesis

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

InitGenesis initializes the bridge module's state from a provided genesis state.

func (Keeper) IsTransferFinalized

func (k Keeper) IsTransferFinalized(ctx sdk.Context, externalID string) bool

IsTransferFinalized returns true if the transfer was found in the finalized transfers set.

func (Keeper) Logger

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

Logger returns a logger for the x/bridge module.

func (Keeper) OutboundTransfer

func (k Keeper) OutboundTransfer(
	ctx sdk.Context,
	sourceAddr string,
	assetID types.AssetID,
	amount math.Int,
) error

func (Keeper) SaveFinalizedTransfer

func (k Keeper) SaveFinalizedTransfer(ctx sdk.Context, externalID string)

SaveFinalizedTransfer creates a new finalized transfer with the given external id.

func (Keeper) SetParam

func (k Keeper) SetParam(ctx sdk.Context, key []byte, value interface{})

SetParam sets a specific bridge module's parameter with the provided parameter.

func (Keeper) SetParams

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

SetParams sets the total set of params.

func (Keeper) UpdateLastAssetHeight

func (k Keeper) UpdateLastAssetHeight(ctx sdk.Context, assetID types.AssetID, height uint64)

UpdateLastAssetHeight properly updates the last transfer height of the asset. If the height of the asset is not found, then create it. Set the height as a maximum of the currently saved height and the provided one since the latest height can't decrease.

func (Keeper) UpdateParams

func (k Keeper) UpdateParams(ctx sdk.Context, newParams types.Params) (UpdateParamsResult, error)

UpdateParams properly updates params of the module.

func (Keeper) UpsertInboundTransfer

func (k Keeper) UpsertInboundTransfer(ctx sdk.Context, t types.InboundTransfer) error

UpsertInboundTransfer updates or inserts the value depending on whether it is already presented in the store or not.

type UpdateParamsResult

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

Jump to

Keyboard shortcuts

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