Documentation ¶
Index ¶
- Constants
- Variables
- func ClaimPrimaryKey(sessionId, supplierAddr string) []byte
- func ClaimSupplierAddressKey(supplierAddr string, primaryKey []byte) []byte
- func ClaimSupplierEndSessionHeightKey(sessionEndHeight int64, primaryKey []byte) []byte
- func KeyComposite(keys ...[]byte) []byte
- func KeyPrefix(p string) []byte
- func NewAccountKeeperQueryClient(accountKeeper AccountKeeper) client.AccountQueryClient
- func NewAppKeeperQueryClient(appKeeper ApplicationKeeper) client.ApplicationQueryClient
- func ParamKeyTable() paramtypes.KeyTable
- func ProofPrimaryKey(sessionId, supplierAddr string) []byte
- func ProofSupplierAddressKey(supplierAddr string, primaryKey []byte) []byte
- func ProofSupplierEndSessionHeightKey(sessionEndHeight int64, primaryKey []byte) []byte
- func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func ValidateMinRelayDifficultyBits(v interface{}) error
- type AccountKeeper
- type AccountKeeperQueryClient
- type AppKeeperQueryClient
- type ApplicationKeeper
- type BankKeeper
- type SessionKeeper
- type SupplierKeeper
Constants ¶
const ( // ClaimPrimaryKeyPrefix is the prefix to retrieve the entire Claim object (the primary store) // TODO_TECHDEBT: consider renaming to ClaimSessionIDPrefix. ClaimPrimaryKeyPrefix = "Claim/primary_key/" // ClaimSupplierAddressPrefix is the key to retrieve a Claim's Primary Key from the Address index ClaimSupplierAddressPrefix = "Claim/address/" // ClaimSessionEndHeightPrefix is the key to retrieve a Claim's Primary Key from the Height index ClaimSessionEndHeightPrefix = "Claim/height/" )
const ( // ProofPrimaryKeyPrefix is the prefix to retrieve the entire Proof object (the primary store) // TODO_TECHDEBT: consider renaming to ProofSessionIDPrefix. ProofPrimaryKeyPrefix = "Proof/primary_key/" // ProofSupplierAddressPrefix is the key to retrieve a Proof's Primary Key from the Address index ProofSupplierAddressPrefix = "Proof/address/" // ProofSessionEndHeightPrefix is the key to retrieve a Proof's Primary Key from the Height index ProofSessionEndHeightPrefix = "Proof/height/" )
const ( // ModuleName defines the module name ModuleName = "proof" // StoreKey defines the primary module store key StoreKey = ModuleName // MemStoreKey defines the in-memory store key MemStoreKey = "mem_proof" )
const TypeMsgCreateClaim = "create_claim"
Variables ¶
var ( ErrProofInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") ErrProofInvalidAddress = sdkerrors.Register(ModuleName, 1101, "invalid address") ErrProofNotFound = sdkerrors.Register(ModuleName, 1102, "supplier not found") ErrProofInvalidService = sdkerrors.Register(ModuleName, 1103, "invalid service in supplier") ErrProofInvalidClaimRootHash = sdkerrors.Register(ModuleName, 1104, "invalid root hash") ErrProofInvalidQueryRequest = sdkerrors.Register(ModuleName, 1105, "invalid query request") ErrProofClaimNotFound = sdkerrors.Register(ModuleName, 1106, "claim not found") ErrProofProofNotFound = sdkerrors.Register(ModuleName, 1107, "proof not found") ErrProofInvalidProof = sdkerrors.Register(ModuleName, 1108, "invalid proof") ErrProofInvalidRelay = sdkerrors.Register(ModuleName, 1109, "invalid relay") ErrProofInvalidRelayRequest = sdkerrors.Register(ModuleName, 1110, "invalid relay request") ErrProofInvalidRelayResponse = sdkerrors.Register(ModuleName, 1111, "invalid relay response") ErrProofNotSecp256k1Curve = sdkerrors.Register(ModuleName, 1112, "not secp256k1 curve") ErrProofApplicationNotFound = sdkerrors.Register(ModuleName, 1113, "application not found") ErrProofPubKeyNotFound = sdkerrors.Register(ModuleName, 1114, "public key not found") ErrProofInvalidSessionHeader = sdkerrors.Register(ModuleName, 1115, "invalid session header") ErrProofInvalidSessionId = sdkerrors.Register(ModuleName, 1116, "invalid session ID") ErrProofInvalidSessionEndHeight = sdkerrors.Register(ModuleName, 1117, "invalid session end height") ErrProofInvalidSessionStartHeight = sdkerrors.Register(ModuleName, 1118, "invalid session start height") ErrProofParamNameInvalid = sdkerrors.Register(ModuleName, 1119, "the provided param name is invalid") ErrProofParamInvalid = sdkerrors.Register(ModuleName, 1120, "the provided param is invalid") )
x/proof module sentinel errors
var ( ParamsKey = []byte("p_proof") // KeyDelimiter is the delimiter for composite keys. KeyDelimiter = []byte("/") )
var ( KeyMinRelayDifficultyBits = []byte("MinRelayDifficultyBits") NameMinRelayDifficultyBits = "min_relay_difficulty_bits" DefaultMinRelayDifficultyBits uint64 = 0 // TODO_BLOCKER(#142, #401): Determine the default value. )
Functions ¶
func ClaimPrimaryKey ¶
ClaimPrimaryKey returns the primary store key used to retrieve a Claim by creating a composite key of the sessionId and supplierAddr.
func ClaimSupplierAddressKey ¶
ClaimSupplierAddressKey returns the key used to iterate through claims given a supplier Address.
func ClaimSupplierEndSessionHeightKey ¶
ClaimSupplierEndSessionHeightKey returns the key used to iterate through claims given a session end height.
func KeyComposite ¶
KeyComposite combines the given keys into a single key for use with KVStore.
func NewAccountKeeperQueryClient ¶
func NewAccountKeeperQueryClient(accountKeeper AccountKeeper) client.AccountQueryClient
NewAccountKeeperQueryClient returns a new AccountQueryClient that is backed by an AccountKeeper instance. It is used by the PubKeyClient to get the public key that corresponds to the provided address. It should be injected into the PubKeyClient when initialized from within the a keeper.
func NewAppKeeperQueryClient ¶
func NewAppKeeperQueryClient(appKeeper ApplicationKeeper) client.ApplicationQueryClient
NewAppKeeperQueryClient returns a new ApplicationQueryClient that is backed by an ApplicationKeeper instance. It is used by the RingClient to get the gateway address that an application has delegated its signing power to. It should be injected into the RingClient when initialized from within the a keeper.
func ParamKeyTable ¶
func ParamKeyTable() paramtypes.KeyTable
ParamKeyTable the param key table for launch module
func ProofPrimaryKey ¶
ProofPrimaryKey returns the primary store key used to retrieve a Proof by creating a composite key of the sessionId and supplierAddr.
func ProofSupplierAddressKey ¶
ProofSupplierAddressKey returns the key used to iterate through Proofs given a supplier Address.
func ProofSupplierEndSessionHeightKey ¶
ProofSupplierEndSessionHeightKey returns the key used to iterate through Proofs given a session end height.
func RegisterInterfaces ¶
func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
func ValidateMinRelayDifficultyBits ¶ added in v0.0.2
func ValidateMinRelayDifficultyBits(v interface{}) error
validateMinRelayDifficultyBits validates the MinRelayDifficultyBits param NB: The argument is an interface type to satisfy the ParamSetPair function signature.
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { GetAccount(context.Context, sdk.AccAddress) sdk.AccountI SetAccount(context.Context, sdk.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 AccountKeeperQueryClient ¶
type AccountKeeperQueryClient struct {
// contains filtered or unexported fields
}
AccountKeeperQueryClient is a thin wrapper around the AccountKeeper. It does not rely on the QueryClient, and therefore does not make any network requests as in the off-chain implementation.
func (*AccountKeeperQueryClient) GetAccount ¶
func (accountQueryClient *AccountKeeperQueryClient) GetAccount( ctx context.Context, addr string, ) (account types.AccountI, err error)
GetAccount returns the account associated with the provided address.
func (*AccountKeeperQueryClient) GetPubKeyFromAddress ¶
func (accountQueryClient *AccountKeeperQueryClient) GetPubKeyFromAddress( ctx context.Context, address string, ) (cryptotypes.PubKey, error)
GetPubKeyFromAddress returns the public key of the given address. It uses the accountQuerier to get the account and then returns its public key.
type AppKeeperQueryClient ¶
type AppKeeperQueryClient struct {
// contains filtered or unexported fields
}
AppKeeperQueryClient is a thin wrapper around the AccountKeeper. It does not rely on the QueryClient, and therefore does not make any network requests as in the off-chain implementation.
func (*AppKeeperQueryClient) GetAllApplications ¶
func (appQueryClient *AppKeeperQueryClient) GetAllApplications(ctx context.Context) ([]apptypes.Application, error)
GetAllApplications returns all the applications in the application store.
func (*AppKeeperQueryClient) GetApplication ¶
func (appQueryClient *AppKeeperQueryClient) GetApplication( ctx context.Context, appAddr string, ) (apptypes.Application, error)
GetApplication returns the application corresponding to the given address.
type ApplicationKeeper ¶
type ApplicationKeeper interface { GetApplication(ctx context.Context, address string) (app apptypes.Application, found bool) GetAllApplications(ctx context.Context) []apptypes.Application SetApplication(context.Context, apptypes.Application) }
ApplicationKeeper defines the expected application keeper to retrieve applications
type BankKeeper ¶
type BankKeeper interface { // 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. SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error }
BankKeeper defines the expected interface for the Bank module.
type SessionKeeper ¶
type SessionKeeper interface { GetSession(context.Context, *sessiontypes.QueryGetSessionRequest) (*sessiontypes.QueryGetSessionResponse, error) GetBlockHash(ctx context.Context, height int64) []byte StoreBlockHash(ctx context.Context) }
type SupplierKeeper ¶
type SupplierKeeper interface {
SetSupplier(context.Context, sharedtypes.Supplier)
}