You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IterateBondedValidatorsByPower(
sdk.Context, func(indexint64, validator stakingtypes.ValidatorI) (stopbool),
)
TotalBondedTokens(sdk.Context) sdk.Int// total bonded tokens within the validator setIterateDelegations(
ctxsdk.Context, delegatorsdk.AccAddress,
fnfunc(indexint64, delegation stakingtypes.DelegationI) (stopbool),
)
So we should add a staking_keeper.go file in x/superfluid/keeper/ and add these three methods. IterateBondedValidatorsByPower and TotalBondedTokens can just return data from the underlying staking keeper.
IterateDelegations needs to basically just return the staking keepers delegations and then construct delegations from the existing superfluid delegations from this address. Looking at the Tally code it appears that it should be fine to return multiple delegation structs for each validator, making this even simpler to integrate.
We should make golang tests for this, by making a validator vote, a superfluid delegator override it, and see that it works.
The text was updated successfully, but these errors were encountered:
How are the stakingkeeper and superfluidkeeper combined inside the gov module? Is there already a feature for merging multiple staking keepers?
EDIT: oh I see the superfluid keeper act as a wrapper for staking keeper, so by exposing the method of the underlying, it covers the staking amount of both keepers.
EDIT: then why doesnt it work to simply use the underlying stakingkeeper to governance? because of the delegations are done by intermediary. okay.
To give SFS stakers direct voting power in votes, we need to pass in the superfluid staking keeper as the staking keeper to the governance keeper.
The governance keeper requires the following methods defined in order to be a staking keeper: https://github.com/cosmos/cosmos-sdk/blob/master/x/gov/types/expected_keepers.go#L16-L27
So we should add a staking_keeper.go file in
x/superfluid/keeper/
and add these three methods.IterateBondedValidatorsByPower
andTotalBondedTokens
can just return data from the underlying staking keeper.IterateDelegations needs to basically just return the staking keepers delegations and then construct delegations from the existing superfluid delegations from this address. Looking at the Tally code it appears that it should be fine to return multiple delegation structs for each validator, making this even simpler to integrate.
We should make golang tests for this, by making a validator vote, a superfluid delegator override it, and see that it works.
The text was updated successfully, but these errors were encountered: