Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AllClaims(ctx context.Context, req *types.QueryAllClaimsRequest) (*types.QueryAllClaimsResponse, error)
- func (k Keeper) AllProofs(ctx context.Context, req *types.QueryAllProofsRequest) (*types.QueryAllProofsResponse, error)
- func (k Keeper) Claim(ctx context.Context, req *types.QueryGetClaimRequest) (*types.QueryGetClaimResponse, error)
- func (k Keeper) EnsureValidProof(ctx context.Context, proof *types.Proof) error
- func (k Keeper) GetAllClaims(ctx context.Context) (claims []types.Claim)
- func (k Keeper) GetAllProofs(ctx context.Context) (proofs []types.Proof)
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetClaim(ctx context.Context, sessionId, supplierOperatorAddr string) (_ types.Claim, isClaimFound bool)
- func (k Keeper) GetParams(ctx context.Context) (params types.Params)
- func (k Keeper) GetProof(ctx context.Context, sessionId, supplierOperatorAddr string) (_ types.Proof, isProofFound bool)
- func (k Keeper) Logger() log.Logger
- func (k Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) Proof(ctx context.Context, req *types.QueryGetProofRequest) (*types.QueryGetProofResponse, error)
- func (k Keeper) ProofRequirementForClaim(ctx context.Context, claim *types.Claim) (_ types.ProofRequirementReason, err error)
- func (k Keeper) RemoveClaim(ctx context.Context, sessionId, supplierOperatorAddr string)
- func (k Keeper) RemoveProof(ctx context.Context, sessionId, supplierOperatorAddr string)
- func (k Keeper) SetParams(ctx context.Context, params types.Params) error
- func (k Keeper) UpsertClaim(ctx context.Context, claim types.Claim)
- func (k Keeper) UpsertProof(ctx context.Context, proof types.Proof)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService store.KVStoreService, logger log.Logger, authority string, bankKeeper types.BankKeeper, sessionKeeper types.SessionKeeper, applicationKeeper types.ApplicationKeeper, accountKeeper types.AccountKeeper, sharedKeeper types.SharedKeeper, serviceKeeper types.ServiceKeeper, ) Keeper
func (Keeper) AllClaims ¶
func (k Keeper) AllClaims(ctx context.Context, req *types.QueryAllClaimsRequest) (*types.QueryAllClaimsResponse, error)
func (Keeper) AllProofs ¶
func (k Keeper) AllProofs(ctx context.Context, req *types.QueryAllProofsRequest) (*types.QueryAllProofsResponse, error)
func (Keeper) Claim ¶
func (k Keeper) Claim(ctx context.Context, req *types.QueryGetClaimRequest) (*types.QueryGetClaimResponse, error)
func (Keeper) EnsureValidProof ¶ added in v0.0.5
EnsureValidProof validates the proof submitted by the supplier is correct with respect to an on-chain claim.
This function should be called during session settlement (i.e. EndBlocker) rather than during proof submission (i.e. SubmitProof) because:
- RPC requests should be quick, lightweight and only do basic validation
- Validators are the ones responsible for the heavy processing & validation during state transitions
- This creates an opportunity to slash suppliers who submit false proofs, whereas they can keep retrying if it takes place in the SubmitProof handler.
Note that some of the validation here is redundant with the validation done in SubmitProof (in the handler). The reason for this is because were are trying to find a balance between preventing sybil or DoS attacks on full nodes during proof submission, but being completely exhaustive in all the checks done here.
func (Keeper) GetAllClaims ¶
GetAllClaims returns all claim
func (Keeper) GetAllProofs ¶
GetAllProofs returns all proof
func (Keeper) GetAuthority ¶
GetAuthority returns the module's authority.
func (Keeper) GetClaim ¶
func (k Keeper) GetClaim(ctx context.Context, sessionId, supplierOperatorAddr string) (_ types.Claim, isClaimFound bool)
GetClaim returns a claim from its index
func (Keeper) GetProof ¶
func (k Keeper) GetProof(ctx context.Context, sessionId, supplierOperatorAddr string) (_ types.Proof, isProofFound bool)
GetProof returns a proof from its index
func (Keeper) Params ¶
func (k Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) Proof ¶
func (k Keeper) Proof(ctx context.Context, req *types.QueryGetProofRequest) (*types.QueryGetProofResponse, error)
func (Keeper) ProofRequirementForClaim ¶ added in v0.0.9
func (k Keeper) ProofRequirementForClaim(ctx context.Context, claim *types.Claim) (_ types.ProofRequirementReason, err error)
ProofRequirementForClaim checks if a proof is required for a claim. If it is not, the claim will be settled without a proof. If it is, the claim will only be settled if a valid proof is available. TODO_BETA(@olshansk): Document safety assumptions of the probabilistic proofs mechanism.
func (Keeper) RemoveClaim ¶
RemoveClaim removes a claim from the store
func (Keeper) RemoveProof ¶
RemoveProof removes a proof from the store
func (Keeper) UpsertClaim ¶
UpsertClaim set a specific claim in the store from its index