Documentation ¶
Index ¶
- Constants
- Variables
- func ErrInputOutputMismatch(codespace sdk.CodespaceType) sdk.Error
- func ErrNoBalanceToWithdraw(codespace sdk.CodespaceType) sdk.Error
- func ErrNoInputs(codespace sdk.CodespaceType) sdk.Error
- func ErrNoOutputs(codespace sdk.CodespaceType) sdk.Error
- func ErrNoValidatorTopup(codespace sdk.CodespaceType) sdk.Error
- func ErrSendDisabled(codespace sdk.CodespaceType) sdk.Error
- func RegisterCodec(cdc *codec.Codec)
- func SetGenesisStateToAppState(appState map[string]json.RawMessage, ...) (map[string]json.RawMessage, error)
- func ValidateGenesis(data GenesisState) error
- type GenesisState
- type MsgTopup
- func (msg MsgTopup) GetLogIndex() uint64
- func (msg MsgTopup) GetSideSignBytes() []byte
- func (msg MsgTopup) GetSignBytes() []byte
- func (msg MsgTopup) GetSigners() []sdk.AccAddress
- func (msg MsgTopup) GetTxHash() types.HeimdallHash
- func (msg MsgTopup) Route() string
- func (msg MsgTopup) Type() string
- func (msg MsgTopup) ValidateBasic() sdk.Error
- type MsgWithdrawFee
- type QueryAccountProofParams
- type QueryDividendAccountParams
- type QuerySequenceParams
- type QueryVerifyAccountProofParams
Constants ¶
const ( CodeSendDisabled sdk.CodeType = 101 CodeInvalidInputsOutputs sdk.CodeType = 102 CodeNoValidatorTopup sdk.CodeType = 103 CodeNoBalanceToWithdraw sdk.CodeType = 104 )
Bank errors reserve 100 ~ 199.
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
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 )
const ( QuerySequence = "sequence" QueryDividendAccount = "dividend-account" QueryDividendAccountRoot = "dividend-account-root" QueryAccountProof = "dividend-account-proof" QueryVerifyAccountProof = "verify-account-proof" )
Variables ¶
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 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 ¶
RegisterCodec registers concrete types on codec codec
func SetGenesisStateToAppState ¶ added in v0.1.7
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 ¶ added in v0.1.7
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 ¶
GetLogIndex Returns log index
func (MsgTopup) GetSideSignBytes ¶ added in v0.1.7
func (MsgTopup) GetSignBytes ¶
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) ValidateBasic ¶
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) ValidateBasic ¶
func (msg MsgWithdrawFee) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type QueryAccountProofParams ¶ added in v0.1.7
type QueryAccountProofParams struct {
UserAddress types.HeimdallAddress `json:"user_addr"`
}
QueryAccountProofParams defines the params for querying account proof.
func NewQueryAccountProofParams ¶ added in v0.1.7
func NewQueryAccountProofParams(userAddress types.HeimdallAddress) QueryAccountProofParams
NewQueryAccountProofParams creates a new instance of QueryAccountProofParams.
type QueryDividendAccountParams ¶ added in v0.1.7
type QueryDividendAccountParams struct {
UserAddress types.HeimdallAddress `json:"user_addr"`
}
QueryDividendAccountParams defines the params for querying dividend account status.
func NewQueryDividendAccountParams ¶ added in v0.1.7
func NewQueryDividendAccountParams(userAddress types.HeimdallAddress) QueryDividendAccountParams
NewQueryDividendAccountParams creates a new instance of QueryDividendAccountParams.
type QuerySequenceParams ¶
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 ¶ added in v0.1.7
type QueryVerifyAccountProofParams struct { UserAddress types.HeimdallAddress `json:"user_addr"` AccountProof string `json:"account_proof"` }
QueryVerifyAccountProofParams defines the params for verifying account proof.
func NewQueryVerifyAccountProofParams ¶ added in v0.1.7
func NewQueryVerifyAccountProofParams(userAddress types.HeimdallAddress, accountProof string) QueryVerifyAccountProofParams
NewQueryVerifyAccountProofParams creates a new instance of QueryVerifyAccountProofParams.