Documentation ¶
Index ¶
- func UInt64FromBytes(s []byte) uint64
- type Hooks
- func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationCreated(_ sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error
- func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
- type Keeper
- func (k Keeper) AttestationRequestByNonce(ctx context.Context, request *types.QueryAttestationRequestByNonceRequest) (*types.QueryAttestationRequestByNonceResponse, error)
- func (k Keeper) CheckLatestAttestationNonce(ctx sdk.Context) bool
- func (k Keeper) DataCommitmentRangeForHeight(c context.Context, request *types.QueryDataCommitmentRangeForHeightRequest) (*types.QueryDataCommitmentRangeForHeightResponse, error)
- func (k Keeper) DeserializeValidatorIterator(vals []byte) stakingtypes.ValAddresses
- func (k Keeper) GetAttestationByNonce(ctx sdk.Context, nonce uint64) (types.AttestationRequestI, bool, error)
- func (k Keeper) GetCurrentDataCommitment(ctx sdk.Context) (types.DataCommitment, error)
- func (k Keeper) GetCurrentValset(ctx sdk.Context) (types.Valset, error)
- func (k Keeper) GetDataCommitmentForHeight(ctx sdk.Context, height uint64) (types.DataCommitment, error)
- func (k Keeper) GetDataCommitmentWindowParam(ctx sdk.Context) uint64
- func (k Keeper) GetLastDataCommitment(ctx sdk.Context) (types.DataCommitment, error)
- func (k Keeper) GetLastUnBondingBlockHeight(ctx sdk.Context) uint64
- func (k Keeper) GetLastValsetBeforeNonce(ctx sdk.Context, nonce uint64) (*types.Valset, error)
- func (k Keeper) GetLatestAttestationNonce(ctx sdk.Context) uint64
- func (k Keeper) GetLatestValset(ctx sdk.Context) (*types.Valset, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetValsetByNonce(ctx sdk.Context, nonce uint64) (*types.Valset, bool, error)
- func (k Keeper) Hooks() Hooks
- func (k Keeper) LastUnbondingHeight(c context.Context, req *types.QueryLastUnbondingHeightRequest) (*types.QueryLastUnbondingHeightResponse, error)
- func (k Keeper) LastValsetRequestBeforeNonce(c context.Context, req *types.QueryLastValsetRequestBeforeNonceRequest) (*types.QueryLastValsetRequestBeforeNonceResponse, error)
- func (k Keeper) LatestAttestationNonce(ctx context.Context, request *types.QueryLatestAttestationNonceRequest) (*types.QueryLatestAttestationNonceResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, request *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) SetAttestationRequest(ctx sdk.Context, at types.AttestationRequestI) error
- func (k Keeper) SetLastUnBondingBlockHeight(ctx sdk.Context, unbondingBlockHeight uint64)
- func (k Keeper) SetLatestAttestationNonce(ctx sdk.Context, nonce uint64)
- func (k Keeper) SetParams(ctx sdk.Context, ps types.Params)
- func (k Keeper) StoreAttestation(ctx sdk.Context, at types.AttestationRequestI)
- type StakingKeeper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UInt64FromBytes ¶ added in v0.7.0
UInt64FromBytes create uint from binary big endian representation.
Types ¶
type Hooks ¶ added in v0.7.0
type Hooks struct {
// contains filtered or unexported fields
}
Hooks is a wrapper struct around Keeper.
func (Hooks) AfterDelegationModified ¶ added in v0.7.0
func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Hooks) AfterValidatorBeginUnbonding ¶ added in v0.7.0
func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorBonded ¶ added in v0.7.0
func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorCreated ¶ added in v0.7.0
func (Hooks) AfterValidatorRemoved ¶ added in v0.7.0
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeDelegationCreated ¶ added in v0.7.0
func (h Hooks) BeforeDelegationCreated(_ sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeDelegationRemoved ¶ added in v0.7.0
func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) BeforeDelegationSharesModified ¶ added in v0.7.0
func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeValidatorModified ¶ added in v0.7.0
func (Hooks) BeforeValidatorSlashed ¶ added in v0.7.0
type Keeper ¶
type Keeper struct { StakingKeeper StakingKeeper // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, paramSpace paramtypes.Subspace, stakingKeeper StakingKeeper) *Keeper
func (Keeper) AttestationRequestByNonce ¶ added in v0.7.0
func (k Keeper) AttestationRequestByNonce( ctx context.Context, request *types.QueryAttestationRequestByNonceRequest, ) (*types.QueryAttestationRequestByNonceResponse, error)
func (Keeper) CheckLatestAttestationNonce ¶ added in v0.7.0
CheckLatestAttestationNonce returns true if the latest attestation request nonce is declared in the store and false if it has not been initialized.
func (Keeper) DataCommitmentRangeForHeight ¶ added in v0.12.0
func (k Keeper) DataCommitmentRangeForHeight( c context.Context, request *types.QueryDataCommitmentRangeForHeightRequest, ) (*types.QueryDataCommitmentRangeForHeightResponse, error)
func (Keeper) DeserializeValidatorIterator ¶ added in v0.7.0
func (k Keeper) DeserializeValidatorIterator(vals []byte) stakingtypes.ValAddresses
DeserializeValidatorIterator returns validators from the validator iterator. Adding here in gravity keeper as cdc is not available inside endblocker.
func (Keeper) GetAttestationByNonce ¶ added in v0.7.0
func (k Keeper) GetAttestationByNonce(ctx sdk.Context, nonce uint64) (types.AttestationRequestI, bool, error)
GetAttestationByNonce returns an attestation request by nonce. Returns (nil, false, nil) if the attestation is not found.
func (Keeper) GetCurrentDataCommitment ¶ added in v0.7.0
GetCurrentDataCommitment creates the latest data commitment at current height according to the data commitment window specified
func (Keeper) GetCurrentValset ¶ added in v0.7.0
func (Keeper) GetDataCommitmentForHeight ¶ added in v0.12.0
func (k Keeper) GetDataCommitmentForHeight(ctx sdk.Context, height uint64) (types.DataCommitment, error)
GetDataCommitmentForHeight returns the attestation containing the provided height.
func (Keeper) GetDataCommitmentWindowParam ¶ added in v0.7.0
func (Keeper) GetLastDataCommitment ¶ added in v0.13.0
GetLastDataCommitment returns the last data commitment.
func (Keeper) GetLastUnBondingBlockHeight ¶ added in v0.7.0
GetLastUnBondingBlockHeight returns the last unbonding block height or zero if not set. This value is not saved or loaded at genesis. This value is reset to zero on chain upgrade.
func (Keeper) GetLastValsetBeforeNonce ¶ added in v0.7.0
GetLastValsetBeforeNonce returns the previous valset before the provided `nonce`. the `nonce` can be a valset, but this method will return the valset before it. If the provided nonce is 1, it will return an error, because, there is no valset before nonce 1.
func (Keeper) GetLatestAttestationNonce ¶ added in v0.7.0
GetLatestAttestationNonce returns the latest attestation request nonce. Panics if the latest attestation nonce doesn't exit. Make sure to call `CheckLatestAttestationNonce` before getting the nonce. This value is set on chain startup. However, it won't be written to store until height = 1. Thus, it's mandatory to run `CheckLatestAttestationNonce` before calling this method. Check x/qgb/genesis.go for more information.
func (Keeper) GetLatestValset ¶ added in v0.7.0
GetLatestValset returns the latest validator set in store. This is different from the CurrentValset because this one has been saved and is therefore *the* latest valset saved in store. GetCurrentValset shows you what could be, if you chose to save it, this function shows you what is the latest valset that was saved. Panics if no valset is found. Because, a valset is always created when starting the chain. Check x/qgb/abci.go:68 for more information.
func (Keeper) GetValsetByNonce ¶ added in v0.7.0
TODO add query for this method and make the orchestrator Querier use it. GetValsetByNonce returns the stored valset associated with the provided nonce. Returns (nil, false, nil) if not found.
func (Keeper) LastUnbondingHeight ¶ added in v0.7.0
func (k Keeper) LastUnbondingHeight( c context.Context, req *types.QueryLastUnbondingHeightRequest, ) (*types.QueryLastUnbondingHeightResponse, error)
LastUnbondingHeight queries the last unbonding height.
func (Keeper) LastValsetRequestBeforeNonce ¶ added in v0.7.0
func (k Keeper) LastValsetRequestBeforeNonce( c context.Context, req *types.QueryLastValsetRequestBeforeNonceRequest, ) (*types.QueryLastValsetRequestBeforeNonceResponse, error)
LastValsetRequestBeforeNonce queries the last valset request before nonce
func (Keeper) LatestAttestationNonce ¶ added in v0.7.0
func (k Keeper) LatestAttestationNonce( ctx context.Context, request *types.QueryLatestAttestationNonceRequest, ) (*types.QueryLatestAttestationNonceResponse, error)
func (Keeper) Params ¶ added in v0.7.0
func (k Keeper) Params(c context.Context, request *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) SetAttestationRequest ¶ added in v0.7.0
SetAttestationRequest sets a new attestation request to the store to be signed by orchestrators afterwards.
func (Keeper) SetLastUnBondingBlockHeight ¶ added in v0.7.0
SetLastUnBondingBlockHeight sets the last unbonding block height. Note this value is not saved to state or loaded at genesis. This value is reset to zero on chain upgrade.
func (Keeper) SetLatestAttestationNonce ¶ added in v0.7.0
SetLatestAttestationNonce sets the latest attestation request nonce, since it's expected that this value will only increase by one and it panics otherwise.
func (Keeper) StoreAttestation ¶ added in v0.7.0
func (k Keeper) StoreAttestation(ctx sdk.Context, at types.AttestationRequestI)
StoreAttestation saves the attestation in store. Should panic if overwriting existing one.
type StakingKeeper ¶ added in v0.7.0
type StakingKeeper interface { GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator GetLastValidatorPower(ctx sdk.Context, valAddr sdk.ValAddress) int64 GetParams(ctx sdk.Context) stakingtypes.Params ValidatorQueueIterator(ctx sdk.Context, endTime time.Time, endHeight int64) sdk.Iterator GetValidatorByEVMAddress(ctx sdk.Context, addr common.Address) (validator stakingtypes.Validator, found bool) }
StakingKeeper restricts the functionality of the bank keeper used in the qgb keeper