keeper

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: AGPL-3.0, Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

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.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	bankKeeper types.BankKeeper,
	blockTimeKeeper types.BlockTimeKeeper,
	ics4Wrapper types.ICS4Wrapper,
	authorities []string,
) *Keeper

func (Keeper) AcknowledgeIBCTransferPacket

func (k Keeper) AcknowledgeIBCTransferPacket(
	ctx sdk.Context,
	packet channeltypes.Packet,
	acknowledgement []byte,
) error

Middleware implementation for OnAckPacket It is called on the sender chain when a relayer relays back the acknowledgement from the receiver chain. On the dYdX chain, this includes the “response” of the receiver chain for outbound transfer from dYdX.

func (Keeper) GetAllLimitParams

func (k Keeper) GetAllLimitParams(ctx sdk.Context) (list []types.LimitParams)

GetAllLimitParams returns `LimitParams` stored in state

func (Keeper) GetAppVersion

func (k Keeper) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool)

GetAppVersion wraps IBC ChannelKeeper's GetAppVersion function

func (Keeper) GetDenomCapacity

func (k Keeper) GetDenomCapacity(
	ctx sdk.Context,
	denom string,
) (val types.DenomCapacity)

GetDenomCapacity returns `DenomCapacity` for the given denom.

func (Keeper) GetLimitParams

func (k Keeper) GetLimitParams(
	ctx sdk.Context,
	denom string,
) (val types.LimitParams)

GetLimitParams returns `LimitParams` for the given denom.

func (Keeper) GetLimiterCapacityListForDenom

func (k Keeper) GetLimiterCapacityListForDenom(
	ctx sdk.Context,
	denom string,
) (
	limiterCapacityList []types.LimiterCapacity,
	err error,
)

GetLimiterCapacityListForDenom returns a list of `LimiterCapacity`, which is a tuple of (limiter, current_capacity), for the given denom.

func (Keeper) HasAuthority

func (k Keeper) HasAuthority(authority string) bool

func (Keeper) HasPendingSendPacket

func (k Keeper) HasPendingSendPacket(ctx sdk.Context, channelId string, sequence uint64) bool

Checks whether the packet sequence number is in the store - indicating that it is a pending packet.

func (Keeper) IncrementCapacitiesForDenom

func (k Keeper) IncrementCapacitiesForDenom(
	ctx sdk.Context,
	denom string,
	amount *big.Int,
)

IncrementCapacitiesForDenom processes a inbound IBC transfer, by updating the capacity lists for the denom.

func (Keeper) InitializeForGenesis

func (k Keeper) InitializeForGenesis(ctx sdk.Context)

func (Keeper) ListLimitParams

func (Keeper) Logger

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

func (Keeper) ProcessWithdrawal

func (k Keeper) ProcessWithdrawal(
	ctx sdk.Context,
	denom string,
	amount *big.Int,
) error

ProcessWithdrawal processes an outbound IBC transfer, by updating the capacity lists for the denom. If any of the capacities are inefficient, returns an error which results in transaction failing upstream.

func (Keeper) RemovePendingSendPacket

func (k Keeper) RemovePendingSendPacket(ctx sdk.Context, channelId string, sequence uint64)

Remove a pending packet sequence number from the store Used after the ack or timeout for a packet has been received

func (Keeper) SendPacket

func (k Keeper) SendPacket(
	ctx sdk.Context,
	channelCap *capabilitytypes.Capability,
	sourcePort string,
	sourceChannel string,
	timeoutHeight clienttypes.Height,
	timeoutTimestamp uint64,
	data []byte,
) (sequence uint64, err error)

SendPacket wraps IBC ChannelKeeper's SendPacket function If the packet does not get rate limited, it passes the packet to the IBC Channel keeper

func (Keeper) SetDenomCapacity

func (k Keeper) SetDenomCapacity(
	ctx sdk.Context,
	denomCapacity types.DenomCapacity,
)

SetDenomCapacity sets `DenomCapacity` for the given denom.

func (Keeper) SetLimitParams

func (k Keeper) SetLimitParams(
	ctx sdk.Context,
	limitParams types.LimitParams,
) (err error)

SetLimitParams sets `LimitParams` for the given denom. Also overwrites the existing `DenomCapacity` object for the denom with a default `capacity_list` of the same length as the `limiters` list. Each `capacity` is initialized to the current baseline.

func (Keeper) SetPendingSendPacket

func (k Keeper) SetPendingSendPacket(ctx sdk.Context, channelId string, sequence uint64)

Sets a pending packet sequence number in the store

func (Keeper) TimeoutIBCTransferPacket

func (k Keeper) TimeoutIBCTransferPacket(ctx sdk.Context, packet channeltypes.Packet) error

Middleware implementation for OnTimeout It is triggered by a relayer with MsgTimeout on the sender chain when timeoutHeight is reached for a sent packet but acknowledgement has not been received. It should therefore revert the capacity change.

func (Keeper) TrySendRateLimitedPacket

func (k Keeper) TrySendRateLimitedPacket(ctx sdk.Context, packet channeltypes.Packet) error

Middleware implementation for SendPacket with rate limiting Checks whether the rate limit has been exceeded - and if it hasn't, sends the packet

func (Keeper) UndoSendPacket

func (k Keeper) UndoSendPacket(
	ctx sdk.Context,
	channelId string,
	sequence uint64,
	denom string,
	amount *big.Int,
)

If a SendPacket fails or times out, undo the capacity decrease that happened during the send Idempotent - has no effect on a previously removed pending packet.

func (Keeper) UndoWithdrawal

func (k Keeper) UndoWithdrawal(
	ctx sdk.Context,
	denom string,
	amount *big.Int,
)

UndoWithdrawal is a wrapper around `IncrementCapacitiesForDenom`. It also emits telemetry for the amount of withdrawal undone.

func (Keeper) UpdateAllCapacitiesEndBlocker

func (k Keeper) UpdateAllCapacitiesEndBlocker(
	ctx sdk.Context,
)

UpdateAllCapacitiesEndBlocker is called during the EndBlocker to update the capacity for all limit params.

func (Keeper) WriteAcknowledgement

func (k Keeper) WriteAcknowledgement(
	ctx sdk.Context,
	chanCap *capabilitytypes.Capability,
	packet ibcexported.PacketI,
	acknowledgement ibcexported.Acknowledgement,
) error

WriteAcknowledgement wraps IBC ChannelKeeper's WriteAcknowledgement function

Jump to

Keyboard shortcuts

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