types

package
v0.0.0-...-bd61a53 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// module name
	ModuleName = "coinswap"

	// StoreKey is the default store key for guardian
	StoreKey = ModuleName

	// RouterKey is the message route for guardian
	RouterKey = ModuleName

	// QuerierRoute is the querier route for the guardian store.
	QuerierRoute = StoreKey
)
View Source
const (
	RecordStatusWaited  = 1
	RecordStatusSucceed = 2
	RecordStatusFailed  = 3
)
View Source
const (
	DefaultParamspace = ModuleName
)

Default parameter namespace

View Source
const (
	QueryReceiptByHash = "queryReceiptByHash"
)
View Source
const (
	TypeMsgCoinSwap = "coinswap"
)

Variables

View Source
var ModuleCdc = codec.New()

ModuleCdc defines the codec to be used by evm module

View Source
var (
	// key for constant fee parameter
	RefreshPoint = []byte("RefreshPoint")
)

Functions

func ParamKeyTable

func ParamKeyTable() params.KeyTable

type declaration for parameters

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types and interfaces on the given codec.

Types

type CodeType

type CodeType = sdk.CodeType
const (
	DefaultCodespace sdk.CodespaceType = ModuleName

	CodeInvalidInput   CodeType = 101
	CodeInvalidAddress CodeType = sdk.CodeInvalidAddress
	CodeUnauthorized   CodeType = sdk.CodeUnauthorized
	CodeInternal       CodeType = sdk.CodeInternal
	CodeUnknownRequest CodeType = sdk.CodeUnknownRequest
)

type CoinSwapReceipt

type CoinSwapReceipt struct {
	Status  int    `json:"status"`  // 兑换状态(1:wait, 2:finished, 0:invalid)
	Receipt string `json:"receipt"` // 用户提币凭据
}

代币兑换交易收条,用于返回一段凭据,用户使用凭据去目标链提取兑换的币

func (CoinSwapReceipt) String

func (c CoinSwapReceipt) String() string

type CoinSwapRecord

type CoinSwapRecord struct {
	TxHash     string `json:"txHash"`     // 抵押交易hash
	FromChain  int    `json:"fromChain"`  // 原始链
	FromAddr   string `json:"fromAddr"`   // 抵押者地址
	Token      int    `json:"token"`      // 代币类型
	Value      uint64 `json:"value"`      // 抵押数量
	ToAddr     string `json:"toAddr"`     // 接收铸币的地址
	ToChain    int    `json:"toChain"`    // 目标链
	EventType  int    `json:"eventType"`  // 事件类型(1: 铸币 0:销毁)
	AddedBlock uint64 `json:"addedBlock"` // 记录产生的区块号
}

func (CoinSwapRecord) Hash

func (c CoinSwapRecord) Hash() []byte

func (CoinSwapRecord) String

func (c CoinSwapRecord) String() string

type CoinSwapRecordStorage

type CoinSwapRecordStorage struct {
	Record  CoinSwapRecord  `json:"record"`
	Receipt CoinSwapReceipt `json:"receipt"`
}

func (CoinSwapRecordStorage) String

func (c CoinSwapRecordStorage) String() string

type MsgCoinSwap

type MsgCoinSwap struct {
	Sender    string `json:"sender"`    // 交易发送者
	TxHash    string `json:"txHash"`    // 抵押交易hash
	FromChain int    `json:"fromChain"` // 原始链
	FromAddr  string `json:"fromAddr"`  // 抵押者地址
	Token     int    `json:"token"`     // 代币类型
	Value     uint64 `json:"value"`     // 抵押数量
	ToAddr    string `json:"toAddr"`    // 接收铸币的地址
	ToChain   int    `json:"toChain"`   // 目标链
	EventType int    `json:"eventType"` // 事件类型(1: 铸币 0:销毁)
}

coinswap msg got from borker node.

func NewMsgCoinSwap

func NewMsgCoinSwap(sender string, txhash string, fromChain int, fromAddr string, token int, value uint64,
	toAddr string, toChain int, eventType int) *MsgCoinSwap

func (MsgCoinSwap) GetMsgs

func (msg MsgCoinSwap) GetMsgs() []sdk.Msg

GetMsgs returns a single MsgSetAccName as an sdk.Msg.

func (MsgCoinSwap) GetSignBytes

func (msg MsgCoinSwap) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgCoinSwap) GetSigners

func (msg MsgCoinSwap) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgCoinSwap) Route

func (msg MsgCoinSwap) Route() string

Route should return the name of the module

func (MsgCoinSwap) ToRecord

func (msg MsgCoinSwap) ToRecord() CoinSwapRecord

func (MsgCoinSwap) Type

func (msg MsgCoinSwap) Type() string

Type should return the action

func (MsgCoinSwap) ValidateBasic

func (msg MsgCoinSwap) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type QueryReceiptByHashParams

type QueryReceiptByHashParams struct {
	Hash string
}

QueryReceiptByHashParams defines the params to query map info by oin addr.

Jump to

Keyboard shortcuts

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