Skip to content

Commit

Permalink
fix: gov support for superfluid (#1555) (#1557)
Browse files Browse the repository at this point in the history
Closes: #XXX

## What is the purpose of the change

@czarcas7ic and I ran into issues manually testing #1191 . We both reproduces this test case: https://github.com/osmosis-labs/osmosis/discussions/1543#discussioncomment-2786650

Upon further investigation, it was found that staking keeper was never replaced with superfluid keeper in the gov module so that the new logic could not be used for calculating tally and overriding validator votes by SF stakers.

We need to e2e test this case in a future PR: #1556

## Testing and Verifying

This change is a trivial rework / code cleanup without any test coverage.

## Documentation and Release Note

  - Does this pull request introduce a new feature or user-facing behavior changes? no
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? no
  - How is the feature or change documented? not applicable

(cherry picked from commit 8aaa84b)

Co-authored-by: Roman <[email protected]>
  • Loading branch information
mergify[bot] and p0mvn authored May 21, 2022
1 parent 46cc167 commit 428b9d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
govKeeper := govkeeper.NewKeeper(
appCodec, appKeepers.keys[govtypes.StoreKey],
appKeepers.GetSubspace(govtypes.ModuleName), appKeepers.AccountKeeper, appKeepers.BankKeeper,
appKeepers.StakingKeeper, govRouter)
appKeepers.SuperfluidKeeper, govRouter)
appKeepers.GovKeeper = &govKeeper
}

Expand Down
3 changes: 3 additions & 0 deletions x/superfluid/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
)

Expand All @@ -31,6 +32,8 @@ type Keeper struct {
lms types.LockupMsgServer
}

var _ govtypes.StakingKeeper = (*Keeper)(nil)

// NewKeeper returns an instance of Keeper.
func NewKeeper(cdc codec.Codec, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, ak authkeeper.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, dk types.DistrKeeper, ek types.EpochKeeper, lk types.LockupKeeper, gk types.GammKeeper, ik types.IncentivesKeeper, lms types.LockupMsgServer) *Keeper {
// set KeyTable if it has not already been set
Expand Down

0 comments on commit 428b9d8

Please sign in to comment.