types

package
v0.0.0-...-606b92f Latest Latest
Warning

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

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

Documentation

Index

Constants

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

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName
)
View Source
const RouterKey = ModuleName // this was defined in your key.go file

RouterKey is the module name router key

Variables

View Source
var (
	// ErrWithdrawTooOften withdraw too often
	ErrWithdrawTooOften  = sdkerrors.Register(ModuleName, 100, "Each address can withdraw only once")
	ErrFaucetKeyEmpty    = sdkerrors.Register(ModuleName, 101, "Armor should Not be empty.")
	ErrFaucetKeyExisted  = sdkerrors.Register(ModuleName, 102, "Faucet key existed")
	ErrCantWithdrawStake = sdkerrors.Register(ModuleName, 103, "Can't withdraw staking token")
	ErrNoEmoji           = sdkerrors.Register(ModuleName, 104, "No emoji present in denom")
)
View Source
var ModuleCdc = codec.New()

ModuleCdc is the codec for the module

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

Types

type FaucetKey

type FaucetKey struct {
	Armor string `json:" armor"`
}

func NewFaucetKey

func NewFaucetKey(armor string) FaucetKey

NewFaucetKey create a instance

func (FaucetKey) String

func (f FaucetKey) String() string

implement fmt.Stringer

type Mining

type Mining struct {
	Minter   sdk.AccAddress `json:"Minter"`
	LastTime int64          `json:"LastTime"`
	Tally    int64          `json:"Tally"`
}

Mining is a struct that contains all the metadata of a mint

func NewMining

func NewMining(minter sdk.AccAddress, tally int64) Mining

NewMining returns a new Mining

func (Mining) GetMinter

func (w Mining) GetMinter() sdk.AccAddress

GetMinter get minter of mining

func (Mining) String

func (w Mining) String() string

implement fmt.Stringer

type MsgFaucetKey

type MsgFaucetKey struct {
	Sender sdk.AccAddress
	Armor  string
}

MsgMint defines a mint message

func NewMsgFaucetKey

func NewMsgFaucetKey(sender sdk.AccAddress, armor string) MsgFaucetKey

NewMsgFaucetKey is a constructor function for MsgFaucetKey

func (MsgFaucetKey) GetSignBytes

func (msg MsgFaucetKey) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgFaucetKey) GetSigners

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

GetSigners defines whose signature is required

func (MsgFaucetKey) Route

func (msg MsgFaucetKey) Route() string

Route should return the name of the module

func (MsgFaucetKey) Type

func (msg MsgFaucetKey) Type() string

Type should return the action

func (MsgFaucetKey) ValidateBasic

func (msg MsgFaucetKey) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type MsgMint

type MsgMint struct {
	Sender sdk.AccAddress
	Minter sdk.AccAddress
	Denom  string
}

MsgMint defines a mint message

func NewMsgMint

func NewMsgMint(sender sdk.AccAddress, minter sdk.AccAddress, denom string) MsgMint

NewMsgMint is a constructor function for NewMsgMint

func (MsgMint) GetSignBytes

func (msg MsgMint) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgMint) GetSigners

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

GetSigners defines whose signature is required

func (MsgMint) Route

func (msg MsgMint) Route() string

Route should return the name of the module

func (MsgMint) Type

func (msg MsgMint) Type() string

Type should return the action

func (MsgMint) ValidateBasic

func (msg MsgMint) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type StakingKeeper

type StakingKeeper interface {
	BondDenom(ctx sdk.Context) string
}

StakingKeeper is required for getting Denom

type SupplyKeeper

type SupplyKeeper interface {
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	SendCoinsFromModuleToAccount(
		ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins,
	) error
	GetSupply(ctx sdk.Context) (supply exported.SupplyI)
}

SupplyKeeper is required for mining coin

Jump to

Keyboard shortcuts

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