Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Hooks
- func (h Hooks) AfterConsensusPubKeyUpdate(_ context.Context, _, _ cryptotypes.PubKey, _ sdk.Coin) error
- func (h Hooks) AfterDelegationModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterUnbondingInitiated(_ context.Context, _ uint64) error
- func (h Hooks) AfterValidatorBeginUnbonding(ctx context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorBonded(ctx context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorCreated(_ context.Context, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorRemoved(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationSharesModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeValidatorModified(_ context.Context, _ sdk.ValAddress) error
- func (h Hooks) BeforeValidatorSlashed(_ context.Context, _ sdk.ValAddress, _ sdkmath.LegacyDec) error
- type Keeper
- func (k Keeper) AddAmountToStake(ctx context.Context, acc sdk.AccAddress, amt math.Int) error
- func (k Keeper) CheckSelectorsDelegations(ctx context.Context, addr sdk.AccAddress) (math.Int, int64, error)
- func (k Keeper) Delegation(ctx context.Context, delegator sdk.AccAddress) (types.Selection, error)
- func (k Keeper) DivvyingTips(ctx context.Context, reporterAddr sdk.AccAddress, reward types.BigUint, ...) error
- func (k Keeper) EscrowReporterStake(ctx context.Context, reporterAddr sdk.AccAddress, power, height uint64, ...) error
- func (k Keeper) FeeRefund(ctx context.Context, hashId []byte, amt math.Int) error
- func (k Keeper) FeefromReporterStake(ctx context.Context, reporterAddr sdk.AccAddress, amt math.Int, hashId []byte) error
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetBondedValidators(ctx context.Context, max uint32) ([]stakingtypes.Validator, error)
- func (k Keeper) GetDelegatorTokensAtBlock(ctx context.Context, delegator []byte, blockNumber uint64) (math.Int, error)
- func (k Keeper) GetNumOfSelectors(ctx context.Context, repAddr sdk.AccAddress) (int, error)
- func (k Keeper) GetReporterTokensAtBlock(ctx context.Context, reporter []byte, blockNumber uint64) (math.Int, error)
- func (k Keeper) HasMin(ctx context.Context, addr sdk.AccAddress, minRequired math.Int) (bool, error)
- func (k Keeper) Hooks() Hooks
- func (k Keeper) JailReporter(ctx context.Context, reporterAddr sdk.AccAddress, jailDuration uint64) error
- func (k Keeper) LegacyDecFromMathUint(value math.Uint) math.LegacyDec
- func (k Keeper) Logger() log.Logger
- func (k Keeper) MoveTokensFromValidator(ctx context.Context, validator stakingtypes.Validator, amount math.Int) error
- func (k Keeper) Reporter(ctx context.Context, reporter sdk.AccAddress) (types.OracleReporter, error)
- func (k Keeper) ReporterStake(ctx context.Context, repAddr sdk.AccAddress) (math.Int, error)
- func (k Keeper) ReturnSlashedTokens(ctx context.Context, amt math.Int, hashId []byte) error
- func (k Keeper) TotalReporterPower(ctx context.Context) (math.Int, error)
- func (k Keeper) TrackStakeChange(ctx context.Context) error
- func (k Keeper) TruncateUint(value math.LegacyDec) math.Uint
- func (k Keeper) UnjailReporter(ctx context.Context, reporterAddr sdk.AccAddress, ...) error
- type Querier
- func (k Querier) AllowedAmount(ctx context.Context, req *types.QueryAllowedAmountRequest) (*types.QueryAllowedAmountResponse, error)
- func (k Querier) AllowedAmountExpiration(ctx context.Context, req *types.QueryAllowedAmountExpirationRequest) (*types.QueryAllowedAmountExpirationResponse, error)
- func (k Querier) AvailableTips(ctx context.Context, req *types.QueryAvailableTipsRequest) (*types.QueryAvailableTipsResponse, error)
- func (k Querier) NumOfSelectorsByReporter(ctx context.Context, req *types.QueryNumOfSelectorsByReporterRequest) (*types.QueryNumOfSelectorsByReporterResponse, error)
- func (k Querier) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) Reporters(ctx context.Context, req *types.QueryReportersRequest) (*types.QueryReportersResponse, error)
- func (k Querier) SelectorReporter(ctx context.Context, req *types.QuerySelectorReporterRequest) (*types.QuerySelectorReporterResponse, error)
- func (k Querier) SpaceAvailableByReporter(ctx context.Context, req *types.QuerySpaceAvailableByReporterRequest) (*types.QuerySpaceAvailableByReporterResponse, error)
- type ReporterSelectorsIndex
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 Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for reporter keeper
func (Hooks) AfterConsensusPubKeyUpdate ¶
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) AfterUnbondingInitiated ¶
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(ctx context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(ctx context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorCreated ¶
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) BeforeValidatorModified ¶
func (Hooks) BeforeValidatorSlashed ¶
type Keeper ¶
type Keeper struct { Params collections.Item[types.Params] Tracker collections.Item[types.StakeTracker] Reporters collections.Map[[]byte, types.OracleReporter] SelectorTips collections.Map[[]byte, types.BigUint] Selectors *collections.IndexedMap[[]byte, types.Selection, ReporterSelectorsIndex] DisputedDelegationAmounts collections.Map[[]byte, types.DelegationsAmounts] FeePaidFromStake collections.Map[[]byte, types.DelegationsAmounts] Report collections.Map[collections.Pair[[]byte, uint64], types.DelegationsAmounts] Schema collections.Schema // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService store.KVStoreService, logger log.Logger, authority string, stakingKeeper types.StakingKeeper, bankKeeper types.BankKeeper, registryKeeper types.RegistryKeeper, ) Keeper
func (Keeper) AddAmountToStake ¶
func (Keeper) CheckSelectorsDelegations ¶
func (k Keeper) CheckSelectorsDelegations(ctx context.Context, addr sdk.AccAddress) (math.Int, int64, error)
function that iterates through a selector's delegations and checks if they meet the min requirement plus counts how many delegations they have
func (Keeper) Delegation ¶
alias
func (Keeper) DivvyingTips ¶
func (k Keeper) DivvyingTips(ctx context.Context, reporterAddr sdk.AccAddress, reward types.BigUint, height uint64) error
distributes tips paid in oracle module to delegators that were part of reporting the tip's report
func (Keeper) EscrowReporterStake ¶
func (Keeper) FeeRefund ¶
called in dispute module after dispute is resolved returns the fee to the delegators that paid minus burn amount
func (Keeper) FeefromReporterStake ¶
func (Keeper) GetAuthority ¶
GetAuthority returns the module's authority.
func (Keeper) GetBondedValidators ¶
func (Keeper) GetDelegatorTokensAtBlock ¶
func (Keeper) GetNumOfSelectors ¶
func (Keeper) GetReporterTokensAtBlock ¶
func (Keeper) JailReporter ¶
func (k Keeper) JailReporter(ctx context.Context, reporterAddr sdk.AccAddress, jailDuration uint64) error
send a reporter to jail
func (Keeper) LegacyDecFromMathUint ¶
Converts a math.Uint to a legacy decimal
func (Keeper) MoveTokensFromValidator ¶
func (Keeper) Reporter ¶
func (k Keeper) Reporter(ctx context.Context, reporter sdk.AccAddress) (types.OracleReporter, error)
func (Keeper) ReporterStake ¶
Reporter returns the total power of a reporter that is bonded at time of the call Store the set of delegations for the reporter at the current block height for dispute purposes to be referenced by block height
func (Keeper) ReturnSlashedTokens ¶
ReturnSlashedTokens returns the slashed tokens to the delegators, called in dispute module after dispute is resolved with result invalid or reporter wins
func (Keeper) TotalReporterPower ¶
func (Keeper) TruncateUint ¶
Truncates a legacy decimal to a math.Uint
func (Keeper) UnjailReporter ¶
func (k Keeper) UnjailReporter(ctx context.Context, reporterAddr sdk.AccAddress, reporter types.OracleReporter) error
remove a reporter from jail
type Querier ¶
type Querier struct {
Keeper
}
func NewQuerier ¶
func (Querier) AllowedAmount ¶
func (k Querier) AllowedAmount(ctx context.Context, req *types.QueryAllowedAmountRequest) (*types.QueryAllowedAmountResponse, error)
get the current staking/unstaking amount allowed w/out triggering 5% change
func (Querier) AllowedAmountExpiration ¶
func (k Querier) AllowedAmountExpiration(ctx context.Context, req *types.QueryAllowedAmountExpirationRequest) (*types.QueryAllowedAmountExpirationResponse, error)
func (Querier) AvailableTips ¶
func (k Querier) AvailableTips(ctx context.Context, req *types.QueryAvailableTipsRequest) (*types.QueryAvailableTipsResponse, error)
func (Querier) NumOfSelectorsByReporter ¶
func (k Querier) NumOfSelectorsByReporter(ctx context.Context, req *types.QueryNumOfSelectorsByReporterRequest) (*types.QueryNumOfSelectorsByReporterResponse, error)
query for num of selectors in reporter
func (Querier) Params ¶
func (k Querier) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Querier) Reporters ¶
func (k Querier) Reporters(ctx context.Context, req *types.QueryReportersRequest) (*types.QueryReportersResponse, error)
Reporters queries all the reporters
func (Querier) SelectorReporter ¶
func (k Querier) SelectorReporter(ctx context.Context, req *types.QuerySelectorReporterRequest) (*types.QuerySelectorReporterResponse, error)
SelectorReporter queries the reporter of a selector
func (Querier) SpaceAvailableByReporter ¶
func (k Querier) SpaceAvailableByReporter(ctx context.Context, req *types.QuerySpaceAvailableByReporterRequest) (*types.QuerySpaceAvailableByReporterResponse, error)
query for num of space available in reporter
type ReporterSelectorsIndex ¶
func NewSelectorsIndex ¶
func NewSelectorsIndex(sb *collections.SchemaBuilder) ReporterSelectorsIndex
func (ReporterSelectorsIndex) IndexesList ¶
func (a ReporterSelectorsIndex) IndexesList() []collections.Index[[]byte, types.Selection]