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 = "nft"

	DELIMITER = "/"

	// DoNotModify used to indicate that some field should not be updated
	DoNotModify = "[do-not-modify]"
)

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 added in v0.2.0

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 added in v0.2.0

ClassTrace implements the Query/ClassTrace gRPC method

func (Keeper) ClassTraces added in v0.2.0

ClassTraces implements the Query/ClassTraces gRPC method

func (Keeper) GetClassTrace added in v0.2.0

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

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

GetNftTransferModuleAddr returns the nft transfer module addr

func (Keeper) HasClassTrace added in v0.2.0

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) MustMarshalClassTrace added in v0.2.0

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

func (Keeper) OnAcknowledgementPacket

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

func (Keeper) OnRecvPacket

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

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

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

C->B->A away_from_source == flase

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

func (Keeper) SendNftTransfer

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

func (Keeper) SetClassTrace added in v0.2.0

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 added in v0.2.0

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