Documentation ¶
Index ¶
- type Keeper
- func (k Keeper) BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability
- func (k Keeper) CounterpartyPayee(goCtx context.Context, req *types.QueryCounterpartyPayeeRequest) (*types.QueryCounterpartyPayeeResponse, error)
- func (k Keeper) DeleteFeeEnabled(ctx sdk.Context, portID, channelID string)
- func (k Keeper) DeleteFeesInEscrow(ctx sdk.Context, packetID channeltypes.PacketId)
- func (k Keeper) DeleteForwardRelayerAddress(ctx sdk.Context, packetID channeltypes.PacketId)
- func (k Keeper) DistributePacketFeesOnAcknowledgement(ctx sdk.Context, forwardRelayer string, reverseRelayer sdk.AccAddress, ...)
- func (k Keeper) DistributePacketFeesOnTimeout(ctx sdk.Context, timeoutRelayer sdk.AccAddress, packetFees []types.PacketFee, ...)
- func (k Keeper) EscrowAccountHasBalance(ctx sdk.Context, coins sdk.Coins) bool
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) FeeEnabledChannel(goCtx context.Context, req *types.QueryFeeEnabledChannelRequest) (*types.QueryFeeEnabledChannelResponse, error)
- func (k Keeper) FeeEnabledChannels(goCtx context.Context, req *types.QueryFeeEnabledChannelsRequest) (*types.QueryFeeEnabledChannelsResponse, error)
- func (k Keeper) GetAllCounterpartyPayees(ctx sdk.Context) []types.RegisteredCounterpartyPayee
- func (k Keeper) GetAllFeeEnabledChannels(ctx sdk.Context) []types.FeeEnabledChannel
- func (k Keeper) GetAllForwardRelayerAddresses(ctx sdk.Context) []types.ForwardRelayerAddress
- func (k Keeper) GetAllIdentifiedPacketFees(ctx sdk.Context) []types.IdentifiedPacketFees
- func (k Keeper) GetAllPayees(ctx sdk.Context) []types.RegisteredPayee
- func (k Keeper) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool)
- func (k Keeper) GetChannel(ctx sdk.Context, portID, channelID string) (channeltypes.Channel, bool)
- func (k Keeper) GetCounterpartyPayeeAddress(ctx sdk.Context, address, channelID string) (string, bool)
- func (k Keeper) GetFeeModuleAddress() sdk.AccAddress
- func (k Keeper) GetFeesInEscrow(ctx sdk.Context, packetID channeltypes.PacketId) (types.PacketFees, bool)
- func (k Keeper) GetICS4Wrapper() porttypes.ICS4Wrapper
- func (k Keeper) GetIdentifiedPacketFeesForChannel(ctx sdk.Context, portID, channelID string) []types.IdentifiedPacketFees
- func (k Keeper) GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool)
- func (k Keeper) GetPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64) []byte
- func (k Keeper) GetPayeeAddress(ctx sdk.Context, relayerAddr, channelID string) (string, bool)
- func (k Keeper) GetRelayerAddressForAsyncAck(ctx sdk.Context, packetID channeltypes.PacketId) (string, bool)
- func (k Keeper) HasChannel(ctx sdk.Context, portID, channelID string) bool
- func (k Keeper) HasFeesInEscrow(ctx sdk.Context, packetID channeltypes.PacketId) bool
- func (k Keeper) IncentivizedPacket(goCtx context.Context, req *types.QueryIncentivizedPacketRequest) (*types.QueryIncentivizedPacketResponse, error)
- func (k Keeper) IncentivizedPackets(goCtx context.Context, req *types.QueryIncentivizedPacketsRequest) (*types.QueryIncentivizedPacketsResponse, error)
- func (k Keeper) IncentivizedPacketsForChannel(goCtx context.Context, req *types.QueryIncentivizedPacketsForChannelRequest) (*types.QueryIncentivizedPacketsForChannelResponse, error)
- func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState)
- func (k Keeper) IsFeeEnabled(ctx sdk.Context, portID, channelID string) bool
- func (k Keeper) IsLocked(ctx sdk.Context) bool
- func (Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MustMarshalFees(fees types.PacketFees) []byte
- func (k Keeper) MustUnmarshalFees(bz []byte) types.PacketFees
- func (k Keeper) PayPacketFee(goCtx context.Context, msg *types.MsgPayPacketFee) (*types.MsgPayPacketFeeResponse, error)
- func (k Keeper) PayPacketFeeAsync(goCtx context.Context, msg *types.MsgPayPacketFeeAsync) (*types.MsgPayPacketFeeAsyncResponse, error)
- func (k Keeper) Payee(goCtx context.Context, req *types.QueryPayeeRequest) (*types.QueryPayeeResponse, error)
- func (k Keeper) RefundFeesOnChannelClosure(ctx sdk.Context, portID, channelID string) error
- func (k Keeper) RegisterCounterpartyPayee(goCtx context.Context, msg *types.MsgRegisterCounterpartyPayee) (*types.MsgRegisterCounterpartyPayeeResponse, error)
- func (k Keeper) RegisterPayee(goCtx context.Context, msg *types.MsgRegisterPayee) (*types.MsgRegisterPayeeResponse, error)
- func (k Keeper) SendPacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, sourcePort string, ...) (uint64, error)
- func (k Keeper) SetCounterpartyPayeeAddress(ctx sdk.Context, address, counterpartyAddress, channelID string)
- func (k Keeper) SetFeeEnabled(ctx sdk.Context, portID, channelID string)
- func (k Keeper) SetFeesInEscrow(ctx sdk.Context, packetID channeltypes.PacketId, fees types.PacketFees)
- func (k Keeper) SetPayeeAddress(ctx sdk.Context, relayerAddr, payeeAddr, channelID string)
- func (k Keeper) SetRelayerAddressForAsyncAck(ctx sdk.Context, packetID channeltypes.PacketId, address string)
- func (k Keeper) TotalAckFees(goCtx context.Context, req *types.QueryTotalAckFeesRequest) (*types.QueryTotalAckFeesResponse, error)
- func (k Keeper) TotalRecvFees(goCtx context.Context, req *types.QueryTotalRecvFeesRequest) (*types.QueryTotalRecvFeesResponse, error)
- func (k Keeper) TotalTimeoutFees(goCtx context.Context, req *types.QueryTotalTimeoutFeesRequest) (*types.QueryTotalTimeoutFeesResponse, error)
- func (k *Keeper) WithICS4Wrapper(wrapper porttypes.ICS4Wrapper)
- func (k Keeper) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, ...) error
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper defines the IBC fungible transfer keeper
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, ics4Wrapper porttypes.ICS4Wrapper, channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, ) Keeper
NewKeeper creates a new 29-fee Keeper instance
func (Keeper) BindPort ¶
func (k Keeper) BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability
BindPort defines a wrapper function for the port Keeper's function in order to expose it to module's InitGenesis function
func (Keeper) CounterpartyPayee ¶
func (k Keeper) CounterpartyPayee(goCtx context.Context, req *types.QueryCounterpartyPayeeRequest) (*types.QueryCounterpartyPayeeResponse, error)
CounterpartyPayee implements the Query/CounterpartyPayee gRPC method and returns the registered counterparty payee address for forward relaying
func (Keeper) DeleteFeeEnabled ¶
DeleteFeeEnabled deletes the fee enabled flag for a given portID and channelID
func (Keeper) DeleteFeesInEscrow ¶
func (k Keeper) DeleteFeesInEscrow(ctx sdk.Context, packetID channeltypes.PacketId)
DeleteFeesInEscrow deletes the fee associated with the given packetID
func (Keeper) DeleteForwardRelayerAddress ¶
func (k Keeper) DeleteForwardRelayerAddress(ctx sdk.Context, packetID channeltypes.PacketId)
DeleteForwardRelayerAddress deletes the forwardRelayerAddr associated with the packetID
func (Keeper) DistributePacketFeesOnAcknowledgement ¶
func (k Keeper) DistributePacketFeesOnAcknowledgement(ctx sdk.Context, forwardRelayer string, reverseRelayer sdk.AccAddress, packetFees []types.PacketFee, packetID channeltypes.PacketId)
DistributePacketFeesOnAcknowledgement pays all the acknowledgement & receive fees for a given packetID while refunding the timeout fees to the refund account.
func (Keeper) DistributePacketFeesOnTimeout ¶
func (k Keeper) DistributePacketFeesOnTimeout(ctx sdk.Context, timeoutRelayer sdk.AccAddress, packetFees []types.PacketFee, packetID channeltypes.PacketId)
DistributePacketFeesOnTimeout pays all the timeout fees for a given packetID while refunding the acknowledgement & receive fees to the refund account.
func (Keeper) EscrowAccountHasBalance ¶
EscrowAccountHasBalance verifies if the escrow account has the provided fee.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the fee middleware application exported genesis
func (Keeper) FeeEnabledChannel ¶
func (k Keeper) FeeEnabledChannel(goCtx context.Context, req *types.QueryFeeEnabledChannelRequest) (*types.QueryFeeEnabledChannelResponse, error)
FeeEnabledChannel implements the Query/FeeEnabledChannel gRPC method and returns true if the provided port and channel identifiers belong to a fee enabled channel
func (Keeper) FeeEnabledChannels ¶
func (k Keeper) FeeEnabledChannels(goCtx context.Context, req *types.QueryFeeEnabledChannelsRequest) (*types.QueryFeeEnabledChannelsResponse, error)
FeeEnabledChannels implements the Query/FeeEnabledChannels gRPC method and returns a list of fee enabled channels
func (Keeper) GetAllCounterpartyPayees ¶
func (k Keeper) GetAllCounterpartyPayees(ctx sdk.Context) []types.RegisteredCounterpartyPayee
GetAllCounterpartyPayees returns all registered counterparty payee addresses
func (Keeper) GetAllFeeEnabledChannels ¶
func (k Keeper) GetAllFeeEnabledChannels(ctx sdk.Context) []types.FeeEnabledChannel
GetAllFeeEnabledChannels returns a list of all ics29 enabled channels containing portID & channelID that are stored in state
func (Keeper) GetAllForwardRelayerAddresses ¶
func (k Keeper) GetAllForwardRelayerAddresses(ctx sdk.Context) []types.ForwardRelayerAddress
GetAllForwardRelayerAddresses returns all forward relayer addresses stored for async acknowledgements
func (Keeper) GetAllIdentifiedPacketFees ¶
func (k Keeper) GetAllIdentifiedPacketFees(ctx sdk.Context) []types.IdentifiedPacketFees
GetAllIdentifiedPacketFees returns a list of all IdentifiedPacketFees that are stored in state
func (Keeper) GetAllPayees ¶
func (k Keeper) GetAllPayees(ctx sdk.Context) []types.RegisteredPayee
GetAllPayees returns all registered payees addresses
func (Keeper) GetAppVersion ¶
GetAppVersion returns the underlying application version.
func (Keeper) GetChannel ¶
GetChannel wraps IBC ChannelKeeper's GetChannel function
func (Keeper) GetCounterpartyPayeeAddress ¶
func (k Keeper) GetCounterpartyPayeeAddress(ctx sdk.Context, address, channelID string) (string, bool)
GetCounterpartyPayeeAddress gets the counterparty payee address given a destination relayer address
func (Keeper) GetFeeModuleAddress ¶
func (k Keeper) GetFeeModuleAddress() sdk.AccAddress
GetFeeModuleAddress returns the ICS29 Fee ModuleAccount address
func (Keeper) GetFeesInEscrow ¶
func (k Keeper) GetFeesInEscrow(ctx sdk.Context, packetID channeltypes.PacketId) (types.PacketFees, bool)
GetFeesInEscrow returns all escrowed packet fees for a given packetID
func (Keeper) GetICS4Wrapper ¶
func (k Keeper) GetICS4Wrapper() porttypes.ICS4Wrapper
GetICS4Wrapper returns the ICS4Wrapper.
func (Keeper) GetIdentifiedPacketFeesForChannel ¶
func (k Keeper) GetIdentifiedPacketFeesForChannel(ctx sdk.Context, portID, channelID string) []types.IdentifiedPacketFees
GetIdentifiedPacketFeesForChannel returns all the currently escrowed fees on a given channel.
func (Keeper) GetNextSequenceSend ¶
GetNextSequenceSend wraps IBC ChannelKeeper's GetNextSequenceSend function
func (Keeper) GetPacketCommitment ¶
func (k Keeper) GetPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64) []byte
GetPacketCommitment wraps IBC ChannelKeeper's GetPacketCommitment function
func (Keeper) GetPayeeAddress ¶
GetPayeeAddress retrieves the fee payee address stored in state given the provided channel identifier and relayer address
func (Keeper) GetRelayerAddressForAsyncAck ¶
func (k Keeper) GetRelayerAddressForAsyncAck(ctx sdk.Context, packetID channeltypes.PacketId) (string, bool)
GetRelayerAddressForAsyncAck gets forward relayer address for a particular packet
func (Keeper) HasChannel ¶
HasChannel returns true if the channel with the given identifiers exists in state.
func (Keeper) HasFeesInEscrow ¶
HasFeesInEscrow returns true if packet fees exist for the provided packetID
func (Keeper) IncentivizedPacket ¶
func (k Keeper) IncentivizedPacket(goCtx context.Context, req *types.QueryIncentivizedPacketRequest) (*types.QueryIncentivizedPacketResponse, error)
IncentivizedPacket implements the Query/IncentivizedPacket gRPC method
func (Keeper) IncentivizedPackets ¶
func (k Keeper) IncentivizedPackets(goCtx context.Context, req *types.QueryIncentivizedPacketsRequest) (*types.QueryIncentivizedPacketsResponse, error)
IncentivizedPackets implements the Query/IncentivizedPackets gRPC method
func (Keeper) IncentivizedPacketsForChannel ¶
func (k Keeper) IncentivizedPacketsForChannel(goCtx context.Context, req *types.QueryIncentivizedPacketsForChannelRequest) (*types.QueryIncentivizedPacketsForChannelResponse, error)
IncentivizedPacketsForChannel implements the Query/IncentivizedPacketsForChannel gRPC method
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState)
InitGenesis initializes the fee middleware application state from a provided genesis state
func (Keeper) IsFeeEnabled ¶
IsFeeEnabled returns whether fee handling logic should be run for the given port. It will check the fee enabled flag for the given port and channel identifiers
func (Keeper) IsLocked ¶
IsLocked indicates if the fee module is locked Please see ADR 004 for more information.
func (Keeper) MustMarshalFees ¶
func (k Keeper) MustMarshalFees(fees types.PacketFees) []byte
MustMarshalFees attempts to encode a Fee object and returns the raw encoded bytes. It panics on error.
func (Keeper) MustUnmarshalFees ¶
func (k Keeper) MustUnmarshalFees(bz []byte) types.PacketFees
MustUnmarshalFees attempts to decode and return a Fee object from raw encoded bytes. It panics on error.
func (Keeper) PayPacketFee ¶
func (k Keeper) PayPacketFee(goCtx context.Context, msg *types.MsgPayPacketFee) (*types.MsgPayPacketFeeResponse, error)
PayPacketFee defines a rpc handler method for MsgPayPacketFee PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to relay the packet with the next sequence
func (Keeper) PayPacketFeeAsync ¶
func (k Keeper) PayPacketFeeAsync(goCtx context.Context, msg *types.MsgPayPacketFeeAsync) (*types.MsgPayPacketFeeAsyncResponse, error)
PayPacketFeeAsync defines a rpc handler method for MsgPayPacketFeeAsync PayPacketFeeAsync is an open callback that may be called by any module/user that wishes to escrow funds in order to incentivize the relaying of a known packet. Only packets which have been sent and have not gone through the packet life cycle may be incentivized.
func (Keeper) Payee ¶
func (k Keeper) Payee(goCtx context.Context, req *types.QueryPayeeRequest) (*types.QueryPayeeResponse, error)
Payee implements the Query/Payee gRPC method and returns the registered payee address to which packet fees are paid out
func (Keeper) RefundFeesOnChannelClosure ¶
RefundFeesOnChannelClosure will refund all fees associated with the given port and channel identifiers. If the escrow account runs out of balance then fee module will become locked as this implies the presence of a severe bug. When the fee module is locked, no fee distributions will be performed. Please see ADR 004 for more information.
func (Keeper) RegisterCounterpartyPayee ¶
func (k Keeper) RegisterCounterpartyPayee(goCtx context.Context, msg *types.MsgRegisterCounterpartyPayee) (*types.MsgRegisterCounterpartyPayeeResponse, error)
RegisterCounterpartyPayee defines a rpc handler method for MsgRegisterCounterpartyPayee RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify the counterparty payee address before relaying. This ensures they will be properly compensated for forward relaying since the destination chain must include the registered counterparty payee address in the acknowledgement. This function may be called more than once by a relayer, in which case, the latest counterparty payee address is always used.
func (Keeper) RegisterPayee ¶
func (k Keeper) RegisterPayee(goCtx context.Context, msg *types.MsgRegisterPayee) (*types.MsgRegisterPayeeResponse, error)
RegisterPayee defines a rpc handler method for MsgRegisterPayee RegisterPayee is called by the relayer on each channelEnd and allows them to set an optional payee to which reverse and timeout relayer packet fees will be paid out. The payee should be registered on the source chain from which packets originate as this is where fee distribution takes place. This function may be called more than once by a relayer, in which case, the latest payee is always used.
func (Keeper) SendPacket ¶
func (k Keeper) SendPacket( ctx sdk.Context, chanCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte, ) (uint64, error)
SendPacket wraps the ICS4Wrapper SendPacket function
func (Keeper) SetCounterpartyPayeeAddress ¶
func (k Keeper) SetCounterpartyPayeeAddress(ctx sdk.Context, address, counterpartyAddress, channelID string)
SetCounterpartyPayeeAddress maps the destination chain counterparty payee address to the source relayer address The receiving chain must store the mapping from: address -> counterpartyPayeeAddress for the given channel
func (Keeper) SetFeeEnabled ¶
SetFeeEnabled sets a flag to determine if fee handling logic should run for the given channel identified by channel and port identifiers.
func (Keeper) SetFeesInEscrow ¶
func (k Keeper) SetFeesInEscrow(ctx sdk.Context, packetID channeltypes.PacketId, fees types.PacketFees)
SetFeesInEscrow sets the given packet fees in escrow keyed by the packetID
func (Keeper) SetPayeeAddress ¶
SetPayeeAddress stores the fee payee address in state keyed by the provided channel identifier and relayer address
func (Keeper) SetRelayerAddressForAsyncAck ¶
func (k Keeper) SetRelayerAddressForAsyncAck(ctx sdk.Context, packetID channeltypes.PacketId, address string)
SetRelayerAddressForAsyncAck sets the forward relayer address during OnRecvPacket in case of async acknowledgement
func (Keeper) TotalAckFees ¶
func (k Keeper) TotalAckFees(goCtx context.Context, req *types.QueryTotalAckFeesRequest) (*types.QueryTotalAckFeesResponse, error)
TotalAckFees implements the Query/TotalAckFees gRPC method
func (Keeper) TotalRecvFees ¶
func (k Keeper) TotalRecvFees(goCtx context.Context, req *types.QueryTotalRecvFeesRequest) (*types.QueryTotalRecvFeesResponse, error)
TotalRecvFees implements the Query/TotalRecvFees gRPC method
func (Keeper) TotalTimeoutFees ¶
func (k Keeper) TotalTimeoutFees(goCtx context.Context, req *types.QueryTotalTimeoutFeesRequest) (*types.QueryTotalTimeoutFeesResponse, error)
TotalTimeoutFees implements the Query/TotalTimeoutFees gRPC method
func (*Keeper) WithICS4Wrapper ¶
func (k *Keeper) WithICS4Wrapper(wrapper porttypes.ICS4Wrapper)
WithICS4Wrapper sets the ICS4Wrapper. This function may be used after the keepers creation to set the middleware which is above this module in the IBC application stack.
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 ICS29 WriteAcknowledgement is used for asynchronous acknowledgements