Documentation
¶
Index ¶
Constants ¶
const ( // ModuleName is the name of the module ModuleName = "faucet" // StoreKey to be used when creating the KVStore StoreKey = ModuleName )
const RouterKey = ModuleName // this was defined in your key.go file
RouterKey is the module name router key
Variables ¶
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") )
var ModuleCdc = codec.New()
ModuleCdc is the codec for the module
Functions ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type Mining ¶
type Mining struct { Minter sdk.AccAddress `json:"Minter"` LastTime int64 `json:"LastTime"` Total sdk.Coin `json:"Total"` }
Mining is a struct that contains all the metadata of a mint
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) ValidateBasic ¶
func (msg MsgFaucetKey) ValidateBasic() error
ValidateBasic runs stateless checks on the message
type MsgMint ¶
type MsgMint struct { Sender sdk.AccAddress Minter sdk.AccAddress Time int64 }
MsgMint defines a mint message
func NewMsgMint ¶
func NewMsgMint(sender sdk.AccAddress, minter sdk.AccAddress, mTime int64) MsgMint
NewMsgMint is a constructor function for NewMsgMint
func (MsgMint) GetSignBytes ¶
GetSignBytes encodes the message for signing
func (MsgMint) GetSigners ¶
func (msg MsgMint) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgMint) ValidateBasic ¶
ValidateBasic runs stateless checks on the message
type StakingKeeper ¶
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