Skip to content

Commit

Permalink
fix: gov support for superfluid (#1555)
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: #1543 (comment)

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
  • Loading branch information
p0mvn authored May 21, 2022
1 parent f5472e0 commit 8aaa84b
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 @@ -9,6 +9,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 @@ -30,6 +31,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 8aaa84b

Please sign in to comment.