keeper

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 25 Imported by: 47

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

This section is empty.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,
	stakingKeeper types.StakingKeeper,
	clientKeeper types.ClientKeeper,
	connectionKeeper types.ConnectionKeeper,
	channelKeeper types.ChannelKeeper,
	portKeeper types.PortKeeper,
	scopedKeeper capabilitykeeper.ScopedKeeper,
) *Keeper

func (Keeper) AuthenticateCapability

func (k Keeper) AuthenticateCapability(ctx sdk.Context, c *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 ort Keeper's function in order to expose it to module's InitGenesis function

func (Keeper) ClaimCapability

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

ClaimCapability allows the transfer module that can claim a capability that IBC module passes to it

func (Keeper) ConsumerChainID

func (k Keeper) ConsumerChainID(ctx sdk.Context) (res string)

ConsumerChainID returns the consumer chain ID param

func (Keeper) ConsumerConsensusState

func (k Keeper) ConsumerConsensusState(ctx sdk.Context) (res spntypes.ConsensusState)

ConsumerConsensusState returns the consumer consensus state param

func (Keeper) ConsumerRevisionHeight

func (k Keeper) ConsumerRevisionHeight(ctx sdk.Context) (res uint64)

ConsumerRevisionHeight returns the consumer revision height

func (Keeper) ConsumerUnbondingPeriod

func (k Keeper) ConsumerUnbondingPeriod(ctx sdk.Context) (res int64)

ConsumerUnbondingPeriod returns the consumer unbonding period

func (Keeper) GetConnectionChannelID

func (k Keeper) GetConnectionChannelID(ctx sdk.Context) (val types.ConnectionChannelID, found bool)

GetConnectionChannelID returns connectionChannelID

func (Keeper) GetConsumerClientID

func (k Keeper) GetConsumerClientID(ctx sdk.Context) (val types.ConsumerClientID, found bool)

GetConsumerClientID returns consumerClientID

func (Keeper) GetMonitoringInfo

func (k Keeper) GetMonitoringInfo(ctx sdk.Context) (val types.MonitoringInfo, found bool)

GetMonitoringInfo returns monitoringInfo

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams get all parameters as types.Params

func (Keeper) GetPort

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

GetPort returns the portID for the 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) IsBound

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

IsBound checks if the module is already bound to the desired port

func (Keeper) LastBlockHeight

func (k Keeper) LastBlockHeight(ctx sdk.Context) (res int64)

LastBlockHeight returns the last block height state param

func (Keeper) Logger

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

func (Keeper) OnAcknowledgementMonitoringPacket

func (k Keeper) OnAcknowledgementMonitoringPacket(
	ctx sdk.Context,
	packet channeltypes.Packet,
	data spntypes.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,
	_ spntypes.MonitoringPacket,
) (packetAck spntypes.MonitoringPacketAck, err error)

OnRecvMonitoringPacket processes packet reception

func (Keeper) OnTimeoutMonitoringPacket

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

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

func (Keeper) Params

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

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

RemoveMonitoringInfo removes monitoringInfo from the store

func (Keeper) ReportBlockSignatures

func (k Keeper) ReportBlockSignatures(ctx sdk.Context, lastCommit abci.CommitInfo, blockHeight int64) error

ReportBlockSignatures gets signatures from blocks and update monitoring info

func (Keeper) SetConnectionChannelID

func (k Keeper) SetConnectionChannelID(ctx sdk.Context, connectionChannelID types.ConnectionChannelID)

SetConnectionChannelID set connectionChannelID in the store

func (Keeper) SetConsumerClientID

func (k Keeper) SetConsumerClientID(ctx sdk.Context, consumerClientID types.ConsumerClientID)

SetConsumerClientID set consumerClientID in the store

func (Keeper) SetMonitoringInfo

func (k Keeper) SetMonitoringInfo(ctx sdk.Context, monitoringInfo types.MonitoringInfo)

SetMonitoringInfo set monitoringInfo in the store

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams set the params

func (Keeper) SetPort

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

SetPort sets the portID for the module. Used in InitGenesis

func (Keeper) TransmitMonitoringPacket

func (k Keeper) TransmitMonitoringPacket(
	ctx sdk.Context,
	packetData spntypes.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 sdk.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 added in v0.3.0

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