Documentation ¶
Index ¶
- func CaptureSetPoEContractAddressFn() (...)
- func DeliverGenTxs(genTxs []json.RawMessage, deliverTx DeliverTxFn, ...) error
- func ExportGenesis(ctx sdk.Context, keeper *Keeper) *types.GenesisState
- func InitGenesis(ctx sdk.Context, keeper initer, deliverTx DeliverTxFn, ...) error
- func ModuleLogger(ctx sdk.Context) log.Logger
- func NewMsgServerImpl(poeKeeper PoEKeeper, contractKeeper wasmtypes.ContractOpsKeeper, ...) types.MsgServer
- func NewWasmVMMock(mutators ...func(*wasmtesting.MockWasmer)) *wasmtesting.MockWasmer
- func RandomAddress(_ *testing.T) sdk.AccAddress
- func SwitchPoEContractAddressFn(t *testing.T, myValsetContract sdk.AccAddress, ...) func(ctx sdk.Context, ctype types.PoEContractType) (sdk.AccAddress, error)
- type CapturedPoEContractAddress
- type ContractSource
- type DeliverTxFn
- type DistributionContract
- type EngagementContract
- type Keeper
- func (k *Keeper) DeleteHistoricalInfo(ctx sdk.Context, height int64)
- func (k *Keeper) DistributionContract(ctx sdk.Context) DistributionContract
- func (k *Keeper) EngagementContract(ctx sdk.Context) EngagementContract
- func (k *Keeper) GetBondDenom(ctx sdk.Context) string
- func (k *Keeper) GetEngagementPoints(ctx sdk.Context, opAddr sdk.AccAddress) (uint64, error)
- func (k *Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
- func (k *Keeper) GetInitialValidatorEngagementPoints(ctx sdk.Context) (res uint64)
- func (k *Keeper) GetParams(ctx sdk.Context) types.Params
- func (k *Keeper) GetPoEContractAddress(ctx sdk.Context, ctype types.PoEContractType) (sdk.AccAddress, error)
- func (k *Keeper) GetValidatorVotes() []abcitypes.VoteInfo
- func (k *Keeper) HistoricalEntries(ctx sdk.Context) (res uint32)
- func (k *Keeper) InitContractAddressCache(ctx sdk.Context)
- func (k *Keeper) IteratePoEContracts(ctx sdk.Context, cb func(types.PoEContractType, sdk.AccAddress) bool)
- func (k *Keeper) MinimumDelegationAmounts(ctx sdk.Context) (res sdk.Coins)
- func (k *Keeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi *stakingtypes.HistoricalInfo)
- func (k *Keeper) SetPoEContractAddress(ctx sdk.Context, ctype types.PoEContractType, contractAddr sdk.AccAddress)
- func (k *Keeper) SetValidatorInitialEngagementPoints(ctx sdk.Context, opAddr sdk.AccAddress, selfDelegation sdk.Coin) error
- func (k *Keeper) StakeContract(ctx sdk.Context) StakeContract
- func (k *Keeper) TrackHistoricalInfo(ctx sdk.Context)
- func (k *Keeper) UnbondingTime(ctx sdk.Context) time.Duration
- func (k *Keeper) UpdateValidatorVotes(validatorVotes []abcitypes.VoteInfo)
- func (k *Keeper) ValsetContract(ctx sdk.Context) ValsetContract
- type LegacyDistributionGRPCQuerier
- func (q LegacyDistributionGRPCQuerier) CommunityPool(c context.Context, req *distributiontypes.QueryCommunityPoolRequest) (*distributiontypes.QueryCommunityPoolResponse, error)
- func (q LegacyDistributionGRPCQuerier) DelegationRewards(c context.Context, req *distributiontypes.QueryDelegationRewardsRequest) (*distributiontypes.QueryDelegationRewardsResponse, error)
- func (q LegacyDistributionGRPCQuerier) DelegationTotalRewards(c context.Context, req *distributiontypes.QueryDelegationTotalRewardsRequest) (*distributiontypes.QueryDelegationTotalRewardsResponse, error)
- func (q LegacyDistributionGRPCQuerier) DelegatorValidators(c context.Context, req *distributiontypes.QueryDelegatorValidatorsRequest) (*distributiontypes.QueryDelegatorValidatorsResponse, error)
- func (q LegacyDistributionGRPCQuerier) DelegatorWithdrawAddress(c context.Context, req *distributiontypes.QueryDelegatorWithdrawAddressRequest) (*distributiontypes.QueryDelegatorWithdrawAddressResponse, error)
- func (q LegacyDistributionGRPCQuerier) Params(c context.Context, req *distributiontypes.QueryParamsRequest) (*distributiontypes.QueryParamsResponse, error)
- func (q LegacyDistributionGRPCQuerier) ValidatorCommission(c context.Context, req *distributiontypes.QueryValidatorCommissionRequest) (*distributiontypes.QueryValidatorCommissionResponse, error)
- func (q LegacyDistributionGRPCQuerier) ValidatorOutstandingRewards(c context.Context, ...) (*distributiontypes.QueryValidatorOutstandingRewardsResponse, error)
- func (q LegacyDistributionGRPCQuerier) ValidatorSlashes(c context.Context, req *distributiontypes.QueryValidatorSlashesRequest) (*distributiontypes.QueryValidatorSlashesResponse, error)
- type LegacySlashingGRPCQuerier
- func (g LegacySlashingGRPCQuerier) Params(c context.Context, req *slashingtypes.QueryParamsRequest) (*slashingtypes.QueryParamsResponse, error)
- func (g LegacySlashingGRPCQuerier) SigningInfo(c context.Context, req *slashingtypes.QuerySigningInfoRequest) (*slashingtypes.QuerySigningInfoResponse, error)
- func (g LegacySlashingGRPCQuerier) SigningInfos(c context.Context, req *slashingtypes.QuerySigningInfosRequest) (*slashingtypes.QuerySigningInfosResponse, error)
- type LegacyStakingGRPCQuerier
- func (q LegacyStakingGRPCQuerier) Delegation(c context.Context, req *stakingtypes.QueryDelegationRequest) (*stakingtypes.QueryDelegationResponse, error)
- func (q LegacyStakingGRPCQuerier) DelegatorDelegations(c context.Context, req *stakingtypes.QueryDelegatorDelegationsRequest) (*stakingtypes.QueryDelegatorDelegationsResponse, error)
- func (q LegacyStakingGRPCQuerier) DelegatorUnbondingDelegations(c context.Context, req *stakingtypes.QueryDelegatorUnbondingDelegationsRequest) (*stakingtypes.QueryDelegatorUnbondingDelegationsResponse, error)
- func (q LegacyStakingGRPCQuerier) DelegatorValidator(c context.Context, req *stakingtypes.QueryDelegatorValidatorRequest) (*stakingtypes.QueryDelegatorValidatorResponse, error)
- func (q LegacyStakingGRPCQuerier) DelegatorValidators(c context.Context, req *stakingtypes.QueryDelegatorValidatorsRequest) (*stakingtypes.QueryDelegatorValidatorsResponse, error)
- func (q LegacyStakingGRPCQuerier) HistoricalInfo(c context.Context, req *stakingtypes.QueryHistoricalInfoRequest) (*stakingtypes.QueryHistoricalInfoResponse, error)
- func (q LegacyStakingGRPCQuerier) Params(c context.Context, req *stakingtypes.QueryParamsRequest) (*stakingtypes.QueryParamsResponse, error)
- func (q LegacyStakingGRPCQuerier) Pool(c context.Context, req *stakingtypes.QueryPoolRequest) (*stakingtypes.QueryPoolResponse, error)
- func (q LegacyStakingGRPCQuerier) Redelegations(c context.Context, req *stakingtypes.QueryRedelegationsRequest) (*stakingtypes.QueryRedelegationsResponse, error)
- func (q LegacyStakingGRPCQuerier) UnbondingDelegation(c context.Context, req *stakingtypes.QueryUnbondingDelegationRequest) (*stakingtypes.QueryUnbondingDelegationResponse, error)
- func (q LegacyStakingGRPCQuerier) Validator(c context.Context, req *stakingtypes.QueryValidatorRequest) (*stakingtypes.QueryValidatorResponse, error)
- func (q LegacyStakingGRPCQuerier) ValidatorDelegations(c context.Context, req *stakingtypes.QueryValidatorDelegationsRequest) (*stakingtypes.QueryValidatorDelegationsResponse, error)
- func (q LegacyStakingGRPCQuerier) ValidatorUnbondingDelegations(c context.Context, req *stakingtypes.QueryValidatorUnbondingDelegationsRequest) (*stakingtypes.QueryValidatorUnbondingDelegationsResponse, error)
- func (q LegacyStakingGRPCQuerier) Validators(c context.Context, req *stakingtypes.QueryValidatorsRequest) (*stakingtypes.QueryValidatorsResponse, error)
- type PoEKeeper
- type PoEKeeperMock
- func (m PoEKeeperMock) DistributionContract(ctx sdk.Context) DistributionContract
- func (m PoEKeeperMock) EngagementContract(ctx sdk.Context) EngagementContract
- func (m PoEKeeperMock) GetBondDenom(ctx sdk.Context) string
- func (m PoEKeeperMock) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
- func (m PoEKeeperMock) GetPoEContractAddress(ctx sdk.Context, ctype types.PoEContractType) (sdk.AccAddress, error)
- func (m PoEKeeperMock) HistoricalEntries(ctx sdk.Context) uint32
- func (m PoEKeeperMock) SetPoEContractAddress(ctx sdk.Context, ctype types.PoEContractType, contractAddr sdk.AccAddress)
- func (m PoEKeeperMock) SetValidatorInitialEngagementPoints(ctx sdk.Context, opAddr sdk.AccAddress, points sdk.Coin) error
- func (m PoEKeeperMock) StakeContract(ctx sdk.Context) StakeContract
- func (m PoEKeeperMock) ValsetContract(ctx sdk.Context) ValsetContract
- type Querier
- func (q Querier) ContractAddress(c context.Context, req *types.QueryContractAddressRequest) (*types.QueryContractAddressResponse, error)
- func (q Querier) HistoricalInfo(c context.Context, req *stakingtypes.QueryHistoricalInfoRequest) (*stakingtypes.QueryHistoricalInfoResponse, error)
- func (q Querier) UnbondingPeriod(c context.Context, req *types.QueryUnbondingPeriodRequest) (*types.QueryUnbondingPeriodResponse, error)
- func (q Querier) Validator(c context.Context, req *stakingtypes.QueryValidatorRequest) (*stakingtypes.QueryValidatorResponse, error)
- func (q Querier) ValidatorDelegation(c context.Context, req *types.QueryValidatorDelegationRequest) (*types.QueryValidatorDelegationResponse, error)
- func (q Querier) ValidatorEngagementReward(c context.Context, req *types.QueryValidatorEngagementRewardRequest) (*types.QueryValidatorEngagementRewardResponse, error)
- func (q Querier) ValidatorOutstandingReward(c context.Context, req *types.QueryValidatorOutstandingRewardRequest) (*types.QueryValidatorOutstandingRewardResponse, error)
- func (q Querier) ValidatorUnbondingDelegations(c context.Context, req *types.QueryValidatorUnbondingDelegationsRequest) (*types.QueryValidatorUnbondingDelegationsResponse, error)
- func (q Querier) Validators(c context.Context, req *stakingtypes.QueryValidatorsRequest) (*stakingtypes.QueryValidatorsResponse, error)
- type SmartQuerierMock
- type StakeContract
- type TestKeepers
- type TwasmKeeperMock
- type ValsetContract
- type ViewKeeper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaptureSetPoEContractAddressFn ¶
func CaptureSetPoEContractAddressFn() (func(ctx sdk.Context, ctype types.PoEContractType, contractAddr sdk.AccAddress), *[]CapturedPoEContractAddress)
CaptureSetPoEContractAddressFn helper for mocks to capture data when called
func DeliverGenTxs ¶
func DeliverGenTxs(genTxs []json.RawMessage, deliverTx DeliverTxFn, txEncodingConfig client.TxEncodingConfig) error
DeliverGenTxs iterates over all genesis txs, decodes each into a Tx and invokes the provided DeliverTxFn with the decoded Tx.
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper *Keeper) *types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func InitGenesis ¶
func InitGenesis( ctx sdk.Context, keeper initer, deliverTx DeliverTxFn, genesisState types.GenesisState, txEncodingConfig client.TxEncodingConfig, ) error
InitGenesis - initialize accounts and deliver genesis transactions
func NewMsgServerImpl ¶
func NewMsgServerImpl(poeKeeper PoEKeeper, contractKeeper wasmtypes.ContractOpsKeeper, twasmKeeper types.TWasmKeeper) types.MsgServer
NewMsgServerImpl returns an implementation of the bank MsgServer interface for the provided Keeper.
func NewWasmVMMock ¶
func NewWasmVMMock(mutators ...func(*wasmtesting.MockWasmer)) *wasmtesting.MockWasmer
NewWasmVMMock creates a new WasmerEngine mock with basic ops for create/instantiation set to noops.
func RandomAddress ¶
func RandomAddress(_ *testing.T) sdk.AccAddress
func SwitchPoEContractAddressFn ¶
func SwitchPoEContractAddressFn(t *testing.T, myValsetContract sdk.AccAddress, myStakingContract sdk.AccAddress) func(ctx sdk.Context, ctype types.PoEContractType) (sdk.AccAddress, error)
Types ¶
type CapturedPoEContractAddress ¶
type CapturedPoEContractAddress struct { Ctype types.PoEContractType ContractAddr sdk.AccAddress }
CapturedPoEContractAddress data type
type ContractSource ¶
type ContractSource interface {
GetPoEContractAddress(sdk.Context, types.PoEContractType) (sdk.AccAddress, error)
}
ContractSource subset of poe keeper
type DeliverTxFn ¶
type DeliverTxFn func(abci.RequestDeliverTx) abci.ResponseDeliverTx
type DistributionContract ¶
type DistributionContract interface { // ValidatorOutstandingReward returns amount or 0 for an unknown address ValidatorOutstandingReward(ctx sdk.Context, addr sdk.AccAddress) (sdk.Coin, error) Address() (sdk.AccAddress, error) }
type EngagementContract ¶
type EngagementContract interface { UpdateAdmin(ctx sdk.Context, newAdmin, sender sdk.AccAddress) error // QueryDelegated returns withdrawal address when set QueryDelegated(ctx sdk.Context, ownerAddr sdk.AccAddress) (*contract.DelegatedResponse, error) QueryWithdrawableRewards(ctx sdk.Context, addr sdk.AccAddress) (sdk.Coin, error) Address() (sdk.AccAddress, error) }
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( marshaler codec.Codec, key sdk.StoreKey, paramSpace paramtypes.Subspace, twasmK types.TWasmKeeper, ak types.AuthKeeper, ) Keeper
NewKeeper constructor
func (*Keeper) DeleteHistoricalInfo ¶
DeleteHistoricalInfo deletes the historical info at a given height
func (*Keeper) DistributionContract ¶
func (k *Keeper) DistributionContract(ctx sdk.Context) DistributionContract
func (*Keeper) EngagementContract ¶
func (k *Keeper) EngagementContract(ctx sdk.Context) EngagementContract
func (*Keeper) GetEngagementPoints ¶
GetEngagementPoints read engagement points from contract
func (*Keeper) GetHistoricalInfo ¶
func (k *Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
GetHistoricalInfo gets the historical info at a given height
func (*Keeper) GetInitialValidatorEngagementPoints ¶
GetInitialValidatorEngagementPoints get number of engagement for any new validator joining post genesis
func (*Keeper) GetPoEContractAddress ¶
func (k *Keeper) GetPoEContractAddress(ctx sdk.Context, ctype types.PoEContractType) (sdk.AccAddress, error)
GetPoEContractAddress get the stored contract address for the given type or returns an error when not exists (yet)
func (*Keeper) GetValidatorVotes ¶
func (*Keeper) HistoricalEntries ¶
HistoricalEntries = number of historical info entries to persist in store
func (*Keeper) InitContractAddressCache ¶
InitContractAddressCache adds all poe contracts to the in memory cache
func (*Keeper) IteratePoEContracts ¶
func (k *Keeper) IteratePoEContracts(ctx sdk.Context, cb func(types.PoEContractType, sdk.AccAddress) bool)
IteratePoEContracts for each persisted PoE contract the given callback is called. When the callback returns true, the loop is aborted early.
func (*Keeper) MinimumDelegationAmounts ¶
func (*Keeper) SetHistoricalInfo ¶
func (k *Keeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi *stakingtypes.HistoricalInfo)
SetHistoricalInfo sets the historical info at a given height
func (*Keeper) SetPoEContractAddress ¶
func (k *Keeper) SetPoEContractAddress(ctx sdk.Context, ctype types.PoEContractType, contractAddr sdk.AccAddress)
SetPoEContractAddress stores the contract address for the given type. If one exists already then it is overwritten.
func (*Keeper) SetValidatorInitialEngagementPoints ¶
func (k *Keeper) SetValidatorInitialEngagementPoints(ctx sdk.Context, opAddr sdk.AccAddress, selfDelegation sdk.Coin) error
SetValidatorInitialEngagementPoints set an initial amount of engagement points for a validator when it matches self delegation preconditions
func (*Keeper) StakeContract ¶
func (k *Keeper) StakeContract(ctx sdk.Context) StakeContract
func (*Keeper) TrackHistoricalInfo ¶
TrackHistoricalInfo saves the latest historical-info and deletes the oldest heights that are below pruning height
func (*Keeper) UnbondingTime ¶
UnbondingTime returns the unbonding period from the staking contract
func (*Keeper) UpdateValidatorVotes ¶
func (*Keeper) ValsetContract ¶
func (k *Keeper) ValsetContract(ctx sdk.Context) ValsetContract
type LegacyDistributionGRPCQuerier ¶
type LegacyDistributionGRPCQuerier struct {
// contains filtered or unexported fields
}
func NewLegacyDistributionGRPCQuerier ¶
func NewLegacyDistributionGRPCQuerier(keeper ViewKeeper) *LegacyDistributionGRPCQuerier
func (LegacyDistributionGRPCQuerier) CommunityPool ¶
func (q LegacyDistributionGRPCQuerier) CommunityPool(c context.Context, req *distributiontypes.QueryCommunityPoolRequest) (*distributiontypes.QueryCommunityPoolResponse, error)
func (LegacyDistributionGRPCQuerier) DelegationRewards ¶
func (q LegacyDistributionGRPCQuerier) DelegationRewards(c context.Context, req *distributiontypes.QueryDelegationRewardsRequest) (*distributiontypes.QueryDelegationRewardsResponse, error)
func (LegacyDistributionGRPCQuerier) DelegationTotalRewards ¶
func (q LegacyDistributionGRPCQuerier) DelegationTotalRewards(c context.Context, req *distributiontypes.QueryDelegationTotalRewardsRequest) (*distributiontypes.QueryDelegationTotalRewardsResponse, error)
func (LegacyDistributionGRPCQuerier) DelegatorValidators ¶
func (q LegacyDistributionGRPCQuerier) DelegatorValidators(c context.Context, req *distributiontypes.QueryDelegatorValidatorsRequest) (*distributiontypes.QueryDelegatorValidatorsResponse, error)
func (LegacyDistributionGRPCQuerier) DelegatorWithdrawAddress ¶
func (q LegacyDistributionGRPCQuerier) DelegatorWithdrawAddress(c context.Context, req *distributiontypes.QueryDelegatorWithdrawAddressRequest) (*distributiontypes.QueryDelegatorWithdrawAddressResponse, error)
func (LegacyDistributionGRPCQuerier) Params ¶
func (q LegacyDistributionGRPCQuerier) Params(c context.Context, req *distributiontypes.QueryParamsRequest) (*distributiontypes.QueryParamsResponse, error)
Params is not supported. Method returns default distribution module params.
func (LegacyDistributionGRPCQuerier) ValidatorCommission ¶
func (q LegacyDistributionGRPCQuerier) ValidatorCommission(c context.Context, req *distributiontypes.QueryValidatorCommissionRequest) (*distributiontypes.QueryValidatorCommissionResponse, error)
func (LegacyDistributionGRPCQuerier) ValidatorOutstandingRewards ¶
func (q LegacyDistributionGRPCQuerier) ValidatorOutstandingRewards(c context.Context, req *distributiontypes.QueryValidatorOutstandingRewardsRequest) (*distributiontypes.QueryValidatorOutstandingRewardsResponse, error)
func (LegacyDistributionGRPCQuerier) ValidatorSlashes ¶
func (q LegacyDistributionGRPCQuerier) ValidatorSlashes(c context.Context, req *distributiontypes.QueryValidatorSlashesRequest) (*distributiontypes.QueryValidatorSlashesResponse, error)
type LegacySlashingGRPCQuerier ¶
type LegacySlashingGRPCQuerier struct {
// contains filtered or unexported fields
}
func NewLegacySlashingGRPCQuerier ¶
func NewLegacySlashingGRPCQuerier(keeper ContractSource) *LegacySlashingGRPCQuerier
func (LegacySlashingGRPCQuerier) Params ¶
func (g LegacySlashingGRPCQuerier) Params(c context.Context, req *slashingtypes.QueryParamsRequest) (*slashingtypes.QueryParamsResponse, error)
Params is not supported. Method returns default slashing module params.
func (LegacySlashingGRPCQuerier) SigningInfo ¶
func (g LegacySlashingGRPCQuerier) SigningInfo(c context.Context, req *slashingtypes.QuerySigningInfoRequest) (*slashingtypes.QuerySigningInfoResponse, error)
SigningInfo legacy support for cosmos-sdk signing info. Note that not all field are available on gridiron
func (LegacySlashingGRPCQuerier) SigningInfos ¶
func (g LegacySlashingGRPCQuerier) SigningInfos(c context.Context, req *slashingtypes.QuerySigningInfosRequest) (*slashingtypes.QuerySigningInfosResponse, error)
SigningInfos is not supported and will return unimplemented error
type LegacyStakingGRPCQuerier ¶
type LegacyStakingGRPCQuerier struct {
// contains filtered or unexported fields
}
func NewLegacyStakingGRPCQuerier ¶
func NewLegacyStakingGRPCQuerier(poeKeeper stakingQuerierKeeper) *LegacyStakingGRPCQuerier
func (LegacyStakingGRPCQuerier) Delegation ¶
func (q LegacyStakingGRPCQuerier) Delegation(c context.Context, req *stakingtypes.QueryDelegationRequest) (*stakingtypes.QueryDelegationResponse, error)
Delegation legacy support for querying the delegate info for a given validator delegator pair Returns response or NotFound error when none exists.
func (LegacyStakingGRPCQuerier) DelegatorDelegations ¶
func (q LegacyStakingGRPCQuerier) DelegatorDelegations(c context.Context, req *stakingtypes.QueryDelegatorDelegationsRequest) (*stakingtypes.QueryDelegatorDelegationsResponse, error)
DelegatorDelegations legacy support for querying all delegations of a given delegator address. In PoE only validator operators do self delegations/ unbondings. Result set is either zero or one element.
func (LegacyStakingGRPCQuerier) DelegatorUnbondingDelegations ¶
func (q LegacyStakingGRPCQuerier) DelegatorUnbondingDelegations(c context.Context, req *stakingtypes.QueryDelegatorUnbondingDelegationsRequest) (*stakingtypes.QueryDelegatorUnbondingDelegationsResponse, error)
DelegatorUnbondingDelegations legacy support for querying all unbonding delegations of a given delegator address In PoE only validator operators do self delegations/ unbondings. Result set is either zero or one element.
func (LegacyStakingGRPCQuerier) DelegatorValidator ¶
func (q LegacyStakingGRPCQuerier) DelegatorValidator(c context.Context, req *stakingtypes.QueryDelegatorValidatorRequest) (*stakingtypes.QueryDelegatorValidatorResponse, error)
func (LegacyStakingGRPCQuerier) DelegatorValidators ¶
func (q LegacyStakingGRPCQuerier) DelegatorValidators(c context.Context, req *stakingtypes.QueryDelegatorValidatorsRequest) (*stakingtypes.QueryDelegatorValidatorsResponse, error)
func (LegacyStakingGRPCQuerier) HistoricalInfo ¶
func (q LegacyStakingGRPCQuerier) HistoricalInfo(c context.Context, req *stakingtypes.QueryHistoricalInfoRequest) (*stakingtypes.QueryHistoricalInfoResponse, error)
HistoricalInfo queries the historical info for given height
func (LegacyStakingGRPCQuerier) Params ¶
func (q LegacyStakingGRPCQuerier) Params(c context.Context, req *stakingtypes.QueryParamsRequest) (*stakingtypes.QueryParamsResponse, error)
func (LegacyStakingGRPCQuerier) Pool ¶
func (q LegacyStakingGRPCQuerier) Pool(c context.Context, req *stakingtypes.QueryPoolRequest) (*stakingtypes.QueryPoolResponse, error)
func (LegacyStakingGRPCQuerier) Redelegations ¶
func (q LegacyStakingGRPCQuerier) Redelegations(c context.Context, req *stakingtypes.QueryRedelegationsRequest) (*stakingtypes.QueryRedelegationsResponse, error)
func (LegacyStakingGRPCQuerier) UnbondingDelegation ¶
func (q LegacyStakingGRPCQuerier) UnbondingDelegation(c context.Context, req *stakingtypes.QueryUnbondingDelegationRequest) (*stakingtypes.QueryUnbondingDelegationResponse, error)
UnbondingDelegation legacy support for querying the unbonding info for given validator delegator pair Returns response or NotFound error when none exists.
func (LegacyStakingGRPCQuerier) Validator ¶
func (q LegacyStakingGRPCQuerier) Validator(c context.Context, req *stakingtypes.QueryValidatorRequest) (*stakingtypes.QueryValidatorResponse, error)
Validator legacy support for querying the validator info for a given validator address. returns NotFound error code when none exists for the given address
func (LegacyStakingGRPCQuerier) ValidatorDelegations ¶
func (q LegacyStakingGRPCQuerier) ValidatorDelegations(c context.Context, req *stakingtypes.QueryValidatorDelegationsRequest) (*stakingtypes.QueryValidatorDelegationsResponse, error)
ValidatorDelegations legacy support for querying the delegate infos for a given validator. In PoE only validator operators do self delegations/ unbondings. Result set is either zero or one element.
func (LegacyStakingGRPCQuerier) ValidatorUnbondingDelegations ¶
func (q LegacyStakingGRPCQuerier) ValidatorUnbondingDelegations(c context.Context, req *stakingtypes.QueryValidatorUnbondingDelegationsRequest) (*stakingtypes.QueryValidatorUnbondingDelegationsResponse, error)
ValidatorUnbondingDelegations legacy support for querying the unbonding delegations of a validator. In PoE only validator operators do self delegations/ unbondings. Result set is either zero or one element.
func (LegacyStakingGRPCQuerier) Validators ¶
func (q LegacyStakingGRPCQuerier) Validators(c context.Context, req *stakingtypes.QueryValidatorsRequest) (*stakingtypes.QueryValidatorsResponse, error)
Validators legacy support for querying all validators that match the given status
type PoEKeeper ¶
type PoEKeeper interface { ContractSource SetValidatorInitialEngagementPoints(ctx sdk.Context, address sdk.AccAddress, value sdk.Coin) error GetBondDenom(ctx sdk.Context) string ValsetContract(ctx sdk.Context) ValsetContract }
PoEKeeper is a subset of the keeper
type PoEKeeperMock ¶
type PoEKeeperMock struct { GetPoEContractAddressFn func(ctx sdk.Context, ctype types.PoEContractType) (sdk.AccAddress, error) SetValidatorInitialEngagementPointsFn func(ctx sdk.Context, address sdk.AccAddress, value sdk.Coin) error SetPoEContractAddressFn func(ctx sdk.Context, ctype types.PoEContractType, contractAddr sdk.AccAddress) GetBondDenomFn func(ctx sdk.Context) string HistoricalEntriesFn func(ctx sdk.Context) uint32 UnbondingTimeFn func(ctx sdk.Context) time.Duration GetHistoricalInfoFn func(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool) DistributionContractFn func(ctx sdk.Context) DistributionContract ValsetContractFn func(ctx sdk.Context) ValsetContract StakeContractFn func(ctx sdk.Context) StakeContract EngagementContractFn func(ctx sdk.Context) EngagementContract // contains filtered or unexported fields }
PoEKeeperMock mocks Keeper methods
func (PoEKeeperMock) DistributionContract ¶
func (m PoEKeeperMock) DistributionContract(ctx sdk.Context) DistributionContract
func (PoEKeeperMock) EngagementContract ¶
func (m PoEKeeperMock) EngagementContract(ctx sdk.Context) EngagementContract
func (PoEKeeperMock) GetBondDenom ¶
func (m PoEKeeperMock) GetBondDenom(ctx sdk.Context) string
func (PoEKeeperMock) GetHistoricalInfo ¶
func (m PoEKeeperMock) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
func (PoEKeeperMock) GetPoEContractAddress ¶
func (m PoEKeeperMock) GetPoEContractAddress(ctx sdk.Context, ctype types.PoEContractType) (sdk.AccAddress, error)
func (PoEKeeperMock) HistoricalEntries ¶
func (m PoEKeeperMock) HistoricalEntries(ctx sdk.Context) uint32
func (PoEKeeperMock) SetPoEContractAddress ¶
func (m PoEKeeperMock) SetPoEContractAddress(ctx sdk.Context, ctype types.PoEContractType, contractAddr sdk.AccAddress)
func (PoEKeeperMock) SetValidatorInitialEngagementPoints ¶
func (m PoEKeeperMock) SetValidatorInitialEngagementPoints(ctx sdk.Context, opAddr sdk.AccAddress, points sdk.Coin) error
func (PoEKeeperMock) StakeContract ¶
func (m PoEKeeperMock) StakeContract(ctx sdk.Context) StakeContract
func (PoEKeeperMock) ValsetContract ¶
func (m PoEKeeperMock) ValsetContract(ctx sdk.Context) ValsetContract
type Querier ¶
type Querier struct {
// contains filtered or unexported fields
}
func (Querier) ContractAddress ¶
func (q Querier) ContractAddress(c context.Context, req *types.QueryContractAddressRequest) (*types.QueryContractAddressResponse, error)
ContractAddress query PoE contract address for given type
func (Querier) HistoricalInfo ¶
func (q Querier) HistoricalInfo(c context.Context, req *stakingtypes.QueryHistoricalInfoRequest) (*stakingtypes.QueryHistoricalInfoResponse, error)
func (Querier) UnbondingPeriod ¶
func (q Querier) UnbondingPeriod(c context.Context, req *types.QueryUnbondingPeriodRequest) (*types.QueryUnbondingPeriodResponse, error)
UnbondingPeriod query the global unbonding period
func (Querier) Validator ¶
func (q Querier) Validator(c context.Context, req *stakingtypes.QueryValidatorRequest) (*stakingtypes.QueryValidatorResponse, error)
Validator queries validator info for a given validator address. returns NotFound error code when none exists for the given address
func (Querier) ValidatorDelegation ¶
func (q Querier) ValidatorDelegation(c context.Context, req *types.QueryValidatorDelegationRequest) (*types.QueryValidatorDelegationResponse, error)
func (Querier) ValidatorEngagementReward ¶
func (q Querier) ValidatorEngagementReward(c context.Context, req *types.QueryValidatorEngagementRewardRequest) (*types.QueryValidatorEngagementRewardResponse, error)
func (Querier) ValidatorOutstandingReward ¶
func (q Querier) ValidatorOutstandingReward(c context.Context, req *types.QueryValidatorOutstandingRewardRequest) (*types.QueryValidatorOutstandingRewardResponse, error)
func (Querier) ValidatorUnbondingDelegations ¶
func (q Querier) ValidatorUnbondingDelegations(c context.Context, req *types.QueryValidatorUnbondingDelegationsRequest) (*types.QueryValidatorUnbondingDelegationsResponse, error)
func (Querier) Validators ¶
func (q Querier) Validators(c context.Context, req *stakingtypes.QueryValidatorsRequest) (*stakingtypes.QueryValidatorsResponse, error)
Validators query all validators that match the given status.
type SmartQuerierMock ¶
type SmartQuerierMock struct {
QuerySmartFn func(ctx sdk.Context, contractAddr sdk.AccAddress, req []byte) ([]byte, error)
}
SmartQuerierMock Mock queries to a contract
func (SmartQuerierMock) QuerySmart ¶
func (m SmartQuerierMock) QuerySmart(ctx sdk.Context, contractAddr sdk.AccAddress, req []byte) ([]byte, error)
type StakeContract ¶
type StakeContract interface { // QueryStakedAmount returns amount in default denom or nil value for an unknown address QueryStakedAmount(ctx sdk.Context, opAddr sdk.AccAddress) (*sdk.Int, error) QueryStakingUnbondingPeriod(ctx sdk.Context) (time.Duration, error) // QueryStakingUnbonding returns the unbondings or empty list for an unknown address QueryStakingUnbonding(ctx sdk.Context, opAddr sdk.AccAddress) ([]stakingtypes.UnbondingDelegationEntry, error) Address() (sdk.AccAddress, error) }
type TestKeepers ¶
type TestKeepers struct { AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper GovKeeper govkeeper.Keeper TWasmKeeper *twasmkeeper.Keeper IBCKeeper *ibckeeper.Keeper PoEKeeper *Keeper EncodingConfig simappparams.EncodingConfig UpgradeKeeper upgradekeeper.Keeper Faucet *wasmkeeper.TestFaucet BaseApp *baseapp.BaseApp }
func CreateDefaultTestInput ¶
func CreateDefaultTestInput(t *testing.T, opts ...wasmkeeper.Option) (sdk.Context, TestKeepers)
CreateDefaultTestInput common settings for CreateTestInput
func CreateTestInput ¶
func CreateTestInput(t *testing.T, isCheckTx bool, supportedFeatures string, opts ...wasmkeeper.Option) (sdk.Context, TestKeepers)
CreateTestInput encoders can be nil to accept the defaults, or set it to override some of the message handlers (like default)
type TwasmKeeperMock ¶
type TwasmKeeperMock struct { QuerySmartFn func(ctx sdk.Context, contractAddr sdk.AccAddress, req []byte) ([]byte, error) SudoFn func(ctx sdk.Context, contractAddress sdk.AccAddress, msg []byte) ([]byte, error) GetContractKeeperFn func() wasmtypes.ContractOpsKeeper }
TwasmKeeperMock mock smart queries and sudo calls
func (TwasmKeeperMock) GetContractKeeper ¶
func (m TwasmKeeperMock) GetContractKeeper() wasmtypes.ContractOpsKeeper
func (TwasmKeeperMock) QuerySmart ¶
func (m TwasmKeeperMock) QuerySmart(ctx sdk.Context, contractAddr sdk.AccAddress, req []byte) ([]byte, error)
func (TwasmKeeperMock) Sudo ¶
func (m TwasmKeeperMock) Sudo(ctx sdk.Context, contractAddress sdk.AccAddress, msg []byte) ([]byte, error)
type ValsetContract ¶
type ValsetContract interface { ListValidators(ctx sdk.Context, pagination *contract.Paginator) ([]stakingtypes.Validator, contract.PaginationCursor, error) QueryValidator(ctx sdk.Context, opAddr sdk.AccAddress) (*stakingtypes.Validator, error) ListValidatorSlashing(ctx sdk.Context, opAddr sdk.AccAddress) ([]contract.ValidatorSlashing, error) QueryConfig(ctx sdk.Context) (*contract.ValsetConfigResponse, error) UpdateAdmin(ctx sdk.Context, new sdk.AccAddress, sender sdk.AccAddress) error IterateActiveValidators(ctx sdk.Context, callback func(c contract.ValidatorInfo) bool, pagination *contract.Paginator) error Address() (sdk.AccAddress, error) }
type ViewKeeper ¶
type ViewKeeper interface { ContractSource GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool) GetBondDenom(ctx sdk.Context) string DistributionContract(ctx sdk.Context) DistributionContract ValsetContract(ctx sdk.Context) ValsetContract StakeContract(ctx sdk.Context) StakeContract EngagementContract(ctx sdk.Context) EngagementContract }