keeper

package
v0.0.0-...-4696dcf Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

NewQuerier creates a new HTLC Querier instance

Types

type Keeper

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

Keeper defines the HTLC keeper

func NewKeeper

func NewKeeper(
	cdc codec.Marshaler,
	key sdk.StoreKey,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
) Keeper

NewKeeper creates a new HTLC Keeper instance

func (Keeper) AddHTLCToExpiredQueue

func (k Keeper) AddHTLCToExpiredQueue(ctx sdk.Context, expirationHeight uint64, hashLock tmbytes.HexBytes)

AddHTLCToExpiredQueue adds the specified HTLC to the expiration queue

func (Keeper) ClaimHTLC

func (k Keeper) ClaimHTLC(ctx sdk.Context, hashLock tmbytes.HexBytes, secret tmbytes.HexBytes) error

ClaimHTLC claims the specified HTLC with the given secret

func (Keeper) CreateHTLC

func (k Keeper) CreateHTLC(
	ctx sdk.Context,
	sender,
	to sdk.AccAddress,
	receiverOnOtherChain string,
	amount sdk.Coins,
	hashLock tmbytes.HexBytes,
	timestamp,
	timeLock uint64,
) error

CreateHTLC creates an HTLC

func (Keeper) DeleteHTLCFromExpiredQueue

func (k Keeper) DeleteHTLCFromExpiredQueue(ctx sdk.Context, expirationHeight uint64, hashLock tmbytes.HexBytes)

DeleteHTLCFromExpiredQueue removes the specified HTLC from the expiration queue

func (Keeper) GetHTLC

func (k Keeper) GetHTLC(ctx sdk.Context, hashLock tmbytes.HexBytes) (htlc types.HTLC, found bool)

GetHTLC retrieves the specified HTLC

func (Keeper) GetHTLCAccount

func (k Keeper) GetHTLCAccount(ctx sdk.Context) authtypes.ModuleAccountI

GetHTLCAccount returns the HTLC module account

func (Keeper) HTLC

func (Keeper) HasHTLC

func (k Keeper) HasHTLC(ctx sdk.Context, hashLock tmbytes.HexBytes) bool

HasHTLC checks if the given HTLC exists

func (Keeper) IterateHTLCExpiredQueueByHeight

func (k Keeper) IterateHTLCExpiredQueueByHeight(
	ctx sdk.Context,
	height uint64,
	op func(hlock tmbytes.HexBytes, h types.HTLC) (stop bool),
)

IterateHTLCExpiredQueueByHeight iterates through the HTLC expiration queue by the specified height

func (Keeper) IterateHTLCs

func (k Keeper) IterateHTLCs(
	ctx sdk.Context,
	op func(hlock tmbytes.HexBytes, h types.HTLC) (stop bool),
)

IterateHTLCs iterates through the HTLCs

func (Keeper) Logger

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

Logger returns a module-specific logger

func (Keeper) RefundHTLC

func (k Keeper) RefundHTLC(ctx sdk.Context, hashLock tmbytes.HexBytes) error

RefundHTLC refunds the specified HTLC

func (Keeper) SetHTLC

func (k Keeper) SetHTLC(ctx sdk.Context, htlc types.HTLC, hashLock tmbytes.HexBytes)

SetHTLC sets the given HTLC

Jump to

Keyboard shortcuts

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