Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnya97 committed Sep 17, 2023
1 parent 1a18bf6 commit 9382028
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion x/concentrated-liquidity/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (k *Keeper) SetListeners(listeners types.ConcentratedLiquidityListeners) *K
return k
}

// ValidatePermissionlessPoolCreationEnabled returns nil if permissionless pool creation in the module is enabled.
// IsPermissionlessPoolCreationEnabled returns nil if permissionless pool creation in the module is enabled.
// Otherwise, returns an error.
func (k Keeper) IsPermissionlessPoolCreationEnabled(ctx sdk.Context) bool {
return k.GetParams(ctx).IsPermissionlessPoolCreationEnabled
Expand Down
6 changes: 3 additions & 3 deletions x/concentrated-liquidity/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,18 +430,18 @@ func (s *KeeperTestSuite) AddBlockTime(timeToAdd time.Duration) {
s.Ctx = s.Ctx.WithBlockTime(s.Ctx.BlockTime().Add(timeToAdd))
}

func (s *KeeperTestSuite) TestValidatePermissionlessPoolCreationEnabled() {
func (s *KeeperTestSuite) TestIsPermissionlessPoolCreationEnabled() {
// Normally, by default, permissionless pool creation is disabled.
// SetupTest, however, calls SetupConcentratedLiquidityDenomsAndPoolCreation which enables permissionless pool creation.
s.Require().True(s.App.ConcentratedLiquidityKeeper.ValidatePermissionlessPoolCreationEnabled(s.Ctx))
s.Require().True(s.App.ConcentratedLiquidityKeeper.IsPermissionlessPoolCreationEnabled(s.Ctx))

// Disable permissionless pool creation.
defaultParams := types.DefaultParams()
defaultParams.IsPermissionlessPoolCreationEnabled = false
s.App.ConcentratedLiquidityKeeper.SetParams(s.Ctx, defaultParams)

// Validate that permissionless pool creation is disabled.
s.Require().False(s.App.ConcentratedLiquidityKeeper.ValidatePermissionlessPoolCreationEnabled(s.Ctx))
s.Require().False(s.App.ConcentratedLiquidityKeeper.IsPermissionlessPoolCreationEnabled(s.Ctx))
}

func (s *KeeperTestSuite) runMultipleAuthorizedUptimes(tests func()) {
Expand Down
2 changes: 1 addition & 1 deletion x/concentrated-liquidity/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (k Keeper) InitializePool(ctx sdk.Context, poolI poolmanagertypes.PoolI, cr
}

if !bypassRestrictions {
if !k.ValidatePermissionlessPoolCreationEnabled(ctx) {
if !k.IsPermissionlessPoolCreationEnabled(ctx) {
return types.ErrPermissionlessPoolCreationDisabled
}

Expand Down

0 comments on commit 9382028

Please sign in to comment.