types

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeIncentivesReleased = "incentives_released"
	AttributeKeySchedules       = "schedules"
)
View Source
const (
	// ModuleName is the incentives module's name
	ModuleName = "incentives"

	// StoreKey is the incentives module's store key
	StoreKey = ModuleName

	// RouterKey is the incentives module's message route
	RouterKey = ModuleName

	// QuerierRoute is the incentives module's querier route
	QuerierRoute = ModuleName
)

Variables

View Source
var (
	ErrFailedRefundToCommunityPool     = errors.Register(ModuleName, 2, "failed to return funds to community pool")
	ErrFailedWithdrawFromCommunityPool = errors.Register(ModuleName, 3, "failed to withdraw funds from community pool")
	ErrInvalidProposalAmount           = errors.Register(ModuleName, 4, "invalid incentives proposal amount")
	ErrInvalidProposalAuthority        = errors.Register(ModuleName, 5, "invalid incentives proposal authority")
	ErrInvalidProposalIds              = errors.Register(ModuleName, 6, "invalid incentives proposal ids")
	ErrInvalidProposalStartEndTimes    = errors.Register(ModuleName, 7, "invalid incentives proposal start and end times")
)
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 (
	KeyNextScheduleID = []byte{0x00} // key for the the next schedule id
	KeySchedule       = []byte{0x01} // key for the incentives schedules
)

Keys for the incentives module substore Items are stored with the following key: values

- 0x00: uint64 - 0x01<uint64_bytes>: Schedule

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthStore        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowStore          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupStore = 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 GetScheduleKey

func GetScheduleKey(id uint64) []byte

GetScheduleKey creates the key for the incentives schedule of the given id

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type AccountKeeper

type AccountKeeper interface {
	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI
}

AccountKeeper defines the expected interface for the auth module keeper

type BankKeeper

type BankKeeper interface {
	GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	MintCoins(ctx sdk.Context, name string, amt sdk.Coins) error
	SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error
}

BankKeeper defines the expected interface for the bank module keeper

type DistrKeeper

type DistrKeeper interface {
	AllocateTokensToValidator(ctx sdk.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins)
	DistributeFromFeePool(ctx sdk.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) error
	FundCommunityPool(ctx sdk.Context, amount sdk.Coins, senderAddr sdk.AccAddress) error
}

DistrKeeper defines the expected interface for the distribution module keeper

type GenesisState

type GenesisState struct {
	// NextScheduleId is the id for the next incentives schedule to be created
	NextScheduleId uint64 `` /* 130-byte string literal not displayed */
	// Schedules is an array of active incentives schedules
	Schedules []Schedule `protobuf:"bytes,2,rep,name=schedules,proto3" json:"schedules"`
}

GenesisState defines the incentives module's genesis state

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns the default genesis state of the incentives module

func (*GenesisState) Descriptor

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

func (*GenesisState) GetNextScheduleId

func (m *GenesisState) GetNextScheduleId() uint64

func (*GenesisState) GetSchedules

func (m *GenesisState) GetSchedules() []Schedule

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

func (gs GenesisState) Validate() error

ValidateGenesis validates the given instance of the incentives module's genesis state.

for each schedule,

- the id must be smaller than the next schedule id

- the id must not be duplicate

- the end time must be after the start time

- the total amount must be non-zero

- the released amount must be equal or smaller than the total amount

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 MsgClient

type MsgClient interface {
	// CreateSchedule is a governance operation for creating a new incentives
	// schedule.
	CreateSchedule(ctx context.Context, in *MsgCreateSchedule, opts ...grpc.CallOption) (*MsgCreateScheduleResponse, error)
	// TerminateSchedule is a governance operation for terminating one or more
	// existing incentives schedules.
	TerminateSchedules(ctx context.Context, in *MsgTerminateSchedules, opts ...grpc.CallOption) (*MsgTerminateSchedulesResponse, 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 MsgCreateSchedule

type MsgCreateSchedule struct {
	// Authority is the account executing the safety fund spend.
	// It should be the gov module account.
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// StartTime is the timestamp at which this incentives schedule shall begin.
	StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"`
	// EndTime is the timestamp at which this incentives schedule shall finish.
	EndTime time.Time `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"`
	// Amount is the total amount of coins that shall be released to stakers
	// throughout the span of this incentives schedule.
	Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
}

MsgCreateSchedule defines the message for creating a new incentives schedule.

This message is typically executed via a governance proposal with the gov module being the executing authority.

func (*MsgCreateSchedule) Descriptor

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

func (*MsgCreateSchedule) GetAmount

func (*MsgCreateSchedule) GetAuthority

func (m *MsgCreateSchedule) GetAuthority() string

func (*MsgCreateSchedule) GetEndTime

func (m *MsgCreateSchedule) GetEndTime() time.Time

func (*MsgCreateSchedule) GetSigners

func (m *MsgCreateSchedule) GetSigners() []sdk.AccAddress

GetSigners returns the expected signers for the message

func (*MsgCreateSchedule) GetStartTime

func (m *MsgCreateSchedule) GetStartTime() time.Time

func (*MsgCreateSchedule) Marshal

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

func (*MsgCreateSchedule) MarshalTo

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

func (*MsgCreateSchedule) MarshalToSizedBuffer

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

func (*MsgCreateSchedule) ProtoMessage

func (*MsgCreateSchedule) ProtoMessage()

func (*MsgCreateSchedule) Reset

func (m *MsgCreateSchedule) Reset()

func (*MsgCreateSchedule) Size

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

func (*MsgCreateSchedule) String

func (m *MsgCreateSchedule) String() string

func (*MsgCreateSchedule) Unmarshal

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

func (*MsgCreateSchedule) ValidateBasic

func (m *MsgCreateSchedule) ValidateBasic() error

ValidateBasic does a sanity check on the provided data

func (*MsgCreateSchedule) XXX_DiscardUnknown

func (m *MsgCreateSchedule) XXX_DiscardUnknown()

func (*MsgCreateSchedule) XXX_Marshal

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

func (*MsgCreateSchedule) XXX_Merge

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

func (*MsgCreateSchedule) XXX_Size

func (m *MsgCreateSchedule) XXX_Size() int

func (*MsgCreateSchedule) XXX_Unmarshal

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

type MsgCreateScheduleResponse

type MsgCreateScheduleResponse struct {
}

MsgCreateScheduleResponse defines the response to executing a MsgCreateSchedule message.

func (*MsgCreateScheduleResponse) Descriptor

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

func (*MsgCreateScheduleResponse) Marshal

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

func (*MsgCreateScheduleResponse) MarshalTo

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

func (*MsgCreateScheduleResponse) MarshalToSizedBuffer

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

func (*MsgCreateScheduleResponse) ProtoMessage

func (*MsgCreateScheduleResponse) ProtoMessage()

func (*MsgCreateScheduleResponse) Reset

func (m *MsgCreateScheduleResponse) Reset()

func (*MsgCreateScheduleResponse) Size

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

func (*MsgCreateScheduleResponse) String

func (m *MsgCreateScheduleResponse) String() string

func (*MsgCreateScheduleResponse) Unmarshal

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

func (*MsgCreateScheduleResponse) XXX_DiscardUnknown

func (m *MsgCreateScheduleResponse) XXX_DiscardUnknown()

func (*MsgCreateScheduleResponse) XXX_Marshal

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

func (*MsgCreateScheduleResponse) XXX_Merge

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

func (*MsgCreateScheduleResponse) XXX_Size

func (m *MsgCreateScheduleResponse) XXX_Size() int

func (*MsgCreateScheduleResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// CreateSchedule is a governance operation for creating a new incentives
	// schedule.
	CreateSchedule(context.Context, *MsgCreateSchedule) (*MsgCreateScheduleResponse, error)
	// TerminateSchedule is a governance operation for terminating one or more
	// existing incentives schedules.
	TerminateSchedules(context.Context, *MsgTerminateSchedules) (*MsgTerminateSchedulesResponse, error)
}

MsgServer is the server API for Msg service.

type MsgTerminateSchedules

type MsgTerminateSchedules struct {
	// Authority is the account executing the safety fund spend.
	// It should be the gov module account.
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// Ids is the array of identifiers of the incentives schedules which are to be
	// terminated.
	Ids []uint64 `protobuf:"varint,2,rep,packed,name=ids,proto3" json:"ids,omitempty"`
}

MsgTerminateSchedules defines the message for terminating one or more existing incentives schedules.

This message is typically executed via a governance proposal with the gov module being the executing authority.

func (*MsgTerminateSchedules) Descriptor

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

func (*MsgTerminateSchedules) GetAuthority

func (m *MsgTerminateSchedules) GetAuthority() string

func (*MsgTerminateSchedules) GetIds

func (m *MsgTerminateSchedules) GetIds() []uint64

func (*MsgTerminateSchedules) GetSigners

func (m *MsgTerminateSchedules) GetSigners() []sdk.AccAddress

GetSigners returns the expected signers for the message

func (*MsgTerminateSchedules) Marshal

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

func (*MsgTerminateSchedules) MarshalTo

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

func (*MsgTerminateSchedules) MarshalToSizedBuffer

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

func (*MsgTerminateSchedules) ProtoMessage

func (*MsgTerminateSchedules) ProtoMessage()

func (*MsgTerminateSchedules) Reset

func (m *MsgTerminateSchedules) Reset()

func (*MsgTerminateSchedules) Size

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

func (*MsgTerminateSchedules) String

func (m *MsgTerminateSchedules) String() string

func (*MsgTerminateSchedules) Unmarshal

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

func (*MsgTerminateSchedules) ValidateBasic

func (m *MsgTerminateSchedules) ValidateBasic() error

ValidateBasic does a sanity check on the provided data

func (*MsgTerminateSchedules) XXX_DiscardUnknown

func (m *MsgTerminateSchedules) XXX_DiscardUnknown()

func (*MsgTerminateSchedules) XXX_Marshal

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

func (*MsgTerminateSchedules) XXX_Merge

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

func (*MsgTerminateSchedules) XXX_Size

func (m *MsgTerminateSchedules) XXX_Size() int

func (*MsgTerminateSchedules) XXX_Unmarshal

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

type MsgTerminateSchedulesResponse

type MsgTerminateSchedulesResponse struct {
	// RefundedAmount is the unreleased incentives that were refunded to the
	// community pool.
	RefundedAmount github_com_cosmos_cosmos_sdk_types.Coins `` /* 147-byte string literal not displayed */
}

MsgTerminateSchedulesResponse defines the response to executing a MsgTerminateSchedules message.

func (*MsgTerminateSchedulesResponse) Descriptor

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

func (*MsgTerminateSchedulesResponse) GetRefundedAmount

func (*MsgTerminateSchedulesResponse) Marshal

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

func (*MsgTerminateSchedulesResponse) MarshalTo

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

func (*MsgTerminateSchedulesResponse) MarshalToSizedBuffer

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

func (*MsgTerminateSchedulesResponse) ProtoMessage

func (*MsgTerminateSchedulesResponse) ProtoMessage()

func (*MsgTerminateSchedulesResponse) Reset

func (m *MsgTerminateSchedulesResponse) Reset()

func (*MsgTerminateSchedulesResponse) Size

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

func (*MsgTerminateSchedulesResponse) String

func (*MsgTerminateSchedulesResponse) Unmarshal

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

func (*MsgTerminateSchedulesResponse) XXX_DiscardUnknown

func (m *MsgTerminateSchedulesResponse) XXX_DiscardUnknown()

func (*MsgTerminateSchedulesResponse) XXX_Marshal

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

func (*MsgTerminateSchedulesResponse) XXX_Merge

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

func (*MsgTerminateSchedulesResponse) XXX_Size

func (m *MsgTerminateSchedulesResponse) XXX_Size() int

func (*MsgTerminateSchedulesResponse) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
	// Schedule queries an incentives schedule by identifier
	Schedule(ctx context.Context, in *QueryScheduleRequest, opts ...grpc.CallOption) (*QueryScheduleResponse, error)
	// Schedules queries all incentives schedules
	Schedules(ctx context.Context, in *QuerySchedulesRequest, opts ...grpc.CallOption) (*QuerySchedulesResponse, error)
}

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 QueryScheduleRequest

type QueryScheduleRequest struct {
	// ID is the identifier of the incentives schedule to be queried
	Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}

QueryScheduleRequest is the request type for the Query/Schedule RPC method

func (*QueryScheduleRequest) Descriptor

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

func (*QueryScheduleRequest) Marshal

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

func (*QueryScheduleRequest) MarshalTo

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

func (*QueryScheduleRequest) MarshalToSizedBuffer

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

func (*QueryScheduleRequest) ProtoMessage

func (*QueryScheduleRequest) ProtoMessage()

func (*QueryScheduleRequest) Reset

func (m *QueryScheduleRequest) Reset()

func (*QueryScheduleRequest) Size

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

func (*QueryScheduleRequest) String

func (m *QueryScheduleRequest) String() string

func (*QueryScheduleRequest) Unmarshal

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

func (*QueryScheduleRequest) XXX_DiscardUnknown

func (m *QueryScheduleRequest) XXX_DiscardUnknown()

func (*QueryScheduleRequest) XXX_Marshal

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

func (*QueryScheduleRequest) XXX_Merge

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

func (*QueryScheduleRequest) XXX_Size

func (m *QueryScheduleRequest) XXX_Size() int

func (*QueryScheduleRequest) XXX_Unmarshal

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

type QueryScheduleResponse

type QueryScheduleResponse struct {
	// Schedule is the parameters of the incentives schedule
	Schedule Schedule `protobuf:"bytes,1,opt,name=schedule,proto3" json:"schedule"`
}

QueryScheduleResponse is the response type for the Query/Schedule RPC method

func (*QueryScheduleResponse) Descriptor

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

func (*QueryScheduleResponse) GetSchedule

func (m *QueryScheduleResponse) GetSchedule() Schedule

func (*QueryScheduleResponse) Marshal

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

func (*QueryScheduleResponse) MarshalTo

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

func (*QueryScheduleResponse) MarshalToSizedBuffer

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

func (*QueryScheduleResponse) ProtoMessage

func (*QueryScheduleResponse) ProtoMessage()

func (*QueryScheduleResponse) Reset

func (m *QueryScheduleResponse) Reset()

func (*QueryScheduleResponse) Size

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

func (*QueryScheduleResponse) String

func (m *QueryScheduleResponse) String() string

func (*QueryScheduleResponse) Unmarshal

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

func (*QueryScheduleResponse) XXX_DiscardUnknown

func (m *QueryScheduleResponse) XXX_DiscardUnknown()

func (*QueryScheduleResponse) XXX_Marshal

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

func (*QueryScheduleResponse) XXX_Merge

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

func (*QueryScheduleResponse) XXX_Size

func (m *QueryScheduleResponse) XXX_Size() int

func (*QueryScheduleResponse) XXX_Unmarshal

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

type QuerySchedulesRequest

type QuerySchedulesRequest struct {
	// Pagination defines an optional pagination for the request
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QuerySchedulesRequest is the request type for the Query/Schedules RPC method

func (*QuerySchedulesRequest) Descriptor

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

func (*QuerySchedulesRequest) Marshal

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

func (*QuerySchedulesRequest) MarshalTo

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

func (*QuerySchedulesRequest) MarshalToSizedBuffer

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

func (*QuerySchedulesRequest) ProtoMessage

func (*QuerySchedulesRequest) ProtoMessage()

func (*QuerySchedulesRequest) Reset

func (m *QuerySchedulesRequest) Reset()

func (*QuerySchedulesRequest) Size

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

func (*QuerySchedulesRequest) String

func (m *QuerySchedulesRequest) String() string

func (*QuerySchedulesRequest) Unmarshal

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

func (*QuerySchedulesRequest) XXX_DiscardUnknown

func (m *QuerySchedulesRequest) XXX_DiscardUnknown()

func (*QuerySchedulesRequest) XXX_Marshal

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

func (*QuerySchedulesRequest) XXX_Merge

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

func (*QuerySchedulesRequest) XXX_Size

func (m *QuerySchedulesRequest) XXX_Size() int

func (*QuerySchedulesRequest) XXX_Unmarshal

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

type QuerySchedulesResponse

type QuerySchedulesResponse struct {
	// Schedule is the parameters of the incentives schedule
	Schedules []Schedule `protobuf:"bytes,1,rep,name=schedules,proto3" json:"schedules"`
	// Pagination defines the pagination in the response
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryScheduleResponse is the response type for the Query/Schedules RPC method

func (*QuerySchedulesResponse) Descriptor

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

func (*QuerySchedulesResponse) GetPagination

func (m *QuerySchedulesResponse) GetPagination() *query.PageResponse

func (*QuerySchedulesResponse) GetSchedules

func (m *QuerySchedulesResponse) GetSchedules() []Schedule

func (*QuerySchedulesResponse) Marshal

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

func (*QuerySchedulesResponse) MarshalTo

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

func (*QuerySchedulesResponse) MarshalToSizedBuffer

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

func (*QuerySchedulesResponse) ProtoMessage

func (*QuerySchedulesResponse) ProtoMessage()

func (*QuerySchedulesResponse) Reset

func (m *QuerySchedulesResponse) Reset()

func (*QuerySchedulesResponse) Size

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

func (*QuerySchedulesResponse) String

func (m *QuerySchedulesResponse) String() string

func (*QuerySchedulesResponse) Unmarshal

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

func (*QuerySchedulesResponse) XXX_DiscardUnknown

func (m *QuerySchedulesResponse) XXX_DiscardUnknown()

func (*QuerySchedulesResponse) XXX_Marshal

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

func (*QuerySchedulesResponse) XXX_Merge

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

func (*QuerySchedulesResponse) XXX_Size

func (m *QuerySchedulesResponse) XXX_Size() int

func (*QuerySchedulesResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// Schedule queries an incentives schedule by identifier
	Schedule(context.Context, *QueryScheduleRequest) (*QueryScheduleResponse, error)
	// Schedules queries all incentives schedules
	Schedules(context.Context, *QuerySchedulesRequest) (*QuerySchedulesResponse, error)
}

QueryServer is the server API for Query service.

type Schedule

type Schedule struct {
	// Id is the identifier of this incentives schedule
	Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// StartTime is the UNIX timestamp of which this incentives schedule shall begin
	StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"`
	// EndTime is the UNIX timestamp of which this incentives schedule shall finish
	EndTime time.Time `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"`
	// TotalAmount is the total amount of coins that shall be released to stakers
	// throughout the span of this incentives schedule
	TotalAmount github_com_cosmos_cosmos_sdk_types.Coins `` /* 158-byte string literal not displayed */
	// ReleasedAmount is the amount of coins that have already been released to
	// the stakers as part of this incentives schedule
	ReleasedAmount github_com_cosmos_cosmos_sdk_types.Coins `` /* 170-byte string literal not displayed */
}

Schedule defines the parameters of an incentives releasing schedule

func (*Schedule) Descriptor

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

func (Schedule) GetBlockReward

func (s Schedule) GetBlockReward(currentTime time.Time) sdk.Coins

GetBlockReward calculates the reward to be releaed given a time:

  • if the current time is before the start time, no coin is to be released
  • if the current time is after the end time, all coins are to be released
  • if the current time is betweeen the start and end times, coins are to be released linearly

func (*Schedule) GetEndTime

func (m *Schedule) GetEndTime() time.Time

func (*Schedule) GetId

func (m *Schedule) GetId() uint64

func (*Schedule) GetReleasedAmount

func (m *Schedule) GetReleasedAmount() github_com_cosmos_cosmos_sdk_types.Coins

func (*Schedule) GetStartTime

func (m *Schedule) GetStartTime() time.Time

func (*Schedule) GetTotalAmount

func (*Schedule) Marshal

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

func (*Schedule) MarshalTo

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

func (*Schedule) MarshalToSizedBuffer

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

func (*Schedule) ProtoMessage

func (*Schedule) ProtoMessage()

func (*Schedule) Reset

func (m *Schedule) Reset()

func (*Schedule) Size

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

func (*Schedule) String

func (m *Schedule) String() string

func (*Schedule) Unmarshal

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

func (*Schedule) XXX_DiscardUnknown

func (m *Schedule) XXX_DiscardUnknown()

func (*Schedule) XXX_Marshal

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

func (*Schedule) XXX_Merge

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

func (*Schedule) XXX_Size

func (m *Schedule) XXX_Size() int

func (*Schedule) XXX_Unmarshal

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

type StakingKeeper

type StakingKeeper interface {
	ValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) stakingtypes.ValidatorI
}

StakingKeeper defines the expected interface for the staking module keeper

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) CreateSchedule

func (*UnimplementedMsgServer) TerminateSchedules

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Schedule

func (*UnimplementedQueryServer) Schedules

Jump to

Keyboard shortcuts

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