types

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// ModuleName defines the module name
	ModuleName = "tokenomics"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_tokenomics"
)
View Source
const (
	// RelayMiningDifficultyKeyPrefix is the prefix to retrieve all RelayMiningDifficulty
	RelayMiningDifficultyKeyPrefix = "RelayMiningDifficulty/value/"
)

Variables

View Source
var (
	ErrTokenomicsInvalidSigner                  = sdkerrors.Register(ModuleName, 1100, "the provided authority address does not match the on-chain governance address")
	ErrTokenomicsAddressInvalid                 = sdkerrors.Register(ModuleName, 1101, "the provided authority address is not a valid bech32 address")
	ErrTokenomicsClaimNil                       = sdkerrors.Register(ModuleName, 1102, "provided claim is nil")
	ErrTokenomicsSessionHeaderNil               = sdkerrors.Register(ModuleName, 1103, "provided claim's session header is nil")
	ErrTokenomicsSessionHeaderInvalid           = sdkerrors.Register(ModuleName, 1104, "provided claim's session header is invalid")
	ErrTokenomicsSupplierModuleSendFailed       = sdkerrors.Register(ModuleName, 1105, "failed to send uPOKT to supplier module account")
	ErrTokenomicsSupplierOperatorAddressInvalid = sdkerrors.Register(ModuleName, 1106, "the supplier operator address in the claim is not a valid bech32 address")
	ErrTokenomicsSupplierNotFound               = sdkerrors.Register(ModuleName, 1107, "supplier not found")
	ErrTokenomicsApplicationNotFound            = sdkerrors.Register(ModuleName, 1108, "application not found")
	ErrTokenomicsApplicationModuleBurn          = sdkerrors.Register(ModuleName, 1109, "failed to burn uPOKT from application module account")
	ErrTokenomicsApplicationAddressInvalid      = sdkerrors.Register(ModuleName, 1110, "the application address in the claim is not a valid bech32 address")
	ErrTokenomicsParamsInvalid                  = sdkerrors.Register(ModuleName, 1111, "provided params are invalid")
	ErrTokenomicsRootHashInvalid                = sdkerrors.Register(ModuleName, 1112, "the root hash in the claim is invalid")
	ErrTokenomicsApplicationNewStakeInvalid     = sdkerrors.Register(ModuleName, 1113, "application stake cannot be reduced to a -ve amount")
	ErrTokenomicsParamNameInvalid               = sdkerrors.Register(ModuleName, 1114, "the provided param name is invalid")
	ErrTokenomicsParamInvalid                   = sdkerrors.Register(ModuleName, 1115, "the provided param is invalid")
	ErrTokenomicsUnmarshalInvalid               = sdkerrors.Register(ModuleName, 1116, "failed to unmarshal the provided bytes")
	ErrTokenomicsDuplicateIndex                 = sdkerrors.Register(ModuleName, 1117, "cannot have a duplicate index")
	ErrTokenomicsMissingRelayMiningDifficulty   = sdkerrors.Register(ModuleName, 1118, "missing relay mining difficulty")
	ErrTokenomicsApplicationOverserviced        = sdkerrors.Register(ModuleName, 1119, "application was overserviced")
	ErrTokenomicsServiceNotFound                = sdkerrors.Register(ModuleName, 1120, "service not found")
	ErrTokenomicsModuleMintFailed               = sdkerrors.Register(ModuleName, 1121, "failed to mint uPOKT to tokenomics module account")
	ErrTokenomicsSendingMintRewards             = sdkerrors.Register(ModuleName, 1122, "failed to send minted rewards")
	ErrTokenomicsSupplierModuleMintFailed       = sdkerrors.Register(ModuleName, 1123, "failed to mint uPOKT to supplier module account")
	ErrTokenomicsSupplierOwnerAddressInvalid    = sdkerrors.Register(ModuleName, 1124, "the supplier owner address in the claim is not a valid bech32 address")
	ErrTokenomicsSupplierRevShareFailed         = sdkerrors.Register(ModuleName, 1125, "failed to send rev share to supplier shareholders")
)

x/tokenomics module sentinel errors

View Source
var (
	ErrInvalidLengthEvent        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEvent          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group")
)
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 (
	KeyComputeUnitsToTokensMultiplier            = []byte("ComputeUnitsToTokensMultiplier")
	ParamComputeUnitsToTokensMultiplier          = "compute_units_to_tokens_multiplier"
	DefaultComputeUnitsToTokensMultiplier uint64 = 42 // TODO_MAINNET: Determine the default value.
)
View Source
var (
	ErrInvalidLengthParams        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowParams          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group")
)
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 (
	ErrInvalidLengthRelayMiningDifficulty        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRelayMiningDifficulty          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupRelayMiningDifficulty = 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")
)
View Source
var ClaimExpirationReason_name = map[int32]string{
	0: "EXPIRATION_REASON_UNSPECIFIED",
	1: "PROOF_MISSING",
	2: "PROOF_INVALID",
}
View Source
var ClaimExpirationReason_value = map[string]int32{
	"EXPIRATION_REASON_UNSPECIFIED": 0,
	"PROOF_MISSING":                 1,
	"PROOF_INVALID":                 2,
}
View Source
var ParamsKey = []byte("p_tokenomics")

Functions

func KeyPrefix

func KeyPrefix(p string) []byte

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable the param key table for launch module

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func RegisterMsgServer added in v0.0.3

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler added in v0.0.3

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 added in v0.0.3

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 added in v0.0.3

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 added in v0.0.3

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 added in v0.0.3

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func RelayMiningDifficultyKey added in v0.0.3

func RelayMiningDifficultyKey(
	serviceId string,
) []byte

RelayMiningDifficultyKey returns the store key to retrieve a RelayMiningDifficulty from the index fields

func ValidateComputeUnitsToTokensMultiplier added in v0.0.2

func ValidateComputeUnitsToTokensMultiplier(v interface{}) error

ValidateComputeUnitsToTokensMultiplier validates the ComputeUnitsToTokensMultiplier governance parameter. NB: The argument is an interface type to satisfy the ParamSetPair function signature.

Types

type AccountKeeper

type AccountKeeper interface {
	// Only used for testing & simulation
	GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
	SetAccount(context.Context, types.AccountI)
	// Return a new account with the next account number and the specified address. Does not save the new account to the store.
	NewAccountWithAddress(context.Context, sdk.AccAddress) sdk.AccountI
	// Fetch the next account number, and increment the internal counter.
	NextAccountNumber(context.Context) uint64
}

AccountKeeper defines the expected interface for the Account module.

type ApplicationKeeper

type ApplicationKeeper interface {
	GetApplication(ctx context.Context, appAddr string) (app apptypes.Application, found bool)
	SetApplication(ctx context.Context, app apptypes.Application)
	GetAllApplications(ctx context.Context) []apptypes.Application
}

type BankKeeper

type BankKeeper interface {
	MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error
	BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error
	// We use the bankkeeper SendXXX instead of DelegateXX methods
	// because their purpose is to "escrow" funds on behalf of an account rather
	// than "delegate" funds from one account to another which is more closely
	// linked to staking.
	SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	Balance(context.Context, *banktypes.QueryBalanceRequest) (*banktypes.QueryBalanceResponse, error)
}

BankKeeper defines the expected interface for the Bank module.

type ClaimExpirationReason added in v0.0.5

type ClaimExpirationReason int32
const (
	ClaimExpirationReason_EXPIRATION_REASON_UNSPECIFIED ClaimExpirationReason = 0
	ClaimExpirationReason_PROOF_MISSING                 ClaimExpirationReason = 1
	ClaimExpirationReason_PROOF_INVALID                 ClaimExpirationReason = 2
)

func (ClaimExpirationReason) EnumDescriptor added in v0.0.5

func (ClaimExpirationReason) EnumDescriptor() ([]byte, []int)

func (ClaimExpirationReason) String added in v0.0.5

func (x ClaimExpirationReason) String() string

type EventApplicationOverserviced added in v0.0.4

type EventApplicationOverserviced struct {
	ApplicationAddr string       `protobuf:"bytes,1,opt,name=application_addr,json=applicationAddr,proto3" json:"application_addr,omitempty"`
	ExpectedBurn    *types1.Coin `protobuf:"bytes,2,opt,name=expected_burn,json=expectedBurn,proto3" json:"expected_burn,omitempty"`
	EffectiveBurn   *types1.Coin `protobuf:"bytes,3,opt,name=effective_burn,json=effectiveBurn,proto3" json:"effective_burn,omitempty"`
}

EventApplicationOverserviced is emitted when an application has less stake than the expected burn.

func (*EventApplicationOverserviced) Descriptor added in v0.0.4

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

func (*EventApplicationOverserviced) GetApplicationAddr added in v0.0.4

func (m *EventApplicationOverserviced) GetApplicationAddr() string

func (*EventApplicationOverserviced) GetEffectiveBurn added in v0.0.4

func (m *EventApplicationOverserviced) GetEffectiveBurn() *types1.Coin

func (*EventApplicationOverserviced) GetExpectedBurn added in v0.0.4

func (m *EventApplicationOverserviced) GetExpectedBurn() *types1.Coin

func (*EventApplicationOverserviced) Marshal added in v0.0.4

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

func (*EventApplicationOverserviced) MarshalTo added in v0.0.4

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

func (*EventApplicationOverserviced) MarshalToSizedBuffer added in v0.0.4

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

func (*EventApplicationOverserviced) ProtoMessage added in v0.0.4

func (*EventApplicationOverserviced) ProtoMessage()

func (*EventApplicationOverserviced) Reset added in v0.0.4

func (m *EventApplicationOverserviced) Reset()

func (*EventApplicationOverserviced) Size added in v0.0.4

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

func (*EventApplicationOverserviced) String added in v0.0.4

func (*EventApplicationOverserviced) Unmarshal added in v0.0.4

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

func (*EventApplicationOverserviced) XXX_DiscardUnknown added in v0.0.4

func (m *EventApplicationOverserviced) XXX_DiscardUnknown()

func (*EventApplicationOverserviced) XXX_Marshal added in v0.0.4

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

func (*EventApplicationOverserviced) XXX_Merge added in v0.0.4

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

func (*EventApplicationOverserviced) XXX_Size added in v0.0.4

func (m *EventApplicationOverserviced) XXX_Size() int

func (*EventApplicationOverserviced) XXX_Unmarshal added in v0.0.4

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

type EventClaimExpired added in v0.0.3

type EventClaimExpired struct {
	Claim *types.Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"`
	// TODO_MAINNET: Shold we include the proof here too?
	NumRelays        uint64                `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"`
	NumComputeUnits  uint64                `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"`
	ExpirationReason ClaimExpirationReason `` /* 147-byte string literal not displayed */
}

EventClaimExpired is an event emitted during settlement whenever a claim requiring an on-chain proof doesn't have one. The claim cannot be settled, leading to that work never being rewarded.

func (*EventClaimExpired) Descriptor added in v0.0.3

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

func (*EventClaimExpired) GetClaim added in v0.0.3

func (m *EventClaimExpired) GetClaim() *types.Claim

func (*EventClaimExpired) GetExpirationReason added in v0.0.5

func (m *EventClaimExpired) GetExpirationReason() ClaimExpirationReason

func (*EventClaimExpired) GetNumComputeUnits added in v0.0.3

func (m *EventClaimExpired) GetNumComputeUnits() uint64

func (*EventClaimExpired) GetNumRelays added in v0.0.3

func (m *EventClaimExpired) GetNumRelays() uint64

func (*EventClaimExpired) Marshal added in v0.0.3

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

func (*EventClaimExpired) MarshalTo added in v0.0.3

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

func (*EventClaimExpired) MarshalToSizedBuffer added in v0.0.3

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

func (*EventClaimExpired) ProtoMessage added in v0.0.3

func (*EventClaimExpired) ProtoMessage()

func (*EventClaimExpired) Reset added in v0.0.3

func (m *EventClaimExpired) Reset()

func (*EventClaimExpired) Size added in v0.0.3

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

func (*EventClaimExpired) String added in v0.0.3

func (m *EventClaimExpired) String() string

func (*EventClaimExpired) Unmarshal added in v0.0.3

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

func (*EventClaimExpired) XXX_DiscardUnknown added in v0.0.3

func (m *EventClaimExpired) XXX_DiscardUnknown()

func (*EventClaimExpired) XXX_Marshal added in v0.0.3

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

func (*EventClaimExpired) XXX_Merge added in v0.0.3

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

func (*EventClaimExpired) XXX_Size added in v0.0.3

func (m *EventClaimExpired) XXX_Size() int

func (*EventClaimExpired) XXX_Unmarshal added in v0.0.3

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

type EventClaimSettled added in v0.0.3

type EventClaimSettled struct {
	Claim            *types.Claim                 `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"`
	NumRelays        uint64                       `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"`
	NumComputeUnits  uint64                       `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"`
	ProofRequirement types.ProofRequirementReason `` /* 143-byte string literal not displayed */
}

EventClaimSettled is an event emitted whenever a claim is settled. The proof_required determines whether the claim requires a proof that has been submitted or not

func (*EventClaimSettled) Descriptor added in v0.0.3

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

func (*EventClaimSettled) GetClaim added in v0.0.3

func (m *EventClaimSettled) GetClaim() *types.Claim

func (*EventClaimSettled) GetNumComputeUnits added in v0.0.3

func (m *EventClaimSettled) GetNumComputeUnits() uint64

func (*EventClaimSettled) GetNumRelays added in v0.0.3

func (m *EventClaimSettled) GetNumRelays() uint64

func (*EventClaimSettled) GetProofRequirement added in v0.0.3

func (m *EventClaimSettled) GetProofRequirement() types.ProofRequirementReason

func (*EventClaimSettled) Marshal added in v0.0.3

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

func (*EventClaimSettled) MarshalTo added in v0.0.3

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

func (*EventClaimSettled) MarshalToSizedBuffer added in v0.0.3

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

func (*EventClaimSettled) ProtoMessage added in v0.0.3

func (*EventClaimSettled) ProtoMessage()

func (*EventClaimSettled) Reset added in v0.0.3

func (m *EventClaimSettled) Reset()

func (*EventClaimSettled) Size added in v0.0.3

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

func (*EventClaimSettled) String added in v0.0.3

func (m *EventClaimSettled) String() string

func (*EventClaimSettled) Unmarshal added in v0.0.3

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

func (*EventClaimSettled) XXX_DiscardUnknown added in v0.0.3

func (m *EventClaimSettled) XXX_DiscardUnknown()

func (*EventClaimSettled) XXX_Marshal added in v0.0.3

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

func (*EventClaimSettled) XXX_Merge added in v0.0.3

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

func (*EventClaimSettled) XXX_Size added in v0.0.3

func (m *EventClaimSettled) XXX_Size() int

func (*EventClaimSettled) XXX_Unmarshal added in v0.0.3

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

type EventRelayMiningDifficultyUpdated added in v0.0.3

type EventRelayMiningDifficultyUpdated struct {
	ServiceId                string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	PrevTargetHashHexEncoded string `` /* 139-byte string literal not displayed */
	NewTargetHashHexEncoded  string `` /* 136-byte string literal not displayed */
	PrevNumRelaysEma         uint64 `protobuf:"varint,4,opt,name=prev_num_relays_ema,json=prevNumRelaysEma,proto3" json:"prev_num_relays_ema,omitempty"`
	NewNumRelaysEma          uint64 `protobuf:"varint,5,opt,name=new_num_relays_ema,json=newNumRelaysEma,proto3" json:"new_num_relays_ema,omitempty"`
}

EventRelayMiningDifficultyUpdated is an event emitted whenever the relay mining difficulty is updated for a given service.

func (*EventRelayMiningDifficultyUpdated) Descriptor added in v0.0.3

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

func (*EventRelayMiningDifficultyUpdated) GetNewNumRelaysEma added in v0.0.3

func (m *EventRelayMiningDifficultyUpdated) GetNewNumRelaysEma() uint64

func (*EventRelayMiningDifficultyUpdated) GetNewTargetHashHexEncoded added in v0.0.3

func (m *EventRelayMiningDifficultyUpdated) GetNewTargetHashHexEncoded() string

func (*EventRelayMiningDifficultyUpdated) GetPrevNumRelaysEma added in v0.0.3

func (m *EventRelayMiningDifficultyUpdated) GetPrevNumRelaysEma() uint64

func (*EventRelayMiningDifficultyUpdated) GetPrevTargetHashHexEncoded added in v0.0.3

func (m *EventRelayMiningDifficultyUpdated) GetPrevTargetHashHexEncoded() string

func (*EventRelayMiningDifficultyUpdated) GetServiceId added in v0.0.3

func (m *EventRelayMiningDifficultyUpdated) GetServiceId() string

func (*EventRelayMiningDifficultyUpdated) Marshal added in v0.0.3

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

func (*EventRelayMiningDifficultyUpdated) MarshalTo added in v0.0.3

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

func (*EventRelayMiningDifficultyUpdated) MarshalToSizedBuffer added in v0.0.3

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

func (*EventRelayMiningDifficultyUpdated) ProtoMessage added in v0.0.3

func (*EventRelayMiningDifficultyUpdated) ProtoMessage()

func (*EventRelayMiningDifficultyUpdated) Reset added in v0.0.3

func (*EventRelayMiningDifficultyUpdated) Size added in v0.0.3

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

func (*EventRelayMiningDifficultyUpdated) String added in v0.0.3

func (*EventRelayMiningDifficultyUpdated) Unmarshal added in v0.0.3

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

func (*EventRelayMiningDifficultyUpdated) XXX_DiscardUnknown added in v0.0.3

func (m *EventRelayMiningDifficultyUpdated) XXX_DiscardUnknown()

func (*EventRelayMiningDifficultyUpdated) XXX_Marshal added in v0.0.3

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

func (*EventRelayMiningDifficultyUpdated) XXX_Merge added in v0.0.3

func (*EventRelayMiningDifficultyUpdated) XXX_Size added in v0.0.3

func (m *EventRelayMiningDifficultyUpdated) XXX_Size() int

func (*EventRelayMiningDifficultyUpdated) XXX_Unmarshal added in v0.0.3

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

type GenesisState added in v0.0.3

type GenesisState struct {
	// params defines all the parameters of the module.
	Params                    Params                  `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	RelayMiningDifficultyList []RelayMiningDifficulty `protobuf:"bytes,2,rep,name=relayMiningDifficultyList,proto3" json:"relayMiningDifficultyList"`
}

GenesisState defines the tokenomics module's genesis state.

func DefaultGenesis added in v0.0.3

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default genesis state

func (*GenesisState) Descriptor added in v0.0.3

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

func (*GenesisState) GetParams added in v0.0.3

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetRelayMiningDifficultyList added in v0.0.3

func (m *GenesisState) GetRelayMiningDifficultyList() []RelayMiningDifficulty

func (*GenesisState) Marshal added in v0.0.3

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

func (*GenesisState) MarshalTo added in v0.0.3

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

func (*GenesisState) MarshalToSizedBuffer added in v0.0.3

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

func (*GenesisState) ProtoMessage added in v0.0.3

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset added in v0.0.3

func (m *GenesisState) Reset()

func (*GenesisState) Size added in v0.0.3

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

func (*GenesisState) String added in v0.0.3

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal added in v0.0.3

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

func (GenesisState) Validate added in v0.0.3

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

func (*GenesisState) XXX_DiscardUnknown added in v0.0.3

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal added in v0.0.3

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

func (*GenesisState) XXX_Merge added in v0.0.3

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

func (*GenesisState) XXX_Size added in v0.0.3

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal added in v0.0.3

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

type MsgClient added in v0.0.3

type MsgClient interface {
	// UpdateParams defines a (governance) operation for updating the module
	// parameters. The authority defaults to the x/gov module account.
	UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
	UpdateParam(ctx context.Context, in *MsgUpdateParam, opts ...grpc.CallOption) (*MsgUpdateParamResponse, 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 added in v0.0.3

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer added in v0.0.3

type MsgServer interface {
	// UpdateParams defines a (governance) operation for updating the module
	// parameters. The authority defaults to the x/gov module account.
	UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
	UpdateParam(context.Context, *MsgUpdateParam) (*MsgUpdateParamResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUpdateParam added in v0.0.3

type MsgUpdateParam struct {
	// authority is the address that controls the module (defaults to x/gov unless overwritten).
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// The (name, as_type) tuple must match the corresponding name and type as
	// specified in the `Params` message in `proof/params.proto.`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Types that are valid to be assigned to AsType:
	//
	//	*MsgUpdateParam_AsString
	//	*MsgUpdateParam_AsInt64
	//	*MsgUpdateParam_AsBytes
	AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"`
}

MsgUpdateParam is the Msg/UpdateParam request type to update a single param.

func NewMsgUpdateParam added in v0.0.3

func NewMsgUpdateParam(authority string, name string, value any) (*MsgUpdateParam, error)

func (*MsgUpdateParam) Descriptor added in v0.0.3

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

func (*MsgUpdateParam) GetAsBytes added in v0.0.3

func (m *MsgUpdateParam) GetAsBytes() []byte

func (*MsgUpdateParam) GetAsInt64 added in v0.0.3

func (m *MsgUpdateParam) GetAsInt64() int64

func (*MsgUpdateParam) GetAsString added in v0.0.3

func (m *MsgUpdateParam) GetAsString() string

func (*MsgUpdateParam) GetAsType added in v0.0.3

func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType

func (*MsgUpdateParam) GetAuthority added in v0.0.3

func (m *MsgUpdateParam) GetAuthority() string

func (*MsgUpdateParam) GetName added in v0.0.3

func (m *MsgUpdateParam) GetName() string

func (*MsgUpdateParam) Marshal added in v0.0.3

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

func (*MsgUpdateParam) MarshalTo added in v0.0.3

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

func (*MsgUpdateParam) MarshalToSizedBuffer added in v0.0.3

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

func (*MsgUpdateParam) ProtoMessage added in v0.0.3

func (*MsgUpdateParam) ProtoMessage()

func (*MsgUpdateParam) Reset added in v0.0.3

func (m *MsgUpdateParam) Reset()

func (*MsgUpdateParam) Size added in v0.0.3

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

func (*MsgUpdateParam) String added in v0.0.3

func (m *MsgUpdateParam) String() string

func (*MsgUpdateParam) Unmarshal added in v0.0.3

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

func (*MsgUpdateParam) ValidateBasic added in v0.0.3

func (msg *MsgUpdateParam) ValidateBasic() error

ValidateBasic performs a basic validation of the MsgUpdateParam fields. It ensures the parameter name is supported and the parameter type matches the expected type for a given parameter name.

func (*MsgUpdateParam) XXX_DiscardUnknown added in v0.0.3

func (m *MsgUpdateParam) XXX_DiscardUnknown()

func (*MsgUpdateParam) XXX_Marshal added in v0.0.3

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

func (*MsgUpdateParam) XXX_Merge added in v0.0.3

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

func (*MsgUpdateParam) XXX_OneofWrappers added in v0.0.3

func (*MsgUpdateParam) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*MsgUpdateParam) XXX_Size added in v0.0.3

func (m *MsgUpdateParam) XXX_Size() int

func (*MsgUpdateParam) XXX_Unmarshal added in v0.0.3

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

type MsgUpdateParamResponse added in v0.0.3

type MsgUpdateParamResponse struct {
	Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
}

MsgUpdateParamResponse defines the response structure for executing a MsgUpdateParam message after a single param update.

func (*MsgUpdateParamResponse) Descriptor added in v0.0.3

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

func (*MsgUpdateParamResponse) GetParams added in v0.0.3

func (m *MsgUpdateParamResponse) GetParams() *Params

func (*MsgUpdateParamResponse) Marshal added in v0.0.3

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

func (*MsgUpdateParamResponse) MarshalTo added in v0.0.3

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

func (*MsgUpdateParamResponse) MarshalToSizedBuffer added in v0.0.3

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

func (*MsgUpdateParamResponse) ProtoMessage added in v0.0.3

func (*MsgUpdateParamResponse) ProtoMessage()

func (*MsgUpdateParamResponse) Reset added in v0.0.3

func (m *MsgUpdateParamResponse) Reset()

func (*MsgUpdateParamResponse) Size added in v0.0.3

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

func (*MsgUpdateParamResponse) String added in v0.0.3

func (m *MsgUpdateParamResponse) String() string

func (*MsgUpdateParamResponse) Unmarshal added in v0.0.3

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

func (*MsgUpdateParamResponse) XXX_DiscardUnknown added in v0.0.3

func (m *MsgUpdateParamResponse) XXX_DiscardUnknown()

func (*MsgUpdateParamResponse) XXX_Marshal added in v0.0.3

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

func (*MsgUpdateParamResponse) XXX_Merge added in v0.0.3

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

func (*MsgUpdateParamResponse) XXX_Size added in v0.0.3

func (m *MsgUpdateParamResponse) XXX_Size() int

func (*MsgUpdateParamResponse) XXX_Unmarshal added in v0.0.3

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

type MsgUpdateParam_AsBytes added in v0.0.3

type MsgUpdateParam_AsBytes struct {
	AsBytes []byte `protobuf:"bytes,7,opt,name=as_bytes,json=asBytes,proto3,oneof" json:"as_bytes"`
}

func (*MsgUpdateParam_AsBytes) MarshalTo added in v0.0.3

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

func (*MsgUpdateParam_AsBytes) MarshalToSizedBuffer added in v0.0.3

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

func (*MsgUpdateParam_AsBytes) Size added in v0.0.3

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

type MsgUpdateParam_AsInt64 added in v0.0.3

type MsgUpdateParam_AsInt64 struct {
	AsInt64 int64 `protobuf:"varint,6,opt,name=as_int64,json=asInt64,proto3,oneof" json:"as_int64"`
}

func (*MsgUpdateParam_AsInt64) MarshalTo added in v0.0.3

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

func (*MsgUpdateParam_AsInt64) MarshalToSizedBuffer added in v0.0.3

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

func (*MsgUpdateParam_AsInt64) Size added in v0.0.3

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

type MsgUpdateParam_AsString added in v0.0.3

type MsgUpdateParam_AsString struct {
	AsString string `protobuf:"bytes,3,opt,name=as_string,json=asString,proto3,oneof" json:"as_string"`
}

func (*MsgUpdateParam_AsString) MarshalTo added in v0.0.3

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

func (*MsgUpdateParam_AsString) MarshalToSizedBuffer added in v0.0.3

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

func (*MsgUpdateParam_AsString) Size added in v0.0.3

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

type MsgUpdateParams added in v0.0.3

type MsgUpdateParams struct {
	// authority is the address that controls the module (defaults to x/gov unless overwritten).
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// params defines the x/tokenomics parameters to update.
	// NOTE: All parameters must be supplied.
	Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

MsgUpdateParams is the Msg/UpdateParams request type to update all params at once.

func NewMsgUpdateParams added in v0.0.3

func NewMsgUpdateParams(
	authority string,
	computeUnitsToTokensMultiplier uint64,
) *MsgUpdateParams

func (*MsgUpdateParams) Descriptor added in v0.0.3

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

func (*MsgUpdateParams) GetAuthority added in v0.0.3

func (m *MsgUpdateParams) GetAuthority() string

func (*MsgUpdateParams) GetParams added in v0.0.3

func (m *MsgUpdateParams) GetParams() Params

func (*MsgUpdateParams) Marshal added in v0.0.3

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

func (*MsgUpdateParams) MarshalTo added in v0.0.3

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

func (*MsgUpdateParams) MarshalToSizedBuffer added in v0.0.3

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

func (*MsgUpdateParams) ProtoMessage added in v0.0.3

func (*MsgUpdateParams) ProtoMessage()

func (*MsgUpdateParams) Reset added in v0.0.3

func (m *MsgUpdateParams) Reset()

func (*MsgUpdateParams) Size added in v0.0.3

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

func (*MsgUpdateParams) String added in v0.0.3

func (m *MsgUpdateParams) String() string

func (*MsgUpdateParams) Unmarshal added in v0.0.3

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

func (*MsgUpdateParams) ValidateBasic added in v0.0.3

func (msg *MsgUpdateParams) ValidateBasic() error

ValidateBasic does a sanity check on the provided data.

func (*MsgUpdateParams) XXX_DiscardUnknown added in v0.0.3

func (m *MsgUpdateParams) XXX_DiscardUnknown()

func (*MsgUpdateParams) XXX_Marshal added in v0.0.3

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

func (*MsgUpdateParams) XXX_Merge added in v0.0.3

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

func (*MsgUpdateParams) XXX_Size added in v0.0.3

func (m *MsgUpdateParams) XXX_Size() int

func (*MsgUpdateParams) XXX_Unmarshal added in v0.0.3

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

type MsgUpdateParamsResponse added in v0.0.3

type MsgUpdateParamsResponse struct {
}

MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message.

func (*MsgUpdateParamsResponse) Descriptor added in v0.0.3

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

func (*MsgUpdateParamsResponse) Marshal added in v0.0.3

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

func (*MsgUpdateParamsResponse) MarshalTo added in v0.0.3

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

func (*MsgUpdateParamsResponse) MarshalToSizedBuffer added in v0.0.3

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

func (*MsgUpdateParamsResponse) ProtoMessage added in v0.0.3

func (*MsgUpdateParamsResponse) ProtoMessage()

func (*MsgUpdateParamsResponse) Reset added in v0.0.3

func (m *MsgUpdateParamsResponse) Reset()

func (*MsgUpdateParamsResponse) Size added in v0.0.3

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

func (*MsgUpdateParamsResponse) String added in v0.0.3

func (m *MsgUpdateParamsResponse) String() string

func (*MsgUpdateParamsResponse) Unmarshal added in v0.0.3

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

func (*MsgUpdateParamsResponse) XXX_DiscardUnknown added in v0.0.3

func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown()

func (*MsgUpdateParamsResponse) XXX_Marshal added in v0.0.3

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

func (*MsgUpdateParamsResponse) XXX_Merge added in v0.0.3

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

func (*MsgUpdateParamsResponse) XXX_Size added in v0.0.3

func (m *MsgUpdateParamsResponse) XXX_Size() int

func (*MsgUpdateParamsResponse) XXX_Unmarshal added in v0.0.3

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

type Params added in v0.0.3

type Params struct {
	// The amount of upokt that a compute unit should translate to when settling a session.
	ComputeUnitsToTokensMultiplier uint64 `` /* 190-byte string literal not displayed */
}

Params defines the parameters for the tokenomics module.

func DefaultParams added in v0.0.3

func DefaultParams() Params

DefaultParams returns a default set of parameters

func NewParams added in v0.0.3

func NewParams(computeUnitsToTokensMultiplier uint64) Params

NewParams creates a new Params instance

func (*Params) Descriptor added in v0.0.3

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

func (*Params) Equal added in v0.0.3

func (this *Params) Equal(that interface{}) bool

func (*Params) GetComputeUnitsToTokensMultiplier added in v0.0.3

func (m *Params) GetComputeUnitsToTokensMultiplier() uint64

func (*Params) Marshal added in v0.0.3

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

func (*Params) MarshalTo added in v0.0.3

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

func (*Params) MarshalToSizedBuffer added in v0.0.3

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

func (*Params) ParamSetPairs added in v0.0.3

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs get the params.ParamSet

func (*Params) ProtoMessage added in v0.0.3

func (*Params) ProtoMessage()

func (*Params) Reset added in v0.0.3

func (m *Params) Reset()

func (*Params) Size added in v0.0.3

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

func (*Params) String added in v0.0.3

func (m *Params) String() string

func (*Params) Unmarshal added in v0.0.3

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

func (*Params) ValidateBasic added in v0.0.3

func (params *Params) ValidateBasic() error

ValidateBasic does a sanity check on the provided params.

func (*Params) XXX_DiscardUnknown added in v0.0.3

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal added in v0.0.3

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

func (*Params) XXX_Merge added in v0.0.3

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

func (*Params) XXX_Size added in v0.0.3

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal added in v0.0.3

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

type PendingClaimsResult added in v0.0.4

type PendingClaimsResult struct {
	NumClaims           uint64
	NumComputeUnits     uint64
	NumRelays           uint64
	RelaysPerServiceMap map[string]uint64
}

PendingClaimsResult encapsulates the result of settling pending claims. It is intended to be used to represent settled and expired results as unique instances.

func NewClaimSettlementResult added in v0.0.4

func NewClaimSettlementResult() PendingClaimsResult

NewClaimSettlementResult creates a new PendingClaimsResult.

type ProofKeeper

type ProofKeeper interface {
	GetAllClaims(ctx context.Context) []prooftypes.Claim
	RemoveClaim(ctx context.Context, sessionId, supplierOperatorAddr string)
	GetProof(ctx context.Context, sessionId, supplierOperatorAddr string) (proof prooftypes.Proof, isProofFound bool)
	RemoveProof(ctx context.Context, sessionId, supplierOperatorAddr string)

	AllClaims(ctx context.Context, req *prooftypes.QueryAllClaimsRequest) (*prooftypes.QueryAllClaimsResponse, error)
	EnsureValidProof(ctx context.Context, proof *prooftypes.Proof) error

	// Only used for testing & simulation
	GetAllProofs(ctx context.Context) []prooftypes.Proof
	UpsertClaim(ctx context.Context, claim prooftypes.Claim)
	UpsertProof(ctx context.Context, claim prooftypes.Proof)
	GetParams(ctx context.Context) prooftypes.Params
	SetParams(ctx context.Context, params prooftypes.Params) error
}

type QueryAllRelayMiningDifficultyRequest added in v0.0.3

type QueryAllRelayMiningDifficultyRequest struct {
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

func (*QueryAllRelayMiningDifficultyRequest) Descriptor added in v0.0.3

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

func (*QueryAllRelayMiningDifficultyRequest) GetPagination added in v0.0.3

func (*QueryAllRelayMiningDifficultyRequest) Marshal added in v0.0.3

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

func (*QueryAllRelayMiningDifficultyRequest) MarshalTo added in v0.0.3

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

func (*QueryAllRelayMiningDifficultyRequest) MarshalToSizedBuffer added in v0.0.3

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

func (*QueryAllRelayMiningDifficultyRequest) ProtoMessage added in v0.0.3

func (*QueryAllRelayMiningDifficultyRequest) ProtoMessage()

func (*QueryAllRelayMiningDifficultyRequest) Reset added in v0.0.3

func (*QueryAllRelayMiningDifficultyRequest) Size added in v0.0.3

func (*QueryAllRelayMiningDifficultyRequest) String added in v0.0.3

func (*QueryAllRelayMiningDifficultyRequest) Unmarshal added in v0.0.3

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

func (*QueryAllRelayMiningDifficultyRequest) XXX_DiscardUnknown added in v0.0.3

func (m *QueryAllRelayMiningDifficultyRequest) XXX_DiscardUnknown()

func (*QueryAllRelayMiningDifficultyRequest) XXX_Marshal added in v0.0.3

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

func (*QueryAllRelayMiningDifficultyRequest) XXX_Merge added in v0.0.3

func (*QueryAllRelayMiningDifficultyRequest) XXX_Size added in v0.0.3

func (*QueryAllRelayMiningDifficultyRequest) XXX_Unmarshal added in v0.0.3

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

type QueryAllRelayMiningDifficultyResponse added in v0.0.3

type QueryAllRelayMiningDifficultyResponse struct {
	RelayMiningDifficulty []RelayMiningDifficulty `protobuf:"bytes,1,rep,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty"`
	Pagination            *query.PageResponse     `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

func (*QueryAllRelayMiningDifficultyResponse) Descriptor added in v0.0.3

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

func (*QueryAllRelayMiningDifficultyResponse) GetPagination added in v0.0.3

func (*QueryAllRelayMiningDifficultyResponse) GetRelayMiningDifficulty added in v0.0.3

func (m *QueryAllRelayMiningDifficultyResponse) GetRelayMiningDifficulty() []RelayMiningDifficulty

func (*QueryAllRelayMiningDifficultyResponse) Marshal added in v0.0.3

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

func (*QueryAllRelayMiningDifficultyResponse) MarshalTo added in v0.0.3

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

func (*QueryAllRelayMiningDifficultyResponse) MarshalToSizedBuffer added in v0.0.3

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

func (*QueryAllRelayMiningDifficultyResponse) ProtoMessage added in v0.0.3

func (*QueryAllRelayMiningDifficultyResponse) ProtoMessage()

func (*QueryAllRelayMiningDifficultyResponse) Reset added in v0.0.3

func (*QueryAllRelayMiningDifficultyResponse) Size added in v0.0.3

func (*QueryAllRelayMiningDifficultyResponse) String added in v0.0.3

func (*QueryAllRelayMiningDifficultyResponse) Unmarshal added in v0.0.3

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

func (*QueryAllRelayMiningDifficultyResponse) XXX_DiscardUnknown added in v0.0.3

func (m *QueryAllRelayMiningDifficultyResponse) XXX_DiscardUnknown()

func (*QueryAllRelayMiningDifficultyResponse) XXX_Marshal added in v0.0.3

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

func (*QueryAllRelayMiningDifficultyResponse) XXX_Merge added in v0.0.3

func (*QueryAllRelayMiningDifficultyResponse) XXX_Size added in v0.0.3

func (*QueryAllRelayMiningDifficultyResponse) XXX_Unmarshal added in v0.0.3

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

type QueryClient added in v0.0.3

type QueryClient interface {
	// Parameters queries the parameters of the module.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// Queries a list of RelayMiningDifficulty items.
	RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error)
	RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, 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 added in v0.0.3

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryGetRelayMiningDifficultyRequest added in v0.0.3

type QueryGetRelayMiningDifficultyRequest struct {
	ServiceId string `protobuf:"bytes,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"`
}

func (*QueryGetRelayMiningDifficultyRequest) Descriptor added in v0.0.3

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

func (*QueryGetRelayMiningDifficultyRequest) GetServiceId added in v0.0.3

func (m *QueryGetRelayMiningDifficultyRequest) GetServiceId() string

func (*QueryGetRelayMiningDifficultyRequest) Marshal added in v0.0.3

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

func (*QueryGetRelayMiningDifficultyRequest) MarshalTo added in v0.0.3

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

func (*QueryGetRelayMiningDifficultyRequest) MarshalToSizedBuffer added in v0.0.3

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

func (*QueryGetRelayMiningDifficultyRequest) ProtoMessage added in v0.0.3

func (*QueryGetRelayMiningDifficultyRequest) ProtoMessage()

func (*QueryGetRelayMiningDifficultyRequest) Reset added in v0.0.3

func (*QueryGetRelayMiningDifficultyRequest) Size added in v0.0.3

func (*QueryGetRelayMiningDifficultyRequest) String added in v0.0.3

func (*QueryGetRelayMiningDifficultyRequest) Unmarshal added in v0.0.3

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

func (*QueryGetRelayMiningDifficultyRequest) XXX_DiscardUnknown added in v0.0.3

func (m *QueryGetRelayMiningDifficultyRequest) XXX_DiscardUnknown()

func (*QueryGetRelayMiningDifficultyRequest) XXX_Marshal added in v0.0.3

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

func (*QueryGetRelayMiningDifficultyRequest) XXX_Merge added in v0.0.3

func (*QueryGetRelayMiningDifficultyRequest) XXX_Size added in v0.0.3

func (*QueryGetRelayMiningDifficultyRequest) XXX_Unmarshal added in v0.0.3

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

type QueryGetRelayMiningDifficultyResponse added in v0.0.3

type QueryGetRelayMiningDifficultyResponse struct {
	RelayMiningDifficulty RelayMiningDifficulty `protobuf:"bytes,1,opt,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty"`
}

func (*QueryGetRelayMiningDifficultyResponse) Descriptor added in v0.0.3

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

func (*QueryGetRelayMiningDifficultyResponse) GetRelayMiningDifficulty added in v0.0.3

func (m *QueryGetRelayMiningDifficultyResponse) GetRelayMiningDifficulty() RelayMiningDifficulty

func (*QueryGetRelayMiningDifficultyResponse) Marshal added in v0.0.3

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

func (*QueryGetRelayMiningDifficultyResponse) MarshalTo added in v0.0.3

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

func (*QueryGetRelayMiningDifficultyResponse) MarshalToSizedBuffer added in v0.0.3

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

func (*QueryGetRelayMiningDifficultyResponse) ProtoMessage added in v0.0.3

func (*QueryGetRelayMiningDifficultyResponse) ProtoMessage()

func (*QueryGetRelayMiningDifficultyResponse) Reset added in v0.0.3

func (*QueryGetRelayMiningDifficultyResponse) Size added in v0.0.3

func (*QueryGetRelayMiningDifficultyResponse) String added in v0.0.3

func (*QueryGetRelayMiningDifficultyResponse) Unmarshal added in v0.0.3

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

func (*QueryGetRelayMiningDifficultyResponse) XXX_DiscardUnknown added in v0.0.3

func (m *QueryGetRelayMiningDifficultyResponse) XXX_DiscardUnknown()

func (*QueryGetRelayMiningDifficultyResponse) XXX_Marshal added in v0.0.3

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

func (*QueryGetRelayMiningDifficultyResponse) XXX_Merge added in v0.0.3

func (*QueryGetRelayMiningDifficultyResponse) XXX_Size added in v0.0.3

func (*QueryGetRelayMiningDifficultyResponse) XXX_Unmarshal added in v0.0.3

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

type QueryParamsRequest added in v0.0.3

type QueryParamsRequest struct {
}

QueryParamsRequest is request type for the Query/Params RPC method.

func (*QueryParamsRequest) Descriptor added in v0.0.3

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

func (*QueryParamsRequest) Marshal added in v0.0.3

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

func (*QueryParamsRequest) MarshalTo added in v0.0.3

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

func (*QueryParamsRequest) MarshalToSizedBuffer added in v0.0.3

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

func (*QueryParamsRequest) ProtoMessage added in v0.0.3

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset added in v0.0.3

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size added in v0.0.3

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

func (*QueryParamsRequest) String added in v0.0.3

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal added in v0.0.3

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

func (*QueryParamsRequest) XXX_DiscardUnknown added in v0.0.3

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal added in v0.0.3

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

func (*QueryParamsRequest) XXX_Merge added in v0.0.3

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

func (*QueryParamsRequest) XXX_Size added in v0.0.3

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal added in v0.0.3

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

type QueryParamsResponse added in v0.0.3

type QueryParamsResponse struct {
	// params holds all the parameters of this module.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse is response type for the Query/Params RPC method.

func (*QueryParamsResponse) Descriptor added in v0.0.3

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

func (*QueryParamsResponse) GetParams added in v0.0.3

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal added in v0.0.3

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

func (*QueryParamsResponse) MarshalTo added in v0.0.3

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

func (*QueryParamsResponse) MarshalToSizedBuffer added in v0.0.3

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

func (*QueryParamsResponse) ProtoMessage added in v0.0.3

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset added in v0.0.3

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size added in v0.0.3

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

func (*QueryParamsResponse) String added in v0.0.3

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal added in v0.0.3

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

func (*QueryParamsResponse) XXX_DiscardUnknown added in v0.0.3

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal added in v0.0.3

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

func (*QueryParamsResponse) XXX_Merge added in v0.0.3

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

func (*QueryParamsResponse) XXX_Size added in v0.0.3

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal added in v0.0.3

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

type QueryServer added in v0.0.3

type QueryServer interface {
	// Parameters queries the parameters of the module.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// Queries a list of RelayMiningDifficulty items.
	RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error)
	RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error)
}

QueryServer is the server API for Query service.

type RelayMiningDifficulty added in v0.0.3

type RelayMiningDifficulty struct {
	// The service ID the the relay mining difficulty is associated with.
	ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	// The block height at which this relay mining difficulty was computed.
	// This is needed to determine how much time has passed since the last time
	// the exponential moving average was computed.
	BlockHeight int64 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	// The exponential moving average of the number of relays for this service.
	NumRelaysEma uint64 `protobuf:"varint,3,opt,name=num_relays_ema,json=numRelaysEma,proto3" json:"num_relays_ema,omitempty"`
	// The target hash determining the difficulty to mine relays for this service.
	// For example, if we use sha256 to hash the (RelayRequest,ReqlayResponse) tuple,
	// and the difficulty has 4 leading zero bits, then the target hash would be:
	// 0b0000111... (until 32 bytes are filled up).
	TargetHash []byte `protobuf:"bytes,4,opt,name=target_hash,json=targetHash,proto3" json:"target_hash,omitempty"`
}

RelayMiningDifficulty is a message used to store the on-chain Relay Mining difficulty associated with a specific service ID.

func (*RelayMiningDifficulty) Descriptor added in v0.0.3

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

func (*RelayMiningDifficulty) GetBlockHeight added in v0.0.3

func (m *RelayMiningDifficulty) GetBlockHeight() int64

func (*RelayMiningDifficulty) GetNumRelaysEma added in v0.0.3

func (m *RelayMiningDifficulty) GetNumRelaysEma() uint64

func (*RelayMiningDifficulty) GetServiceId added in v0.0.3

func (m *RelayMiningDifficulty) GetServiceId() string

func (*RelayMiningDifficulty) GetTargetHash added in v0.0.3

func (m *RelayMiningDifficulty) GetTargetHash() []byte

func (*RelayMiningDifficulty) Marshal added in v0.0.3

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

func (*RelayMiningDifficulty) MarshalTo added in v0.0.3

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

func (*RelayMiningDifficulty) MarshalToSizedBuffer added in v0.0.3

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

func (*RelayMiningDifficulty) ProtoMessage added in v0.0.3

func (*RelayMiningDifficulty) ProtoMessage()

func (*RelayMiningDifficulty) Reset added in v0.0.3

func (m *RelayMiningDifficulty) Reset()

func (*RelayMiningDifficulty) Size added in v0.0.3

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

func (*RelayMiningDifficulty) String added in v0.0.3

func (m *RelayMiningDifficulty) String() string

func (*RelayMiningDifficulty) Unmarshal added in v0.0.3

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

func (*RelayMiningDifficulty) XXX_DiscardUnknown added in v0.0.3

func (m *RelayMiningDifficulty) XXX_DiscardUnknown()

func (*RelayMiningDifficulty) XXX_Marshal added in v0.0.3

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

func (*RelayMiningDifficulty) XXX_Merge added in v0.0.3

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

func (*RelayMiningDifficulty) XXX_Size added in v0.0.3

func (m *RelayMiningDifficulty) XXX_Size() int

func (*RelayMiningDifficulty) XXX_Unmarshal added in v0.0.3

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

type ServiceKeeper added in v0.0.6

type ServiceKeeper interface {
	GetService(ctx context.Context, serviceID string) (sharedtypes.Service, bool)
	// Only used for testing & simulation
	SetService(ctx context.Context, service sharedtypes.Service)
}

type SessionKeeper added in v0.0.4

type SessionKeeper interface {
	GetSession(context.Context, *sessiontypes.QueryGetSessionRequest) (*sessiontypes.QueryGetSessionResponse, error)
	GetBlockHash(ctx context.Context, height int64) []byte
	StoreBlockHash(ctx context.Context)
}

type SharedKeeper added in v0.0.3

type SharedKeeper interface {
	GetParams(ctx context.Context) sharedtypes.Params
	SetParams(ctx context.Context, params sharedtypes.Params) error

	GetProofWindowCloseHeight(ctx context.Context, queryHeight int64) int64
}

type SupplierKeeper added in v0.0.4

type SupplierKeeper interface {
	GetSupplier(ctx context.Context, supplierOperatorAddr string) (supplier sharedtypes.Supplier, found bool)
	GetAllSuppliers(ctx context.Context) (suppliers []sharedtypes.Supplier)
	SetSupplier(ctx context.Context, supplier sharedtypes.Supplier)
}

type UnimplementedMsgServer added in v0.0.3

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) UpdateParam added in v0.0.3

func (*UnimplementedMsgServer) UpdateParams added in v0.0.3

type UnimplementedQueryServer added in v0.0.3

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Params added in v0.0.3

func (*UnimplementedQueryServer) RelayMiningDifficulty added in v0.0.3

func (*UnimplementedQueryServer) RelayMiningDifficultyAll added in v0.0.3

Jump to

Keyboard shortcuts

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