Documentation
¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AcknowledgeIBCTransferPacket(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte) error
- func (k Keeper) AllPendingSendPackets(ctx context.Context, req *types.QueryAllPendingSendPacketsRequest) (*types.QueryAllPendingSendPacketsResponse, error)
- func (k Keeper) CapacityByDenom(ctx context.Context, req *types.QueryCapacityByDenomRequest) (*types.QueryCapacityByDenomResponse, error)
- func (k Keeper) GetAllLimitParams(ctx sdk.Context) (list []types.LimitParams)
- func (k Keeper) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool)
- func (k Keeper) GetDenomCapacity(ctx sdk.Context, denom string) (val types.DenomCapacity)
- func (k Keeper) GetLimitParams(ctx sdk.Context, denom string) (val types.LimitParams)
- func (k Keeper) GetLimiterCapacityListForDenom(ctx sdk.Context, denom string) (limiterCapacityList []types.LimiterCapacity, err error)
- func (k Keeper) HasAuthority(authority string) bool
- func (k Keeper) HasPendingSendPacket(ctx sdk.Context, channelId string, sequence uint64) bool
- func (k Keeper) IncrementCapacitiesForDenom(ctx sdk.Context, denom string, amount *big.Int)
- func (k Keeper) InitializeForGenesis(ctx sdk.Context)
- func (k Keeper) ListLimitParams(ctx context.Context, req *types.ListLimitParamsRequest) (*types.ListLimitParamsResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) cosmoslog.Logger
- func (k Keeper) ProcessWithdrawal(ctx sdk.Context, denom string, amount *big.Int) error
- func (k Keeper) RemovePendingSendPacket(ctx sdk.Context, channelId string, sequence uint64)
- func (k Keeper) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, sourcePort string, ...) (sequence uint64, err error)
- func (k Keeper) SetDenomCapacity(ctx sdk.Context, denomCapacity types.DenomCapacity)
- func (k Keeper) SetLimitParams(ctx sdk.Context, limitParams types.LimitParams) (err error)
- func (k Keeper) SetPendingSendPacket(ctx sdk.Context, channelId string, sequence uint64)
- func (k Keeper) TimeoutIBCTransferPacket(ctx sdk.Context, packet channeltypes.Packet) error
- func (k Keeper) TrySendRateLimitedPacket(ctx sdk.Context, packet channeltypes.Packet) error
- func (k Keeper) UndoSendPacket(ctx sdk.Context, channelId string, sequence uint64, denom string, ...)
- func (k Keeper) UndoWithdrawal(ctx sdk.Context, denom string, amount *big.Int)
- func (k Keeper) UpdateAllCapacitiesEndBlocker(ctx sdk.Context)
- func (k Keeper) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
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) AllPendingSendPackets ¶
func (k Keeper) AllPendingSendPackets( ctx context.Context, req *types.QueryAllPendingSendPacketsRequest, ) (*types.QueryAllPendingSendPacketsResponse, error)
func (Keeper) CapacityByDenom ¶
func (k Keeper) CapacityByDenom( ctx context.Context, req *types.QueryCapacityByDenomRequest, ) (*types.QueryCapacityByDenomResponse, error)
func (Keeper) GetAllLimitParams ¶
func (k Keeper) GetAllLimitParams(ctx sdk.Context) (list []types.LimitParams)
GetAllLimitParams returns `LimitParams` stored in state
func (Keeper) GetAppVersion ¶
GetAppVersion wraps IBC ChannelKeeper's GetAppVersion function
func (Keeper) GetDenomCapacity ¶
GetDenomCapacity returns `DenomCapacity` for the given denom.
func (Keeper) GetLimitParams ¶
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 (Keeper) HasPendingSendPacket ¶
Checks whether the packet sequence number is in the store - indicating that it is a pending packet.
func (Keeper) IncrementCapacitiesForDenom ¶
IncrementCapacitiesForDenom processes a inbound IBC transfer, by updating the capacity lists for the denom.
func (Keeper) InitializeForGenesis ¶
func (Keeper) ListLimitParams ¶
func (k Keeper) ListLimitParams( ctx context.Context, req *types.ListLimitParamsRequest, ) (*types.ListLimitParamsResponse, error)
func (Keeper) ProcessWithdrawal ¶
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 ¶
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 ¶
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 ¶
Sets a pending packet sequence number in the store
func (Keeper) TimeoutIBCTransferPacket ¶
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 ¶
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 ¶
UndoWithdrawal is a wrapper around `IncrementCapacitiesForDenom`. It also emits telemetry for the amount of withdrawal undone.
func (Keeper) UpdateAllCapacitiesEndBlocker ¶
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