types

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSendDisabled         sdk.CodeType = 101
	CodeInvalidInputsOutputs sdk.CodeType = 102
	CodeNoValidatorTopup     sdk.CodeType = 103
	CodeNoBalanceToWithdraw  sdk.CodeType = 104
)

Bank errors reserve 100 ~ 199.

View Source
const (
	EventTypeTopup       = "topup"
	EventTypeFeeWithdraw = "fee-withdraw"
	EventTypeTransfer    = "transfer"

	AttributeKeyRecipient         = "recipient"
	AttributeKeySender            = "sender"
	AttributeKeyUser              = "user"
	AttributeKeyTopupAmount       = "topup-amount"
	AttributeKeyFeeWithdrawAmount = "fee-withdraw-amount"

	AttributeValueCategory = ModuleName
)

bank module event types

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

	// StoreKey is the store key string for bor
	StoreKey = ModuleName

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

	// QuerierRoute is the querier route for bor
	QuerierRoute = ModuleName

	// DefaultParamspace default name for parameter store
	DefaultParamspace = ModuleName

	// DefaultCodespace default code space
	DefaultCodespace sdk.CodespaceType = ModuleName
)
View Source
const (
	QuerySequence            = "sequence"
	QueryDividendAccount     = "dividend-account"
	QueryDividendAccountRoot = "dividend-account-root"
	QueryAccountProof        = "dividend-account-proof"
	QueryVerifyAccountProof  = "verify-account-proof"
)

Variables

View Source
var ModuleCdc = codec.New()

ModuleCdc module cdc

Functions

func ErrInputOutputMismatch

func ErrInputOutputMismatch(codespace sdk.CodespaceType) sdk.Error

ErrInputOutputMismatch is an error

func ErrNoBalanceToWithdraw

func ErrNoBalanceToWithdraw(codespace sdk.CodespaceType) sdk.Error

ErrNoBalanceToWithdraw is an error for validator topup withdraw

func ErrNoInputs

func ErrNoInputs(codespace sdk.CodespaceType) sdk.Error

ErrNoInputs is an error

func ErrNoOutputs

func ErrNoOutputs(codespace sdk.CodespaceType) sdk.Error

ErrNoOutputs is an error

func ErrNoValidatorTopup

func ErrNoValidatorTopup(codespace sdk.CodespaceType) sdk.Error

ErrNoValidatorTopup is an error for validator topup

func ErrSendDisabled

func ErrSendDisabled(codespace sdk.CodespaceType) sdk.Error

ErrSendDisabled is an error

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on codec codec

func SetGenesisStateToAppState

func SetGenesisStateToAppState(appState map[string]json.RawMessage, dividendAccounts []hmTypes.DividendAccount) (map[string]json.RawMessage, error)

SetGenesisStateToAppState sets state into app state

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis performs basic validation of topup genesis data returning an error for any failed validation criteria.

Types

type GenesisState

type GenesisState struct {
	TopupSequences   []string                  `json:"tx_sequences" yaml:"tx_sequences"`
	DividentAccounts []hmTypes.DividendAccount `json:"dividend_accounts" yaml:"dividend_accounts"`
}

GenesisState is the bank state that must be provided at genesis.

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState returns a default genesis state

func GetGenesisStateFromAppState

func GetGenesisStateFromAppState(appState map[string]json.RawMessage) GenesisState

GetGenesisStateFromAppState returns staking GenesisState given raw application genesis state

func NewGenesisState

func NewGenesisState(topupSequence []string, dividentAccounts []hmTypes.DividendAccount) GenesisState

NewGenesisState creates a new genesis state.

type MsgTopup

type MsgTopup struct {
	FromAddress types.HeimdallAddress `json:"from_address"`
	User        types.HeimdallAddress `json:"user"`
	Fee         sdk.Int               `json:"fee"`
	TxHash      types.HeimdallHash    `json:"tx_hash"`
	LogIndex    uint64                `json:"log_index"`
	BlockNumber uint64                `json:"block_number"`
}

MsgTopup - high level transaction of the fee coin module

func NewMsgTopup

func NewMsgTopup(
	fromAddr types.HeimdallAddress,
	user types.HeimdallAddress,
	fee sdk.Int,
	txhash types.HeimdallHash,
	logIndex uint64,
	blockNumber uint64,
) MsgTopup

NewMsgTopup - construct arbitrary multi-in, multi-out send msg.

func (MsgTopup) GetLogIndex

func (msg MsgTopup) GetLogIndex() uint64

GetLogIndex Returns log index

func (MsgTopup) GetSideSignBytes

func (msg MsgTopup) GetSideSignBytes() []byte

func (MsgTopup) GetSignBytes

func (msg MsgTopup) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgTopup) GetSigners

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

GetSigners Implements Msg.

func (MsgTopup) GetTxHash

func (msg MsgTopup) GetTxHash() types.HeimdallHash

GetTxHash Returns tx hash

func (MsgTopup) Route

func (msg MsgTopup) Route() string

Route Implements Msg.

func (MsgTopup) Type

func (msg MsgTopup) Type() string

Type Implements Msg.

func (MsgTopup) ValidateBasic

func (msg MsgTopup) ValidateBasic() sdk.Error

ValidateBasic Implements Msg.

type MsgWithdrawFee

type MsgWithdrawFee struct {
	UserAddress types.HeimdallAddress `json:"from_address"`
	Amount      sdk.Int               `json:"amount"`
}

MsgWithdrawFee - high level transaction of the fee coin withdrawal module

func NewMsgWithdrawFee

func NewMsgWithdrawFee(
	fromAddr types.HeimdallAddress,
	amount sdk.Int,
) MsgWithdrawFee

NewMsgWithdrawFee - construct arbitrary fee withdraw msg

func (MsgWithdrawFee) GetSignBytes

func (msg MsgWithdrawFee) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgWithdrawFee) GetSigners

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

GetSigners Implements Msg.

func (MsgWithdrawFee) Route

func (msg MsgWithdrawFee) Route() string

Route Implements Msg.

func (MsgWithdrawFee) Type

func (msg MsgWithdrawFee) Type() string

Type Implements Msg.

func (MsgWithdrawFee) ValidateBasic

func (msg MsgWithdrawFee) ValidateBasic() sdk.Error

ValidateBasic Implements Msg.

type QueryAccountProofParams

type QueryAccountProofParams struct {
	UserAddress types.HeimdallAddress `json:"user_addr"`
}

QueryAccountProofParams defines the params for querying account proof.

func NewQueryAccountProofParams

func NewQueryAccountProofParams(userAddress types.HeimdallAddress) QueryAccountProofParams

NewQueryAccountProofParams creates a new instance of QueryAccountProofParams.

type QueryDividendAccountParams

type QueryDividendAccountParams struct {
	UserAddress types.HeimdallAddress `json:"user_addr"`
}

QueryDividendAccountParams defines the params for querying dividend account status.

func NewQueryDividendAccountParams

func NewQueryDividendAccountParams(userAddress types.HeimdallAddress) QueryDividendAccountParams

NewQueryDividendAccountParams creates a new instance of QueryDividendAccountParams.

type QuerySequenceParams

type QuerySequenceParams struct {
	TxHash   string
	LogIndex uint64
}

QuerySequenceParams defines the params for querying an account Sequence.

func NewQuerySequenceParams

func NewQuerySequenceParams(txHash string, logIndex uint64) QuerySequenceParams

NewQuerySequenceParams creates a new instance of QuerySequenceParams.

type QueryVerifyAccountProofParams

type QueryVerifyAccountProofParams struct {
	UserAddress  types.HeimdallAddress `json:"user_addr"`
	AccountProof string                `json:"account_proof"`
}

QueryVerifyAccountProofParams defines the params for verifying account proof.

func NewQueryVerifyAccountProofParams

func NewQueryVerifyAccountProofParams(userAddress types.HeimdallAddress, accountProof string) QueryVerifyAccountProofParams

NewQueryVerifyAccountProofParams creates a new instance of QueryVerifyAccountProofParams.

Jump to

Keyboard shortcuts

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