From f84fce330e27d689bc06dd3ae9c86cd83adc5094 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Mon, 27 Feb 2023 17:03:39 +0700 Subject: [PATCH 01/26] remove exit fee param --- app/apptesting/gamm.go | 4 - app/apptesting/test_suite.go | 1 - app/upgrades/v15/upgrade_test.go | 2 - app/upgrades/v15/upgrades.go | 2 +- .../pool-models/balancer/balancerPool.proto | 5 - .../stableswap/stableswap_pool.proto | 5 - tests/ibc-hooks/ibc_middleware_test.go | 2 - tests/mocks/cfmm_pool.go | 42 ----- tests/mocks/cl_pool.go | 14 -- wasmbinding/test/custom_query_test.go | 1 - x/concentrated-liquidity/model/pool.go | 5 - x/gamm/README.md | 1 - x/gamm/client/cli/cli_test.go | 27 ++-- x/gamm/client/cli/flags.go | 3 - x/gamm/client/cli/tx.go | 12 -- x/gamm/keeper/gas_test.go | 1 - x/gamm/keeper/genesis_test.go | 5 - x/gamm/keeper/grpc_query.go | 4 +- x/gamm/keeper/grpc_query_test.go | 1 - x/gamm/keeper/pool_service.go | 3 +- x/gamm/keeper/pool_service_test.go | 27 ---- x/gamm/keeper/pool_test.go | 4 - x/gamm/keeper/swap_test.go | 2 - x/gamm/pool-models/balancer/amm_test.go | 16 +- .../pool-models/balancer/balancerPool.pb.go | 152 ++++++------------ x/gamm/pool-models/balancer/marshal_test.go | 2 - x/gamm/pool-models/balancer/msgs_test.go | 7 +- x/gamm/pool-models/balancer/pool.go | 6 +- x/gamm/pool-models/balancer/pool_params.go | 13 -- .../pool-models/balancer/pool_suite_test.go | 2 +- x/gamm/pool-models/balancer/pool_test.go | 6 +- .../internal/cfmm_common/lp_test.go | 19 ++- x/gamm/pool-models/stableswap/msgs_test.go | 5 +- x/gamm/pool-models/stableswap/pool.go | 4 - x/gamm/pool-models/stableswap/pool_params.go | 8 - x/gamm/pool-models/stableswap/pool_test.go | 6 +- .../stableswap/stableswap_pool.pb.go | 130 +++++---------- x/gamm/pool-models/stableswap/util_test.go | 1 - x/gamm/simulation/sim_msgs.go | 7 +- x/poolmanager/client/cli/cli_test.go | 36 ++--- x/poolmanager/client/cli/flags.go | 3 - x/poolmanager/client/cli/tx.go | 12 -- x/poolmanager/client/testutil/test_helpers.go | 10 +- x/poolmanager/create_pool_test.go | 3 - x/poolmanager/keeper_test.go | 1 - x/poolmanager/router_test.go | 5 - x/poolmanager/types/pool.go | 3 - x/protorev/keeper/keeper_test.go | 49 +----- x/superfluid/keeper/gov/gov_test.go | 1 - x/superfluid/keeper/keeper_test.go | 1 - x/superfluid/keeper/migrate_test.go | 1 - x/superfluid/keeper/unpool_test.go | 3 - x/twap/api_test.go | 1 - 53 files changed, 146 insertions(+), 540 deletions(-) diff --git a/app/apptesting/gamm.go b/app/apptesting/gamm.go index 7a2621addda..dd098087f4e 100644 --- a/app/apptesting/gamm.go +++ b/app/apptesting/gamm.go @@ -74,7 +74,6 @@ func (s *KeeperTestHelper) PrepareBalancerPoolWithCoinsAndWeights(coins sdk.Coin return s.PrepareCustomBalancerPool(poolAssets, balancer.PoolParams{ SwapFee: sdk.ZeroDec(), - ExitFee: sdk.ZeroDec(), }) } @@ -82,7 +81,6 @@ func (s *KeeperTestHelper) PrepareBalancerPoolWithCoinsAndWeights(coins sdk.Coin func (s *KeeperTestHelper) PrepareBalancerPool() uint64 { poolId := s.PrepareBalancerPoolWithPoolParams(balancer.PoolParams{ SwapFee: sdk.NewDec(0), - ExitFee: sdk.NewDec(0), }) spotPrice, err := s.App.GAMMKeeper.CalculateSpotPrice(s.Ctx, poolId, "foo", "bar") @@ -117,7 +115,6 @@ func (s *KeeperTestHelper) PrepareBasicStableswapPool() uint64 { params := stableswap.PoolParams{ SwapFee: sdk.NewDec(0), - ExitFee: sdk.NewDec(0), } msg := stableswap.NewMsgCreateStableswapPool(s.TestAccs[0], params, DefaultStableswapLiquidity, []uint64{}, "") @@ -132,7 +129,6 @@ func (s *KeeperTestHelper) PrepareImbalancedStableswapPool() uint64 { params := stableswap.PoolParams{ SwapFee: sdk.NewDec(0), - ExitFee: sdk.NewDec(0), } msg := stableswap.NewMsgCreateStableswapPool(s.TestAccs[0], params, ImbalancedStableswapLiquidity, []uint64{1, 1, 1}, "") diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go index 44a8c5b5e3b..0902cec8754 100644 --- a/app/apptesting/test_suite.go +++ b/app/apptesting/test_suite.go @@ -300,7 +300,6 @@ func (s *KeeperTestHelper) SetupGammPoolsWithBondDenomMultiplier(multipliers []s poolParams := balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), } msg := balancer.NewMsgCreateBalancerPool(acc1, poolParams, poolAssets, defaultFutureGovernor) diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index 65d63799457..3c274148ea0 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -101,13 +101,11 @@ func (suite *UpgradeTestSuite) TestMigrateBalancerToStablePools() { // Create the balancer pool swapFee := sdk.MustNewDecFromStr("0.003") - exitFee := sdk.MustNewDecFromStr("0.025") poolID, err := suite.App.PoolManagerKeeper.CreatePool( suite.Ctx, balancer.NewMsgCreateBalancerPool(suite.TestAccs[0], balancer.PoolParams{ SwapFee: swapFee, - ExitFee: exitFee, }, []balancertypes.PoolAsset{ { diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index bd2acff2a03..3bfb2f09140 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -97,7 +97,7 @@ func migrateBalancerPoolToSolidlyStable(ctx sdk.Context, gammKeeper *gammkeeper. // initialize the stableswap pool stableswapPool, err := stableswap.NewStableswapPool( poolId, - stableswap.PoolParams{SwapFee: balancerPool.GetSwapFee(ctx), ExitFee: balancerPool.GetExitFee(ctx)}, + stableswap.PoolParams{SwapFee: balancerPool.GetSwapFee(ctx)}, balancerPool.GetTotalPoolLiquidity(ctx), []uint64{1, 1}, "osmo1k8c2m5cn322akk5wy8lpt87dd2f4yh9afcd7af", // Stride Foundation 2/3 multisig diff --git a/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto b/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto index 114dee98b30..3204e3fc376 100644 --- a/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto +++ b/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto @@ -79,11 +79,6 @@ message PoolParams { (gogoproto.moretags) = "yaml:\"swap_fee\"", (gogoproto.nullable) = false ]; - string exit_fee = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"exit_fee\"", - (gogoproto.nullable) = false - ]; SmoothWeightChangeParams smooth_weight_change_params = 3 [ (gogoproto.moretags) = "yaml:\"smooth_weight_change_params\"", (gogoproto.nullable) = true diff --git a/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto b/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto index 841dc8cb747..9635fefe919 100644 --- a/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto +++ b/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto @@ -22,11 +22,6 @@ message PoolParams { (gogoproto.moretags) = "yaml:\"swap_fee\"", (gogoproto.nullable) = false ]; - string exit_fee = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"exit_fee\"", - (gogoproto.nullable) = false - ]; } // Pool is the stableswap Pool struct diff --git a/tests/ibc-hooks/ibc_middleware_test.go b/tests/ibc-hooks/ibc_middleware_test.go index 6bf0b6bda48..781e04f801c 100644 --- a/tests/ibc-hooks/ibc_middleware_test.go +++ b/tests/ibc-hooks/ibc_middleware_test.go @@ -559,7 +559,6 @@ func (suite *HooksTestSuite) SetupPools(chainName Chain, multipliers []sdk.Dec) poolParams := balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), } msg := balancer.NewMsgCreateBalancerPool(acc1, poolParams, poolAssets, defaultFutureGovernor) @@ -887,7 +886,6 @@ func (suite *HooksTestSuite) CreateIBCPoolOnChainB() { poolParams := balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), } msg := balancer.NewMsgCreateBalancerPool(acc1, poolParams, poolAssets, defaultFutureGovernor) diff --git a/tests/mocks/cfmm_pool.go b/tests/mocks/cfmm_pool.go index b985649655d..bc0712a3141 100644 --- a/tests/mocks/cfmm_pool.go +++ b/tests/mocks/cfmm_pool.go @@ -142,20 +142,6 @@ func (mr *MockCFMMPoolIMockRecorder) GetAddress() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAddress", reflect.TypeOf((*MockCFMMPoolI)(nil).GetAddress)) } -// GetExitFee mocks base method. -func (m *MockCFMMPoolI) GetExitFee(ctx types.Context) types.Dec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetExitFee", ctx) - ret0, _ := ret[0].(types.Dec) - return ret0 -} - -// GetExitFee indicates an expected call of GetExitFee. -func (mr *MockCFMMPoolIMockRecorder) GetExitFee(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExitFee", reflect.TypeOf((*MockCFMMPoolI)(nil).GetExitFee), ctx) -} - // GetId mocks base method. func (m *MockCFMMPoolI) GetId() uint64 { m.ctrl.T.Helper() @@ -512,20 +498,6 @@ func (mr *MockPoolAmountOutExtensionMockRecorder) GetAddress() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAddress", reflect.TypeOf((*MockPoolAmountOutExtension)(nil).GetAddress)) } -// GetExitFee mocks base method. -func (m *MockPoolAmountOutExtension) GetExitFee(ctx types.Context) types.Dec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetExitFee", ctx) - ret0, _ := ret[0].(types.Dec) - return ret0 -} - -// GetExitFee indicates an expected call of GetExitFee. -func (mr *MockPoolAmountOutExtensionMockRecorder) GetExitFee(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExitFee", reflect.TypeOf((*MockPoolAmountOutExtension)(nil).GetExitFee), ctx) -} - // GetId mocks base method. func (m *MockPoolAmountOutExtension) GetId() uint64 { m.ctrl.T.Helper() @@ -879,20 +851,6 @@ func (mr *MockWeightedPoolExtensionMockRecorder) GetAddress() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAddress", reflect.TypeOf((*MockWeightedPoolExtension)(nil).GetAddress)) } -// GetExitFee mocks base method. -func (m *MockWeightedPoolExtension) GetExitFee(ctx types.Context) types.Dec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetExitFee", ctx) - ret0, _ := ret[0].(types.Dec) - return ret0 -} - -// GetExitFee indicates an expected call of GetExitFee. -func (mr *MockWeightedPoolExtensionMockRecorder) GetExitFee(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExitFee", reflect.TypeOf((*MockWeightedPoolExtension)(nil).GetExitFee), ctx) -} - // GetId mocks base method. func (m *MockWeightedPoolExtension) GetId() uint64 { m.ctrl.T.Helper() diff --git a/tests/mocks/cl_pool.go b/tests/mocks/cl_pool.go index b1b27e92231..c5b93fd2b99 100644 --- a/tests/mocks/cl_pool.go +++ b/tests/mocks/cl_pool.go @@ -106,20 +106,6 @@ func (mr *MockConcentratedPoolExtensionMockRecorder) GetCurrentTick() *gomock.Ca return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentTick", reflect.TypeOf((*MockConcentratedPoolExtension)(nil).GetCurrentTick)) } -// GetExitFee mocks base method. -func (m *MockConcentratedPoolExtension) GetExitFee(ctx types.Context) types.Dec { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetExitFee", ctx) - ret0, _ := ret[0].(types.Dec) - return ret0 -} - -// GetExitFee indicates an expected call of GetExitFee. -func (mr *MockConcentratedPoolExtensionMockRecorder) GetExitFee(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExitFee", reflect.TypeOf((*MockConcentratedPoolExtension)(nil).GetExitFee), ctx) -} - // GetId mocks base method. func (m *MockConcentratedPoolExtension) GetId() uint64 { m.ctrl.T.Helper() diff --git a/wasmbinding/test/custom_query_test.go b/wasmbinding/test/custom_query_test.go index 0d01ddbc84e..ca80645a47b 100644 --- a/wasmbinding/test/custom_query_test.go +++ b/wasmbinding/test/custom_query_test.go @@ -155,7 +155,6 @@ func preparePool(t *testing.T, ctx sdk.Context, osmosis *app.OsmosisApp, addr sd poolParams := balancer.PoolParams{ SwapFee: sdk.NewDec(0), - ExitFee: sdk.NewDec(0), } msg := balancer.NewMsgCreateBalancerPool(addr, poolParams, assets, "") diff --git a/x/concentrated-liquidity/model/pool.go b/x/concentrated-liquidity/model/pool.go index a1234f08a64..574cf5205ae 100644 --- a/x/concentrated-liquidity/model/pool.go +++ b/x/concentrated-liquidity/model/pool.go @@ -82,11 +82,6 @@ func (p Pool) GetSwapFee(ctx sdk.Context) sdk.Dec { return p.SwapFee } -// GetExitFee returns the exit fee of the pool -func (p Pool) GetExitFee(ctx sdk.Context) sdk.Dec { - return sdk.ZeroDec() -} - // IsActive returns true if the pool is active func (p Pool) IsActive(ctx sdk.Context) bool { return true diff --git a/x/gamm/README.md b/x/gamm/README.md index e5c1c38ae4b..1b90ccebf4c 100644 --- a/x/gamm/README.md +++ b/x/gamm/README.md @@ -161,7 +161,6 @@ Pools have the following parameters: | Key | Type | | --------------------------| ----------------------------| | SwapFee | sdk.Dec | -| ExitFee | sdk.Dec | | FutureGovernor | \*FutureGovernor | | Weights | \*Weights | | SmoothWeightChangeParams | \*SmoothWeightChangeParams | diff --git a/x/gamm/client/cli/cli_test.go b/x/gamm/client/cli/cli_test.go index 2fa745f85b6..00a00f8f646 100644 --- a/x/gamm/client/cli/cli_test.go +++ b/x/gamm/client/cli/cli_test.go @@ -37,8 +37,7 @@ func TestNewCreatePoolCmd(t *testing.T) { `{ "weights": "1node0token,3stake", "initial-deposit": "100node0token,100stake", - "swap-fee": "0.001", - "exit-fee": "0.001" + "swap-fee": "0.001" }`, false, }, @@ -48,10 +47,9 @@ func TestNewCreatePoolCmd(t *testing.T) { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001", "%s": "osmo1fqlr98d45v5ysqgp6h56kpujcj4cvsjnjq9nck" } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee, cli.PoolFileFutureGovernor), + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileFutureGovernor), false, }, "bad pool json - missing quotes around exit fee": { @@ -60,9 +58,8 @@ func TestNewCreatePoolCmd(t *testing.T) { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": 0.001 } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee), + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee), true, }, "empty pool json": { @@ -74,14 +71,13 @@ func TestNewCreatePoolCmd(t *testing.T) { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001", "%s": { "%s": "864h", "%s": "2node0token,1stake", "%s": "2006-01-02T15:04:05Z" } } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee, + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileSmoothWeightChangeParams, cli.PoolFileDuration, cli.PoolFileTargetPoolWeights, cli.PoolFileStartTime, ), false, @@ -92,13 +88,12 @@ func TestNewCreatePoolCmd(t *testing.T) { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001", "%s": { "%s": "864h", "%s": "2node0token,1stake" } } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee, + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileSmoothWeightChangeParams, cli.PoolFileDuration, cli.PoolFileTargetPoolWeights, ), false, @@ -109,10 +104,9 @@ func TestNewCreatePoolCmd(t *testing.T) { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001", "%s": {} } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee, + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileSmoothWeightChangeParams, ), false, @@ -123,10 +117,9 @@ func TestNewCreatePoolCmd(t *testing.T) { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001", "%s": "invalid string" } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee, + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileSmoothWeightChangeParams, ), true, @@ -137,12 +130,11 @@ func TestNewCreatePoolCmd(t *testing.T) { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001", "%s": { "%s": "2node0token,1stake" } } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee, + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileSmoothWeightChangeParams, cli.PoolFileTargetPoolWeights, ), true, @@ -153,10 +145,9 @@ func TestNewCreatePoolCmd(t *testing.T) { "%s": "1node0token", "%s": "100node0token", "%s": "0.001", - "%s": "0.001" "unknown": true, } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee), + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee), true, }, } diff --git a/x/gamm/client/cli/flags.go b/x/gamm/client/cli/flags.go index 20042d3e8f0..4933a698694 100644 --- a/x/gamm/client/cli/flags.go +++ b/x/gamm/client/cli/flags.go @@ -13,7 +13,6 @@ const ( PoolFileWeights = "weights" PoolFileInitialDeposit = "initial-deposit" PoolFileSwapFee = "swap-fee" - PoolFileExitFee = "exit-fee" PoolFileFutureGovernor = "future-governor" PoolFileSmoothWeightChangeParams = "lbp-params" @@ -46,7 +45,6 @@ type createBalancerPoolInputs struct { Weights string `json:"weights"` InitialDeposit string `json:"initial-deposit"` SwapFee string `json:"swap-fee"` - ExitFee string `json:"exit-fee"` FutureGovernor string `json:"future-governor"` SmoothWeightChangeParams smoothWeightChangeParamsInputs `json:"lbp-params"` } @@ -54,7 +52,6 @@ type createBalancerPoolInputs struct { type createStableswapPoolInputs struct { InitialDeposit string `json:"initial-deposit"` SwapFee string `json:"swap-fee"` - ExitFee string `json:"exit-fee"` FutureGovernor string `json:"future-governor"` ScalingFactorController string `json:"scaling-factor-controller"` ScalingFactors string `json:"scaling-factors"` diff --git a/x/gamm/client/cli/tx.go b/x/gamm/client/cli/tx.go index 3617da8fd6b..68ae4764e1a 100644 --- a/x/gamm/client/cli/tx.go +++ b/x/gamm/client/cli/tx.go @@ -225,11 +225,6 @@ func NewBuildCreateBalancerPoolMsg(clientCtx client.Context, fs *flag.FlagSet) ( return nil, err } - exitFee, err := sdk.NewDecFromStr(pool.ExitFee) - if err != nil { - return nil, err - } - var poolAssets []balancer.PoolAsset for i := 0; i < len(poolAssetCoins); i++ { if poolAssetCoins[i].Denom != deposit[i].Denom { @@ -244,7 +239,6 @@ func NewBuildCreateBalancerPoolMsg(clientCtx client.Context, fs *flag.FlagSet) ( poolParams := &balancer.PoolParams{ SwapFee: swapFee, - ExitFee: exitFee, } msg := &balancer.MsgCreateBalancerPool{ @@ -320,14 +314,8 @@ func NewBuildCreateStableswapPoolMsg(clientCtx client.Context, fs *flag.FlagSet) return nil, err } - exitFee, err := sdk.NewDecFromStr(flags.ExitFee) - if err != nil { - return nil, err - } - poolParams := &stableswap.PoolParams{ SwapFee: swapFee, - ExitFee: exitFee, } scalingFactors := []uint64{} diff --git a/x/gamm/keeper/gas_test.go b/x/gamm/keeper/gas_test.go index e43a8d0b086..5edcbf37d3b 100644 --- a/x/gamm/keeper/gas_test.go +++ b/x/gamm/keeper/gas_test.go @@ -104,7 +104,6 @@ func (suite *KeeperTestSuite) TestRepeatedJoinPoolDistinctDenom() { suite.FundAcc(defaultAddr, coins) defaultPoolParams := balancertypes.PoolParams{ SwapFee: sdk.NewDec(0), - ExitFee: sdk.NewDec(0), } for i := 1; i <= denomNumber; i++ { randToken := "randToken" + strconv.Itoa(i+1) diff --git a/x/gamm/keeper/genesis_test.go b/x/gamm/keeper/genesis_test.go index 99c04068e93..78f6c596ce9 100644 --- a/x/gamm/keeper/genesis_test.go +++ b/x/gamm/keeper/genesis_test.go @@ -31,7 +31,6 @@ func TestGammInitGenesis(t *testing.T) { balancerPool, err := balancer.NewBalancerPool(1, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, []balancer.PoolAsset{ { Weight: sdk.NewInt(1), @@ -62,7 +61,6 @@ func TestGammInitGenesis(t *testing.T) { require.Equal(t, balancerPool.GetId(), poolStored.GetId()) require.Equal(t, balancerPool.GetAddress(), poolStored.GetAddress()) require.Equal(t, balancerPool.GetSwapFee(ctx), poolStored.GetSwapFee(ctx)) - require.Equal(t, balancerPool.GetExitFee(ctx), poolStored.GetExitFee(ctx)) // require.Equal(t, balancerPool.GetTotalWeight(), sdk.Nw) require.Equal(t, balancerPool.GetTotalShares(), poolStored.GetTotalShares()) // require.Equal(t, balancerPool.GetAllPoolAssets(), poolStored.GetAllPoolAssets()) @@ -92,7 +90,6 @@ func TestGammExportGenesis(t *testing.T) { msg := balancer.NewMsgCreateBalancerPool(acc1, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, []balancer.PoolAsset{{ Weight: sdk.NewInt(100), Token: sdk.NewCoin("foo", sdk.NewInt(10000)), @@ -105,7 +102,6 @@ func TestGammExportGenesis(t *testing.T) { msg = balancer.NewMsgCreateBalancerPool(acc1, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, []balancer.PoolAsset{{ Weight: sdk.NewInt(70), Token: sdk.NewCoin("foo", sdk.NewInt(10000)), @@ -146,7 +142,6 @@ func TestMarshalUnmarshalGenesis(t *testing.T) { msg := balancer.NewMsgCreateBalancerPool(acc1, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, []balancer.PoolAsset{{ Weight: sdk.NewInt(100), Token: sdk.NewCoin("foo", sdk.NewInt(10000)), diff --git a/x/gamm/keeper/grpc_query.go b/x/gamm/keeper/grpc_query.go index 4cb5fe4d14e..ee3e8536881 100644 --- a/x/gamm/keeper/grpc_query.go +++ b/x/gamm/keeper/grpc_query.go @@ -241,14 +241,12 @@ func (q Querier) CalcExitPoolCoinsFromShares(ctx context.Context, req *types.Que return nil, types.ErrPoolNotFound } - exitFee := pool.GetExitFee(sdkCtx) - totalSharesAmount := pool.GetTotalShares() if req.ShareInAmount.GTE(totalSharesAmount) || req.ShareInAmount.LTE(sdk.ZeroInt()) { return nil, sdkerrors.Wrapf(types.ErrInvalidMathApprox, "share ratio is zero or negative") } - exitCoins, err := pool.CalcExitPoolCoinsFromShares(sdkCtx, req.ShareInAmount, exitFee) + exitCoins, err := pool.CalcExitPoolCoinsFromShares(sdkCtx, req.ShareInAmount, sdk.ZeroDec()) if err != nil { return nil, err } diff --git a/x/gamm/keeper/grpc_query_test.go b/x/gamm/keeper/grpc_query_test.go index 401304f4040..b68a4ac38d7 100644 --- a/x/gamm/keeper/grpc_query_test.go +++ b/x/gamm/keeper/grpc_query_test.go @@ -178,7 +178,6 @@ func (suite *KeeperTestSuite) TestPoolsWithFilter() { ) defaultPoolParams = balancer.PoolParams{ SwapFee: sdk.ZeroDec(), - ExitFee: sdk.ZeroDec(), } ) diff --git a/x/gamm/keeper/pool_service.go b/x/gamm/keeper/pool_service.go index e3139d301f9..2d41d5f9674 100644 --- a/x/gamm/keeper/pool_service.go +++ b/x/gamm/keeper/pool_service.go @@ -308,8 +308,7 @@ func (k Keeper) ExitPool( } else if shareInAmount.LTE(sdk.ZeroInt()) { return sdk.Coins{}, sdkerrors.Wrapf(types.ErrInvalidMathApprox, "Trying to exit a negative amount of shares") } - exitFee := pool.GetExitFee(ctx) - exitCoins, err = pool.ExitPool(ctx, shareInAmount, exitFee) + exitCoins, err = pool.ExitPool(ctx, shareInAmount, sdk.ZeroDec()) if err != nil { return sdk.Coins{}, err } diff --git a/x/gamm/keeper/pool_service_test.go b/x/gamm/keeper/pool_service_test.go index 93ebf1b3c3b..578b731df1f 100644 --- a/x/gamm/keeper/pool_service_test.go +++ b/x/gamm/keeper/pool_service_test.go @@ -19,14 +19,11 @@ import ( var ( defaultSwapFee = sdk.MustNewDecFromStr("0.025") - defaultExitFee = sdk.MustNewDecFromStr("0.025") defaultPoolParams = balancer.PoolParams{ SwapFee: defaultSwapFee, - ExitFee: defaultExitFee, } defaultStableSwapPoolParams = stableswap.PoolParams{ SwapFee: defaultSwapFee, - ExitFee: defaultExitFee, } defaultScalingFactor = []uint64{1, 1} defaultFutureGovernor = "" @@ -88,15 +85,6 @@ func (suite *KeeperTestSuite) TestCreateBalancerPool() { name: "create a pool with negative swap fee", msg: balancer.NewMsgCreateBalancerPool(testAccount, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(-1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), - }, defaultPoolAssets, defaultFutureGovernor), - emptySender: false, - expectPass: false, - }, { - name: "create a pool with negative exit fee", - msg: balancer.NewMsgCreateBalancerPool(testAccount, balancer.PoolParams{ - SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(-1, 2), }, defaultPoolAssets, defaultFutureGovernor), emptySender: false, expectPass: false, @@ -104,7 +92,6 @@ func (suite *KeeperTestSuite) TestCreateBalancerPool() { name: "create the pool with empty PoolAssets", msg: balancer.NewMsgCreateBalancerPool(testAccount, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, []balancertypes.PoolAsset{}, defaultFutureGovernor), emptySender: false, expectPass: false, @@ -112,7 +99,6 @@ func (suite *KeeperTestSuite) TestCreateBalancerPool() { name: "create the pool with 0 weighted PoolAsset", msg: balancer.NewMsgCreateBalancerPool(testAccount, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, []balancertypes.PoolAsset{{ Weight: sdk.NewInt(0), Token: sdk.NewCoin("foo", sdk.NewInt(10000)), @@ -126,7 +112,6 @@ func (suite *KeeperTestSuite) TestCreateBalancerPool() { name: "create the pool with negative weighted PoolAsset", msg: balancer.NewMsgCreateBalancerPool(testAccount, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, []balancertypes.PoolAsset{{ Weight: sdk.NewInt(-1), Token: sdk.NewCoin("foo", sdk.NewInt(10000)), @@ -140,7 +125,6 @@ func (suite *KeeperTestSuite) TestCreateBalancerPool() { name: "create the pool with 0 balance PoolAsset", msg: balancer.NewMsgCreateBalancerPool(testAccount, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, []balancertypes.PoolAsset{{ Weight: sdk.NewInt(100), Token: sdk.NewCoin("foo", sdk.NewInt(0)), @@ -154,7 +138,6 @@ func (suite *KeeperTestSuite) TestCreateBalancerPool() { name: "create the pool with negative balance PoolAsset", msg: balancer.NewMsgCreateBalancerPool(testAccount, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, []balancertypes.PoolAsset{{ Weight: sdk.NewInt(100), Token: sdk.Coin{ @@ -171,7 +154,6 @@ func (suite *KeeperTestSuite) TestCreateBalancerPool() { name: "create the pool with duplicated PoolAssets", msg: balancer.NewMsgCreateBalancerPool(testAccount, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, []balancertypes.PoolAsset{{ Weight: sdk.NewInt(100), Token: sdk.NewCoin("foo", sdk.NewInt(10000)), @@ -512,7 +494,6 @@ func (suite *KeeperTestSuite) TestJoinPoolNoSwap() { // Create the pool at first msg := balancer.NewMsgCreateBalancerPool(testAccount, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, defaultPoolAssets, defaultFutureGovernor) poolId, err := poolmanagerKeeper.CreatePool(suite.Ctx, msg) suite.Require().NoError(err, "test: %v", test.name) @@ -623,7 +604,6 @@ func (suite *KeeperTestSuite) TestExitPool() { // Create the pool at first msg := balancer.NewMsgCreateBalancerPool(test.txSender, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDec(0), }, defaultPoolAssets, defaultFutureGovernor) poolId, err := poolmanagerKeeper.CreatePool(ctx, msg) @@ -669,7 +649,6 @@ func (suite *KeeperTestSuite) TestJoinPoolExitPool_InverseRelationship() { name: "pool with same token ratio", pool: balancer.NewMsgCreateBalancerPool(nil, balancer.PoolParams{ SwapFee: sdk.ZeroDec(), - ExitFee: sdk.ZeroDec(), }, []balancertypes.PoolAsset{ { Weight: sdk.NewInt(100), @@ -686,7 +665,6 @@ func (suite *KeeperTestSuite) TestJoinPoolExitPool_InverseRelationship() { name: "pool with different token ratio", pool: balancer.NewMsgCreateBalancerPool(nil, balancer.PoolParams{ SwapFee: sdk.ZeroDec(), - ExitFee: sdk.ZeroDec(), }, []balancertypes.PoolAsset{ { Weight: sdk.NewInt(100), @@ -768,7 +746,6 @@ func (suite *KeeperTestSuite) TestActiveBalancerPool() { // Create the pool at first poolId := suite.PrepareBalancerPoolWithPoolParams(balancer.PoolParams{ SwapFee: sdk.NewDec(0), - ExitFee: sdk.NewDec(0), }) ctx = ctx.WithBlockTime(tc.blockTime) @@ -812,7 +789,6 @@ func (suite *KeeperTestSuite) TestJoinSwapExactAmountInConsistency() { testCases := []struct { name string poolSwapFee sdk.Dec - poolExitFee sdk.Dec tokensIn sdk.Coins shareOutMinAmount sdk.Int expectedSharesOut sdk.Int @@ -821,7 +797,6 @@ func (suite *KeeperTestSuite) TestJoinSwapExactAmountInConsistency() { { name: "single coin with zero swap and exit fees", poolSwapFee: sdk.ZeroDec(), - poolExitFee: sdk.ZeroDec(), tokensIn: sdk.NewCoins(sdk.NewCoin("foo", sdk.NewInt(1000000))), shareOutMinAmount: sdk.ZeroInt(), expectedSharesOut: sdk.NewInt(6265857020099440400), @@ -834,7 +809,6 @@ func (suite *KeeperTestSuite) TestJoinSwapExactAmountInConsistency() { // { // name: "single coin with positive swap fee and zero exit fee", // poolSwapFee: sdk.NewDecWithPrec(1, 2), - // poolExitFee: sdk.ZeroDec(), // tokensIn: sdk.NewCoins(sdk.NewCoin("foo", sdk.NewInt(1000000))), // shareOutMinAmount: sdk.ZeroInt(), // expectedSharesOut: sdk.NewInt(6226484702880621000), @@ -865,7 +839,6 @@ func (suite *KeeperTestSuite) TestJoinSwapExactAmountInConsistency() { }, balancer.PoolParams{ SwapFee: tc.poolSwapFee, - ExitFee: tc.poolExitFee, }, ) diff --git a/x/gamm/keeper/pool_test.go b/x/gamm/keeper/pool_test.go index 4fda1dedd48..78d432740cb 100644 --- a/x/gamm/keeper/pool_test.go +++ b/x/gamm/keeper/pool_test.go @@ -23,7 +23,6 @@ var ( } defaultPoolParamsStableSwap = stableswap.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), } defaultPoolId = uint64(1) defaultAcctFundsStableSwap sdk.Coins = sdk.NewCoins( @@ -286,7 +285,6 @@ func (suite *KeeperTestSuite) TestGetPoolAndPoke() { isPokePool: true, poolId: suite.prepareCustomBalancerPool(defaultAcctFunds, startPoolWeightAssets, balancer.PoolParams{ SwapFee: defaultSwapFee, - ExitFee: defaultExitFee, SmoothWeightChangeParams: &balancer.SmoothWeightChangeParams{ StartTime: time.Unix(startTime, 0), // start time is before block time so the weights should change Duration: time.Hour, @@ -300,7 +298,6 @@ func (suite *KeeperTestSuite) TestGetPoolAndPoke() { defaultAcctFunds, stableswap.PoolParams{ SwapFee: defaultSwapFee, - ExitFee: defaultExitFee, }, sdk.NewCoins(sdk.NewCoin(defaultAcctFunds[0].Denom, defaultAcctFunds[0].Amount.QuoRaw(2)), sdk.NewCoin(defaultAcctFunds[1].Denom, defaultAcctFunds[1].Amount.QuoRaw(2))), []uint64{1, 1}, @@ -502,7 +499,6 @@ func (suite *KeeperTestSuite) TestSetStableSwapScalingFactors() { defaultAcctFunds, stableswap.PoolParams{ SwapFee: defaultSwapFee, - ExitFee: defaultExitFee, }, sdk.NewCoins(sdk.NewCoin(defaultAcctFunds[0].Denom, defaultAcctFunds[0].Amount.QuoRaw(2)), sdk.NewCoin(defaultAcctFunds[1].Denom, defaultAcctFunds[1].Amount.QuoRaw(2))), tc.scalingFactors, diff --git a/x/gamm/keeper/swap_test.go b/x/gamm/keeper/swap_test.go index 888afceddac..7ee324577f1 100644 --- a/x/gamm/keeper/swap_test.go +++ b/x/gamm/keeper/swap_test.go @@ -128,7 +128,6 @@ func (suite *KeeperTestSuite) TestBalancerPoolSimpleSwapExactAmountIn() { } poolId := suite.PrepareBalancerPoolWithPoolParams(balancer.PoolParams{ SwapFee: swapFee, - ExitFee: sdk.ZeroDec(), }) if !test.swapFeeOverwriteQuotient.IsNil() { swapFee = swapFee.Quo(test.swapFeeOverwriteQuotient) @@ -438,7 +437,6 @@ func (suite *KeeperTestSuite) TestActiveBalancerPoolSwap() { poolId := suite.PrepareBalancerPoolWithPoolParams(balancer.PoolParams{ SwapFee: sdk.NewDec(0), - ExitFee: sdk.NewDec(0), }) suite.Ctx = suite.Ctx.WithBlockTime(tc.blockTime) diff --git a/x/gamm/pool-models/balancer/amm_test.go b/x/gamm/pool-models/balancer/amm_test.go index 7c20a78665c..1ab27cb4b9e 100644 --- a/x/gamm/pool-models/balancer/amm_test.go +++ b/x/gamm/pool-models/balancer/amm_test.go @@ -26,29 +26,21 @@ func TestBalancerPoolParams(t *testing.T) { // NewPool panics in the error case. tests := []struct { SwapFee sdk.Dec - ExitFee sdk.Dec shouldErr bool }{ // Should work - {defaultSwapFee, defaultExitFee, noErr}, + {defaultSwapFee, noErr}, // Can't set the swap fee as negative - {sdk.NewDecWithPrec(-1, 2), defaultExitFee, wantErr}, + {sdk.NewDecWithPrec(-1, 2), wantErr}, // Can't set the swap fee as 1 - {sdk.NewDec(1), defaultExitFee, wantErr}, + {sdk.NewDec(1), wantErr}, // Can't set the swap fee above 1 - {sdk.NewDecWithPrec(15, 1), defaultExitFee, wantErr}, - // Can't set the exit fee as negative - {defaultSwapFee, sdk.NewDecWithPrec(-1, 2), wantErr}, - // Can't set the exit fee as 1 - {defaultSwapFee, sdk.NewDec(1), wantErr}, - // Can't set the exit fee above 1 - {defaultSwapFee, sdk.NewDecWithPrec(15, 1), wantErr}, + {sdk.NewDecWithPrec(15, 1), wantErr}, } for i, params := range tests { PoolParams := balancer.PoolParams{ SwapFee: params.SwapFee, - ExitFee: params.ExitFee, } err := PoolParams.Validate(dummyPoolAssets) if params.shouldErr { diff --git a/x/gamm/pool-models/balancer/balancerPool.pb.go b/x/gamm/pool-models/balancer/balancerPool.pb.go index 56bab4af76e..c4f9c1036a6 100644 --- a/x/gamm/pool-models/balancer/balancerPool.pb.go +++ b/x/gamm/pool-models/balancer/balancerPool.pb.go @@ -135,7 +135,6 @@ func (m *SmoothWeightChangeParams) GetTargetPoolWeights() []PoolAsset { // The pool's token holders are specified in future_pool_governor. type PoolParams struct { SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee" yaml:"swap_fee"` - ExitFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exit_fee,json=exitFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exit_fee" yaml:"exit_fee"` SmoothWeightChangeParams *SmoothWeightChangeParams `protobuf:"bytes,3,opt,name=smooth_weight_change_params,json=smoothWeightChangeParams,proto3" json:"smooth_weight_change_params,omitempty" yaml:"smooth_weight_change_params"` } @@ -298,59 +297,58 @@ func init() { } var fileDescriptor_7e991f749f68c2a4 = []byte{ - // 831 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0x8f, 0x93, 0xb4, 0xd9, 0x4e, 0x96, 0x45, 0x9d, 0xcd, 0xc1, 0x4d, 0x45, 0x5c, 0x0d, 0x12, - 0x5a, 0xa1, 0x8d, 0xad, 0x2c, 0x70, 0xd9, 0xcb, 0x6a, 0xd3, 0x16, 0xd4, 0x5b, 0x71, 0x91, 0x4a, - 0x51, 0x25, 0x6b, 0x92, 0x4c, 0x6c, 0xab, 0xb6, 0xc7, 0xf2, 0x4c, 0xd2, 0xf6, 0x1b, 0x70, 0xec, - 0xb1, 0xdc, 0x7a, 0xe7, 0x0a, 0xdf, 0xa1, 0x82, 0x4b, 0x8f, 0x88, 0x83, 0x41, 0x2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 0x36, 0x38, 0x71, 0xf8, 0x79, 0x4a, - 0x98, 0xbd, 0x43, 0xfa, 0xb3, 0xf1, 0x16, 0x38, 0xc8, 0xad, 0x89, 0xe3, 0x97, 0x84, 0x08, 0x74, - 0x72, 0x16, 0x72, 0x89, 0x5e, 0xfe, 0x7f, 0xe8, 0x05, 0x0e, 0x72, 0x6b, 0xe2, 0x28, 0xd0, 0x7f, - 0x30, 0xc0, 0x26, 0x93, 0xc2, 0xd4, 0x1d, 0x7b, 0x7d, 0x29, 0x4d, 0x2f, 0x95, 0xbd, 0x99, 0x15, - 0xa9, 0x1a, 0x7b, 0xf1, 0x20, 0x97, 0x29, 0xba, 0xfb, 0xe9, 0x75, 0x6e, 0x19, 0x93, 0xdc, 0x42, - 0xba, 0xab, 0xe5, 0x05, 0x90, 0x6b, 0xb2, 0x25, 0x28, 0xe8, 0x47, 0x03, 0xac, 0x4d, 0x77, 0x05, - 0x77, 0xc1, 0x0a, 0xa7, 0x27, 0x24, 0xd1, 0x0f, 0x64, 0xc3, 0xd6, 0xef, 0x5e, 0x3c, 0xb9, 0x29, - 0xa3, 0x6d, 0x1a, 0x26, 0xdd, 0x86, 0xde, 0xea, 0x73, 0xbd, 0x55, 0x91, 0x85, 0x5c, 0x95, 0x0d, - 0x0f, 0xc1, 0xaa, 0xe2, 0xa1, 0x87, 0xf9, 0xee, 0x09, 0xc3, 0xdc, 0x4b, 0xf8, 0x24, 0xb7, 0x3e, - 0x50, 0xb0, 0x0a, 0x05, 0xb9, 0x1a, 0x0e, 0xfd, 0x5c, 0x05, 0x55, 0xc1, 0x16, 0xbe, 0x06, 0x35, - 0x3c, 0x18, 0x64, 0x84, 0x31, 0xad, 0x06, 0x38, 0xc9, 0xad, 0x17, 0x2a, 0x49, 0x5f, 0x20, 0xb7, - 0x08, 0x81, 0x2f, 0x40, 0x39, 0x1c, 0x48, 0x2e, 0x55, 0xb7, 0x1c, 0x0e, 0xe0, 0x10, 0xd4, 0xa5, - 0xfe, 0xee,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0x2d, 0xff, 0x43, 0xed, 0xad, 0xca, 0x8f, 0xfc, - 0x67, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xc4, 0xe9, 0x0d, 0x7c, 0x07, 0x00, 0x00, + // 815 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0x93, 0xb4, 0xdd, 0x4c, 0x96, 0x45, 0x9d, 0xcd, 0xc1, 0x4d, 0x45, 0x5c, 0x0d, 0x12, + 0x5a, 0xa1, 0x8d, 0xad, 0x2c, 0x70, 0xd9, 0xcb, 0x6a, 0xbd, 0x5b, 0x50, 0x6f, 0xc5, 0x45, 0x2a, + 0x45, 0x95, 0xac, 0x49, 0x32, 0xb1, 0xad, 0xda, 0x1e, 0xcb, 0x33, 0x49, 0xe9, 0x3f, 0x80, 0x38, + 0xf6, 0x58, 0x6e, 0xbd, 0x73, 0x85, 0xff, 0xa1, 0x82, 0x4b, 0x8f, 0x88, 0x83, 0x41, 0xed, 0x8d, + 0x63, 0xfe, 0x02, 0x34, 0x3f, 0x9c, 0xa4, 0x25, 0x11, 0xed, 0x29, 0x9e, 0x37, 0xef, 0x7d, 0xdf, + 0xf7, 0xde, 0xfb, 0xec, 0x80, 0xcf, 0x29, 0x4b, 0x28, 0x8b, 0x98, 0x13, 0xe0, 0x24, 0x71, 0x32, + 0x4a, 0xe3, 0x6e, 0x42, 0x87, 0x24, 0x66, 0x4e, 0x1f, 0xc7, 0x38, 0x1d, 0x90, 0x7c, 0xf6, 0xb0, + 0x4f, 0x69, 0x6c, 0x67, 0x39, 0xe5, 0x14, 0xb6, 0x74, 0x95, 0x2d, 0xaa, 0xec, 0x49, 0xaf, 0x4f, + 0x38, 0xee, 0xb5, 0xb7, 0x06, 0x32, 0xec, 0xcb, 0x1c, 0x47, 0x1d, 0x54, 0x41, 0xbb, 0x15, 0xd0, + 0x80, 0xaa, 0xb8, 0x78, 0xd2, 0xd1, 0x4e, 0x40, 0x69, 0x10, 0x13, 0x47, 0x9e, 0xfa, 0xe3, 0x91, + 0x33, 0x1c, 0xe7, 0x98, 0x47, 0x34, 0xd5, 0xf7, 0xd6, 0xfd, 0x7b, 0x1e, 0x25, 0x84, 0x71, 0x9c, + 0x64, 0x25, 0x80, 0x22, 0x71, 0xf0, 0x98, 0x87, 0x8e, 0x96, 0x21, 0x0f, 0xf7, 0xee, 0xfb, 0x98, + 0x91, 0xd9, 0xfd, 0x80, 0x46, 0x9a, 0x00, 0xfd, 0x5e, 0x03, 0xe6, 0x41, 0x42, 0x29, 0x0f, 0x0f, + 0x49, 0x14, 0x84, 0xfc, 0x5d, 0x88, 0xd3, 0x80, 0xec, 0xe3, 0x1c, 0x27, 0x0c, 0x7e, 0x0b, 0x00, + 0xe3, 0x38, 0xe7, 0xbe, 0x60, 0x35, 0x8d, 0x1d, 0xe3, 0x45, 0xf3, 0x55, 0xdb, 0x56, 0x92, 0xec, + 0x52, 0x92, 0xfd, 0x4d, 0x29, 0xc9, 0xfd, 0xe8, 0xaa, 0xb0, 0x2a, 0xd3, 0xc2, 0xda, 0x3c, 0xc3, + 0x49, 0xfc, 0x1a, 0xcd, 0x6b, 0xd1, 0xf9, 0x5f, 0x96, 0xe1, 0x35, 0x64, 0x40, 0xa4, 0xc3, 0x10, + 0x3c, 0x29, 0x3b, 0x35, 0xab, 0x12, 0x77, 0xeb, 0x3f, 0xb8, 0xef, 0x75, 0x82, 0xdb, 0x13, 0xb0, + 0xff, 0x14, 0x16, 0x2c, 0x4b, 0x5e, 0xd2, 0x24, 0xe2, 0x24, 0xc9, 0xf8, 0xd9, 0xb4, 0xb0, 0x3e, + 0x54, 0x64, 0xe5, 0x1d, 0xba, 0x10, 0x54, 0x33, 0x74, 0x38, 0x01, 0xad, 0x28, 0x8d, 0x78, 0x84, + 0x63, 0x5f, 0xec, 0xd6, 0x3f, 0x95, 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x15, 0xfe, 0x02, 0x82, 0x9e, 0x85, 0x4c, 0x63, 0x30, 0x2c, 0x85, 0x6b, 0x67, 0x6c, 0xc8, + 0x19, 0xec, 0x3e, 0xda, 0x19, 0x77, 0xfa, 0x28, 0xfd, 0xa1, 0xfa, 0x50, 0xf6, 0x7e, 0xbd, 0xf9, + 0xe3, 0xa5, 0x55, 0xb9, 0xb8, 0xb4, 0x2a, 0xbf, 0xfd, 0xd2, 0x5d, 0x13, 0x42, 0xf7, 0xdc, 0xa3, + 0xab, 0x9b, 0x8e, 0x71, 0x7d, 0xd3, 0x31, 0xfe, 0xbe, 0xe9, 0x18, 0xe7, 0xb7, 0x9d, 0xca, 0xf5, + 0x6d, 0xa7, 0xf2, 0xc7, 0x6d, 0xa7, 0xf2, 0xdd, 0x9b, 0x05, 0x62, 0xdd, 0x69, 0x37, 0xc6, 0x7d, + 0x56, 0x1e, 0x9c, 0x49, 0xef, 0x0b, 0xe7, 0xfb, 0xd5, 0x7f, 0x79, 0xfd, 0x75, 0xf9, 0x19, 0xfe, + 0xec, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x1d, 0x74, 0xf7, 0x1e, 0x07, 0x00, 0x00, } func (m *SmoothWeightChangeParams) Marshal() (dAtA []byte, err error) { @@ -452,16 +450,6 @@ func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - { - size := m.ExitFee.Size() - i -= size - if _, err := m.ExitFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 { size := m.SwapFee.Size() i -= size @@ -648,8 +636,6 @@ func (m *PoolParams) Size() (n int) { _ = l l = m.SwapFee.Size() n += 1 + l + sovBalancerPool(uint64(l)) - l = m.ExitFee.Size() - n += 1 + l + sovBalancerPool(uint64(l)) if m.SmoothWeightChangeParams != nil { l = m.SmoothWeightChangeParams.Size() n += 1 + l + sovBalancerPool(uint64(l)) @@ -955,40 +941,6 @@ func (m *PoolParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExitFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SmoothWeightChangeParams", wireType) diff --git a/x/gamm/pool-models/balancer/marshal_test.go b/x/gamm/pool-models/balancer/marshal_test.go index ceff4f58d40..6cc9e4621e3 100644 --- a/x/gamm/pool-models/balancer/marshal_test.go +++ b/x/gamm/pool-models/balancer/marshal_test.go @@ -39,7 +39,6 @@ func TestPoolJson(t *testing.T) { } pacc, err := balancer.NewBalancerPool(poolId, balancer.PoolParams{ SwapFee: defaultSwapFee, - ExitFee: defaultExitFee, }, jsonAssetTest, defaultFutureGovernor, defaultCurBlockTime) require.NoError(t, err) @@ -66,7 +65,6 @@ func TestPoolProtoMarshal(t *testing.T) { require.Equal(t, pool2.Id, uint64(10)) require.Equal(t, pool2.PoolParams.SwapFee, defaultSwapFee) - require.Equal(t, pool2.PoolParams.ExitFee, defaultExitFee) require.Equal(t, pool2.FuturePoolGovernor, "") require.Equal(t, pool2.TotalShares, sdk.Coin{Denom: "gamm/pool/10", Amount: sdk.ZeroInt()}) require.Equal(t, pool2.PoolAssets, []balancer.PoolAsset{ diff --git a/x/gamm/pool-models/balancer/msgs_test.go b/x/gamm/pool-models/balancer/msgs_test.go index ef97286a0e4..7a03fc88e79 100644 --- a/x/gamm/pool-models/balancer/msgs_test.go +++ b/x/gamm/pool-models/balancer/msgs_test.go @@ -34,7 +34,6 @@ func TestMsgCreateBalancerPool_ValidateBasic(t *testing.T) { poolParams := &balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), } msg := &balancer.MsgCreateBalancerPool{ @@ -153,7 +152,6 @@ func TestMsgCreateBalancerPool_ValidateBasic(t *testing.T) { msg: createMsg(func(msg balancer.MsgCreateBalancerPool) balancer.MsgCreateBalancerPool { msg.PoolParams = &balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(-1, 2), - ExitFee: sdk.NewDecWithPrec(0, 0), } return msg }), @@ -195,7 +193,6 @@ func TestMsgCreateBalancerPool_ValidateBasic(t *testing.T) { name: "zero swap fee, zero exit fee", msg: createMsg(func(msg balancer.MsgCreateBalancerPool) balancer.MsgCreateBalancerPool { msg.PoolParams = &balancer.PoolParams{ - ExitFee: sdk.NewDecWithPrec(0, 0), SwapFee: sdk.NewDecWithPrec(0, 0), } return msg @@ -252,7 +249,7 @@ func (suite *KeeperTestSuite) TestMsgCreateBalancerPool() { "basic success test": { msg: balancer.MsgCreateBalancerPool{ Sender: suite.TestAccs[0].String(), - PoolParams: &balancer.PoolParams{SwapFee: sdk.NewDecWithPrec(1, 2), ExitFee: sdk.NewDecWithPrec(1, 3)}, + PoolParams: &balancer.PoolParams{SwapFee: sdk.NewDecWithPrec(1, 2)}, PoolAssets: apptesting.DefaultPoolAssets, FuturePoolGovernor: "", }, @@ -261,7 +258,7 @@ func (suite *KeeperTestSuite) TestMsgCreateBalancerPool() { "error due to negative swap fee": { msg: balancer.MsgCreateBalancerPool{ Sender: suite.TestAccs[0].String(), - PoolParams: &balancer.PoolParams{SwapFee: sdk.NewDecWithPrec(1, 2).Neg(), ExitFee: sdk.NewDecWithPrec(1, 3)}, + PoolParams: &balancer.PoolParams{SwapFee: sdk.NewDecWithPrec(1, 2).Neg()}, PoolAssets: apptesting.DefaultPoolAssets, FuturePoolGovernor: "", }, diff --git a/x/gamm/pool-models/balancer/pool.go b/x/gamm/pool-models/balancer/pool.go index 91a82e27a20..eadd9df2520 100644 --- a/x/gamm/pool-models/balancer/pool.go +++ b/x/gamm/pool-models/balancer/pool.go @@ -96,10 +96,6 @@ func (p Pool) GetTotalPoolLiquidity(_ sdk.Context) sdk.Coins { return poolAssetsCoins(p.PoolAssets) } -func (p Pool) GetExitFee(_ sdk.Context) sdk.Dec { - return p.PoolParams.ExitFee -} - func (p Pool) GetPoolParams() PoolParams { return p.PoolParams } @@ -960,7 +956,7 @@ func (p *Pool) ExitSwapExactAmountOut( p.GetTotalShares().ToDec(), tokenOut.Amount.ToDec(), p.GetSwapFee(ctx), - p.GetExitFee(ctx), + sdk.ZeroDec(), ).TruncateInt() if !sharesIn.IsPositive() { diff --git a/x/gamm/pool-models/balancer/pool_params.go b/x/gamm/pool-models/balancer/pool_params.go index cfbf3d0d4d3..3d1118d1bc0 100644 --- a/x/gamm/pool-models/balancer/pool_params.go +++ b/x/gamm/pool-models/balancer/pool_params.go @@ -11,20 +11,11 @@ import ( func NewPoolParams(swapFee, exitFee sdk.Dec, params *SmoothWeightChangeParams) PoolParams { return PoolParams{ SwapFee: swapFee, - ExitFee: exitFee, SmoothWeightChangeParams: params, } } func (params PoolParams) Validate(poolWeights []PoolAsset) error { - if params.ExitFee.IsNegative() { - return types.ErrNegativeExitFee - } - - if params.ExitFee.GTE(sdk.OneDec()) { - return types.ErrTooMuchExitFee - } - if params.SwapFee.IsNegative() { return types.ErrNegativeSwapFee } @@ -72,7 +63,3 @@ func (params PoolParams) Validate(poolWeights []PoolAsset) error { func (params PoolParams) GetPoolSwapFee() sdk.Dec { return params.SwapFee } - -func (params PoolParams) GetPoolExitFee() sdk.Dec { - return params.ExitFee -} diff --git a/x/gamm/pool-models/balancer/pool_suite_test.go b/x/gamm/pool-models/balancer/pool_suite_test.go index a5a69b4f330..4da02275b26 100644 --- a/x/gamm/pool-models/balancer/pool_suite_test.go +++ b/x/gamm/pool-models/balancer/pool_suite_test.go @@ -798,7 +798,7 @@ func (suite *KeeperTestSuite) TestBalancerSpotPriceBounds() { } poolAssets := []balancer.PoolAsset{defaultBaseAsset, defaultQuoteAsset} - poolId := suite.PrepareCustomBalancerPool(poolAssets, balancer.PoolParams{SwapFee: sdk.ZeroDec(), ExitFee: sdk.ZeroDec()}) + poolId := suite.PrepareCustomBalancerPool(poolAssets, balancer.PoolParams{SwapFee: sdk.ZeroDec()}) pool, err := suite.App.GAMMKeeper.GetPoolAndPoke(suite.Ctx, poolId) suite.Require().NoError(err, "test: %s", tc.name) diff --git a/x/gamm/pool-models/balancer/pool_test.go b/x/gamm/pool-models/balancer/pool_test.go index aadd6712a84..31ddeb4ab3c 100644 --- a/x/gamm/pool-models/balancer/pool_test.go +++ b/x/gamm/pool-models/balancer/pool_test.go @@ -18,11 +18,9 @@ import ( var ( defaultSwapFee = sdk.MustNewDecFromStr("0.025") - defaultExitFee = sdk.MustNewDecFromStr("0.025") defaultPoolId = uint64(10) defaultBalancerPoolParams = balancer.PoolParams{ SwapFee: defaultSwapFee, - ExitFee: defaultExitFee, } defaultFutureGovernor = "" defaultCurBlockTime = time.Unix(1618700000, 0) @@ -967,7 +965,6 @@ func TestLBPParamsEmptyStartTime(t *testing.T) { pacc, err := balancer.NewBalancerPool(defaultPoolId, balancer.PoolParams{ SmoothWeightChangeParams: ¶ms, SwapFee: defaultSwapFee, - ExitFee: defaultExitFee, }, initialPoolAssets, defaultFutureGovernor, defaultCurBlockTime) require.NoError(t, err) @@ -1159,7 +1156,6 @@ func TestBalancerPoolPokeTokenWeights(t *testing.T) { // Initialize the pool pacc, err := balancer.NewBalancerPool(uint64(poolId), balancer.PoolParams{ SwapFee: defaultSwapFee, - ExitFee: defaultExitFee, SmoothWeightChangeParams: &tc.params, }, initialPoolAssets, defaultFutureGovernor, defaultCurBlockTime) require.NoError(t, err, "poolId %v", poolId) @@ -1339,7 +1335,7 @@ func TestCalcJoinPoolNoSwapShares(t *testing.T) { balancerPool := balancer.Pool{ Address: types.NewPoolAddress(defaultPoolId).String(), Id: defaultPoolId, - PoolParams: balancer.PoolParams{SwapFee: defaultSwapFee, ExitFee: defaultExitFee}, + PoolParams: balancer.PoolParams{SwapFee: defaultSwapFee}, PoolAssets: test.poolAssets, FuturePoolGovernor: defaultFutureGovernor, TotalShares: sdk.NewCoin(types.GetPoolShareDenom(defaultPoolId), types.InitPoolSharesSupply), diff --git a/x/gamm/pool-models/internal/cfmm_common/lp_test.go b/x/gamm/pool-models/internal/cfmm_common/lp_test.go index 007b92dc613..b694c7512dd 100644 --- a/x/gamm/pool-models/internal/cfmm_common/lp_test.go +++ b/x/gamm/pool-models/internal/cfmm_common/lp_test.go @@ -44,7 +44,7 @@ func TestCalcExitPool(t *testing.T) { // create these pools used for testing twoAssetPool, err := stableswap.NewStableswapPool( 1, - stableswap.PoolParams{ExitFee: sdk.ZeroDec()}, + stableswap.PoolParams{}, twoStablePoolAssets, []uint64{1, 1}, "", @@ -54,7 +54,7 @@ func TestCalcExitPool(t *testing.T) { threeAssetPool, err := balancer.NewBalancerPool( 1, - balancer.PoolParams{SwapFee: sdk.ZeroDec(), ExitFee: sdk.ZeroDec()}, + balancer.PoolParams{SwapFee: sdk.ZeroDec(),}, threeBalancerPoolAssets, "", time.Now(), @@ -63,7 +63,7 @@ func TestCalcExitPool(t *testing.T) { twoAssetPoolWithExitFee, err := stableswap.NewStableswapPool( 1, - stableswap.PoolParams{ExitFee: sdk.MustNewDecFromStr("0.0001")}, + stableswap.PoolParams{}, twoStablePoolAssets, []uint64{1, 1}, "", @@ -73,7 +73,7 @@ func TestCalcExitPool(t *testing.T) { threeAssetPoolWithExitFee, err := balancer.NewBalancerPool( 1, - balancer.PoolParams{SwapFee: sdk.ZeroDec(), ExitFee: sdk.MustNewDecFromStr("0.0002")}, + balancer.PoolParams{SwapFee: sdk.ZeroDec()}, threeBalancerPoolAssets, "", time.Now(), @@ -126,15 +126,14 @@ func TestCalcExitPool(t *testing.T) { for _, test := range tests { // using empty context since, currently, the context is not used anyway. This might be changed in the future - exitFee := test.pool.GetExitFee(emptyContext) - exitCoins, err := cfmm_common.CalcExitPool(emptyContext, test.pool, test.exitingShares, exitFee) + exitCoins, err := cfmm_common.CalcExitPool(emptyContext, test.pool, test.exitingShares, sdk.ZeroDec()) if test.expError { require.Error(t, err, "test: %v", test.name) } else { require.NoError(t, err, "test: %v", test.name) // exitCoins = ( (1 - exitFee) * exitingShares / poolTotalShares ) * poolTotalLiquidity - expExitCoins := mulCoins(test.pool.GetTotalPoolLiquidity(emptyContext), (sdk.OneDec().Sub(exitFee)).MulInt(test.exitingShares).QuoInt(test.pool.GetTotalShares())) + expExitCoins := mulCoins(test.pool.GetTotalPoolLiquidity(emptyContext), (sdk.OneDec()).MulInt(test.exitingShares).QuoInt(test.pool.GetTotalShares())) require.Equal(t, expExitCoins.Sort().String(), exitCoins.Sort().String(), "test: %v", test.name) } } @@ -160,7 +159,7 @@ func TestMaximalExactRatioJoin(t *testing.T) { pool: func() poolmanagertypes.PoolI { balancerPool, err := balancer.NewBalancerPool( 1, - balancer.PoolParams{SwapFee: sdk.ZeroDec(), ExitFee: sdk.ZeroDec()}, + balancer.PoolParams{SwapFee: sdk.ZeroDec()}, balancerPoolAsset, "", time.Now(), @@ -177,7 +176,7 @@ func TestMaximalExactRatioJoin(t *testing.T) { pool: func() poolmanagertypes.PoolI { balancerPool, err := balancer.NewBalancerPool( 1, - balancer.PoolParams{SwapFee: sdk.ZeroDec(), ExitFee: sdk.ZeroDec()}, + balancer.PoolParams{SwapFee: sdk.ZeroDec()}, balancerPoolAsset, "", time.Now(), @@ -194,7 +193,7 @@ func TestMaximalExactRatioJoin(t *testing.T) { for _, test := range tests { balancerPool, err := balancer.NewBalancerPool( 1, - balancer.PoolParams{SwapFee: sdk.ZeroDec(), ExitFee: sdk.ZeroDec()}, + balancer.PoolParams{SwapFee: sdk.ZeroDec()}, balancerPoolAsset, "", time.Now(), diff --git a/x/gamm/pool-models/stableswap/msgs_test.go b/x/gamm/pool-models/stableswap/msgs_test.go index 9c816e39907..cdd426cfed3 100644 --- a/x/gamm/pool-models/stableswap/msgs_test.go +++ b/x/gamm/pool-models/stableswap/msgs_test.go @@ -20,7 +20,6 @@ func baseCreatePoolMsgGen(sender sdk.AccAddress) *stableswap.MsgCreateStableswap poolParams := &stableswap.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), } msg := &stableswap.MsgCreateStableswapPool{ @@ -122,7 +121,6 @@ func TestMsgCreateStableswapPoolValidateBasic(t *testing.T) { msg: updateMsg(func(msg stableswap.MsgCreateStableswapPool) stableswap.MsgCreateStableswapPool { msg.PoolParams = &stableswap.PoolParams{ SwapFee: sdk.NewDecWithPrec(-1, 2), - ExitFee: sdk.NewDecWithPrec(0, 0), } return msg }), @@ -196,7 +194,6 @@ func TestMsgCreateStableswapPoolValidateBasic(t *testing.T) { name: "zero swap fee, zero exit fee", msg: updateMsg(func(msg stableswap.MsgCreateStableswapPool) stableswap.MsgCreateStableswapPool { msg.PoolParams = &stableswap.PoolParams{ - ExitFee: sdk.NewDecWithPrec(0, 0), SwapFee: sdk.NewDecWithPrec(0, 0), } return msg @@ -300,7 +297,7 @@ func (suite *TestSuite) TestMsgCreateStableswapPool() { suite.SetupTest() var ( - validParams = &stableswap.PoolParams{SwapFee: sdk.NewDecWithPrec(1, 2), ExitFee: sdk.NewDecWithPrec(1, 3)} + validParams = &stableswap.PoolParams{SwapFee: sdk.NewDecWithPrec(1, 2)} validInitialLiquidity = sdk.NewCoins(sdk.NewCoin("usdc", sdk.NewInt(1_000_000)), sdk.NewCoin("usdt", sdk.NewInt(2_000_000))) validScalingFactors = []uint64{1, 1} invalidScalingFactors = []uint64{1, 1, 1} diff --git a/x/gamm/pool-models/stableswap/pool.go b/x/gamm/pool-models/stableswap/pool.go index 40cf09dccd0..f415bd1d69a 100644 --- a/x/gamm/pool-models/stableswap/pool.go +++ b/x/gamm/pool-models/stableswap/pool.go @@ -89,10 +89,6 @@ func (p Pool) GetSwapFee(ctx sdk.Context) sdk.Dec { return p.PoolParams.SwapFee } -func (p Pool) GetExitFee(ctx sdk.Context) sdk.Dec { - return p.PoolParams.ExitFee -} - func (p Pool) IsActive(ctx sdk.Context) bool { return true } diff --git a/x/gamm/pool-models/stableswap/pool_params.go b/x/gamm/pool-models/stableswap/pool_params.go index f118ab0bd1d..d7d8c4306f7 100644 --- a/x/gamm/pool-models/stableswap/pool_params.go +++ b/x/gamm/pool-models/stableswap/pool_params.go @@ -7,14 +7,6 @@ import ( ) func (params PoolParams) Validate() error { - if params.ExitFee.IsNegative() { - return types.ErrNegativeExitFee - } - - if params.ExitFee.GTE(sdk.OneDec()) { - return types.ErrTooMuchExitFee - } - if params.SwapFee.IsNegative() { return types.ErrNegativeSwapFee } diff --git a/x/gamm/pool-models/stableswap/pool_test.go b/x/gamm/pool-models/stableswap/pool_test.go index 1297d677bc1..bb04bd3086b 100644 --- a/x/gamm/pool-models/stableswap/pool_test.go +++ b/x/gamm/pool-models/stableswap/pool_test.go @@ -17,11 +17,9 @@ import ( var ( defaultSwapFee = sdk.MustNewDecFromStr("0.025") - defaultExitFee = sdk.ZeroDec() defaultPoolId = uint64(1) defaultStableswapPoolParams = PoolParams{ SwapFee: defaultSwapFee, - ExitFee: defaultExitFee, } defaultTwoAssetScalingFactors = []uint64{1, 1} defaultThreeAssetScalingFactors = []uint64{1, 1, 1} @@ -960,7 +958,7 @@ func TestInverseJoinPoolExitPool(t *testing.T) { // we join then exit the pool shares, err := p.JoinPool(ctx, tc.tokensIn, tc.swapFee) - tokenOut, err := p.ExitPool(ctx, shares, defaultExitFee) + tokenOut, err := p.ExitPool(ctx, shares, sdk.ZeroDec()) // if single asset join, we swap output tokens to input denom to test the full inverse relationship if len(tc.tokensIn) == 1 { @@ -1040,7 +1038,7 @@ func TestExitPool(t *testing.T) { t.Run(name, func(t *testing.T) { ctx := sdk.Context{} p := poolStructFromAssets(tc.initialPoolLiquidity, tc.scalingFactors) - tokenOut, err := p.ExitPool(ctx, tc.sharesIn, defaultExitFee) + tokenOut, err := p.ExitPool(ctx, tc.sharesIn, sdk.ZeroDec()) if tc.expectPass { finalPoolLiquidity := p.GetTotalPoolLiquidity(ctx) diff --git a/x/gamm/pool-models/stableswap/stableswap_pool.pb.go b/x/gamm/pool-models/stableswap/stableswap_pool.pb.go index 388a59b0bba..231db43f019 100644 --- a/x/gamm/pool-models/stableswap/stableswap_pool.pb.go +++ b/x/gamm/pool-models/stableswap/stableswap_pool.pb.go @@ -34,7 +34,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // The pool's token holders are specified in future_pool_governor. type PoolParams struct { SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee" yaml:"swap_fee"` - ExitFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exit_fee,json=exitFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exit_fee" yaml:"exit_fee"` } func (m *PoolParams) Reset() { *m = PoolParams{} } @@ -136,48 +135,47 @@ func init() { } var fileDescriptor_ae0f054436f9999a = []byte{ - // 642 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x8e, 0xdb, 0xb4, 0x29, 0x5b, 0x48, 0x85, 0xa9, 0x84, 0xdb, 0x0a, 0x6f, 0xb0, 0x28, 0x8a, - 0x10, 0xb1, 0x29, 0x08, 0x24, 0x7a, 0x6b, 0x8a, 0x8a, 0x90, 0x10, 0x2a, 0xe6, 0xc4, 0x8f, 0x14, - 0xd6, 0xf6, 0xc6, 0x5d, 0x61, 0x67, 0xcd, 0xee, 0xba, 0xb4, 0x17, 0xce, 0x1c, 0x39, 0x72, 0xec, - 0x19, 0xae, 0x3c, 0x44, 0xc5, 0xa9, 0x47, 0xc4, 0xc1, 0xa0, 0xf6, 0x0d, 0xf2, 0x04, 0x68, 0xd7, - 0xeb, 0xfe, 0x04, 0xa8, 0x2a, 0x71, 0xca, 0xce, 0xcc, 0x37, 0xdf, 0xcc, 0x37, 0x33, 0x31, 0xb8, - 0x4f, 0x79, 0x4a, 0x39, 0xe1, 0x5e, 0x8c, 0xd2, 0xd4, 0xcb, 0x28, 0x4d, 0x3a, 0x29, 0x8d, 0x70, - 0xc2, 0x3d, 0x2e, 0x50, 0x90, 0x60, 0xfe, 0x0e, 0x65, 0xc7, 0x9e, 0x3d, 0x89, 0x70, 0x33, 0x46, - 0x05, 0x35, 0x6f, 0xe8, 0x54, 0x57, 0xa6, 0xba, 0x32, 0x50, 0x66, 0xba, 0x47, 0x70, 0x77, 0x73, - 0x29, 0xc0, 0x02, 0x2d, 0xcd, 0xcf, 0x85, 0x0a, 0xdc, 0x53, 0x99, 0x5e, 0x69, 0x94, 0x34, 0xf3, - 0xb3, 0x31, 0x8d, 0x69, 0xe9, 0x97, 0x2f, 0xed, 0xb5, 0x63, 0x4a, 0xe3, 0x04, 0x7b, 0xca, 0x0a, - 0xf2, 0xbe, 0x17, 0xe5, 0x0c, 0x09, 0x42, 0x07, 0x3a, 0x0e, 0x47, 0xe3, 0x82, 0xa4, 0x98, 0x0b, - 0x94, 0x66, 0x15, 0x41, 0x59, 0xc4, 0x43, 0xb9, 0xd8, 0xf0, 0x74, 0x1b, 0xca, 0x18, 0x89, 0x07, - 0x88, 0xe3, 0xc3, 0x78, 0x48, 0x89, 0x2e, 0xe0, 0xec, 0x1a, 0x00, 0xac, 0x53, 0x9a, 0xac, 0x23, - 0x86, 0x52, 0x6e, 0x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 0x07, 0x76, 0x6d, 0xef, 0xc0, 0xae, 0x7d, 0x3f, 0xb0, 0x6b, 0x2f, 0x56, 0x8e, 0xcd, 0x45, 0x5f, - 0x5d, 0x27, 0x41, 0x01, 0xaf, 0x0c, 0x6f, 0x73, 0xe9, 0xae, 0xb7, 0x75, 0xda, 0x97, 0x2c, 0x98, - 0x54, 0x7f, 0xee, 0x3b, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x5c, 0xc8, 0x15, 0xc4, 0xf7, 0x04, - 0x00, 0x00, + // 625 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd4, 0x3c, + 0x14, 0x9d, 0xb4, 0xd3, 0x9f, 0xcf, 0xfd, 0x98, 0x8a, 0x50, 0x89, 0xb4, 0x15, 0xf1, 0x10, 0x51, + 0x34, 0x42, 0x4c, 0x42, 0x41, 0x20, 0xd1, 0x5d, 0xa7, 0xa8, 0x08, 0x09, 0xa1, 0x12, 0x56, 0xfc, + 0x48, 0x83, 0x93, 0x78, 0x52, 0x83, 0x33, 0x0e, 0xb6, 0x53, 0xe8, 0x86, 0x35, 0x4b, 0x96, 0x2c, + 0xbb, 0x86, 0x2d, 0x0f, 0x51, 0xb1, 0xea, 0x12, 0xb1, 0x08, 0xa8, 0x7d, 0x83, 0x79, 0x02, 0x64, + 0xc7, 0xd3, 0x9f, 0x01, 0xaa, 0xae, 0xc6, 0xf7, 0xde, 0x73, 0xcf, 0x39, 0xd7, 0xd7, 0x13, 0x70, + 0x97, 0x89, 0x8c, 0x09, 0x22, 0x82, 0x14, 0x65, 0x59, 0x90, 0x33, 0x46, 0xdb, 0x19, 0x4b, 0x30, + 0x15, 0x81, 0x90, 0x28, 0xa2, 0x58, 0xbc, 0x45, 0xf9, 0xb1, 0x63, 0x57, 0x21, 0xfc, 0x9c, 0x33, + 0xc9, 0xec, 0x6b, 0xa6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 0x94, 0xf0, 0xf2, 0x1f, 0x37, 0x3d, 0x82, 0xf5, 0xc2, 0x86, 0xc9, 0xac, 0x57, 0x09, + 0xfb, 0x25, 0x98, 0x3f, 0x89, 0xe9, 0xc6, 0xac, 0x2f, 0x39, 0xa3, 0x14, 0x73, 0x67, 0x5a, 0x5f, + 0xfb, 0x95, 0x41, 0x09, 0x9b, 0x86, 0xf9, 0x5f, 0x50, 0x2f, 0xbc, 0x78, 0x82, 0x78, 0xed, 0xb0, + 0xb2, 0x72, 0xfe, 0xc3, 0x0e, 0xac, 0x7d, 0xda, 0x81, 0xb5, 0x6f, 0x5f, 0xdb, 0x13, 0x6a, 0x35, + 0x0f, 0x3a, 0xcf, 0x77, 0xf7, 0x5d, 0x6b, 0x6f, 0xdf, 0xb5, 0x7e, 0xed, 0xbb, 0xd6, 0xc7, 0x03, + 0xb7, 0xb6, 0x77, 0xe0, 0xd6, 0xbe, 0x1f, 0xb8, 0xb5, 0x67, 0xab, 0xc7, 0xee, 0xc5, 0xbc, 0xba, + 0x36, 0x45, 0x91, 0x18, 0x06, 0xc1, 0xd6, 0xf2, 0xed, 0xe0, 0xdd, 0x69, 0x9f, 0x9a, 0x68, 0x52, + 0xff, 0xfb, 0x6e, 0xfd, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xf5, 0x01, 0x3e, 0x98, 0x04, 0x00, + 0x00, } func (m *PoolParams) Marshal() (dAtA []byte, err error) { @@ -200,16 +198,6 @@ func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size := m.ExitFee.Size() - i -= size - if _, err := m.ExitFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintStableswapPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 { size := m.SwapFee.Size() i -= size @@ -343,8 +331,6 @@ func (m *PoolParams) Size() (n int) { _ = l l = m.SwapFee.Size() n += 1 + l + sovStableswapPool(uint64(l)) - l = m.ExitFee.Size() - n += 1 + l + sovStableswapPool(uint64(l)) return n } @@ -458,40 +444,6 @@ func (m *PoolParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExitFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStableswapPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStableswapPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipStableswapPool(dAtA[iNdEx:]) diff --git a/x/gamm/pool-models/stableswap/util_test.go b/x/gamm/pool-models/stableswap/util_test.go index dada28614ea..1ec901d7f93 100644 --- a/x/gamm/pool-models/stableswap/util_test.go +++ b/x/gamm/pool-models/stableswap/util_test.go @@ -14,7 +14,6 @@ func createTestPool(t *testing.T, poolLiquidity sdk.Coins, swapFee, exitFee sdk. pool, err := NewStableswapPool(1, PoolParams{ SwapFee: swapFee, - ExitFee: exitFee, }, poolLiquidity, scalingFactors, "", "") require.NoError(t, err) diff --git a/x/gamm/simulation/sim_msgs.go b/x/gamm/simulation/sim_msgs.go index ccb550435cc..ecbd1c3c0ba 100644 --- a/x/gamm/simulation/sim_msgs.go +++ b/x/gamm/simulation/sim_msgs.go @@ -70,7 +70,7 @@ func RandomExitPoolMsg(k keeper.Keeper, sim *simtypes.SimCtx, ctx sdk.Context) ( } // calculate the minimum number of tokens received from input of gamm shares - tokenOutMins, err := pool.CalcExitPoolCoinsFromShares(ctx, gammShares.Amount, pool.GetExitFee(ctx)) + tokenOutMins, err := pool.CalcExitPoolCoinsFromShares(ctx, gammShares.Amount, sdk.ZeroDec()) if err != nil { return nil, err } @@ -103,7 +103,6 @@ func RandomCreateUniV2Msg(k keeper.Keeper, sim *simtypes.SimCtx, ctx sdk.Context // TODO: pseudo-randomly generate swap and exit fees poolParams := &balancertypes.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.ZeroDec(), } // from the above selected account, determine the token type and respective weight needed to make the pool @@ -300,7 +299,7 @@ func RandomExitSwapExternAmountOut(k keeper.Keeper, sim *simtypes.SimCtx, ctx sd gammShares.Amount = sim.RandomAmount(gammShares.Amount) // calc exitedCoins from gammShares in - exitedCoins, err := pool.CalcExitPoolCoinsFromShares(ctx, gammShares.Amount, pool.GetExitFee(ctx)) + exitedCoins, err := pool.CalcExitPoolCoinsFromShares(ctx, gammShares.Amount, sdk.ZeroDec()) if err != nil { return nil, err } @@ -342,7 +341,7 @@ func RandomExitSwapShareAmountIn(k keeper.Keeper, sim *simtypes.SimCtx, ctx sdk. gammShares.Amount = sim.RandomAmount(gammShares.Amount) // calc exitedCoins from gammShares in - exitedCoins, err := pool.CalcExitPoolCoinsFromShares(ctx, gammShares.Amount, pool.GetExitFee(ctx)) + exitedCoins, err := pool.CalcExitPoolCoinsFromShares(ctx, gammShares.Amount, sdk.ZeroDec()) if err != nil { return nil, err } diff --git a/x/poolmanager/client/cli/cli_test.go b/x/poolmanager/client/cli/cli_test.go index cff4bd45458..b7ff7f09b28 100644 --- a/x/poolmanager/client/cli/cli_test.go +++ b/x/poolmanager/client/cli/cli_test.go @@ -258,9 +258,8 @@ func (s *IntegrationTestSuite) TestNewCreatePoolCmd() { "%s": "1node0token", "%s": "100node0token", "%s": "0.001", - "%s": "0.001" } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee), + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee), true, &sdk.TxResponse{}, 4, }, { @@ -270,9 +269,8 @@ func (s *IntegrationTestSuite) TestNewCreatePoolCmd() { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001" } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee), + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee), false, &sdk.TxResponse{}, 0, }, { @@ -282,9 +280,8 @@ func (s *IntegrationTestSuite) TestNewCreatePoolCmd() { "%s": "100node0token,100stake", "%s": "0.001", "%s": "1node0token,3stake", - "%s": "0.001" } - `, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileWeights, cli.PoolFileExitFee), + `, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileWeights), false, &sdk.TxResponse{}, 0, }, { // --record-tokens=100.0stake2 --record-tokens=100.0stake --record-tokens-weight=5 --record-tokens-weight=5 --swap-fee=0.01 --exit-fee=0.01 --from=validator --keyring-backend=test --chain-id=testing --yes @@ -294,9 +291,8 @@ func (s *IntegrationTestSuite) TestNewCreatePoolCmd() { "%s": "1node0token,1stake,2btc", "%s": "100node0token,100stake,100btc", "%s": "0.001", - "%s": "0.001" } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee), + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee), false, &sdk.TxResponse{}, 5, }, { @@ -306,10 +302,9 @@ func (s *IntegrationTestSuite) TestNewCreatePoolCmd() { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001", "%s": "osmo1fqlr98d45v5ysqgp6h56kpujcj4cvsjnjq9nck" } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee, cli.PoolFileFutureGovernor), + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileFutureGovernor), false, &sdk.TxResponse{}, 0, }, // Due to CI time concerns, we leave these CLI tests commented out, and instead guaranteed via @@ -365,9 +360,8 @@ func (s *IntegrationTestSuite) TestNewCreatePoolCmd() { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": 0.001 } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee), + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee), true, &sdk.TxResponse{}, 0, }, { @@ -381,14 +375,13 @@ func (s *IntegrationTestSuite) TestNewCreatePoolCmd() { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001", "%s": { "%s": "864h", "%s": "2node0token,1stake", "%s": "2006-01-02T15:04:05Z" } } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee, + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileSmoothWeightChangeParams, cli.PoolFileDuration, cli.PoolFileTargetPoolWeights, cli.PoolFileStartTime, ), false, &sdk.TxResponse{}, 0, @@ -400,13 +393,12 @@ func (s *IntegrationTestSuite) TestNewCreatePoolCmd() { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001", "%s": { "%s": "864h", "%s": "2node0token,1stake" } } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee, + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileSmoothWeightChangeParams, cli.PoolFileDuration, cli.PoolFileTargetPoolWeights, ), false, &sdk.TxResponse{}, 0, @@ -418,10 +410,9 @@ func (s *IntegrationTestSuite) TestNewCreatePoolCmd() { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001", "%s": {} } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee, + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileSmoothWeightChangeParams, ), false, &sdk.TxResponse{}, 0, @@ -433,10 +424,9 @@ func (s *IntegrationTestSuite) TestNewCreatePoolCmd() { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001", "%s": "invalid string" } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee, + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileSmoothWeightChangeParams, ), true, &sdk.TxResponse{}, 0, @@ -448,12 +438,11 @@ func (s *IntegrationTestSuite) TestNewCreatePoolCmd() { "%s": "1node0token,3stake", "%s": "100node0token,100stake", "%s": "0.001", - "%s": "0.001", "%s": { "%s": "2node0token,1stake" } } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee, + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileSmoothWeightChangeParams, cli.PoolFileTargetPoolWeights, ), true, &sdk.TxResponse{}, 0, @@ -465,10 +454,9 @@ func (s *IntegrationTestSuite) TestNewCreatePoolCmd() { "%s": "1node0token", "%s": "100node0token", "%s": "0.001", - "%s": "0.001" "unknown": true, } - `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee, cli.PoolFileExitFee), + `, cli.PoolFileWeights, cli.PoolFileInitialDeposit, cli.PoolFileSwapFee), true, &sdk.TxResponse{}, 0, }, } diff --git a/x/poolmanager/client/cli/flags.go b/x/poolmanager/client/cli/flags.go index e3275864c19..54cc8ac6472 100644 --- a/x/poolmanager/client/cli/flags.go +++ b/x/poolmanager/client/cli/flags.go @@ -7,7 +7,6 @@ const ( PoolFileWeights = "weights" PoolFileInitialDeposit = "initial-deposit" PoolFileSwapFee = "swap-fee" - PoolFileExitFee = "exit-fee" PoolFileFutureGovernor = "future-governor" PoolFileSmoothWeightChangeParams = "lbp-params" @@ -27,7 +26,6 @@ type createBalancerPoolInputs struct { Weights string `json:"weights"` InitialDeposit string `json:"initial-deposit"` SwapFee string `json:"swap-fee"` - ExitFee string `json:"exit-fee"` FutureGovernor string `json:"future-governor"` SmoothWeightChangeParams smoothWeightChangeParamsInputs `json:"lbp-params"` } @@ -35,7 +33,6 @@ type createBalancerPoolInputs struct { type createStableswapPoolInputs struct { InitialDeposit string `json:"initial-deposit"` SwapFee string `json:"swap-fee"` - ExitFee string `json:"exit-fee"` FutureGovernor string `json:"future-governor"` ScalingFactorController string `json:"scaling-factor-controller"` ScalingFactors string `json:"scaling-factors"` diff --git a/x/poolmanager/client/cli/tx.go b/x/poolmanager/client/cli/tx.go index 9a5daad9f04..922eb209209 100644 --- a/x/poolmanager/client/cli/tx.go +++ b/x/poolmanager/client/cli/tx.go @@ -170,11 +170,6 @@ func NewBuildCreateBalancerPoolMsg(clientCtx client.Context, txf tx.Factory, fs return txf, nil, err } - exitFee, err := sdk.NewDecFromStr(pool.ExitFee) - if err != nil { - return txf, nil, err - } - var poolAssets []balancer.PoolAsset for i := 0; i < len(poolAssetCoins); i++ { if poolAssetCoins[i].Denom != deposit[i].Denom { @@ -189,7 +184,6 @@ func NewBuildCreateBalancerPoolMsg(clientCtx client.Context, txf tx.Factory, fs poolParams := &balancer.PoolParams{ SwapFee: swapFee, - ExitFee: exitFee, } msg := &balancer.MsgCreateBalancerPool{ @@ -261,14 +255,8 @@ func NewBuildCreateStableswapPoolMsg(clientCtx client.Context, txf tx.Factory, f return txf, nil, err } - exitFee, err := sdk.NewDecFromStr(flags.ExitFee) - if err != nil { - return txf, nil, err - } - poolParams := &stableswap.PoolParams{ SwapFee: swapFee, - ExitFee: exitFee, } scalingFactors := []uint64{} diff --git a/x/poolmanager/client/testutil/test_helpers.go b/x/poolmanager/client/testutil/test_helpers.go index 16978f5527c..fd724952a42 100644 --- a/x/poolmanager/client/testutil/test_helpers.go +++ b/x/poolmanager/client/testutil/test_helpers.go @@ -44,8 +44,6 @@ func MsgCreatePool( "%s": "%s", "%s": "%s", "%s": "%s", - "%s": "%s", - "%s": "%s" } `, poolmanagercli.PoolFileWeights, tokenWeights, @@ -53,10 +51,10 @@ func MsgCreatePool( initialDeposit, poolmanagercli.PoolFileSwapFee, swapFee, - poolmanagercli.PoolFileExitFee, - exitFee, - poolmanagercli.PoolFileExitFee, - exitFee, + // poolmanagercli.PoolFileExitFee, + // exitFee, + // poolmanagercli.PoolFileExitFee, + // exitFee, ), ) diff --git a/x/poolmanager/create_pool_test.go b/x/poolmanager/create_pool_test.go index 7cd2f6e1800..a9eff7dc763 100644 --- a/x/poolmanager/create_pool_test.go +++ b/x/poolmanager/create_pool_test.go @@ -34,7 +34,6 @@ func (suite *KeeperTestSuite) TestPoolCreationFee() { poolCreationFee: sdk.Coins{}, msg: balancer.NewMsgCreateBalancerPool(suite.TestAccs[0], balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, apptesting.DefaultPoolAssets, ""), expectPass: true, }, { @@ -42,7 +41,6 @@ func (suite *KeeperTestSuite) TestPoolCreationFee() { poolCreationFee: nil, msg: balancer.NewMsgCreateBalancerPool(suite.TestAccs[0], balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, apptesting.DefaultPoolAssets, ""), expectPass: true, }, { @@ -50,7 +48,6 @@ func (suite *KeeperTestSuite) TestPoolCreationFee() { poolCreationFee: sdk.Coins{sdk.NewCoin("atom", sdk.NewInt(10000))}, msg: balancer.NewMsgCreateBalancerPool(suite.TestAccs[0], balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDecWithPrec(1, 2), }, apptesting.DefaultPoolAssets, ""), expectPass: false, }, diff --git a/x/poolmanager/keeper_test.go b/x/poolmanager/keeper_test.go index bc487999f62..974b9dda0e4 100644 --- a/x/poolmanager/keeper_test.go +++ b/x/poolmanager/keeper_test.go @@ -62,7 +62,6 @@ func (suite *KeeperTestSuite) createBalancerPoolsFromCoinsWithSwapFee(poolCoins suite.FundAcc(suite.TestAccs[0], curPoolCoins) suite.PrepareCustomBalancerPoolFromCoins(curPoolCoins, balancer.PoolParams{ SwapFee: swapFee[i], - ExitFee: sdk.ZeroDec(), }) } } diff --git a/x/poolmanager/router_test.go b/x/poolmanager/router_test.go index 1b53e5cbdc7..3a280a0b4af 100644 --- a/x/poolmanager/router_test.go +++ b/x/poolmanager/router_test.go @@ -1103,7 +1103,6 @@ func (suite *KeeperTestSuite) TestSingleSwapExactAmountIn() { suite.FundAcc(suite.TestAccs[0], tc.poolCoins) suite.PrepareCustomBalancerPoolFromCoins(tc.poolCoins, balancer.PoolParams{ SwapFee: tc.poolFee, - ExitFee: sdk.ZeroDec(), }) // execute the swap @@ -1139,21 +1138,17 @@ func (suite *KeeperTestSuite) setupPools(poolType types.PoolType, poolDefaultSwa // and two pools for calculating `EstimateMultihopSwapExactAmountOut` suite.PrepareBalancerPoolWithPoolParams(balancer.PoolParams{ SwapFee: poolDefaultSwapFee, // 1% - ExitFee: sdk.NewDec(0), }) suite.PrepareBalancerPoolWithPoolParams(balancer.PoolParams{ SwapFee: poolDefaultSwapFee, - ExitFee: sdk.NewDec(0), }) firstEstimatePoolId = suite.PrepareBalancerPoolWithPoolParams(balancer.PoolParams{ SwapFee: poolDefaultSwapFee, // 1% - ExitFee: sdk.NewDec(0), }) secondEstimatePoolId = suite.PrepareBalancerPoolWithPoolParams(balancer.PoolParams{ SwapFee: poolDefaultSwapFee, - ExitFee: sdk.NewDec(0), }) return } diff --git a/x/poolmanager/types/pool.go b/x/poolmanager/types/pool.go index 00c04038740..f7003c04da1 100644 --- a/x/poolmanager/types/pool.go +++ b/x/poolmanager/types/pool.go @@ -17,9 +17,6 @@ type PoolI interface { // (prior TWAPs, network downtime, other pool states, etc.) // hence Context is provided as an argument. GetSwapFee(ctx sdk.Context) sdk.Dec - // GetExitFee returns the pool's exit fee, based on the current state. - // Pools may choose to make their exit fees dependent upon state. - GetExitFee(ctx sdk.Context) sdk.Dec // Returns whether the pool has swaps enabled at the moment IsActive(ctx sdk.Context) bool // GetTotalShares returns the total number of LP shares in the pool diff --git a/x/protorev/keeper/keeper_test.go b/x/protorev/keeper/keeper_test.go index 4cd2c5e09d8..5123a6922f2 100644 --- a/x/protorev/keeper/keeper_test.go +++ b/x/protorev/keeper/keeper_test.go @@ -41,7 +41,6 @@ type Pool struct { Amount1 sdk.Int Amount2 sdk.Int SwapFee sdk.Dec - ExitFee sdk.Dec PoolId uint64 } @@ -178,7 +177,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 1, }, { // Pool 2 @@ -193,7 +191,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 2, }, { // Pool 3 @@ -208,7 +205,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 3, }, { // Pool 4 @@ -223,7 +219,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 4, }, { // Pool 5 @@ -238,7 +233,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 5, }, { // Pool 6 @@ -253,7 +247,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 6, }, { // Pool 7 @@ -268,7 +261,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 7, }, { // Pool 8 @@ -283,7 +275,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 8, }, { // Pool 9 @@ -298,7 +289,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 9, }, { // Pool 10 @@ -313,7 +303,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 10, }, { // Pool 11 @@ -328,7 +317,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 11, }, { // Pool 12 @@ -343,7 +331,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 12, }, { // Pool 13 @@ -358,7 +345,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 13, }, { // Pool 14 @@ -373,7 +359,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 14, }, { // Pool 15 @@ -388,7 +373,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 15, }, { // Pool 16 @@ -403,7 +387,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 16, }, { // Pool 17 @@ -418,7 +401,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 17, }, { // Pool 18 @@ -433,7 +415,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 18, }, { // Pool 19 @@ -448,7 +429,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 19, }, { // Pool 20 @@ -463,7 +443,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 20, }, { // Pool 21 @@ -478,7 +457,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(0, 2), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 21, }, { // Pool 22 @@ -493,7 +471,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(2, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 22, }, { // Pool 23 @@ -508,7 +485,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(535, 5), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 23, }, { // Pool 24 @@ -523,7 +499,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(2, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 24, }, { // Pool 25 @@ -538,7 +513,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(2, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 25, }, { // Pool 26 @@ -553,7 +527,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(2, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 26, }, { // Pool 27 @@ -568,7 +541,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(2, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 27, }, { // Pool 28 @@ -591,7 +563,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(4, 4), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 28, }, { // Pool 29 @@ -606,7 +577,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(2, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 29, }, { // Pool 30 @@ -621,7 +591,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(2, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 30, }, { // Pool 31 @@ -644,7 +613,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(4, 4), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 31, }, { // Pool 32 @@ -659,7 +627,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(3, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 32, }, { // Pool 33 @@ -674,7 +641,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(3, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 33, }, { // Pool 34 @@ -689,7 +655,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(3, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 34, }, { // Pool 35 @@ -704,7 +669,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(2, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 35, }, { // Pool 36 @@ -719,7 +683,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(3, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 36, }, { // Pool 37 @@ -734,7 +697,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(3, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 37, }, { // Pool 38 @@ -749,7 +711,6 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(2, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 38, }, { // Pool 39 @@ -764,13 +725,12 @@ func (suite *KeeperTestSuite) setUpPools() { }, }, SwapFee: sdk.NewDecWithPrec(2, 3), - ExitFee: sdk.NewDecWithPrec(0, 2), PoolId: 39, }, } for _, pool := range suite.pools { - suite.createGAMMPool(pool.PoolAssets, pool.SwapFee, pool.ExitFee) + suite.createGAMMPool(pool.PoolAssets, pool.SwapFee, sdk.ZeroDec()) } suite.stableSwapPools = []StableSwapPool{ @@ -782,7 +742,6 @@ func (suite *KeeperTestSuite) setUpPools() { ), poolParams: stableswap.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 4), - ExitFee: sdk.NewDecWithPrec(0, 2), }, scalingFactors: []uint64{1, 1, 1}, }, @@ -794,7 +753,6 @@ func (suite *KeeperTestSuite) setUpPools() { ), poolParams: stableswap.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 4), - ExitFee: sdk.NewDecWithPrec(0, 2), }, scalingFactors: []uint64{1, 1, 1}, }, @@ -805,7 +763,6 @@ func (suite *KeeperTestSuite) setUpPools() { ), poolParams: stableswap.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 4), - ExitFee: sdk.NewDecWithPrec(0, 2), }, scalingFactors: []uint64{1, 1}, }, @@ -816,7 +773,6 @@ func (suite *KeeperTestSuite) setUpPools() { ), poolParams: stableswap.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 4), - ExitFee: sdk.NewDecWithPrec(0, 2), }, scalingFactors: []uint64{1, 1}, }, @@ -827,7 +783,6 @@ func (suite *KeeperTestSuite) setUpPools() { ), poolParams: stableswap.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 4), - ExitFee: sdk.NewDecWithPrec(0, 2), }, scalingFactors: []uint64{1, 1}, }, @@ -838,7 +793,6 @@ func (suite *KeeperTestSuite) setUpPools() { ), poolParams: stableswap.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 4), - ExitFee: sdk.NewDecWithPrec(0, 2), }, scalingFactors: []uint64{1, 1}, }, @@ -864,7 +818,6 @@ func (suite *KeeperTestSuite) createStableswapPool(initialLiquidity sdk.Coins, p func (suite *KeeperTestSuite) createGAMMPool(poolAssets []balancertypes.PoolAsset, swapFee, exitFee sdk.Dec) uint64 { poolParams := balancertypes.PoolParams{ SwapFee: swapFee, - ExitFee: exitFee, } return suite.prepareCustomBalancerPool(poolAssets, poolParams) diff --git a/x/superfluid/keeper/gov/gov_test.go b/x/superfluid/keeper/gov/gov_test.go index 5bbc47d2403..ab031263b62 100644 --- a/x/superfluid/keeper/gov/gov_test.go +++ b/x/superfluid/keeper/gov/gov_test.go @@ -31,7 +31,6 @@ func (suite *KeeperTestSuite) createGammPool(denoms []string) uint64 { msg := balancer.NewMsgCreateBalancerPool(acc1, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.ZeroDec(), }, poolAssets, "") poolId, err := suite.App.PoolManagerKeeper.CreatePool(suite.Ctx, msg) suite.Require().NoError(err) diff --git a/x/superfluid/keeper/keeper_test.go b/x/superfluid/keeper/keeper_test.go index 7c693c3a759..9f395fdcc16 100644 --- a/x/superfluid/keeper/keeper_test.go +++ b/x/superfluid/keeper/keeper_test.go @@ -110,7 +110,6 @@ func (suite *KeeperTestSuite) createGammPool(denoms []string) uint64 { msg := balancer.NewMsgCreateBalancerPool(acc1, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.ZeroDec(), }, poolAssets, "") poolId, err := suite.App.PoolManagerKeeper.CreatePool(suite.Ctx, msg) suite.Require().NoError(err) diff --git a/x/superfluid/keeper/migrate_test.go b/x/superfluid/keeper/migrate_test.go index 1af63ec95de..3b416c5f287 100644 --- a/x/superfluid/keeper/migrate_test.go +++ b/x/superfluid/keeper/migrate_test.go @@ -96,7 +96,6 @@ func (suite *KeeperTestSuite) TestUnlockAndMigrate() { // Create a balancer pool of "stake" and "foo". msg := balancer.NewMsgCreateBalancerPool(poolCreateAcc, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDec(0), }, defaultPoolAssets, defaultFutureGovernor) balancerPooId, err := poolmanagerKeeper.CreatePool(ctx, msg) suite.Require().NoError(err) diff --git a/x/superfluid/keeper/unpool_test.go b/x/superfluid/keeper/unpool_test.go index dcab10d934a..9bb15f47edf 100644 --- a/x/superfluid/keeper/unpool_test.go +++ b/x/superfluid/keeper/unpool_test.go @@ -15,10 +15,8 @@ import ( var ( defaultSwapFee = sdk.MustNewDecFromStr("0.025") - defaultExitFee = sdk.MustNewDecFromStr("0.025") defaultPoolParams = balancer.PoolParams{ SwapFee: defaultSwapFee, - ExitFee: defaultExitFee, } defaultFutureGovernor = "" @@ -113,7 +111,6 @@ func (suite *KeeperTestSuite) TestUnpool() { // create pool of "stake" and "foo" msg := balancer.NewMsgCreateBalancerPool(poolCreateAcc, balancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(1, 2), - ExitFee: sdk.NewDec(0), }, defaultPoolAssets, defaultFutureGovernor) poolId, err := poolmanagerKeeper.CreatePool(ctx, msg) diff --git a/x/twap/api_test.go b/x/twap/api_test.go index e93bade2b3e..8ef15ec5bb6 100644 --- a/x/twap/api_test.go +++ b/x/twap/api_test.go @@ -887,7 +887,6 @@ func (s *TestSuite) TestGeometricTwapToNow_BalancerPool_Randomized() { s.PrepareCustomBalancerPool(assets, balancer.PoolParams{ SwapFee: sdk.ZeroDec(), - ExitFee: sdk.ZeroDec(), }) // We add 1ms to avoid always landing on the same block time From eac9f6f190b6bca627ea504a41aa3e96cf40461e Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Mon, 27 Feb 2023 17:22:01 +0700 Subject: [PATCH 02/26] remove exit-fee in e2e --- scripts/setup_superfluid.sh | 1 - scripts/upgrade/upgrade_lockup.sh | 1 - tests/e2e/scripts/geometricPool.json | 1 - tests/e2e/scripts/ibcDenomPool.json | 1 - tests/e2e/scripts/nativeDenomPool.json | 1 - tests/e2e/scripts/nativeDenomThreeAssetPool.json | 1 - tests/e2e/scripts/pool1A.json | 1 - tests/e2e/scripts/pool1B.json | 1 - tests/e2e/scripts/protorevPool1.json | 1 - tests/e2e/scripts/protorevPool2.json | 1 - tests/e2e/scripts/protorevPool3.json | 1 - tests/ibc-hooks/test_crosschain_swaps.sh | 1 - tests/localosmosis/scripts/nativeDenomPoolA.json | 1 - tests/localosmosis/scripts/nativeDenomPoolB.json | 1 - tests/localosmosis/scripts/nativeDenomThreeAssetPool.json | 1 - tests/localosmosis/scripts/stableswapPool.json | 1 - x/gamm/client/cli/tx.go | 2 -- x/poolmanager/client/cli/tx.go | 1 - 18 files changed, 19 deletions(-) diff --git a/scripts/setup_superfluid.sh b/scripts/setup_superfluid.sh index ee5f4c94bee..0825ccf8eda 100644 --- a/scripts/setup_superfluid.sh +++ b/scripts/setup_superfluid.sh @@ -7,7 +7,6 @@ # "weights": "5stake,5uosmo", # "initial-deposit": "1000000stake,1000000uosmo", # "swap-fee": "0.01", -# "exit-fee": "0.01", # "future-governor": "168h" # } diff --git a/scripts/upgrade/upgrade_lockup.sh b/scripts/upgrade/upgrade_lockup.sh index f5fe14ab6e6..08179ea8c75 100644 --- a/scripts/upgrade/upgrade_lockup.sh +++ b/scripts/upgrade/upgrade_lockup.sh @@ -26,7 +26,6 @@ Create pool.json "weights": "1stake,1valtoken", "initial-deposit": "100stake,20valtoken", "swap-fee": "0.01", - "exit-fee": "0.01", "future-governor": "168h" } ``` diff --git a/tests/e2e/scripts/geometricPool.json b/tests/e2e/scripts/geometricPool.json index 8c60b25e5cf..75b2362c86a 100644 --- a/tests/e2e/scripts/geometricPool.json +++ b/tests/e2e/scripts/geometricPool.json @@ -2,6 +2,5 @@ "weights": "1uosmo,1stake", "initial-deposit": "1000000uosmo,2000000stake", "swap-fee": "0", - "exit-fee": "0", "future-governor": "" } diff --git a/tests/e2e/scripts/ibcDenomPool.json b/tests/e2e/scripts/ibcDenomPool.json index 730a02acb80..ae9c06ec3de 100644 --- a/tests/e2e/scripts/ibcDenomPool.json +++ b/tests/e2e/scripts/ibcDenomPool.json @@ -2,6 +2,5 @@ "weights": "5ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,5uosmo", "initial-deposit": "499404ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,500000uosmo", "swap-fee": "0.01", - "exit-fee": "0.01", "future-governor": "" } diff --git a/tests/e2e/scripts/nativeDenomPool.json b/tests/e2e/scripts/nativeDenomPool.json index 86e86c56ff9..7737f05504a 100644 --- a/tests/e2e/scripts/nativeDenomPool.json +++ b/tests/e2e/scripts/nativeDenomPool.json @@ -2,6 +2,5 @@ "weights": "5uosmo,5stake", "initial-deposit": "499404uosmo,500000stake", "swap-fee": "0.01", - "exit-fee": "0.01", "future-governor": "" } diff --git a/tests/e2e/scripts/nativeDenomThreeAssetPool.json b/tests/e2e/scripts/nativeDenomThreeAssetPool.json index e86d42b90f4..f48f634dd58 100644 --- a/tests/e2e/scripts/nativeDenomThreeAssetPool.json +++ b/tests/e2e/scripts/nativeDenomThreeAssetPool.json @@ -2,6 +2,5 @@ "weights": "5stake,5uion,5uosmo", "initial-deposit": "10000000stake,1000000uion,20000000uosmo", "swap-fee": "0.01", - "exit-fee": "0.01", "future-governor": "" } diff --git a/tests/e2e/scripts/pool1A.json b/tests/e2e/scripts/pool1A.json index ce93c659c5a..75591259fba 100644 --- a/tests/e2e/scripts/pool1A.json +++ b/tests/e2e/scripts/pool1A.json @@ -2,6 +2,5 @@ "weights": "5ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,5uosmo", "initial-deposit": "499404ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,500000uosmo", "swap-fee": "0.01", - "exit-fee": "0.01", "future-governor": "" } diff --git a/tests/e2e/scripts/pool1B.json b/tests/e2e/scripts/pool1B.json index 730a02acb80..ae9c06ec3de 100644 --- a/tests/e2e/scripts/pool1B.json +++ b/tests/e2e/scripts/pool1B.json @@ -2,6 +2,5 @@ "weights": "5ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,5uosmo", "initial-deposit": "499404ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,500000uosmo", "swap-fee": "0.01", - "exit-fee": "0.01", "future-governor": "" } diff --git a/tests/e2e/scripts/protorevPool1.json b/tests/e2e/scripts/protorevPool1.json index ac3a1bd7af8..68851305b4a 100644 --- a/tests/e2e/scripts/protorevPool1.json +++ b/tests/e2e/scripts/protorevPool1.json @@ -2,6 +2,5 @@ "weights": "1ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC,1uosmo", "initial-deposit": "18986995439401ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC,191801648570uosmo", "swap-fee": "0.002", - "exit-fee": "0.0", "future-governor": "" } \ No newline at end of file diff --git a/tests/e2e/scripts/protorevPool2.json b/tests/e2e/scripts/protorevPool2.json index 212b273361c..9574c95cb69 100644 --- a/tests/e2e/scripts/protorevPool2.json +++ b/tests/e2e/scripts/protorevPool2.json @@ -2,6 +2,5 @@ "weights": "1ibc/0EF15DF2F02480ADE0BB6E85D9EBB5DAEA2836D3860E9F97F9AADE4F57A31AA0,1ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC", "initial-deposit": "72765460003038ibc/0EF15DF2F02480ADE0BB6E85D9EBB5DAEA2836D3860E9F97F9AADE4F57A31AA0,596032233203ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC", "swap-fee": "0.00535", - "exit-fee": "0.0", "future-governor": "" } \ No newline at end of file diff --git a/tests/e2e/scripts/protorevPool3.json b/tests/e2e/scripts/protorevPool3.json index 8f5a7687a40..39f30e52ed7 100644 --- a/tests/e2e/scripts/protorevPool3.json +++ b/tests/e2e/scripts/protorevPool3.json @@ -2,6 +2,5 @@ "weights": "1ibc/0EF15DF2F02480ADE0BB6E85D9EBB5DAEA2836D3860E9F97F9AADE4F57A31AA0,1uosmo", "initial-deposit": "165624820984787ibc/0EF15DF2F02480ADE0BB6E85D9EBB5DAEA2836D3860E9F97F9AADE4F57A31AA0,13901565323uosmo", "swap-fee": "0.002", - "exit-fee": "0.0", "future-governor": "" } \ No newline at end of file diff --git a/tests/ibc-hooks/test_crosschain_swaps.sh b/tests/ibc-hooks/test_crosschain_swaps.sh index ea1e973396f..5f6f051d347 100644 --- a/tests/ibc-hooks/test_crosschain_swaps.sh +++ b/tests/ibc-hooks/test_crosschain_swaps.sh @@ -38,7 +38,6 @@ cat >sample_pool.json < Date: Tue, 28 Feb 2023 16:09:09 +0700 Subject: [PATCH 03/26] fix proto --- .../pool-models/balancer/balancerPool.proto | 2 +- .../pool-models/balancer/balancerPool.pb.go | 50 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto b/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto index 3204e3fc376..ac224c70da0 100644 --- a/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto +++ b/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto @@ -79,7 +79,7 @@ message PoolParams { (gogoproto.moretags) = "yaml:\"swap_fee\"", (gogoproto.nullable) = false ]; - SmoothWeightChangeParams smooth_weight_change_params = 3 [ + SmoothWeightChangeParams smooth_weight_change_params = 2 [ (gogoproto.moretags) = "yaml:\"smooth_weight_change_params\"", (gogoproto.nullable) = true ]; diff --git a/x/gamm/pool-models/balancer/balancerPool.pb.go b/x/gamm/pool-models/balancer/balancerPool.pb.go index c4f9c1036a6..c59e9b0d693 100644 --- a/x/gamm/pool-models/balancer/balancerPool.pb.go +++ b/x/gamm/pool-models/balancer/balancerPool.pb.go @@ -135,7 +135,7 @@ func (m *SmoothWeightChangeParams) GetTargetPoolWeights() []PoolAsset { // The pool's token holders are specified in future_pool_governor. type PoolParams struct { SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee" yaml:"swap_fee"` - SmoothWeightChangeParams *SmoothWeightChangeParams `protobuf:"bytes,3,opt,name=smooth_weight_change_params,json=smoothWeightChangeParams,proto3" json:"smooth_weight_change_params,omitempty" yaml:"smooth_weight_change_params"` + SmoothWeightChangeParams *SmoothWeightChangeParams `protobuf:"bytes,2,opt,name=smooth_weight_change_params,json=smoothWeightChangeParams,proto3" json:"smooth_weight_change_params,omitempty" yaml:"smooth_weight_change_params"` } func (m *PoolParams) Reset() { *m = PoolParams{} } @@ -327,28 +327,28 @@ var fileDescriptor_7e991f749f68c2a4 = []byte{ 0x1f, 0x11, 0xb5, 0xbd, 0x86, 0xfb, 0x56, 0xe0, 0xfe, 0x59, 0x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97, 0x9f, 0xe1, + 0xcf, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x88, 0xa3, 0x31, 0xfa, 0x1e, 0x07, 0x00, 0x00, } func (m *SmoothWeightChangeParams) Marshal() (dAtA []byte, err error) { @@ -448,7 +448,7 @@ func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBalancerPool(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } { size := m.SwapFee.Size() @@ -941,7 +941,7 @@ func (m *PoolParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SmoothWeightChangeParams", wireType) } From 7e8f7c0e0d4412d18a6858c4585654dcc5c31182 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Tue, 28 Feb 2023 16:41:00 +0700 Subject: [PATCH 04/26] create old proto for upgrade --- x/gamm/v2types/balancerPool.pb.go | 1516 ++++++++++++++++++++++++++ x/gamm/v2types/stableswap_pool.pb.go | 940 ++++++++++++++++ 2 files changed, 2456 insertions(+) create mode 100644 x/gamm/v2types/balancerPool.pb.go create mode 100644 x/gamm/v2types/stableswap_pool.pb.go diff --git a/x/gamm/v2types/balancerPool.pb.go b/x/gamm/v2types/balancerPool.pb.go new file mode 100644 index 00000000000..56bab4af76e --- /dev/null +++ b/x/gamm/v2types/balancerPool.pb.go @@ -0,0 +1,1516 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: osmosis/gamm/pool-models/balancer/balancerPool.proto + +// this is a legacy package that requires additional migration logic +// in order to use the correct packge. Decision made to use legacy package path +// until clear steps for migration logic and the unknowns for state breaking are +// investigated for changing proto package. + +package balancer + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/x/auth/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Parameters for changing the weights in a balancer pool smoothly from +// a start weight and end weight over a period of time. +// Currently, the only smooth change supported is linear changing between +// the two weights, but more types may be added in the future. +// When these parameters are set, the weight w(t) for pool time `t` is the +// following: +// +// t <= start_time: w(t) = initial_pool_weights +// start_time < t <= start_time + duration: +// w(t) = initial_pool_weights + (t - start_time) * +// (target_pool_weights - initial_pool_weights) / (duration) +// t > start_time + duration: w(t) = target_pool_weights +type SmoothWeightChangeParams struct { + // The start time for beginning the weight change. + // If a parameter change / pool instantiation leaves this blank, + // it should be generated by the state_machine as the current time. + StartTime time.Time `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` + // Duration for the weights to change over + Duration time.Duration `protobuf:"bytes,2,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` + // The initial pool weights. These are copied from the pool's settings + // at the time of weight change instantiation. + // The amount PoolAsset.token.amount field is ignored if present, + // future type refactorings should just have a type with the denom & weight + // here. + InitialPoolWeights []PoolAsset `protobuf:"bytes,3,rep,name=initial_pool_weights,json=initialPoolWeights,proto3" json:"initial_pool_weights" yaml:"initial_pool_weights"` + // The target pool weights. The pool weights will change linearly with respect + // to time between start_time, and start_time + duration. The amount + // PoolAsset.token.amount field is ignored if present, future type + // refactorings should just have a type with the denom & weight here. + TargetPoolWeights []PoolAsset `protobuf:"bytes,4,rep,name=target_pool_weights,json=targetPoolWeights,proto3" json:"target_pool_weights" yaml:"target_pool_weights"` +} + +func (m *SmoothWeightChangeParams) Reset() { *m = SmoothWeightChangeParams{} } +func (m *SmoothWeightChangeParams) String() string { return proto.CompactTextString(m) } +func (*SmoothWeightChangeParams) ProtoMessage() {} +func (*SmoothWeightChangeParams) Descriptor() ([]byte, []int) { + return fileDescriptor_7e991f749f68c2a4, []int{0} +} +func (m *SmoothWeightChangeParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SmoothWeightChangeParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SmoothWeightChangeParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SmoothWeightChangeParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_SmoothWeightChangeParams.Merge(m, src) +} +func (m *SmoothWeightChangeParams) XXX_Size() int { + return m.Size() +} +func (m *SmoothWeightChangeParams) XXX_DiscardUnknown() { + xxx_messageInfo_SmoothWeightChangeParams.DiscardUnknown(m) +} + +var xxx_messageInfo_SmoothWeightChangeParams proto.InternalMessageInfo + +func (m *SmoothWeightChangeParams) GetStartTime() time.Time { + if m != nil { + return m.StartTime + } + return time.Time{} +} + +func (m *SmoothWeightChangeParams) GetDuration() time.Duration { + if m != nil { + return m.Duration + } + return 0 +} + +func (m *SmoothWeightChangeParams) GetInitialPoolWeights() []PoolAsset { + if m != nil { + return m.InitialPoolWeights + } + return nil +} + +func (m *SmoothWeightChangeParams) GetTargetPoolWeights() []PoolAsset { + if m != nil { + return m.TargetPoolWeights + } + return nil +} + +// PoolParams defined the parameters that will be managed by the pool +// governance in the future. This params are not managed by the chain +// governance. Instead they will be managed by the token holders of the pool. +// The pool's token holders are specified in future_pool_governor. +type PoolParams struct { + SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee" yaml:"swap_fee"` + ExitFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exit_fee,json=exitFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exit_fee" yaml:"exit_fee"` + SmoothWeightChangeParams *SmoothWeightChangeParams `protobuf:"bytes,3,opt,name=smooth_weight_change_params,json=smoothWeightChangeParams,proto3" json:"smooth_weight_change_params,omitempty" yaml:"smooth_weight_change_params"` +} + +func (m *PoolParams) Reset() { *m = PoolParams{} } +func (m *PoolParams) String() string { return proto.CompactTextString(m) } +func (*PoolParams) ProtoMessage() {} +func (*PoolParams) Descriptor() ([]byte, []int) { + return fileDescriptor_7e991f749f68c2a4, []int{1} +} +func (m *PoolParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PoolParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PoolParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PoolParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_PoolParams.Merge(m, src) +} +func (m *PoolParams) XXX_Size() int { + return m.Size() +} +func (m *PoolParams) XXX_DiscardUnknown() { + xxx_messageInfo_PoolParams.DiscardUnknown(m) +} + +var xxx_messageInfo_PoolParams proto.InternalMessageInfo + +func (m *PoolParams) GetSmoothWeightChangeParams() *SmoothWeightChangeParams { + if m != nil { + return m.SmoothWeightChangeParams + } + return nil +} + +// Pool asset is an internal struct that combines the amount of the +// token in the pool, and its balancer weight. +// This is an awkward packaging of data, +// and should be revisited in a future state migration. +type PoolAsset struct { + // Coins we are talking about, + // the denomination must be unique amongst all PoolAssets for this pool. + Token types1.Coin `protobuf:"bytes,1,opt,name=token,proto3" json:"token" yaml:"token"` + // Weight that is not normalized. This weight must be less than 2^50 + Weight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"weight" yaml:"weight"` +} + +func (m *PoolAsset) Reset() { *m = PoolAsset{} } +func (m *PoolAsset) String() string { return proto.CompactTextString(m) } +func (*PoolAsset) ProtoMessage() {} +func (*PoolAsset) Descriptor() ([]byte, []int) { + return fileDescriptor_7e991f749f68c2a4, []int{2} +} +func (m *PoolAsset) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PoolAsset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PoolAsset.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PoolAsset) XXX_Merge(src proto.Message) { + xxx_messageInfo_PoolAsset.Merge(m, src) +} +func (m *PoolAsset) XXX_Size() int { + return m.Size() +} +func (m *PoolAsset) XXX_DiscardUnknown() { + xxx_messageInfo_PoolAsset.DiscardUnknown(m) +} + +var xxx_messageInfo_PoolAsset proto.InternalMessageInfo + +func (m *PoolAsset) GetToken() types1.Coin { + if m != nil { + return m.Token + } + return types1.Coin{} +} + +type Pool struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + PoolParams PoolParams `protobuf:"bytes,3,opt,name=pool_params,json=poolParams,proto3" json:"pool_params" yaml:"balancer_pool_params"` + // This string specifies who will govern the pool in the future. + // Valid forms of this are: + // {token name},{duration} + // {duration} + // where {token name} if specified is the token which determines the + // governor, and if not specified is the LP token for this pool.duration is + // a time specified as 0w,1w,2w, etc. which specifies how long the token + // would need to be locked up to count in governance. 0w means no lockup. + // TODO: Further improve these docs + FuturePoolGovernor string `protobuf:"bytes,4,opt,name=future_pool_governor,json=futurePoolGovernor,proto3" json:"future_pool_governor,omitempty" yaml:"future_pool_governor"` + // sum of all LP tokens sent out + TotalShares types1.Coin `protobuf:"bytes,5,opt,name=total_shares,json=totalShares,proto3" json:"total_shares" yaml:"total_shares"` + // These are assumed to be sorted by denomiation. + // They contain the pool asset and the information about the weight + PoolAssets []PoolAsset `protobuf:"bytes,6,rep,name=pool_assets,json=poolAssets,proto3" json:"pool_assets" yaml:"pool_assets"` + // sum of all non-normalized pool weights + TotalWeight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=total_weight,json=totalWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_weight" yaml:"total_weight"` +} + +func (m *Pool) Reset() { *m = Pool{} } +func (*Pool) ProtoMessage() {} +func (*Pool) Descriptor() ([]byte, []int) { + return fileDescriptor_7e991f749f68c2a4, []int{3} +} +func (m *Pool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Pool.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Pool) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pool.Merge(m, src) +} +func (m *Pool) XXX_Size() int { + return m.Size() +} +func (m *Pool) XXX_DiscardUnknown() { + xxx_messageInfo_Pool.DiscardUnknown(m) +} + +var xxx_messageInfo_Pool proto.InternalMessageInfo + +func init() { + proto.RegisterType((*SmoothWeightChangeParams)(nil), "osmosis.gamm.v1beta1.SmoothWeightChangeParams") + proto.RegisterType((*PoolParams)(nil), "osmosis.gamm.v1beta1.PoolParams") + proto.RegisterType((*PoolAsset)(nil), "osmosis.gamm.v1beta1.PoolAsset") + proto.RegisterType((*Pool)(nil), "osmosis.gamm.v1beta1.Pool") +} + +func init() { + proto.RegisterFile("osmosis/gamm/pool-models/balancer/balancerPool.proto", fileDescriptor_7e991f749f68c2a4) +} + +var fileDescriptor_7e991f749f68c2a4 = []byte{ + // 831 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0x8f, 0x93, 0xb4, 0xd9, 0x4e, 0x96, 0x45, 0x9d, 0xcd, 0xc1, 0x4d, 0x45, 0x5c, 0x0d, 0x12, + 0x5a, 0xa1, 0x8d, 0xad, 0x2c, 0x70, 0xd9, 0xcb, 0x6a, 0xd3, 0x16, 0xd4, 0x5b, 0x71, 0x91, 0x4a, + 0x51, 0x25, 0x6b, 0x92, 0x4c, 0x6c, 0xab, 0xb6, 0xc7, 0xf2, 0x4c, 0xd2, 0xf6, 0x1b, 0x70, 0xec, + 0xb1, 0xdc, 0x7a, 0xe7, 0x0a, 0xdf, 0xa1, 0x82, 0x4b, 0x8f, 0x88, 0x83, 0x41, 0x2d, 0x27, 0x8e, + 0xf9, 0x04, 0x68, 0xfe, 0x38, 0x49, 0x4b, 0x22, 0x5a, 0x71, 0xca, 0xbc, 0x37, 0xef, 0xfd, 0xde, + 0xef, 0xbd, 0xf7, 0x1b, 0x07, 0x7c, 0x4e, 0x59, 0x4c, 0x59, 0xc8, 0x1c, 0x1f, 0xc7, 0xb1, 0x93, + 0x52, 0x1a, 0xb5, 0x63, 0x3a, 0x20, 0x11, 0x73, 0x7a, 0x38, 0xc2, 0x49, 0x9f, 0x64, 0xd3, 0xc3, + 0x3e, 0xa5, 0x91, 0x9d, 0x66, 0x94, 0x53, 0xd8, 0xd0, 0x59, 0xb6, 0xc8, 0xb2, 0xc7, 0x9d, 0x1e, + 0xe1, 0xb8, 0xd3, 0xdc, 0xe8, 0x4b, 0xb7, 0x27, 0x63, 0x1c, 0x65, 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0x38, 0xf2, 0xc4, 0x6e, 0xbd, 0x53, 0xd9, 0x26, 0x33, 0x2b, 0x5b, 0x95, 0x57, 0xf5, 0x37, 0x96, + 0xbd, 0x68, 0x8f, 0xb6, 0x58, 0xf4, 0x7b, 0xc6, 0x08, 0xef, 0x7e, 0xac, 0x5b, 0xda, 0x54, 0x55, + 0x16, 0x41, 0x21, 0x17, 0x6a, 0xb7, 0x48, 0x53, 0x63, 0x64, 0x90, 0x81, 0x97, 0x1c, 0x67, 0x3e, + 0xe1, 0xf7, 0xcb, 0x56, 0x1f, 0x57, 0x16, 0xe9, 0xb2, 0x4d, 0x55, 0x76, 0x01, 0x12, 0x72, 0xd7, + 0x95, 0x77, 0xae, 0x28, 0xfa, 0xab, 0x0c, 0x80, 0xb0, 0xf5, 0xfe, 0x8e, 0xc1, 0x33, 0x76, 0x8a, + 0x53, 0x6f, 0x48, 0xd4, 0xf6, 0xd6, 0xba, 0xef, 0x05, 0xee, 0xef, 0xb9, 0xf5, 0x89, 0x1f, 0xf2, + 0x60, 0xd4, 0xb3, 0xfb, 0x34, 0xd6, 0x32, 0xd5, 0x3f, 0x6d, 0x36, 0x38, 0x71, 0xf8, 0x79, 0x4a, + 0x98, 0xbd, 0x43, 0xfa, 0xb3, 0xf1, 0x16, 0x38, 0xc8, 0xad, 0x89, 0xe3, 0x97, 0x84, 0x08, 0x74, + 0x72, 0x16, 0x72, 0x89, 0x5e, 0xfe, 0x7f, 0xe8, 0x05, 0x0e, 0x72, 0x6b, 0xe2, 0x28, 0xd0, 0x7f, + 0x30, 0xc0, 0x26, 0x93, 0xc2, 0xd4, 0x1d, 0x7b, 0x7d, 0x29, 0x4d, 0x2f, 0x95, 0xbd, 0x99, 0x15, + 0xa9, 0x1a, 0x7b, 0xf1, 0x20, 0x97, 0x29, 0xba, 0xfb, 0xe9, 0x75, 0x6e, 0x19, 0x93, 0xdc, 0x42, + 0xba, 0xab, 0xe5, 0x05, 0x90, 0x6b, 0xb2, 0x25, 0x28, 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0xf3, 0x40, 0x5a, 0xf0, 0x58, 0x4f, 0x05, 0x0b, 0x29, 0x30, 0x73, 0xf5, 0x71, 0xcf, 0xbb, 0xa9, + 0xf1, 0xa1, 0xc2, 0x9f, 0x43, 0xd0, 0xb3, 0x90, 0x61, 0x0c, 0x06, 0x05, 0x71, 0xad, 0x8c, 0x9a, + 0x9c, 0xc1, 0xee, 0x93, 0x95, 0x71, 0xaf, 0x8f, 0x42, 0x1f, 0xaa, 0x0f, 0x25, 0xef, 0xb7, 0xeb, + 0xdf, 0x5f, 0x59, 0xa5, 0xcb, 0x2b, 0xab, 0xf4, 0xcb, 0x4f, 0xed, 0x15, 0x41, 0x74, 0xaf, 0x7b, + 0x74, 0x7d, 0xdb, 0x32, 0x6e, 0x6e, 0x5b, 0xc6, 0x9f, 0xb7, 0x2d, 0xe3, 0xe2, 0xae, 0x55, 0xba, + 0xb9, 0x6b, 0x95, 0x7e, 0xbb, 0x6b, 0x95, 0xbe, 0x7b, 0x37, 0x57, 0x58, 0x77, 0xda, 0x8e, 0x70, + 0x8f, 0x15, 0x86, 0x33, 0xee, 0x7c, 0xe1, 0x9c, 0x2d, 0xff, 0x43, 0xed, 0xad, 0xca, 0x8f, 0xfc, + 0x67, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xc4, 0xe9, 0x0d, 0x7c, 0x07, 0x00, 0x00, +} + +func (m *SmoothWeightChangeParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SmoothWeightChangeParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SmoothWeightChangeParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TargetPoolWeights) > 0 { + for iNdEx := len(m.TargetPoolWeights) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TargetPoolWeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.InitialPoolWeights) > 0 { + for iNdEx := len(m.InitialPoolWeights) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InitialPoolWeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintBalancerPool(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x12 + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintBalancerPool(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PoolParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PoolParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SmoothWeightChangeParams != nil { + { + size, err := m.SmoothWeightChangeParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + { + size := m.ExitFee.Size() + i -= size + if _, err := m.ExitFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.SwapFee.Size() + i -= size + if _, err := m.SwapFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PoolAsset) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PoolAsset) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PoolAsset) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Weight.Size() + i -= size + if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Pool) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Pool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.TotalWeight.Size() + i -= size + if _, err := m.TotalWeight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.PoolAssets) > 0 { + for iNdEx := len(m.PoolAssets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PoolAssets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + { + size, err := m.TotalShares.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.FuturePoolGovernor) > 0 { + i -= len(m.FuturePoolGovernor) + copy(dAtA[i:], m.FuturePoolGovernor) + i = encodeVarintBalancerPool(dAtA, i, uint64(len(m.FuturePoolGovernor))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.PoolParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Id != 0 { + i = encodeVarintBalancerPool(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintBalancerPool(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintBalancerPool(dAtA []byte, offset int, v uint64) int { + offset -= sovBalancerPool(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SmoothWeightChangeParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovBalancerPool(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration) + n += 1 + l + sovBalancerPool(uint64(l)) + if len(m.InitialPoolWeights) > 0 { + for _, e := range m.InitialPoolWeights { + l = e.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + } + } + if len(m.TargetPoolWeights) > 0 { + for _, e := range m.TargetPoolWeights { + l = e.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + } + } + return n +} + +func (m *PoolParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.SwapFee.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + l = m.ExitFee.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + if m.SmoothWeightChangeParams != nil { + l = m.SmoothWeightChangeParams.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + } + return n +} + +func (m *PoolAsset) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Token.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + l = m.Weight.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + return n +} + +func (m *Pool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovBalancerPool(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovBalancerPool(uint64(m.Id)) + } + l = m.PoolParams.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + l = len(m.FuturePoolGovernor) + if l > 0 { + n += 1 + l + sovBalancerPool(uint64(l)) + } + l = m.TotalShares.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + if len(m.PoolAssets) > 0 { + for _, e := range m.PoolAssets { + l = e.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + } + } + l = m.TotalWeight.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + return n +} + +func sovBalancerPool(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBalancerPool(x uint64) (n int) { + return sovBalancerPool(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SmoothWeightChangeParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SmoothWeightChangeParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SmoothWeightChangeParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialPoolWeights", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InitialPoolWeights = append(m.InitialPoolWeights, PoolAsset{}) + if err := m.InitialPoolWeights[len(m.InitialPoolWeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetPoolWeights", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TargetPoolWeights = append(m.TargetPoolWeights, PoolAsset{}) + if err := m.TargetPoolWeights[len(m.TargetPoolWeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBalancerPool(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBalancerPool + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PoolParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PoolParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PoolParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SwapFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExitFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SmoothWeightChangeParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SmoothWeightChangeParams == nil { + m.SmoothWeightChangeParams = &SmoothWeightChangeParams{} + } + if err := m.SmoothWeightChangeParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBalancerPool(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBalancerPool + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PoolAsset) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PoolAsset: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PoolAsset: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBalancerPool(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBalancerPool + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Pool) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Pool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Pool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PoolParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FuturePoolGovernor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FuturePoolGovernor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalShares", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolAssets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PoolAssets = append(m.PoolAssets, PoolAsset{}) + if err := m.PoolAssets[len(m.PoolAssets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalWeight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBalancerPool(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBalancerPool + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBalancerPool(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthBalancerPool + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBalancerPool + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBalancerPool + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBalancerPool = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBalancerPool = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBalancerPool = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/gamm/v2types/stableswap_pool.pb.go b/x/gamm/v2types/stableswap_pool.pb.go new file mode 100644 index 00000000000..388a59b0bba --- /dev/null +++ b/x/gamm/v2types/stableswap_pool.pb.go @@ -0,0 +1,940 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: osmosis/gamm/pool-models/stableswap/stableswap_pool.proto + +package stableswap + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/x/auth/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// PoolParams defined the parameters that will be managed by the pool +// governance in the future. This params are not managed by the chain +// governance. Instead they will be managed by the token holders of the pool. +// The pool's token holders are specified in future_pool_governor. +type PoolParams struct { + SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee" yaml:"swap_fee"` + ExitFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exit_fee,json=exitFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exit_fee" yaml:"exit_fee"` +} + +func (m *PoolParams) Reset() { *m = PoolParams{} } +func (m *PoolParams) String() string { return proto.CompactTextString(m) } +func (*PoolParams) ProtoMessage() {} +func (*PoolParams) Descriptor() ([]byte, []int) { + return fileDescriptor_ae0f054436f9999a, []int{0} +} +func (m *PoolParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PoolParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PoolParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PoolParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_PoolParams.Merge(m, src) +} +func (m *PoolParams) XXX_Size() int { + return m.Size() +} +func (m *PoolParams) XXX_DiscardUnknown() { + xxx_messageInfo_PoolParams.DiscardUnknown(m) +} + +var xxx_messageInfo_PoolParams proto.InternalMessageInfo + +// Pool is the stableswap Pool struct +type Pool struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + PoolParams PoolParams `protobuf:"bytes,3,opt,name=pool_params,json=poolParams,proto3" json:"pool_params" yaml:"stableswap_pool_params"` + // This string specifies who will govern the pool in the future. + // Valid forms of this are: + // {token name},{duration} + // {duration} + // where {token name} if specified is the token which determines the + // governor, and if not specified is the LP token for this pool.duration is + // a time specified as 0w,1w,2w, etc. which specifies how long the token + // would need to be locked up to count in governance. 0w means no lockup. + FuturePoolGovernor string `protobuf:"bytes,4,opt,name=future_pool_governor,json=futurePoolGovernor,proto3" json:"future_pool_governor,omitempty" yaml:"future_pool_governor"` + // sum of all LP shares + TotalShares types.Coin `protobuf:"bytes,5,opt,name=total_shares,json=totalShares,proto3" json:"total_shares" yaml:"total_shares"` + // assets in the pool + PoolLiquidity github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=pool_liquidity,json=poolLiquidity,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"pool_liquidity"` + // for calculation amognst assets with different precisions + ScalingFactors []uint64 `protobuf:"varint,7,rep,packed,name=scaling_factors,json=scalingFactors,proto3" json:"scaling_factors,omitempty" yaml:"stableswap_scaling_factors"` + // scaling_factor_controller is the address can adjust pool scaling factors + ScalingFactorController string `protobuf:"bytes,8,opt,name=scaling_factor_controller,json=scalingFactorController,proto3" json:"scaling_factor_controller,omitempty" yaml:"scaling_factor_controller"` +} + +func (m *Pool) Reset() { *m = Pool{} } +func (*Pool) ProtoMessage() {} +func (*Pool) Descriptor() ([]byte, []int) { + return fileDescriptor_ae0f054436f9999a, []int{1} +} +func (m *Pool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Pool.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Pool) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pool.Merge(m, src) +} +func (m *Pool) XXX_Size() int { + return m.Size() +} +func (m *Pool) XXX_DiscardUnknown() { + xxx_messageInfo_Pool.DiscardUnknown(m) +} + +var xxx_messageInfo_Pool proto.InternalMessageInfo + +func init() { + proto.RegisterType((*PoolParams)(nil), "osmosis.gamm.poolmodels.stableswap.v1beta1.PoolParams") + proto.RegisterType((*Pool)(nil), "osmosis.gamm.poolmodels.stableswap.v1beta1.Pool") +} + +func init() { + proto.RegisterFile("osmosis/gamm/pool-models/stableswap/stableswap_pool.proto", fileDescriptor_ae0f054436f9999a) +} + +var fileDescriptor_ae0f054436f9999a = []byte{ + // 642 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x8e, 0xdb, 0xb4, 0x29, 0x5b, 0x48, 0x85, 0xa9, 0x84, 0xdb, 0x0a, 0x6f, 0xb0, 0x28, 0x8a, + 0x10, 0xb1, 0x29, 0x08, 0x24, 0x7a, 0x6b, 0x8a, 0x8a, 0x90, 0x10, 0x2a, 0xe6, 0xc4, 0x8f, 0x14, + 0xd6, 0xf6, 0xc6, 0x5d, 0x61, 0x67, 0xcd, 0xee, 0xba, 0xb4, 0x17, 0xce, 0x1c, 0x39, 0x72, 0xec, + 0x19, 0xae, 0x3c, 0x44, 0xc5, 0xa9, 0x47, 0xc4, 0xc1, 0xa0, 0xf6, 0x0d, 0xf2, 0x04, 0x68, 0xd7, + 0xeb, 0xfe, 0x04, 0xa8, 0x2a, 0x71, 0xca, 0xce, 0xcc, 0x37, 0xdf, 0xcc, 0x37, 0x33, 0x31, 0xb8, + 0x4f, 0x79, 0x4a, 0x39, 0xe1, 0x5e, 0x8c, 0xd2, 0xd4, 0xcb, 0x28, 0x4d, 0x3a, 0x29, 0x8d, 0x70, + 0xc2, 0x3d, 0x2e, 0x50, 0x90, 0x60, 0xfe, 0x0e, 0x65, 0xc7, 0x9e, 0x3d, 0x89, 0x70, 0x33, 0x46, + 0x05, 0x35, 0x6f, 0xe8, 0x54, 0x57, 0xa6, 0xba, 0x32, 0x50, 0x66, 0xba, 0x47, 0x70, 0x77, 0x73, + 0x29, 0xc0, 0x02, 0x2d, 0xcd, 0xcf, 0x85, 0x0a, 0xdc, 0x53, 0x99, 0x5e, 0x69, 0x94, 0x34, 0xf3, + 0xb3, 0x31, 0x8d, 0x69, 0xe9, 0x97, 0x2f, 0xed, 0xb5, 0x63, 0x4a, 0xe3, 0x04, 0x7b, 0xca, 0x0a, + 0xf2, 0xbe, 0x17, 0xe5, 0x0c, 0x09, 0x42, 0x07, 0x3a, 0x0e, 0x47, 0xe3, 0x82, 0xa4, 0x98, 0x0b, + 0x94, 0x66, 0x15, 0x41, 0x59, 0xc4, 0x43, 0xb9, 0xd8, 0xf0, 0x74, 0x1b, 0xca, 0x18, 0x89, 0x07, + 0x88, 0xe3, 0xc3, 0x78, 0x48, 0x89, 0x2e, 0xe0, 0xec, 0x1a, 0x00, 0xac, 0x53, 0x9a, 0xac, 0x23, + 0x86, 0x52, 0x6e, 0xbe, 0x02, 0x53, 0x4a, 0x7f, 0x1f, 0x63, 0xcb, 0x68, 0x19, 0xed, 0x73, 0xdd, + 0x95, 0xdd, 0x02, 0xd6, 0x7e, 0x14, 0xf0, 0x7a, 0x4c, 0xc4, 0x46, 0x1e, 0xb8, 0x21, 0x4d, 0xb5, + 0x30, 0xfd, 0xd3, 0xe1, 0xd1, 0x1b, 0x4f, 0x6c, 0x67, 0x98, 0xbb, 0x0f, 0x70, 0x38, 0x2c, 0xe0, + 0xcc, 0x36, 0x4a, 0x93, 0x65, 0xa7, 0xe2,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48, 0xc8, + 0xdb, 0x9c, 0x44, 0x44, 0x6c, 0x5b, 0x93, 0xad, 0xf1, 0xd3, 0xc9, 0x6f, 0x49, 0xf2, 0xcf, 0x3f, + 0x61, 0xfb, 0x0c, 0x3b, 0x97, 0x09, 0xdc, 0xbf, 0x20, 0x4b, 0x3c, 0xae, 0x2a, 0x98, 0x4f, 0xc0, + 0x0c, 0x0f, 0x51, 0x42, 0x06, 0x71, 0xaf, 0x8f, 0x42, 0x41, 0x19, 0xb7, 0x1a, 0xad, 0xf1, 0x76, + 0xbd, 0xbb, 0x38, 0x2c, 0xe0, 0xd5, 0x3f, 0x26, 0x3d, 0x82, 0x75, 0xfc, 0xa6, 0xf6, 0xac, 0x95, + 0x0e, 0xf3, 0x35, 0x98, 0x3b, 0x89, 0xe9, 0x85, 0x74, 0x20, 0x18, 0x4d, 0x12, 0xcc, 0xac, 0x29, + 0x35, 0xf6, 0x6b, 0xc3, 0x02, 0xb6, 0x34, 0xf3, 0xbf, 0xa0, 0x8e, 0x7f, 0xf9, 0x04, 0xf1, 0xea, + 0x61, 0x64, 0xf9, 0xe2, 0x87, 0x1d, 0x58, 0xfb, 0xb4, 0x03, 0x6b, 0xdf, 0xbe, 0x76, 0x26, 0xe4, + 0x6a, 0x1e, 0x75, 0x5f, 0xee, 0xee, 0xdb, 0xc6, 0xde, 0xbe, 0x6d, 0xfc, 0xda, 0xb7, 0x8d, 0x8f, + 0x07, 0x76, 0x6d, 0xef, 0xc0, 0xae, 0x7d, 0x3f, 0xb0, 0x6b, 0x2f, 0x56, 0x8e, 0xcd, 0x45, 0x5f, + 0x5d, 0x27, 0x41, 0x01, 0xaf, 0x0c, 0x6f, 0x73, 0xe9, 0xae, 0xb7, 0x75, 0xda, 0x97, 0x2c, 0x98, + 0x54, 0x7f, 0xee, 0x3b, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x5c, 0xc8, 0x15, 0xc4, 0xf7, 0x04, + 0x00, 0x00, +} + +func (m *PoolParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PoolParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.ExitFee.Size() + i -= size + if _, err := m.ExitFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintStableswapPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.SwapFee.Size() + i -= size + if _, err := m.SwapFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintStableswapPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Pool) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Pool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ScalingFactorController) > 0 { + i -= len(m.ScalingFactorController) + copy(dAtA[i:], m.ScalingFactorController) + i = encodeVarintStableswapPool(dAtA, i, uint64(len(m.ScalingFactorController))) + i-- + dAtA[i] = 0x42 + } + if len(m.ScalingFactors) > 0 { + dAtA2 := make([]byte, len(m.ScalingFactors)*10) + var j1 int + for _, num := range m.ScalingFactors { + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintStableswapPool(dAtA, i, uint64(j1)) + i-- + dAtA[i] = 0x3a + } + if len(m.PoolLiquidity) > 0 { + for iNdEx := len(m.PoolLiquidity) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PoolLiquidity[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStableswapPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + { + size, err := m.TotalShares.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStableswapPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.FuturePoolGovernor) > 0 { + i -= len(m.FuturePoolGovernor) + copy(dAtA[i:], m.FuturePoolGovernor) + i = encodeVarintStableswapPool(dAtA, i, uint64(len(m.FuturePoolGovernor))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.PoolParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStableswapPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Id != 0 { + i = encodeVarintStableswapPool(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintStableswapPool(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintStableswapPool(dAtA []byte, offset int, v uint64) int { + offset -= sovStableswapPool(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PoolParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.SwapFee.Size() + n += 1 + l + sovStableswapPool(uint64(l)) + l = m.ExitFee.Size() + n += 1 + l + sovStableswapPool(uint64(l)) + return n +} + +func (m *Pool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovStableswapPool(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovStableswapPool(uint64(m.Id)) + } + l = m.PoolParams.Size() + n += 1 + l + sovStableswapPool(uint64(l)) + l = len(m.FuturePoolGovernor) + if l > 0 { + n += 1 + l + sovStableswapPool(uint64(l)) + } + l = m.TotalShares.Size() + n += 1 + l + sovStableswapPool(uint64(l)) + if len(m.PoolLiquidity) > 0 { + for _, e := range m.PoolLiquidity { + l = e.Size() + n += 1 + l + sovStableswapPool(uint64(l)) + } + } + if len(m.ScalingFactors) > 0 { + l = 0 + for _, e := range m.ScalingFactors { + l += sovStableswapPool(uint64(e)) + } + n += 1 + sovStableswapPool(uint64(l)) + l + } + l = len(m.ScalingFactorController) + if l > 0 { + n += 1 + l + sovStableswapPool(uint64(l)) + } + return n +} + +func sovStableswapPool(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozStableswapPool(x uint64) (n int) { + return sovStableswapPool(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PoolParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PoolParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PoolParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SwapFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExitFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStableswapPool(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStableswapPool + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Pool) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Pool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Pool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PoolParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FuturePoolGovernor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FuturePoolGovernor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalShares", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolLiquidity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PoolLiquidity = append(m.PoolLiquidity, types.Coin{}) + if err := m.PoolLiquidity[len(m.PoolLiquidity)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ScalingFactors = append(m.ScalingFactors, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.ScalingFactors) == 0 { + m.ScalingFactors = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ScalingFactors = append(m.ScalingFactors, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field ScalingFactors", wireType) + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ScalingFactorController", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthStableswapPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStableswapPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ScalingFactorController = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStableswapPool(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStableswapPool + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStableswapPool(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStableswapPool + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthStableswapPool + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStableswapPool + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthStableswapPool + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthStableswapPool = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStableswapPool = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStableswapPool = fmt.Errorf("proto: unexpected end of group") +) From bc5de9877a7eed30185664154aedb2831f9c5dba Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:00:46 +0700 Subject: [PATCH 05/26] update proto for old types --- .../gamm/v2/balancer/balancerPool.proto | 83 + .../gamm/v2/stableswap/stableswap_pool.proto | 73 + x/gamm/v2types/balancer/balancerPool.pb.go | 908 ++++++++++ x/gamm/v2types/balancerPool.pb.go | 1516 ----------------- .../{ => stableswap}/stableswap_pool.pb.go | 102 +- 5 files changed, 1115 insertions(+), 1567 deletions(-) create mode 100644 proto/osmosis/gamm/v2/balancer/balancerPool.proto create mode 100644 proto/osmosis/gamm/v2/stableswap/stableswap_pool.proto create mode 100644 x/gamm/v2types/balancer/balancerPool.pb.go delete mode 100644 x/gamm/v2types/balancerPool.pb.go rename x/gamm/v2types/{ => stableswap}/stableswap_pool.pb.go (83%) diff --git a/proto/osmosis/gamm/v2/balancer/balancerPool.proto b/proto/osmosis/gamm/v2/balancer/balancerPool.proto new file mode 100644 index 00000000000..79ac98cd1c6 --- /dev/null +++ b/proto/osmosis/gamm/v2/balancer/balancerPool.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; +// this is a legacy package that requires additional migration logic +// in order to use the correct packge. Decision made to use legacy package path +// until clear steps for migration logic and the unknowns for state breaking are +// investigated for changing proto package. +package osmosis.gamm.v2.balancer; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "cosmos/auth/v1beta1/auth.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/gamm/pool-models/balancer/balancerPool.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer"; + +// PoolParams defined the parameters that will be managed by the pool +// governance in the future. This params are not managed by the chain +// governance. Instead they will be managed by the token holders of the pool. +// The pool's token holders are specified in future_pool_governor. +message PoolParams { + string swap_fee = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"swap_fee\"", + (gogoproto.nullable) = false + ]; + string exit_fee = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"exit_fee\"", + (gogoproto.nullable) = false + ]; + osmosis.gamm.v1beta1.SmoothWeightChangeParams smooth_weight_change_params = 3 + [ + (gogoproto.moretags) = "yaml:\"smooth_weight_change_params\"", + (gogoproto.nullable) = true + ]; +} + +message Pool { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "PoolI"; + + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + uint64 id = 2; + + PoolParams pool_params = 3 [ + (gogoproto.moretags) = "yaml:\"balancer_pool_params\"", + (gogoproto.nullable) = false + ]; + + // This string specifies who will govern the pool in the future. + // Valid forms of this are: + // {token name},{duration} + // {duration} + // where {token name} if specified is the token which determines the + // governor, and if not specified is the LP token for this pool.duration is + // a time specified as 0w,1w,2w, etc. which specifies how long the token + // would need to be locked up to count in governance. 0w means no lockup. + // TODO: Further improve these docs + string future_pool_governor = 4 + [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; + // sum of all LP tokens sent out + cosmos.base.v1beta1.Coin total_shares = 5 [ + (gogoproto.moretags) = "yaml:\"total_shares\"", + (gogoproto.nullable) = false + ]; + // These are assumed to be sorted by denomiation. + // They contain the pool asset and the information about the weight + repeated osmosis.gamm.v1beta1.PoolAsset pool_assets = 6 [ + (gogoproto.moretags) = "yaml:\"pool_assets\"", + (gogoproto.nullable) = false + ]; + // sum of all non-normalized pool weights + string total_weight = 7 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"total_weight\"", + (gogoproto.nullable) = false + ]; +} diff --git a/proto/osmosis/gamm/v2/stableswap/stableswap_pool.proto b/proto/osmosis/gamm/v2/stableswap/stableswap_pool.proto new file mode 100644 index 00000000000..a8787576829 --- /dev/null +++ b/proto/osmosis/gamm/v2/stableswap/stableswap_pool.proto @@ -0,0 +1,73 @@ +syntax = "proto3"; +package osmosis.gamm.v2.stableswap; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "cosmos/auth/v1beta1/auth.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap"; + +// PoolParams defined the parameters that will be managed by the pool +// governance in the future. This params are not managed by the chain +// governance. Instead they will be managed by the token holders of the pool. +// The pool's token holders are specified in future_pool_governor. +message PoolParams { + string swap_fee = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"swap_fee\"", + (gogoproto.nullable) = false + ]; + string exit_fee = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"exit_fee\"", + (gogoproto.nullable) = false + ]; +} + +// Pool is the stableswap Pool struct +message Pool { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "PoolI"; + + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + uint64 id = 2; + + PoolParams pool_params = 3 [ + (gogoproto.moretags) = "yaml:\"stableswap_pool_params\"", + (gogoproto.nullable) = false + ]; + + // This string specifies who will govern the pool in the future. + // Valid forms of this are: + // {token name},{duration} + // {duration} + // where {token name} if specified is the token which determines the + // governor, and if not specified is the LP token for this pool.duration is + // a time specified as 0w,1w,2w, etc. which specifies how long the token + // would need to be locked up to count in governance. 0w means no lockup. + string future_pool_governor = 4 + [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; + // sum of all LP shares + cosmos.base.v1beta1.Coin total_shares = 5 [ + (gogoproto.moretags) = "yaml:\"total_shares\"", + (gogoproto.nullable) = false + ]; + // assets in the pool + repeated cosmos.base.v1beta1.Coin pool_liquidity = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // for calculation amognst assets with different precisions + repeated uint64 scaling_factors = 7 + [ (gogoproto.moretags) = "yaml:\"stableswap_scaling_factors\"" ]; + // scaling_factor_controller is the address can adjust pool scaling factors + string scaling_factor_controller = 8 + [ (gogoproto.moretags) = "yaml:\"scaling_factor_controller\"" ]; +} diff --git a/x/gamm/v2types/balancer/balancerPool.pb.go b/x/gamm/v2types/balancer/balancerPool.pb.go new file mode 100644 index 00000000000..ff49b307a2d --- /dev/null +++ b/x/gamm/v2types/balancer/balancerPool.pb.go @@ -0,0 +1,908 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: osmosis/gamm/v2/balancer/balancerPool.proto + +// this is a legacy package that requires additional migration logic +// in order to use the correct packge. Decision made to use legacy package path +// until clear steps for migration logic and the unknowns for state breaking are +// investigated for changing proto package. + +package balancer + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/x/auth/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + balancer "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/balancer" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// PoolParams defined the parameters that will be managed by the pool +// governance in the future. This params are not managed by the chain +// governance. Instead they will be managed by the token holders of the pool. +// The pool's token holders are specified in future_pool_governor. +type PoolParams struct { + SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee" yaml:"swap_fee"` + ExitFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exit_fee,json=exitFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exit_fee" yaml:"exit_fee"` + SmoothWeightChangeParams *balancer.SmoothWeightChangeParams `protobuf:"bytes,3,opt,name=smooth_weight_change_params,json=smoothWeightChangeParams,proto3" json:"smooth_weight_change_params,omitempty" yaml:"smooth_weight_change_params"` +} + +func (m *PoolParams) Reset() { *m = PoolParams{} } +func (m *PoolParams) String() string { return proto.CompactTextString(m) } +func (*PoolParams) ProtoMessage() {} +func (*PoolParams) Descriptor() ([]byte, []int) { + return fileDescriptor_36e6bec4fd4d490e, []int{0} +} +func (m *PoolParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PoolParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PoolParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PoolParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_PoolParams.Merge(m, src) +} +func (m *PoolParams) XXX_Size() int { + return m.Size() +} +func (m *PoolParams) XXX_DiscardUnknown() { + xxx_messageInfo_PoolParams.DiscardUnknown(m) +} + +var xxx_messageInfo_PoolParams proto.InternalMessageInfo + +func (m *PoolParams) GetSmoothWeightChangeParams() *balancer.SmoothWeightChangeParams { + if m != nil { + return m.SmoothWeightChangeParams + } + return nil +} + +type Pool struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + PoolParams PoolParams `protobuf:"bytes,3,opt,name=pool_params,json=poolParams,proto3" json:"pool_params" yaml:"balancer_pool_params"` + // This string specifies who will govern the pool in the future. + // Valid forms of this are: + // {token name},{duration} + // {duration} + // where {token name} if specified is the token which determines the + // governor, and if not specified is the LP token for this pool.duration is + // a time specified as 0w,1w,2w, etc. which specifies how long the token + // would need to be locked up to count in governance. 0w means no lockup. + // TODO: Further improve these docs + FuturePoolGovernor string `protobuf:"bytes,4,opt,name=future_pool_governor,json=futurePoolGovernor,proto3" json:"future_pool_governor,omitempty" yaml:"future_pool_governor"` + // sum of all LP tokens sent out + TotalShares types.Coin `protobuf:"bytes,5,opt,name=total_shares,json=totalShares,proto3" json:"total_shares" yaml:"total_shares"` + // These are assumed to be sorted by denomiation. + // They contain the pool asset and the information about the weight + PoolAssets []balancer.PoolAsset `protobuf:"bytes,6,rep,name=pool_assets,json=poolAssets,proto3" json:"pool_assets" yaml:"pool_assets"` + // sum of all non-normalized pool weights + TotalWeight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=total_weight,json=totalWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_weight" yaml:"total_weight"` +} + +func (m *Pool) Reset() { *m = Pool{} } +func (m *Pool) String() string { return proto.CompactTextString(m) } +func (*Pool) ProtoMessage() {} +func (*Pool) Descriptor() ([]byte, []int) { + return fileDescriptor_36e6bec4fd4d490e, []int{1} +} +func (m *Pool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Pool.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Pool) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pool.Merge(m, src) +} +func (m *Pool) XXX_Size() int { + return m.Size() +} +func (m *Pool) XXX_DiscardUnknown() { + xxx_messageInfo_Pool.DiscardUnknown(m) +} + +var xxx_messageInfo_Pool proto.InternalMessageInfo + +func init() { + proto.RegisterType((*PoolParams)(nil), "osmosis.gamm.v2.balancer.PoolParams") + proto.RegisterType((*Pool)(nil), "osmosis.gamm.v2.balancer.Pool") +} + +func init() { + proto.RegisterFile("osmosis/gamm/v2/balancer/balancerPool.proto", fileDescriptor_36e6bec4fd4d490e) +} + +var fileDescriptor_36e6bec4fd4d490e = []byte{ + // 652 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x8e, 0xd3, 0xb4, 0x81, 0x0d, 0x2a, 0xc2, 0xf4, 0xe0, 0xb6, 0x92, 0xb7, 0x32, 0x08, 0x55, + 0x40, 0xd6, 0x6a, 0x80, 0x4b, 0x39, 0x35, 0xe5, 0x47, 0xbd, 0x15, 0x57, 0x08, 0x81, 0x2a, 0x59, + 0xeb, 0x78, 0x6b, 0x1b, 0xec, 0xac, 0xe5, 0xdd, 0xa4, 0xed, 0x1b, 0x70, 0xe4, 0x08, 0xb7, 0x3e, + 0x04, 0x17,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5, 0x01, 0xab, 0x0c, 0x77, 0xb8, 0xf6, 0xc4, + 0x3d, 0xa8, 0x5e, 0x42, 0x59, 0xc8, 0xf8, 0x0d, 0x08, 0xe6, 0xe4, 0x03, 0xf0, 0xe8, 0x4f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xe7, 0x17, 0xb2, 0xa1, 0x31, 0x05, 0x00, 0x00, +} + +func (m *PoolParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PoolParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SmoothWeightChangeParams != nil { + { + size, err := m.SmoothWeightChangeParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + { + size := m.ExitFee.Size() + i -= size + if _, err := m.ExitFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.SwapFee.Size() + i -= size + if _, err := m.SwapFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Pool) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Pool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.TotalWeight.Size() + i -= size + if _, err := m.TotalWeight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.PoolAssets) > 0 { + for iNdEx := len(m.PoolAssets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PoolAssets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + { + size, err := m.TotalShares.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.FuturePoolGovernor) > 0 { + i -= len(m.FuturePoolGovernor) + copy(dAtA[i:], m.FuturePoolGovernor) + i = encodeVarintBalancerPool(dAtA, i, uint64(len(m.FuturePoolGovernor))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.PoolParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBalancerPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Id != 0 { + i = encodeVarintBalancerPool(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintBalancerPool(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintBalancerPool(dAtA []byte, offset int, v uint64) int { + offset -= sovBalancerPool(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PoolParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.SwapFee.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + l = m.ExitFee.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + if m.SmoothWeightChangeParams != nil { + l = m.SmoothWeightChangeParams.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + } + return n +} + +func (m *Pool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovBalancerPool(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovBalancerPool(uint64(m.Id)) + } + l = m.PoolParams.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + l = len(m.FuturePoolGovernor) + if l > 0 { + n += 1 + l + sovBalancerPool(uint64(l)) + } + l = m.TotalShares.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + if len(m.PoolAssets) > 0 { + for _, e := range m.PoolAssets { + l = e.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + } + } + l = m.TotalWeight.Size() + n += 1 + l + sovBalancerPool(uint64(l)) + return n +} + +func sovBalancerPool(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBalancerPool(x uint64) (n int) { + return sovBalancerPool(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PoolParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PoolParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PoolParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SwapFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExitFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SmoothWeightChangeParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SmoothWeightChangeParams == nil { + m.SmoothWeightChangeParams = &balancer.SmoothWeightChangeParams{} + } + if err := m.SmoothWeightChangeParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBalancerPool(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBalancerPool + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Pool) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Pool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Pool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PoolParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FuturePoolGovernor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FuturePoolGovernor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalShares", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolAssets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PoolAssets = append(m.PoolAssets, balancer.PoolAsset{}) + if err := m.PoolAssets[len(m.PoolAssets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalWeight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBalancerPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBalancerPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBalancerPool(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBalancerPool + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBalancerPool(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBalancerPool + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthBalancerPool + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBalancerPool + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBalancerPool + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBalancerPool = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBalancerPool = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBalancerPool = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/gamm/v2types/balancerPool.pb.go b/x/gamm/v2types/balancerPool.pb.go deleted file mode 100644 index 56bab4af76e..00000000000 --- a/x/gamm/v2types/balancerPool.pb.go +++ /dev/null @@ -1,1516 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/gamm/pool-models/balancer/balancerPool.proto - -// this is a legacy package that requires additional migration logic -// in order to use the correct packge. Decision made to use legacy package path -// until clear steps for migration logic and the unknowns for state breaking are -// investigated for changing proto package. - -package balancer - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types1 "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/x/auth/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Parameters for changing the weights in a balancer pool smoothly from -// a start weight and end weight over a period of time. -// Currently, the only smooth change supported is linear changing between -// the two weights, but more types may be added in the future. -// When these parameters are set, the weight w(t) for pool time `t` is the -// following: -// -// t <= start_time: w(t) = initial_pool_weights -// start_time < t <= start_time + duration: -// w(t) = initial_pool_weights + (t - start_time) * -// (target_pool_weights - initial_pool_weights) / (duration) -// t > start_time + duration: w(t) = target_pool_weights -type SmoothWeightChangeParams struct { - // The start time for beginning the weight change. - // If a parameter change / pool instantiation leaves this blank, - // it should be generated by the state_machine as the current time. - StartTime time.Time `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` - // Duration for the weights to change over - Duration time.Duration `protobuf:"bytes,2,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` - // The initial pool weights. These are copied from the pool's settings - // at the time of weight change instantiation. - // The amount PoolAsset.token.amount field is ignored if present, - // future type refactorings should just have a type with the denom & weight - // here. - InitialPoolWeights []PoolAsset `protobuf:"bytes,3,rep,name=initial_pool_weights,json=initialPoolWeights,proto3" json:"initial_pool_weights" yaml:"initial_pool_weights"` - // The target pool weights. The pool weights will change linearly with respect - // to time between start_time, and start_time + duration. The amount - // PoolAsset.token.amount field is ignored if present, future type - // refactorings should just have a type with the denom & weight here. - TargetPoolWeights []PoolAsset `protobuf:"bytes,4,rep,name=target_pool_weights,json=targetPoolWeights,proto3" json:"target_pool_weights" yaml:"target_pool_weights"` -} - -func (m *SmoothWeightChangeParams) Reset() { *m = SmoothWeightChangeParams{} } -func (m *SmoothWeightChangeParams) String() string { return proto.CompactTextString(m) } -func (*SmoothWeightChangeParams) ProtoMessage() {} -func (*SmoothWeightChangeParams) Descriptor() ([]byte, []int) { - return fileDescriptor_7e991f749f68c2a4, []int{0} -} -func (m *SmoothWeightChangeParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SmoothWeightChangeParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SmoothWeightChangeParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SmoothWeightChangeParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_SmoothWeightChangeParams.Merge(m, src) -} -func (m *SmoothWeightChangeParams) XXX_Size() int { - return m.Size() -} -func (m *SmoothWeightChangeParams) XXX_DiscardUnknown() { - xxx_messageInfo_SmoothWeightChangeParams.DiscardUnknown(m) -} - -var xxx_messageInfo_SmoothWeightChangeParams proto.InternalMessageInfo - -func (m *SmoothWeightChangeParams) GetStartTime() time.Time { - if m != nil { - return m.StartTime - } - return time.Time{} -} - -func (m *SmoothWeightChangeParams) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func (m *SmoothWeightChangeParams) GetInitialPoolWeights() []PoolAsset { - if m != nil { - return m.InitialPoolWeights - } - return nil -} - -func (m *SmoothWeightChangeParams) GetTargetPoolWeights() []PoolAsset { - if m != nil { - return m.TargetPoolWeights - } - return nil -} - -// PoolParams defined the parameters that will be managed by the pool -// governance in the future. This params are not managed by the chain -// governance. Instead they will be managed by the token holders of the pool. -// The pool's token holders are specified in future_pool_governor. -type PoolParams struct { - SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee" yaml:"swap_fee"` - ExitFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exit_fee,json=exitFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exit_fee" yaml:"exit_fee"` - SmoothWeightChangeParams *SmoothWeightChangeParams `protobuf:"bytes,3,opt,name=smooth_weight_change_params,json=smoothWeightChangeParams,proto3" json:"smooth_weight_change_params,omitempty" yaml:"smooth_weight_change_params"` -} - -func (m *PoolParams) Reset() { *m = PoolParams{} } -func (m *PoolParams) String() string { return proto.CompactTextString(m) } -func (*PoolParams) ProtoMessage() {} -func (*PoolParams) Descriptor() ([]byte, []int) { - return fileDescriptor_7e991f749f68c2a4, []int{1} -} -func (m *PoolParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PoolParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PoolParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PoolParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_PoolParams.Merge(m, src) -} -func (m *PoolParams) XXX_Size() int { - return m.Size() -} -func (m *PoolParams) XXX_DiscardUnknown() { - xxx_messageInfo_PoolParams.DiscardUnknown(m) -} - -var xxx_messageInfo_PoolParams proto.InternalMessageInfo - -func (m *PoolParams) GetSmoothWeightChangeParams() *SmoothWeightChangeParams { - if m != nil { - return m.SmoothWeightChangeParams - } - return nil -} - -// Pool asset is an internal struct that combines the amount of the -// token in the pool, and its balancer weight. -// This is an awkward packaging of data, -// and should be revisited in a future state migration. -type PoolAsset struct { - // Coins we are talking about, - // the denomination must be unique amongst all PoolAssets for this pool. - Token types1.Coin `protobuf:"bytes,1,opt,name=token,proto3" json:"token" yaml:"token"` - // Weight that is not normalized. This weight must be less than 2^50 - Weight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"weight" yaml:"weight"` -} - -func (m *PoolAsset) Reset() { *m = PoolAsset{} } -func (m *PoolAsset) String() string { return proto.CompactTextString(m) } -func (*PoolAsset) ProtoMessage() {} -func (*PoolAsset) Descriptor() ([]byte, []int) { - return fileDescriptor_7e991f749f68c2a4, []int{2} -} -func (m *PoolAsset) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PoolAsset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PoolAsset.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PoolAsset) XXX_Merge(src proto.Message) { - xxx_messageInfo_PoolAsset.Merge(m, src) -} -func (m *PoolAsset) XXX_Size() int { - return m.Size() -} -func (m *PoolAsset) XXX_DiscardUnknown() { - xxx_messageInfo_PoolAsset.DiscardUnknown(m) -} - -var xxx_messageInfo_PoolAsset proto.InternalMessageInfo - -func (m *PoolAsset) GetToken() types1.Coin { - if m != nil { - return m.Token - } - return types1.Coin{} -} - -type Pool struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` - Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - PoolParams PoolParams `protobuf:"bytes,3,opt,name=pool_params,json=poolParams,proto3" json:"pool_params" yaml:"balancer_pool_params"` - // This string specifies who will govern the pool in the future. - // Valid forms of this are: - // {token name},{duration} - // {duration} - // where {token name} if specified is the token which determines the - // governor, and if not specified is the LP token for this pool.duration is - // a time specified as 0w,1w,2w, etc. which specifies how long the token - // would need to be locked up to count in governance. 0w means no lockup. - // TODO: Further improve these docs - FuturePoolGovernor string `protobuf:"bytes,4,opt,name=future_pool_governor,json=futurePoolGovernor,proto3" json:"future_pool_governor,omitempty" yaml:"future_pool_governor"` - // sum of all LP tokens sent out - TotalShares types1.Coin `protobuf:"bytes,5,opt,name=total_shares,json=totalShares,proto3" json:"total_shares" yaml:"total_shares"` - // These are assumed to be sorted by denomiation. - // They contain the pool asset and the information about the weight - PoolAssets []PoolAsset `protobuf:"bytes,6,rep,name=pool_assets,json=poolAssets,proto3" json:"pool_assets" yaml:"pool_assets"` - // sum of all non-normalized pool weights - TotalWeight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=total_weight,json=totalWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_weight" yaml:"total_weight"` -} - -func (m *Pool) Reset() { *m = Pool{} } -func (*Pool) ProtoMessage() {} -func (*Pool) Descriptor() ([]byte, []int) { - return fileDescriptor_7e991f749f68c2a4, []int{3} -} -func (m *Pool) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Pool.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Pool) XXX_Merge(src proto.Message) { - xxx_messageInfo_Pool.Merge(m, src) -} -func (m *Pool) XXX_Size() int { - return m.Size() -} -func (m *Pool) XXX_DiscardUnknown() { - xxx_messageInfo_Pool.DiscardUnknown(m) -} - -var xxx_messageInfo_Pool proto.InternalMessageInfo - -func init() { - proto.RegisterType((*SmoothWeightChangeParams)(nil), "osmosis.gamm.v1beta1.SmoothWeightChangeParams") - proto.RegisterType((*PoolParams)(nil), "osmosis.gamm.v1beta1.PoolParams") - proto.RegisterType((*PoolAsset)(nil), "osmosis.gamm.v1beta1.PoolAsset") - proto.RegisterType((*Pool)(nil), "osmosis.gamm.v1beta1.Pool") -} - -func init() { - proto.RegisterFile("osmosis/gamm/pool-models/balancer/balancerPool.proto", fileDescriptor_7e991f749f68c2a4) -} - -var fileDescriptor_7e991f749f68c2a4 = []byte{ - // 831 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0x8f, 0x93, 0xb4, 0xd9, 0x4e, 0x96, 0x45, 0x9d, 0xcd, 0xc1, 0x4d, 0x45, 0x5c, 0x0d, 0x12, - 0x5a, 0xa1, 0x8d, 0xad, 0x2c, 0x70, 0xd9, 0xcb, 0x6a, 0xd3, 0x16, 0xd4, 0x5b, 0x71, 0x91, 0x4a, - 0x51, 0x25, 0x6b, 0x92, 0x4c, 0x6c, 0xab, 0xb6, 0xc7, 0xf2, 0x4c, 0xd2, 0xf6, 0x1b, 0x70, 0xec, - 0xb1, 0xdc, 0x7a, 0xe7, 0x0a, 0xdf, 0xa1, 0x82, 0x4b, 0x8f, 0x88, 0x83, 0x41, 0x2d, 0x27, 0x8e, - 0xf9, 0x04, 0x68, 0xfe, 0x38, 0x49, 0x4b, 0x22, 0x5a, 0x71, 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0xff, 0xff, 0x5d, 0xc4, 0xe9, 0x0d, 0x7c, 0x07, 0x00, 0x00, -} - -func (m *SmoothWeightChangeParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SmoothWeightChangeParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SmoothWeightChangeParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TargetPoolWeights) > 0 { - for iNdEx := len(m.TargetPoolWeights) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TargetPoolWeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.InitialPoolWeights) > 0 { - for iNdEx := len(m.InitialPoolWeights) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.InitialPoolWeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintBalancerPool(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x12 - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintBalancerPool(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *PoolParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PoolParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.SmoothWeightChangeParams != nil { - { - size, err := m.SmoothWeightChangeParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - { - size := m.ExitFee.Size() - i -= size - if _, err := m.ExitFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.SwapFee.Size() - i -= size - if _, err := m.SwapFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *PoolAsset) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PoolAsset) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PoolAsset) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Weight.Size() - i -= size - if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Pool) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Pool) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.TotalWeight.Size() - i -= size - if _, err := m.TotalWeight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - if len(m.PoolAssets) > 0 { - for iNdEx := len(m.PoolAssets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PoolAssets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - { - size, err := m.TotalShares.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.FuturePoolGovernor) > 0 { - i -= len(m.FuturePoolGovernor) - copy(dAtA[i:], m.FuturePoolGovernor) - i = encodeVarintBalancerPool(dAtA, i, uint64(len(m.FuturePoolGovernor))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.PoolParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.Id != 0 { - i = encodeVarintBalancerPool(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x10 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintBalancerPool(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintBalancerPool(dAtA []byte, offset int, v uint64) int { - offset -= sovBalancerPool(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *SmoothWeightChangeParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovBalancerPool(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovBalancerPool(uint64(l)) - if len(m.InitialPoolWeights) > 0 { - for _, e := range m.InitialPoolWeights { - l = e.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - } - } - if len(m.TargetPoolWeights) > 0 { - for _, e := range m.TargetPoolWeights { - l = e.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - } - } - return n -} - -func (m *PoolParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.SwapFee.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - l = m.ExitFee.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - if m.SmoothWeightChangeParams != nil { - l = m.SmoothWeightChangeParams.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - } - return n -} - -func (m *PoolAsset) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Token.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - l = m.Weight.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - return n -} - -func (m *Pool) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovBalancerPool(uint64(l)) - } - if m.Id != 0 { - n += 1 + sovBalancerPool(uint64(m.Id)) - } - l = m.PoolParams.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - l = len(m.FuturePoolGovernor) - if l > 0 { - n += 1 + l + sovBalancerPool(uint64(l)) - } - l = m.TotalShares.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - if len(m.PoolAssets) > 0 { - for _, e := range m.PoolAssets { - l = e.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - } - } - l = m.TotalWeight.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - return n -} - -func sovBalancerPool(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozBalancerPool(x uint64) (n int) { - return sovBalancerPool(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *SmoothWeightChangeParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SmoothWeightChangeParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SmoothWeightChangeParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialPoolWeights", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InitialPoolWeights = append(m.InitialPoolWeights, PoolAsset{}) - if err := m.InitialPoolWeights[len(m.InitialPoolWeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TargetPoolWeights", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TargetPoolWeights = append(m.TargetPoolWeights, PoolAsset{}) - if err := m.TargetPoolWeights[len(m.TargetPoolWeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBalancerPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBalancerPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PoolParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PoolParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PoolParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SwapFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SwapFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExitFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SmoothWeightChangeParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SmoothWeightChangeParams == nil { - m.SmoothWeightChangeParams = &SmoothWeightChangeParams{} - } - if err := m.SmoothWeightChangeParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBalancerPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBalancerPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PoolAsset) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PoolAsset: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PoolAsset: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBalancerPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBalancerPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Pool) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Pool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Pool: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PoolParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FuturePoolGovernor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FuturePoolGovernor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalShares", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TotalShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolAssets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PoolAssets = append(m.PoolAssets, PoolAsset{}) - if err := m.PoolAssets[len(m.PoolAssets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalWeight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TotalWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBalancerPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBalancerPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipBalancerPool(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthBalancerPool - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupBalancerPool - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthBalancerPool - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthBalancerPool = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBalancerPool = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupBalancerPool = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gamm/v2types/stableswap_pool.pb.go b/x/gamm/v2types/stableswap/stableswap_pool.pb.go similarity index 83% rename from x/gamm/v2types/stableswap_pool.pb.go rename to x/gamm/v2types/stableswap/stableswap_pool.pb.go index 388a59b0bba..c5949f10a73 100644 --- a/x/gamm/v2types/stableswap_pool.pb.go +++ b/x/gamm/v2types/stableswap/stableswap_pool.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/gamm/pool-models/stableswap/stableswap_pool.proto +// source: osmosis/gamm/v2/stableswap/stableswap_pool.proto package stableswap @@ -41,7 +41,7 @@ func (m *PoolParams) Reset() { *m = PoolParams{} } func (m *PoolParams) String() string { return proto.CompactTextString(m) } func (*PoolParams) ProtoMessage() {} func (*PoolParams) Descriptor() ([]byte, []int) { - return fileDescriptor_ae0f054436f9999a, []int{0} + return fileDescriptor_ce8f72b729f595f3, []int{0} } func (m *PoolParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -94,10 +94,11 @@ type Pool struct { ScalingFactorController string `protobuf:"bytes,8,opt,name=scaling_factor_controller,json=scalingFactorController,proto3" json:"scaling_factor_controller,omitempty" yaml:"scaling_factor_controller"` } -func (m *Pool) Reset() { *m = Pool{} } -func (*Pool) ProtoMessage() {} +func (m *Pool) Reset() { *m = Pool{} } +func (m *Pool) String() string { return proto.CompactTextString(m) } +func (*Pool) ProtoMessage() {} func (*Pool) Descriptor() ([]byte, []int) { - return fileDescriptor_ae0f054436f9999a, []int{1} + return fileDescriptor_ce8f72b729f595f3, []int{1} } func (m *Pool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -127,57 +128,56 @@ func (m *Pool) XXX_DiscardUnknown() { var xxx_messageInfo_Pool proto.InternalMessageInfo func init() { - proto.RegisterType((*PoolParams)(nil), "osmosis.gamm.poolmodels.stableswap.v1beta1.PoolParams") - proto.RegisterType((*Pool)(nil), "osmosis.gamm.poolmodels.stableswap.v1beta1.Pool") + proto.RegisterType((*PoolParams)(nil), "osmosis.gamm.v2.stableswap.PoolParams") + proto.RegisterType((*Pool)(nil), "osmosis.gamm.v2.stableswap.Pool") } func init() { - proto.RegisterFile("osmosis/gamm/pool-models/stableswap/stableswap_pool.proto", fileDescriptor_ae0f054436f9999a) + proto.RegisterFile("osmosis/gamm/v2/stableswap/stableswap_pool.proto", fileDescriptor_ce8f72b729f595f3) } -var fileDescriptor_ae0f054436f9999a = []byte{ - // 642 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x8e, 0xdb, 0xb4, 0x29, 0x5b, 0x48, 0x85, 0xa9, 0x84, 0xdb, 0x0a, 0x6f, 0xb0, 0x28, 0x8a, - 0x10, 0xb1, 0x29, 0x08, 0x24, 0x7a, 0x6b, 0x8a, 0x8a, 0x90, 0x10, 0x2a, 0xe6, 0xc4, 0x8f, 0x14, - 0xd6, 0xf6, 0xc6, 0x5d, 0x61, 0x67, 0xcd, 0xee, 0xba, 0xb4, 0x17, 0xce, 0x1c, 0x39, 0x72, 0xec, - 0x19, 0xae, 0x3c, 0x44, 0xc5, 0xa9, 0x47, 0xc4, 0xc1, 0xa0, 0xf6, 0x0d, 0xf2, 0x04, 0x68, 0xd7, - 0xeb, 0xfe, 0x04, 0xa8, 0x2a, 0x71, 0xca, 0xce, 0xcc, 0x37, 0xdf, 0xcc, 0x37, 0x33, 0x31, 0xb8, - 0x4f, 0x79, 0x4a, 0x39, 0xe1, 0x5e, 0x8c, 0xd2, 0xd4, 0xcb, 0x28, 0x4d, 0x3a, 0x29, 0x8d, 0x70, - 0xc2, 0x3d, 0x2e, 0x50, 0x90, 0x60, 0xfe, 0x0e, 0x65, 0xc7, 0x9e, 0x3d, 0x89, 0x70, 0x33, 0x46, - 0x05, 0x35, 0x6f, 0xe8, 0x54, 0x57, 0xa6, 0xba, 0x32, 0x50, 0x66, 0xba, 0x47, 0x70, 0x77, 0x73, - 0x29, 0xc0, 0x02, 0x2d, 0xcd, 0xcf, 0x85, 0x0a, 0xdc, 0x53, 0x99, 0x5e, 0x69, 0x94, 0x34, 0xf3, - 0xb3, 0x31, 0x8d, 0x69, 0xe9, 0x97, 0x2f, 0xed, 0xb5, 0x63, 0x4a, 0xe3, 0x04, 0x7b, 0xca, 0x0a, - 0xf2, 0xbe, 0x17, 0xe5, 0x0c, 0x09, 0x42, 0x07, 0x3a, 0x0e, 0x47, 0xe3, 0x82, 0xa4, 0x98, 0x0b, - 0x94, 0x66, 0x15, 0x41, 0x59, 0xc4, 0x43, 0xb9, 0xd8, 0xf0, 0x74, 0x1b, 0xca, 0x18, 0x89, 0x07, - 0x88, 0xe3, 0xc3, 0x78, 0x48, 0x89, 0x2e, 0xe0, 0xec, 0x1a, 0x00, 0xac, 0x53, 0x9a, 0xac, 0x23, - 0x86, 0x52, 0x6e, 0xbe, 0x02, 0x53, 0x4a, 0x7f, 0x1f, 0x63, 0xcb, 0x68, 0x19, 0xed, 0x73, 0xdd, - 0x95, 0xdd, 0x02, 0xd6, 0x7e, 0x14, 0xf0, 0x7a, 0x4c, 0xc4, 0x46, 0x1e, 0xb8, 0x21, 0x4d, 0xb5, - 0x30, 0xfd, 0xd3, 0xe1, 0xd1, 0x1b, 0x4f, 0x6c, 0x67, 0x98, 0xbb, 0x0f, 0x70, 0x38, 0x2c, 0xe0, - 0xcc, 0x36, 0x4a, 0x93, 0x65, 0xa7, 0xe2, 0x71, 0xfc, 0x86, 0x7c, 0xae, 0x61, 0x2c, 0xd9, 0xf1, - 0x16, 0x11, 0x8a, 0x7d, 0xec, 0xff, 0xd8, 0x2b, 0x1e, 0xc7, 0x6f, 0xc8, 0xe7, 0x1a, 0xc6, 0xce, - 0x97, 0x09, 0x50, 0x97, 0x52, 0xcc, 0x9b, 0xa0, 0x81, 0xa2, 0x88, 0x61, 0xce, 0xb5, 0x06, 0x73, - 0x58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8f, 0x42, 0x41, 0x19, 0xb7, 0x1a, 0xad, 0xf1, 0x76, - 0xbd, 0xbb, 0x38, 0x2c, 0xe0, 0xd5, 0x3f, 0x26, 0x3d, 0x82, 0x75, 0xfc, 0xa6, 0xf6, 0xac, 0x95, - 0x0e, 0xf3, 0x35, 0x98, 0x3b, 0x89, 0xe9, 0x85, 0x74, 0x20, 0x18, 0x4d, 0x12, 0xcc, 0xac, 0x29, - 0x35, 0xf6, 0x6b, 0xc3, 0x02, 0xb6, 0x34, 0xf3, 0xbf, 0xa0, 0x8e, 0x7f, 0xf9, 0x04, 0xf1, 0xea, - 0x61, 0x64, 0xf9, 0xe2, 0x87, 0x1d, 0x58, 0xfb, 0xb4, 0x03, 0x6b, 0xdf, 0xbe, 0x76, 0x26, 0xe4, - 0x6a, 0x1e, 0x75, 0x5f, 0xee, 0xee, 0xdb, 0xc6, 0xde, 0xbe, 0x6d, 0xfc, 0xda, 0xb7, 0x8d, 0x8f, - 0x07, 0x76, 0x6d, 0xef, 0xc0, 0xae, 0x7d, 0x3f, 0xb0, 0x6b, 0x2f, 0x56, 0x8e, 0xcd, 0x45, 0x5f, - 0x5d, 0x27, 0x41, 0x01, 0xaf, 0x0c, 0x6f, 0x73, 0xe9, 0xae, 0xb7, 0x75, 0xda, 0x97, 0x2c, 0x98, - 0x54, 0x7f, 0xee, 0x3b, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x5c, 0xc8, 0x15, 0xc4, 0xf7, 0x04, - 0x00, 0x00, +var fileDescriptor_ce8f72b729f595f3 = []byte{ + // 638 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x41, 0x4f, 0xd4, 0x40, + 0x14, 0xde, 0xc2, 0xc2, 0xe2, 0xa0, 0x4b, 0xac, 0x24, 0x16, 0x88, 0x9d, 0xb5, 0x11, 0xb2, 0x07, + 0x69, 0x01, 0xe3, 0x85,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0x36, 0x3e, 0x9c, 0xd8, 0xb5, 0xa3, 0x13, 0xbb, 0xf6, 0xed, + 0xc4, 0xae, 0xbd, 0xbc, 0x37, 0xa2, 0x8b, 0xbe, 0xb2, 0xd5, 0x04, 0x05, 0xbc, 0x32, 0xbc, 0xc1, + 0xfa, 0x5d, 0x6f, 0xaf, 0xfa, 0x40, 0x29, 0x9d, 0x46, 0x3e, 0x4d, 0xc1, 0xb4, 0xfa, 0x23, 0xdf, + 0xf9, 0x15, 0x00, 0x00, 0xff, 0xff, 0x7d, 0xe8, 0xa9, 0x27, 0xca, 0x04, 0x00, 0x00, } func (m *PoolParams) Marshal() (dAtA []byte, err error) { From 536f69af91dff2e8f95e45c45243ff92b18edfba Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:01:15 +0700 Subject: [PATCH 06/26] codec --- x/gamm/module.go | 6 ++++ x/gamm/v2types/balancer/codec.go | 50 ++++++++++++++++++++++++++++++ x/gamm/v2types/stableswap/codec.go | 50 ++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 x/gamm/v2types/balancer/codec.go create mode 100644 x/gamm/v2types/stableswap/codec.go diff --git a/x/gamm/module.go b/x/gamm/module.go index 4f12da8cad7..64b7a229f46 100644 --- a/x/gamm/module.go +++ b/x/gamm/module.go @@ -33,6 +33,8 @@ import ( simulation "github.com/osmosis-labs/osmosis/v15/x/gamm/simulation" "github.com/osmosis-labs/osmosis/v15/x/gamm/types" "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types" + oldbalancer "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer" + oldstableswap "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap" ) var ( @@ -52,6 +54,8 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { types.RegisterLegacyAminoCodec(cdc) balancer.RegisterLegacyAminoCodec(cdc) stableswap.RegisterLegacyAminoCodec(cdc) + oldbalancer.RegisterLegacyAminoCodec(cdc) + oldstableswap.RegisterLegacyAminoCodec(cdc) } // DefaultGenesis returns default genesis state as raw bytes for the gamm @@ -92,6 +96,8 @@ func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) types.RegisterInterfaces(registry) balancer.RegisterInterfaces(registry) stableswap.RegisterInterfaces(registry) + oldbalancer.RegisterInterfaces(registry) + oldstableswap.RegisterInterfaces(registry) } type AppModule struct { diff --git a/x/gamm/v2types/balancer/codec.go b/x/gamm/v2types/balancer/codec.go new file mode 100644 index 00000000000..0eab0c14f35 --- /dev/null +++ b/x/gamm/v2types/balancer/codec.go @@ -0,0 +1,50 @@ +package balancer + +import ( + types "github.com/osmosis-labs/osmosis/v15/x/gamm/types" + poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" + + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + proto "github.com/gogo/protobuf/proto" +) + +// RegisterLegacyAminoCodec registers the necessary x/gamm interfaces and concrete types +// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&Pool{}, "osmosis/gamm/v2/balancer/Pool", nil) +} + +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterInterface( + "osmosis.poolmanager.v1beta1.PoolI", + (*poolmanagertypes.PoolI)(nil), + &Pool{}, + ) + registry.RegisterInterface( + "osmosis.gamm.v1beta1.PoolI", // N.B.: the old proto-path is preserved for backwards-compatibility. + (*types.CFMMPoolI)(nil), + &Pool{}, + ) + registry.RegisterImplementations( + (*proto.Message)(nil), + &PoolParams{}, + ) +} + +var ( + amino = codec.NewLegacyAmino() + + // ModuleCdc references the global x/bank module codec. Note, the codec should + // ONLY be used in certain instances of tests and for JSON encoding as Amino is + // still used for that purpose. + // + // The actual codec used for serialization should be provided to x/staking and + // defined at the application level. + ModuleCdc = codec.NewAminoCodec(amino) +) + +func init() { + RegisterLegacyAminoCodec(amino) + amino.Seal() +} diff --git a/x/gamm/v2types/stableswap/codec.go b/x/gamm/v2types/stableswap/codec.go new file mode 100644 index 00000000000..c21ebe803a7 --- /dev/null +++ b/x/gamm/v2types/stableswap/codec.go @@ -0,0 +1,50 @@ +package stableswap + +import ( + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + types "github.com/osmosis-labs/osmosis/v15/x/gamm/types" + poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" +) + +// RegisterLegacyAminoCodec registers the necessary x/gamm interfaces and concrete types +// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&Pool{}, "osmosis/gamm/v2/stableswap/Pool", nil) +} + +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterInterface( + "osmosis.poolmanager.v1beta1.PoolI", + (*poolmanagertypes.PoolI)(nil), + &Pool{}, + ) + registry.RegisterInterface( + "osmosis.gamm.v1beta1.PoolI", // N.B.: the old proto-path is preserved for backwards-compatibility. + (*types.CFMMPoolI)(nil), + &Pool{}, + ) +} + +var ( + amino = codec.NewLegacyAmino() + + // ModuleCdc references the global x/bank module codec. Note, the codec should + // ONLY be used in certain instances of tests and for JSON encoding as Amino is + // still used for that purpose. + // + // The actual codec used for serialization should be provided to x/staking and + // defined at the application level. + ModuleCdc = codec.NewAminoCodec(amino) +) + +func init() { + RegisterLegacyAminoCodec(amino) + // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be + // used to properly serialize MsgGrant and MsgExec instances + sdk.RegisterLegacyAminoCodec(amino) + amino.Seal() +} + +const PoolTypeName string = "Stableswap" From f0c4d6a413d3b25436890af187c2b8ca73b263fb Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:01:47 +0700 Subject: [PATCH 07/26] implement poolI interface --- x/gamm/v2types/balancer/pool.go | 99 +++++++++++++++++++++++++++++++ x/gamm/v2types/stableswap/pool.go | 99 +++++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+) create mode 100644 x/gamm/v2types/balancer/pool.go create mode 100644 x/gamm/v2types/stableswap/pool.go diff --git a/x/gamm/v2types/balancer/pool.go b/x/gamm/v2types/balancer/pool.go new file mode 100644 index 00000000000..f8825f1cb57 --- /dev/null +++ b/x/gamm/v2types/balancer/pool.go @@ -0,0 +1,99 @@ +package balancer + +import ( + + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/v15/x/gamm/types" + poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" +) + +var ( + _ poolmanagertypes.PoolI = &Pool{} + _ types.CFMMPoolI = &Pool{} +) + + +// GetAddress returns the address of a pool. +// If the pool address is not bech32 valid, it returns an empty address. +func (p Pool) GetAddress() sdk.AccAddress { + return nil +} + +func (p Pool) GetId() uint64 { + return p.Id +} + +func (p Pool) GetSwapFee(_ sdk.Context) sdk.Dec { + return p.PoolParams.SwapFee +} + +func (p Pool) GetTotalPoolLiquidity(_ sdk.Context) sdk.Coins { + return sdk.Coins{} +} + +func (p Pool) GetTotalShares() sdk.Int { + return p.TotalShares.Amount +} + +func (p Pool) IsActive(ctx sdk.Context) bool { + return true +} + +func (p Pool) GetType() poolmanagertypes.PoolType { + return poolmanagertypes.Balancer +} + +func (p Pool) SpotPrice(ctx sdk.Context, quoteAsset, baseAsset string) (spotPrice sdk.Dec, err error) { + return sdk.ZeroDec(), nil +} + +func (p *Pool) CalcExitPoolCoinsFromShares(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitedCoins sdk.Coins, err error) { + return sdk.Coins{}, err +} + +func (p Pool) CalcInAmtGivenOut( + ctx sdk.Context, tokensOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) ( + tokenIn sdk.Coin, err error, +) { + return sdk.Coin{}, err +} + +func (p *Pool) CalcJoinPoolNoSwapShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, tokensJoined sdk.Coins, err error) { + return sdk.ZeroInt(), sdk.Coins{}, nil +} + +func (p *Pool) CalcJoinPoolShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, newLiquidity sdk.Coins, err error) { + return sdk.ZeroInt(), sdk.Coins{}, nil +} + +func (p Pool) CalcOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, swapFee sdk.Dec) (tokenOut sdk.Coin, err error) { + return sdk.Coin{}, nil +} + +func (p *Pool) ExitPool(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitingCoins sdk.Coins, err error) { + return sdk.Coins{}, err +} + +func (p *Pool) JoinPool(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (sdk.Int, error) { + return sdk.ZeroInt(), nil +} + +func (p *Pool) JoinPoolNoSwap(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (sdk.Int, error) { + return sdk.ZeroInt(), nil +} + +func (p *Pool) SwapInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) (tokenIn sdk.Coin, err error) { + return sdk.Coin{}, nil +} + +func (p *Pool) SwapOutAmtGivenIn( + ctx sdk.Context, + tokensIn sdk.Coins, + tokenOutDenom string, + swapFee sdk.Dec, +) ( + tokenOut sdk.Coin, err error, +) { + return sdk.Coin{}, nil +} \ No newline at end of file diff --git a/x/gamm/v2types/stableswap/pool.go b/x/gamm/v2types/stableswap/pool.go new file mode 100644 index 00000000000..6e3cf21cc7b --- /dev/null +++ b/x/gamm/v2types/stableswap/pool.go @@ -0,0 +1,99 @@ +package stableswap + +import ( + + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/v15/x/gamm/types" + poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" +) + +var ( + _ poolmanagertypes.PoolI = &Pool{} + _ types.CFMMPoolI = &Pool{} +) + + +// GetAddress returns the address of a pool. +// If the pool address is not bech32 valid, it returns an empty address. +func (p Pool) GetAddress() sdk.AccAddress { + return nil +} + +func (p Pool) GetId() uint64 { + return p.Id +} + +func (p Pool) GetSwapFee(_ sdk.Context) sdk.Dec { + return p.PoolParams.SwapFee +} + +func (p Pool) GetTotalPoolLiquidity(_ sdk.Context) sdk.Coins { + return sdk.Coins{} +} + +func (p Pool) GetTotalShares() sdk.Int { + return p.TotalShares.Amount +} + +func (p Pool) IsActive(ctx sdk.Context) bool { + return true +} + +func (p Pool) GetType() poolmanagertypes.PoolType { + return poolmanagertypes.Stableswap +} + +func (p Pool) SpotPrice(ctx sdk.Context, quoteAsset, baseAsset string) (spotPrice sdk.Dec, err error) { + return sdk.ZeroDec(), nil +} + +func (p *Pool) CalcExitPoolCoinsFromShares(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitedCoins sdk.Coins, err error) { + return sdk.Coins{}, err +} + +func (p Pool) CalcInAmtGivenOut( + ctx sdk.Context, tokensOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) ( + tokenIn sdk.Coin, err error, +) { + return sdk.Coin{}, err +} + +func (p *Pool) CalcJoinPoolNoSwapShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, tokensJoined sdk.Coins, err error) { + return sdk.ZeroInt(), sdk.Coins{}, nil +} + +func (p *Pool) CalcJoinPoolShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, newLiquidity sdk.Coins, err error) { + return sdk.ZeroInt(), sdk.Coins{}, nil +} + +func (p Pool) CalcOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, swapFee sdk.Dec) (tokenOut sdk.Coin, err error) { + return sdk.Coin{}, nil +} + +func (p *Pool) ExitPool(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitingCoins sdk.Coins, err error) { + return sdk.Coins{}, err +} + +func (p *Pool) JoinPool(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (sdk.Int, error) { + return sdk.ZeroInt(), nil +} + +func (p *Pool) JoinPoolNoSwap(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (sdk.Int, error) { + return sdk.ZeroInt(), nil +} + +func (p *Pool) SwapInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) (tokenIn sdk.Coin, err error) { + return sdk.Coin{}, nil +} + +func (p *Pool) SwapOutAmtGivenIn( + ctx sdk.Context, + tokensIn sdk.Coins, + tokenOutDenom string, + swapFee sdk.Dec, +) ( + tokenOut sdk.Coin, err error, +) { + return sdk.Coin{}, nil +} \ No newline at end of file From a1f03703ab444f847bd530099372191902a8f2ec Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:02:10 +0700 Subject: [PATCH 08/26] convert from old => new types --- x/gamm/migration/convert.go | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 x/gamm/migration/convert.go diff --git a/x/gamm/migration/convert.go b/x/gamm/migration/convert.go new file mode 100644 index 00000000000..5fff233e9b2 --- /dev/null +++ b/x/gamm/migration/convert.go @@ -0,0 +1,38 @@ +package migration + +import ( + oldbalancer "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer" + "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/balancer" + oldstableswap "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap" + "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/stableswap" +) + +func convertToNewBalancerPool(oldPool oldbalancer.Pool) balancer.Pool { + return balancer.Pool{ + Address: oldPool.Address, + Id: oldPool.Id, + PoolParams: balancer.PoolParams{ + SwapFee: oldPool.PoolParams.SwapFee, + SmoothWeightChangeParams: oldPool.PoolParams.SmoothWeightChangeParams, + }, + FuturePoolGovernor: oldPool.FuturePoolGovernor, + TotalShares: oldPool.TotalShares, + PoolAssets: oldPool.PoolAssets, + TotalWeight: oldPool.TotalWeight, + } +} + +func convertToNewStableSwapPool(oldPool oldstableswap.Pool) stableswap.Pool { + return stableswap.Pool{ + Address: oldPool.Address, + Id: oldPool.Id, + PoolParams: stableswap.PoolParams{ + SwapFee: oldPool.PoolParams.SwapFee, + }, + FuturePoolGovernor: oldPool.FuturePoolGovernor, + TotalShares: oldPool.TotalShares, + PoolLiquidity: oldPool.PoolLiquidity, + ScalingFactors: oldPool.ScalingFactors, + ScalingFactorController: oldPool.ScalingFactorController, + } +} \ No newline at end of file From 1a908635c295707543f5bbb6f33ccdc8ee0e7fcd Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:02:42 +0700 Subject: [PATCH 09/26] migrate store --- x/gamm/migration/migrate.go | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 x/gamm/migration/migrate.go diff --git a/x/gamm/migration/migrate.go b/x/gamm/migration/migrate.go new file mode 100644 index 00000000000..6a5ee31012c --- /dev/null +++ b/x/gamm/migration/migrate.go @@ -0,0 +1,65 @@ +package migration + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + gammkeeper "github.com/osmosis-labs/osmosis/v15/x/gamm/keeper" + gammtypes "github.com/osmosis-labs/osmosis/v15/x/gamm/types" + oldbalancer "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer" + oldstableswap "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap" + poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" +) + +func RemoveExitFee(ctx sdk.Context, keeper gammkeeper.Keeper) error { + store := ctx.KVStore(keeper.GetStoreKey(ctx)) + cdc := keeper.GetCodec(ctx) + + iterator := sdk.KVStorePrefixIterator(store, gammtypes.KeyPrefixPools) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + pool, err := keeper.UnmarshalPool(iterator.Value()) + if err != nil { + return sdkerrors.Wrapf(err, "unable to unmarshal pool (%v)", iterator.Key()) + } + poolKey := iterator.Key() + + switch pool.GetType() { + case poolmanagertypes.Balancer: + oldPool, ok := pool.(*oldbalancer.Pool) + if !ok { + return sdkerrors.Wrapf(err, "unable to unmarshal pool (%v) using old balancer data type", iterator.Key()) + } + if !oldPool.PoolParams.ExitFee.Equal(sdk.ZeroDec()) { + store.Delete(poolKey) + } else { + // Convert and serialize using the new type + newPool := convertToNewBalancerPool(*oldPool) + newPoolBz, err := cdc.MarshalInterface(&newPool) + if err != nil { + return sdkerrors.Wrapf(err, "unable to marshal pool (%v) using new balancer data type", iterator.Key()) + } + store.Set(poolKey, newPoolBz) + } + case poolmanagertypes.Stableswap: + oldPool, ok := pool.(*oldstableswap.Pool) + if !ok { + return sdkerrors.Wrapf(err, "unable to unmarshal pool (%v) using old stableswap data type", iterator.Key()) + } + if !oldPool.PoolParams.ExitFee.Equal(sdk.ZeroDec()) { + store.Delete(poolKey) + } else { + // Convert and serialize using the new type + newPool := convertToNewStableSwapPool(*oldPool) + newPoolBz, err := cdc.MarshalInterface(&newPool) + if err != nil { + return sdkerrors.Wrapf(err, "unable to marshal pool (%v) using new stableswap data type", iterator.Key()) + } + store.Set(poolKey, newPoolBz) + } + } + } + return nil +} \ No newline at end of file From 94838329e5316cbf0858e14c00398fd63401c345 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:03:02 +0700 Subject: [PATCH 10/26] upgrade handler --- app/upgrades/v15/upgrades.go | 7 +++++++ x/gamm/keeper/keeper.go | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index 3bfb2f09140..4d1b765da08 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -28,6 +28,7 @@ import ( "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/stableswap" gammtypes "github.com/osmosis-labs/osmosis/v15/x/gamm/types" "github.com/osmosis-labs/osmosis/v15/x/poolmanager" + gammmigration "github.com/osmosis-labs/osmosis/v15/x/gamm/migration" ) func CreateUpgradeHandler( @@ -47,6 +48,8 @@ func CreateUpgradeHandler( // Instead,it is moved to poolmanager. migrateNextPoolId(ctx, keepers.GAMMKeeper, keepers.PoolManagerKeeper) + removeExitFee(ctx, *keepers.GAMMKeeper) + // N.B.: this is done to avoid initializing genesis for poolmanager module. // Otherwise, it would overwrite migrations with InitGenesis(). // See RunMigrations() for details. @@ -268,3 +271,7 @@ func registerOsmoIonMetadata(ctx sdk.Context, bankKeeper bankkeeper.Keeper) { bankKeeper.SetDenomMetaData(ctx, uosmoMetadata) bankKeeper.SetDenomMetaData(ctx, uionMetadata) } + +func removeExitFee(ctx sdk.Context, gammKeeper gammkeeper.Keeper) error { + return gammmigration.RemoveExitFee(ctx, gammKeeper) +} diff --git a/x/gamm/keeper/keeper.go b/x/gamm/keeper/keeper.go index e7d3a5cc8ac..248966d2193 100644 --- a/x/gamm/keeper/keeper.go +++ b/x/gamm/keeper/keeper.go @@ -88,3 +88,13 @@ func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { func (k Keeper) setParams(ctx sdk.Context, params types.Params) { k.paramSpace.SetParamSet(ctx, ¶ms) } + +// SetParams sets the total set of params. +func (k Keeper) GetCodec(ctx sdk.Context) codec.BinaryCodec { + return k.cdc +} + +// SetParams sets the total set of params. +func (k Keeper) GetStoreKey(ctx sdk.Context) sdk.StoreKey { + return k.storeKey +} From d88c9c6e03a1354a3134dad403180c6288d334bf Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:03:13 +0700 Subject: [PATCH 11/26] test --- app/upgrades/v15/export_test.go | 4 ++ app/upgrades/v15/upgrade_test.go | 90 ++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) diff --git a/app/upgrades/v15/export_test.go b/app/upgrades/v15/export_test.go index 1e57bed9980..414682c7a4f 100644 --- a/app/upgrades/v15/export_test.go +++ b/app/upgrades/v15/export_test.go @@ -34,3 +34,7 @@ func MigrateBalancerPoolToSolidlyStable(ctx sdk.Context, gammKeeper *gammkeeper. func SetRateLimits(ctx sdk.Context, accountKeeper *authkeeper.AccountKeeper, rateLimitingICS4Wrapper *ibcratelimit.ICS4Wrapper, wasmKeeper *wasmkeeper.Keeper) { setRateLimits(ctx, accountKeeper, rateLimitingICS4Wrapper, wasmKeeper) } + +func RemoveExitFee(ctx sdk.Context, gammKeeper gammkeeper.Keeper) error { + return removeExitFee(ctx, gammKeeper) +} diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index 3c274148ea0..4091d4e30d7 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -5,6 +5,7 @@ import ( "os" "reflect" "testing" + "time" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" @@ -22,6 +23,9 @@ import ( gamm "github.com/osmosis-labs/osmosis/v15/x/gamm/keeper" balancer "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/balancer" balancertypes "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/balancer" + gammtypes "github.com/osmosis-labs/osmosis/v15/x/gamm/types" + oldbalancer "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer" + oldstableswap "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap" poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" ) @@ -254,3 +258,89 @@ func (suite *UpgradeTestSuite) validateCons(coinsA, coinsB sdk.Coins) { osmoassert.DecApproxEq(suite.T(), coinBAmount.ToDec(), coinA.Amount.ToDec(), sdk.NewDec(2)) } } + +func (suite *UpgradeTestSuite) TestRemoveExitFee() { + suite.SetupTest() // reset + + store := suite.Ctx.KVStore(suite.App.GAMMKeeper.GetStoreKey(suite.Ctx)) + + // Set up balancer pool with exit fee + balancerWithFee := oldbalancer.Pool{ + Id: 1, + PoolParams: oldbalancer.PoolParams{ + SwapFee: sdk.NewDecWithPrec(5, 2), + ExitFee: sdk.NewDecWithPrec(5, 2), + SmoothWeightChangeParams: &balancertypes.SmoothWeightChangeParams{ + StartTime: time.Now(), + }, + }, + PoolAssets: []balancertypes.PoolAsset{ + { + Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000)), + Weight: sdk.NewInt(1000), + }, + { + Token: sdk.NewCoin("uion", sdk.NewInt(1000000)), + Weight: sdk.NewInt(1000), + }, + }, + } + balancerWithFeebz, err := suite.App.GAMMKeeper.MarshalPool(&balancerWithFee) + store.Set(gammtypes.GetKeyPrefixPools(balancerWithFee.Id), balancerWithFeebz) + + // Set up stableswap pool with exit fee + stableswapWithFee := oldstableswap.Pool{ + Id: 2, + PoolParams: oldstableswap.PoolParams{ + SwapFee: sdk.NewDecWithPrec(5, 2), + ExitFee: sdk.NewDecWithPrec(5, 2), + }, + PoolLiquidity: sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(1000000)), sdk.NewCoin("uion", sdk.NewInt(1000000))), + } + stableswapWithFeeBz, err := suite.App.GAMMKeeper.MarshalPool(&stableswapWithFee) + store.Set(gammtypes.GetKeyPrefixPools(stableswapWithFee.Id), stableswapWithFeeBz) + + // Set up pool with zero exit fee + poolWithZeroFee := oldbalancer.Pool{ + Id: 3, + PoolParams: oldbalancer.PoolParams{ + SwapFee: sdk.NewDecWithPrec(5, 2), + ExitFee: sdk.ZeroDec(), + SmoothWeightChangeParams: &balancertypes.SmoothWeightChangeParams{ + StartTime: time.Now(), + }, + }, + PoolAssets: []balancertypes.PoolAsset{ + { + Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000)), + Weight: sdk.NewInt(1000), + }, + { + Token: sdk.NewCoin("uion", sdk.NewInt(1000000)), + Weight: sdk.NewInt(1000), + }, + }, + } + poolWithZeroFeeBz, err := suite.App.GAMMKeeper.MarshalPool(&poolWithZeroFee) + store.Set(gammtypes.GetKeyPrefixPools(poolWithZeroFee.Id), poolWithZeroFeeBz) + + // system under test. + err = v15.RemoveExitFee(suite.Ctx, *suite.App.GAMMKeeper) + + // Should be removed + newBalancerPoolWithFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, balancerWithFee.Id) + suite.Require().Error(err) + suite.Require().Nil(newBalancerPoolWithFee) + + // Should be removed + newStableSwapWithFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, stableswapWithFee.Id) + fmt.Println("newStableSwapWithFee", newStableSwapWithFee, err) + suite.Require().Error(err) + suite.Require().Nil(newStableSwapWithFee) + + // Pool with zero exit fee should not be removed + newPoolWithZeroFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, poolWithZeroFee.Id) + suite.Require().NoError(err) + suite.Require().NotNil(newPoolWithZeroFee) + fmt.Println("newPoolWithZeroFee", newPoolWithZeroFee) +} From 22dbceb653845ed72c38f2fdd6ce0ad95b2a72bf Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:11:58 +0700 Subject: [PATCH 12/26] fix e2e --- tests/e2e/configurer/upgrade.go | 4 ++-- tests/e2e/scripts/pool1A-legacy.json | 7 +++++++ tests/e2e/scripts/pool1B-legacy.json | 7 +++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tests/e2e/scripts/pool1A-legacy.json create mode 100644 tests/e2e/scripts/pool1B-legacy.json diff --git a/tests/e2e/configurer/upgrade.go b/tests/e2e/configurer/upgrade.go index 58026906b79..fcd1e9df07c 100644 --- a/tests/e2e/configurer/upgrade.go +++ b/tests/e2e/configurer/upgrade.go @@ -125,9 +125,9 @@ func (uc *UpgradeConfigurer) CreatePreUpgradeState() error { chainA.SendIBC(chainB, chainB.NodeConfigs[0].PublicAddress, initialization.StakeToken) chainB.SendIBC(chainA, chainA.NodeConfigs[0].PublicAddress, initialization.StakeToken) - config.PreUpgradePoolId = chainANode.CreateBalancerPool("pool1A.json", initialization.ValidatorWalletName) + config.PreUpgradePoolId = chainANode.CreateBalancerPool("pool1A-legacy.json", initialization.ValidatorWalletName) poolShareDenom := fmt.Sprintf("gamm/pool/%d", config.PreUpgradePoolId) - chainBNode.CreateBalancerPool("pool1B.json", initialization.ValidatorWalletName) + chainBNode.CreateBalancerPool("pool1B-legacy.json", initialization.ValidatorWalletName) // enable superfluid assets on chainA chainA.EnableSuperfluidAsset(poolShareDenom) diff --git a/tests/e2e/scripts/pool1A-legacy.json b/tests/e2e/scripts/pool1A-legacy.json new file mode 100644 index 00000000000..ce93c659c5a --- /dev/null +++ b/tests/e2e/scripts/pool1A-legacy.json @@ -0,0 +1,7 @@ +{ + "weights": "5ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,5uosmo", + "initial-deposit": "499404ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,500000uosmo", + "swap-fee": "0.01", + "exit-fee": "0.01", + "future-governor": "" +} diff --git a/tests/e2e/scripts/pool1B-legacy.json b/tests/e2e/scripts/pool1B-legacy.json new file mode 100644 index 00000000000..e41dbfb47e9 --- /dev/null +++ b/tests/e2e/scripts/pool1B-legacy.json @@ -0,0 +1,7 @@ +{ + "weights": "5ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,5uosmo", + "initial-deposit": "499404ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,500000uosmo", + "swap-fee": "0.01", + "exit-fee": "0.0", + "future-governor": "" +} From 3148b6ca7186eda6c4e73e94dd6d42ee90e97bd7 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:29:45 +0700 Subject: [PATCH 13/26] lint --- app/upgrades/v15/upgrade_test.go | 25 +++++++++++-------------- app/upgrades/v15/upgrades.go | 12 ++++++++++-- x/gamm/migration/convert.go | 26 +++++++++++++------------- x/gamm/migration/migrate.go | 4 ++-- x/gamm/v2types/balancer/pool.go | 9 +++------ x/gamm/v2types/stableswap/pool.go | 9 +++------ 6 files changed, 42 insertions(+), 43 deletions(-) diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index 4091d4e30d7..c1eeb210afe 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -55,9 +55,7 @@ func (suite *UpgradeTestSuite) TestMigrateNextPoolIdAndCreatePool() { expectedNextPoolId uint64 = 1 ) - var ( - gammKeeperType = reflect.TypeOf(&gamm.Keeper{}) - ) + gammKeeperType := reflect.TypeOf(&gamm.Keeper{}) ctx := suite.Ctx gammKeeper := suite.App.GAMMKeeper @@ -247,7 +245,6 @@ func (suite *UpgradeTestSuite) TestSetRateLimits() { // This is the last one. If the others failed the upgrade would've panicked before adding this one state, err = suite.App.WasmKeeper.QuerySmart(suite.Ctx, addr, []byte(`{"get_quotas": {"channel_id": "any", "denom": "ibc/E6931F78057F7CC5DA0FD6CEF82FF39373A6E0452BF1FD76910B93292CF356C1"}}`)) suite.Require().Greaterf(len(state), 0, "state should not be empty") - } func (suite *UpgradeTestSuite) validateCons(coinsA, coinsB sdk.Coins) { @@ -264,7 +261,7 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { store := suite.Ctx.KVStore(suite.App.GAMMKeeper.GetStoreKey(suite.Ctx)) - // Set up balancer pool with exit fee + // Set up balancer pool with exit fee balancerWithFee := oldbalancer.Pool{ Id: 1, PoolParams: oldbalancer.PoolParams{ @@ -276,11 +273,11 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { }, PoolAssets: []balancertypes.PoolAsset{ { - Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000)), + Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000)), Weight: sdk.NewInt(1000), }, { - Token: sdk.NewCoin("uion", sdk.NewInt(1000000)), + Token: sdk.NewCoin("uion", sdk.NewInt(1000000)), Weight: sdk.NewInt(1000), }, }, @@ -288,8 +285,8 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { balancerWithFeebz, err := suite.App.GAMMKeeper.MarshalPool(&balancerWithFee) store.Set(gammtypes.GetKeyPrefixPools(balancerWithFee.Id), balancerWithFeebz) - // Set up stableswap pool with exit fee - stableswapWithFee := oldstableswap.Pool{ + // Set up stableswap pool with exit fee + stableswapWithFee := oldstableswap.Pool{ Id: 2, PoolParams: oldstableswap.PoolParams{ SwapFee: sdk.NewDecWithPrec(5, 2), @@ -303,7 +300,7 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { // Set up pool with zero exit fee poolWithZeroFee := oldbalancer.Pool{ Id: 3, - PoolParams: oldbalancer.PoolParams{ + PoolParams: oldbalancer.PoolParams{ SwapFee: sdk.NewDecWithPrec(5, 2), ExitFee: sdk.ZeroDec(), SmoothWeightChangeParams: &balancertypes.SmoothWeightChangeParams{ @@ -312,11 +309,11 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { }, PoolAssets: []balancertypes.PoolAsset{ { - Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000)), + Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000)), Weight: sdk.NewInt(1000), }, { - Token: sdk.NewCoin("uion", sdk.NewInt(1000000)), + Token: sdk.NewCoin("uion", sdk.NewInt(1000000)), Weight: sdk.NewInt(1000), }, }, @@ -331,13 +328,13 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { newBalancerPoolWithFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, balancerWithFee.Id) suite.Require().Error(err) suite.Require().Nil(newBalancerPoolWithFee) - + // Should be removed newStableSwapWithFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, stableswapWithFee.Id) fmt.Println("newStableSwapWithFee", newStableSwapWithFee, err) suite.Require().Error(err) suite.Require().Nil(newStableSwapWithFee) - + // Pool with zero exit fee should not be removed newPoolWithZeroFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, poolWithZeroFee.Id) suite.Require().NoError(err) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index 4d1b765da08..1569befee47 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -25,10 +25,10 @@ import ( appParams "github.com/osmosis-labs/osmosis/v15/app/params" "github.com/osmosis-labs/osmosis/v15/app/upgrades" gammkeeper "github.com/osmosis-labs/osmosis/v15/x/gamm/keeper" + gammmigration "github.com/osmosis-labs/osmosis/v15/x/gamm/migration" "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/stableswap" gammtypes "github.com/osmosis-labs/osmosis/v15/x/gamm/types" "github.com/osmosis-labs/osmosis/v15/x/poolmanager" - gammmigration "github.com/osmosis-labs/osmosis/v15/x/gamm/migration" ) func CreateUpgradeHandler( @@ -48,7 +48,15 @@ func CreateUpgradeHandler( // Instead,it is moved to poolmanager. migrateNextPoolId(ctx, keepers.GAMMKeeper, keepers.PoolManagerKeeper) - removeExitFee(ctx, *keepers.GAMMKeeper) + err := removeExitFee(ctx, *keepers.GAMMKeeper) + if err != nil { + return fromVM, err + } + + // N.B.: this is done to avoid initializing genesis for gamm module. + // Otherwise, it would overwrite migrations with InitGenesis(). + // See RunMigrations() for details. + fromVM[gammtypes.ModuleName] = 0 // N.B.: this is done to avoid initializing genesis for poolmanager module. // Otherwise, it would overwrite migrations with InitGenesis(). diff --git a/x/gamm/migration/convert.go b/x/gamm/migration/convert.go index 5fff233e9b2..6eaac41d623 100644 --- a/x/gamm/migration/convert.go +++ b/x/gamm/migration/convert.go @@ -1,38 +1,38 @@ package migration import ( - oldbalancer "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer" "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/balancer" - oldstableswap "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap" "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/stableswap" + oldbalancer "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer" + oldstableswap "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap" ) func convertToNewBalancerPool(oldPool oldbalancer.Pool) balancer.Pool { return balancer.Pool{ Address: oldPool.Address, - Id: oldPool.Id, + Id: oldPool.Id, PoolParams: balancer.PoolParams{ - SwapFee: oldPool.PoolParams.SwapFee, + SwapFee: oldPool.PoolParams.SwapFee, SmoothWeightChangeParams: oldPool.PoolParams.SmoothWeightChangeParams, }, FuturePoolGovernor: oldPool.FuturePoolGovernor, - TotalShares: oldPool.TotalShares, - PoolAssets: oldPool.PoolAssets, - TotalWeight: oldPool.TotalWeight, + TotalShares: oldPool.TotalShares, + PoolAssets: oldPool.PoolAssets, + TotalWeight: oldPool.TotalWeight, } } func convertToNewStableSwapPool(oldPool oldstableswap.Pool) stableswap.Pool { return stableswap.Pool{ Address: oldPool.Address, - Id: oldPool.Id, + Id: oldPool.Id, PoolParams: stableswap.PoolParams{ SwapFee: oldPool.PoolParams.SwapFee, }, - FuturePoolGovernor: oldPool.FuturePoolGovernor, - TotalShares: oldPool.TotalShares, - PoolLiquidity: oldPool.PoolLiquidity, - ScalingFactors: oldPool.ScalingFactors, + FuturePoolGovernor: oldPool.FuturePoolGovernor, + TotalShares: oldPool.TotalShares, + PoolLiquidity: oldPool.PoolLiquidity, + ScalingFactors: oldPool.ScalingFactors, ScalingFactorController: oldPool.ScalingFactorController, } -} \ No newline at end of file +} diff --git a/x/gamm/migration/migrate.go b/x/gamm/migration/migrate.go index 6a5ee31012c..337d4cae6b1 100644 --- a/x/gamm/migration/migrate.go +++ b/x/gamm/migration/migrate.go @@ -60,6 +60,6 @@ func RemoveExitFee(ctx sdk.Context, keeper gammkeeper.Keeper) error { store.Set(poolKey, newPoolBz) } } - } + } return nil -} \ No newline at end of file +} diff --git a/x/gamm/v2types/balancer/pool.go b/x/gamm/v2types/balancer/pool.go index f8825f1cb57..61545a80a79 100644 --- a/x/gamm/v2types/balancer/pool.go +++ b/x/gamm/v2types/balancer/pool.go @@ -1,19 +1,16 @@ package balancer import ( - - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v15/x/gamm/types" poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" ) var ( - _ poolmanagertypes.PoolI = &Pool{} - _ types.CFMMPoolI = &Pool{} + _ poolmanagertypes.PoolI = &Pool{} + _ types.CFMMPoolI = &Pool{} ) - // GetAddress returns the address of a pool. // If the pool address is not bech32 valid, it returns an empty address. func (p Pool) GetAddress() sdk.AccAddress { @@ -96,4 +93,4 @@ func (p *Pool) SwapOutAmtGivenIn( tokenOut sdk.Coin, err error, ) { return sdk.Coin{}, nil -} \ No newline at end of file +} diff --git a/x/gamm/v2types/stableswap/pool.go b/x/gamm/v2types/stableswap/pool.go index 6e3cf21cc7b..713946a6a8f 100644 --- a/x/gamm/v2types/stableswap/pool.go +++ b/x/gamm/v2types/stableswap/pool.go @@ -1,19 +1,16 @@ package stableswap import ( - - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/v15/x/gamm/types" poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" ) var ( - _ poolmanagertypes.PoolI = &Pool{} - _ types.CFMMPoolI = &Pool{} + _ poolmanagertypes.PoolI = &Pool{} + _ types.CFMMPoolI = &Pool{} ) - // GetAddress returns the address of a pool. // If the pool address is not bech32 valid, it returns an empty address. func (p Pool) GetAddress() sdk.AccAddress { @@ -96,4 +93,4 @@ func (p *Pool) SwapOutAmtGivenIn( tokenOut sdk.Coin, err error, ) { return sdk.Coin{}, nil -} \ No newline at end of file +} From ea885243ea6b6d2ca78f18704c6deeff50beac50 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:54:13 +0700 Subject: [PATCH 14/26] fix test: change hex string for new types --- x/gamm/pool-models/balancer/marshal_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/gamm/pool-models/balancer/marshal_test.go b/x/gamm/pool-models/balancer/marshal_test.go index 6cc9e4621e3..ad1cd752984 100644 --- a/x/gamm/pool-models/balancer/marshal_test.go +++ b/x/gamm/pool-models/balancer/marshal_test.go @@ -55,8 +55,8 @@ func TestPoolJson(t *testing.T) { } func TestPoolProtoMarshal(t *testing.T) { - // hex of serialzied poolI from v6.x - decodedByteArray, err := hex.DecodeString("0a3f6f736d6f316b727033387a7a63337a7a356173396e64716b79736b686b7a76367839653330636b63713567346c637375357770776371793073613364656132100a1a260a113235303030303030303030303030303030121132353030303030303030303030303030302a110a0c67616d6d2f706f6f6c2f3130120130321e0a0e0a05746573743112053130303030120c313037333734313832343030321e0a0e0a05746573743212053530303030120c3231343734383336343830303a0c333232313232353437323030") + // since we decided to remove ExitFee, this hex string should be changed + decodedByteArray, err := hex.DecodeString("100a1a130a1132353030303030303030303030303030302a110a0c67616d6d2f706f6f6c2f3130120130321e0a0e0a05746573743112053130303030120c313037333734313832343030321e0a0e0a05746573743212053530303030120c3231343734383336343830303a0130") require.NoError(t, err) pool2 := balancer.Pool{} From 267c0f8c867c177674dd6d704219d73abaf76863 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Mon, 13 Mar 2023 15:53:28 +0700 Subject: [PATCH 15/26] try to use reversed --- app/upgrades/v15/constants.go | 1 + app/upgrades/v15/export_test.go | 4 +- app/upgrades/v15/upgrade_test.go | 150 +++++++++--------- app/upgrades/v15/upgrades.go | 17 +- .../pool-models/balancer/balancerPool.proto | 1 + .../stableswap/stableswap_pool.proto | 1 + .../gamm/v2/balancer/balancerPool.proto | 83 ---------- .../gamm/v2/stableswap/stableswap_pool.proto | 73 --------- x/gamm/keeper/pool.go | 1 + x/gamm/migration/convert.go | 38 ----- x/gamm/migration/migrate.go | 65 -------- x/gamm/module.go | 12 +- 12 files changed, 98 insertions(+), 348 deletions(-) delete mode 100644 proto/osmosis/gamm/v2/balancer/balancerPool.proto delete mode 100644 proto/osmosis/gamm/v2/stableswap/stableswap_pool.proto delete mode 100644 x/gamm/migration/convert.go delete mode 100644 x/gamm/migration/migrate.go diff --git a/app/upgrades/v15/constants.go b/app/upgrades/v15/constants.go index a6b6e4efe6b..5f61b1aa0bb 100644 --- a/app/upgrades/v15/constants.go +++ b/app/upgrades/v15/constants.go @@ -19,6 +19,7 @@ const UpgradeName = "v15" const stOSMO_OSMOPoolId = 833 const stJUNO_JUNOPoolId = 817 const stSTARS_STARSPoolId = 810 +var exitFeePools = []uint64{553, 596, 555, 905, 597, 802, 654, 595, 696, 551, 552, 554, 652, 655, 657, 797} var Upgrade = upgrades.Upgrade{ UpgradeName: UpgradeName, diff --git a/app/upgrades/v15/export_test.go b/app/upgrades/v15/export_test.go index 414682c7a4f..1cbc04d0f48 100644 --- a/app/upgrades/v15/export_test.go +++ b/app/upgrades/v15/export_test.go @@ -35,6 +35,6 @@ func SetRateLimits(ctx sdk.Context, accountKeeper *authkeeper.AccountKeeper, rat setRateLimits(ctx, accountKeeper, rateLimitingICS4Wrapper, wasmKeeper) } -func RemoveExitFee(ctx sdk.Context, gammKeeper gammkeeper.Keeper) error { - return removeExitFee(ctx, gammKeeper) +func RemoveExitFee(ctx sdk.Context, gammKeeper gammkeeper.Keeper) { + removeExitFee(ctx, gammKeeper) } diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index c1eeb210afe..3480c2f6abf 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -1,11 +1,12 @@ package v15_test import ( + "encoding/hex" "fmt" "os" "reflect" "testing" - "time" + // "time" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" @@ -24,8 +25,8 @@ import ( balancer "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/balancer" balancertypes "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/balancer" gammtypes "github.com/osmosis-labs/osmosis/v15/x/gamm/types" - oldbalancer "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer" - oldstableswap "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap" + // oldbalancer "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer" + // oldstableswap "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap" poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" ) @@ -262,81 +263,84 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { store := suite.Ctx.KVStore(suite.App.GAMMKeeper.GetStoreKey(suite.Ctx)) // Set up balancer pool with exit fee - balancerWithFee := oldbalancer.Pool{ - Id: 1, - PoolParams: oldbalancer.PoolParams{ - SwapFee: sdk.NewDecWithPrec(5, 2), - ExitFee: sdk.NewDecWithPrec(5, 2), - SmoothWeightChangeParams: &balancertypes.SmoothWeightChangeParams{ - StartTime: time.Now(), - }, - }, - PoolAssets: []balancertypes.PoolAsset{ - { - Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000)), - Weight: sdk.NewInt(1000), - }, - { - Token: sdk.NewCoin("uion", sdk.NewInt(1000000)), - Weight: sdk.NewInt(1000), - }, - }, - } - balancerWithFeebz, err := suite.App.GAMMKeeper.MarshalPool(&balancerWithFee) - store.Set(gammtypes.GetKeyPrefixPools(balancerWithFee.Id), balancerWithFeebz) - - // Set up stableswap pool with exit fee - stableswapWithFee := oldstableswap.Pool{ - Id: 2, - PoolParams: oldstableswap.PoolParams{ - SwapFee: sdk.NewDecWithPrec(5, 2), - ExitFee: sdk.NewDecWithPrec(5, 2), - }, - PoolLiquidity: sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(1000000)), sdk.NewCoin("uion", sdk.NewInt(1000000))), - } - stableswapWithFeeBz, err := suite.App.GAMMKeeper.MarshalPool(&stableswapWithFee) - store.Set(gammtypes.GetKeyPrefixPools(stableswapWithFee.Id), stableswapWithFeeBz) - - // Set up pool with zero exit fee - poolWithZeroFee := oldbalancer.Pool{ - Id: 3, - PoolParams: oldbalancer.PoolParams{ - SwapFee: sdk.NewDecWithPrec(5, 2), - ExitFee: sdk.ZeroDec(), - SmoothWeightChangeParams: &balancertypes.SmoothWeightChangeParams{ - StartTime: time.Now(), - }, - }, - PoolAssets: []balancertypes.PoolAsset{ - { - Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000)), - Weight: sdk.NewInt(1000), - }, - { - Token: sdk.NewCoin("uion", sdk.NewInt(1000000)), - Weight: sdk.NewInt(1000), - }, - }, - } - poolWithZeroFeeBz, err := suite.App.GAMMKeeper.MarshalPool(&poolWithZeroFee) - store.Set(gammtypes.GetKeyPrefixPools(poolWithZeroFee.Id), poolWithZeroFeeBz) - + // balancerWithFee := oldbalancer.Pool{ + // Id: 1, + // PoolParams: oldbalancer.PoolParams{ + // SwapFee: sdk.NewDecWithPrec(5, 2), + // ExitFee: sdk.NewDecWithPrec(5, 2), + // SmoothWeightChangeParams: &balancertypes.SmoothWeightChangeParams{ + // StartTime: time.Now(), + // }, + // }, + // PoolAssets: []balancertypes.PoolAsset{ + // { + // Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000)), + // Weight: sdk.NewInt(1000), + // }, + // { + // Token: sdk.NewCoin("uion", sdk.NewInt(1000000)), + // Weight: sdk.NewInt(1000), + // }, + // }, + // } + // balancerWithFeebz, err := suite.App.GAMMKeeper.MarshalPool(&balancerWithFee) + // store.Set(gammtypes.GetKeyPrefixPools(balancerWithFee.Id), balancerWithFeebz) + + // // Set up stableswap pool with exit fee + // stableswapWithFee := oldstableswap.Pool{ + // Id: 2, + // PoolParams: oldstableswap.PoolParams{ + // SwapFee: sdk.NewDecWithPrec(5, 2), + // ExitFee: sdk.NewDecWithPrec(5, 2), + // }, + // PoolLiquidity: sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(1000000)), sdk.NewCoin("uion", sdk.NewInt(1000000))), + // } + // stableswapWithFeeBz, err := suite.App.GAMMKeeper.MarshalPool(&stableswapWithFee) + // store.Set(gammtypes.GetKeyPrefixPools(stableswapWithFee.Id), stableswapWithFeeBz) + + // // Set up pool with zero exit fee + // poolWithZeroFee := oldbalancer.Pool{ + // Id: 3, + // PoolParams: oldbalancer.PoolParams{ + // SwapFee: sdk.NewDecWithPrec(5, 2), + // ExitFee: sdk.ZeroDec(), + // SmoothWeightChangeParams: &balancertypes.SmoothWeightChangeParams{ + // StartTime: time.Now(), + // }, + // }, + // PoolAssets: []balancertypes.PoolAsset{ + // { + // Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000)), + // Weight: sdk.NewInt(1000), + // }, + // { + // Token: sdk.NewCoin("uion", sdk.NewInt(1000000)), + // Weight: sdk.NewInt(1000), + // }, + // }, + // } + // poolWithZeroFeeBz, err := suite.App.GAMMKeeper.MarshalPool(&poolWithZeroFee) + // fmt.Println(hex.EncodeToString(poolWithZeroFeeBz)) + // store.Set(gammtypes.GetKeyPrefixPools(poolWithZeroFee.Id), poolWithZeroFeeBz) + + testPoolBz, err := hex.DecodeString("0a1e2f6f736d6f7369732e67616d6d2e76322e62616c616e6365722e506f6f6c126710031a280a1135303030303030303030303030303030301201301a100a0c08ffc6bba0061090bce8800312002a0312013032180a100a05756f736d6f12073130303030303012043130303032170a0f0a0475696f6e1207313030303030301204313030303a0130") + store.Set(gammtypes.GetKeyPrefixPools(3), testPoolBz) // system under test. - err = v15.RemoveExitFee(suite.Ctx, *suite.App.GAMMKeeper) + // err = v15.RemoveExitFee(suite.Ctx, *suite.App.GAMMKeeper) - // Should be removed - newBalancerPoolWithFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, balancerWithFee.Id) - suite.Require().Error(err) - suite.Require().Nil(newBalancerPoolWithFee) + // // Should be removed + // newBalancerPoolWithFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, balancerWithFee.Id) + // suite.Require().Error(err) + // suite.Require().Nil(newBalancerPoolWithFee) - // Should be removed - newStableSwapWithFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, stableswapWithFee.Id) - fmt.Println("newStableSwapWithFee", newStableSwapWithFee, err) - suite.Require().Error(err) - suite.Require().Nil(newStableSwapWithFee) + // // Should be removed + // newStableSwapWithFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, stableswapWithFee.Id) + // fmt.Println("newStableSwapWithFee", newStableSwapWithFee, err) + // suite.Require().Error(err) + // suite.Require().Nil(newStableSwapWithFee) // Pool with zero exit fee should not be removed - newPoolWithZeroFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, poolWithZeroFee.Id) + newPoolWithZeroFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 3) suite.Require().NoError(err) suite.Require().NotNil(newPoolWithZeroFee) fmt.Println("newPoolWithZeroFee", newPoolWithZeroFee) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index 1569befee47..c6142673275 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -25,7 +25,6 @@ import ( appParams "github.com/osmosis-labs/osmosis/v15/app/params" "github.com/osmosis-labs/osmosis/v15/app/upgrades" gammkeeper "github.com/osmosis-labs/osmosis/v15/x/gamm/keeper" - gammmigration "github.com/osmosis-labs/osmosis/v15/x/gamm/migration" "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/stableswap" gammtypes "github.com/osmosis-labs/osmosis/v15/x/gamm/types" "github.com/osmosis-labs/osmosis/v15/x/poolmanager" @@ -48,11 +47,8 @@ func CreateUpgradeHandler( // Instead,it is moved to poolmanager. migrateNextPoolId(ctx, keepers.GAMMKeeper, keepers.PoolManagerKeeper) - err := removeExitFee(ctx, *keepers.GAMMKeeper) - if err != nil { - return fromVM, err - } - + removeExitFee(ctx, *keepers.GAMMKeeper) + // N.B.: this is done to avoid initializing genesis for gamm module. // Otherwise, it would overwrite migrations with InitGenesis(). // See RunMigrations() for details. @@ -280,6 +276,11 @@ func registerOsmoIonMetadata(ctx sdk.Context, bankKeeper bankkeeper.Keeper) { bankKeeper.SetDenomMetaData(ctx, uionMetadata) } -func removeExitFee(ctx sdk.Context, gammKeeper gammkeeper.Keeper) error { - return gammmigration.RemoveExitFee(ctx, gammKeeper) +func removeExitFee(ctx sdk.Context, gammKeeper gammkeeper.Keeper) { + for _, poolId := range exitFeePools { + err := gammKeeper.DeletePool(ctx, poolId) + if err != nil { + panic(err) + } + } } diff --git a/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto b/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto index ac224c70da0..18da0025b9a 100644 --- a/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto +++ b/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto @@ -79,6 +79,7 @@ message PoolParams { (gogoproto.moretags) = "yaml:\"swap_fee\"", (gogoproto.nullable) = false ]; + reserved 2; SmoothWeightChangeParams smooth_weight_change_params = 2 [ (gogoproto.moretags) = "yaml:\"smooth_weight_change_params\"", (gogoproto.nullable) = true diff --git a/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto b/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto index 9635fefe919..c95b5b15127 100644 --- a/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto +++ b/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto @@ -22,6 +22,7 @@ message PoolParams { (gogoproto.moretags) = "yaml:\"swap_fee\"", (gogoproto.nullable) = false ]; + reserved 2; } // Pool is the stableswap Pool struct diff --git a/proto/osmosis/gamm/v2/balancer/balancerPool.proto b/proto/osmosis/gamm/v2/balancer/balancerPool.proto deleted file mode 100644 index 79ac98cd1c6..00000000000 --- a/proto/osmosis/gamm/v2/balancer/balancerPool.proto +++ /dev/null @@ -1,83 +0,0 @@ -syntax = "proto3"; -// this is a legacy package that requires additional migration logic -// in order to use the correct packge. Decision made to use legacy package path -// until clear steps for migration logic and the unknowns for state breaking are -// investigated for changing proto package. -package osmosis.gamm.v2.balancer; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; - -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -import "cosmos/auth/v1beta1/auth.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "osmosis/gamm/pool-models/balancer/balancerPool.proto"; - -option go_package = "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer"; - -// PoolParams defined the parameters that will be managed by the pool -// governance in the future. This params are not managed by the chain -// governance. Instead they will be managed by the token holders of the pool. -// The pool's token holders are specified in future_pool_governor. -message PoolParams { - string swap_fee = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"swap_fee\"", - (gogoproto.nullable) = false - ]; - string exit_fee = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"exit_fee\"", - (gogoproto.nullable) = false - ]; - osmosis.gamm.v1beta1.SmoothWeightChangeParams smooth_weight_change_params = 3 - [ - (gogoproto.moretags) = "yaml:\"smooth_weight_change_params\"", - (gogoproto.nullable) = true - ]; -} - -message Pool { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - option (cosmos_proto.implements_interface) = "PoolI"; - - string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; - uint64 id = 2; - - PoolParams pool_params = 3 [ - (gogoproto.moretags) = "yaml:\"balancer_pool_params\"", - (gogoproto.nullable) = false - ]; - - // This string specifies who will govern the pool in the future. - // Valid forms of this are: - // {token name},{duration} - // {duration} - // where {token name} if specified is the token which determines the - // governor, and if not specified is the LP token for this pool.duration is - // a time specified as 0w,1w,2w, etc. which specifies how long the token - // would need to be locked up to count in governance. 0w means no lockup. - // TODO: Further improve these docs - string future_pool_governor = 4 - [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; - // sum of all LP tokens sent out - cosmos.base.v1beta1.Coin total_shares = 5 [ - (gogoproto.moretags) = "yaml:\"total_shares\"", - (gogoproto.nullable) = false - ]; - // These are assumed to be sorted by denomiation. - // They contain the pool asset and the information about the weight - repeated osmosis.gamm.v1beta1.PoolAsset pool_assets = 6 [ - (gogoproto.moretags) = "yaml:\"pool_assets\"", - (gogoproto.nullable) = false - ]; - // sum of all non-normalized pool weights - string total_weight = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"total_weight\"", - (gogoproto.nullable) = false - ]; -} diff --git a/proto/osmosis/gamm/v2/stableswap/stableswap_pool.proto b/proto/osmosis/gamm/v2/stableswap/stableswap_pool.proto deleted file mode 100644 index a8787576829..00000000000 --- a/proto/osmosis/gamm/v2/stableswap/stableswap_pool.proto +++ /dev/null @@ -1,73 +0,0 @@ -syntax = "proto3"; -package osmosis.gamm.v2.stableswap; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; - -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -import "cosmos/auth/v1beta1/auth.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap"; - -// PoolParams defined the parameters that will be managed by the pool -// governance in the future. This params are not managed by the chain -// governance. Instead they will be managed by the token holders of the pool. -// The pool's token holders are specified in future_pool_governor. -message PoolParams { - string swap_fee = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"swap_fee\"", - (gogoproto.nullable) = false - ]; - string exit_fee = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"exit_fee\"", - (gogoproto.nullable) = false - ]; -} - -// Pool is the stableswap Pool struct -message Pool { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - option (cosmos_proto.implements_interface) = "PoolI"; - - string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; - uint64 id = 2; - - PoolParams pool_params = 3 [ - (gogoproto.moretags) = "yaml:\"stableswap_pool_params\"", - (gogoproto.nullable) = false - ]; - - // This string specifies who will govern the pool in the future. - // Valid forms of this are: - // {token name},{duration} - // {duration} - // where {token name} if specified is the token which determines the - // governor, and if not specified is the LP token for this pool.duration is - // a time specified as 0w,1w,2w, etc. which specifies how long the token - // would need to be locked up to count in governance. 0w means no lockup. - string future_pool_governor = 4 - [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; - // sum of all LP shares - cosmos.base.v1beta1.Coin total_shares = 5 [ - (gogoproto.moretags) = "yaml:\"total_shares\"", - (gogoproto.nullable) = false - ]; - // assets in the pool - repeated cosmos.base.v1beta1.Coin pool_liquidity = 6 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - - // for calculation amognst assets with different precisions - repeated uint64 scaling_factors = 7 - [ (gogoproto.moretags) = "yaml:\"stableswap_scaling_factors\"" ]; - // scaling_factor_controller is the address can adjust pool scaling factors - string scaling_factor_controller = 8 - [ (gogoproto.moretags) = "yaml:\"scaling_factor_controller\"" ]; -} diff --git a/x/gamm/keeper/pool.go b/x/gamm/keeper/pool.go index 58eb27b51eb..300ff6d37b0 100644 --- a/x/gamm/keeper/pool.go +++ b/x/gamm/keeper/pool.go @@ -94,6 +94,7 @@ func (k Keeper) GetPoolsAndPoke(ctx sdk.Context) (res []types.CFMMPoolI, err err func (k Keeper) setPool(ctx sdk.Context, pool poolmanagertypes.PoolI) error { bz, err := k.MarshalPool(pool) + fmt.Println("bz", bz) if err != nil { return err } diff --git a/x/gamm/migration/convert.go b/x/gamm/migration/convert.go deleted file mode 100644 index 6eaac41d623..00000000000 --- a/x/gamm/migration/convert.go +++ /dev/null @@ -1,38 +0,0 @@ -package migration - -import ( - "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/balancer" - "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/stableswap" - oldbalancer "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer" - oldstableswap "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap" -) - -func convertToNewBalancerPool(oldPool oldbalancer.Pool) balancer.Pool { - return balancer.Pool{ - Address: oldPool.Address, - Id: oldPool.Id, - PoolParams: balancer.PoolParams{ - SwapFee: oldPool.PoolParams.SwapFee, - SmoothWeightChangeParams: oldPool.PoolParams.SmoothWeightChangeParams, - }, - FuturePoolGovernor: oldPool.FuturePoolGovernor, - TotalShares: oldPool.TotalShares, - PoolAssets: oldPool.PoolAssets, - TotalWeight: oldPool.TotalWeight, - } -} - -func convertToNewStableSwapPool(oldPool oldstableswap.Pool) stableswap.Pool { - return stableswap.Pool{ - Address: oldPool.Address, - Id: oldPool.Id, - PoolParams: stableswap.PoolParams{ - SwapFee: oldPool.PoolParams.SwapFee, - }, - FuturePoolGovernor: oldPool.FuturePoolGovernor, - TotalShares: oldPool.TotalShares, - PoolLiquidity: oldPool.PoolLiquidity, - ScalingFactors: oldPool.ScalingFactors, - ScalingFactorController: oldPool.ScalingFactorController, - } -} diff --git a/x/gamm/migration/migrate.go b/x/gamm/migration/migrate.go deleted file mode 100644 index 337d4cae6b1..00000000000 --- a/x/gamm/migration/migrate.go +++ /dev/null @@ -1,65 +0,0 @@ -package migration - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - gammkeeper "github.com/osmosis-labs/osmosis/v15/x/gamm/keeper" - gammtypes "github.com/osmosis-labs/osmosis/v15/x/gamm/types" - oldbalancer "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer" - oldstableswap "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap" - poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" -) - -func RemoveExitFee(ctx sdk.Context, keeper gammkeeper.Keeper) error { - store := ctx.KVStore(keeper.GetStoreKey(ctx)) - cdc := keeper.GetCodec(ctx) - - iterator := sdk.KVStorePrefixIterator(store, gammtypes.KeyPrefixPools) - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - pool, err := keeper.UnmarshalPool(iterator.Value()) - if err != nil { - return sdkerrors.Wrapf(err, "unable to unmarshal pool (%v)", iterator.Key()) - } - poolKey := iterator.Key() - - switch pool.GetType() { - case poolmanagertypes.Balancer: - oldPool, ok := pool.(*oldbalancer.Pool) - if !ok { - return sdkerrors.Wrapf(err, "unable to unmarshal pool (%v) using old balancer data type", iterator.Key()) - } - if !oldPool.PoolParams.ExitFee.Equal(sdk.ZeroDec()) { - store.Delete(poolKey) - } else { - // Convert and serialize using the new type - newPool := convertToNewBalancerPool(*oldPool) - newPoolBz, err := cdc.MarshalInterface(&newPool) - if err != nil { - return sdkerrors.Wrapf(err, "unable to marshal pool (%v) using new balancer data type", iterator.Key()) - } - store.Set(poolKey, newPoolBz) - } - case poolmanagertypes.Stableswap: - oldPool, ok := pool.(*oldstableswap.Pool) - if !ok { - return sdkerrors.Wrapf(err, "unable to unmarshal pool (%v) using old stableswap data type", iterator.Key()) - } - if !oldPool.PoolParams.ExitFee.Equal(sdk.ZeroDec()) { - store.Delete(poolKey) - } else { - // Convert and serialize using the new type - newPool := convertToNewStableSwapPool(*oldPool) - newPoolBz, err := cdc.MarshalInterface(&newPool) - if err != nil { - return sdkerrors.Wrapf(err, "unable to marshal pool (%v) using new stableswap data type", iterator.Key()) - } - store.Set(poolKey, newPoolBz) - } - } - } - return nil -} diff --git a/x/gamm/module.go b/x/gamm/module.go index 64b7a229f46..044fe9e23ae 100644 --- a/x/gamm/module.go +++ b/x/gamm/module.go @@ -33,8 +33,8 @@ import ( simulation "github.com/osmosis-labs/osmosis/v15/x/gamm/simulation" "github.com/osmosis-labs/osmosis/v15/x/gamm/types" "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types" - oldbalancer "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer" - oldstableswap "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap" + // oldbalancer "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/balancer" + // oldstableswap "github.com/osmosis-labs/osmosis/v15/x/gamm/v2types/stableswap" ) var ( @@ -54,8 +54,8 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { types.RegisterLegacyAminoCodec(cdc) balancer.RegisterLegacyAminoCodec(cdc) stableswap.RegisterLegacyAminoCodec(cdc) - oldbalancer.RegisterLegacyAminoCodec(cdc) - oldstableswap.RegisterLegacyAminoCodec(cdc) + // oldbalancer.RegisterLegacyAminoCodec(cdc) + // oldstableswap.RegisterLegacyAminoCodec(cdc) } // DefaultGenesis returns default genesis state as raw bytes for the gamm @@ -96,8 +96,8 @@ func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) types.RegisterInterfaces(registry) balancer.RegisterInterfaces(registry) stableswap.RegisterInterfaces(registry) - oldbalancer.RegisterInterfaces(registry) - oldstableswap.RegisterInterfaces(registry) + // oldbalancer.RegisterInterfaces(registry) + // oldstableswap.RegisterInterfaces(registry) } type AppModule struct { From c9569716b0bd2816ebd6bcc2874b1d06430e646a Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Mon, 13 Mar 2023 15:59:59 +0700 Subject: [PATCH 16/26] testing --- app/upgrades/v15/upgrade_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index 3480c2f6abf..0cbe7bea508 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -323,8 +323,8 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { // fmt.Println(hex.EncodeToString(poolWithZeroFeeBz)) // store.Set(gammtypes.GetKeyPrefixPools(poolWithZeroFee.Id), poolWithZeroFeeBz) - testPoolBz, err := hex.DecodeString("0a1e2f6f736d6f7369732e67616d6d2e76322e62616c616e6365722e506f6f6c126710031a280a1135303030303030303030303030303030301201301a100a0c08ffc6bba0061090bce8800312002a0312013032180a100a05756f736d6f12073130303030303012043130303032170a0f0a0475696f6e1207313030303030301204313030303a0130") - store.Set(gammtypes.GetKeyPrefixPools(3), testPoolBz) + testPoolBz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12da010a3f6f736d6f31353030687937356b7273396538743530616176366661686b38737868616a6e396374703430717776766e38746370726b6b3677737a756e34613510021a260a113130303030303030303030303030303030121131303030303030303030303030303030302a240a0b67616d6d2f706f6f6c2f321215313030303030303030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321b0a0c0a03666f6f12053130303030120b37353136313932373638303a0c313832353336313130303830") + store.Set(gammtypes.GetKeyPrefixPools(2), testPoolBz) // system under test. // err = v15.RemoveExitFee(suite.Ctx, *suite.App.GAMMKeeper) @@ -340,7 +340,7 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { // suite.Require().Nil(newStableSwapWithFee) // Pool with zero exit fee should not be removed - newPoolWithZeroFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 3) + newPoolWithZeroFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 2) suite.Require().NoError(err) suite.Require().NotNil(newPoolWithZeroFee) fmt.Println("newPoolWithZeroFee", newPoolWithZeroFee) From 59d74c927ef7a208748d0160f8c9bd540b497470 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Mon, 13 Mar 2023 16:34:38 +0700 Subject: [PATCH 17/26] set up test --- app/upgrades/v15/export_test.go | 4 +- app/upgrades/v15/upgrade_test.go | 103 +++++++------------------------ app/upgrades/v15/upgrades.go | 9 ++- 3 files changed, 32 insertions(+), 84 deletions(-) diff --git a/app/upgrades/v15/export_test.go b/app/upgrades/v15/export_test.go index 1cbc04d0f48..41e6ffea718 100644 --- a/app/upgrades/v15/export_test.go +++ b/app/upgrades/v15/export_test.go @@ -35,6 +35,6 @@ func SetRateLimits(ctx sdk.Context, accountKeeper *authkeeper.AccountKeeper, rat setRateLimits(ctx, accountKeeper, rateLimitingICS4Wrapper, wasmKeeper) } -func RemoveExitFee(ctx sdk.Context, gammKeeper gammkeeper.Keeper) { - removeExitFee(ctx, gammKeeper) +func RemoveExitFee(ctx sdk.Context, gammKeeper gammkeeper.Keeper, poolsWithExitFee []uint64) { + removeExitFee(ctx, gammKeeper, poolsWithExitFee) } diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index 0cbe7bea508..fe593214c84 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -262,86 +262,31 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { store := suite.Ctx.KVStore(suite.App.GAMMKeeper.GetStoreKey(suite.Ctx)) - // Set up balancer pool with exit fee - // balancerWithFee := oldbalancer.Pool{ - // Id: 1, - // PoolParams: oldbalancer.PoolParams{ - // SwapFee: sdk.NewDecWithPrec(5, 2), - // ExitFee: sdk.NewDecWithPrec(5, 2), - // SmoothWeightChangeParams: &balancertypes.SmoothWeightChangeParams{ - // StartTime: time.Now(), - // }, - // }, - // PoolAssets: []balancertypes.PoolAsset{ - // { - // Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000)), - // Weight: sdk.NewInt(1000), - // }, - // { - // Token: sdk.NewCoin("uion", sdk.NewInt(1000000)), - // Weight: sdk.NewInt(1000), - // }, - // }, - // } - // balancerWithFeebz, err := suite.App.GAMMKeeper.MarshalPool(&balancerWithFee) - // store.Set(gammtypes.GetKeyPrefixPools(balancerWithFee.Id), balancerWithFeebz) - - // // Set up stableswap pool with exit fee - // stableswapWithFee := oldstableswap.Pool{ - // Id: 2, - // PoolParams: oldstableswap.PoolParams{ - // SwapFee: sdk.NewDecWithPrec(5, 2), - // ExitFee: sdk.NewDecWithPrec(5, 2), - // }, - // PoolLiquidity: sdk.NewCoins(sdk.NewCoin("uosmo", sdk.NewInt(1000000)), sdk.NewCoin("uion", sdk.NewInt(1000000))), - // } - // stableswapWithFeeBz, err := suite.App.GAMMKeeper.MarshalPool(&stableswapWithFee) - // store.Set(gammtypes.GetKeyPrefixPools(stableswapWithFee.Id), stableswapWithFeeBz) - - // // Set up pool with zero exit fee - // poolWithZeroFee := oldbalancer.Pool{ - // Id: 3, - // PoolParams: oldbalancer.PoolParams{ - // SwapFee: sdk.NewDecWithPrec(5, 2), - // ExitFee: sdk.ZeroDec(), - // SmoothWeightChangeParams: &balancertypes.SmoothWeightChangeParams{ - // StartTime: time.Now(), - // }, - // }, - // PoolAssets: []balancertypes.PoolAsset{ - // { - // Token: sdk.NewCoin("uosmo", sdk.NewInt(1000000)), - // Weight: sdk.NewInt(1000), - // }, - // { - // Token: sdk.NewCoin("uion", sdk.NewInt(1000000)), - // Weight: sdk.NewInt(1000), - // }, - // }, - // } - // poolWithZeroFeeBz, err := suite.App.GAMMKeeper.MarshalPool(&poolWithZeroFee) - // fmt.Println(hex.EncodeToString(poolWithZeroFeeBz)) - // store.Set(gammtypes.GetKeyPrefixPools(poolWithZeroFee.Id), poolWithZeroFeeBz) - - testPoolBz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12da010a3f6f736d6f31353030687937356b7273396538743530616176366661686b38737868616a6e396374703430717776766e38746370726b6b3677737a756e34613510021a260a113130303030303030303030303030303030121131303030303030303030303030303030302a240a0b67616d6d2f706f6f6c2f321215313030303030303030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321b0a0c0a03666f6f12053130303030120b37353136313932373638303a0c313832353336313130303830") - store.Set(gammtypes.GetKeyPrefixPools(2), testPoolBz) - // system under test. - // err = v15.RemoveExitFee(suite.Ctx, *suite.App.GAMMKeeper) - - // // Should be removed - // newBalancerPoolWithFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, balancerWithFee.Id) - // suite.Require().Error(err) - // suite.Require().Nil(newBalancerPoolWithFee) - - // // Should be removed - // newStableSwapWithFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, stableswapWithFee.Id) - // fmt.Println("newStableSwapWithFee", newStableSwapWithFee, err) - // suite.Require().Error(err) - // suite.Require().Nil(newStableSwapWithFee) + // Set up balancer pool 2 with zero exit fee + pool2Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12cb010a3f6f736d6f31353030687937356b7273396538743530616176366661686b38737868616a6e396374703430717776766e38746370726b6b3677737a756e34613510021a160a1132353030303030303030303030303030301201302a240a0b67616d6d2f706f6f6c2f321215313030303030303030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321c0a0c0a03666f6f12053130303030120c3130373337343138323430303a0c323134373438333634383030") + store.Set(gammtypes.GetKeyPrefixPools(2), pool2Bz) + + // Set up balancer pool 553 with non zero exit fee + pool553Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12de010a3f6f736d6f316d3830666e71767673643833776538676e68393938726535356a71386371326d646b6363636c716d7571773878706d36396167736d386666643610a9041a260a113235303030303030303030303030303030121132353030303030303030303030303030302a260a0d67616d6d2f706f6f6c2f3535331215313030303030303030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321c0a0c0a03666f6f12053130303030120c3130373337343138323430303a0c323134373438333634383030") + store.Set(gammtypes.GetKeyPrefixPools(553), pool553Bz) + + // Set up stableswap pool 596 with non zero exit fee + pool596Bz, err := hex.DecodeString("0a302f6f736d6f7369732e67616d6d2e706f6f6c6d6f64656c732e737461626c65737761702e763162657461312e506f6f6c12b4010a3f6f736d6f316a747a6b7a32333833636567676138707a7137617a6d377470336c63757465703935757270767571787a3378383573667077377373617170633510d4041a260a113130303030303030303030303030303030121131303030303030303030303030303030302a260a0d67616d6d2f706f6f6c2f3539361215313030303030303030303030303030303030303030320c0a0362617212053130303030320c0a03666f6f120531303030303a020101") + store.Set(gammtypes.GetKeyPrefixPools(596), pool596Bz) // Pool with zero exit fee should not be removed - newPoolWithZeroFee, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 2) + pool2, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 2) + fmt.Println("pool2", pool2, err) suite.Require().NoError(err) - suite.Require().NotNil(newPoolWithZeroFee) - fmt.Println("newPoolWithZeroFee", newPoolWithZeroFee) + suite.Require().NotNil(pool2) + fmt.Println("pool2", pool2) + + // Pool 553 & 596 should be removed + pool553, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 553) + suite.Require().Error(err) + suite.Require().Nil(pool553) + + pool596, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 596) + suite.Require().Error(err) + suite.Require().Nil(pool596) } diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index c6142673275..f616cb3e5aa 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -1,6 +1,8 @@ package v15 import ( + "fmt" + packetforwardtypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types" poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" @@ -47,7 +49,7 @@ func CreateUpgradeHandler( // Instead,it is moved to poolmanager. migrateNextPoolId(ctx, keepers.GAMMKeeper, keepers.PoolManagerKeeper) - removeExitFee(ctx, *keepers.GAMMKeeper) + removeExitFee(ctx, *keepers.GAMMKeeper, exitFeePools) // N.B.: this is done to avoid initializing genesis for gamm module. // Otherwise, it would overwrite migrations with InitGenesis(). @@ -90,6 +92,7 @@ func migrateBalancerPoolsToSolidlyStable(ctx sdk.Context, gammKeeper *gammkeeper // migrate stOSMO_OSMOPoolId, stJUNO_JUNOPoolId, stSTARS_STARSPoolId pools := []uint64{stOSMO_OSMOPoolId, stJUNO_JUNOPoolId, stSTARS_STARSPoolId} for _, poolId := range pools { + fmt.Println("poolId", poolId) migrateBalancerPoolToSolidlyStable(ctx, gammKeeper, poolmanagerKeeper, bankKeeper, poolId) } } @@ -276,8 +279,8 @@ func registerOsmoIonMetadata(ctx sdk.Context, bankKeeper bankkeeper.Keeper) { bankKeeper.SetDenomMetaData(ctx, uionMetadata) } -func removeExitFee(ctx sdk.Context, gammKeeper gammkeeper.Keeper) { - for _, poolId := range exitFeePools { +func removeExitFee(ctx sdk.Context, gammKeeper gammkeeper.Keeper, poolsWithExitFee []uint64) { + for _, poolId := range poolsWithExitFee { err := gammKeeper.DeletePool(ctx, poolId) if err != nil { panic(err) From 441196f04608fdb86c6ea06640283dde46517911 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Mon, 13 Mar 2023 19:42:13 +0700 Subject: [PATCH 18/26] testing --- app/upgrades/v15/upgrade_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index fe593214c84..687feed9ef3 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -263,8 +263,8 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { store := suite.Ctx.KVStore(suite.App.GAMMKeeper.GetStoreKey(suite.Ctx)) // Set up balancer pool 2 with zero exit fee - pool2Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12cb010a3f6f736d6f31353030687937356b7273396538743530616176366661686b38737868616a6e396374703430717776766e38746370726b6b3677737a756e34613510021a160a1132353030303030303030303030303030301201302a240a0b67616d6d2f706f6f6c2f321215313030303030303030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321c0a0c0a03666f6f12053130303030120c3130373337343138323430303a0c323134373438333634383030") - store.Set(gammtypes.GetKeyPrefixPools(2), pool2Bz) + pool2Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c128d010a3f6f736d6f316d773061633672776c70357238776170776b337a73366732396838666373637871616b647a7739656d6b6e65366338776a70397130743376387410031a160a1132353030303030303030303030303030301201302a0312013032130a0c0a03666f6f12053130303030120331303032130a0c0a036261721205313030303012033130303a0130") + store.Set(gammtypes.GetKeyPrefixPools(3), pool2Bz) // Set up balancer pool 553 with non zero exit fee pool553Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12de010a3f6f736d6f316d3830666e71767673643833776538676e68393938726535356a71386371326d646b6363636c716d7571773878706d36396167736d386666643610a9041a260a113235303030303030303030303030303030121132353030303030303030303030303030302a260a0d67616d6d2f706f6f6c2f3535331215313030303030303030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321c0a0c0a03666f6f12053130303030120c3130373337343138323430303a0c323134373438333634383030") @@ -275,7 +275,7 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { store.Set(gammtypes.GetKeyPrefixPools(596), pool596Bz) // Pool with zero exit fee should not be removed - pool2, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 2) + pool2, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 3) fmt.Println("pool2", pool2, err) suite.Require().NoError(err) suite.Require().NotNil(pool2) From 3a05a49ca73b671e8479136dd9a96700347fd72a Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Mon, 13 Mar 2023 21:23:11 +0700 Subject: [PATCH 19/26] testing --- app/upgrades/v15/upgrade_test.go | 6 +++--- x/gamm/keeper/pool.go | 2 ++ x/gamm/pool-models/balancer/pool.go | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index 687feed9ef3..3bee7b891c8 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -263,8 +263,8 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { store := suite.Ctx.KVStore(suite.App.GAMMKeeper.GetStoreKey(suite.Ctx)) // Set up balancer pool 2 with zero exit fee - pool2Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c128d010a3f6f736d6f316d773061633672776c70357238776170776b337a73366732396838666373637871616b647a7739656d6b6e65366338776a70397130743376387410031a160a1132353030303030303030303030303030301201302a0312013032130a0c0a03666f6f12053130303030120331303032130a0c0a036261721205313030303012033130303a0130") - store.Set(gammtypes.GetKeyPrefixPools(3), pool2Bz) + pool2Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12d7010a3f6f736d6f316d773061633672776c70357238776170776b337a73366732396838666373637871616b647a7739656d6b6e65366338776a70397130743376387410011a260a113130303030303030303030303030303030121131303030303030303030303030303030302a240a0b67616d6d2f706f6f6c2f311215313030303030303030303030303030303030303030321d0a0f0a096e6f6465746f6b656e12023130120a3130373337343138323432190a0b0a057374616b6512023130120a313037333734313832343a0a32313437343833363438") + store.Set(gammtypes.GetKeyPrefixPools(1), pool2Bz) // Set up balancer pool 553 with non zero exit fee pool553Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12de010a3f6f736d6f316d3830666e71767673643833776538676e68393938726535356a71386371326d646b6363636c716d7571773878706d36396167736d386666643610a9041a260a113235303030303030303030303030303030121132353030303030303030303030303030302a260a0d67616d6d2f706f6f6c2f3535331215313030303030303030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321c0a0c0a03666f6f12053130303030120c3130373337343138323430303a0c323134373438333634383030") @@ -275,7 +275,7 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { store.Set(gammtypes.GetKeyPrefixPools(596), pool596Bz) // Pool with zero exit fee should not be removed - pool2, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 3) + pool2, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 1) fmt.Println("pool2", pool2, err) suite.Require().NoError(err) suite.Require().NotNil(pool2) diff --git a/x/gamm/keeper/pool.go b/x/gamm/keeper/pool.go index 300ff6d37b0..dc108e1dbb4 100644 --- a/x/gamm/keeper/pool.go +++ b/x/gamm/keeper/pool.go @@ -46,6 +46,8 @@ func (k Keeper) GetPoolAndPoke(ctx sdk.Context, poolId uint64) (types.CFMMPoolI, return nil, err } + fmt.Println("pool", pool) + if pokePool, ok := pool.(types.WeightedPoolExtension); ok { pokePool.PokePool(ctx.BlockTime()) } diff --git a/x/gamm/pool-models/balancer/pool.go b/x/gamm/pool-models/balancer/pool.go index eadd9df2520..e7ce6a82eaa 100644 --- a/x/gamm/pool-models/balancer/pool.go +++ b/x/gamm/pool-models/balancer/pool.go @@ -396,6 +396,7 @@ func (p *Pool) updateAllWeights(newWeights []PoolAsset) { func (p *Pool) PokePool(blockTime time.Time) { // check if pool weights didn't change poolWeightsChanging := p.PoolParams.SmoothWeightChangeParams != nil + fmt.Println("p.PoolParams.SmoothWeightChangeParams", p.PoolParams.SmoothWeightChangeParams) if !poolWeightsChanging { return } From 8455809fd388231046c90f91f44871ed06d1641c Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Mon, 13 Mar 2023 23:13:49 +0700 Subject: [PATCH 20/26] test 3 pools --- app/upgrades/v15/upgrade_test.go | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index 3bee7b891c8..450540d53c2 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -263,7 +263,7 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { store := suite.Ctx.KVStore(suite.App.GAMMKeeper.GetStoreKey(suite.Ctx)) // Set up balancer pool 2 with zero exit fee - pool2Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12d7010a3f6f736d6f316d773061633672776c70357238776170776b337a73366732396838666373637871616b647a7739656d6b6e65366338776a70397130743376387410011a260a113130303030303030303030303030303030121131303030303030303030303030303030302a240a0b67616d6d2f706f6f6c2f311215313030303030303030303030303030303030303030321d0a0f0a096e6f6465746f6b656e12023130120a3130373337343138323432190a0b0a057374616b6512023130120a313037333734313832343a0a32313437343833363438") + pool2Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12c5010a3f6f736d6f316d773061633672776c70357238776170776b337a73366732396838666373637871616b647a7739656d6b6e65366338776a70397130743376387410011a160a1132353030303030303030303030303030301201302a1e0a0b67616d6d2f706f6f6c2f31120f313030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321c0a0c0a03666f6f12053130303030120c3130373337343138323430303a0c323134373438333634383030") store.Set(gammtypes.GetKeyPrefixPools(1), pool2Bz) // Set up balancer pool 553 with non zero exit fee @@ -274,19 +274,13 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { pool596Bz, err := hex.DecodeString("0a302f6f736d6f7369732e67616d6d2e706f6f6c6d6f64656c732e737461626c65737761702e763162657461312e506f6f6c12b4010a3f6f736d6f316a747a6b7a32333833636567676138707a7137617a6d377470336c63757465703935757270767571787a3378383573667077377373617170633510d4041a260a113130303030303030303030303030303030121131303030303030303030303030303030302a260a0d67616d6d2f706f6f6c2f3539361215313030303030303030303030303030303030303030320c0a0362617212053130303030320c0a03666f6f120531303030303a020101") store.Set(gammtypes.GetKeyPrefixPools(596), pool596Bz) - // Pool with zero exit fee should not be removed - pool2, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 1) - fmt.Println("pool2", pool2, err) - suite.Require().NoError(err) - suite.Require().NotNil(pool2) - fmt.Println("pool2", pool2) + v15.RemoveExitFee(suite.Ctx, *suite.App.GAMMKeeper, []uint64{553, 596}) - // Pool 553 & 596 should be removed - pool553, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 553) - suite.Require().Error(err) - suite.Require().Nil(pool553) + bz := store.Get(gammtypes.GetKeyPrefixPools(1)) + pool1, err := suite.App.GAMMKeeper.UnmarshalPool(bz) + suite.Require().NoError(err) + suite.Require().NotNil(pool1) - pool596, err := suite.App.GAMMKeeper.GetPool(suite.Ctx, 596) - suite.Require().Error(err) - suite.Require().Nil(pool596) + suite.Require().True(!store.Has(gammtypes.GetKeyPrefixPools(553))) + suite.Require().True(!store.Has(gammtypes.GetKeyPrefixPools(596))) } From 0bf6f3ff75402cb23fb44ed9980eafaa7c10bee3 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Mon, 13 Mar 2023 23:18:48 +0700 Subject: [PATCH 21/26] test passed :wq d --- app/upgrades/v15/upgrade_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index 450540d53c2..afdda52b2b3 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -263,7 +263,7 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { store := suite.Ctx.KVStore(suite.App.GAMMKeeper.GetStoreKey(suite.Ctx)) // Set up balancer pool 2 with zero exit fee - pool2Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12c5010a3f6f736d6f316d773061633672776c70357238776170776b337a73366732396838666373637871616b647a7739656d6b6e65366338776a70397130743376387410011a160a1132353030303030303030303030303030301201302a1e0a0b67616d6d2f706f6f6c2f31120f313030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321c0a0c0a03666f6f12053130303030120c3130373337343138323430303a0c323134373438333634383030") + pool2Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12db010a3f6f736d6f316d773061633672776c70357238776170776b337a73366732396838666373637871616b647a7739656d6b6e65366338776a70397130743376387410011a260a113130303030303030303030303030303030121131303030303030303030303030303030302a240a0b67616d6d2f706f6f6c2f311215313030303030303030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321c0a0c0a03666f6f12053130303030120c3130373337343138323430303a0c323134373438333634383030") store.Set(gammtypes.GetKeyPrefixPools(1), pool2Bz) // Set up balancer pool 553 with non zero exit fee From 11d4f34b2154fda98fb30ee5415c32dd1fa4e084 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Mon, 13 Mar 2023 23:22:44 +0700 Subject: [PATCH 22/26] fix proto --- go.mod | 2 +- go.work.sum | 157 +----------------- .../pool-models/balancer/balancerPool.proto | 2 +- .../pool-models/balancer/balancerPool.pb.go | 109 ++++++------ .../stableswap/stableswap_pool.pb.go | 82 ++++----- 5 files changed, 102 insertions(+), 250 deletions(-) diff --git a/go.mod b/go.mod index bc36915985a..30dc3ed6ac1 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/CosmWasm/wasmd v0.30.0 github.com/cosmos/cosmos-proto v1.0.0-alpha8 - github.com/cosmos/cosmos-sdk v0.46.10 + github.com/cosmos/cosmos-sdk v0.46.11 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/ibc-go/v4 v4.3.0 github.com/gogo/protobuf v1.3.3 diff --git a/go.work.sum b/go.work.sum index a7588dc1ba1..deda125111b 100644 --- a/go.work.sum +++ b/go.work.sum @@ -580,6 +580,7 @@ github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqO github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI= github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U= @@ -1218,6 +1219,7 @@ github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xl github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= @@ -1501,15 +1503,10 @@ github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230130075237-62557eac2673/go.mod h1:iD6Wq2g6bEIG51uohesQXUXCKadW3yqjCkIk1uPhCNE= github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230205215450-2961572f877a/go.mod h1:iD6Wq2g6bEIG51uohesQXUXCKadW3yqjCkIk1uPhCNE= -github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.0-20230201094300-e8bba2b45fd8/go.mod h1:Kh2V4fLvLM4/EagRX53CYDJnILAz9NzCCETKXoH/sno= -github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0 h1:TJIWdbX0B+kpNagQrjgq8bCMrbhiuX73M2XwgtDMoOI= -github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= -github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/otiai10/mint v1.3.1 h1:BCmzIS3n71sGfHB5NMNDB3lHYPz8fWSkCAErHed//qc= -github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/otiai10/mint v1.3.3 h1:7JgpsBaN0uMkyju4tbYHu0mnM55hNKVYLsXmwr15NQI= github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pact-foundation/pact-go v1.0.4 h1:OYkFijGHoZAYbOIb1LWXrwKQbMMRUv1oQ89blD2Mh2Q= github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= @@ -1589,8 +1586,6 @@ github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mo github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71 h1:CNooiryw5aisadVfzneSZPswRWvnVW8hF1bS/vo8ReI= github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= github.com/quasilyte/gogrep v0.0.0-20220828223005-86e4605de09f/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= -github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= -github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5 h1:CvqZS4QYHBRvx7AeFdimd16HCbLlYsvQMcKDACpJW/c= @@ -1599,8 +1594,6 @@ github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96 h1:J8J/c github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls= github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e h1:eTWZyPUnHcuGRDiryS/l2I7FfKjbU3IBx3IjqHPxuKU= github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI= -github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s= @@ -1619,9 +1612,7 @@ github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZ github.com/ryancurrah/gomodguard v1.0.4/go.mod h1:9T/Cfuxs5StfsocWr4WzDL36HqnX0fVb9d5fSEaLhoE= github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM= github.com/ryancurrah/gomodguard v1.2.4/go.mod h1:+Kem4VjWwvFpUJRJSwa16s1tBJe+vbv02+naTow2f6M= -github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= -github.com/ryanrolds/sqlclosecheck v0.4.0/go.mod h1:TBRRjzL31JONc9i4XMinicuo+s+E8yKZ5FN8X3G6CKQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= @@ -1632,9 +1623,7 @@ github.com/sagikazarmark/crypt v0.9.0 h1:fipzMFW34hFUEc4D7fsLQFtE7yElkpgyS2zrued github.com/sagikazarmark/crypt v0.9.0/go.mod h1:RnH7sEhxfdnPm1z+XMgSLjWTEIjyK4z2dw6+4vHTMuo= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da h1:p3Vo3i64TCLY7gIfzeQaUJ+kppEO5WQG3cL8iE8tGHU= github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= -github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= -github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= github.com/sashamelentyev/usestdlibvars v1.20.0/go.mod h1:0GaP+ecfZMXShS0A94CJn6aEuPRILv8h/VuWI9n1ygg= github.com/sashamelentyev/usestdlibvars v1.21.1/go.mod h1:MPI52Qq99iO9sFZZcKJ2y/bx6BNjs+/2bw3PCggIbew= github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I= @@ -1646,7 +1635,6 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUt github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646 h1:RpforrEYXWkmGwJHIGnLZ3tTWStkjVVstwzNGqxX2Ds= -github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/securego/gosec v0.0.0-20200103095621-79fbf3af8d83/go.mod h1:vvbZ2Ae7AzSq3/kywjUDxSNq2SJ27RxCz2un0H3ePqE= github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989/go.mod h1:i9l/TNj+yDFh9SZXUTvspXTjbFXgZGP/UvhU1S65A4A= github.com/securego/gosec/v2 v2.3.0/go.mod h1:UzeVyUXbxukhLeHKV3VVqo7HdoQR9MrRfFmZYotn8ME= @@ -1656,7 +1644,6 @@ github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtr github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= github.com/shirou/gopsutil v2.20.5+incompatible h1:tYH07UPoQt0OCQdgWWMgYHy3/a9bcxNpBIysykNIP7I= github.com/shirou/gopsutil/v3 v3.22.9/go.mod h1:bBYl1kjgEJpWpxeHmLI+dVHWtyAwfcmSBLDsp2TNT8A= @@ -1664,19 +1651,12 @@ github.com/shirou/gopsutil/v3 v3.23.1 h1:a9KKO+kGLKEvcPIs4W62v0nu3sciVDOOOPUD0Hz github.com/shirou/gopsutil/v3 v3.23.1/go.mod h1:NN6mnm5/0k8jw4cBfCnJtr5L7ErOTg18tMNpgFkn0hA= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041 h1:llrF3Fs4018ePo4+G/HV/uQUqEI1HMDjCeOf2V6puPc= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/sivchari/containedctx v1.0.2/go.mod h1:PwZOeqm4/DLoJOqMSIJs3aKqXRX4YO+uXww087KZ7Bw= -github.com/sivchari/nosnakecase v1.7.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= github.com/sivchari/tenv v1.7.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= -github.com/sivchari/tenv v1.7.1/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= @@ -1687,12 +1667,10 @@ github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa h1:YJfZp12Z3AFhSBeX github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= github.com/sony/gobreaker v0.4.1 h1:oMnRNZXX5j85zso6xCPRNPtmAycat+WcoKbklScLDgQ= github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE= github.com/sourcegraph/go-diff v0.5.3/go.mod h1:v9JDtjCE4HHHCZGId75rg8gkKKa98RVjBcBGsVmMmak= github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= -github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= @@ -1716,17 +1694,11 @@ github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= -github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= -github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 h1:gIlAHnH1vJb5vwEjIp5kBj/eu99p/bl0Ay2goiPe5xE= github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 h1:njlZPzLwU639dk2kqnCPPv+wNjq7Xb6EfUxe/oX0/NM= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= -github.com/strangelove-ventures/async-icq/v4 v4.0.0-rc0 h1:foE/5O2/XiqGsdTKx3R0BTfKgW9KnUYyQLZt0WFSesE= -github.com/strangelove-ventures/async-icq/v4 v4.0.0-rc0/go.mod h1:thzXHoaK1MgPDCjN7Rp9A/VcHA4cmjQpKCtVNt2O2xk= -github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4 h1:8Tn4Gy/DAq7wzV1CxEGv80ujZ+nUvzgwwdCobO/Gj8Y= -github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4/go.mod h1:AG8F5pdk3x1h7PlRvPoMem3623W+w8HJHrWYkVJ51kk= github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e h1:mOtuXaRAbVZsxAHVdPR3IjfmN8T1h2iczJLynhLybf8= @@ -1737,7 +1709,6 @@ github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= @@ -1747,23 +1718,15 @@ github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNG github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c/go.mod h1:SbErYREK7xXdsRiigaQiQkI9McGRzYMvlKYaP3Nimdk= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tdakkota/asciicheck v0.1.1/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/tm-db v0.6.6/go.mod h1:wP8d49A85B7/erz/r4YbKssKw6ylsO/hKtFk7E1aWZI= -github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= -github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= -github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tidwall/gjson v1.6.7 h1:Mb1M9HZCRWEcXQ8ieJo7auYyyiSux6w9XN3AdTpxJrE= github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE= github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU= @@ -1771,8 +1734,6 @@ github.com/tidwall/sjson v1.1.4 h1:bTSsPLdAYF5QNLSwYsKfBKKTnlGbIuhqL3CpRsjzGhg= github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= -github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= -github.com/timonwong/loggercheck v0.9.3/go.mod h1:wUqnk9yAOIKtGA39l1KLE9Iz0QiTocu/YZoOf+OzFdw= github.com/tinylib/msgp v1.1.5 h1:2gXmtWueD2HefZHQe1QOy9HVzmFrLOVvsXwXBQ0ayy0= github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0= github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0= @@ -1789,11 +1750,9 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tomarrell/wrapcheck/v2 v2.7.0/go.mod h1:ao7l5p0aOlUNJKI0qVwB4Yjlqutd0IvAB9Rdwyilxvg= -github.com/tomarrell/wrapcheck/v2 v2.8.0/go.mod h1:ao7l5p0aOlUNJKI0qVwB4Yjlqutd0IvAB9Rdwyilxvg= github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4= github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= -github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo= github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274/go.mod h1:oPAfvw32vlUJSjyDcQ3Bu0nb2ON2B+G0dtVN/SZNJiA= github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg= @@ -1810,15 +1769,12 @@ github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGr github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= -github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM= -github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= @@ -1835,12 +1791,10 @@ github.com/vektra/mockery/v2 v2.14.0/go.mod h1:bnD1T8tExSgPD1ripLkDbr60JA9VtQeu1 github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0= -github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df h1:OviZH7qLw/7ZovXvuNyL3XQl8UFofeikI1NW1Gypu7k= -github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/vmihailenco/msgpack/v5 v5.1.4 h1:6K44/cU6dMNGkVTGGuu7ef2NdSRFMhAFGGLfE3cqtHM= @@ -1851,40 +1805,24 @@ github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 h1:1cngl9mPEoITZG8s8cVcUy5CeIBYhEESkOB7m6Gmkrk= github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= github.com/xanzy/go-gitlab v0.32.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= -github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= github.com/ybbus/jsonrpc v2.1.2+incompatible h1:V4mkE9qhbDQ92/MLMIhlhMSbz8jNXdagC3xBR5NDwaQ= -github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -github.com/zimmski/go-mutesting v0.0.0-20210610104036-6d9217011a00/go.mod h1:RJt5SMnyha63GbdwCKJiX9djvvEC4KsfXJSZ5oTmSPw= -github.com/zimmski/go-tool v0.0.0-20150119110811-2dfdc9ac8439/go.mod h1:G4FVqCRvfz74AEB1crDNdQuvMfOoKtk7DlePsnV2yGs= -github.com/zimmski/osutil v0.0.0-20190128123334-0d0b3ca231ac/go.mod h1:wJ9WGevuM/rw8aB2pQPFMUgXZWeaouI0ueFamR0DUPE= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= @@ -1967,23 +1905,17 @@ go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg go.opentelemetry.io/proto/otlp v0.12.0/go.mod h1:TsIjwGWIx5VFYv9KGVlOpxoBl5Dy+63SUguV7GGvlSQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI= golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4= @@ -2009,22 +1941,20 @@ golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5 golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20221002003631-540bb7301a08/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= @@ -2042,13 +1972,7 @@ golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20200801112145-973feb4309de h1:OVJ6QQUBAesB8CZijKDSsXX7xYVtUhrkY0gwMfbi4p4= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2065,7 +1989,6 @@ golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -2076,7 +1999,6 @@ golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -2088,16 +2010,11 @@ golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220726230323-06994584191e/go.mod h1:AaygXjzTFtRAg2ttMY5RMuhpJ3cNnI0XpyFJD1iQRSM= golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221017152216-f25eb7ecb193/go.mod h1:RpDiru2p0u2F0lLpEoqnP2+7xs0ifAuOcJ442g6GU2s= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -2121,13 +2038,10 @@ golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 h1:nt+Q6cXKz4MosCSpnbMtqi golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2136,7 +2050,6 @@ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2148,7 +2061,6 @@ golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2173,28 +2085,20 @@ golang.org/x/sys v0.0.0-20210313202042-bd2e13477e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211031064116-611d5d643895/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2211,14 +2115,10 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220727055044-e65921a090b8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2227,26 +2127,15 @@ golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220919170432-7a66f970e087/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2254,85 +2143,54 @@ golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190228203856-589c23e65e65/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= -golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190916130336-e45ffcd953cc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191018212557-ed542cd5b28a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204192400-7124308813f3/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200622203043-20e05c1c8ffa/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200630154851-b2d8b0336632/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200706234117-b22de6825cf7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201002184944-ecd9fd270d5d/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201028025901-8cd080b735b3/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201230224404-63754364767c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= -golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.9-0.20211228192929-ee1ca4ffc4da/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12-0.20220628192153-7743d1d949f1/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= -golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= -golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.4.1-0.20221208213631-3f74d914ae6d/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= -golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= @@ -2490,7 +2348,6 @@ google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnp google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= @@ -2524,8 +2381,6 @@ gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/yaml.v2 v2.2.6/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= @@ -2615,13 +2470,9 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= -mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw= mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc= mvdan.cc/unparam v0.0.0-20220706161116-678bad134442/go.mod h1:F/Cxw/6mVrNKqrR2YjFf5CaW0Bw4RL8RfbEf4GRggJk= -mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d/go.mod h1:IeHQjmn6TOD+e4Z3RFiZMMsLVL+A96Nvptar8Fj71is= pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= diff --git a/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto b/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto index 18da0025b9a..2c3334987e6 100644 --- a/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto +++ b/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto @@ -80,7 +80,7 @@ message PoolParams { (gogoproto.nullable) = false ]; reserved 2; - SmoothWeightChangeParams smooth_weight_change_params = 2 [ + SmoothWeightChangeParams smooth_weight_change_params = 3 [ (gogoproto.moretags) = "yaml:\"smooth_weight_change_params\"", (gogoproto.nullable) = true ]; diff --git a/x/gamm/pool-models/balancer/balancerPool.pb.go b/x/gamm/pool-models/balancer/balancerPool.pb.go index c59e9b0d693..40972856ef7 100644 --- a/x/gamm/pool-models/balancer/balancerPool.pb.go +++ b/x/gamm/pool-models/balancer/balancerPool.pb.go @@ -135,7 +135,7 @@ func (m *SmoothWeightChangeParams) GetTargetPoolWeights() []PoolAsset { // The pool's token holders are specified in future_pool_governor. type PoolParams struct { SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee" yaml:"swap_fee"` - SmoothWeightChangeParams *SmoothWeightChangeParams `protobuf:"bytes,2,opt,name=smooth_weight_change_params,json=smoothWeightChangeParams,proto3" json:"smooth_weight_change_params,omitempty" yaml:"smooth_weight_change_params"` + SmoothWeightChangeParams *SmoothWeightChangeParams `protobuf:"bytes,3,opt,name=smooth_weight_change_params,json=smoothWeightChangeParams,proto3" json:"smooth_weight_change_params,omitempty" yaml:"smooth_weight_change_params"` } func (m *PoolParams) Reset() { *m = PoolParams{} } @@ -297,58 +297,59 @@ func init() { } var fileDescriptor_7e991f749f68c2a4 = []byte{ - // 815 bytes of a gzipped FileDescriptorProto + // 822 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0x93, 0xb4, 0xdd, 0x4c, 0x96, 0x45, 0x9d, 0xcd, 0xc1, 0x4d, 0x45, 0x5c, 0x0d, 0x12, - 0x5a, 0xa1, 0x8d, 0xad, 0x2c, 0x70, 0xd9, 0xcb, 0x6a, 0xbd, 0x5b, 0x50, 0x6f, 0xc5, 0x45, 0x2a, - 0x45, 0x95, 0xac, 0x49, 0x32, 0xb1, 0xad, 0xda, 0x1e, 0xcb, 0x33, 0x49, 0xe9, 0x3f, 0x80, 0x38, - 0xf6, 0x58, 0x6e, 0xbd, 0x73, 0x85, 0xff, 0xa1, 0x82, 0x4b, 0x8f, 0x88, 0x83, 0x41, 0xed, 0x8d, - 0x63, 0xfe, 0x02, 0x34, 0x3f, 0x9c, 0xa4, 0x25, 0x11, 0xed, 0x29, 0x9e, 0x37, 0xef, 0x7d, 0xdf, - 0xf7, 0xde, 0xfb, 0xec, 0x80, 0xcf, 0x29, 0x4b, 0x28, 0x8b, 0x98, 0x13, 0xe0, 0x24, 0x71, 0x32, - 0x4a, 0xe3, 0x6e, 0x42, 0x87, 0x24, 0x66, 0x4e, 0x1f, 0xc7, 0x38, 0x1d, 0x90, 0x7c, 0xf6, 0xb0, - 0x4f, 0x69, 0x6c, 0x67, 0x39, 0xe5, 0x14, 0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, 0x3c, 0x38, 0x93, 0xde, 0xe7, 0xce, 0xf7, 0xab, + 0xff, 0xf8, 0xfa, 0xeb, 0xf2, 0x63, 0xfc, 0xe9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x42, 0xab, + 0xf4, 0x7d, 0x24, 0x07, 0x00, 0x00, } func (m *SmoothWeightChangeParams) Marshal() (dAtA []byte, err error) { @@ -448,7 +449,7 @@ func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBalancerPool(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } { size := m.SwapFee.Size() @@ -941,7 +942,7 @@ func (m *PoolParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SmoothWeightChangeParams", wireType) } diff --git a/x/gamm/pool-models/stableswap/stableswap_pool.pb.go b/x/gamm/pool-models/stableswap/stableswap_pool.pb.go index 231db43f019..d147c4da7d5 100644 --- a/x/gamm/pool-models/stableswap/stableswap_pool.pb.go +++ b/x/gamm/pool-models/stableswap/stableswap_pool.pb.go @@ -135,47 +135,47 @@ func init() { } var fileDescriptor_ae0f054436f9999a = []byte{ - // 625 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd4, 0x3c, - 0x14, 0x9d, 0xb4, 0xd3, 0x9f, 0xcf, 0xfd, 0x98, 0x8a, 0x50, 0x89, 0xb4, 0x15, 0xf1, 0x10, 0x51, - 0x34, 0x42, 0x4c, 0x42, 0x41, 0x20, 0xd1, 0x5d, 0xa7, 0xa8, 0x08, 0x09, 0xa1, 0x12, 0x56, 0xfc, - 0x48, 0x83, 0x93, 0x78, 0x52, 0x83, 0x33, 0x0e, 0xb6, 0x53, 0xe8, 0x86, 0x35, 0x4b, 0x96, 0x2c, - 0xbb, 0x86, 0x2d, 0x0f, 0x51, 0xb1, 0xea, 0x12, 0xb1, 0x08, 0xa8, 0x7d, 0x83, 0x79, 0x02, 0x64, - 0xc7, 0xd3, 0x9f, 0x01, 0xaa, 0xae, 0xc6, 0xf7, 0xde, 0x73, 0xcf, 0x39, 0xd7, 0xd7, 0x13, 0x70, - 0x97, 0x89, 0x8c, 0x09, 0x22, 0x82, 0x14, 0x65, 0x59, 0x90, 0x33, 0x46, 0xdb, 0x19, 0x4b, 0x30, - 0x15, 0x81, 0x90, 0x28, 0xa2, 0x58, 0xbc, 0x45, 0xf9, 0xb1, 0x63, 0x57, 0x21, 0xfc, 0x9c, 0x33, - 0xc9, 0xec, 0x6b, 0xa6, 0xd5, 0x57, 0xad, 0xbe, 0x2a, 0x54, 0x9d, 0xfe, 0x11, 0xdc, 0xdf, 0x5a, - 0x8e, 0xb0, 0x44, 0xcb, 0x0b, 0xf3, 0xb1, 0x06, 0x77, 0x75, 0x67, 0x50, 0x05, 0x15, 0xcd, 0xc2, - 0x5c, 0xca, 0x52, 0x56, 0xe5, 0xd5, 0xc9, 0x64, 0xdd, 0x94, 0xb1, 0x94, 0xe2, 0x40, 0x47, 0x51, - 0xd1, 0x0b, 0x92, 0x82, 0x23, 0x49, 0x58, 0xdf, 0xd4, 0xe1, 0x68, 0x5d, 0x92, 0x0c, 0x0b, 0x89, - 0xb2, 0x7c, 0x48, 0x50, 0x89, 0x04, 0xa8, 0x90, 0x9b, 0x81, 0xb1, 0xa1, 0x83, 0x91, 0x7a, 0x84, - 0x04, 0x3e, 0xac, 0xc7, 0x8c, 0x18, 0x01, 0xef, 0x15, 0x00, 0x1b, 0x8c, 0xd1, 0x0d, 0xc4, 0x51, - 0x26, 0xec, 0x17, 0x60, 0x5a, 0x8f, 0xdf, 0xc3, 0xd8, 0xb1, 0x9a, 0x56, 0xeb, 0xbf, 0xce, 0xea, - 0x6e, 0x09, 0x6b, 0x3f, 0x4a, 0x78, 0x35, 0x25, 0x72, 0xb3, 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 0xff, 0xff, 0xe6, 0xf5, 0x01, 0x3e, 0x98, 0x04, 0x00, - 0x00, + // 629 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0x8d, 0x93, 0xf4, 0x83, 0x2d, 0xa4, 0x60, 0x2a, 0xe1, 0xb6, 0xc2, 0x1b, 0x2c, 0x8a, 0x22, + 0x44, 0x6c, 0x0a, 0x02, 0x89, 0xde, 0x9a, 0xa2, 0x22, 0x10, 0x42, 0xc5, 0x9c, 0xf8, 0x90, 0xc2, + 0xda, 0xde, 0xb8, 0x16, 0xeb, 0xac, 0xd9, 0x5d, 0x17, 0x7a, 0xe1, 0xcc, 0x91, 0x23, 0xc7, 0x9e, + 0xe1, 0xca, 0x8f, 0xa8, 0x38, 0xf5, 0x88, 0x38, 0x18, 0xd4, 0xfe, 0x03, 0xff, 0x02, 0xb4, 0xeb, + 0x4d, 0xbf, 0x80, 0xaa, 0xa7, 0xec, 0xcc, 0xbc, 0x79, 0xef, 0xcd, 0xce, 0xc6, 0xe0, 0x1e, 0xe5, + 0x29, 0xe5, 0x09, 0xf7, 0x62, 0x94, 0xa6, 0x5e, 0x46, 0x29, 0xe9, 0xa6, 0x34, 0xc2, 0x84, 0x7b, + 0x5c, 0xa0, 0x80, 0x60, 0xfe, 0x0e, 0x65, 0x87, 0x8e, 0x7d, 0x89, 0x70, 0x33, 0x46, 0x05, 0x35, + 0xaf, 0xeb, 0x56, 0x57, 0xb6, 0xba, 0xb2, 0x50, 0x75, 0xba, 0x07, 0x70, 0x77, 0x63, 0x31, 0xc0, + 0x02, 0x2d, 0xce, 0xcd, 0x86, 0x0a, 0xdc, 0x57, 0x9d, 0x5e, 0x15, 0x54, 0x34, 0x73, 0x33, 0x31, + 0x8d, 0x69, 0x95, 0x97, 0x27, 0x9d, 0xb5, 0x63, 0x4a, 0x63, 0x82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x6a, 0x59, 0xc0, 0xb6, 0x66, 0xfe, 0x1f, 0xd4, 0xf1, 0x2f, 0x1d, + 0x21, 0x5e, 0xd9, 0xaf, 0x2c, 0x5d, 0xf8, 0xb8, 0x05, 0x6b, 0x9f, 0xb7, 0x60, 0xed, 0xfb, 0xb7, + 0xee, 0x98, 0x5c, 0xcd, 0xc3, 0xde, 0xcb, 0xed, 0x5d, 0xdb, 0xd8, 0xd9, 0xb5, 0x8d, 0xdf, 0xbb, + 0xb6, 0xf1, 0x69, 0xcf, 0xae, 0xed, 0xec, 0xd9, 0xb5, 0x1f, 0x7b, 0x76, 0xed, 0xc5, 0xf2, 0xa1, + 0x7b, 0xd1, 0xaf, 0xae, 0x4b, 0x50, 0xc0, 0x47, 0x81, 0xb7, 0xb1, 0x78, 0xc7, 0x7b, 0x7f, 0xd2, + 0x07, 0x27, 0x18, 0x57, 0xff, 0xc1, 0xdb, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xeb, 0x63, 0xdf, + 0xd9, 0x9e, 0x04, 0x00, 0x00, } func (m *PoolParams) Marshal() (dAtA []byte, err error) { From a15654a06c9fff1bf208098ab5077a6ae37d8a92 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Tue, 21 Mar 2023 12:18:56 +0700 Subject: [PATCH 23/26] format --- app/upgrades/v15/upgrade_test.go | 2 +- app/upgrades/v15/upgrades.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index a93b61c919b..9938bec9d4d 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -265,7 +265,7 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { // Set up balancer pool 2 with zero exit fee pool2Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12db010a3f6f736d6f316d773061633672776c70357238776170776b337a73366732396838666373637871616b647a7739656d6b6e65366338776a70397130743376387410011a260a113130303030303030303030303030303030121131303030303030303030303030303030302a240a0b67616d6d2f706f6f6c2f311215313030303030303030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321c0a0c0a03666f6f12053130303030120c3130373337343138323430303a0c323134373438333634383030") store.Set(gammtypes.GetKeyPrefixPools(1), pool2Bz) - + // Set up balancer pool 553 with non zero exit fee pool553Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12de010a3f6f736d6f316d3830666e71767673643833776538676e68393938726535356a71386371326d646b6363636c716d7571773878706d36396167736d386666643610a9041a260a113235303030303030303030303030303030121132353030303030303030303030303030302a260a0d67616d6d2f706f6f6c2f3535331215313030303030303030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321c0a0c0a03666f6f12053130303030120c3130373337343138323430303a0c323134373438333634383030") store.Set(gammtypes.GetKeyPrefixPools(553), pool553Bz) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index bdd4f4cfab6..a2607df6db7 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -50,7 +50,7 @@ func CreateUpgradeHandler( migrateNextPoolId(ctx, keepers.GAMMKeeper, keepers.PoolManagerKeeper) removeExitFee(ctx, *keepers.GAMMKeeper, exitFeePools) - + // N.B.: this is done to avoid initializing genesis for gamm module. // Otherwise, it would overwrite migrations with InitGenesis(). // See RunMigrations() for details. From b040201771fd0c0fa489fa919de70f20a7fea68b Mon Sep 17 00:00:00 2001 From: hieuvubk Date: Tue, 21 Mar 2023 06:49:29 +0000 Subject: [PATCH 24/26] Update go.mod --- go.mod | 8 ++++---- go.sum | 18 ++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 71dd96cc67d..ebf07b3459d 100644 --- a/go.mod +++ b/go.mod @@ -19,10 +19,10 @@ require ( github.com/mattn/go-sqlite3 v1.14.16 github.com/ory/dockertest/v3 v3.9.1 github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 - github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230316203321-2edd49875f80 - github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230317232332-81bd3c5ef0c2 - github.com/osmosis-labs/osmosis/x/epochs v0.0.0-20230313084619-8d291c1d9813 - github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.0-20230316203321-2edd49875f80 + github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230321051856-a15654a06c9f + github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230321051856-a15654a06c9f + github.com/osmosis-labs/osmosis/x/epochs v0.0.0-20230321051856-a15654a06c9f + github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.0-20230321051856-a15654a06c9f github.com/pkg/errors v0.9.1 github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.5.0 diff --git a/go.sum b/go.sum index 95aae516ef5..5a88c5f66df 100644 --- a/go.sum +++ b/go.sum @@ -933,16 +933,14 @@ github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230313061712-4f857c6a941a h1:ycdL github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20230313061712-4f857c6a941a/go.mod h1:rud0OaBIuq3+qOqtwT4SR7Q7iSzRp7w41fjninTjfnQ= github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 h1:YlmchqTmlwdWSmrRmXKR+PcU96ntOd8u10vTaTZdcNY= github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3/go.mod h1:lV6KnqXYD/ayTe7310MHtM3I2q8Z6bBfMAi+bhwPYtI= -github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230316203321-2edd49875f80 h1:MqSb3Q5Uqb2r3PcyijgFL0lcIe57PqncqyfkRtyyn6E= -github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230316203321-2edd49875f80/go.mod h1:PT796t7vS3STUWYikgwzY9e7jhLo0N/hwZf4R6haj0o= -github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230316203321-2edd49875f80 h1:p/+OkuP3fvSK6UvUxeaX6JirBMhs2yveDmT9Vi80Je0= -github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230316203321-2edd49875f80/go.mod h1:spcwVLt51T9NAUpFb+W0UKO7e9mwF5K/hc3nTrmGoP4= -github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230317232332-81bd3c5ef0c2 h1:syLNakfGKE9SjReHzcE8B0vWaykxKeno10uOyHi+0aI= -github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230317232332-81bd3c5ef0c2/go.mod h1:spcwVLt51T9NAUpFb+W0UKO7e9mwF5K/hc3nTrmGoP4= -github.com/osmosis-labs/osmosis/x/epochs v0.0.0-20230313084619-8d291c1d9813 h1:OVT8hqFET8DkAeiSUs5h2nTg1uZFU6kPRP2sDWzVm/o= -github.com/osmosis-labs/osmosis/x/epochs v0.0.0-20230313084619-8d291c1d9813/go.mod h1:lJebPe8cmSTwXXuWmgSNc1S4Bobz9g3x05ZL4igbAAI= -github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.0-20230316203321-2edd49875f80 h1:8gZdQsLkU0XOJ43xlzr1ig9fTVqgdZcoGbLL0ZnUzZs= -github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.0-20230316203321-2edd49875f80/go.mod h1:M8MLeBNbbG6qB5/2B5RUPTvqhsNaG0XagqdQfk/lVfY= +github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230321051856-a15654a06c9f h1:DD7hL/KEy0pg/2y+dVdi54MI/zULp9SJYL/FyyD9hyw= +github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230321051856-a15654a06c9f/go.mod h1:PT796t7vS3STUWYikgwzY9e7jhLo0N/hwZf4R6haj0o= +github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230321051856-a15654a06c9f h1:5/xxQ05neDMbdwZtpzs+u29wNlprQ7PHoquFSlxGsww= +github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230321051856-a15654a06c9f/go.mod h1:spcwVLt51T9NAUpFb+W0UKO7e9mwF5K/hc3nTrmGoP4= +github.com/osmosis-labs/osmosis/x/epochs v0.0.0-20230321051856-a15654a06c9f h1:5QL4c8+zZyaf/P7tGXJ+q5AwsjW9d73cW9+eeMXcV6U= +github.com/osmosis-labs/osmosis/x/epochs v0.0.0-20230321051856-a15654a06c9f/go.mod h1:lJebPe8cmSTwXXuWmgSNc1S4Bobz9g3x05ZL4igbAAI= +github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.0-20230321051856-a15654a06c9f h1:KhTDnk6xiGL/36Kbgn85cTnlX300R4QE00zqj2JwicU= +github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.0-20230321051856-a15654a06c9f/go.mod h1:M8MLeBNbbG6qB5/2B5RUPTvqhsNaG0XagqdQfk/lVfY= github.com/osmosis-labs/wasmd v0.30.0-osmo-v15 h1:vjbzq9ta/KmQwUM6PcRmrBJuDwILgLbV4POypC1Uhn8= github.com/osmosis-labs/wasmd v0.30.0-osmo-v15/go.mod h1:5fDYJyMXBq6u2iuHqqOTYiZ5NitIOeIW5k7qEXqbwJE= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= From 456f19f30dedae4c186d83b06b93dd845320d129 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Mon, 27 Mar 2023 15:21:54 +0700 Subject: [PATCH 25/26] remove all exitfee --- tests/e2e/initialization/config.go | 2 +- tests/mocks/cfmm_pool.go | 48 +- wasmbinding/query_plugin_test.go | 2 +- x/gamm/keeper/grpc_query.go | 2 +- x/gamm/keeper/grpc_query_test.go | 3 +- x/gamm/keeper/migrate_test.go | 2 +- x/gamm/keeper/pool.go | 3 - x/gamm/keeper/pool_service.go | 2 +- x/gamm/pool-models/balancer/amm.go | 8 +- x/gamm/pool-models/balancer/pool.go | 10 +- x/gamm/pool-models/balancer/pool_params.go | 2 +- .../pool-models/balancer/pool_suite_test.go | 11 +- x/gamm/pool-models/balancer/pool_test.go | 7 +- x/gamm/pool-models/balancer/util_test.go | 4 +- x/gamm/pool-models/internal/cfmm_common/lp.go | 15 +- .../internal/cfmm_common/lp_test.go | 2 +- x/gamm/pool-models/stableswap/amm_test.go | 7 +- x/gamm/pool-models/stableswap/pool.go | 8 +- x/gamm/pool-models/stableswap/pool_test.go | 4 +- x/gamm/pool-models/stableswap/util_test.go | 2 +- x/gamm/simulation/sim_msgs.go | 6 +- x/gamm/types/errors.go | 2 - x/gamm/types/pool.go | 4 +- x/gamm/v2types/balancer/balancerPool.pb.go | 908 ----------------- x/gamm/v2types/balancer/codec.go | 50 - x/gamm/v2types/balancer/pool.go | 96 -- x/gamm/v2types/stableswap/codec.go | 50 - x/gamm/v2types/stableswap/pool.go | 96 -- .../v2types/stableswap/stableswap_pool.pb.go | 940 ------------------ x/poolmanager/create_pool_test.go | 2 +- x/protorev/keeper/keeper_test.go | 4 +- 31 files changed, 69 insertions(+), 2233 deletions(-) delete mode 100644 x/gamm/v2types/balancer/balancerPool.pb.go delete mode 100644 x/gamm/v2types/balancer/codec.go delete mode 100644 x/gamm/v2types/balancer/pool.go delete mode 100644 x/gamm/v2types/stableswap/codec.go delete mode 100644 x/gamm/v2types/stableswap/pool.go delete mode 100644 x/gamm/v2types/stableswap/stableswap_pool.pb.go diff --git a/tests/e2e/initialization/config.go b/tests/e2e/initialization/config.go index 062c4d20871..b727b841933 100644 --- a/tests/e2e/initialization/config.go +++ b/tests/e2e/initialization/config.go @@ -584,7 +584,7 @@ func setDenomMetadata(genState *banktypes.GenesisState, denom string) { // sets up a pool with 1% fee, equal weights, and given denoms with supply of 100000000000, // and a given pool id. func setupPool(poolId uint64, denomA, denomB string) *types1.Any { - feePoolParams := balancer.NewPoolParams(sdk.MustNewDecFromStr("0.01"), sdk.ZeroDec(), nil) + feePoolParams := balancer.NewPoolParams(sdk.MustNewDecFromStr("0.01"), nil) feePoolAssets := []balancer.PoolAsset{ { Weight: sdk.NewInt(100), diff --git a/tests/mocks/cfmm_pool.go b/tests/mocks/cfmm_pool.go index bc0712a3141..3a3eb155bd4 100644 --- a/tests/mocks/cfmm_pool.go +++ b/tests/mocks/cfmm_pool.go @@ -37,18 +37,18 @@ func (m *MockCFMMPoolI) EXPECT() *MockCFMMPoolIMockRecorder { } // CalcExitPoolCoinsFromShares mocks base method. -func (m *MockCFMMPoolI) CalcExitPoolCoinsFromShares(ctx types.Context, numShares types.Int, exitFee types.Dec) (types.Coins, error) { +func (m *MockCFMMPoolI) CalcExitPoolCoinsFromShares(ctx types.Context, numShares types.Int) (types.Coins, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CalcExitPoolCoinsFromShares", ctx, numShares, exitFee) + ret := m.ctrl.Call(m, "CalcExitPoolCoinsFromShares", ctx, numShares) ret0, _ := ret[0].(types.Coins) ret1, _ := ret[1].(error) return ret0, ret1 } // CalcExitPoolCoinsFromShares indicates an expected call of CalcExitPoolCoinsFromShares. -func (mr *MockCFMMPoolIMockRecorder) CalcExitPoolCoinsFromShares(ctx, numShares, exitFee interface{}) *gomock.Call { +func (mr *MockCFMMPoolIMockRecorder) CalcExitPoolCoinsFromShares(ctx, numShares interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalcExitPoolCoinsFromShares", reflect.TypeOf((*MockCFMMPoolI)(nil).CalcExitPoolCoinsFromShares), ctx, numShares, exitFee) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalcExitPoolCoinsFromShares", reflect.TypeOf((*MockCFMMPoolI)(nil).CalcExitPoolCoinsFromShares), ctx, numShares) } // CalcInAmtGivenOut mocks base method. @@ -114,18 +114,18 @@ func (mr *MockCFMMPoolIMockRecorder) CalcOutAmtGivenIn(ctx, tokenIn, tokenOutDen } // ExitPool mocks base method. -func (m *MockCFMMPoolI) ExitPool(ctx types.Context, numShares types.Int, exitFee types.Dec) (types.Coins, error) { +func (m *MockCFMMPoolI) ExitPool(ctx types.Context, numShares types.Int) (types.Coins, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ExitPool", ctx, numShares, exitFee) + ret := m.ctrl.Call(m, "ExitPool", ctx, numShares) ret0, _ := ret[0].(types.Coins) ret1, _ := ret[1].(error) return ret0, ret1 } // ExitPool indicates an expected call of ExitPool. -func (mr *MockCFMMPoolIMockRecorder) ExitPool(ctx, numShares, exitFee interface{}) *gomock.Call { +func (mr *MockCFMMPoolIMockRecorder) ExitPool(ctx, numShares interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExitPool", reflect.TypeOf((*MockCFMMPoolI)(nil).ExitPool), ctx, numShares, exitFee) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExitPool", reflect.TypeOf((*MockCFMMPoolI)(nil).ExitPool), ctx, numShares) } // GetAddress mocks base method. @@ -363,18 +363,18 @@ func (m *MockPoolAmountOutExtension) EXPECT() *MockPoolAmountOutExtensionMockRec } // CalcExitPoolCoinsFromShares mocks base method. -func (m *MockPoolAmountOutExtension) CalcExitPoolCoinsFromShares(ctx types.Context, numShares types.Int, exitFee types.Dec) (types.Coins, error) { +func (m *MockPoolAmountOutExtension) CalcExitPoolCoinsFromShares(ctx types.Context, numShares types.Int) (types.Coins, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CalcExitPoolCoinsFromShares", ctx, numShares, exitFee) + ret := m.ctrl.Call(m, "CalcExitPoolCoinsFromShares", ctx, numShares) ret0, _ := ret[0].(types.Coins) ret1, _ := ret[1].(error) return ret0, ret1 } // CalcExitPoolCoinsFromShares indicates an expected call of CalcExitPoolCoinsFromShares. -func (mr *MockPoolAmountOutExtensionMockRecorder) CalcExitPoolCoinsFromShares(ctx, numShares, exitFee interface{}) *gomock.Call { +func (mr *MockPoolAmountOutExtensionMockRecorder) CalcExitPoolCoinsFromShares(ctx, numShares interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalcExitPoolCoinsFromShares", reflect.TypeOf((*MockPoolAmountOutExtension)(nil).CalcExitPoolCoinsFromShares), ctx, numShares, exitFee) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalcExitPoolCoinsFromShares", reflect.TypeOf((*MockPoolAmountOutExtension)(nil).CalcExitPoolCoinsFromShares), ctx, numShares) } // CalcInAmtGivenOut mocks base method. @@ -455,18 +455,18 @@ func (mr *MockPoolAmountOutExtensionMockRecorder) CalcTokenInShareAmountOut(ctx, } // ExitPool mocks base method. -func (m *MockPoolAmountOutExtension) ExitPool(ctx types.Context, numShares types.Int, exitFee types.Dec) (types.Coins, error) { +func (m *MockPoolAmountOutExtension) ExitPool(ctx types.Context, numShares types.Int) (types.Coins, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ExitPool", ctx, numShares, exitFee) + ret := m.ctrl.Call(m, "ExitPool", ctx, numShares) ret0, _ := ret[0].(types.Coins) ret1, _ := ret[1].(error) return ret0, ret1 } // ExitPool indicates an expected call of ExitPool. -func (mr *MockPoolAmountOutExtensionMockRecorder) ExitPool(ctx, numShares, exitFee interface{}) *gomock.Call { +func (mr *MockPoolAmountOutExtensionMockRecorder) ExitPool(ctx, numShares interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExitPool", reflect.TypeOf((*MockPoolAmountOutExtension)(nil).ExitPool), ctx, numShares, exitFee) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExitPool", reflect.TypeOf((*MockPoolAmountOutExtension)(nil).ExitPool), ctx, numShares) } // ExitSwapExactAmountOut mocks base method. @@ -746,18 +746,18 @@ func (m *MockWeightedPoolExtension) EXPECT() *MockWeightedPoolExtensionMockRecor } // CalcExitPoolCoinsFromShares mocks base method. -func (m *MockWeightedPoolExtension) CalcExitPoolCoinsFromShares(ctx types.Context, numShares types.Int, exitFee types.Dec) (types.Coins, error) { +func (m *MockWeightedPoolExtension) CalcExitPoolCoinsFromShares(ctx types.Context, numShares types.Int) (types.Coins, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CalcExitPoolCoinsFromShares", ctx, numShares, exitFee) + ret := m.ctrl.Call(m, "CalcExitPoolCoinsFromShares", ctx, numShares) ret0, _ := ret[0].(types.Coins) ret1, _ := ret[1].(error) return ret0, ret1 } // CalcExitPoolCoinsFromShares indicates an expected call of CalcExitPoolCoinsFromShares. -func (mr *MockWeightedPoolExtensionMockRecorder) CalcExitPoolCoinsFromShares(ctx, numShares, exitFee interface{}) *gomock.Call { +func (mr *MockWeightedPoolExtensionMockRecorder) CalcExitPoolCoinsFromShares(ctx, numShares interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalcExitPoolCoinsFromShares", reflect.TypeOf((*MockWeightedPoolExtension)(nil).CalcExitPoolCoinsFromShares), ctx, numShares, exitFee) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalcExitPoolCoinsFromShares", reflect.TypeOf((*MockWeightedPoolExtension)(nil).CalcExitPoolCoinsFromShares), ctx, numShares) } // CalcInAmtGivenOut mocks base method. @@ -823,18 +823,18 @@ func (mr *MockWeightedPoolExtensionMockRecorder) CalcOutAmtGivenIn(ctx, tokenIn, } // ExitPool mocks base method. -func (m *MockWeightedPoolExtension) ExitPool(ctx types.Context, numShares types.Int, exitFee types.Dec) (types.Coins, error) { +func (m *MockWeightedPoolExtension) ExitPool(ctx types.Context, numShares types.Int) (types.Coins, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ExitPool", ctx, numShares, exitFee) + ret := m.ctrl.Call(m, "ExitPool", ctx, numShares) ret0, _ := ret[0].(types.Coins) ret1, _ := ret[1].(error) return ret0, ret1 } // ExitPool indicates an expected call of ExitPool. -func (mr *MockWeightedPoolExtensionMockRecorder) ExitPool(ctx, numShares, exitFee interface{}) *gomock.Call { +func (mr *MockWeightedPoolExtensionMockRecorder) ExitPool(ctx, numShares interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExitPool", reflect.TypeOf((*MockWeightedPoolExtension)(nil).ExitPool), ctx, numShares, exitFee) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExitPool", reflect.TypeOf((*MockWeightedPoolExtension)(nil).ExitPool), ctx, numShares) } // GetAddress mocks base method. diff --git a/wasmbinding/query_plugin_test.go b/wasmbinding/query_plugin_test.go index ef92ed21918..ffdb95a9e4a 100644 --- a/wasmbinding/query_plugin_test.go +++ b/wasmbinding/query_plugin_test.go @@ -78,7 +78,7 @@ func (suite *StargateTestSuite) TestStargateQuerier() { err := simapp.FundAccount(suite.app.BankKeeper, suite.ctx, sender, apptesting.DefaultAcctFunds) suite.Require().NoError(err) msg := balancer.NewMsgCreateBalancerPool(sender, - balancer.NewPoolParams(sdk.ZeroDec(), sdk.ZeroDec(), nil), + balancer.NewPoolParams(sdk.ZeroDec(), nil), apptesting.DefaultPoolAssets, "") _, err = suite.app.PoolManagerKeeper.CreatePool(suite.ctx, msg) suite.NoError(err) diff --git a/x/gamm/keeper/grpc_query.go b/x/gamm/keeper/grpc_query.go index 42be8fe9adb..3ed70a71db5 100644 --- a/x/gamm/keeper/grpc_query.go +++ b/x/gamm/keeper/grpc_query.go @@ -252,7 +252,7 @@ func (q Querier) CalcExitPoolCoinsFromShares(ctx context.Context, req *types.Que return nil, sdkerrors.Wrapf(types.ErrInvalidMathApprox, "share ratio is zero or negative") } - exitCoins, err := pool.CalcExitPoolCoinsFromShares(sdkCtx, req.ShareInAmount, sdk.ZeroDec()) + exitCoins, err := pool.CalcExitPoolCoinsFromShares(sdkCtx, req.ShareInAmount) if err != nil { return nil, err } diff --git a/x/gamm/keeper/grpc_query_test.go b/x/gamm/keeper/grpc_query_test.go index b68a4ac38d7..0be4a698484 100644 --- a/x/gamm/keeper/grpc_query_test.go +++ b/x/gamm/keeper/grpc_query_test.go @@ -19,7 +19,6 @@ func (suite *KeeperTestSuite) TestCalcExitPoolCoinsFromShares() { queryClient := suite.queryClient ctx := suite.Ctx poolId := suite.PrepareBalancerPool() - exitFee := sdk.ZeroDec() testCases := []struct { name string @@ -69,7 +68,7 @@ func (suite *KeeperTestSuite) TestCalcExitPoolCoinsFromShares() { err = suite.App.InterfaceRegistry().UnpackAny(poolRes.Pool, &pool) suite.Require().NoError(err) - exitCoins, err := pool.CalcExitPoolCoinsFromShares(ctx, tc.shareInAmount, exitFee) + exitCoins, err := pool.CalcExitPoolCoinsFromShares(ctx, tc.shareInAmount) suite.Require().NoError(err) // For each coin in exitCoins we are looking for a match in our response diff --git a/x/gamm/keeper/migrate_test.go b/x/gamm/keeper/migrate_test.go index 464fc0fe799..2216a6cb39e 100644 --- a/x/gamm/keeper/migrate_test.go +++ b/x/gamm/keeper/migrate_test.go @@ -139,7 +139,7 @@ func (suite *KeeperTestSuite) TestMigrate() { balancerPool, err = suite.App.GAMMKeeper.GetPoolAndPoke(suite.Ctx, balancerPoolId) suite.Require().NoError(err) sharesToMigrate := sdk.NewCoin(test.param.sharesToMigrateDenom, test.param.sharesToMigrateAmount) - expectedCoinsOut, err := balancerPool.CalcExitPoolCoinsFromShares(suite.Ctx, sharesToMigrate.Amount, sdk.ZeroDec()) + expectedCoinsOut, err := balancerPool.CalcExitPoolCoinsFromShares(suite.Ctx, sharesToMigrate.Amount) suite.Require().NoError(err) // Migrate the user's gamm shares to a full range concentrated liquidity position diff --git a/x/gamm/keeper/pool.go b/x/gamm/keeper/pool.go index 61837b9485b..73a924a9960 100644 --- a/x/gamm/keeper/pool.go +++ b/x/gamm/keeper/pool.go @@ -61,8 +61,6 @@ func (k Keeper) GetPoolAndPoke(ctx sdk.Context, poolId uint64) (types.CFMMPoolI, return nil, err } - fmt.Println("pool", pool) - if pokePool, ok := pool.(types.WeightedPoolExtension); ok { pokePool.PokePool(ctx.BlockTime()) } @@ -111,7 +109,6 @@ func (k Keeper) GetPoolsAndPoke(ctx sdk.Context) (res []types.CFMMPoolI, err err func (k Keeper) setPool(ctx sdk.Context, pool poolmanagertypes.PoolI) error { bz, err := k.MarshalPool(pool) - fmt.Println("bz", bz) if err != nil { return err } diff --git a/x/gamm/keeper/pool_service.go b/x/gamm/keeper/pool_service.go index 2d41d5f9674..0d6a46134f3 100644 --- a/x/gamm/keeper/pool_service.go +++ b/x/gamm/keeper/pool_service.go @@ -308,7 +308,7 @@ func (k Keeper) ExitPool( } else if shareInAmount.LTE(sdk.ZeroInt()) { return sdk.Coins{}, sdkerrors.Wrapf(types.ErrInvalidMathApprox, "Trying to exit a negative amount of shares") } - exitCoins, err = pool.ExitPool(ctx, shareInAmount, sdk.ZeroDec()) + exitCoins, err = pool.ExitPool(ctx, shareInAmount) if err != nil { return sdk.Coins{}, err } diff --git a/x/gamm/pool-models/balancer/amm.go b/x/gamm/pool-models/balancer/amm.go index a7a371c7f25..950bc65bf4e 100644 --- a/x/gamm/pool-models/balancer/amm.go +++ b/x/gamm/pool-models/balancer/amm.go @@ -214,8 +214,7 @@ func calcPoolSharesInGivenSingleAssetOut( normalizedTokenWeightOut, totalPoolSharesSupply, tokenAmountOut, - swapFee, - exitFee sdk.Dec, + swapFee sdk.Dec, ) sdk.Dec { tokenAmountOutFeeIncluded := tokenAmountOut.Quo(feeRatio(normalizedTokenWeightOut, swapFee)) @@ -223,10 +222,7 @@ func calcPoolSharesInGivenSingleAssetOut( // pool weight is always 1 sharesIn := solveConstantFunctionInvariant(tokenBalanceOut.Sub(tokenAmountOutFeeIncluded), tokenBalanceOut, normalizedTokenWeightOut, totalPoolSharesSupply, sdk.OneDec()) - // charge exit fee on the pool token side - // pAi = pAiAfterExitFee/(1-exitFee) - sharesInFeeIncluded := sharesIn.Quo(sdk.OneDec().Sub(exitFee)) - return sharesInFeeIncluded + return sharesIn } // ensureDenomInPool check to make sure the input denoms exist in the provided pool asset map diff --git a/x/gamm/pool-models/balancer/pool.go b/x/gamm/pool-models/balancer/pool.go index e7ce6a82eaa..66beb3d2596 100644 --- a/x/gamm/pool-models/balancer/pool.go +++ b/x/gamm/pool-models/balancer/pool.go @@ -396,7 +396,6 @@ func (p *Pool) updateAllWeights(newWeights []PoolAsset) { func (p *Pool) PokePool(blockTime time.Time) { // check if pool weights didn't change poolWeightsChanging := p.PoolParams.SmoothWeightChangeParams != nil - fmt.Println("p.PoolParams.SmoothWeightChangeParams", p.PoolParams.SmoothWeightChangeParams) if !poolWeightsChanging { return } @@ -847,8 +846,8 @@ func (p *Pool) calcJoinSingleAssetTokensIn(tokensIn sdk.Coins, totalShares sdk.I return totalNewShares, totalNewLiquidity, nil } -func (p *Pool) ExitPool(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitingCoins sdk.Coins, err error) { - exitingCoins, err = p.CalcExitPoolCoinsFromShares(ctx, exitingShares, exitFee) +func (p *Pool) ExitPool(ctx sdk.Context, exitingShares sdk.Int) (exitingCoins sdk.Coins, err error) { + exitingCoins, err = p.CalcExitPoolCoinsFromShares(ctx, exitingShares) if err != nil { return sdk.Coins{}, err } @@ -874,8 +873,8 @@ func (p *Pool) exitPool(ctx sdk.Context, exitingCoins sdk.Coins, exitingShares s return nil } -func (p *Pool) CalcExitPoolCoinsFromShares(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitedCoins sdk.Coins, err error) { - return cfmm_common.CalcExitPool(ctx, p, exitingShares, exitFee) +func (p *Pool) CalcExitPoolCoinsFromShares(ctx sdk.Context, exitingShares sdk.Int) (exitedCoins sdk.Coins, err error) { + return cfmm_common.CalcExitPool(ctx, p, exitingShares) } func (p *Pool) CalcTokenInShareAmountOut( @@ -957,7 +956,6 @@ func (p *Pool) ExitSwapExactAmountOut( p.GetTotalShares().ToDec(), tokenOut.Amount.ToDec(), p.GetSwapFee(ctx), - sdk.ZeroDec(), ).TruncateInt() if !sharesIn.IsPositive() { diff --git a/x/gamm/pool-models/balancer/pool_params.go b/x/gamm/pool-models/balancer/pool_params.go index 3d1118d1bc0..69efcf36959 100644 --- a/x/gamm/pool-models/balancer/pool_params.go +++ b/x/gamm/pool-models/balancer/pool_params.go @@ -8,7 +8,7 @@ import ( "github.com/osmosis-labs/osmosis/v15/x/gamm/types" ) -func NewPoolParams(swapFee, exitFee sdk.Dec, params *SmoothWeightChangeParams) PoolParams { +func NewPoolParams(swapFee sdk.Dec, params *SmoothWeightChangeParams) PoolParams { return PoolParams{ SwapFee: swapFee, SmoothWeightChangeParams: params, diff --git a/x/gamm/pool-models/balancer/pool_suite_test.go b/x/gamm/pool-models/balancer/pool_suite_test.go index 4da02275b26..864d81ca40e 100644 --- a/x/gamm/pool-models/balancer/pool_suite_test.go +++ b/x/gamm/pool-models/balancer/pool_suite_test.go @@ -833,7 +833,7 @@ func (suite *KeeperTestSuite) TestCalcJoinPoolShares() { tc := tc suite.T().Run(tc.name, func(t *testing.T) { - pool := createTestPool(t, tc.swapFee, sdk.ZeroDec(), tc.poolAssets...) + pool := createTestPool(t, tc.swapFee, tc.poolAssets...) // system under test sut := func() { @@ -870,7 +870,7 @@ func (suite *KeeperTestSuite) TestJoinPool() { tc := tc suite.T().Run(tc.name, func(t *testing.T) { - pool := createTestPool(t, tc.swapFee, sdk.ZeroDec(), tc.poolAssets...) + pool := createTestPool(t, tc.swapFee, tc.poolAssets...) // system under test sut := func() { @@ -965,7 +965,7 @@ func (suite *KeeperTestSuite) TestJoinPoolNoSwap() { tc := tc suite.T().Run(tc.name, func(t *testing.T) { - pool := createTestPool(t, tc.swapFee, sdk.ZeroDec(), tc.poolAssets...) + pool := createTestPool(t, tc.swapFee, tc.poolAssets...) // system under test sut := func() { @@ -1024,7 +1024,6 @@ func (suite *KeeperTestSuite) TestRandomizedJoinPoolExitPoolInvariants() { } swapFeeDec := sdk.ZeroDec() - exitFeeDec := sdk.ZeroDec() // create pool with randomized initial token amounts // and randomized ratio of join/exit @@ -1039,7 +1038,7 @@ func (suite *KeeperTestSuite) TestRandomizedJoinPoolExitPoolInvariants() { Weight: sdk.NewInt(5), } - pool = createTestPool(suite.T(), swapFeeDec, exitFeeDec, poolAssetOut, poolAssetIn) + pool = createTestPool(suite.T(), swapFeeDec, poolAssetOut, poolAssetIn) suite.Require().NotNil(pool) return pool @@ -1058,7 +1057,7 @@ func (suite *KeeperTestSuite) TestRandomizedJoinPoolExitPoolInvariants() { // exits for same amount of shares minted exitPool := func(pool types.CFMMPoolI, tc *testCase) { - _, err := pool.ExitPool(suite.Ctx, tc.numShares, exitFeeDec) + _, err := pool.ExitPool(suite.Ctx, tc.numShares) suite.Require().NoError(err) } diff --git a/x/gamm/pool-models/balancer/pool_test.go b/x/gamm/pool-models/balancer/pool_test.go index 31ddeb4ab3c..a145916a90a 100644 --- a/x/gamm/pool-models/balancer/pool_test.go +++ b/x/gamm/pool-models/balancer/pool_test.go @@ -133,7 +133,7 @@ func TestCalcSingleAssetJoin(t *testing.T) { for _, tc := range calcSingleAssetJoinTestCases { tc := tc t.Run(tc.name, func(t *testing.T) { - pool := createTestPool(t, tc.swapFee, sdk.MustNewDecFromStr("0"), tc.poolAssets...) + pool := createTestPool(t, tc.swapFee, tc.poolAssets...) tokenIn := tc.tokensIn[0] @@ -340,7 +340,7 @@ func TestCalcJoinSingleAssetTokensIn(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { - pool := createTestPool(t, tc.swapFee, sdk.ZeroDec(), tc.poolAssets...) + pool := createTestPool(t, tc.swapFee, tc.poolAssets...) poolAssetsByDenom, err := balancer.GetPoolAssetsByDenom(pool.GetAllPoolAssets()) require.NoError(t, err) @@ -560,10 +560,9 @@ func (suite *BalancerTestSuite) TestBalancerCalculateAmountOutAndIn_InverseRelat swapFeeDec, err := sdk.NewDecFromStr(swapFee) suite.Require().NoError(err) - exitFeeDec, err := sdk.NewDecFromStr("0") suite.Require().NoError(err) - pool := createTestPool(suite.T(), swapFeeDec, exitFeeDec, poolAssetOut, poolAssetIn) + pool := createTestPool(suite.T(), swapFeeDec, poolAssetOut, poolAssetIn) suite.Require().NotNil(pool) errTolerance := osmomath.ErrTolerance{ diff --git a/x/gamm/pool-models/balancer/util_test.go b/x/gamm/pool-models/balancer/util_test.go index 97a7b56804c..f45ca56359a 100644 --- a/x/gamm/pool-models/balancer/util_test.go +++ b/x/gamm/pool-models/balancer/util_test.go @@ -16,10 +16,10 @@ import ( "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/balancer" ) -func createTestPool(t *testing.T, swapFee, exitFee sdk.Dec, poolAssets ...balancer.PoolAsset) *balancer.Pool { +func createTestPool(t *testing.T, swapFee sdk.Dec, poolAssets ...balancer.PoolAsset) *balancer.Pool { pool, err := balancer.NewBalancerPool( 1, - balancer.NewPoolParams(swapFee, exitFee, nil), + balancer.NewPoolParams(swapFee, nil), poolAssets, "", time.Now(), diff --git a/x/gamm/pool-models/internal/cfmm_common/lp.go b/x/gamm/pool-models/internal/cfmm_common/lp.go index 2cf691e2687..83fbedcefa8 100644 --- a/x/gamm/pool-models/internal/cfmm_common/lp.go +++ b/x/gamm/pool-models/internal/cfmm_common/lp.go @@ -13,22 +13,14 @@ import ( const errMsgFormatSharesLargerThanMax = "%s resulted shares is larger than the max amount of %s" // CalcExitPool returns how many tokens should come out, when exiting k LP shares against a "standard" CFMM -func CalcExitPool(ctx sdk.Context, pool types.CFMMPoolI, exitingShares sdk.Int, exitFee sdk.Dec) (sdk.Coins, error) { +func CalcExitPool(ctx sdk.Context, pool types.CFMMPoolI, exitingShares sdk.Int) (sdk.Coins, error) { totalShares := pool.GetTotalShares() if exitingShares.GTE(totalShares) { return sdk.Coins{}, sdkerrors.Wrapf(types.ErrLimitMaxAmount, errMsgFormatSharesLargerThanMax, exitingShares, totalShares) } - // refundedShares = exitingShares * (1 - exit fee) // with 0 exit fee optimization - var refundedShares sdk.Dec - if !exitFee.IsZero() { - // exitingShares * (1 - exit fee) - oneSubExitFee := sdk.OneDec().SubMut(exitFee) - refundedShares = oneSubExitFee.MulIntMut(exitingShares) - } else { - refundedShares = exitingShares.ToDec() - } + refundedShares := exitingShares.ToDec() shareOutRatio := refundedShares.QuoInt(totalShares) // exitedCoins = shareOutRatio * pool liquidity @@ -144,8 +136,7 @@ func BinarySearchSingleAssetJoin( poolWithUpdatedLiquidity := poolWithAddedLiquidityAndShares(tokenIn, sharesIn) swapToDenom := tokenIn.Denom // so now due to correctness of exitPool, we exitPool and swap all remaining assets to base asset - exitFee := sdk.ZeroDec() - exitedCoins, err := poolWithUpdatedLiquidity.ExitPool(ctx, sharesIn, exitFee) + exitedCoins, err := poolWithUpdatedLiquidity.ExitPool(ctx, sharesIn) if err != nil { return sdk.Int{}, err } diff --git a/x/gamm/pool-models/internal/cfmm_common/lp_test.go b/x/gamm/pool-models/internal/cfmm_common/lp_test.go index b694c7512dd..2ba5f9b7218 100644 --- a/x/gamm/pool-models/internal/cfmm_common/lp_test.go +++ b/x/gamm/pool-models/internal/cfmm_common/lp_test.go @@ -126,7 +126,7 @@ func TestCalcExitPool(t *testing.T) { for _, test := range tests { // using empty context since, currently, the context is not used anyway. This might be changed in the future - exitCoins, err := cfmm_common.CalcExitPool(emptyContext, test.pool, test.exitingShares, sdk.ZeroDec()) + exitCoins, err := cfmm_common.CalcExitPool(emptyContext, test.pool, test.exitingShares) if test.expError { require.Error(t, err, "test: %v", test.name) } else { diff --git a/x/gamm/pool-models/stableswap/amm_test.go b/x/gamm/pool-models/stableswap/amm_test.go index f63e1cd3c95..ac18f176038 100644 --- a/x/gamm/pool-models/stableswap/amm_test.go +++ b/x/gamm/pool-models/stableswap/amm_test.go @@ -719,11 +719,10 @@ func (suite *StableSwapTestSuite) Test_StableSwap_CalculateAmountOutAndIn_Invers swapFeeDec, err := sdk.NewDecFromStr(swapFee) suite.Require().NoError(err) - exitFeeDec, err := sdk.NewDecFromStr("0") suite.Require().NoError(err) // TODO: add scaling factors into inverse relationship tests - pool := createTestPool(suite.T(), tc.poolLiquidity, swapFeeDec, exitFeeDec, tc.scalingFactors) + pool := createTestPool(suite.T(), tc.poolLiquidity, swapFeeDec, tc.scalingFactors) suite.Require().NotNil(pool) errTolerance := osmomath.ErrTolerance{ AdditiveTolerance: sdk.Dec{}, MultiplicativeTolerance: sdk.NewDecWithPrec(1, 12)} @@ -756,7 +755,7 @@ func (suite *StableSwapTestSuite) Test_StableSwap_Slippage_LiquidityRelation() { for name, tc := range testcases { for _, swapFee := range swapFeeCases { createPoolFn := func(ctx sdk.Context, liq sdk.Coins) types.CFMMPoolI { - return createTestPool(suite.T(), liq, sdk.MustNewDecFromStr(swapFee), sdk.ZeroDec(), tc.scalingFactors) + return createTestPool(suite.T(), liq, sdk.MustNewDecFromStr(swapFee), tc.scalingFactors) } ctx := sdk.Context{} test_helpers.TestSlippageRelationWithLiquidityIncrease(name, suite.T(), ctx, createPoolFn, tc.initialLiquidity) @@ -874,7 +873,7 @@ func TestCalcSingleAssetJoinShares(t *testing.T) { require.NoError(t, err, "test: %s", name) p.updatePoolForJoin(sdk.Coins{tc.tokenIn}, shares) - exitTokens, err := p.ExitPool(ctx, shares, sdk.ZeroDec()) + exitTokens, err := p.ExitPool(ctx, shares) require.NoError(t, err, "test: %s", name) // since each asset swap can have up to sdk.OneInt() error, our expected error bound is 1*numAssets diff --git a/x/gamm/pool-models/stableswap/pool.go b/x/gamm/pool-models/stableswap/pool.go index f415bd1d69a..5c9f1597523 100644 --- a/x/gamm/pool-models/stableswap/pool.go +++ b/x/gamm/pool-models/stableswap/pool.go @@ -366,8 +366,8 @@ func (p *Pool) JoinPoolNoSwap(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.D return newShares, nil } -func (p *Pool) ExitPool(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitingCoins sdk.Coins, err error) { - exitingCoins, err = p.CalcExitPoolCoinsFromShares(ctx, exitingShares, exitFee) +func (p *Pool) ExitPool(ctx sdk.Context, exitingShares sdk.Int) (exitingCoins sdk.Coins, err error) { + exitingCoins, err = p.CalcExitPoolCoinsFromShares(ctx, exitingShares) if err != nil { return sdk.Coins{}, err } @@ -382,8 +382,8 @@ func (p *Pool) ExitPool(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) return exitingCoins, nil } -func (p Pool) CalcExitPoolCoinsFromShares(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitingCoins sdk.Coins, err error) { - return cfmm_common.CalcExitPool(ctx, &p, exitingShares, exitFee) +func (p Pool) CalcExitPoolCoinsFromShares(ctx sdk.Context, exitingShares sdk.Int) (exitingCoins sdk.Coins, err error) { + return cfmm_common.CalcExitPool(ctx, &p, exitingShares) } // SetScalingFactors sets scaling factors for pool to the given amount diff --git a/x/gamm/pool-models/stableswap/pool_test.go b/x/gamm/pool-models/stableswap/pool_test.go index bb04bd3086b..210117e9cf1 100644 --- a/x/gamm/pool-models/stableswap/pool_test.go +++ b/x/gamm/pool-models/stableswap/pool_test.go @@ -958,7 +958,7 @@ func TestInverseJoinPoolExitPool(t *testing.T) { // we join then exit the pool shares, err := p.JoinPool(ctx, tc.tokensIn, tc.swapFee) - tokenOut, err := p.ExitPool(ctx, shares, sdk.ZeroDec()) + tokenOut, err := p.ExitPool(ctx, shares) // if single asset join, we swap output tokens to input denom to test the full inverse relationship if len(tc.tokensIn) == 1 { @@ -1038,7 +1038,7 @@ func TestExitPool(t *testing.T) { t.Run(name, func(t *testing.T) { ctx := sdk.Context{} p := poolStructFromAssets(tc.initialPoolLiquidity, tc.scalingFactors) - tokenOut, err := p.ExitPool(ctx, tc.sharesIn, sdk.ZeroDec()) + tokenOut, err := p.ExitPool(ctx, tc.sharesIn) if tc.expectPass { finalPoolLiquidity := p.GetTotalPoolLiquidity(ctx) diff --git a/x/gamm/pool-models/stableswap/util_test.go b/x/gamm/pool-models/stableswap/util_test.go index 1ec901d7f93..d8ea9173d20 100644 --- a/x/gamm/pool-models/stableswap/util_test.go +++ b/x/gamm/pool-models/stableswap/util_test.go @@ -9,7 +9,7 @@ import ( "github.com/osmosis-labs/osmosis/v15/x/gamm/types" ) -func createTestPool(t *testing.T, poolLiquidity sdk.Coins, swapFee, exitFee sdk.Dec, scalingFactors []uint64) types.CFMMPoolI { +func createTestPool(t *testing.T, poolLiquidity sdk.Coins, swapFee sdk.Dec, scalingFactors []uint64) types.CFMMPoolI { scalingFactors, _ = applyScalingFactorMultiplier(scalingFactors) pool, err := NewStableswapPool(1, PoolParams{ diff --git a/x/gamm/simulation/sim_msgs.go b/x/gamm/simulation/sim_msgs.go index ecbd1c3c0ba..d6b3d4f0932 100644 --- a/x/gamm/simulation/sim_msgs.go +++ b/x/gamm/simulation/sim_msgs.go @@ -70,7 +70,7 @@ func RandomExitPoolMsg(k keeper.Keeper, sim *simtypes.SimCtx, ctx sdk.Context) ( } // calculate the minimum number of tokens received from input of gamm shares - tokenOutMins, err := pool.CalcExitPoolCoinsFromShares(ctx, gammShares.Amount, sdk.ZeroDec()) + tokenOutMins, err := pool.CalcExitPoolCoinsFromShares(ctx, gammShares.Amount) if err != nil { return nil, err } @@ -299,7 +299,7 @@ func RandomExitSwapExternAmountOut(k keeper.Keeper, sim *simtypes.SimCtx, ctx sd gammShares.Amount = sim.RandomAmount(gammShares.Amount) // calc exitedCoins from gammShares in - exitedCoins, err := pool.CalcExitPoolCoinsFromShares(ctx, gammShares.Amount, sdk.ZeroDec()) + exitedCoins, err := pool.CalcExitPoolCoinsFromShares(ctx, gammShares.Amount) if err != nil { return nil, err } @@ -341,7 +341,7 @@ func RandomExitSwapShareAmountIn(k keeper.Keeper, sim *simtypes.SimCtx, ctx sdk. gammShares.Amount = sim.RandomAmount(gammShares.Amount) // calc exitedCoins from gammShares in - exitedCoins, err := pool.CalcExitPoolCoinsFromShares(ctx, gammShares.Amount, sdk.ZeroDec()) + exitedCoins, err := pool.CalcExitPoolCoinsFromShares(ctx, gammShares.Amount) if err != nil { return nil, err } diff --git a/x/gamm/types/errors.go b/x/gamm/types/errors.go index dbc6b17f20b..f94e6cac3bb 100644 --- a/x/gamm/types/errors.go +++ b/x/gamm/types/errors.go @@ -59,9 +59,7 @@ var ( ErrEmptyRoutes = sdkerrors.Register(ModuleName, 21, "routes not defined") ErrEmptyPoolAssets = sdkerrors.Register(ModuleName, 22, "PoolAssets not defined") ErrNegativeSwapFee = sdkerrors.Register(ModuleName, 23, "swap fee is negative") - ErrNegativeExitFee = sdkerrors.Register(ModuleName, 24, "exit fee is negative") ErrTooMuchSwapFee = sdkerrors.Register(ModuleName, 25, "swap fee should be lesser than 1 (100%)") - ErrTooMuchExitFee = sdkerrors.Register(ModuleName, 26, "exit fee should be lesser than 1 (100%)") ErrNotPositiveWeight = sdkerrors.Register(ModuleName, 27, "token weight should be greater than 0") ErrWeightTooLarge = sdkerrors.Register(ModuleName, 28, "user specified token weight should be less than 2^20") ErrNotPositiveCriteria = sdkerrors.Register(ModuleName, 29, "min out amount or max in amount should be positive") diff --git a/x/gamm/types/pool.go b/x/gamm/types/pool.go index 38cc6fe3c8a..b7ecc80c6ed 100644 --- a/x/gamm/types/pool.go +++ b/x/gamm/types/pool.go @@ -29,13 +29,13 @@ type CFMMPoolI interface { // ExitPool exits #numShares LP shares from the pool, decreases its internal liquidity & LP share totals, // and returns the number of coins that are being returned. // This mutates the pool and state. - ExitPool(ctx sdk.Context, numShares sdk.Int, exitFee sdk.Dec) (exitedCoins sdk.Coins, err error) + ExitPool(ctx sdk.Context, numShares sdk.Int) (exitedCoins sdk.Coins, err error) // CalcJoinPoolNoSwapShares returns how many LP shares JoinPoolNoSwap would return on these arguments. // This does not mutate the pool, or state. CalcJoinPoolNoSwapShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, newLiquidity sdk.Coins, err error) // CalcExitPoolCoinsFromShares returns how many coins ExitPool would return on these arguments. // This does not mutate the pool, or state. - CalcExitPoolCoinsFromShares(ctx sdk.Context, numShares sdk.Int, exitFee sdk.Dec) (exitedCoins sdk.Coins, err error) + CalcExitPoolCoinsFromShares(ctx sdk.Context, numShares sdk.Int) (exitedCoins sdk.Coins, err error) // CalcJoinPoolShares returns how many LP shares JoinPool would return on these arguments. // This does not mutate the pool, or state. CalcJoinPoolShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, newLiquidity sdk.Coins, err error) diff --git a/x/gamm/v2types/balancer/balancerPool.pb.go b/x/gamm/v2types/balancer/balancerPool.pb.go deleted file mode 100644 index ff49b307a2d..00000000000 --- a/x/gamm/v2types/balancer/balancerPool.pb.go +++ /dev/null @@ -1,908 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/gamm/v2/balancer/balancerPool.proto - -// this is a legacy package that requires additional migration logic -// in order to use the correct packge. Decision made to use legacy package path -// until clear steps for migration logic and the unknowns for state breaking are -// investigated for changing proto package. - -package balancer - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/x/auth/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - balancer "github.com/osmosis-labs/osmosis/v15/x/gamm/pool-models/balancer" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// PoolParams defined the parameters that will be managed by the pool -// governance in the future. This params are not managed by the chain -// governance. Instead they will be managed by the token holders of the pool. -// The pool's token holders are specified in future_pool_governor. -type PoolParams struct { - SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee" yaml:"swap_fee"` - ExitFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exit_fee,json=exitFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exit_fee" yaml:"exit_fee"` - SmoothWeightChangeParams *balancer.SmoothWeightChangeParams `protobuf:"bytes,3,opt,name=smooth_weight_change_params,json=smoothWeightChangeParams,proto3" json:"smooth_weight_change_params,omitempty" yaml:"smooth_weight_change_params"` -} - -func (m *PoolParams) Reset() { *m = PoolParams{} } -func (m *PoolParams) String() string { return proto.CompactTextString(m) } -func (*PoolParams) ProtoMessage() {} -func (*PoolParams) Descriptor() ([]byte, []int) { - return fileDescriptor_36e6bec4fd4d490e, []int{0} -} -func (m *PoolParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PoolParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PoolParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PoolParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_PoolParams.Merge(m, src) -} -func (m *PoolParams) XXX_Size() int { - return m.Size() -} -func (m *PoolParams) XXX_DiscardUnknown() { - xxx_messageInfo_PoolParams.DiscardUnknown(m) -} - -var xxx_messageInfo_PoolParams proto.InternalMessageInfo - -func (m *PoolParams) GetSmoothWeightChangeParams() *balancer.SmoothWeightChangeParams { - if m != nil { - return m.SmoothWeightChangeParams - } - return nil -} - -type Pool struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` - Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - PoolParams PoolParams `protobuf:"bytes,3,opt,name=pool_params,json=poolParams,proto3" json:"pool_params" yaml:"balancer_pool_params"` - // This string specifies who will govern the pool in the future. - // Valid forms of this are: - // {token name},{duration} - // {duration} - // where {token name} if specified is the token which determines the - // governor, and if not specified is the LP token for this pool.duration is - // a time specified as 0w,1w,2w, etc. which specifies how long the token - // would need to be locked up to count in governance. 0w means no lockup. - // TODO: Further improve these docs - FuturePoolGovernor string `protobuf:"bytes,4,opt,name=future_pool_governor,json=futurePoolGovernor,proto3" json:"future_pool_governor,omitempty" yaml:"future_pool_governor"` - // sum of all LP tokens sent out - TotalShares types.Coin `protobuf:"bytes,5,opt,name=total_shares,json=totalShares,proto3" json:"total_shares" yaml:"total_shares"` - // These are assumed to be sorted by denomiation. - // They contain the pool asset and the information about the weight - PoolAssets []balancer.PoolAsset `protobuf:"bytes,6,rep,name=pool_assets,json=poolAssets,proto3" json:"pool_assets" yaml:"pool_assets"` - // sum of all non-normalized pool weights - TotalWeight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=total_weight,json=totalWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_weight" yaml:"total_weight"` -} - -func (m *Pool) Reset() { *m = Pool{} } -func (m *Pool) String() string { return proto.CompactTextString(m) } -func (*Pool) ProtoMessage() {} -func (*Pool) Descriptor() ([]byte, []int) { - return fileDescriptor_36e6bec4fd4d490e, []int{1} -} -func (m *Pool) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Pool.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Pool) XXX_Merge(src proto.Message) { - xxx_messageInfo_Pool.Merge(m, src) -} -func (m *Pool) XXX_Size() int { - return m.Size() -} -func (m *Pool) XXX_DiscardUnknown() { - xxx_messageInfo_Pool.DiscardUnknown(m) -} - -var xxx_messageInfo_Pool proto.InternalMessageInfo - -func init() { - proto.RegisterType((*PoolParams)(nil), "osmosis.gamm.v2.balancer.PoolParams") - proto.RegisterType((*Pool)(nil), "osmosis.gamm.v2.balancer.Pool") -} - -func init() { - proto.RegisterFile("osmosis/gamm/v2/balancer/balancerPool.proto", fileDescriptor_36e6bec4fd4d490e) -} - -var fileDescriptor_36e6bec4fd4d490e = []byte{ - // 652 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x8e, 0xd3, 0xb4, 0x81, 0x0d, 0x2a, 0xc2, 0xf4, 0xe0, 0xb6, 0x92, 0xb7, 0x32, 0x08, 0x55, - 0x40, 0xd6, 0x6a, 0x80, 0x4b, 0x39, 0x35, 0xe5, 0x47, 0xbd, 0x15, 0x57, 0x08, 0x81, 0x2a, 0x59, - 0xeb, 0x78, 0x6b, 0x1b, 0xec, 0xac, 0xe5, 0xdd, 0xa4, 0xed, 0x1b, 0x70, 0xe4, 0x08, 0xb7, 0x3e, - 0x04, 0x17, 0xde, 0xa0, 0xe2, 0xd4, 0x23, 0xe2, 0x60, 0xa1, 0x96, 0x27, 0xc8, 0x13, 0xa0, 0xfd, - 0x71, 0x9a, 0x56, 0x0d, 0x12, 0xe2, 0xe4, 0x9d, 0x9d, 0x6f, 0xbe, 0x99, 0xf9, 0x66, 0xbc, 0xe0, - 0x01, 0x65, 0x19, 0x65, 0x09, 0x73, 0x23, 0x9c, 0x65, 0xee, 0xb0, 0xe3, 0x06, 0x38, 0xc5, 0xfd, - 0x1e, 0x29, 0xc6, 0x87, 0x6d, 0x4a, 0x53, 0x94, 0x17, 0x94, 0x53, 0xd3, 0xd2, 0x60, 0x24, 0xc0, - 0x68, 0xd8, 0x41, 0x15, 0x66, 0x69, 0xb1, 0x27, 0x5d, 0xbe, 0xc4, 0xb9, 0xca, 0x50, 0x41, 0x4b, - 0x0b, 0x11, 0x8d, 0xa8, 0xba, 0x17, 0x27, 0x7d, 0x6b, 0x47, 0x94, 0x46, 0x29, 0x71, 0xa5, 0x15, - 0x0c, 0xf6, 0xdc, 0x70, 0x50, 0x60, 0x9e, 0xd0, 0xbe, 0xf6, 0xc3, 0xcb, 0x7e, 0x9e, 0x64, 0x84, - 0x71, 0x9c, 0xe5, 0x15, 0x81, 0x4a, 0xe2, 0xe2, 0x01, 0x8f, 0xdd, 0xe1, 0x5a, 0x40, 0x38, 0x5e, - 0x93, 0xc6, 0x25, 0x7f, 0x80, 0x19, 0x19, 0xfb, 0x7b, 0x34, 0xa9, 0x12, 0x3c, 0xbe, 0xd0, 0x78, - 0x4e, 0x69, 0xda, 0xce, 0x68, 0x48, 0x52, 0xf6, 0x37, 0x05, 0x9c, 0xdf, 0x75, 0x00, 0x84, 0xb9, - 0x8d, 0x0b, 0x9c, 0x31, 0x73, 0x17, 0x5c, 0x63, 0xfb, 0x38, 0xf7, 0xf7, 0x08, 0xb1, 0x8c, 0x15, - 0x63, 0xf5, 0x7a, 0x77, 0xe3, 0xb8, 0x84, 0xb5, 0x9f, 0x25, 0xbc, 0x17, 0x25, 0x3c, 0x1e, 0x04, - 0xa8, 0x47, 0x33, 0x2d, 0x87, 0xfe, 0xb4, 0x59, 0xf8, 0xc1, 0xe5, 0x87, 0x39, 0x61, 0xe8, 0x19, - 0xe9, 0x8d, 0x4a, 0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, 0xff, 0xff, 0xe7, 0x17, 0xb2, 0xa1, 0x31, 0x05, 0x00, 0x00, -} - -func (m *PoolParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PoolParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.SmoothWeightChangeParams != nil { - { - size, err := m.SmoothWeightChangeParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - { - size := m.ExitFee.Size() - i -= size - if _, err := m.ExitFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.SwapFee.Size() - i -= size - if _, err := m.SwapFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Pool) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Pool) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.TotalWeight.Size() - i -= size - if _, err := m.TotalWeight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - if len(m.PoolAssets) > 0 { - for iNdEx := len(m.PoolAssets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PoolAssets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - { - size, err := m.TotalShares.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.FuturePoolGovernor) > 0 { - i -= len(m.FuturePoolGovernor) - copy(dAtA[i:], m.FuturePoolGovernor) - i = encodeVarintBalancerPool(dAtA, i, uint64(len(m.FuturePoolGovernor))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.PoolParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.Id != 0 { - i = encodeVarintBalancerPool(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x10 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintBalancerPool(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintBalancerPool(dAtA []byte, offset int, v uint64) int { - offset -= sovBalancerPool(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PoolParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.SwapFee.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - l = m.ExitFee.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - if m.SmoothWeightChangeParams != nil { - l = m.SmoothWeightChangeParams.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - } - return n -} - -func (m *Pool) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovBalancerPool(uint64(l)) - } - if m.Id != 0 { - n += 1 + sovBalancerPool(uint64(m.Id)) - } - l = m.PoolParams.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - l = len(m.FuturePoolGovernor) - if l > 0 { - n += 1 + l + sovBalancerPool(uint64(l)) - } - l = m.TotalShares.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - if len(m.PoolAssets) > 0 { - for _, e := range m.PoolAssets { - l = e.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - } - } - l = m.TotalWeight.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - return n -} - -func sovBalancerPool(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozBalancerPool(x uint64) (n int) { - return sovBalancerPool(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *PoolParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PoolParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PoolParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SwapFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SwapFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExitFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SmoothWeightChangeParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SmoothWeightChangeParams == nil { - m.SmoothWeightChangeParams = &balancer.SmoothWeightChangeParams{} - } - if err := m.SmoothWeightChangeParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBalancerPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBalancerPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Pool) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Pool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Pool: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PoolParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FuturePoolGovernor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FuturePoolGovernor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalShares", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TotalShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolAssets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PoolAssets = append(m.PoolAssets, balancer.PoolAsset{}) - if err := m.PoolAssets[len(m.PoolAssets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalWeight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TotalWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBalancerPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBalancerPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipBalancerPool(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthBalancerPool - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupBalancerPool - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthBalancerPool - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthBalancerPool = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBalancerPool = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupBalancerPool = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gamm/v2types/balancer/codec.go b/x/gamm/v2types/balancer/codec.go deleted file mode 100644 index 0eab0c14f35..00000000000 --- a/x/gamm/v2types/balancer/codec.go +++ /dev/null @@ -1,50 +0,0 @@ -package balancer - -import ( - types "github.com/osmosis-labs/osmosis/v15/x/gamm/types" - poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" - - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - proto "github.com/gogo/protobuf/proto" -) - -// RegisterLegacyAminoCodec registers the necessary x/gamm interfaces and concrete types -// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&Pool{}, "osmosis/gamm/v2/balancer/Pool", nil) -} - -func RegisterInterfaces(registry codectypes.InterfaceRegistry) { - registry.RegisterInterface( - "osmosis.poolmanager.v1beta1.PoolI", - (*poolmanagertypes.PoolI)(nil), - &Pool{}, - ) - registry.RegisterInterface( - "osmosis.gamm.v1beta1.PoolI", // N.B.: the old proto-path is preserved for backwards-compatibility. - (*types.CFMMPoolI)(nil), - &Pool{}, - ) - registry.RegisterImplementations( - (*proto.Message)(nil), - &PoolParams{}, - ) -} - -var ( - amino = codec.NewLegacyAmino() - - // ModuleCdc references the global x/bank module codec. Note, the codec should - // ONLY be used in certain instances of tests and for JSON encoding as Amino is - // still used for that purpose. - // - // The actual codec used for serialization should be provided to x/staking and - // defined at the application level. - ModuleCdc = codec.NewAminoCodec(amino) -) - -func init() { - RegisterLegacyAminoCodec(amino) - amino.Seal() -} diff --git a/x/gamm/v2types/balancer/pool.go b/x/gamm/v2types/balancer/pool.go deleted file mode 100644 index 61545a80a79..00000000000 --- a/x/gamm/v2types/balancer/pool.go +++ /dev/null @@ -1,96 +0,0 @@ -package balancer - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/osmosis-labs/osmosis/v15/x/gamm/types" - poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" -) - -var ( - _ poolmanagertypes.PoolI = &Pool{} - _ types.CFMMPoolI = &Pool{} -) - -// GetAddress returns the address of a pool. -// If the pool address is not bech32 valid, it returns an empty address. -func (p Pool) GetAddress() sdk.AccAddress { - return nil -} - -func (p Pool) GetId() uint64 { - return p.Id -} - -func (p Pool) GetSwapFee(_ sdk.Context) sdk.Dec { - return p.PoolParams.SwapFee -} - -func (p Pool) GetTotalPoolLiquidity(_ sdk.Context) sdk.Coins { - return sdk.Coins{} -} - -func (p Pool) GetTotalShares() sdk.Int { - return p.TotalShares.Amount -} - -func (p Pool) IsActive(ctx sdk.Context) bool { - return true -} - -func (p Pool) GetType() poolmanagertypes.PoolType { - return poolmanagertypes.Balancer -} - -func (p Pool) SpotPrice(ctx sdk.Context, quoteAsset, baseAsset string) (spotPrice sdk.Dec, err error) { - return sdk.ZeroDec(), nil -} - -func (p *Pool) CalcExitPoolCoinsFromShares(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitedCoins sdk.Coins, err error) { - return sdk.Coins{}, err -} - -func (p Pool) CalcInAmtGivenOut( - ctx sdk.Context, tokensOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) ( - tokenIn sdk.Coin, err error, -) { - return sdk.Coin{}, err -} - -func (p *Pool) CalcJoinPoolNoSwapShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, tokensJoined sdk.Coins, err error) { - return sdk.ZeroInt(), sdk.Coins{}, nil -} - -func (p *Pool) CalcJoinPoolShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, newLiquidity sdk.Coins, err error) { - return sdk.ZeroInt(), sdk.Coins{}, nil -} - -func (p Pool) CalcOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, swapFee sdk.Dec) (tokenOut sdk.Coin, err error) { - return sdk.Coin{}, nil -} - -func (p *Pool) ExitPool(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitingCoins sdk.Coins, err error) { - return sdk.Coins{}, err -} - -func (p *Pool) JoinPool(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (sdk.Int, error) { - return sdk.ZeroInt(), nil -} - -func (p *Pool) JoinPoolNoSwap(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (sdk.Int, error) { - return sdk.ZeroInt(), nil -} - -func (p *Pool) SwapInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) (tokenIn sdk.Coin, err error) { - return sdk.Coin{}, nil -} - -func (p *Pool) SwapOutAmtGivenIn( - ctx sdk.Context, - tokensIn sdk.Coins, - tokenOutDenom string, - swapFee sdk.Dec, -) ( - tokenOut sdk.Coin, err error, -) { - return sdk.Coin{}, nil -} diff --git a/x/gamm/v2types/stableswap/codec.go b/x/gamm/v2types/stableswap/codec.go deleted file mode 100644 index c21ebe803a7..00000000000 --- a/x/gamm/v2types/stableswap/codec.go +++ /dev/null @@ -1,50 +0,0 @@ -package stableswap - -import ( - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - types "github.com/osmosis-labs/osmosis/v15/x/gamm/types" - poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" -) - -// RegisterLegacyAminoCodec registers the necessary x/gamm interfaces and concrete types -// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&Pool{}, "osmosis/gamm/v2/stableswap/Pool", nil) -} - -func RegisterInterfaces(registry codectypes.InterfaceRegistry) { - registry.RegisterInterface( - "osmosis.poolmanager.v1beta1.PoolI", - (*poolmanagertypes.PoolI)(nil), - &Pool{}, - ) - registry.RegisterInterface( - "osmosis.gamm.v1beta1.PoolI", // N.B.: the old proto-path is preserved for backwards-compatibility. - (*types.CFMMPoolI)(nil), - &Pool{}, - ) -} - -var ( - amino = codec.NewLegacyAmino() - - // ModuleCdc references the global x/bank module codec. Note, the codec should - // ONLY be used in certain instances of tests and for JSON encoding as Amino is - // still used for that purpose. - // - // The actual codec used for serialization should be provided to x/staking and - // defined at the application level. - ModuleCdc = codec.NewAminoCodec(amino) -) - -func init() { - RegisterLegacyAminoCodec(amino) - // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be - // used to properly serialize MsgGrant and MsgExec instances - sdk.RegisterLegacyAminoCodec(amino) - amino.Seal() -} - -const PoolTypeName string = "Stableswap" diff --git a/x/gamm/v2types/stableswap/pool.go b/x/gamm/v2types/stableswap/pool.go deleted file mode 100644 index 713946a6a8f..00000000000 --- a/x/gamm/v2types/stableswap/pool.go +++ /dev/null @@ -1,96 +0,0 @@ -package stableswap - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/osmosis-labs/osmosis/v15/x/gamm/types" - poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types" -) - -var ( - _ poolmanagertypes.PoolI = &Pool{} - _ types.CFMMPoolI = &Pool{} -) - -// GetAddress returns the address of a pool. -// If the pool address is not bech32 valid, it returns an empty address. -func (p Pool) GetAddress() sdk.AccAddress { - return nil -} - -func (p Pool) GetId() uint64 { - return p.Id -} - -func (p Pool) GetSwapFee(_ sdk.Context) sdk.Dec { - return p.PoolParams.SwapFee -} - -func (p Pool) GetTotalPoolLiquidity(_ sdk.Context) sdk.Coins { - return sdk.Coins{} -} - -func (p Pool) GetTotalShares() sdk.Int { - return p.TotalShares.Amount -} - -func (p Pool) IsActive(ctx sdk.Context) bool { - return true -} - -func (p Pool) GetType() poolmanagertypes.PoolType { - return poolmanagertypes.Stableswap -} - -func (p Pool) SpotPrice(ctx sdk.Context, quoteAsset, baseAsset string) (spotPrice sdk.Dec, err error) { - return sdk.ZeroDec(), nil -} - -func (p *Pool) CalcExitPoolCoinsFromShares(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitedCoins sdk.Coins, err error) { - return sdk.Coins{}, err -} - -func (p Pool) CalcInAmtGivenOut( - ctx sdk.Context, tokensOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) ( - tokenIn sdk.Coin, err error, -) { - return sdk.Coin{}, err -} - -func (p *Pool) CalcJoinPoolNoSwapShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, tokensJoined sdk.Coins, err error) { - return sdk.ZeroInt(), sdk.Coins{}, nil -} - -func (p *Pool) CalcJoinPoolShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, newLiquidity sdk.Coins, err error) { - return sdk.ZeroInt(), sdk.Coins{}, nil -} - -func (p Pool) CalcOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, swapFee sdk.Dec) (tokenOut sdk.Coin, err error) { - return sdk.Coin{}, nil -} - -func (p *Pool) ExitPool(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitingCoins sdk.Coins, err error) { - return sdk.Coins{}, err -} - -func (p *Pool) JoinPool(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (sdk.Int, error) { - return sdk.ZeroInt(), nil -} - -func (p *Pool) JoinPoolNoSwap(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (sdk.Int, error) { - return sdk.ZeroInt(), nil -} - -func (p *Pool) SwapInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) (tokenIn sdk.Coin, err error) { - return sdk.Coin{}, nil -} - -func (p *Pool) SwapOutAmtGivenIn( - ctx sdk.Context, - tokensIn sdk.Coins, - tokenOutDenom string, - swapFee sdk.Dec, -) ( - tokenOut sdk.Coin, err error, -) { - return sdk.Coin{}, nil -} diff --git a/x/gamm/v2types/stableswap/stableswap_pool.pb.go b/x/gamm/v2types/stableswap/stableswap_pool.pb.go deleted file mode 100644 index c5949f10a73..00000000000 --- a/x/gamm/v2types/stableswap/stableswap_pool.pb.go +++ /dev/null @@ -1,940 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/gamm/v2/stableswap/stableswap_pool.proto - -package stableswap - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/x/auth/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// PoolParams defined the parameters that will be managed by the pool -// governance in the future. This params are not managed by the chain -// governance. Instead they will be managed by the token holders of the pool. -// The pool's token holders are specified in future_pool_governor. -type PoolParams struct { - SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee" yaml:"swap_fee"` - ExitFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exit_fee,json=exitFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exit_fee" yaml:"exit_fee"` -} - -func (m *PoolParams) Reset() { *m = PoolParams{} } -func (m *PoolParams) String() string { return proto.CompactTextString(m) } -func (*PoolParams) ProtoMessage() {} -func (*PoolParams) Descriptor() ([]byte, []int) { - return fileDescriptor_ce8f72b729f595f3, []int{0} -} -func (m *PoolParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PoolParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PoolParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PoolParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_PoolParams.Merge(m, src) -} -func (m *PoolParams) XXX_Size() int { - return m.Size() -} -func (m *PoolParams) XXX_DiscardUnknown() { - xxx_messageInfo_PoolParams.DiscardUnknown(m) -} - -var xxx_messageInfo_PoolParams proto.InternalMessageInfo - -// Pool is the stableswap Pool struct -type Pool struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` - Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - PoolParams PoolParams `protobuf:"bytes,3,opt,name=pool_params,json=poolParams,proto3" json:"pool_params" yaml:"stableswap_pool_params"` - // This string specifies who will govern the pool in the future. - // Valid forms of this are: - // {token name},{duration} - // {duration} - // where {token name} if specified is the token which determines the - // governor, and if not specified is the LP token for this pool.duration is - // a time specified as 0w,1w,2w, etc. which specifies how long the token - // would need to be locked up to count in governance. 0w means no lockup. - FuturePoolGovernor string `protobuf:"bytes,4,opt,name=future_pool_governor,json=futurePoolGovernor,proto3" json:"future_pool_governor,omitempty" yaml:"future_pool_governor"` - // sum of all LP shares - TotalShares types.Coin `protobuf:"bytes,5,opt,name=total_shares,json=totalShares,proto3" json:"total_shares" yaml:"total_shares"` - // assets in the pool - PoolLiquidity github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=pool_liquidity,json=poolLiquidity,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"pool_liquidity"` - // for calculation amognst assets with different precisions - ScalingFactors []uint64 `protobuf:"varint,7,rep,packed,name=scaling_factors,json=scalingFactors,proto3" json:"scaling_factors,omitempty" yaml:"stableswap_scaling_factors"` - // scaling_factor_controller is the address can adjust pool scaling factors - ScalingFactorController string `protobuf:"bytes,8,opt,name=scaling_factor_controller,json=scalingFactorController,proto3" json:"scaling_factor_controller,omitempty" yaml:"scaling_factor_controller"` -} - -func (m *Pool) Reset() { *m = Pool{} } -func (m *Pool) String() string { return proto.CompactTextString(m) } -func (*Pool) ProtoMessage() {} -func (*Pool) Descriptor() ([]byte, []int) { - return fileDescriptor_ce8f72b729f595f3, []int{1} -} -func (m *Pool) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Pool.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Pool) XXX_Merge(src proto.Message) { - xxx_messageInfo_Pool.Merge(m, src) -} -func (m *Pool) XXX_Size() int { - return m.Size() -} -func (m *Pool) XXX_DiscardUnknown() { - xxx_messageInfo_Pool.DiscardUnknown(m) -} - -var xxx_messageInfo_Pool proto.InternalMessageInfo - -func init() { - proto.RegisterType((*PoolParams)(nil), "osmosis.gamm.v2.stableswap.PoolParams") - proto.RegisterType((*Pool)(nil), "osmosis.gamm.v2.stableswap.Pool") -} - -func init() { - proto.RegisterFile("osmosis/gamm/v2/stableswap/stableswap_pool.proto", fileDescriptor_ce8f72b729f595f3) -} - -var fileDescriptor_ce8f72b729f595f3 = []byte{ - // 638 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x41, 0x4f, 0xd4, 0x40, - 0x14, 0xde, 0xc2, 0xc2, 0xe2, 0xa0, 0x4b, 0xac, 0x24, 0x16, 0x88, 0x9d, 0xb5, 0x11, 0xb2, 0x07, - 0x69, 0x01, 0xe3, 0x85, 0xc4, 0x83, 0x8b, 0xc1, 0x98, 0x18, 0x83, 0xf5, 0x60, 0x34, 0x26, 0xe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 0xae, 0xbd, 0xbc, 0x37, 0xa2, 0x8b, 0xbe, 0xb2, 0xd5, 0x04, 0x05, 0xbc, 0x32, 0xbc, 0xc1, - 0xfa, 0x5d, 0x6f, 0xaf, 0xfa, 0x40, 0x29, 0x9d, 0x46, 0x3e, 0x4d, 0xc1, 0xb4, 0xfa, 0x23, 0xdf, - 0xf9, 0x15, 0x00, 0x00, 0xff, 0xff, 0x7d, 0xe8, 0xa9, 0x27, 0xca, 0x04, 0x00, 0x00, -} - -func (m *PoolParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PoolParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.ExitFee.Size() - i -= size - if _, err := m.ExitFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintStableswapPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.SwapFee.Size() - i -= size - if _, err := m.SwapFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintStableswapPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Pool) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Pool) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ScalingFactorController) > 0 { - i -= len(m.ScalingFactorController) - copy(dAtA[i:], m.ScalingFactorController) - i = encodeVarintStableswapPool(dAtA, i, uint64(len(m.ScalingFactorController))) - i-- - dAtA[i] = 0x42 - } - if len(m.ScalingFactors) > 0 { - dAtA2 := make([]byte, len(m.ScalingFactors)*10) - var j1 int - for _, num := range m.ScalingFactors { - for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA2[j1] = uint8(num) - j1++ - } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintStableswapPool(dAtA, i, uint64(j1)) - i-- - dAtA[i] = 0x3a - } - if len(m.PoolLiquidity) > 0 { - for iNdEx := len(m.PoolLiquidity) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PoolLiquidity[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStableswapPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - { - size, err := m.TotalShares.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStableswapPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.FuturePoolGovernor) > 0 { - i -= len(m.FuturePoolGovernor) - copy(dAtA[i:], m.FuturePoolGovernor) - i = encodeVarintStableswapPool(dAtA, i, uint64(len(m.FuturePoolGovernor))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.PoolParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStableswapPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.Id != 0 { - i = encodeVarintStableswapPool(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x10 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintStableswapPool(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintStableswapPool(dAtA []byte, offset int, v uint64) int { - offset -= sovStableswapPool(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PoolParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.SwapFee.Size() - n += 1 + l + sovStableswapPool(uint64(l)) - l = m.ExitFee.Size() - n += 1 + l + sovStableswapPool(uint64(l)) - return n -} - -func (m *Pool) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovStableswapPool(uint64(l)) - } - if m.Id != 0 { - n += 1 + sovStableswapPool(uint64(m.Id)) - } - l = m.PoolParams.Size() - n += 1 + l + sovStableswapPool(uint64(l)) - l = len(m.FuturePoolGovernor) - if l > 0 { - n += 1 + l + sovStableswapPool(uint64(l)) - } - l = m.TotalShares.Size() - n += 1 + l + sovStableswapPool(uint64(l)) - if len(m.PoolLiquidity) > 0 { - for _, e := range m.PoolLiquidity { - l = e.Size() - n += 1 + l + sovStableswapPool(uint64(l)) - } - } - if len(m.ScalingFactors) > 0 { - l = 0 - for _, e := range m.ScalingFactors { - l += sovStableswapPool(uint64(e)) - } - n += 1 + sovStableswapPool(uint64(l)) + l - } - l = len(m.ScalingFactorController) - if l > 0 { - n += 1 + l + sovStableswapPool(uint64(l)) - } - return n -} - -func sovStableswapPool(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozStableswapPool(x uint64) (n int) { - return sovStableswapPool(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *PoolParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PoolParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PoolParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SwapFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStableswapPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStableswapPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SwapFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExitFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStableswapPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStableswapPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStableswapPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStableswapPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Pool) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Pool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Pool: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStableswapPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStableswapPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStableswapPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStableswapPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PoolParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FuturePoolGovernor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStableswapPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStableswapPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FuturePoolGovernor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalShares", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStableswapPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStableswapPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TotalShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolLiquidity", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStableswapPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStableswapPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PoolLiquidity = append(m.PoolLiquidity, types.Coin{}) - if err := m.PoolLiquidity[len(m.PoolLiquidity)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ScalingFactors = append(m.ScalingFactors, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthStableswapPool - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthStableswapPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.ScalingFactors) == 0 { - m.ScalingFactors = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ScalingFactors = append(m.ScalingFactors, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field ScalingFactors", wireType) - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScalingFactorController", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStableswapPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStableswapPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ScalingFactorController = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStableswapPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStableswapPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipStableswapPool(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStableswapPool - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthStableswapPool - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupStableswapPool - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthStableswapPool - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthStableswapPool = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStableswapPool = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupStableswapPool = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/poolmanager/create_pool_test.go b/x/poolmanager/create_pool_test.go index a9eff7dc763..5a71110fd7e 100644 --- a/x/poolmanager/create_pool_test.go +++ b/x/poolmanager/create_pool_test.go @@ -114,7 +114,7 @@ func (suite *KeeperTestSuite) TestPoolCreationFee() { // TestCreatePool tests that all possible pools are created correctly. func (suite *KeeperTestSuite) TestCreatePool() { - validBalancerPoolMsg := balancer.NewMsgCreateBalancerPool(suite.TestAccs[0], balancer.NewPoolParams(sdk.ZeroDec(), sdk.ZeroDec(), nil), []balancer.PoolAsset{ + validBalancerPoolMsg := balancer.NewMsgCreateBalancerPool(suite.TestAccs[0], balancer.NewPoolParams(sdk.ZeroDec(), nil), []balancer.PoolAsset{ { Token: sdk.NewCoin(foo, defaultInitPoolAmount), Weight: sdk.NewInt(1), diff --git a/x/protorev/keeper/keeper_test.go b/x/protorev/keeper/keeper_test.go index 601abd28d88..1e0d5fc7f03 100644 --- a/x/protorev/keeper/keeper_test.go +++ b/x/protorev/keeper/keeper_test.go @@ -734,7 +734,7 @@ func (suite *KeeperTestSuite) setUpPools() { } for _, pool := range suite.pools { - suite.createGAMMPool(pool.PoolAssets, pool.SwapFee, sdk.ZeroDec()) + suite.createGAMMPool(pool.PoolAssets, pool.SwapFee) } suite.stableSwapPools = []StableSwapPool{ @@ -819,7 +819,7 @@ func (suite *KeeperTestSuite) createStableswapPool(initialLiquidity sdk.Coins, p } // createGAMMPool creates a balancer pool with the given pool assets and params -func (suite *KeeperTestSuite) createGAMMPool(poolAssets []balancertypes.PoolAsset, swapFee, exitFee sdk.Dec) uint64 { +func (suite *KeeperTestSuite) createGAMMPool(poolAssets []balancertypes.PoolAsset, swapFee sdk.Dec) uint64 { poolParams := balancertypes.PoolParams{ SwapFee: swapFee, } From 464cde3c12a7e0454e2f972e4df03910664444e1 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Mon, 27 Mar 2023 16:21:53 +0700 Subject: [PATCH 26/26] fix upgrade handler --- app/upgrades/v15/constants.go | 1 - app/upgrades/v15/export_test.go | 4 ---- app/upgrades/v15/upgrade_test.go | 14 ++++++-------- app/upgrades/v15/upgrades.go | 16 ---------------- 4 files changed, 6 insertions(+), 29 deletions(-) diff --git a/app/upgrades/v15/constants.go b/app/upgrades/v15/constants.go index 72aca4218f0..47eb55cdb5c 100644 --- a/app/upgrades/v15/constants.go +++ b/app/upgrades/v15/constants.go @@ -18,7 +18,6 @@ const UpgradeName = "v15" const stOSMO_OSMOPoolId = 833 const stJUNO_JUNOPoolId = 817 const stSTARS_STARSPoolId = 810 -var exitFeePools = []uint64{553, 596, 555, 905, 597, 802, 654, 595, 696, 551, 552, 554, 652, 655, 657, 797} var Upgrade = upgrades.Upgrade{ UpgradeName: UpgradeName, diff --git a/app/upgrades/v15/export_test.go b/app/upgrades/v15/export_test.go index 41e6ffea718..1e57bed9980 100644 --- a/app/upgrades/v15/export_test.go +++ b/app/upgrades/v15/export_test.go @@ -34,7 +34,3 @@ func MigrateBalancerPoolToSolidlyStable(ctx sdk.Context, gammKeeper *gammkeeper. func SetRateLimits(ctx sdk.Context, accountKeeper *authkeeper.AccountKeeper, rateLimitingICS4Wrapper *ibcratelimit.ICS4Wrapper, wasmKeeper *wasmkeeper.Keeper) { setRateLimits(ctx, accountKeeper, rateLimitingICS4Wrapper, wasmKeeper) } - -func RemoveExitFee(ctx sdk.Context, gammKeeper gammkeeper.Keeper, poolsWithExitFee []uint64) { - removeExitFee(ctx, gammKeeper, poolsWithExitFee) -} diff --git a/app/upgrades/v15/upgrade_test.go b/app/upgrades/v15/upgrade_test.go index 7590b9d99ec..a9a46f2b226 100644 --- a/app/upgrades/v15/upgrade_test.go +++ b/app/upgrades/v15/upgrade_test.go @@ -271,17 +271,15 @@ func (suite *UpgradeTestSuite) TestRemoveExitFee() { pool553Bz, err := hex.DecodeString("0a1a2f6f736d6f7369732e67616d6d2e763162657461312e506f6f6c12de010a3f6f736d6f316d3830666e71767673643833776538676e68393938726535356a71386371326d646b6363636c716d7571773878706d36396167736d386666643610a9041a260a113235303030303030303030303030303030121132353030303030303030303030303030302a260a0d67616d6d2f706f6f6c2f3535331215313030303030303030303030303030303030303030321c0a0c0a0362617212053130303030120c313037333734313832343030321c0a0c0a03666f6f12053130303030120c3130373337343138323430303a0c323134373438333634383030") store.Set(gammtypes.GetKeyPrefixPools(553), pool553Bz) - // Set up stableswap pool 596 with non zero exit fee - pool596Bz, err := hex.DecodeString("0a302f6f736d6f7369732e67616d6d2e706f6f6c6d6f64656c732e737461626c65737761702e763162657461312e506f6f6c12b4010a3f6f736d6f316a747a6b7a32333833636567676138707a7137617a6d377470336c63757465703935757270767571787a3378383573667077377373617170633510d4041a260a113130303030303030303030303030303030121131303030303030303030303030303030302a260a0d67616d6d2f706f6f6c2f3539361215313030303030303030303030303030303030303030320c0a0362617212053130303030320c0a03666f6f120531303030303a020101") - store.Set(gammtypes.GetKeyPrefixPools(596), pool596Bz) - - v15.RemoveExitFee(suite.Ctx, *suite.App.GAMMKeeper, []uint64{553, 596}) - bz := store.Get(gammtypes.GetKeyPrefixPools(1)) pool1, err := suite.App.GAMMKeeper.UnmarshalPool(bz) suite.Require().NoError(err) suite.Require().NotNil(pool1) + suite.Require().Equal(reflect.ValueOf(pool1).Elem().FieldByName("PoolParams").FieldByName("ExitFee"), reflect.Value{}) - suite.Require().True(!store.Has(gammtypes.GetKeyPrefixPools(553))) - suite.Require().True(!store.Has(gammtypes.GetKeyPrefixPools(596))) + bz = store.Get(gammtypes.GetKeyPrefixPools(553)) + pool553, err := suite.App.GAMMKeeper.UnmarshalPool(bz) + suite.Require().NoError(err) + suite.Require().NotNil(pool553) + suite.Require().Equal(reflect.ValueOf(pool553).Elem().FieldByName("PoolParams").FieldByName("ExitFee"), reflect.Value{}) } diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index a2607df6db7..3577b9d5eba 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -49,13 +49,6 @@ func CreateUpgradeHandler( // Instead,it is moved to poolmanager. migrateNextPoolId(ctx, keepers.GAMMKeeper, keepers.PoolManagerKeeper) - removeExitFee(ctx, *keepers.GAMMKeeper, exitFeePools) - - // N.B.: this is done to avoid initializing genesis for gamm module. - // Otherwise, it would overwrite migrations with InitGenesis(). - // See RunMigrations() for details. - fromVM[gammtypes.ModuleName] = 0 - // N.B.: this is done to avoid initializing genesis for poolmanager module. // Otherwise, it would overwrite migrations with InitGenesis(). // See RunMigrations() for details. @@ -296,12 +289,3 @@ func registerOsmoIonMetadata(ctx sdk.Context, bankKeeper bankkeeper.Keeper) { bankKeeper.SetDenomMetaData(ctx, uosmoMetadata) bankKeeper.SetDenomMetaData(ctx, uionMetadata) } - -func removeExitFee(ctx sdk.Context, gammKeeper gammkeeper.Keeper, poolsWithExitFee []uint64) { - for _, poolId := range poolsWithExitFee { - err := gammKeeper.DeletePool(ctx, poolId) - if err != nil { - panic(err) - } - } -}