types

package
v0.0.0-...-b8c38bb Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

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

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")
	ErrTokenomicsSupplierModuleMintFailed   = sdkerrors.Register(ModuleName, 1105, "failed to mint uPOKT to supplier module account")
	ErrTokenomicsSupplierRewardFailed       = sdkerrors.Register(ModuleName, 1106, "failed to send uPOKT from supplier module account to supplier")
	ErrTokenomicsSupplierAddressInvalid     = sdkerrors.Register(ModuleName, 1107, "the supplier address in the claim is not a valid bech32 address")
	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, 1112, "the application address in the claim is not a valid bech32 address")
	ErrTokenomicsParamsInvalid              = sdkerrors.Register(ModuleName, 1113, "provided params are invalid")
	ErrTokenomicsRootHashInvalid            = sdkerrors.Register(ModuleName, 1114, "the root hash in the claim is invalid")
	ErrTokenomicsApplicationNewStakeInvalid = sdkerrors.Register(ModuleName, 1115, "application stake cannot be reduced to a -ve amount")
)

x/tokenomics module sentinel errors

View Source
var (
	KeyComputeUnitsToTokensMultiplier = []byte("ComputeUnitsToTokensMultiplier")
	// TODO: Determine the default value
	DefaultComputeUnitsToTokensMultiplier uint64 = 42
)
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)

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // only used for simulation
}

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

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
}

BankKeeper defines the expected interface for the Bank module.

type ProofKeeper

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

	// Only used for testing & simulation
	UpsertClaim(ctx context.Context, claim prooftypes.Claim)
	UpsertProof(ctx context.Context, claim prooftypes.Proof)
}

Jump to

Keyboard shortcuts

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