types

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	DailyMintRate     = 146940000 // loya per day
	DefaultBondDenom  = "loya"
	MillisecondsInDay = 24 * 60 * 60 * 1000
)

Variables

View Source
var (
	ErrInvalidSigner      = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message")
	ErrAlreadyInitialized = sdkerrors.Register(ModuleName, 1101, "already initialized")
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthMint        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMint          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMint = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterInterfaces

func RegisterInterfaces(mint cdctypes.InterfaceRegistry)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

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

func (m *GenesisState) MarshalTo(dAtA []byte) (int, 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 NewMinter

func NewMinter(bondDenom string) Minter

NewMinter returns a new Minter object.

func (Minter) CalculateBlockProvision

func (m Minter) CalculateBlockProvision(current, previous time.Time) (sdk.Coin, error)

CalculateBlockProvision returns the total number of coins that should be minted due to time elapsed for the current block.

func (*Minter) Descriptor

func (*Minter) Descriptor() ([]byte, []int)

func (*Minter) GetBondDenom

func (m *Minter) GetBondDenom() string

func (*Minter) GetInitialized

func (m *Minter) GetInitialized() bool

func (*Minter) GetPreviousBlockTime

func (m *Minter) GetPreviousBlockTime() *time.Time

func (*Minter) Marshal

func (m *Minter) Marshal() (dAtA []byte, err error)

func (*Minter) MarshalTo

func (m *Minter) MarshalTo(dAtA []byte) (int, error)

func (*Minter) MarshalToSizedBuffer

func (m *Minter) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Minter) ProtoMessage

func (*Minter) ProtoMessage()

func (*Minter) Reset

func (m *Minter) Reset()

func (*Minter) Size

func (m *Minter) Size() (n int)

func (*Minter) String

func (m *Minter) String() string

func (*Minter) Unmarshal

func (m *Minter) Unmarshal(dAtA []byte) error

func (Minter) Validate

func (m Minter) Validate() error

Validate returns an error if the minter is invalid.

func (*Minter) XXX_DiscardUnknown

func (m *Minter) XXX_DiscardUnknown()

func (*Minter) XXX_Marshal

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

func (*Minter) XXX_Merge

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

func (*Minter) XXX_Size

func (m *Minter) XXX_Size() int

func (*Minter) XXX_Unmarshal

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

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

func (*MsgInit) GetAuthority

func (m *MsgInit) GetAuthority() string

func (*MsgInit) Marshal

func (m *MsgInit) Marshal() (dAtA []byte, err error)

func (*MsgInit) MarshalTo

func (m *MsgInit) MarshalTo(dAtA []byte) (int, error)

func (*MsgInit) MarshalToSizedBuffer

func (m *MsgInit) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgInit) ProtoMessage

func (*MsgInit) ProtoMessage()

func (*MsgInit) Reset

func (m *MsgInit) Reset()

func (*MsgInit) Size

func (m *MsgInit) Size() (n int)

func (*MsgInit) String

func (m *MsgInit) String() string

func (*MsgInit) Unmarshal

func (m *MsgInit) Unmarshal(dAtA []byte) error

func (*MsgInit) XXX_DiscardUnknown

func (m *MsgInit) XXX_DiscardUnknown()

func (*MsgInit) XXX_Marshal

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

func (*MsgInit) XXX_Merge

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

func (*MsgInit) XXX_Size

func (m *MsgInit) XXX_Size() int

func (*MsgInit) XXX_Unmarshal

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

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 QueryServer

type QueryServer interface {
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) Init

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

Jump to

Keyboard shortcuts

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