keeper

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MonitoringPacketTimeoutDelay is the delay before a monitoring packet is timed out
	// The timeout is set to one year
	// This is an arbitrarily chosen value that should never be reached in practice
	MonitoringPacketTimeoutDelay = time.Hour * 8760
)

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.

func NewQueryServerImpl

func NewQueryServerImpl(k *Keeper) types.QueryServer

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

Types

type Keeper

type Keeper struct {
	Schema              collections.Schema
	Params              collections.Item[types.Params]
	MonitoringInfo      collections.Item[types.MonitoringInfo]
	ConnectionChannelID collections.Item[types.ConnectionChannelID]
	ConsumerClientID    collections.Item[types.ConsumerClientID]
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	addressCodec address.Codec,
	storeService store.KVStoreService,
	logger log.Logger,
	authority string,
	ibcKeeperFn func() *ibckeeper.Keeper,
	capabilityScopedFn func(string) capabilitykeeper.ScopedKeeper,
	stakingKeeper types.StakingKeeper,
) *Keeper

func (Keeper) AddressCodec

func (k Keeper) AddressCodec() address.Codec

AddressCodec returns the address codec.

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) BindPort

func (k Keeper) BindPort(ctx sdk.Context, portID string) error

BindPort defines a wrapper function for the port Keeper's function in order to expose it to module's InitGenesis function

func (Keeper) ChanCloseInit

func (k Keeper) ChanCloseInit(ctx sdk.Context, portID, channelID string) error

ChanCloseInit defines a wrapper function for the channel Keeper's function.

func (Keeper) ClaimCapability

func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error

ClaimCapability allows the IBC app module to claim a capability that core IBC passes to it

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetPort

func (k Keeper) GetPort(ctx sdk.Context) string

GetPort returns the portID for the IBC app module. Used in ExportGenesis

func (Keeper) InitializeConsumerClient

func (k Keeper) InitializeConsumerClient(ctx sdk.Context) (string, error)

InitializeConsumerClient initializes the consumer IBC client and set it in the store

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

func (Keeper) OnAcknowledgementMonitoringPacket

func (k Keeper) OnAcknowledgementMonitoringPacket(
	ctx sdk.Context,
	packet channeltypes.Packet,
	data networktypes.MonitoringPacket,
	ack channeltypes.Acknowledgement,
) error

OnAcknowledgementMonitoringPacket responds to the the success or failure of a packet acknowledgement written on the receiving chain.

func (Keeper) OnRecvMonitoringPacket

func (k Keeper) OnRecvMonitoringPacket(
	_ sdk.Context,
	_ channeltypes.Packet,
	_ networktypes.MonitoringPacket,
) (packetAck networktypes.MonitoringPacketAck, err error)

OnRecvMonitoringPacket processes packet reception

func (Keeper) OnTimeoutMonitoringPacket

func (k Keeper) OnTimeoutMonitoringPacket(
	_ sdk.Context,
	_ channeltypes.Packet,
	_ networktypes.MonitoringPacket,
) error

OnTimeoutMonitoringPacket responds to the case where a packet has not been transmitted because of a timeout

func (Keeper) RegisterConnectionChannelID

func (k Keeper) RegisterConnectionChannelID(ctx sdk.Context, channelID string) error

RegisterConnectionChannelID registers the channel ID for the connection used with the consumer chain

func (Keeper) ReportBlockSignatures

func (k Keeper) ReportBlockSignatures(ctx context.Context, lastCommit comet.CommitInfo, blockHeight int64) error

ReportBlockSignatures gets signatures from blocks and update monitoring info

func (Keeper) ScopedKeeper

func (k Keeper) ScopedKeeper() exported.ScopedKeeper

ScopedKeeper returns the ScopedKeeper

func (*Keeper) SetChannelKeeper

func (k *Keeper) SetChannelKeeper(channelKeeper types.ChannelKeeper) error

SetChannelKeeper sets IBC channel keeper

func (*Keeper) SetClientKeeper

func (k *Keeper) SetClientKeeper(clientKeeper types.ClientKeeper) error

SetClientKeeper sets IBC client keeper

func (*Keeper) SetConnectionKeeper

func (k *Keeper) SetConnectionKeeper(connectionKeeper types.ConnectionKeeper) error

SetConnectionKeeper sets IBC connection keeper

func (*Keeper) SetIBCKeeper

func (k *Keeper) SetIBCKeeper(ibcKeeper *ibckeeper.Keeper) error

SetIBCKeeper sets the IBC Keeper

func (Keeper) SetPort

func (k Keeper) SetPort(ctx sdk.Context, portID string)

SetPort sets the portID for the IBC app module. Used in InitGenesis

func (*Keeper) SetPortKeeper

func (k *Keeper) SetPortKeeper(portKeeper types.PortKeeper) error

SetPortKeeper sets IBC port keeper

func (Keeper) ShouldBound

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

ShouldBound checks if the IBC app module can be bound to the desired port

func (Keeper) TransmitMonitoringPacket

func (k Keeper) TransmitMonitoringPacket(
	ctx sdk.Context,
	packetData networktypes.MonitoringPacket,
	sourcePort,
	sourceChannel string,
	timeoutHeight clienttypes.Height,
	timeoutTimestamp uint64,
) (sequence uint64, err error)

TransmitMonitoringPacket transmits the packet over IBC with the specified source port and source channel

func (Keeper) TransmitSignatures

func (k Keeper) TransmitSignatures(ctx context.Context, blockHeight int64) (sequence uint64, err error)

TransmitSignatures transmits over IBC the signatures to consumer if height is reached and signatures are not yet transmitted

func (Keeper) VerifyClientIDFromConnID

func (k Keeper) VerifyClientIDFromConnID(ctx sdk.Context, connID string) error

VerifyClientIDFromConnID verifies if the client ID associated with the provided connection ID is the consumer client ID and if no connection is yet established with the consumer chain this operation should be performed at OnChanOpenTry handshake phase

Jump to

Keyboard shortcuts

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