Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterInterfaces(mint cdctypes.InterfaceRegistry)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- func ValidateGenesis(data GenesisState) error
- type AccountKeeper
- type BankKeeper
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) GetBondDenom() string
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type Minter
- func (m Minter) CalculateBlockProvision(current, previous time.Time) (sdk.Coin, error)
- func (*Minter) Descriptor() ([]byte, []int)
- func (m *Minter) GetBondDenom() string
- func (m *Minter) GetInitialized() bool
- func (m *Minter) GetPreviousBlockTime() *time.Time
- func (m *Minter) Marshal() (dAtA []byte, err error)
- func (m *Minter) MarshalTo(dAtA []byte) (int, error)
- func (m *Minter) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Minter) ProtoMessage()
- func (m *Minter) Reset()
- func (m *Minter) Size() (n int)
- func (m *Minter) String() string
- func (m *Minter) Unmarshal(dAtA []byte) error
- func (m Minter) Validate() error
- func (m *Minter) XXX_DiscardUnknown()
- func (m *Minter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Minter) XXX_Merge(src proto.Message)
- func (m *Minter) XXX_Size() int
- func (m *Minter) XXX_Unmarshal(b []byte) error
- type MsgClient
- type MsgInit
- func (*MsgInit) Descriptor() ([]byte, []int)
- func (m *MsgInit) GetAuthority() string
- func (m *MsgInit) Marshal() (dAtA []byte, err error)
- func (m *MsgInit) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgInit) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgInit) ProtoMessage()
- func (m *MsgInit) Reset()
- func (m *MsgInit) Size() (n int)
- func (m *MsgInit) String() string
- func (m *MsgInit) Unmarshal(dAtA []byte) error
- func (m *MsgInit) XXX_DiscardUnknown()
- func (m *MsgInit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgInit) XXX_Merge(src proto.Message)
- func (m *MsgInit) XXX_Size() int
- func (m *MsgInit) XXX_Unmarshal(b []byte) error
- type MsgMsgInitResponse
- func (*MsgMsgInitResponse) Descriptor() ([]byte, []int)
- func (m *MsgMsgInitResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgMsgInitResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgMsgInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgMsgInitResponse) ProtoMessage()
- func (m *MsgMsgInitResponse) Reset()
- func (m *MsgMsgInitResponse) Size() (n int)
- func (m *MsgMsgInitResponse) String() string
- func (m *MsgMsgInitResponse) Unmarshal(dAtA []byte) error
- func (m *MsgMsgInitResponse) XXX_DiscardUnknown()
- func (m *MsgMsgInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgMsgInitResponse) XXX_Merge(src proto.Message)
- func (m *MsgMsgInitResponse) XXX_Size() int
- func (m *MsgMsgInitResponse) XXX_Unmarshal(b []byte) error
- type MsgServer
- type QueryClient
- type QueryServer
- type UnimplementedMsgServer
- type UnimplementedQueryServer
Constants ¶
const ( // ModuleName is the name of the mint module. ModuleName = "mint" // StoreKey is the default store key for mint StoreKey = ModuleName // RouterKey defines the module's message routing key RouterKey = StoreKey TimeBasedRewards = "time_based_rewards" )
const ( DailyMintRate = 146940000 // loya per day DefaultBondDenom = "loya" MillisecondsInDay = 24 * 60 * 60 * 1000 )
Variables ¶
var ( ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") ErrAlreadyInitialized = sdkerrors.Register(ModuleName, 1101, "already initialized") )
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
Functions ¶
func RegisterInterfaces ¶
func RegisterInterfaces(mint cdctypes.InterfaceRegistry)
func RegisterMsgServer ¶
func RegisterQueryServer ¶
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the provided genesis state to ensure the expected invariants holds.
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { GetModuleAddress(name string) sdk.AccAddress GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI }
AccountKeeper defines the contract required for account APIs.
type BankKeeper ¶
type BankKeeper interface { SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error MintCoins(ctx context.Context, name string, amt sdk.Coins) error InputOutputCoins(ctx context.Context, inputs banktypes.Input, outputs []banktypes.Output) error }
BankKeeper defines the contract needed to be fulfilled for banking and supply dependencies.
type GenesisState ¶
type GenesisState struct { // BondDenom is the denomination of the token that should be minted. BondDenom string `protobuf:"bytes,2,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty"` }
GenesisState defines the mint module's genesis state.
func DefaultGenesis ¶
func DefaultGenesis() *GenesisState
DefaultGenesisState creates a default GenesisState object
func NewGenesisState ¶
func NewGenesisState(bondDenom string) *GenesisState
NewGenesisState creates a new GenesisState object
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) GetBondDenom ¶
func (m *GenesisState) GetBondDenom() string
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalToSizedBuffer ¶
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (*GenesisState) XXX_DiscardUnknown ¶
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶
func (m *GenesisState) XXX_Unmarshal(b []byte) error
type Minter ¶
type Minter struct { // PreviousBlockTime is the timestamp of the previous block. PreviousBlockTime *time.Time `protobuf:"bytes,1,opt,name=previous_block_time,json=previousBlockTime,proto3,stdtime" json:"previous_block_time,omitempty"` // BondDenom is the denomination of the token that should be minted. BondDenom string `protobuf:"bytes,2,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty"` // init Initialized bool `protobuf:"varint,3,opt,name=initialized,proto3" json:"initialized,omitempty"` }
Minter represents the mint state.
func DefaultMinter ¶
func DefaultMinter() Minter
DefaultMinter returns a Minter object with default values.
func (Minter) CalculateBlockProvision ¶
CalculateBlockProvision returns the total number of coins that should be minted due to time elapsed for the current block.
func (*Minter) Descriptor ¶
func (*Minter) GetBondDenom ¶
func (*Minter) GetInitialized ¶
func (*Minter) GetPreviousBlockTime ¶
func (*Minter) MarshalToSizedBuffer ¶
func (*Minter) ProtoMessage ¶
func (*Minter) ProtoMessage()
func (*Minter) XXX_DiscardUnknown ¶
func (m *Minter) XXX_DiscardUnknown()
func (*Minter) XXX_Marshal ¶
func (*Minter) XXX_Unmarshal ¶
type MsgClient ¶
type MsgClient interface {
Init(ctx context.Context, in *MsgInit, opts ...grpc.CallOption) (*MsgMsgInitResponse, error)
}
MsgClient is the client API for Msg service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgClient ¶
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type MsgInit ¶
type MsgInit struct { // authority is the address that is allowed calling this msg. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` }
func (*MsgInit) Descriptor ¶
func (*MsgInit) GetAuthority ¶
func (*MsgInit) MarshalToSizedBuffer ¶
func (*MsgInit) ProtoMessage ¶
func (*MsgInit) ProtoMessage()
func (*MsgInit) XXX_DiscardUnknown ¶
func (m *MsgInit) XXX_DiscardUnknown()
func (*MsgInit) XXX_Marshal ¶
func (*MsgInit) XXX_Unmarshal ¶
type MsgMsgInitResponse ¶
type MsgMsgInitResponse struct { }
func (*MsgMsgInitResponse) Descriptor ¶
func (*MsgMsgInitResponse) Descriptor() ([]byte, []int)
func (*MsgMsgInitResponse) Marshal ¶
func (m *MsgMsgInitResponse) Marshal() (dAtA []byte, err error)
func (*MsgMsgInitResponse) MarshalTo ¶
func (m *MsgMsgInitResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgMsgInitResponse) MarshalToSizedBuffer ¶
func (m *MsgMsgInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgMsgInitResponse) ProtoMessage ¶
func (*MsgMsgInitResponse) ProtoMessage()
func (*MsgMsgInitResponse) Reset ¶
func (m *MsgMsgInitResponse) Reset()
func (*MsgMsgInitResponse) Size ¶
func (m *MsgMsgInitResponse) Size() (n int)
func (*MsgMsgInitResponse) String ¶
func (m *MsgMsgInitResponse) String() string
func (*MsgMsgInitResponse) Unmarshal ¶
func (m *MsgMsgInitResponse) Unmarshal(dAtA []byte) error
func (*MsgMsgInitResponse) XXX_DiscardUnknown ¶
func (m *MsgMsgInitResponse) XXX_DiscardUnknown()
func (*MsgMsgInitResponse) XXX_Marshal ¶
func (m *MsgMsgInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgMsgInitResponse) XXX_Merge ¶
func (m *MsgMsgInitResponse) XXX_Merge(src proto.Message)
func (*MsgMsgInitResponse) XXX_Size ¶
func (m *MsgMsgInitResponse) XXX_Size() int
func (*MsgMsgInitResponse) XXX_Unmarshal ¶
func (m *MsgMsgInitResponse) XXX_Unmarshal(b []byte) error
type MsgServer ¶
type MsgServer interface {
Init(context.Context, *MsgInit) (*MsgMsgInitResponse, error)
}
MsgServer is the server API for Msg service.
type QueryClient ¶
type QueryClient interface { }
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc grpc1.ClientConn) QueryClient
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) Init ¶
func (*UnimplementedMsgServer) Init(ctx context.Context, req *MsgInit) (*MsgMsgInitResponse, error)
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.