keeper

package
v9.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQueryServer

func NewQueryServer(k *Keeper) types.QueryServer

NewQueryServer returns a new 03-connection types.QueryServer implementation.

Types

type Keeper

type Keeper struct {
	// implements gRPC QueryServer interface
	types.QueryServer
	// contains filtered or unexported fields
}

Keeper defines the IBC connection keeper

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, legacySubspace types.ParamSubspace, ck types.ClientKeeper) *Keeper

NewKeeper creates a new IBC connection Keeper instance

func (*Keeper) ConnOpenAck

func (k *Keeper) ConnOpenAck(
	ctx sdk.Context,
	connectionID string,
	version *types.Version,
	counterpartyConnectionID string,
	tryProof []byte,
	proofHeight exported.Height,
) error

ConnOpenAck relays acceptance of a connection open attempt from chain B back to chain A (this code is executed on chain A).

NOTE: Identifiers are checked on msg validation.

func (*Keeper) ConnOpenConfirm

func (k *Keeper) ConnOpenConfirm(
	ctx sdk.Context,
	connectionID string,
	ackProof []byte,
	proofHeight exported.Height,
) error

ConnOpenConfirm confirms opening of a connection on chain A to chain B, after which the connection is open on both chains (this code is executed on chain B).

NOTE: Identifiers are checked on msg validation.

func (*Keeper) ConnOpenInit

func (k *Keeper) ConnOpenInit(
	ctx sdk.Context,
	clientID string,
	counterparty types.Counterparty,
	version *types.Version,
	delayPeriod uint64,
) (string, error)

ConnOpenInit initialises a connection attempt on chain A. The generated connection identifier is returned.

NOTE: Msg validation verifies the supplied identifiers and ensures that the counterparty connection identifier is empty.

func (*Keeper) ConnOpenTry

func (k *Keeper) ConnOpenTry(
	ctx sdk.Context,
	counterparty types.Counterparty,
	delayPeriod uint64,
	clientID string,
	counterpartyVersions []*types.Version,
	initProof []byte,
	proofHeight exported.Height,
) (string, error)

ConnOpenTry relays notice of a connection attempt on chain A to chain B (this code is executed on chain B).

NOTE:

  • Here chain A acts as the counterparty
  • Identifiers are checked on msg validation

func (*Keeper) CreateSentinelLocalhostConnection

func (k *Keeper) CreateSentinelLocalhostConnection(ctx sdk.Context)

CreateSentinelLocalhostConnection creates and sets the sentinel localhost connection end in the IBC store.

func (*Keeper) GenerateConnectionIdentifier

func (k *Keeper) GenerateConnectionIdentifier(ctx sdk.Context) string

GenerateConnectionIdentifier returns the next connection identifier.

func (*Keeper) GetAllClientConnectionPaths

func (k *Keeper) GetAllClientConnectionPaths(ctx sdk.Context) []types.ConnectionPaths

GetAllClientConnectionPaths returns all stored clients connection id paths. It will ignore the clients that haven't initialized a connection handshake since no paths are stored.

func (*Keeper) GetAllConnections

func (k *Keeper) GetAllConnections(ctx sdk.Context) (connections []types.IdentifiedConnection)

GetAllConnections returns all stored ConnectionEnd objects.

func (*Keeper) GetClientConnectionPaths

func (k *Keeper) GetClientConnectionPaths(ctx sdk.Context, clientID string) ([]string, bool)

GetClientConnectionPaths returns all the connection paths stored under a particular client

func (*Keeper) GetCommitmentPrefix

func (k *Keeper) GetCommitmentPrefix() exported.Prefix

GetCommitmentPrefix returns the IBC connection store prefix as a commitment Prefix

func (*Keeper) GetConnection

func (k *Keeper) GetConnection(ctx sdk.Context, connectionID string) (types.ConnectionEnd, bool)

GetConnection returns a connection with a particular identifier

func (*Keeper) GetNextConnectionSequence

func (k *Keeper) GetNextConnectionSequence(ctx sdk.Context) uint64

GetNextConnectionSequence gets the next connection sequence from the store.

func (*Keeper) GetParams

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

GetParams returns the total set of ibc-connection parameters.

func (*Keeper) HasConnection

func (k *Keeper) HasConnection(ctx sdk.Context, connectionID string) bool

HasConnection returns a true if the connection with the given identifier exists in the store.

func (*Keeper) IterateConnections

func (k *Keeper) IterateConnections(ctx sdk.Context, cb func(types.IdentifiedConnection) bool)

IterateConnections provides an iterator over all ConnectionEnd objects. For each ConnectionEnd, cb will be called. If the cb returns true, the iterator will close and stop.

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (*Keeper) SetClientConnectionPaths

func (k *Keeper) SetClientConnectionPaths(ctx sdk.Context, clientID string, paths []string)

SetClientConnectionPaths sets the connections paths for client

func (*Keeper) SetConnection

func (k *Keeper) SetConnection(ctx sdk.Context, connectionID string, connection types.ConnectionEnd)

SetConnection sets a connection to the store

func (*Keeper) SetNextConnectionSequence

func (k *Keeper) SetNextConnectionSequence(ctx sdk.Context, sequence uint64)

SetNextConnectionSequence sets the next connection sequence to the store.

func (*Keeper) SetParams

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

SetParams sets the total set of ibc-connection parameters.

func (*Keeper) VerifyChannelState

func (k *Keeper) VerifyChannelState(
	ctx sdk.Context,
	connection types.ConnectionEnd,
	height exported.Height,
	proof []byte,
	portID,
	channelID string,
	channel channeltypes.Channel,
) error

VerifyChannelState verifies a proof of the channel state of the specified channel end, under the specified port, stored on the target machine.

func (*Keeper) VerifyChannelUpgrade

func (k *Keeper) VerifyChannelUpgrade(
	ctx sdk.Context,
	connection types.ConnectionEnd,
	proofHeight exported.Height,
	upgradeProof []byte,
	portID,
	channelID string,
	upgrade channeltypes.Upgrade,
) error

VerifyChannelUpgrade verifies the proof that a particular proposed upgrade has been stored in the upgrade path.

func (*Keeper) VerifyChannelUpgradeError

func (k *Keeper) VerifyChannelUpgradeError(
	ctx sdk.Context,
	connection types.ConnectionEnd,
	height exported.Height,
	proof []byte,
	portID,
	channelID string,
	errorReceipt channeltypes.ErrorReceipt,
) error

VerifyChannelUpgradeError verifies a proof of the provided upgrade error receipt.

func (*Keeper) VerifyConnectionState

func (k *Keeper) VerifyConnectionState(
	ctx sdk.Context,
	connection types.ConnectionEnd,
	height exported.Height,
	proof []byte,
	connectionID string,
	counterpartyConnection types.ConnectionEnd,
) error

VerifyConnectionState verifies a proof of the connection state of the specified connection end stored on the target machine.

func (*Keeper) VerifyNextSequenceRecv

func (k *Keeper) VerifyNextSequenceRecv(
	ctx sdk.Context,
	connection types.ConnectionEnd,
	height exported.Height,
	proof []byte,
	portID,
	channelID string,
	nextSequenceRecv uint64,
) error

VerifyNextSequenceRecv verifies a proof of the next sequence number to be received of the specified channel at the specified port.

func (*Keeper) VerifyPacketAcknowledgement

func (k *Keeper) VerifyPacketAcknowledgement(
	ctx sdk.Context,
	connection types.ConnectionEnd,
	height exported.Height,
	proof []byte,
	portID,
	channelID string,
	sequence uint64,
	acknowledgement []byte,
) error

VerifyPacketAcknowledgement verifies a proof of an incoming packet acknowledgement at the specified port, specified channel, and specified sequence.

func (*Keeper) VerifyPacketCommitment

func (k *Keeper) VerifyPacketCommitment(
	ctx sdk.Context,
	connection types.ConnectionEnd,
	height exported.Height,
	proof []byte,
	portID,
	channelID string,
	sequence uint64,
	commitmentBytes []byte,
) error

VerifyPacketCommitment verifies a proof of an outgoing packet commitment at the specified port, specified channel, and specified sequence.

func (*Keeper) VerifyPacketReceiptAbsence

func (k *Keeper) VerifyPacketReceiptAbsence(
	ctx sdk.Context,
	connection types.ConnectionEnd,
	height exported.Height,
	proof []byte,
	portID,
	channelID string,
	sequence uint64,
) error

VerifyPacketReceiptAbsence verifies a proof of the absence of an incoming packet receipt at the specified port, specified channel, and specified sequence.

type Migrator

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(keeper *Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate3to4

func (m Migrator) Migrate3to4(ctx sdk.Context) error

Migrate3to4 migrates from version 3 to 4. This migration writes the sentinel localhost connection end to state.

func (Migrator) MigrateParams

func (m Migrator) MigrateParams(ctx sdk.Context) error

MigrateParams migrates from consensus version 4 to 5. This migration takes the parameters that are currently stored and managed by x/params and stores them directly in the ibc module's state.

Jump to

Keyboard shortcuts

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