Documentation
¶
Index ¶
- func CreatePricesMap(prices []feedstypes.Price) map[string]feedstypes.Price
- func ExportGenesis(ctx sdk.Context, k Keeper) *types.GenesisState
- func GenerateNewPrices(signalDeviations []types.SignalDeviation, ...) []feedstypes.Price
- func InitGenesis(ctx sdk.Context, k Keeper, data *types.GenesisState)
- func IsOutOfGasError(err any) (bool, string)
- func IsValidPortID(portID string) bool
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQueryServer(k Keeper) types.QueryServer
- func PortIDForTunnel(tunnelID uint64) string
- type Keeper
- func (k Keeper) ActivateTunnel(ctx sdk.Context, tunnelID uint64) error
- func (k Keeper) AddTunnel(ctx sdk.Context, route types.RouteI, signalDeviations []types.SignalDeviation, ...) (*types.Tunnel, error)
- func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool
- func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
- func (k Keeper) CreatePacket(ctx sdk.Context, tunnelID uint64, prices []feedstypes.Price) (types.Packet, error)
- func (k Keeper) DeactivateTunnel(ctx sdk.Context, tunnelID uint64) error
- func (k Keeper) DeductBasePacketFee(ctx sdk.Context, feePayer sdk.AccAddress) error
- func (k Keeper) DeleteActiveTunnelID(ctx sdk.Context, tunnelID uint64)
- func (k Keeper) DeleteDeposit(ctx sdk.Context, tunnelID uint64, depositorAddr sdk.AccAddress)
- func (k Keeper) DepositToTunnel(ctx sdk.Context, tunnelID uint64, depositor sdk.AccAddress, ...) error
- func (k Keeper) GenerateTunnelAccount(ctx sdk.Context, key string) (sdk.AccAddress, error)
- func (k Keeper) GetActiveTunnelIDs(ctx sdk.Context) []uint64
- func (k Keeper) GetAllDeposits(ctx sdk.Context) []types.Deposit
- func (k Keeper) GetAllLatestPrices(ctx sdk.Context) []types.LatestPrices
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetDeposit(ctx sdk.Context, tunnelID uint64, depositorAddr sdk.AccAddress) (deposit types.Deposit, found bool)
- func (k Keeper) GetDeposits(ctx sdk.Context, tunnelID uint64) []types.Deposit
- func (k Keeper) GetLatestPrices(ctx sdk.Context, tunnelID uint64) (types.LatestPrices, error)
- func (k Keeper) GetModuleBalance(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetPacket(ctx sdk.Context, tunnelID uint64, sequence uint64) (types.Packet, error)
- func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k Keeper) GetTotalFees(ctx sdk.Context) types.TotalFees
- func (k Keeper) GetTunnel(ctx sdk.Context, tunnelID uint64) (types.Tunnel, error)
- func (k Keeper) GetTunnelAccount(ctx sdk.Context) sdk.ModuleAccountI
- func (k Keeper) GetTunnelCount(ctx sdk.Context) uint64
- func (k Keeper) GetTunnels(ctx sdk.Context) []types.Tunnel
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MustGetTunnel(ctx sdk.Context, tunnelID uint64) types.Tunnel
- func (k Keeper) ProduceActiveTunnelPackets(ctx sdk.Context) error
- func (k Keeper) ProducePacket(ctx sdk.Context, tunnelID uint64, feedsPricesMap map[string]feedstypes.Price) error
- func (k Keeper) SendIBCPacket(ctx sdk.Context, route *types.IBCRoute, packet types.Packet, interval uint64) (types.PacketReceiptI, error)
- func (k Keeper) SendPacket(ctx sdk.Context, packet types.Packet) (err error)
- func (k Keeper) SendTSSPacket(ctx sdk.Context, route *types.TSSRoute, packet types.Packet, ...) (receipt types.PacketReceiptI, err error)
- func (k Keeper) SetActiveTunnelID(ctx sdk.Context, tunnelID uint64)
- func (k Keeper) SetDeposit(ctx sdk.Context, deposit types.Deposit)
- func (k Keeper) SetLatestPrices(ctx sdk.Context, latestPrices types.LatestPrices)
- func (k Keeper) SetModuleAccount(ctx sdk.Context, acc sdk.ModuleAccountI)
- func (k Keeper) SetPacket(ctx sdk.Context, packet types.Packet)
- func (k Keeper) SetParams(ctx sdk.Context, p types.Params) error
- func (k Keeper) SetTotalFees(ctx sdk.Context, totalFee types.TotalFees)
- func (k Keeper) SetTunnel(ctx sdk.Context, tunnel types.Tunnel)
- func (k Keeper) SetTunnelCount(ctx sdk.Context, count uint64)
- func (k Keeper) UpdateSignalsAndInterval(ctx sdk.Context, tunnelID uint64, signalDeviations []types.SignalDeviation, ...) error
- func (k Keeper) WithdrawFromTunnel(ctx sdk.Context, tunnelID uint64, amount sdk.Coins, withdrawer sdk.AccAddress) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePricesMap ¶
func CreatePricesMap(prices []feedstypes.Price) map[string]feedstypes.Price
CreatePricesMap creates a map of prices with signal ID as the key
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) *types.GenesisState
ExportGenesis returns the module's exported genesis
func GenerateNewPrices ¶
func GenerateNewPrices( signalDeviations []types.SignalDeviation, latestPricesMap map[string]feedstypes.Price, feedsPricesMap map[string]feedstypes.Price, timestamp int64, sendAll bool, ) []feedstypes.Price
GenerateNewPrices generates new prices based on the current prices and signal deviations.
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, data *types.GenesisState)
InitGenesis initializes the module's state from a provided genesis state.
func IsOutOfGasError ¶
IsOutOfGasError checks if the error object is an out of gas or gas overflow error type
func IsValidPortID ¶
IsValidPortID checks if a given port ID is valid. It ensures that the port ID starts with the predefined prefix (portIDPrefix).
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the x/tunnel MsgServer interface.
func NewQueryServer ¶
func NewQueryServer(k Keeper) types.QueryServer
func PortIDForTunnel ¶
PortIDForTunnel generates a unique port ID for a given tunnel ID. It concatenates a predefined prefix (portIDPrefix) with the tunnel ID.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, feedsKeeper types.FeedsKeeper, bandtssKeeper types.BandtssKeeper, channelKeeper types.ChannelKeeper, ics4Wrapper types.ICS4Wrapper, portKeeper types.PortKeeper, scopedKeeper types.ScopedKeeper, authority string, ) Keeper
NewKeeper creates a new tunnel Keeper instance
func (Keeper) ActivateTunnel ¶
ActivateTunnel activates a tunnel
func (Keeper) AddTunnel ¶
func (k Keeper) AddTunnel( ctx sdk.Context, route types.RouteI, signalDeviations []types.SignalDeviation, interval uint64, creator sdk.AccAddress, ) (*types.Tunnel, error)
AddTunnel adds a new tunnel
func (Keeper) AuthenticateCapability ¶
func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool
AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function
func (Keeper) ClaimCapability ¶
func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
ClaimCapability allows the tunnel module that can claim a capability that IBC module passes to it
func (Keeper) CreatePacket ¶
func (k Keeper) CreatePacket( ctx sdk.Context, tunnelID uint64, prices []feedstypes.Price, ) (types.Packet, error)
CreatePacket creates a new packet of the given tunnel. Creating a packet charges the base packet fee to the tunnel's fee payer.
func (Keeper) DeactivateTunnel ¶
DeactivateTunnel deactivates a tunnel
func (Keeper) DeductBasePacketFee ¶
DeductBasePacketFee deducts the base packet fee from the fee payer of the packet
func (Keeper) DeleteActiveTunnelID ¶
DeleteActiveTunnelID deletes the active tunnel ID from the store
func (Keeper) DeleteDeposit ¶
DeleteDeposit deletes a deposit from the store
func (Keeper) DepositToTunnel ¶
func (k Keeper) DepositToTunnel( ctx sdk.Context, tunnelID uint64, depositor sdk.AccAddress, depositAmount sdk.Coins, ) error
DepositToTunnel deposits to a tunnel
func (Keeper) GenerateTunnelAccount ¶
GenerateTunnelAccount generates a new tunnel account for the given key
func (Keeper) GetActiveTunnelIDs ¶
GetActiveTunnelIDs retrieves the active tunnel IDs from the store
func (Keeper) GetAllDeposits ¶
GetAllDeposits returns all deposits in the store
func (Keeper) GetAllLatestPrices ¶
func (k Keeper) GetAllLatestPrices(ctx sdk.Context) []types.LatestPrices
GetAllLatestPrices gets all the latest prices from the store
func (Keeper) GetAuthority ¶
GetAuthority returns the x/tunnel module's authority.
func (Keeper) GetDeposit ¶
func (k Keeper) GetDeposit( ctx sdk.Context, tunnelID uint64, depositorAddr sdk.AccAddress, ) (deposit types.Deposit, found bool)
GetDeposit retrieves a deposit by its tunnel ID and depositor address
func (Keeper) GetDeposits ¶
GetDeposits retrieves all deposits for the tunnel
func (Keeper) GetLatestPrices ¶
GetLatestPrices gets the latest prices from the store
func (Keeper) GetModuleBalance ¶
GetModuleBalance returns the balance of the tunnel ModuleAccount
func (Keeper) GetTotalFees ¶
GetTotalFees retrieves the total fees from the store
func (Keeper) GetTunnelAccount ¶
func (k Keeper) GetTunnelAccount(ctx sdk.Context) sdk.ModuleAccountI
GetTunnelAccount returns the tunnel ModuleAccount
func (Keeper) GetTunnelCount ¶
GetTunnelCount returns the current number of all tunnels ever existed
func (Keeper) GetTunnels ¶
GetTunnels returns all tunnels
func (Keeper) MustGetTunnel ¶
MustGetTunnel retrieves a tunnel by its ID. Panics if the tunnel does not exist.
func (Keeper) ProduceActiveTunnelPackets ¶
ProduceActiveTunnelPackets generates packets and sends packets to the destination route for all active tunnels
func (Keeper) ProducePacket ¶
func (k Keeper) ProducePacket( ctx sdk.Context, tunnelID uint64, feedsPricesMap map[string]feedstypes.Price, ) error
ProducePacket generates a packet and sends it to the destination route
func (Keeper) SendIBCPacket ¶
func (k Keeper) SendIBCPacket( ctx sdk.Context, route *types.IBCRoute, packet types.Packet, interval uint64, ) (types.PacketReceiptI, error)
SendIBCPacket sends IBC packet
func (Keeper) SendPacket ¶
SendPacket sends a packet to the destination route
func (Keeper) SendTSSPacket ¶
func (k Keeper) SendTSSPacket( ctx sdk.Context, route *types.TSSRoute, packet types.Packet, feePayer sdk.AccAddress, ) (receipt types.PacketReceiptI, err error)
SendTSSPacket sends TSS packet
func (Keeper) SetActiveTunnelID ¶
SetActiveTunnelID sets the active tunnel ID in the store
func (Keeper) SetDeposit ¶
SetDeposit sets a deposit in the store
func (Keeper) SetLatestPrices ¶
func (k Keeper) SetLatestPrices(ctx sdk.Context, latestPrices types.LatestPrices)
SetLatestPrices sets the latest prices in the store
func (Keeper) SetModuleAccount ¶
func (k Keeper) SetModuleAccount(ctx sdk.Context, acc sdk.ModuleAccountI)
SetModuleAccount sets a module account in the account keeper.
func (Keeper) SetTotalFees ¶
SetTotalFees sets the total fees in the store
func (Keeper) SetTunnelCount ¶
SetTunnelCount sets the tunnel count in the store
func (Keeper) UpdateSignalsAndInterval ¶
func (k Keeper) UpdateSignalsAndInterval( ctx sdk.Context, tunnelID uint64, signalDeviations []types.SignalDeviation, interval uint64, ) error
UpdateSignalsAndInterval edits a tunnel and reset latest signal price interval.