keeper

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeStoreTransactionID

func MakeStoreTransactionID(txID types.TxID, txIndex uint8) []byte

func MakeTxID

func MakeTxID(ctx sdk.Context, msg types.MsgInitiate) types.TxID

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

Types

type Keeper

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

Keeper maintains the link to storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(
	cdc *codec.Codec,
	storeKey sdk.StoreKey,
	channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper,
	scopedKeeper capability.ScopedKeeper,
) Keeper

NewKeeper creates new instances of the cross Keeper

func (Keeper) BindPort

func (k Keeper) BindPort(ctx sdk.Context, portID string) (*capability.Capability, 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, cap *capability.Capability, name string) error

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

func (Keeper) CreatePreparePacket

func (k Keeper) CreatePreparePacket(
	ctx sdk.Context,
	seq uint64,
	sourcePort,
	sourceChannel,
	destinationPort,
	destinationChannel string,
	txID types.TxID,
	txIndex types.TxIndex,
	transaction types.ContractTransaction,
	sender sdk.AccAddress,
) channel.Packet

func (Keeper) EnsureCoordinatorStatus

func (k Keeper) EnsureCoordinatorStatus(ctx sdk.Context, txID types.TxID, status uint8) (*types.CoordinatorInfo, error)

func (Keeper) EnsureTxStatus

func (k Keeper) EnsureTxStatus(ctx sdk.Context, txID types.TxID, txIndex types.TxIndex, status uint8) (*types.TxInfo, error)

func (Keeper) GetContractResult

func (k Keeper) GetContractResult(ctx sdk.Context, txID types.TxID, txIndex types.TxIndex) (types.ContractHandlerResult, bool)

func (Keeper) GetCoordinator

func (k Keeper) GetCoordinator(ctx sdk.Context, txID types.TxID) (*types.CoordinatorInfo, bool)

func (Keeper) GetTx

func (k Keeper) GetTx(ctx sdk.Context, txID types.TxID, txIndex types.TxIndex) (*types.TxInfo, bool)

func (Keeper) IterateUnacknowledgedPackets

func (k Keeper) IterateUnacknowledgedPackets(ctx sdk.Context, cb func(key []byte) bool)

func (Keeper) MulticastCommitPacket

func (k Keeper) MulticastCommitPacket(
	ctx sdk.Context,
	txID types.TxID,
	isCommittable bool,
) error

func (Keeper) MulticastPreparePacket

func (k Keeper) MulticastPreparePacket(
	ctx sdk.Context,
	sender sdk.AccAddress,
	msg types.MsgInitiate,
	transactions []types.ContractTransaction,
) (types.TxID, error)

func (Keeper) PacketCommitAcknowledgement

func (k Keeper) PacketCommitAcknowledgement(ctx sdk.Context, txID types.TxID, txIndex types.TxIndex) error

func (Keeper) PacketExecuted

func (k Keeper) PacketExecuted(ctx sdk.Context, packet channelexported.PacketI, acknowledgement []byte) error

PacketExecuted defines a wrapper function for the channel Keeper's function in order to expose it to the cross handler. Keeper retreives channel capability and passes it into channel keeper for authentication

func (Keeper) PrepareTransaction

func (k Keeper) PrepareTransaction(
	ctx sdk.Context,
	contractHandler types.ContractHandler,
	sourcePort,
	sourceChannel,
	destinationPort,
	destinationChannel string,
	data types.PacketDataPrepare,
) (uint8, error)

func (Keeper) ReceiveCommitPacket

func (k Keeper) ReceiveCommitPacket(
	ctx sdk.Context,
	contractHandler types.ContractHandler,
	sourcePort,
	sourceChannel,
	destinationPort,
	destinationChannel string,
	data types.PacketDataCommit,
) (types.ContractHandlerResult, error)

func (Keeper) ReceivePrepareAcknowledgement

func (k Keeper) ReceivePrepareAcknowledgement(
	ctx sdk.Context,
	sourcePort string,
	sourceChannel string,
	ack types.PacketPrepareAcknowledgement,
	txID types.TxID,
	txIndex types.TxIndex,
) (canMulticast bool, isCommittable bool, err error)

func (Keeper) RemoveContractResult

func (k Keeper) RemoveContractResult(ctx sdk.Context, txID types.TxID, txIndex types.TxIndex)

func (Keeper) RemoveUnacknowledgedPacket

func (k Keeper) RemoveUnacknowledgedPacket(ctx sdk.Context, sourcePort, sourceChannel string, seq uint64)

func (Keeper) SetContractResult

func (k Keeper) SetContractResult(ctx sdk.Context, txID types.TxID, txIndex types.TxIndex, result types.ContractHandlerResult)

func (Keeper) SetCoordinator

func (k Keeper) SetCoordinator(ctx sdk.Context, txID types.TxID, ci types.CoordinatorInfo)

func (Keeper) SetTx

func (k Keeper) SetTx(ctx sdk.Context, txID types.TxID, txIndex types.TxIndex, tx types.TxInfo)

func (Keeper) SetUnacknowledgedPacket

func (k Keeper) SetUnacknowledgedPacket(ctx sdk.Context, sourcePort, sourceChannel string, seq uint64)

func (Keeper) UpdateCoordinatorStatus

func (k Keeper) UpdateCoordinatorStatus(ctx sdk.Context, txID types.TxID, status uint8) error

func (Keeper) UpdateTxStatus

func (k Keeper) UpdateTxStatus(ctx sdk.Context, txID types.TxID, txIndex types.TxIndex, status uint8) error

Jump to

Keyboard shortcuts

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