Skip to content

Commit

Permalink
simplify for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed Aug 2, 2023
1 parent 0b1af18 commit bb111c0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions x/gamm/keeper/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,20 +377,17 @@ func (k Keeper) CreateConcentratedPoolFromCFMM(ctx sdk.Context, cfmmPoolIdToLink
return nil, types.MustHaveTwoDenomsError{NumDenoms: len(poolLiquidity)}
}

foundDenom0 := false
denom1 := ""
for _, coin := range poolLiquidity {
if coin.Denom == desiredDenom0 {
foundDenom0 = true
} else {
continue
} else if denom1 == "" {
denom1 = coin.Denom
} else {
return nil, types.NoDesiredDenomInPoolError{DesiredDenom: desiredDenom0}
}
}

if !foundDenom0 {
return nil, types.NoDesiredDenomInPoolError{DesiredDenom: desiredDenom0}
}

createPoolMsg := clmodel.NewMsgCreateConcentratedPool(poolCreatorAddress, desiredDenom0, denom1, tickSpacing, spreadFactor)
concentratedPool, err := k.poolManager.CreateConcentratedPoolAsPoolManager(ctx, createPoolMsg)
if err != nil {
Expand Down

0 comments on commit bb111c0

Please sign in to comment.