Documentation ¶
Index ¶
Constants ¶
const ( // ModuleName is the name of the module ModuleName = "faucet" // StoreKey to be used when creating the KVStore StoreKey = ModuleName // RouterKey uses module name for tx routing RouterKey = ModuleName // QuerierRoute uses module name for query routing QuerierRoute = ModuleName )
const (
AttributeRecipient string = "recipient"
)
Faucet module events
const (
QueryFunded = "funded"
)
Supported endpoints
Variables ¶
var ( EnableFaucetKey = []byte{0x01} TimeoutKey = []byte{0x02} CapKey = []byte{0x03} MaxPerRequestKey = []byte{0x04} FundedKey = []byte{0x05} )
var ( // ErrWithdrawTooOften withdraw too often ErrWithdrawTooOften = sdkerrors.Register(ModuleName, 2, "each address can withdraw only once") )
var ModuleCdc = codec.New()
ModuleCdc is the codec for the module
Functions ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type GenesisState ¶
type GenesisState struct { // enable faucet funding EnableFaucet bool `json:"enable_faucet" yaml:"enable_faucet"` // addresses can send requests every <Timeout> duration Timeout time.Duration `json:"timeout" yaml:"timeout"` // max total amount to be funded by the faucet FaucetCap sdk.Int `json:"faucet_cap" yaml:"faucet_cap"` // max amount per request (i.e sum of all requested coin amounts). MaxAmountPerRequest sdk.Int `json:"max_amount_per_request" yaml:"max_amount_per_request"` }
GenesisState defines the application's genesis state. It contains all the information required and accounts to initialize the blockchain.
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState sets default evm genesis config
func (GenesisState) Validate ¶
func (gs GenesisState) Validate() error
Validate performs a basic validation of the GenesisState fields.
type MsgFund ¶
type MsgFund struct { Amount sdk.Coins `json:"amount" yaml:"amount"` Sender sdk.AccAddress `json:"sender" yaml:"sender"` Recipient sdk.AccAddress `json:"receipient" yaml:"receipient"` }
MsgFund funds a recipient address
func NewMsgFund ¶
func NewMsgFund(amount sdk.Coins, sender, recipient sdk.AccAddress) MsgFund
NewMsgFund is a constructor function for NewMsgFund
func (MsgFund) GetSignBytes ¶
GetSignBytes encodes the message for signing
func (MsgFund) GetSigners ¶
func (msg MsgFund) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgFund) 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 GetModuleAccount(ctx sdk.Context, moduleName string) supplyexported.ModuleAccountI }
SupplyKeeper is required for mining coin