htlc

package
v1.0.0-GridTestnet.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the name of the HTLC module
	ModuleName = "htlc"

	// StoreKey is the string store representation
	StoreKey string = ModuleName

	// QuerierRoute is the querier route for the HTLC module
	QuerierRoute string = ModuleName

	// RouterKey is the msg router key for the HTLC module
	RouterKey string = ModuleName
)

Variables

View Source
var (
	ErrInvalidLengthHtlc        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowHtlc          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupHtlc = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// Keys for store prefixes
	HTLCKey             = []byte{0x01} // prefix for HTLC
	HTLCExpiredQueueKey = []byte{0x02} // prefix for the HTLC expiration queue
)
View Source
var HTLCStatus_name = map[int32]string{
	0: "HTLC_STATE_OPEN",
	1: "HTLC_STATE_COMPLETED",
	2: "HTLC_STATE_EXPIRED",
	3: "HTLC_STATE_REFUNDED",
}
View Source
var HTLCStatus_value = map[string]int32{
	"HTLC_STATE_OPEN":      0,
	"HTLC_STATE_COMPLETED": 1,
	"HTLC_STATE_EXPIRED":   2,
	"HTLC_STATE_REFUNDED":  3,
}

Functions

func GetHTLCExpiredQueueKey

func GetHTLCExpiredQueueKey(expirationHeight uint64, hashLock []byte) []byte

GetHTLCExpiredQueueKey returns the key for the HTLC expiration queue by the specified height and hash lock VALUE: []byte{}

func GetHTLCExpiredQueueSubspace

func GetHTLCExpiredQueueSubspace(expirationHeight uint64) []byte

GetHTLCExpiredQueueSubspace returns the key prefix for the HTLC expiration queue by the given height

func GetHTLCKey

func GetHTLCKey(hashLock []byte) []byte

GetHTLCKey returns the key for the HTLC with the specified hash lock VALUE: htlc/HTLC

func PresetHTLTParams

func PresetHTLTParams() htlctypes.Params

Types

type HTLCStatus

type HTLCStatus int32

HTLCStatus defines the state of an OldHTLC

const (
	// HTLC_STATE_OPEN defines an open state.
	Open HTLCStatus = 0
	// HTLC_STATE_COMPLETED defines a completed state.
	Completed HTLCStatus = 1
	// HTLC_STATE_EXPIRED defines an expired state.
	Expired HTLCStatus = 2
	// HTLC_STATE_REFUNDED defines a refunded state.
	Refunded HTLCStatus = 3
)

func (HTLCStatus) String

func (x HTLCStatus) String() string

type OldHTLC

type OldHTLC struct {
	Sender               string                                   `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	To                   string                                   `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	ReceiverOnOtherChain string                                   `` /* 156-byte string literal not displayed */
	Amount               github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
	Secret               string                                   `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"`
	Timestamp            uint64                                   `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	ExpirationHeight     uint64                                   `` /* 135-byte string literal not displayed */
	State                HTLCStatus                               `protobuf:"varint,8,opt,name=state,proto3,enum=irismod.htlc.HTLCStatus" json:"state,omitempty"`
}

OldHTLC defines the struct of an OldHTLC

func (*OldHTLC) Equal

func (this *OldHTLC) Equal(that interface{}) bool

func (*OldHTLC) Marshal

func (m *OldHTLC) Marshal() (dAtA []byte, err error)

func (*OldHTLC) MarshalTo

func (m *OldHTLC) MarshalTo(dAtA []byte) (int, error)

func (*OldHTLC) MarshalToSizedBuffer

func (m *OldHTLC) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*OldHTLC) ProtoMessage

func (*OldHTLC) ProtoMessage()

func (*OldHTLC) Reset

func (m *OldHTLC) Reset()

func (*OldHTLC) Size

func (m *OldHTLC) Size() (n int)

func (*OldHTLC) String

func (m *OldHTLC) String() string

func (*OldHTLC) Unmarshal

func (m *OldHTLC) Unmarshal(dAtA []byte) error

func (*OldHTLC) XXX_DiscardUnknown

func (m *OldHTLC) XXX_DiscardUnknown()

func (*OldHTLC) XXX_Marshal

func (m *OldHTLC) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OldHTLC) XXX_Merge

func (m *OldHTLC) XXX_Merge(src proto.Message)

func (*OldHTLC) XXX_Size

func (m *OldHTLC) XXX_Size() int

func (*OldHTLC) XXX_Unmarshal

func (m *OldHTLC) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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