Skip to content

Commit

Permalink
add TestSetStableSwapScalingFactors but still comment out because sta…
Browse files Browse the repository at this point in the history
…bleswap still disable
  • Loading branch information
vuong177 committed May 19, 2022
1 parent afe0887 commit bd83d2d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x/gamm/keeper/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func (k Keeper) GetNextPoolNumberAndIncrement(ctx sdk.Context) uint64 {
}

// set ScalingFactors in stable stableswap pools
func (k *Keeper) setStableSwapScalingFactors(ctx sdk.Context, scalingFactors []uint64, poolId uint64, scalingFactorGovernor string) error {
func (k *Keeper) SetStableSwapScalingFactors(ctx sdk.Context, scalingFactors []uint64, poolId uint64, scalingFactorGovernor string) error {
poolI, err := k.GetPoolAndPoke(ctx, poolId)
if err != nil {
return err
Expand Down
34 changes: 34 additions & 0 deletions x/gamm/keeper/pool_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,3 +573,37 @@ func (suite *KeeperTestSuite) TestJoinSwapExactAmountInConsistency() {
})
}
}

// func (suite *KeeperTestSuite) TestSetStableSwapScalingFactors() {
// stableSwapPoolParams := stableswap.PoolParams{
// SwapFee: defaultSwapFee,
// ExitFee: defaultExitFee,
// }

// testPoolAsset := sdk.Coins{
// sdk.NewCoin("foo", sdk.NewInt(10000)),
// sdk.NewCoin("bar", sdk.NewInt(10000)),
// }

// suite.FundAcc(suite.TestAccs[0], defaultAcctFunds)

// testScalingFactors := []uint64{1, 1}

// msg := stableswap.NewMsgCreateStableswapPool(
// suite.TestAccs[0], stableSwapPoolParams, testPoolAsset, defaultFutureGovernor)
// poolID, err := suite.App.GAMMKeeper.CreatePool(suite.Ctx, msg)
// suite.Require().NoError(err)

// err = suite.App.GAMMKeeper.SetStableSwapScalingFactors(suite.Ctx, testScalingFactors, poolID, "")
// suite.Require().NoError(err)

// poolI, err := suite.App.GAMMKeeper.GetPoolAndPoke(suite.Ctx, poolID)
// suite.Require().NoError(err)

// poolScalingFactors := poolI.(*stableswap.Pool).GetScalingFactors()

// suite.Require().Equal(
// poolScalingFactors,
// testScalingFactors,
// )
// }

0 comments on commit bd83d2d

Please sign in to comment.