keeper

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 22 Imported by: 21

Documentation

Index

Constants

View Source
const (
	CLASSPREFIX = "tibc-"

	CLASSPATHPREFIX = "mt"

	DELIMITER = "/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

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

func NewKeeper

NewKeeper creates a new TIBC transfer Keeper instance

func (Keeper) ClassPathFromHash

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

ClassPathFromHash returns the full class path prefix from an ibc class with a hash component.

func (Keeper) ClassTrace

ClassTrace implements the Query/ClassTrace gRPC method

func (Keeper) ClassTraces

ClassTraces implements the Query/ClassTraces gRPC method

func (Keeper) GetClassTrace

func (k Keeper) GetClassTrace(
	ctx sdk.Context,
	classTraceHash tmbytes.HexBytes,
) (types.ClassTrace, bool)

GetClassTrace retreives the full identifiers trace and base class from the store.

func (Keeper) GetMtTransferModuleAddr

func (k Keeper) GetMtTransferModuleAddr(name string) sdk.AccAddress

GetMtTransferModuleAddr returns the mt transfer module addr

func (Keeper) HasClassTrace

func (k Keeper) HasClassTrace(ctx sdk.Context, classTraceHash tmbytes.HexBytes) bool

HasClassTrace checks if a the key with the given class trace hash exists on the store.

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) MtTransfer

func (k Keeper) MtTransfer(goCtx context.Context, msg *types.MsgMtTransfer) (*types.MsgMtTransferResponse, error)

func (Keeper) MustMarshalClassTrace

func (k Keeper) MustMarshalClassTrace(classTrace types.ClassTrace) []byte

MustMarshalClassTrace attempts to encode an ClassTrace object and returns the raw encoded bytes. It panics on error.

func (Keeper) OnAcknowledgementPacket

func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, data types.MultiTokenPacketData, ack packetType.Acknowledgement) error

func (Keeper) OnRecvPacket

func (k Keeper) OnRecvPacket(ctx sdk.Context, packet packetType.Packet, data types.MultiTokenPacketData) error

OnRecvPacket A->B->C away_from_source == true

B receive packet from A : class -> mt/A/B/class
c receive packet from B : mt/A/B/class -> mt/A/B/C/class

C->B->A away_from_source == flase

B receive packet from C : mt/A/B/C/class -> mt/A/B/class
A receive packet from B : mt/A/B/class -> class

func (Keeper) SendMtTransfer

func (k Keeper) SendMtTransfer(
	ctx sdk.Context,
	class, id string,
	sender sdk.AccAddress,
	receiver string,
	destChain string,
	relayChain string,
	destContract string,
	amount uint64,
) error

func (Keeper) SetClassTrace

func (k Keeper) SetClassTrace(ctx sdk.Context, classTrace types.ClassTrace)

SetClassTrace sets a new {trace hash -> class trace} pair to the store.

func (Keeper) UnmarshalClassTrace

func (k Keeper) UnmarshalClassTrace(bz []byte) (types.ClassTrace, error)

UnmarshalClassTrace attempts to decode and return an ClassTrace object from raw encoded bytes.

Jump to

Keyboard shortcuts

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