Documentation ¶
Index ¶
- Constants
- Variables
- func ParamKeyTable() subspace.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func ValidateGenesis(data GenesisState) error
- type AccountKeeper
- type GenesisState
- type MsgAdd
- func (*MsgAdd) Descriptor() ([]byte, []int)
- func (msg MsgAdd) GetSignBytes() []byte
- func (msg MsgAdd) GetSigners() []sdk.AccAddress
- func (*MsgAdd) ProtoMessage()
- func (m *MsgAdd) Reset()
- func (msg MsgAdd) Route() string
- func (m *MsgAdd) String() string
- func (msg MsgAdd) Type() string
- func (msg MsgAdd) ValidateBasic() error
- func (m *MsgAdd) XXX_DiscardUnknown()
- func (m *MsgAdd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgAdd) XXX_Merge(src proto.Message)
- func (m *MsgAdd) XXX_Size() int
- func (m *MsgAdd) XXX_Unmarshal(b []byte) error
- type ParamSubspace
- type Params
Constants ¶
const ( EventType = "credit" AttributeKeyAddress = "address" AttributeKeyAmount = "amount" AttributeActionAdded = "added" AttributeActionSubtracted = "subtracted" )
module event types and attributes
const ( // ModuleName is the name of the module ModuleName = "credit" // StoreKey to be used when creating the KVStore StoreKey = ModuleName // RouterKey to be used for routing msgs RouterKey = ModuleName // QuerierRoute to be used for routing QuerierRoute = ModuleName )
const ( QueryGet = "get" QueryParameters = "parameters" )
Query endpoints supported by the ownership querier
const (
DefaultParamspace = ModuleName
)
Default parameter namespace
Variables ¶
var ( // KeyMinters key for the parameter Minters KeyMinters = []byte("Minters") // DefaultMinters is the default value of Minters DefaultMinters = []sdk.AccAddress{} )
var ModuleCdc *codec.Codec
ModuleCdc defines the module codec.
Functions ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on codec.
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the instance genesis parameters
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) exported.Account GetAccount(ctx sdk.Context, addr sdk.AccAddress) exported.Account SetAccount(ctx sdk.Context, acc exported.Account) }
AccountKeeper interface
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params" validate:"dive"` Credits map[string]sdk.Int `json:"credits" yaml:"credits" validate:"dive,required,bigint"` }
GenesisState - all instance state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState is the default GenesisState
func NewGenesisState ¶
func NewGenesisState(params Params, credits map[string]sdk.Int) GenesisState
NewGenesisState creates a new GenesisState object
type MsgAdd ¶
type MsgAdd struct { // The msg's signer. Signer github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 151-byte string literal not displayed */ // The address to add the credits. Address github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 153-byte string literal not displayed */ // amount of credits to add. Amount github_com_cosmos_cosmos_sdk_types.Int `` /* 154-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
The message to add credits.
func (*MsgAdd) Descriptor ¶
func (MsgAdd) GetSignBytes ¶
GetSignBytes encodes the message for signing.
func (MsgAdd) GetSigners ¶
func (msg MsgAdd) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required.
func (*MsgAdd) ProtoMessage ¶
func (*MsgAdd) ProtoMessage()
func (MsgAdd) ValidateBasic ¶
ValidateBasic runs stateless checks on the message.
func (*MsgAdd) XXX_DiscardUnknown ¶
func (m *MsgAdd) XXX_DiscardUnknown()
func (*MsgAdd) XXX_Marshal ¶
func (*MsgAdd) XXX_Unmarshal ¶
type ParamSubspace ¶
type ParamSubspace interface { WithKeyTable(table params.KeyTable) params.Subspace Get(ctx sdk.Context, key []byte, ptr interface{}) GetParamSet(ctx sdk.Context, ps params.ParamSet) SetParamSet(ctx sdk.Context, ps params.ParamSet) }
ParamSubspace defines the expected Subspace interfacace
type Params ¶
type Params struct {
Minters []sdk.AccAddress `json:"minters" yaml:"minters"`
}
Params - used for initializing default parameter for instance at genesis
func DefaultParams ¶
func DefaultParams() Params
DefaultParams defines the parameters for this module
func NewParams ¶
func NewParams(minters []sdk.AccAddress) Params
NewParams creates a new Params object
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
ParamSetPairs - Implements params.ParamSet