types

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 6 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

	// RouterKey uses module name for tx routing
	RouterKey = ModuleName

	// QuerierRoute uses module name for query routing
	QuerierRoute = ModuleName
)
View Source
const (
	AttributeRecipient string = "recipient"
)

Faucet module events

View Source
const (
	QueryFunded = "funded"
)

Supported endpoints

Variables

View Source
var (
	EnableFaucetKey  = []byte{0x01}
	TimeoutKey       = []byte{0x02}
	CapKey           = []byte{0x03}
	MaxPerRequestKey = []byte{0x04}
	FundedKey        = []byte{0x05}
)
View Source
var (
	// ErrWithdrawTooOften withdraw too often
	ErrWithdrawTooOften = sdkerrors.Register(ModuleName, 2, "each address can withdraw only once")
)
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 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

func (msg MsgFund) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgFund) GetSigners

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

GetSigners defines whose signature is required

func (MsgFund) Route

func (msg MsgFund) Route() string

Route should return the name of the module

func (MsgFund) Type

func (msg MsgFund) Type() string

Type should return the action

func (MsgFund) ValidateBasic

func (msg MsgFund) 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
	GetModuleAccount(ctx sdk.Context, moduleName string) supplyexported.ModuleAccountI
}

SupplyKeeper is required for mining coin

Jump to

Keyboard shortcuts

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