types

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventType = "credit"

	AttributeKeyAddress = "address"
	AttributeKeyAmount  = "amount"

	AttributeActionAdded      = "added"
	AttributeActionSubtracted = "subtracted"
)

module event types and attributes

View Source
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
)
View Source
const (
	QueryGet        = "get"
	QueryParameters = "parameters"
)

Query endpoints supported by the ownership querier

View Source
const (
	DefaultParamspace = ModuleName
)

Default parameter namespace

Variables

View Source
var (
	// KeyMinters key for the parameter Minters
	KeyMinters = []byte("Minters")

	// DefaultMinters is the default value of Minters
	DefaultMinters = []sdk.AccAddress{}
)
View Source
var ModuleCdc *codec.Codec

ModuleCdc defines the module codec.

Functions

func ParamKeyTable

func ParamKeyTable() subspace.KeyTable

ParamKeyTable for auth module

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

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) Descriptor() ([]byte, []int)

func (MsgAdd) GetSignBytes

func (msg MsgAdd) GetSignBytes() []byte

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) Reset

func (m *MsgAdd) Reset()

func (MsgAdd) Route

func (msg MsgAdd) Route() string

Route should return the name of the module.

func (*MsgAdd) String

func (m *MsgAdd) String() string

func (MsgAdd) Type

func (msg MsgAdd) Type() string

Type returns the action.

func (MsgAdd) ValidateBasic

func (msg MsgAdd) ValidateBasic() error

ValidateBasic runs stateless checks on the message.

func (*MsgAdd) XXX_DiscardUnknown

func (m *MsgAdd) XXX_DiscardUnknown()

func (*MsgAdd) XXX_Marshal

func (m *MsgAdd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgAdd) XXX_Merge

func (m *MsgAdd) XXX_Merge(src proto.Message)

func (*MsgAdd) XXX_Size

func (m *MsgAdd) XXX_Size() int

func (*MsgAdd) XXX_Unmarshal

func (m *MsgAdd) XXX_Unmarshal(b []byte) error

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

func (Params) String

func (p Params) String() string

String implements the stringer interface for Params

Jump to

Keyboard shortcuts

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