Documentation ¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func GetIncentiveCountKey(incentive Incentive) []byte
- func GetIncentiveKey(incentive Incentive) []byte
- func GetIncentiveKeyWithIndex(incentive Incentive, index uint64) []byte
- func IncentivesToBytes(incentives ...Incentive) ([][]byte, error)
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) GetRegistry() []IncentivesByType
- 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 (gs GenesisState) ValidateBasic() 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 GetAllIncentivesRequest
- func (*GetAllIncentivesRequest) Descriptor() ([]byte, []int)
- func (m *GetAllIncentivesRequest) Marshal() (dAtA []byte, err error)
- func (m *GetAllIncentivesRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *GetAllIncentivesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetAllIncentivesRequest) ProtoMessage()
- func (m *GetAllIncentivesRequest) Reset()
- func (m *GetAllIncentivesRequest) Size() (n int)
- func (m *GetAllIncentivesRequest) String() string
- func (m *GetAllIncentivesRequest) Unmarshal(dAtA []byte) error
- func (m *GetAllIncentivesRequest) XXX_DiscardUnknown()
- func (m *GetAllIncentivesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetAllIncentivesRequest) XXX_Merge(src proto.Message)
- func (m *GetAllIncentivesRequest) XXX_Size() int
- func (m *GetAllIncentivesRequest) XXX_Unmarshal(b []byte) error
- type GetAllIncentivesResponse
- func (*GetAllIncentivesResponse) Descriptor() ([]byte, []int)
- func (m *GetAllIncentivesResponse) GetRegistry() []IncentivesByType
- func (m *GetAllIncentivesResponse) Marshal() (dAtA []byte, err error)
- func (m *GetAllIncentivesResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *GetAllIncentivesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetAllIncentivesResponse) ProtoMessage()
- func (m *GetAllIncentivesResponse) Reset()
- func (m *GetAllIncentivesResponse) Size() (n int)
- func (m *GetAllIncentivesResponse) String() string
- func (m *GetAllIncentivesResponse) Unmarshal(dAtA []byte) error
- func (m *GetAllIncentivesResponse) XXX_DiscardUnknown()
- func (m *GetAllIncentivesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetAllIncentivesResponse) XXX_Merge(src proto.Message)
- func (m *GetAllIncentivesResponse) XXX_Size() int
- func (m *GetAllIncentivesResponse) XXX_Unmarshal(b []byte) error
- type GetIncentivesByTypeRequest
- func (*GetIncentivesByTypeRequest) Descriptor() ([]byte, []int)
- func (m *GetIncentivesByTypeRequest) GetIncentiveType() string
- func (m *GetIncentivesByTypeRequest) Marshal() (dAtA []byte, err error)
- func (m *GetIncentivesByTypeRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *GetIncentivesByTypeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetIncentivesByTypeRequest) ProtoMessage()
- func (m *GetIncentivesByTypeRequest) Reset()
- func (m *GetIncentivesByTypeRequest) Size() (n int)
- func (m *GetIncentivesByTypeRequest) String() string
- func (m *GetIncentivesByTypeRequest) Unmarshal(dAtA []byte) error
- func (m *GetIncentivesByTypeRequest) XXX_DiscardUnknown()
- func (m *GetIncentivesByTypeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetIncentivesByTypeRequest) XXX_Merge(src proto.Message)
- func (m *GetIncentivesByTypeRequest) XXX_Size() int
- func (m *GetIncentivesByTypeRequest) XXX_Unmarshal(b []byte) error
- type GetIncentivesByTypeResponse
- func (*GetIncentivesByTypeResponse) Descriptor() ([]byte, []int)
- func (m *GetIncentivesByTypeResponse) GetEntries() [][]byte
- func (m *GetIncentivesByTypeResponse) Marshal() (dAtA []byte, err error)
- func (m *GetIncentivesByTypeResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *GetIncentivesByTypeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetIncentivesByTypeResponse) ProtoMessage()
- func (m *GetIncentivesByTypeResponse) Reset()
- func (m *GetIncentivesByTypeResponse) Size() (n int)
- func (m *GetIncentivesByTypeResponse) String() string
- func (m *GetIncentivesByTypeResponse) Unmarshal(dAtA []byte) error
- func (m *GetIncentivesByTypeResponse) XXX_DiscardUnknown()
- func (m *GetIncentivesByTypeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetIncentivesByTypeResponse) XXX_Merge(src proto.Message)
- func (m *GetIncentivesByTypeResponse) XXX_Size() int
- func (m *GetIncentivesByTypeResponse) XXX_Unmarshal(b []byte) error
- type Incentive
- type IncentivesByType
- func (*IncentivesByType) Descriptor() ([]byte, []int)
- func (m *IncentivesByType) GetEntries() [][]byte
- func (m *IncentivesByType) GetIncentiveType() string
- func (m *IncentivesByType) Marshal() (dAtA []byte, err error)
- func (m *IncentivesByType) MarshalTo(dAtA []byte) (int, error)
- func (m *IncentivesByType) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*IncentivesByType) ProtoMessage()
- func (m *IncentivesByType) Reset()
- func (m *IncentivesByType) Size() (n int)
- func (m *IncentivesByType) String() string
- func (m *IncentivesByType) Unmarshal(dAtA []byte) error
- func (i IncentivesByType) ValidateBasic() error
- func (m *IncentivesByType) XXX_DiscardUnknown()
- func (m *IncentivesByType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *IncentivesByType) XXX_Merge(src proto.Message)
- func (m *IncentivesByType) XXX_Size() int
- func (m *IncentivesByType) XXX_Unmarshal(b []byte) error
- type QueryClient
- type QueryServer
- type Strategy
- type UnimplementedQueryServer
Constants ¶
const ( // ModuleName is the name of the module. ModuleName = "incentives" // StoreKey is the store key string for incentives. StoreKey = ModuleName )
Variables ¶
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
var ( // KeyPrefixIncentive is the root key prefix under which all incentives are stored. KeyPrefixIncentive = []byte{keyPrefixIncentive} // KeyPrefixCount is the key prefix used to index incentives. KeyPrefixCount = []byte{keyPrefixCount} )
Functions ¶
func GetIncentiveCountKey ¶
GetIncentiveCountKey gets the store key for the incentive count.
func GetIncentiveKey ¶
GetIncentiveKey gets the store key for an incentive.
func GetIncentiveKeyWithIndex ¶
GetIncentiveKeyWithIndex gets the store key for an incentive with an index.
func IncentivesToBytes ¶
IncentivesToBytes converts a slice of Incentives to a slice of bytes.
func RegisterQueryHandler ¶
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 GenesisState ¶
type GenesisState struct { // Registry is a list of incentives by type. The registry defined here // should be a subset of the incentive types defined in the incentive // module (keeper). Registry []IncentivesByType `protobuf:"bytes,1,rep,name=registry,proto3" json:"registry"` }
GenesisState is the genesis-state for the x/incentives module.
func GetGenesisStateFromAppState ¶
func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMessage) GenesisState
GetGenesisStateFromAppState returns x/incentives GenesisState given raw application genesis state.
func NewDefaultGenesisState ¶
func NewDefaultGenesisState() *GenesisState
NewDefaultGenesisState returns a default genesis state for the module.
func NewGenesisState ¶
func NewGenesisState(incentives []IncentivesByType) *GenesisState
NewGenesisState returns a new genesis state for the module.
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) GetRegistry ¶
func (m *GenesisState) GetRegistry() []IncentivesByType
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) ValidateBasic ¶
func (gs GenesisState) ValidateBasic() error
ValidateBasic performs basic validation of the genesis state data returning an error for any failed validation criteria.
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 GetAllIncentivesRequest ¶
type GetAllIncentivesRequest struct { }
GetAllIncentivesRequest is the request type for the Query/GetAllIncentives RPC method.
func (*GetAllIncentivesRequest) Descriptor ¶
func (*GetAllIncentivesRequest) Descriptor() ([]byte, []int)
func (*GetAllIncentivesRequest) Marshal ¶
func (m *GetAllIncentivesRequest) Marshal() (dAtA []byte, err error)
func (*GetAllIncentivesRequest) MarshalTo ¶
func (m *GetAllIncentivesRequest) MarshalTo(dAtA []byte) (int, error)
func (*GetAllIncentivesRequest) MarshalToSizedBuffer ¶
func (m *GetAllIncentivesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetAllIncentivesRequest) ProtoMessage ¶
func (*GetAllIncentivesRequest) ProtoMessage()
func (*GetAllIncentivesRequest) Reset ¶
func (m *GetAllIncentivesRequest) Reset()
func (*GetAllIncentivesRequest) Size ¶
func (m *GetAllIncentivesRequest) Size() (n int)
func (*GetAllIncentivesRequest) String ¶
func (m *GetAllIncentivesRequest) String() string
func (*GetAllIncentivesRequest) Unmarshal ¶
func (m *GetAllIncentivesRequest) Unmarshal(dAtA []byte) error
func (*GetAllIncentivesRequest) XXX_DiscardUnknown ¶
func (m *GetAllIncentivesRequest) XXX_DiscardUnknown()
func (*GetAllIncentivesRequest) XXX_Marshal ¶
func (m *GetAllIncentivesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetAllIncentivesRequest) XXX_Merge ¶
func (m *GetAllIncentivesRequest) XXX_Merge(src proto.Message)
func (*GetAllIncentivesRequest) XXX_Size ¶
func (m *GetAllIncentivesRequest) XXX_Size() int
func (*GetAllIncentivesRequest) XXX_Unmarshal ¶
func (m *GetAllIncentivesRequest) XXX_Unmarshal(b []byte) error
type GetAllIncentivesResponse ¶
type GetAllIncentivesResponse struct { // Registry is the list of all incentives, grouped by type. Registry []IncentivesByType `protobuf:"bytes,1,rep,name=registry,proto3" json:"registry"` }
GetAllIncentivesResponse is the response type for the Query/GetAllIncentives RPC method.
func (*GetAllIncentivesResponse) Descriptor ¶
func (*GetAllIncentivesResponse) Descriptor() ([]byte, []int)
func (*GetAllIncentivesResponse) GetRegistry ¶
func (m *GetAllIncentivesResponse) GetRegistry() []IncentivesByType
func (*GetAllIncentivesResponse) Marshal ¶
func (m *GetAllIncentivesResponse) Marshal() (dAtA []byte, err error)
func (*GetAllIncentivesResponse) MarshalTo ¶
func (m *GetAllIncentivesResponse) MarshalTo(dAtA []byte) (int, error)
func (*GetAllIncentivesResponse) MarshalToSizedBuffer ¶
func (m *GetAllIncentivesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetAllIncentivesResponse) ProtoMessage ¶
func (*GetAllIncentivesResponse) ProtoMessage()
func (*GetAllIncentivesResponse) Reset ¶
func (m *GetAllIncentivesResponse) Reset()
func (*GetAllIncentivesResponse) Size ¶
func (m *GetAllIncentivesResponse) Size() (n int)
func (*GetAllIncentivesResponse) String ¶
func (m *GetAllIncentivesResponse) String() string
func (*GetAllIncentivesResponse) Unmarshal ¶
func (m *GetAllIncentivesResponse) Unmarshal(dAtA []byte) error
func (*GetAllIncentivesResponse) XXX_DiscardUnknown ¶
func (m *GetAllIncentivesResponse) XXX_DiscardUnknown()
func (*GetAllIncentivesResponse) XXX_Marshal ¶
func (m *GetAllIncentivesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetAllIncentivesResponse) XXX_Merge ¶
func (m *GetAllIncentivesResponse) XXX_Merge(src proto.Message)
func (*GetAllIncentivesResponse) XXX_Size ¶
func (m *GetAllIncentivesResponse) XXX_Size() int
func (*GetAllIncentivesResponse) XXX_Unmarshal ¶
func (m *GetAllIncentivesResponse) XXX_Unmarshal(b []byte) error
type GetIncentivesByTypeRequest ¶
type GetIncentivesByTypeRequest struct { // IncentiveType is the incentive type i.e. (BadPriceIncentiveType, GoodPriceIncentiveType). IncentiveType string `protobuf:"bytes,1,opt,name=incentive_type,json=incentiveType,proto3" json:"incentive_type,omitempty"` }
GetIncentivesByTypeRequest is the request type for the Query/GetIncentivesByType RPC method.
func (*GetIncentivesByTypeRequest) Descriptor ¶
func (*GetIncentivesByTypeRequest) Descriptor() ([]byte, []int)
func (*GetIncentivesByTypeRequest) GetIncentiveType ¶
func (m *GetIncentivesByTypeRequest) GetIncentiveType() string
func (*GetIncentivesByTypeRequest) Marshal ¶
func (m *GetIncentivesByTypeRequest) Marshal() (dAtA []byte, err error)
func (*GetIncentivesByTypeRequest) MarshalTo ¶
func (m *GetIncentivesByTypeRequest) MarshalTo(dAtA []byte) (int, error)
func (*GetIncentivesByTypeRequest) MarshalToSizedBuffer ¶
func (m *GetIncentivesByTypeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetIncentivesByTypeRequest) ProtoMessage ¶
func (*GetIncentivesByTypeRequest) ProtoMessage()
func (*GetIncentivesByTypeRequest) Reset ¶
func (m *GetIncentivesByTypeRequest) Reset()
func (*GetIncentivesByTypeRequest) Size ¶
func (m *GetIncentivesByTypeRequest) Size() (n int)
func (*GetIncentivesByTypeRequest) String ¶
func (m *GetIncentivesByTypeRequest) String() string
func (*GetIncentivesByTypeRequest) Unmarshal ¶
func (m *GetIncentivesByTypeRequest) Unmarshal(dAtA []byte) error
func (*GetIncentivesByTypeRequest) XXX_DiscardUnknown ¶
func (m *GetIncentivesByTypeRequest) XXX_DiscardUnknown()
func (*GetIncentivesByTypeRequest) XXX_Marshal ¶
func (m *GetIncentivesByTypeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetIncentivesByTypeRequest) XXX_Merge ¶
func (m *GetIncentivesByTypeRequest) XXX_Merge(src proto.Message)
func (*GetIncentivesByTypeRequest) XXX_Size ¶
func (m *GetIncentivesByTypeRequest) XXX_Size() int
func (*GetIncentivesByTypeRequest) XXX_Unmarshal ¶
func (m *GetIncentivesByTypeRequest) XXX_Unmarshal(b []byte) error
type GetIncentivesByTypeResponse ¶
type GetIncentivesByTypeResponse struct { // Entries is the list of incentives of the given type. Entries [][]byte `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` }
GetIncentivesByTypeResponse is the response type for the Query/GetIncentivesByType RPC method.
func (*GetIncentivesByTypeResponse) Descriptor ¶
func (*GetIncentivesByTypeResponse) Descriptor() ([]byte, []int)
func (*GetIncentivesByTypeResponse) GetEntries ¶
func (m *GetIncentivesByTypeResponse) GetEntries() [][]byte
func (*GetIncentivesByTypeResponse) Marshal ¶
func (m *GetIncentivesByTypeResponse) Marshal() (dAtA []byte, err error)
func (*GetIncentivesByTypeResponse) MarshalTo ¶
func (m *GetIncentivesByTypeResponse) MarshalTo(dAtA []byte) (int, error)
func (*GetIncentivesByTypeResponse) MarshalToSizedBuffer ¶
func (m *GetIncentivesByTypeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetIncentivesByTypeResponse) ProtoMessage ¶
func (*GetIncentivesByTypeResponse) ProtoMessage()
func (*GetIncentivesByTypeResponse) Reset ¶
func (m *GetIncentivesByTypeResponse) Reset()
func (*GetIncentivesByTypeResponse) Size ¶
func (m *GetIncentivesByTypeResponse) Size() (n int)
func (*GetIncentivesByTypeResponse) String ¶
func (m *GetIncentivesByTypeResponse) String() string
func (*GetIncentivesByTypeResponse) Unmarshal ¶
func (m *GetIncentivesByTypeResponse) Unmarshal(dAtA []byte) error
func (*GetIncentivesByTypeResponse) XXX_DiscardUnknown ¶
func (m *GetIncentivesByTypeResponse) XXX_DiscardUnknown()
func (*GetIncentivesByTypeResponse) XXX_Marshal ¶
func (m *GetIncentivesByTypeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetIncentivesByTypeResponse) XXX_Merge ¶
func (m *GetIncentivesByTypeResponse) XXX_Merge(src proto.Message)
func (*GetIncentivesByTypeResponse) XXX_Size ¶
func (m *GetIncentivesByTypeResponse) XXX_Size() int
func (*GetIncentivesByTypeResponse) XXX_Unmarshal ¶
func (m *GetIncentivesByTypeResponse) XXX_Unmarshal(b []byte) error
type Incentive ¶
type Incentive interface { proto.Message // ValidateBasic does a stateless check on the incentive. ValidateBasic() error // Type returns the incentive type. Type() string // Marshall the incentive into bytes. Marshal() ([]byte, error) // Unmarshal the incentive from bytes. Unmarshal([]byte) error // Copy the incentive. Copy() Incentive }
Incentive is the interface contract that must be fulfilled to allow for slashing/rewarding arbitrary events. To add a new incentive, implement this interface along with the corresponding strategy callback function. Each incentive type must be registered with its corresponding strategy function in the keeper.
func SortIncentivesByType ¶
SortIncentivesByType sorts a slice of Incentives by their type.
func SortIncentivesStrategiesMap ¶
SortIncentivesStrategiesMap sorts a map of IncentivesByType by their type.
type IncentivesByType ¶
type IncentivesByType struct { // IncentiveType is the incentive type i.e. (BadPriceIncentiveType, GoodPriceIncentiveType). IncentiveType string `protobuf:"bytes,1,opt,name=incentive_type,json=incentiveType,proto3" json:"incentive_type,omitempty"` // Entries is a list of incentive bytes. Entries [][]byte `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` }
IncentivesByType encapsulates a list of incentives by type. Each of the entries here must correspond to the same incentive type defined here.
func NewIncentives ¶
func NewIncentives(name string, incentives [][]byte) IncentivesByType
NewIncentives returns a new Incentives instance.
func (*IncentivesByType) Descriptor ¶
func (*IncentivesByType) Descriptor() ([]byte, []int)
func (*IncentivesByType) GetEntries ¶
func (m *IncentivesByType) GetEntries() [][]byte
func (*IncentivesByType) GetIncentiveType ¶
func (m *IncentivesByType) GetIncentiveType() string
func (*IncentivesByType) Marshal ¶
func (m *IncentivesByType) Marshal() (dAtA []byte, err error)
func (*IncentivesByType) MarshalToSizedBuffer ¶
func (m *IncentivesByType) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*IncentivesByType) ProtoMessage ¶
func (*IncentivesByType) ProtoMessage()
func (*IncentivesByType) Reset ¶
func (m *IncentivesByType) Reset()
func (*IncentivesByType) Size ¶
func (m *IncentivesByType) Size() (n int)
func (*IncentivesByType) String ¶
func (m *IncentivesByType) String() string
func (*IncentivesByType) Unmarshal ¶
func (m *IncentivesByType) Unmarshal(dAtA []byte) error
func (IncentivesByType) ValidateBasic ¶
func (i IncentivesByType) ValidateBasic() error
ValidateBasic performs basic validation of the Incentives data returning an error for any failed validation criteria.
func (*IncentivesByType) XXX_DiscardUnknown ¶
func (m *IncentivesByType) XXX_DiscardUnknown()
func (*IncentivesByType) XXX_Marshal ¶
func (m *IncentivesByType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*IncentivesByType) XXX_Merge ¶
func (m *IncentivesByType) XXX_Merge(src proto.Message)
func (*IncentivesByType) XXX_Size ¶
func (m *IncentivesByType) XXX_Size() int
func (*IncentivesByType) XXX_Unmarshal ¶
func (m *IncentivesByType) XXX_Unmarshal(b []byte) error
type QueryClient ¶
type QueryClient interface { // GetIncentivesByType returns all incentives of a given type. If the type is // not registered with the module, an error is returned. GetIncentivesByType(ctx context.Context, in *GetIncentivesByTypeRequest, opts ...grpc.CallOption) (*GetIncentivesByTypeResponse, error) // GetAllIncentives returns all incentives. GetAllIncentives(ctx context.Context, in *GetAllIncentivesRequest, opts ...grpc.CallOption) (*GetAllIncentivesResponse, 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 QueryServer ¶
type QueryServer interface { // GetIncentivesByType returns all incentives of a given type. If the type is // not registered with the module, an error is returned. GetIncentivesByType(context.Context, *GetIncentivesByTypeRequest) (*GetIncentivesByTypeResponse, error) // GetAllIncentives returns all incentives. GetAllIncentives(context.Context, *GetAllIncentivesRequest) (*GetAllIncentivesResponse, error) }
QueryServer is the server API for Query service.
type Strategy ¶
Strategy defines the callback function that will be executed by the incentives module with the given context and incentive. The strategy is responsible for the following:
- If the strategy desires to update the incentive, it must return the updated incentive.
- If the strategy desires to delete the incentive, it must return nil.
- If the strategy desires to leave the incentive unchanged, it must return the same incentive.
- Applying any desired state transitions such as minting rewards, or slashing.
For an example implementation, please see the examples/ directory.
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) GetAllIncentives ¶
func (*UnimplementedQueryServer) GetAllIncentives(ctx context.Context, req *GetAllIncentivesRequest) (*GetAllIncentivesResponse, error)
func (*UnimplementedQueryServer) GetIncentivesByType ¶
func (*UnimplementedQueryServer) GetIncentivesByType(ctx context.Context, req *GetIncentivesByTypeRequest) (*GetIncentivesByTypeResponse, error)