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

	// StoreKey is the default store key for guardian
	MapinfoStoreKey = ModuleName
	VerifyStoreKey  = ModuleName + "verify"

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

	// QuerierRoute is the querier route for the guardian store.
	QuerierRoute = MapinfoStoreKey
)
View Source
const (
	TypeMsgRegister  = "register"
	TypeMsgMapVerify = "verify"
)
View Source
const (
	QueryInfoByErc = "queryInfoByErc" // QueryFeed
	QueryInfoByCC  = "queryInfoByCC"
)
View Source
const (
	MappingWaitVerify   int = iota
	MappingVerifyFailed     // 注册并且verify失败
	MappingVerifyPassed     // 注册并且verify成功
	MappingOutline          // 超过了verify的时间,注册已经无效
)
View Source
const (
	DefaultParamspace = ModuleName
)

Default parameter namespace

Variables

View Source
var (
	// key for constant fee parameter
	RefreshPoint      = []byte("RefreshPoint")
	WaitVerifyTimeout = []byte("WaitVerifyTimeout")
)
View Source
var ModuleCdc = codec.New()

ModuleCdc defines the codec to be used by evm module

Functions

func MapedKey

func MapedKey(info MappingInfo) []byte

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 MappingInfo

type MappingInfo struct {
	ErcAddr       string   `json:"erc_addr"`
	CCAddr        string   `json:"cc_addr"`
	RegisterBlock uint64   `json:"register_block"`
	Balance       *big.Int `json:"balance"`
	Status        int      `json:"status"`
}

type MsgMapVerify

type MsgMapVerify struct {
	ErcAddr string `json:"erc_addr"`   // 用户的ERC20地址
	CCAddr  string `json:"cross_addr"` // cross chain address to binding
}

func NewMsgMapVerify

func NewMsgMapVerify(ercAddr string, ccAddr string) *MsgMapVerify

func (MsgMapVerify) GetMsgs

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

GetMsgs returns a single MsgSetAccName as an sdk.Msg.

func (MsgMapVerify) GetSignBytes

func (msg MsgMapVerify) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgMapVerify) GetSigners

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

GetSigners defines whose signature is required

func (MsgMapVerify) Route

func (msg MsgMapVerify) Route() string

Route should return the name of the module

func (MsgMapVerify) Type

func (msg MsgMapVerify) Type() string

Type should return the action

func (MsgMapVerify) ValidateBasic

func (msg MsgMapVerify) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgRegister

type MsgRegister struct {
	Sender  string `json:"sender"`
	ErcAddr string `json:"erc_addr"`   // 用户的ERC20地址
	CCAddr  string `json:"cross_addr"` // cross chain address to binding
}

func NewMsgRegister

func NewMsgRegister(sender string, ercAddr string, ccAddr string) *MsgRegister

func (MsgRegister) GetMsgs

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

GetMsgs returns a single MsgSetAccName as an sdk.Msg.

func (MsgRegister) GetSignBytes

func (msg MsgRegister) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgRegister) GetSigners

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

GetSigners defines whose signature is required

func (MsgRegister) Route

func (msg MsgRegister) Route() string

Route should return the name of the module

func (MsgRegister) Type

func (msg MsgRegister) Type() string

Type should return the action

func (MsgRegister) ValidateBasic

func (msg MsgRegister) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type QueryInfoByCCParams

type QueryInfoByCCParams struct {
	CCAddr string
}

QueryInfoByCCParams defines the params to query map info by crossnode addr.

type QueryInfoByErcParams

type QueryInfoByErcParams struct {
	ErcAddr string
}

QueryInfoByErcParams defines the params to query map info by oin erc20 addr.

type QueryInfoResponse

type QueryInfoResponse struct {
	Found         bool   `json:"found"`
	ErcAddr       string `json:"ercAddress"`
	CCAddr        string `json:"ccAddress"`
	RegisterBlock uint64 `json:"registerBlock"`
	Balance       uint64 `json:"balance"`
	Status        int    `json:"status"`
}

func (QueryInfoResponse) String

func (q QueryInfoResponse) String() string

Jump to

Keyboard shortcuts

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