From efc7fbaf9c51f8b6db016100ed32f8b4550d70bc Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Mon, 2 Oct 2023 22:02:19 -0600 Subject: [PATCH 01/34] transer cl position --- osmoutils/osmocli/parsers.go | 8 + proto/osmosis/concentrated-liquidity/tx.proto | 16 +- x/concentrated-liquidity/client/cli/tx.go | 9 + x/concentrated-liquidity/export_test.go | 4 + x/concentrated-liquidity/msg_server.go | 37 + x/concentrated-liquidity/msg_server_test.go | 85 +++ x/concentrated-liquidity/position.go | 126 ++++ x/concentrated-liquidity/position_test.go | 170 +++++ x/concentrated-liquidity/types/errors.go | 8 + x/concentrated-liquidity/types/events.go | 2 + x/concentrated-liquidity/types/msgs.go | 44 ++ x/concentrated-liquidity/types/msgs_test.go | 74 +- x/concentrated-liquidity/types/tx.pb.go | 638 ++++++++++++++++-- 13 files changed, 1144 insertions(+), 77 deletions(-) diff --git a/osmoutils/osmocli/parsers.go b/osmoutils/osmocli/parsers.go index 229d450a831..f37688e23d6 100644 --- a/osmoutils/osmocli/parsers.go +++ b/osmoutils/osmocli/parsers.go @@ -380,3 +380,11 @@ func ParseStringTo2DArray(input string) ([][]uint64, error) { return result, nil } + +func ParseUint64SliceToString(values []uint64) string { + strs := make([]string, len(values)) + for i, v := range values { + strs[i] = strconv.FormatUint(v, 10) + } + return strings.Join(strs, ", ") +} diff --git a/proto/osmosis/concentrated-liquidity/tx.proto b/proto/osmosis/concentrated-liquidity/tx.proto index 4f5f3fe880c..aaf86cda60b 100644 --- a/proto/osmosis/concentrated-liquidity/tx.proto +++ b/proto/osmosis/concentrated-liquidity/tx.proto @@ -23,6 +23,8 @@ service Msg { returns (MsgCollectSpreadRewardsResponse); rpc CollectIncentives(MsgCollectIncentives) returns (MsgCollectIncentivesResponse); + rpc TransferPositions(MsgTransferPositions) + returns (MsgTransferPositionsResponse); } // ===================== MsgCreatePosition @@ -221,4 +223,16 @@ message MsgFungifyChargedPositions { message MsgFungifyChargedPositionsResponse { uint64 new_position_id = 1 [ (gogoproto.moretags) = "yaml:\"new_position_id\"" ]; -} \ No newline at end of file +} + +// ===================== MsgTransferPositions +message MsgTransferPositions { + option (amino.name) = "osmosis/cl-transfer-positions"; + + repeated uint64 position_ids = 1 + [ (gogoproto.moretags) = "yaml:\"position_ids\"" ]; + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string new_owner = 3 [ (gogoproto.moretags) = "yaml:\"new_owner\"" ]; +} + +message MsgTransferPositionsResponse {} \ No newline at end of file diff --git a/x/concentrated-liquidity/client/cli/tx.go b/x/concentrated-liquidity/client/cli/tx.go index 3e5035c207f..3d28dfec294 100644 --- a/x/concentrated-liquidity/client/cli/tx.go +++ b/x/concentrated-liquidity/client/cli/tx.go @@ -30,6 +30,7 @@ func NewTxCmd() *cobra.Command { osmocli.AddTxCmd(txCmd, NewCollectSpreadRewardsCmd) osmocli.AddTxCmd(txCmd, NewCollectIncentivesCmd) osmocli.AddTxCmd(txCmd, NewFungifyChargedPositionsCmd) + osmocli.AddTxCmd(txCmd, NewTransferPositionsCmd) return txCmd } @@ -94,6 +95,14 @@ func NewFungifyChargedPositionsCmd() (*osmocli.TxCliDesc, *types.MsgFungifyCharg }, &types.MsgFungifyChargedPositions{} } +func NewTransferPositionsCmd() (*osmocli.TxCliDesc, *types.MsgTransferPositions) { + return &osmocli.TxCliDesc{ + Use: "transfer-positions [position-ids] [new-owner]", + Short: "transfer a list of concentrated liquidity positions to a new owner", + Example: "osmosisd tx concentratedliquidity transfer-positions 56,89,1011 osmo10fhdy8zhepstpwsr9l4a8yxuyggqmpqx4ktheq --from val --chain-id osmosis-1 -b block --keyring-backend test --fees 1000uosmo", + }, &types.MsgTransferPositions{} +} + // NewCmdCreateConcentratedLiquidityPoolsProposal implements a command handler for create concentrated liquidity pool proposal func NewCmdCreateConcentratedLiquidityPoolsProposal() *cobra.Command { cmd := &cobra.Command{ diff --git a/x/concentrated-liquidity/export_test.go b/x/concentrated-liquidity/export_test.go index 54c7b6f65c7..8387c15488c 100644 --- a/x/concentrated-liquidity/export_test.go +++ b/x/concentrated-liquidity/export_test.go @@ -328,3 +328,7 @@ func (k Keeper) SetupSwapStrategy(ctx sdk.Context, p types.ConcentratedPoolExten func MoveRewardsToNewPositionAndDeleteOldAcc(ctx sdk.Context, accum *accum.AccumulatorObject, oldPositionName, newPositionName string, growthOutside sdk.DecCoins) error { return moveRewardsToNewPositionAndDeleteOldAcc(accum, oldPositionName, newPositionName, growthOutside) } + +func (k Keeper) TransferPositions(ctx sdk.Context, positionIds []uint64, sender sdk.AccAddress, recipient sdk.AccAddress) error { + return k.transferPositions(ctx, positionIds, sender, recipient) +} diff --git a/x/concentrated-liquidity/msg_server.go b/x/concentrated-liquidity/msg_server.go index 1af37cf0aba..113c8f4ba0c 100644 --- a/x/concentrated-liquidity/msg_server.go +++ b/x/concentrated-liquidity/msg_server.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/osmomath" + "github.com/osmosis-labs/osmosis/osmoutils/osmocli" clmodel "github.com/osmosis-labs/osmosis/v19/x/concentrated-liquidity/model" "github.com/osmosis-labs/osmosis/v19/x/concentrated-liquidity/types" ) @@ -201,3 +202,39 @@ func (server msgServer) CollectIncentives(goCtx context.Context, msg *types.MsgC return &types.MsgCollectIncentivesResponse{CollectedIncentives: totalCollectedIncentives, ForfeitedIncentives: totalForefeitedIncentives}, nil } + +func (server msgServer) TransferPositions(goCtx context.Context, msg *types.MsgTransferPositions) (*types.MsgTransferPositionsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + + newOwner, err := sdk.AccAddressFromBech32(msg.NewOwner) + if err != nil { + return nil, err + } + + err = server.keeper.transferPositions(ctx, msg.PositionIds, sender, newOwner) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + ), + sdk.NewEvent( + types.TypeEvtTransferPositions, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + sdk.NewAttribute(types.AttributeNewOwner, msg.NewOwner), + sdk.NewAttribute(types.AttributeInputPositionIds, osmocli.ParseUint64SliceToString(msg.PositionIds)), + ), + }) + + return &types.MsgTransferPositionsResponse{}, nil +} diff --git a/x/concentrated-liquidity/msg_server_test.go b/x/concentrated-liquidity/msg_server_test.go index 88f9c6c4ebe..678b9f6d929 100644 --- a/x/concentrated-liquidity/msg_server_test.go +++ b/x/concentrated-liquidity/msg_server_test.go @@ -545,3 +545,88 @@ func (s *KeeperTestSuite) TestFungify_Events() { }) } } + +func (s *KeeperTestSuite) TestTransferPositions_Events() { + testcases := map[string]struct { + positionIds []uint64 + numPositionsToCreate int + shouldSetupUnownedPosition bool + expectedTransferPositionsEvent int + expectedMessageEvents int + expectedError error + }{ + "single position ID": { + positionIds: []uint64{DefaultPositionId}, + numPositionsToCreate: 1, + expectedTransferPositionsEvent: 1, + expectedMessageEvents: 2, // 1 for transfer, 1 for collect spread rewards (calls event even when no spread rewards) + }, + "two position IDs": { + positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, + numPositionsToCreate: 2, + expectedTransferPositionsEvent: 1, + expectedMessageEvents: 3, // 1 for transfer, 2 for collect spread rewards (calls event even when no spread rewards) + }, + "three position IDs": { + positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, + numPositionsToCreate: 3, + expectedTransferPositionsEvent: 1, + expectedMessageEvents: 4, // 1 for transfer, 3 for collect spread rewards (calls event even when no spread rewards) + }, + "two position IDs, second ID does not exist": { + positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, + numPositionsToCreate: 1, + expectedError: types.PositionIdNotFoundError{PositionId: DefaultPositionId + 1}, + }, + "three position IDs, not an owner of one of them": { + positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, + numPositionsToCreate: 2, + shouldSetupUnownedPosition: true, + expectedError: types.NotPositionOwnerError{}, + }, + } + + for name, tc := range testcases { + s.Run(name, func() { + s.SetupTest() + ctx := s.Ctx + + // Create a cl pool with a default position + pool := s.PrepareConcentratedPool() + for i := 0; i < tc.numPositionsToCreate; i++ { + s.SetupDefaultPosition(pool.GetId()) + } + + if tc.shouldSetupUnownedPosition { + // Position from another account. + s.SetupDefaultPositionAcc(pool.GetId(), s.TestAccs[1]) + } + + msgServer := cl.NewMsgServerImpl(s.App.ConcentratedLiquidityKeeper) + + // Reset event counts to 0 by creating a new manager. + ctx = ctx.WithEventManager(sdk.NewEventManager()) + s.Equal(0, len(ctx.EventManager().Events())) + + msg := &types.MsgTransferPositions{ + PositionIds: tc.positionIds, + Sender: s.TestAccs[0].String(), + NewOwner: s.TestAccs[1].String(), + } + + // System under test + response, err := msgServer.TransferPositions(sdk.WrapSDKContext(ctx), msg) + + if tc.expectedError == nil { + s.Require().NoError(err) + s.Require().NotNil(response) + s.AssertEventEmitted(ctx, types.TypeEvtTransferPositions, tc.expectedTransferPositionsEvent) + s.AssertEventEmitted(ctx, sdk.EventTypeMessage, tc.expectedMessageEvents) + } else { + s.Require().Error(err) + s.Require().ErrorAs(err, &tc.expectedError) + s.Require().Nil(response) + } + }) + } +} diff --git a/x/concentrated-liquidity/position.go b/x/concentrated-liquidity/position.go index 0f4844cb41a..2798ed10ddb 100644 --- a/x/concentrated-liquidity/position.go +++ b/x/concentrated-liquidity/position.go @@ -14,6 +14,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils" "github.com/osmosis-labs/osmosis/osmoutils/accum" + "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" "github.com/osmosis-labs/osmosis/v19/x/concentrated-liquidity/model" "github.com/osmosis-labs/osmosis/v19/x/concentrated-liquidity/types" lockuptypes "github.com/osmosis-labs/osmosis/v19/x/lockup/types" @@ -23,6 +24,11 @@ const MinNumPositions = 2 var emptyOptions = &accum.Options{} +type PositionWithWithdrawnAmount struct { + Position model.Position + CoinsWithdrawn sdk.Coins +} + // getOrInitPosition retrieves the position's liquidity for the given tick range. // If it doesn't exist, it returns zero. func (k Keeper) getOrInitPosition( @@ -664,3 +670,123 @@ func (k Keeper) updateFullRangeLiquidityInPool(ctx sdk.Context, poolId uint64, l osmoutils.MustSetDec(store, poolIdLiquidityKey, newTotalFullRangeLiquidity) return nil } + +// // transferPositions transfers the ownership of a set of positions from one account to another. +// // It first withdraws all the positions from the sender's account, accumulating the total amount of tokens withdrawn. +// // Then, it sends the total withdrawn tokens to the recipient's account. +// // Finally, it recreates the positions under the recipient's account, maintaining the same properties as the original positions. +// // +// // Parameters: +// // - ctx: The context of the operation. +// // - positionIds: A slice of position IDs to be transferred. +// // - sender: The account address of the current owner of the positions. +// // - recipient: The account address of the new owner of the positions. +// // +// // Returns: +// // - A slice of new position IDs created under the recipient's account. +// // - An error if any operation fails, such as withdrawing a position, sending coins, or creating a new position. +// func (k Keeper) transferPositions(ctx sdk.Context, positionIds []uint64, sender sdk.AccAddress, recipient sdk.AccAddress) ([]uint64, error) { +// if !osmoassert.Uint64ArrayValuesAreUnique(positionIds) { +// return nil, types.DuplicatePositionIdsError{PositionIds: positionIds} +// } + +// withdrawnPositions := []PositionWithWithdrawnAmount{} +// totalCoinsWithdrawn := sdk.NewCoins() + +// // We first withdraw all the positions, and store the position and withdraw amounts. +// // This allows us to do a single bank send at the end, which is more efficient. +// for _, positionId := range positionIds { +// position, err := k.GetPosition(ctx, positionId) +// if err != nil { +// return nil, err +// } + +// // Get the pool from the position so we know what denoms we are dealing with. +// pool, err := k.GetConcentratedPoolById(ctx, position.PoolId) +// if err != nil { +// return nil, err +// } + +// // Withdraw the entire position. +// // This also acts as a pseudo owner check, since if the sender does not match the position owner, the withdraw will fail. +// amt0, amt1, err := k.WithdrawPosition(ctx, sender, positionId, position.Liquidity) +// if err != nil { +// return nil, err +// } + +// withdrawnCoins := sdk.NewCoins(sdk.NewCoin(pool.GetToken0(), amt0), sdk.NewCoin(pool.GetToken1(), amt1)) +// totalCoinsWithdrawn = totalCoinsWithdrawn.Add(withdrawnCoins...) + +// withdrawnPositions = append(withdrawnPositions, PositionWithWithdrawnAmount{ +// Position: position, +// CoinsWithdrawn: withdrawnCoins, +// }) +// } + +// // Send the total withdrawn tokens to the recipient. +// err := k.bankKeeper.SendCoins(ctx, sender, recipient, totalCoinsWithdrawn) +// if err != nil { +// return nil, err +// } + +// // Recreate the positions with the recipient as the owner. +// newPositionIds := []uint64{} +// for _, wp := range withdrawnPositions { +// newPosition, err := k.CreatePosition(ctx, wp.Position.PoolId, recipient, wp.CoinsWithdrawn, osmomath.ZeroInt(), osmomath.ZeroInt(), wp.Position.LowerTick, wp.Position.UpperTick) +// if err != nil { +// return nil, err +// } +// newPositionIds = append(newPositionIds, newPosition.ID) +// } + +// return newPositionIds, nil +// } + +func (k Keeper) transferPositions(ctx sdk.Context, positionIds []uint64, sender sdk.AccAddress, recipient sdk.AccAddress) error { + if !osmoassert.Uint64ArrayValuesAreUnique(positionIds) { + return types.DuplicatePositionIdsError{PositionIds: positionIds} + } + + for _, positionId := range positionIds { + position, err := k.GetPosition(ctx, positionId) + if err != nil { + return err + } + + // Check that the sender is the owner of the position. + if position.Address != sender.String() { + return types.PositionOwnerMismatchError{PositionOwner: position.Address, Sender: sender.String()} + } + + // If the position has an active underlying lock, we cannot transfer it. + positionHasActiveUnderlyingLock, lockId, err := k.positionHasActiveUnderlyingLockAndUpdate(ctx, positionId) + if err != nil { + return err + } + if positionHasActiveUnderlyingLock { + return types.LockNotMatureError{PositionId: position.PositionId, LockId: lockId} + } + + // Collect any outstanding incentives and rewards for the position. + if _, err := k.collectSpreadRewards(ctx, sender, positionId); err != nil { + return err + } + if _, _, err := k.collectIncentives(ctx, sender, positionId); err != nil { + return err + } + + // Delete the KVStore entries for the position. + err = k.deletePosition(ctx, positionId, sender, position.PoolId) + if err != nil { + return err + } + + // Restore the position under the recipient's account. + err = k.SetPosition(ctx, position.PoolId, recipient, position.LowerTick, position.UpperTick, position.JoinTime, position.Liquidity, position.PositionId, 0) + if err != nil { + return err + } + } + + return nil +} diff --git a/x/concentrated-liquidity/position_test.go b/x/concentrated-liquidity/position_test.go index b2149c414b5..2e2d2260c4b 100644 --- a/x/concentrated-liquidity/position_test.go +++ b/x/concentrated-liquidity/position_test.go @@ -2245,3 +2245,173 @@ func (s *KeeperTestSuite) TestNegativeTickRange_SpreadFactor() { s.clk.InitGenesis(s.Ctx, *export) } + +// func (s *KeeperTestSuite) TestTransferPositions() { +// testcases := map[string]struct { +// positionIds []uint64 +// numPositionsToCreate int +// shouldSetupUnownedPosition bool +// expectedError error +// }{ +// "single position ID": { +// positionIds: []uint64{DefaultPositionId}, +// numPositionsToCreate: 1, +// }, +// "two position IDs": { +// positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, +// numPositionsToCreate: 2, +// }, +// "three position IDs": { +// positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, +// numPositionsToCreate: 3, +// }, +// "two position IDs, second ID does not exist": { +// positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, +// numPositionsToCreate: 1, +// expectedError: types.PositionIdNotFoundError{PositionId: DefaultPositionId + 1}, +// }, +// "three position IDs, not an owner of one of them": { +// positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, +// numPositionsToCreate: 2, +// shouldSetupUnownedPosition: true, +// expectedError: types.NotPositionOwnerError{}, +// }, +// } + +// for name, tc := range testcases { +// s.Run(name, func() { +// s.SetupTest() + +// lastPositionId := 0 + +// // Create a cl pool with a default position +// pool := s.PrepareConcentratedPool() +// for i := 0; i < tc.numPositionsToCreate; i++ { +// s.SetupDefaultPosition(pool.GetId()) +// lastPositionId++ +// } + +// if tc.shouldSetupUnownedPosition { +// // Position from another account. +// s.SetupDefaultPositionAcc(pool.GetId(), s.TestAccs[1]) +// lastPositionId++ +// } + +// initialUserPositions, err := s.App.ConcentratedLiquidityKeeper.GetUserPositions(s.Ctx, s.TestAccs[0], 1) +// s.Require().NoError(err) + +// newOwnerBalancePre := s.App.BankKeeper.GetAllBalances(s.Ctx, s.TestAccs[1]) + +// // System under test +// newPositionIds, err := s.App.ConcentratedLiquidityKeeper.TransferPositions(s.Ctx, tc.positionIds, s.TestAccs[0], s.TestAccs[1]) + +// if tc.expectedError != nil { +// s.Require().Error(err) +// s.Require().ErrorAs(err, &tc.expectedError) +// } else { +// s.Require().NoError(err) + +// s.Require().Equal(lastPositionId, len(newPositionIds)) +// for i, newPositionId := range newPositionIds { +// newPosition, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, newPositionId) +// s.Require().NoError(err) + +// // All the following should be the same in the new position as it was in the old one. +// s.Require().Equal(initialUserPositions[i].UpperTick, newPosition.UpperTick) +// s.Require().Equal(initialUserPositions[i].LowerTick, newPosition.LowerTick) +// s.Require().Equal(initialUserPositions[i].PoolId, newPosition.PoolId) + +// // The new position should have the new owner +// s.Require().Equal(s.TestAccs[1].String(), newPosition.Address) + +// // NOTE: Liquidity values are not the same between positions, +// newOwnerBalancePost := s.App.BankKeeper.GetAllBalances(s.Ctx, s.TestAccs[1]) +// fmt.Println("newOwnerBalancePost", newOwnerBalancePost) +// fmt.Println("newOwnerBalancePre", newOwnerBalancePre) +// } +// } +// }) +// } +// } + +func (s *KeeperTestSuite) TestTransferPositions() { + testcases := map[string]struct { + positionIds []uint64 + numPositionsToCreate int + shouldSetupUnownedPosition bool + expectedError error + }{ + "single position ID": { + positionIds: []uint64{DefaultPositionId}, + numPositionsToCreate: 1, + }, + "two position IDs": { + positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, + numPositionsToCreate: 2, + }, + "three position IDs": { + positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, + numPositionsToCreate: 3, + }, + "two position IDs, second ID does not exist": { + positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, + numPositionsToCreate: 1, + expectedError: types.PositionIdNotFoundError{PositionId: DefaultPositionId + 1}, + }, + "three position IDs, not an owner of one of them": { + positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, + numPositionsToCreate: 2, + shouldSetupUnownedPosition: true, + expectedError: types.NotPositionOwnerError{}, + }, + } + + for name, tc := range testcases { + s.Run(name, func() { + s.SetupTest() + + lastPositionId := 0 + + // Create a cl pool with a default position + pool := s.PrepareConcentratedPool() + for i := 0; i < tc.numPositionsToCreate; i++ { + s.SetupDefaultPosition(pool.GetId()) + lastPositionId++ + } + + if tc.shouldSetupUnownedPosition { + // Position from another account. + s.SetupDefaultPositionAcc(pool.GetId(), s.TestAccs[1]) + lastPositionId++ + } + + initialUserPositions, err := s.App.ConcentratedLiquidityKeeper.GetUserPositions(s.Ctx, s.TestAccs[0], 1) + s.Require().NoError(err) + + // System under test + err = s.App.ConcentratedLiquidityKeeper.TransferPositions(s.Ctx, tc.positionIds, s.TestAccs[0], s.TestAccs[1]) + + if tc.expectedError != nil { + s.Require().Error(err) + s.Require().ErrorAs(err, &tc.expectedError) + } else { + s.Require().NoError(err) + + for i := 0; i < lastPositionId; i++ { + newPosition, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, uint64(i+1)) + s.Require().NoError(err) + + // All position values except the owner should be the same in the new position as it was in the old one. + s.Require().Equal(initialUserPositions[i].UpperTick, newPosition.UpperTick) + s.Require().Equal(initialUserPositions[i].LowerTick, newPosition.LowerTick) + s.Require().Equal(initialUserPositions[i].PoolId, newPosition.PoolId) + s.Require().Equal(initialUserPositions[i].JoinTime, newPosition.JoinTime) + s.Require().Equal(initialUserPositions[i].Liquidity, newPosition.Liquidity) + + // The new position should have the new owner + s.Require().Equal(s.TestAccs[1].String(), newPosition.Address) + } + } + }) + } +} diff --git a/x/concentrated-liquidity/types/errors.go b/x/concentrated-liquidity/types/errors.go index fcff58c65d6..1e7c0f15c05 100644 --- a/x/concentrated-liquidity/types/errors.go +++ b/x/concentrated-liquidity/types/errors.go @@ -896,3 +896,11 @@ type NumberOfTicksExceedsMaxError struct { func (e NumberOfTicksExceedsMaxError) Error() string { return fmt.Sprintf("number of ticks exceeds max ticks. Provided number of ticks (%d), max ticks (%d)", e.NumberOfTicks, e.MaxNumberOfTicks) } + +type DuplicatePositionIdsError struct { + PositionIds []uint64 +} + +func (e DuplicatePositionIdsError) Error() string { + return fmt.Sprintf("duplicate position ids found (%v)", e.PositionIds) +} diff --git a/x/concentrated-liquidity/types/events.go b/x/concentrated-liquidity/types/events.go index aaf8d9d0099..e24838d334f 100644 --- a/x/concentrated-liquidity/types/events.go +++ b/x/concentrated-liquidity/types/events.go @@ -12,6 +12,7 @@ const ( TypeEvtFungifyChargedPosition = "fungify_charged_position" TypeEvtMoveRewards = "move_rewards" TypeEvtCrossTick = "cross_tick" + TypeEvtTransferPositions = "transfer_positions" AttributeValueCategory = ModuleName AttributeKeyPositionId = "position_id" @@ -46,4 +47,5 @@ const ( AttributeKeyTickIndex = "tick_idx" AttributeKeySpreadRewardGrowthOppositeDirectionOfLastTraversal = "spread_reward_growth" AttributeKeyUptimeGrowthOppositeDirectionOfLastTraversal = "uptime_growth" + AttributeNewOwner = "new_owner" ) diff --git a/x/concentrated-liquidity/types/msgs.go b/x/concentrated-liquidity/types/msgs.go index 429cd028c1c..89cbd182e94 100644 --- a/x/concentrated-liquidity/types/msgs.go +++ b/x/concentrated-liquidity/types/msgs.go @@ -7,6 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/osmomath" + "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" ) // constants. @@ -17,6 +18,7 @@ const ( TypeMsgCollectSpreadRewards = "collect-spread-rewards" TypeMsgCollectIncentives = "collect-incentives" TypeMsgFungifyChargedPositions = "fungify-charged-positions" + TypeMsgTransferPositions = "transfer-positions" ) var _ sdk.Msg = &MsgCreatePosition{} @@ -223,3 +225,45 @@ func (msg MsgFungifyChargedPositions) GetSigners() []sdk.AccAddress { } return []sdk.AccAddress{sender} } + +var _ sdk.Msg = &MsgTransferPositions{} + +func (msg MsgTransferPositions) Route() string { return RouterKey } +func (msg MsgTransferPositions) Type() string { return TypeMsgTransferPositions } +func (msg MsgTransferPositions) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return fmt.Errorf("Invalid sender address (%s)", err) + } + + _, err = sdk.AccAddressFromBech32(msg.NewOwner) + if err != nil { + return fmt.Errorf("Invalid new owner address (%s)", err) + } + + if msg.Sender == msg.NewOwner { + return fmt.Errorf("Sender and new owner cannot be the same (%s)", msg.Sender) + } + + if !osmoassert.Uint64ArrayValuesAreUnique(msg.PositionIds) { + return fmt.Errorf("Position IDs must be unique, got %v", msg.PositionIds) + } + + if len(msg.PositionIds) < 1 { + return fmt.Errorf("Must provide at least 1 position ID, got %d", len(msg.PositionIds)) + } + + return nil +} + +func (msg MsgTransferPositions) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +} + +func (msg MsgTransferPositions) GetSigners() []sdk.AccAddress { + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{sender} +} diff --git a/x/concentrated-liquidity/types/msgs_test.go b/x/concentrated-liquidity/types/msgs_test.go index f2fe1f505c8..4797eef0dcb 100644 --- a/x/concentrated-liquidity/types/msgs_test.go +++ b/x/concentrated-liquidity/types/msgs_test.go @@ -21,13 +21,18 @@ type extMsg interface { Type() string } -var addr1 string -var invalidAddr sdk.AccAddress +var ( + addr1 string + addr2 string + invalidAddr sdk.AccAddress +) func init() { appParams.SetAddressPrefixes() pk1 := ed25519.GenPrivKey().PubKey() addr1 = sdk.AccAddress(pk1.Address()).String() + pk2 := ed25519.GenPrivKey().PubKey() + addr2 = sdk.AccAddress(pk2.Address()).String() invalidAddr = sdk.AccAddress("invalid") } @@ -364,3 +369,68 @@ func TestConcentratedLiquiditySerialization(t *testing.T) { }) } } + +func TestMsgTransferPositions(t *testing.T) { + tests := []struct { + name string + msg types.MsgTransferPositions + expectPass bool + }{ + { + name: "proper msg", + msg: types.MsgTransferPositions{ + PositionIds: []uint64{1, 2, 5, 9, 20}, + Sender: addr1, + NewOwner: addr2, + }, + expectPass: true, + }, + { + name: "position ids are not unique", + msg: types.MsgTransferPositions{ + PositionIds: []uint64{1, 2, 5, 9, 1}, + Sender: addr1, + NewOwner: addr2, + }, + expectPass: false, + }, + { + name: "no position ids", + msg: types.MsgTransferPositions{ + Sender: addr1, + NewOwner: addr2, + }, + expectPass: false, + }, + { + name: "invalid sender", + msg: types.MsgTransferPositions{ + PositionIds: []uint64{1, 2, 5, 9, 20}, + Sender: invalidAddr.String(), + NewOwner: addr2, + }, + expectPass: false, + }, + { + name: "invalid new owner", + msg: types.MsgTransferPositions{ + PositionIds: []uint64{1, 2, 5, 9, 20}, + Sender: addr1, + NewOwner: invalidAddr.String(), + }, + expectPass: false, + }, + { + name: "sender and new owner are the same", + msg: types.MsgTransferPositions{ + PositionIds: []uint64{1, 2, 5, 9, 20}, + Sender: addr1, + NewOwner: addr1, + }, + expectPass: false, + }, + } + for _, test := range tests { + runValidateBasicTest(t, test.name, &test.msg, test.expectPass, types.TypeMsgTransferPositions) + } +} diff --git a/x/concentrated-liquidity/types/tx.pb.go b/x/concentrated-liquidity/types/tx.pb.go index e15a0cef088..6ad73be6cb2 100644 --- a/x/concentrated-liquidity/types/tx.pb.go +++ b/x/concentrated-liquidity/types/tx.pb.go @@ -687,6 +687,103 @@ func (m *MsgFungifyChargedPositionsResponse) GetNewPositionId() uint64 { return 0 } +// ===================== MsgTransferPositions +type MsgTransferPositions struct { + PositionIds []uint64 `protobuf:"varint,1,rep,packed,name=position_ids,json=positionIds,proto3" json:"position_ids,omitempty" yaml:"position_ids"` + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` + NewOwner string `protobuf:"bytes,3,opt,name=new_owner,json=newOwner,proto3" json:"new_owner,omitempty" yaml:"new_owner"` +} + +func (m *MsgTransferPositions) Reset() { *m = MsgTransferPositions{} } +func (m *MsgTransferPositions) String() string { return proto.CompactTextString(m) } +func (*MsgTransferPositions) ProtoMessage() {} +func (*MsgTransferPositions) Descriptor() ([]byte, []int) { + return fileDescriptor_1f1fff802923d7db, []int{12} +} +func (m *MsgTransferPositions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferPositions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferPositions.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 *MsgTransferPositions) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferPositions.Merge(m, src) +} +func (m *MsgTransferPositions) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferPositions) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferPositions.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferPositions proto.InternalMessageInfo + +func (m *MsgTransferPositions) GetPositionIds() []uint64 { + if m != nil { + return m.PositionIds + } + return nil +} + +func (m *MsgTransferPositions) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgTransferPositions) GetNewOwner() string { + if m != nil { + return m.NewOwner + } + return "" +} + +type MsgTransferPositionsResponse struct { +} + +func (m *MsgTransferPositionsResponse) Reset() { *m = MsgTransferPositionsResponse{} } +func (m *MsgTransferPositionsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTransferPositionsResponse) ProtoMessage() {} +func (*MsgTransferPositionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1f1fff802923d7db, []int{13} +} +func (m *MsgTransferPositionsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferPositionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferPositionsResponse.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 *MsgTransferPositionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferPositionsResponse.Merge(m, src) +} +func (m *MsgTransferPositionsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferPositionsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferPositionsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferPositionsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreatePosition)(nil), "osmosis.concentratedliquidity.v1beta1.MsgCreatePosition") proto.RegisterType((*MsgCreatePositionResponse)(nil), "osmosis.concentratedliquidity.v1beta1.MsgCreatePositionResponse") @@ -700,6 +797,8 @@ func init() { proto.RegisterType((*MsgCollectIncentivesResponse)(nil), "osmosis.concentratedliquidity.v1beta1.MsgCollectIncentivesResponse") proto.RegisterType((*MsgFungifyChargedPositions)(nil), "osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositions") proto.RegisterType((*MsgFungifyChargedPositionsResponse)(nil), "osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositionsResponse") + proto.RegisterType((*MsgTransferPositions)(nil), "osmosis.concentratedliquidity.v1beta1.MsgTransferPositions") + proto.RegisterType((*MsgTransferPositionsResponse)(nil), "osmosis.concentratedliquidity.v1beta1.MsgTransferPositionsResponse") } func init() { @@ -707,81 +806,85 @@ func init() { } var fileDescriptor_1f1fff802923d7db = []byte{ - // 1174 bytes of a gzipped FileDescriptorProto + // 1240 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58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af, + 0x5a, 0xde, 0x9d, 0xd0, 0x4c, 0xfb, 0x3f, 0x14, 0xbd, 0xfc, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x9b, 0xb6, 0x78, 0x49, 0x04, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -806,6 +909,7 @@ type MsgClient interface { AddToPosition(ctx context.Context, in *MsgAddToPosition, opts ...grpc.CallOption) (*MsgAddToPositionResponse, error) CollectSpreadRewards(ctx context.Context, in *MsgCollectSpreadRewards, opts ...grpc.CallOption) (*MsgCollectSpreadRewardsResponse, error) CollectIncentives(ctx context.Context, in *MsgCollectIncentives, opts ...grpc.CallOption) (*MsgCollectIncentivesResponse, error) + TransferPositions(ctx context.Context, in *MsgTransferPositions, opts ...grpc.CallOption) (*MsgTransferPositionsResponse, error) } type msgClient struct { @@ -861,6 +965,15 @@ func (c *msgClient) CollectIncentives(ctx context.Context, in *MsgCollectIncenti return out, nil } +func (c *msgClient) TransferPositions(ctx context.Context, in *MsgTransferPositions, opts ...grpc.CallOption) (*MsgTransferPositionsResponse, error) { + out := new(MsgTransferPositionsResponse) + err := c.cc.Invoke(ctx, "/osmosis.concentratedliquidity.v1beta1.Msg/TransferPositions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { CreatePosition(context.Context, *MsgCreatePosition) (*MsgCreatePositionResponse, error) @@ -873,6 +986,7 @@ type MsgServer interface { AddToPosition(context.Context, *MsgAddToPosition) (*MsgAddToPositionResponse, error) CollectSpreadRewards(context.Context, *MsgCollectSpreadRewards) (*MsgCollectSpreadRewardsResponse, error) CollectIncentives(context.Context, *MsgCollectIncentives) (*MsgCollectIncentivesResponse, error) + TransferPositions(context.Context, *MsgTransferPositions) (*MsgTransferPositionsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -894,6 +1008,9 @@ func (*UnimplementedMsgServer) CollectSpreadRewards(ctx context.Context, req *Ms func (*UnimplementedMsgServer) CollectIncentives(ctx context.Context, req *MsgCollectIncentives) (*MsgCollectIncentivesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CollectIncentives not implemented") } +func (*UnimplementedMsgServer) TransferPositions(ctx context.Context, req *MsgTransferPositions) (*MsgTransferPositionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransferPositions not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -989,6 +1106,24 @@ func _Msg_CollectIncentives_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Msg_TransferPositions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransferPositions) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).TransferPositions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.concentratedliquidity.v1beta1.Msg/TransferPositions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TransferPositions(ctx, req.(*MsgTransferPositions)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "osmosis.concentratedliquidity.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -1013,6 +1148,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "CollectIncentives", Handler: _Msg_CollectIncentives_Handler, }, + { + MethodName: "TransferPositions", + Handler: _Msg_TransferPositions_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "osmosis/concentrated-liquidity/tx.proto", @@ -1636,6 +1775,84 @@ func (m *MsgFungifyChargedPositionsResponse) MarshalToSizedBuffer(dAtA []byte) ( return len(dAtA) - i, nil } +func (m *MsgTransferPositions) 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 *MsgTransferPositions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferPositions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NewOwner) > 0 { + i -= len(m.NewOwner) + copy(dAtA[i:], m.NewOwner) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewOwner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x12 + } + if len(m.PositionIds) > 0 { + dAtA8 := make([]byte, len(m.PositionIds)*10) + var j7 int + for _, num := range m.PositionIds { + for num >= 1<<7 { + dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j7++ + } + dAtA8[j7] = uint8(num) + j7++ + } + i -= j7 + copy(dAtA[i:], dAtA8[:j7]) + i = encodeVarintTx(dAtA, i, uint64(j7)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTransferPositionsResponse) 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 *MsgTransferPositionsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferPositionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1882,6 +2099,39 @@ func (m *MsgFungifyChargedPositionsResponse) Size() (n int) { return n } +func (m *MsgTransferPositions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PositionIds) > 0 { + l = 0 + for _, e := range m.PositionIds { + l += sovTx(uint64(e)) + } + n += 1 + sovTx(uint64(l)) + l + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.NewOwner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTransferPositionsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3710,6 +3960,246 @@ func (m *MsgFungifyChargedPositionsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgTransferPositions) 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 ErrIntOverflowTx + } + 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: MsgTransferPositions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferPositions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PositionIds = append(m.PositionIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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.PositionIds) == 0 { + m.PositionIds = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PositionIds = append(m.PositionIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field PositionIds", wireType) + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewOwner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewOwner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTransferPositionsResponse) 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 ErrIntOverflowTx + } + 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: MsgTransferPositionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferPositionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 3c0dbd45cf0c413c7639855862871a166af1748b Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 3 Oct 2023 04:06:10 +0000 Subject: [PATCH 02/34] Auto: update go.mod after push to adam/transfer-position-cl that modified dependencies locally --- go.mod | 2 +- go.sum | 4 ++-- osmomath/go.mod | 11 +++++------ osmomath/go.sum | 16 +++++----------- osmoutils/go.mod | 10 +++++----- osmoutils/go.sum | 15 +++++---------- tests/cl-genesis-positions/go.mod | 10 +++++----- tests/cl-genesis-positions/go.sum | 15 +++++---------- tests/cl-go-client/go.mod | 10 +++++----- tests/cl-go-client/go.sum | 15 +++++---------- x/epochs/go.mod | 12 ++++++------ x/epochs/go.sum | 19 +++++++------------ x/ibc-hooks/go.mod | 12 ++++++------ x/ibc-hooks/go.sum | 19 +++++++------------ 14 files changed, 69 insertions(+), 101 deletions(-) diff --git a/go.mod b/go.mod index 395affa854f..d6ed89b9f7b 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/ory/dockertest/v3 v3.10.0 github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20230924192433-36cf2950dca4 - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7 + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51 github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230911120014-b14342e08daf github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230911120014-b14342e08daf github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 42b42b5e688..53904c2c376 100644 --- a/go.sum +++ b/go.sum @@ -966,8 +966,8 @@ github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 h1:Ylmch 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.7-0.20230924192433-36cf2950dca4 h1:venI3u6DjxKcQbjiCO3V8s0ww/jx+cAZRkpwLHadms8= github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20230924192433-36cf2950dca4/go.mod h1:IlCTpM2uoi8SUAigc9r9kAaoz7K5H9O84u7CwaTLDdY= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7 h1:E5rwhxKEt6XOIfLkoLNiqCCFNCymJjiwMYIP+0ABMKM= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51 h1:iMcTtxurvgua69sd0jSqsWVimIc05BEIuQUfTQl3V8Y= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230911120014-b14342e08daf h1:8lkIsAj3L7zxvOZbqVLNJRpSdDxaYhYfAIG7XjPaJiU= github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230911120014-b14342e08daf/go.mod h1:C0Uqe6X4N5ASA+1xZ6guaaJyUVKLcaVJIQa4Q4LG9Vk= github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230911120014-b14342e08daf h1:ZEi+yJJPgpYtmNwZ1bMiP5cMBDQ83FK/YGgmTnWmoAI= diff --git a/osmomath/go.mod b/osmomath/go.mod index c7780636201..cae414bbc34 100644 --- a/osmomath/go.mod +++ b/osmomath/go.mod @@ -3,7 +3,7 @@ module github.com/osmosis-labs/osmosis/osmomath go 1.20 require ( - cosmossdk.io/math v1.1.3-rc.0 + cosmossdk.io/math v1.1.3-rc.1 github.com/cosmos/cosmos-sdk v0.47.5 github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230911115719-1d5a34978fe1 github.com/stretchr/testify v1.8.4 @@ -53,11 +53,10 @@ require ( github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect + github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/cast v1.5.1 // indirect diff --git a/osmomath/go.sum b/osmomath/go.sum index df127c3be99..c244d7d54a2 100644 --- a/osmomath/go.sum +++ b/osmomath/go.sum @@ -34,8 +34,7 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/math v1.1.3-rc.0 h1:lut7IbQGuqog4vEIHSB7ivtwwIr6rHrt5yoVowmtoDs= -cosmossdk.io/math v1.1.3-rc.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +cosmossdk.io/math v1.1.3-rc.1 h1:NebCNWDqb1MJRNfvxr4YY7d8FSYgkuB3L75K6xvM+Zo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= @@ -315,23 +314,19 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= @@ -339,7 +334,6 @@ github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5 github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= diff --git a/osmoutils/go.mod b/osmoutils/go.mod index 04af31602af..74ebaee80b2 100644 --- a/osmoutils/go.mod +++ b/osmoutils/go.mod @@ -3,7 +3,7 @@ module github.com/osmosis-labs/osmosis/osmoutils go 1.20 require ( - cosmossdk.io/math v1.1.3-rc.0 + cosmossdk.io/math v1.1.3-rc.1 github.com/cosmos/cosmos-sdk v0.47.5 github.com/cosmos/iavl v0.19.7 github.com/cosmos/ibc-go/v4 v4.3.1 @@ -97,10 +97,10 @@ require ( github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/regen-network/cosmos-proto v0.3.1 // indirect diff --git a/osmoutils/go.sum b/osmoutils/go.sum index f9a1eebb22d..f254fd7b6e9 100644 --- a/osmoutils/go.sum +++ b/osmoutils/go.sum @@ -40,8 +40,7 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/math v1.1.3-rc.0 h1:lut7IbQGuqog4vEIHSB7ivtwwIr6rHrt5yoVowmtoDs= -cosmossdk.io/math v1.1.3-rc.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +cosmossdk.io/math v1.1.3-rc.1 h1:NebCNWDqb1MJRNfvxr4YY7d8FSYgkuB3L75K6xvM+Zo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -751,16 +750,14 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -769,16 +766,14 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= diff --git a/tests/cl-genesis-positions/go.mod b/tests/cl-genesis-positions/go.mod index b71fbc04918..7d51ebfa723 100644 --- a/tests/cl-genesis-positions/go.mod +++ b/tests/cl-genesis-positions/go.mod @@ -13,7 +13,7 @@ require ( require ( cosmossdk.io/errors v1.0.0 // indirect - cosmossdk.io/math v1.1.3-rc.0 // indirect + cosmossdk.io/math v1.1.3-rc.1 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -106,10 +106,10 @@ require ( github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/regen-network/cosmos-proto v0.3.1 // indirect diff --git a/tests/cl-genesis-positions/go.sum b/tests/cl-genesis-positions/go.sum index d212c446798..7590007cc71 100644 --- a/tests/cl-genesis-positions/go.sum +++ b/tests/cl-genesis-positions/go.sum @@ -40,8 +40,7 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/math v1.1.3-rc.0 h1:lut7IbQGuqog4vEIHSB7ivtwwIr6rHrt5yoVowmtoDs= -cosmossdk.io/math v1.1.3-rc.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +cosmossdk.io/math v1.1.3-rc.1 h1:NebCNWDqb1MJRNfvxr4YY7d8FSYgkuB3L75K6xvM+Zo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -759,16 +758,14 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -777,16 +774,14 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= diff --git a/tests/cl-go-client/go.mod b/tests/cl-go-client/go.mod index 22f505da9d0..7d7d5a8fbb1 100644 --- a/tests/cl-go-client/go.mod +++ b/tests/cl-go-client/go.mod @@ -14,7 +14,7 @@ require ( require ( cosmossdk.io/errors v1.0.0 // indirect - cosmossdk.io/math v1.1.3-rc.0 // indirect + cosmossdk.io/math v1.1.3-rc.1 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -94,10 +94,10 @@ require ( github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/regen-network/cosmos-proto v0.3.1 // indirect diff --git a/tests/cl-go-client/go.sum b/tests/cl-go-client/go.sum index 4db7af57b67..6413a1644fa 100644 --- a/tests/cl-go-client/go.sum +++ b/tests/cl-go-client/go.sum @@ -40,8 +40,7 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/math v1.1.3-rc.0 h1:lut7IbQGuqog4vEIHSB7ivtwwIr6rHrt5yoVowmtoDs= -cosmossdk.io/math v1.1.3-rc.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +cosmossdk.io/math v1.1.3-rc.1 h1:NebCNWDqb1MJRNfvxr4YY7d8FSYgkuB3L75K6xvM+Zo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -746,16 +745,14 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -764,16 +761,14 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= diff --git a/x/epochs/go.mod b/x/epochs/go.mod index ddda0507a06..809b175f71b 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -8,7 +8,7 @@ require ( github.com/golang/protobuf v1.5.3 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7 + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 github.com/tendermint/tendermint v0.37.0-rc1 @@ -18,7 +18,7 @@ require ( ) require ( - cosmossdk.io/math v1.1.3-rc.0 // indirect + cosmossdk.io/math v1.1.3-rc.1 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -93,10 +93,10 @@ require ( github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/regen-network/cosmos-proto v0.3.1 // indirect diff --git a/x/epochs/go.sum b/x/epochs/go.sum index 4009ebbb546..a669c2c0676 100644 --- a/x/epochs/go.sum +++ b/x/epochs/go.sum @@ -40,8 +40,7 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= -cosmossdk.io/math v1.1.3-rc.0 h1:lut7IbQGuqog4vEIHSB7ivtwwIr6rHrt5yoVowmtoDs= -cosmossdk.io/math v1.1.3-rc.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +cosmossdk.io/math v1.1.3-rc.1 h1:NebCNWDqb1MJRNfvxr4YY7d8FSYgkuB3L75K6xvM+Zo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -721,8 +720,8 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= github.com/osmosis-labs/osmosis/osmomath v0.0.6 h1:WNkVmeeudAqRFk5a4CChWsdxfiY/XLClT1i845L78ss= github.com/osmosis-labs/osmosis/osmomath v0.0.6/go.mod h1:UlftwozB+QObT3o0YfkuuyL9fsVdgoWt0dm6J7MLYnU= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7 h1:E5rwhxKEt6XOIfLkoLNiqCCFNCymJjiwMYIP+0ABMKM= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51 h1:iMcTtxurvgua69sd0jSqsWVimIc05BEIuQUfTQl3V8Y= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= github.com/osmosis-labs/osmosis/v19 v19.0.0 h1:gqcas/XfxtEuZXsWGTO9vNMHiY78Qs09FBQw73djIVM= github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= @@ -759,16 +758,14 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -777,16 +774,14 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= diff --git a/x/ibc-hooks/go.mod b/x/ibc-hooks/go.mod index 4f6e2ebc2c1..9992b69f653 100644 --- a/x/ibc-hooks/go.mod +++ b/x/ibc-hooks/go.mod @@ -12,14 +12,14 @@ require ( github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/osmosis-labs/osmosis/osmomath v0.0.6 - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7 + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51 github.com/spf13/cobra v1.7.0 github.com/tendermint/tendermint v0.37.0-rc1 google.golang.org/grpc v1.57.0 ) require ( - cosmossdk.io/math v1.1.3-rc.0 // indirect + cosmossdk.io/math v1.1.3-rc.1 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -99,10 +99,10 @@ require ( github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/regen-network/cosmos-proto v0.3.1 // indirect diff --git a/x/ibc-hooks/go.sum b/x/ibc-hooks/go.sum index ce4bde850ea..a93d8051ef0 100644 --- a/x/ibc-hooks/go.sum +++ b/x/ibc-hooks/go.sum @@ -41,8 +41,7 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/math v1.1.3-rc.0 h1:lut7IbQGuqog4vEIHSB7ivtwwIr6rHrt5yoVowmtoDs= -cosmossdk.io/math v1.1.3-rc.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +cosmossdk.io/math v1.1.3-rc.1 h1:NebCNWDqb1MJRNfvxr4YY7d8FSYgkuB3L75K6xvM+Zo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -733,8 +732,8 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= github.com/osmosis-labs/osmosis/osmomath v0.0.6 h1:WNkVmeeudAqRFk5a4CChWsdxfiY/XLClT1i845L78ss= github.com/osmosis-labs/osmosis/osmomath v0.0.6/go.mod h1:UlftwozB+QObT3o0YfkuuyL9fsVdgoWt0dm6J7MLYnU= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7 h1:E5rwhxKEt6XOIfLkoLNiqCCFNCymJjiwMYIP+0ABMKM= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51 h1:iMcTtxurvgua69sd0jSqsWVimIc05BEIuQUfTQl3V8Y= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16 h1:X747cZYdnqc/+RV48iPVeGprpVb/fUWSaKGsZUWrdbg= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16/go.mod h1:Rf8zW/GgBQyFRRB4s62VQHWA6sTlMFSjoDQQpoq64iI= github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE= @@ -772,16 +771,14 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -790,16 +787,14 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= From bca153330426bcc391e0f0dccc645b2f1f7a648e Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Mon, 2 Oct 2023 22:10:33 -0600 Subject: [PATCH 03/34] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa9084492b8..f67e84877ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#6468](https://github.com/osmosis-labs/osmosis/pull/6468) feat: remove osmo multihop discount * [#6420](https://github.com/osmosis-labs/osmosis/pull/6420) feat[CL]: Creates a governance set whitelist of addresses that can bypass the normal pool creation restrictions on concentrated liquidity pools +* [#6623](https://github.com/osmosis-labs/osmosis/pull/6420) feat: transfer cl position to new owner ### State Breaking From dff23159d2524105fca2ad6b6c48c0b786532b83 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 3 Oct 2023 09:31:22 -0600 Subject: [PATCH 04/34] remove commented out logic --- proto/osmosis/concentrated-liquidity/tx.proto | 2 +- x/concentrated-liquidity/position.go | 81 +++-------------- x/concentrated-liquidity/position_test.go | 88 ------------------- 3 files changed, 11 insertions(+), 160 deletions(-) diff --git a/proto/osmosis/concentrated-liquidity/tx.proto b/proto/osmosis/concentrated-liquidity/tx.proto index aaf86cda60b..5635d7cb7b6 100644 --- a/proto/osmosis/concentrated-liquidity/tx.proto +++ b/proto/osmosis/concentrated-liquidity/tx.proto @@ -235,4 +235,4 @@ message MsgTransferPositions { string new_owner = 3 [ (gogoproto.moretags) = "yaml:\"new_owner\"" ]; } -message MsgTransferPositionsResponse {} \ No newline at end of file +message MsgTransferPositionsResponse {} diff --git a/x/concentrated-liquidity/position.go b/x/concentrated-liquidity/position.go index 2798ed10ddb..97c03fff9da 100644 --- a/x/concentrated-liquidity/position.go +++ b/x/concentrated-liquidity/position.go @@ -671,78 +671,17 @@ func (k Keeper) updateFullRangeLiquidityInPool(ctx sdk.Context, poolId uint64, l return nil } -// // transferPositions transfers the ownership of a set of positions from one account to another. -// // It first withdraws all the positions from the sender's account, accumulating the total amount of tokens withdrawn. -// // Then, it sends the total withdrawn tokens to the recipient's account. -// // Finally, it recreates the positions under the recipient's account, maintaining the same properties as the original positions. -// // -// // Parameters: -// // - ctx: The context of the operation. -// // - positionIds: A slice of position IDs to be transferred. -// // - sender: The account address of the current owner of the positions. -// // - recipient: The account address of the new owner of the positions. -// // -// // Returns: -// // - A slice of new position IDs created under the recipient's account. -// // - An error if any operation fails, such as withdrawing a position, sending coins, or creating a new position. -// func (k Keeper) transferPositions(ctx sdk.Context, positionIds []uint64, sender sdk.AccAddress, recipient sdk.AccAddress) ([]uint64, error) { -// if !osmoassert.Uint64ArrayValuesAreUnique(positionIds) { -// return nil, types.DuplicatePositionIdsError{PositionIds: positionIds} -// } - -// withdrawnPositions := []PositionWithWithdrawnAmount{} -// totalCoinsWithdrawn := sdk.NewCoins() - -// // We first withdraw all the positions, and store the position and withdraw amounts. -// // This allows us to do a single bank send at the end, which is more efficient. -// for _, positionId := range positionIds { -// position, err := k.GetPosition(ctx, positionId) -// if err != nil { -// return nil, err -// } - -// // Get the pool from the position so we know what denoms we are dealing with. -// pool, err := k.GetConcentratedPoolById(ctx, position.PoolId) -// if err != nil { -// return nil, err -// } - -// // Withdraw the entire position. -// // This also acts as a pseudo owner check, since if the sender does not match the position owner, the withdraw will fail. -// amt0, amt1, err := k.WithdrawPosition(ctx, sender, positionId, position.Liquidity) -// if err != nil { -// return nil, err -// } - -// withdrawnCoins := sdk.NewCoins(sdk.NewCoin(pool.GetToken0(), amt0), sdk.NewCoin(pool.GetToken1(), amt1)) -// totalCoinsWithdrawn = totalCoinsWithdrawn.Add(withdrawnCoins...) - -// withdrawnPositions = append(withdrawnPositions, PositionWithWithdrawnAmount{ -// Position: position, -// CoinsWithdrawn: withdrawnCoins, -// }) -// } - -// // Send the total withdrawn tokens to the recipient. -// err := k.bankKeeper.SendCoins(ctx, sender, recipient, totalCoinsWithdrawn) -// if err != nil { -// return nil, err -// } - -// // Recreate the positions with the recipient as the owner. -// newPositionIds := []uint64{} -// for _, wp := range withdrawnPositions { -// newPosition, err := k.CreatePosition(ctx, wp.Position.PoolId, recipient, wp.CoinsWithdrawn, osmomath.ZeroInt(), osmomath.ZeroInt(), wp.Position.LowerTick, wp.Position.UpperTick) -// if err != nil { -// return nil, err -// } -// newPositionIds = append(newPositionIds, newPosition.ID) -// } - -// return newPositionIds, nil -// } - +// transferPositions transfers ownership of a set of positions from a sender to a recipient. +// It first checks if the provided position IDs are unique. If not, it returns a DuplicatePositionIdsError. +// For each position ID, it retrieves the corresponding position and checks if the sender is the owner of the position. +// If the sender is not the owner, it returns an error. +// It then checks if the position has an active underlying lock, and if so, returns an error. +// It then collects any outstanding incentives and rewards for the position, deletes the KVStore entries for the position, +// and restores the position under the recipient's account. +// If any of these operations fail, it returns the corresponding error. +// If all operations succeed, it returns nil. func (k Keeper) transferPositions(ctx sdk.Context, positionIds []uint64, sender sdk.AccAddress, recipient sdk.AccAddress) error { + // All position IDs in the array must be unique. if !osmoassert.Uint64ArrayValuesAreUnique(positionIds) { return types.DuplicatePositionIdsError{PositionIds: positionIds} } diff --git a/x/concentrated-liquidity/position_test.go b/x/concentrated-liquidity/position_test.go index 2e2d2260c4b..acc09a7eb9e 100644 --- a/x/concentrated-liquidity/position_test.go +++ b/x/concentrated-liquidity/position_test.go @@ -2246,94 +2246,6 @@ func (s *KeeperTestSuite) TestNegativeTickRange_SpreadFactor() { s.clk.InitGenesis(s.Ctx, *export) } -// func (s *KeeperTestSuite) TestTransferPositions() { -// testcases := map[string]struct { -// positionIds []uint64 -// numPositionsToCreate int -// shouldSetupUnownedPosition bool -// expectedError error -// }{ -// "single position ID": { -// positionIds: []uint64{DefaultPositionId}, -// numPositionsToCreate: 1, -// }, -// "two position IDs": { -// positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, -// numPositionsToCreate: 2, -// }, -// "three position IDs": { -// positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, -// numPositionsToCreate: 3, -// }, -// "two position IDs, second ID does not exist": { -// positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, -// numPositionsToCreate: 1, -// expectedError: types.PositionIdNotFoundError{PositionId: DefaultPositionId + 1}, -// }, -// "three position IDs, not an owner of one of them": { -// positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, -// numPositionsToCreate: 2, -// shouldSetupUnownedPosition: true, -// expectedError: types.NotPositionOwnerError{}, -// }, -// } - -// for name, tc := range testcases { -// s.Run(name, func() { -// s.SetupTest() - -// lastPositionId := 0 - -// // Create a cl pool with a default position -// pool := s.PrepareConcentratedPool() -// for i := 0; i < tc.numPositionsToCreate; i++ { -// s.SetupDefaultPosition(pool.GetId()) -// lastPositionId++ -// } - -// if tc.shouldSetupUnownedPosition { -// // Position from another account. -// s.SetupDefaultPositionAcc(pool.GetId(), s.TestAccs[1]) -// lastPositionId++ -// } - -// initialUserPositions, err := s.App.ConcentratedLiquidityKeeper.GetUserPositions(s.Ctx, s.TestAccs[0], 1) -// s.Require().NoError(err) - -// newOwnerBalancePre := s.App.BankKeeper.GetAllBalances(s.Ctx, s.TestAccs[1]) - -// // System under test -// newPositionIds, err := s.App.ConcentratedLiquidityKeeper.TransferPositions(s.Ctx, tc.positionIds, s.TestAccs[0], s.TestAccs[1]) - -// if tc.expectedError != nil { -// s.Require().Error(err) -// s.Require().ErrorAs(err, &tc.expectedError) -// } else { -// s.Require().NoError(err) - -// s.Require().Equal(lastPositionId, len(newPositionIds)) -// for i, newPositionId := range newPositionIds { -// newPosition, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, newPositionId) -// s.Require().NoError(err) - -// // All the following should be the same in the new position as it was in the old one. -// s.Require().Equal(initialUserPositions[i].UpperTick, newPosition.UpperTick) -// s.Require().Equal(initialUserPositions[i].LowerTick, newPosition.LowerTick) -// s.Require().Equal(initialUserPositions[i].PoolId, newPosition.PoolId) - -// // The new position should have the new owner -// s.Require().Equal(s.TestAccs[1].String(), newPosition.Address) - -// // NOTE: Liquidity values are not the same between positions, -// newOwnerBalancePost := s.App.BankKeeper.GetAllBalances(s.Ctx, s.TestAccs[1]) -// fmt.Println("newOwnerBalancePost", newOwnerBalancePost) -// fmt.Println("newOwnerBalancePre", newOwnerBalancePre) -// } -// } -// }) -// } -// } - func (s *KeeperTestSuite) TestTransferPositions() { testcases := map[string]struct { positionIds []uint64 From 231ada1de8007d03e8856ed389ad7186d81bcb1e Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 3 Oct 2023 10:32:03 -0500 Subject: [PATCH 05/34] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f67e84877ee..21500ea4fa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#6468](https://github.com/osmosis-labs/osmosis/pull/6468) feat: remove osmo multihop discount * [#6420](https://github.com/osmosis-labs/osmosis/pull/6420) feat[CL]: Creates a governance set whitelist of addresses that can bypass the normal pool creation restrictions on concentrated liquidity pools -* [#6623](https://github.com/osmosis-labs/osmosis/pull/6420) feat: transfer cl position to new owner +* [#6623](https://github.com/osmosis-labs/osmosis/pull/6420) feat: transfer cl positions to new owner ### State Breaking From 5cfe3bf013342528b4a47ff06b2077430cebcae4 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 3 Oct 2023 09:38:26 -0600 Subject: [PATCH 06/34] add godoc and test for ParseUint64SliceToString --- osmoutils/osmocli/parsers_test.go | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/osmoutils/osmocli/parsers_test.go b/osmoutils/osmocli/parsers_test.go index f933857341f..e90d455430a 100644 --- a/osmoutils/osmocli/parsers_test.go +++ b/osmoutils/osmocli/parsers_test.go @@ -167,3 +167,36 @@ func TestParseFieldFromArg(t *testing.T) { }) } } + +func TestParseUint64SliceToString(t *testing.T) { + tests := []struct { + name string + input []uint64 + expected string + }{ + { + name: "Test with empty slice", + input: []uint64{}, + expected: "", + }, + { + name: "Test with single element", + input: []uint64{1}, + expected: "1", + }, + { + name: "Test with multiple elements", + input: []uint64{1, 2, 3, 4, 5}, + expected: "1, 2, 3, 4, 5", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result := ParseUint64SliceToString(tt.input) + if result != tt.expected { + t.Errorf("expected %s, got %s", tt.expected, result) + } + }) + } +} From 198cf746da54ed4c10c9cfd96fde97252748e381 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 3 Oct 2023 09:38:43 -0600 Subject: [PATCH 07/34] add godoc --- osmoutils/osmocli/parsers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osmoutils/osmocli/parsers.go b/osmoutils/osmocli/parsers.go index f37688e23d6..dc2a467c36a 100644 --- a/osmoutils/osmocli/parsers.go +++ b/osmoutils/osmocli/parsers.go @@ -381,6 +381,10 @@ func ParseStringTo2DArray(input string) ([][]uint64, error) { return result, nil } +// ParseUint64SliceToString converts a slice of uint64 values into a string. +// Each uint64 value in the slice is converted to a string using base 10. +// The resulting strings are then joined together with a comma separator. +// The resulting string is returned. func ParseUint64SliceToString(values []uint64) string { strs := make([]string, len(values)) for i, v := range values { From 21195eec99da9068d62976b1e8b157fa319df31a Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 3 Oct 2023 12:15:02 -0600 Subject: [PATCH 08/34] add incentives and spread rewards to message server test --- x/concentrated-liquidity/msg_server_test.go | 67 ++++++++++++++++++--- x/concentrated-liquidity/spread_rewards.go | 5 ++ 2 files changed, 63 insertions(+), 9 deletions(-) diff --git a/x/concentrated-liquidity/msg_server_test.go b/x/concentrated-liquidity/msg_server_test.go index 678b9f6d929..1ae7d840530 100644 --- a/x/concentrated-liquidity/msg_server_test.go +++ b/x/concentrated-liquidity/msg_server_test.go @@ -547,10 +547,15 @@ func (s *KeeperTestSuite) TestFungify_Events() { } func (s *KeeperTestSuite) TestTransferPositions_Events() { + // expectedUptimes are used for claimable incentives tests + expectedUptimes := getExpectedUptimes() + testcases := map[string]struct { positionIds []uint64 numPositionsToCreate int shouldSetupUnownedPosition bool + hasIncentivesToClaim bool + hasSpreadRewardsToClaim bool expectedTransferPositionsEvent int expectedMessageEvents int expectedError error @@ -559,19 +564,41 @@ func (s *KeeperTestSuite) TestTransferPositions_Events() { positionIds: []uint64{DefaultPositionId}, numPositionsToCreate: 1, expectedTransferPositionsEvent: 1, - expectedMessageEvents: 2, // 1 for transfer, 1 for collect spread rewards (calls event even when no spread rewards) + expectedMessageEvents: 1, // 1 for transfer, 1 for collect spread rewards + }, + "single position ID with claimable incentives": { + positionIds: []uint64{DefaultPositionId}, + hasIncentivesToClaim: true, + numPositionsToCreate: 1, + expectedTransferPositionsEvent: 1, + expectedMessageEvents: 3, // 1 for transfer, 1 for collect incentives claim send, 1 for collect incentives forfeit send + }, + "single position ID with claimable spread rewards": { + positionIds: []uint64{DefaultPositionId}, + hasSpreadRewardsToClaim: true, + numPositionsToCreate: 1, + expectedTransferPositionsEvent: 1, + expectedMessageEvents: 2, // 1 for transfer, 1 for collect spread rewards claim send + }, + "single position ID with claimable incentives and spread rewards": { + positionIds: []uint64{DefaultPositionId}, + hasIncentivesToClaim: true, + hasSpreadRewardsToClaim: true, + numPositionsToCreate: 1, + expectedTransferPositionsEvent: 1, + expectedMessageEvents: 4, // 1 for transfer, 1 for collect incentives claim send, 1 for collect incentives forfeit send, 1 for collect spread rewards claim send }, "two position IDs": { positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, numPositionsToCreate: 2, expectedTransferPositionsEvent: 1, - expectedMessageEvents: 3, // 1 for transfer, 2 for collect spread rewards (calls event even when no spread rewards) + expectedMessageEvents: 1, // 1 for transfer }, "three position IDs": { positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, numPositionsToCreate: 3, expectedTransferPositionsEvent: 1, - expectedMessageEvents: 4, // 1 for transfer, 3 for collect spread rewards (calls event even when no spread rewards) + expectedMessageEvents: 1, // 1 for transfer }, "two position IDs, second ID does not exist": { positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, @@ -589,7 +616,6 @@ func (s *KeeperTestSuite) TestTransferPositions_Events() { for name, tc := range testcases { s.Run(name, func() { s.SetupTest() - ctx := s.Ctx // Create a cl pool with a default position pool := s.PrepareConcentratedPool() @@ -602,11 +628,34 @@ func (s *KeeperTestSuite) TestTransferPositions_Events() { s.SetupDefaultPositionAcc(pool.GetId(), s.TestAccs[1]) } + if tc.hasIncentivesToClaim { + // Determine how much position will claim and fund + coinsToFundForIncentivesToUser := expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24, defaultMultiplier) + s.FundAcc(pool.GetIncentivesAddress(), coinsToFundForIncentivesToUser) + // Determine how much position will forfeit and fund + coinsToFundForForefeitToPool := expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24*14, defaultMultiplier).Sub(expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24, defaultMultiplier)) + s.FundAcc(pool.GetIncentivesAddress(), coinsToFundForForefeitToPool) + // Add uptime growth to the pool that targets the position + position, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, 1) + s.Require().NoError(err) + s.addUptimeGrowthInsideRange(s.Ctx, pool.GetId(), s.TestAccs[0], position.LowerTick+1, position.LowerTick, position.UpperTick, expectedUptimes.hundredTokensMultiDenom) + } + + if tc.hasSpreadRewardsToClaim { + // Utilize the position liquidity value to determine how much spread rewards the position will claim + position, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, 1) + s.Require().NoError(err) + expectedAmountToClaim := position.Liquidity.MulInt(osmomath.NewInt(10)).TruncateInt() + // Fund the spread rewards account with the expected rewards and add to the pool's accum + s.FundAcc(pool.GetSpreadRewardsAddress(), sdk.NewCoins(sdk.NewCoin(ETH, expectedAmountToClaim))) + s.AddToSpreadRewardAccumulator(pool.GetId(), sdk.NewDecCoin(ETH, osmomath.NewInt(10))) + } + msgServer := cl.NewMsgServerImpl(s.App.ConcentratedLiquidityKeeper) // Reset event counts to 0 by creating a new manager. - ctx = ctx.WithEventManager(sdk.NewEventManager()) - s.Equal(0, len(ctx.EventManager().Events())) + s.Ctx = s.Ctx.WithEventManager(sdk.NewEventManager()) + s.Equal(0, len(s.Ctx.EventManager().Events())) msg := &types.MsgTransferPositions{ PositionIds: tc.positionIds, @@ -615,13 +664,13 @@ func (s *KeeperTestSuite) TestTransferPositions_Events() { } // System under test - response, err := msgServer.TransferPositions(sdk.WrapSDKContext(ctx), msg) + response, err := msgServer.TransferPositions(sdk.WrapSDKContext(s.Ctx), msg) if tc.expectedError == nil { s.Require().NoError(err) s.Require().NotNil(response) - s.AssertEventEmitted(ctx, types.TypeEvtTransferPositions, tc.expectedTransferPositionsEvent) - s.AssertEventEmitted(ctx, sdk.EventTypeMessage, tc.expectedMessageEvents) + s.AssertEventEmitted(s.Ctx, types.TypeEvtTransferPositions, tc.expectedTransferPositionsEvent) + s.AssertEventEmitted(s.Ctx, sdk.EventTypeMessage, tc.expectedMessageEvents) } else { s.Require().Error(err) s.Require().ErrorAs(err, &tc.expectedError) diff --git a/x/concentrated-liquidity/spread_rewards.go b/x/concentrated-liquidity/spread_rewards.go index af5e84ac1df..242de3f4b61 100644 --- a/x/concentrated-liquidity/spread_rewards.go +++ b/x/concentrated-liquidity/spread_rewards.go @@ -174,6 +174,11 @@ func (k Keeper) collectSpreadRewards(ctx sdk.Context, sender sdk.AccAddress, pos return sdk.Coins{}, err } + // Early return, emit no events if there is no spread rewards to claim. + if spreadRewardsClaimed.IsZero() { + return sdk.Coins{}, nil + } + // Send the claimed spread rewards from the pool's address to the owner's address. pool, err := k.getPoolById(ctx, position.PoolId) if err != nil { From 39bac77fdb22cd6f4338e76848ac678e1ed40c8c Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 3 Oct 2023 12:50:15 -0600 Subject: [PATCH 09/34] expand message server test --- x/concentrated-liquidity/msg_server_test.go | 52 ++++++++++++++------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/x/concentrated-liquidity/msg_server_test.go b/x/concentrated-liquidity/msg_server_test.go index 1ae7d840530..930ba08326c 100644 --- a/x/concentrated-liquidity/msg_server_test.go +++ b/x/concentrated-liquidity/msg_server_test.go @@ -600,6 +600,14 @@ func (s *KeeperTestSuite) TestTransferPositions_Events() { expectedTransferPositionsEvent: 1, expectedMessageEvents: 1, // 1 for transfer }, + "three position IDs with claimable incentives and spread rewards": { + positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, + hasIncentivesToClaim: true, + hasSpreadRewardsToClaim: true, + numPositionsToCreate: 3, + expectedTransferPositionsEvent: 1, + expectedMessageEvents: 10, // 1 for transfer, 3 for collect incentives claim send, 3 for collect incentives forfeit send, 3 for collect spread rewards claim send + }, "two position IDs, second ID does not exist": { positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, numPositionsToCreate: 1, @@ -629,26 +637,36 @@ func (s *KeeperTestSuite) TestTransferPositions_Events() { } if tc.hasIncentivesToClaim { - // Determine how much position will claim and fund - coinsToFundForIncentivesToUser := expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24, defaultMultiplier) - s.FundAcc(pool.GetIncentivesAddress(), coinsToFundForIncentivesToUser) - // Determine how much position will forfeit and fund - coinsToFundForForefeitToPool := expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24*14, defaultMultiplier).Sub(expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24, defaultMultiplier)) - s.FundAcc(pool.GetIncentivesAddress(), coinsToFundForForefeitToPool) - // Add uptime growth to the pool that targets the position - position, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, 1) - s.Require().NoError(err) - s.addUptimeGrowthInsideRange(s.Ctx, pool.GetId(), s.TestAccs[0], position.LowerTick+1, position.LowerTick, position.UpperTick, expectedUptimes.hundredTokensMultiDenom) + for _, positionId := range tc.positionIds { + // Determine how much position will claim and fund + coinsToFundForIncentivesToUser := expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24, defaultMultiplier) + s.FundAcc(pool.GetIncentivesAddress(), coinsToFundForIncentivesToUser) + // Determine how much position will forfeit and fund + coinsToFundForForefeitToPool := expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24*14, defaultMultiplier).Sub(expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24, defaultMultiplier)) + s.FundAcc(pool.GetIncentivesAddress(), coinsToFundForForefeitToPool) + // Add uptime growth to the pool that targets the position + position, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, positionId) + s.Require().NoError(err) + // only add to uptime growth once for simplicity + if positionId == tc.positionIds[0] { + s.addUptimeGrowthInsideRange(s.Ctx, pool.GetId(), s.TestAccs[0], position.LowerTick+1, position.LowerTick, position.UpperTick, expectedUptimes.hundredTokensMultiDenom) + } + } } if tc.hasSpreadRewardsToClaim { - // Utilize the position liquidity value to determine how much spread rewards the position will claim - position, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, 1) - s.Require().NoError(err) - expectedAmountToClaim := position.Liquidity.MulInt(osmomath.NewInt(10)).TruncateInt() - // Fund the spread rewards account with the expected rewards and add to the pool's accum - s.FundAcc(pool.GetSpreadRewardsAddress(), sdk.NewCoins(sdk.NewCoin(ETH, expectedAmountToClaim))) - s.AddToSpreadRewardAccumulator(pool.GetId(), sdk.NewDecCoin(ETH, osmomath.NewInt(10))) + for _, positionId := range tc.positionIds { + // Utilize the position liquidity value to determine how much spread rewards the position will claim + position, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, positionId) + s.Require().NoError(err) + expectedAmountToClaim := position.Liquidity.MulInt(osmomath.NewInt(10)).TruncateInt() + // Fund the spread rewards account with the expected rewards and add to the pool's accum + s.FundAcc(pool.GetSpreadRewardsAddress(), sdk.NewCoins(sdk.NewCoin(ETH, expectedAmountToClaim))) + // only add to spread rewards accum once for simplicity + if positionId == tc.positionIds[0] { + s.AddToSpreadRewardAccumulator(pool.GetId(), sdk.NewDecCoin(ETH, osmomath.NewInt(10))) + } + } } msgServer := cl.NewMsgServerImpl(s.App.ConcentratedLiquidityKeeper) From 07be72249ff0544fc6e89769ad9dfa1ec69bd24d Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 3 Oct 2023 16:02:48 -0600 Subject: [PATCH 10/34] further expand test --- osmoutils/compare.go | 19 ++ osmoutils/compare_test.go | 37 +++ x/concentrated-liquidity/fuzz_test.go | 6 +- x/concentrated-liquidity/incentives.go | 14 +- x/concentrated-liquidity/msg_server_test.go | 8 + x/concentrated-liquidity/position.go | 40 +++ x/concentrated-liquidity/position_test.go | 267 ++++++++++++++++---- x/concentrated-liquidity/spread_rewards.go | 2 +- x/concentrated-liquidity/types/errors.go | 9 + 9 files changed, 350 insertions(+), 52 deletions(-) diff --git a/osmoutils/compare.go b/osmoutils/compare.go index cd17e97497c..f5f00719a03 100644 --- a/osmoutils/compare.go +++ b/osmoutils/compare.go @@ -57,3 +57,22 @@ func Max(values ...interface{}) interface{} { } return max } + +func DifferenceBetweenUint64Arrays(a, b []uint64) []uint64 { + m := make(map[uint64]bool) + + for _, item := range a { + m[item] = true + } + + for _, item := range b { + delete(m, item) + } + + var result []uint64 + for item := range m { + result = append(result, item) + } + + return result +} diff --git a/osmoutils/compare_test.go b/osmoutils/compare_test.go index 2a61b680e0b..f4e5e7ed691 100644 --- a/osmoutils/compare_test.go +++ b/osmoutils/compare_test.go @@ -1,6 +1,7 @@ package osmoutils_test import ( + "reflect" "testing" "github.com/stretchr/testify/assert" @@ -38,3 +39,39 @@ func TestMax(t *testing.T) { }) } } + +func TestDifferenceUint64(t *testing.T) { + testCases := []struct { + a []uint64 + b []uint64 + expected []uint64 + }{ + { + a: []uint64{1, 2, 3, 4, 5}, + b: []uint64{4, 5, 6, 7, 8}, + expected: []uint64{1, 2, 3}, + }, + { + a: []uint64{10, 20, 30, 40, 50}, + b: []uint64{30, 40, 50, 60, 70}, + expected: []uint64{10, 20}, + }, + { + a: []uint64{}, + b: []uint64{1, 2, 3}, + expected: []uint64{}, + }, + { + a: []uint64{1, 2, 3}, + b: []uint64{}, + expected: []uint64{1, 2, 3}, + }, + } + + for _, tc := range testCases { + result := osmoutils.DifferenceBetweenUint64Arrays(tc.a, tc.b) + if !reflect.DeepEqual(result, tc.expected) { + t.Errorf("DifferenceUint64(%v, %v) = %v; want %v", tc.a, tc.b, result, tc.expected) + } + } +} diff --git a/x/concentrated-liquidity/fuzz_test.go b/x/concentrated-liquidity/fuzz_test.go index acd3d821bb4..176e6b29932 100644 --- a/x/concentrated-liquidity/fuzz_test.go +++ b/x/concentrated-liquidity/fuzz_test.go @@ -39,9 +39,9 @@ type positionAndLiquidity struct { accountIndex int } -func TestFuzz_Many(t *testing.T) { - fuzz(t, defaultNumSwaps, defaultNumPositions, 10) -} +// func TestFuzz_Many(t *testing.T) { +// fuzz(t, defaultNumSwaps, defaultNumPositions, 10) +// } func (s *KeeperTestSuite) TestFuzz_GivenSeed() { // Seed 1688572291 - gives mismatch between tokenIn given to "out given in" and token in returned from "in given out" diff --git a/x/concentrated-liquidity/incentives.go b/x/concentrated-liquidity/incentives.go index 95224177152..0e1ff17daac 100644 --- a/x/concentrated-liquidity/incentives.go +++ b/x/concentrated-liquidity/incentives.go @@ -760,14 +760,18 @@ func (k Keeper) collectIncentives(ctx sdk.Context, sender sdk.AccAddress, positi } // Send the collected incentives to the position's owner from the pool's address. - if err := k.bankKeeper.SendCoins(ctx, pool.GetIncentivesAddress(), sender, collectedIncentivesForPosition); err != nil { - return sdk.Coins{}, sdk.Coins{}, err + if !collectedIncentivesForPosition.IsZero() { + if err := k.bankKeeper.SendCoins(ctx, pool.GetIncentivesAddress(), sender, collectedIncentivesForPosition); err != nil { + return sdk.Coins{}, sdk.Coins{}, err + } } // Send the forfeited incentives to the community pool from the pool's address. - err = k.communityPoolKeeper.FundCommunityPool(ctx, forfeitedIncentivesForPosition, pool.GetIncentivesAddress()) - if err != nil { - return sdk.Coins{}, sdk.Coins{}, err + if !forfeitedIncentivesForPosition.IsZero() { + err = k.communityPoolKeeper.FundCommunityPool(ctx, forfeitedIncentivesForPosition, pool.GetIncentivesAddress()) + if err != nil { + return sdk.Coins{}, sdk.Coins{}, err + } } // Emit an event indicating that incentives were collected. diff --git a/x/concentrated-liquidity/msg_server_test.go b/x/concentrated-liquidity/msg_server_test.go index 930ba08326c..c6fece17ae4 100644 --- a/x/concentrated-liquidity/msg_server_test.go +++ b/x/concentrated-liquidity/msg_server_test.go @@ -558,6 +558,7 @@ func (s *KeeperTestSuite) TestTransferPositions_Events() { hasSpreadRewardsToClaim bool expectedTransferPositionsEvent int expectedMessageEvents int + isLastPositionInPool bool expectedError error }{ "single position ID": { @@ -652,6 +653,8 @@ func (s *KeeperTestSuite) TestTransferPositions_Events() { s.addUptimeGrowthInsideRange(s.Ctx, pool.GetId(), s.TestAccs[0], position.LowerTick+1, position.LowerTick, position.UpperTick, expectedUptimes.hundredTokensMultiDenom) } } + // Move block time forward to allow for claiming incentives + s.Ctx = s.Ctx.WithBlockTime(s.Ctx.BlockTime().Add(time.Hour * 24)) } if tc.hasSpreadRewardsToClaim { @@ -669,6 +672,11 @@ func (s *KeeperTestSuite) TestTransferPositions_Events() { } } + if !tc.isLastPositionInPool { + // Setup a far out of range position that we do not touch, so when we transfer positions we do not transfer the last position in the pool. + s.SetupPosition(pool.GetId(), s.TestAccs[2], sdk.NewCoins(DefaultCoin1), DefaultMinTick, DefaultMinTick+100, true) + } + msgServer := cl.NewMsgServerImpl(s.App.ConcentratedLiquidityKeeper) // Reset event counts to 0 by creating a new manager. diff --git a/x/concentrated-liquidity/position.go b/x/concentrated-liquidity/position.go index 97c03fff9da..51857555e2d 100644 --- a/x/concentrated-liquidity/position.go +++ b/x/concentrated-liquidity/position.go @@ -720,6 +720,17 @@ func (k Keeper) transferPositions(ctx sdk.Context, positionIds []uint64, sender return err } + // There exists special logic branches we take if a position is the last position in a pool and it is withdrawn. + // It makes sense to accept the small annoyance of preventing a position from being transferred if it is the last position in a pool + // instead of considering all the edge cases that would arise if we allowed it. + anyPositionsRemainingInPool, err := k.HasAnyPositionForPool(ctx, position.PoolId) + if err != nil { + return err + } + if !anyPositionsRemainingInPool { + return types.LastPositionTransferError{PositionId: positionId, PoolId: position.PoolId} + } + // Restore the position under the recipient's account. err = k.SetPosition(ctx, position.PoolId, recipient, position.LowerTick, position.UpperTick, position.JoinTime, position.Liquidity, position.PositionId, 0) if err != nil { @@ -729,3 +740,32 @@ func (k Keeper) transferPositions(ctx sdk.Context, positionIds []uint64, sender return nil } + +// underlyingPositionsValue calculates the value of the underlying assets in the given positions. +func (k Keeper) UnderlyingPositionsValue(ctx sdk.Context, positionIds []uint64) (sdk.Coins, error) { + underlyingAssets := sdk.Coins{} + + for _, positionId := range positionIds { + position, err := k.GetPosition(ctx, positionId) + if err != nil { + return sdk.Coins{}, err + } + + pool, err := k.GetConcentratedPoolById(ctx, position.PoolId) + if err != nil { + return sdk.Coins{}, err + } + + asset0, asset1, err := pool.CalcActualAmounts(ctx, position.LowerTick, position.UpperTick, position.Liquidity) + if err != nil { + return sdk.Coins{}, err + } + + underlyingAssets = underlyingAssets.Add( + sdk.NewCoin(pool.GetToken0(), asset0.TruncateInt()), + sdk.NewCoin(pool.GetToken1(), asset1.TruncateInt()), + ) + } + + return underlyingAssets, nil +} diff --git a/x/concentrated-liquidity/position_test.go b/x/concentrated-liquidity/position_test.go index acc09a7eb9e..15698ece555 100644 --- a/x/concentrated-liquidity/position_test.go +++ b/x/concentrated-liquidity/position_test.go @@ -10,6 +10,7 @@ import ( "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/osmoutils" "github.com/osmosis-labs/osmosis/osmoutils/accum" + "github.com/osmosis-labs/osmosis/osmoutils/osmoassert" "github.com/osmosis-labs/osmosis/v19/app/apptesting" cl "github.com/osmosis-labs/osmosis/v19/x/concentrated-liquidity" "github.com/osmosis-labs/osmosis/v19/x/concentrated-liquidity/math" @@ -2247,83 +2248,263 @@ func (s *KeeperTestSuite) TestNegativeTickRange_SpreadFactor() { } func (s *KeeperTestSuite) TestTransferPositions() { + // expectedUptimes are used for claimable incentives tests + expectedUptimes := getExpectedUptimes() + + errTolerance := osmomath.ErrTolerance{ + AdditiveTolerance: osmomath.NewDec(1), + // Actual should be less than expected, so we round down + RoundingDir: osmomath.RoundDown, + } + + oldOwner := s.TestAccs[0] + newOwner := s.TestAccs[1] + testcases := map[string]struct { - positionIds []uint64 - numPositionsToCreate int - shouldSetupUnownedPosition bool - expectedError error + inRangePositions []uint64 + outOfRangePositions []uint64 + positionsToTransfer []uint64 + setupUnownedPosition bool + isLastPositionInPool bool + + expectedError error }{ - "single position ID": { - positionIds: []uint64{DefaultPositionId}, - numPositionsToCreate: 1, - }, - "two position IDs": { - positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, - numPositionsToCreate: 2, - }, - "three position IDs": { - positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, - numPositionsToCreate: 3, - }, - "two position IDs, second ID does not exist": { - positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1}, - numPositionsToCreate: 1, - expectedError: types.PositionIdNotFoundError{PositionId: DefaultPositionId + 1}, - }, - "three position IDs, not an owner of one of them": { - positionIds: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, - numPositionsToCreate: 2, - shouldSetupUnownedPosition: true, - expectedError: types.NotPositionOwnerError{}, + "single position ID in range": { + inRangePositions: []uint64{DefaultPositionId}, + positionsToTransfer: []uint64{DefaultPositionId}, + }, + "two position IDs, one in range, one out of range": { + inRangePositions: []uint64{DefaultPositionId}, + outOfRangePositions: []uint64{DefaultPositionId + 1}, + positionsToTransfer: []uint64{DefaultPositionId, DefaultPositionId + 1}, + }, + "two position IDs in range": { + inRangePositions: []uint64{DefaultPositionId, DefaultPositionId + 1}, + positionsToTransfer: []uint64{DefaultPositionId, DefaultPositionId + 1}, + }, + "three position IDs in range": { + inRangePositions: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, + positionsToTransfer: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, + }, + "three position IDs, two in range, one out of range": { + inRangePositions: []uint64{DefaultPositionId, DefaultPositionId + 1}, + outOfRangePositions: []uint64{DefaultPositionId + 2}, + positionsToTransfer: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, + }, + "three position IDs, two in range, one out of range, only transfer the two in range": { + inRangePositions: []uint64{DefaultPositionId, DefaultPositionId + 1}, + outOfRangePositions: []uint64{DefaultPositionId + 2}, + positionsToTransfer: []uint64{DefaultPositionId, DefaultPositionId + 1}, + }, + "three position IDs, one in range, two out of range, transfer one in range and one out of range": { + inRangePositions: []uint64{DefaultPositionId}, + outOfRangePositions: []uint64{DefaultPositionId + 1, DefaultPositionId + 2}, + positionsToTransfer: []uint64{DefaultPositionId, DefaultPositionId + 2}, + }, + "error: two position IDs, second ID does not exist": { + inRangePositions: []uint64{DefaultPositionId, DefaultPositionId + 1}, + positionsToTransfer: []uint64{DefaultPositionId, DefaultPositionId + 3}, + expectedError: types.PositionIdNotFoundError{PositionId: DefaultPositionId + 3}, + }, + "error: three position IDs, not an owner of one of them": { + inRangePositions: []uint64{DefaultPositionId, DefaultPositionId + 1}, + positionsToTransfer: []uint64{DefaultPositionId, DefaultPositionId + 1, DefaultPositionId + 2}, + setupUnownedPosition: true, + expectedError: types.PositionOwnerMismatchError{PositionOwner: newOwner.String(), Sender: oldOwner.String()}, + }, + "error: attempt to transfer last position in pool": { + inRangePositions: []uint64{DefaultPositionId}, + positionsToTransfer: []uint64{DefaultPositionId}, + isLastPositionInPool: true, + expectedError: types.LastPositionTransferError{PositionId: DefaultPositionId, PoolId: 1}, }, } for name, tc := range testcases { s.Run(name, func() { s.SetupTest() + pool := s.PrepareConcentratedPool() lastPositionId := 0 - // Create a cl pool with a default position - pool := s.PrepareConcentratedPool() - for i := 0; i < tc.numPositionsToCreate; i++ { + // Setup in range positions + for i := 0; i < len(tc.inRangePositions); i++ { s.SetupDefaultPosition(pool.GetId()) lastPositionId++ } - if tc.shouldSetupUnownedPosition { - // Position from another account. - s.SetupDefaultPositionAcc(pool.GetId(), s.TestAccs[1]) + // Setup out of range positions + for i := 0; i < len(tc.outOfRangePositions); i++ { + // Position with out of range ticks. + s.SetupPosition(pool.GetId(), oldOwner, sdk.NewCoins(DefaultCoin1), DefaultMinTick, DefaultMinTick+100, true) + lastPositionId++ + } + + // Setup unowned position (owned by newOwner) + if tc.setupUnownedPosition { + s.SetupDefaultPositionAcc(pool.GetId(), newOwner) lastPositionId++ } - initialUserPositions, err := s.App.ConcentratedLiquidityKeeper.GetUserPositions(s.Ctx, s.TestAccs[0], 1) + // Setup a far out of range position that we do not touch, so when we transfer positions we do not transfer the last position in the pool. + if !tc.isLastPositionInPool { + s.SetupPosition(pool.GetId(), s.TestAccs[2], sdk.NewCoins(DefaultCoin0), DefaultMaxTick-100, DefaultMaxTick, true) + } + + // For each position that is in range, add spread rewards and incentives to their respective addresses + totalExpectedRewards := s.fundIncentiveAndSpreadRewardsAddr(s.Ctx, pool.GetIncentivesAddress(), pool.GetSpreadRewardsAddress(), tc.inRangePositions) + + // Add spread rewards and incentives to the pool + s.addUptimeGrowthInsideRange(s.Ctx, pool.GetId(), oldOwner, apptesting.DefaultLowerTick+1, DefaultLowerTick, DefaultUpperTick, expectedUptimes.hundredTokensMultiDenom) + s.AddToSpreadRewardAccumulator(pool.GetId(), sdk.NewDecCoin(ETH, osmomath.NewInt(10))) + + // Move block time forward. In the event we have positions in range + // this allows us to test both collected and forfeited incentives + s.Ctx = s.Ctx.WithBlockTime(s.Ctx.BlockTime().Add(time.Hour * 24)) + + initialUserPositions, err := s.App.ConcentratedLiquidityKeeper.GetUserPositions(s.Ctx, oldOwner, 1) s.Require().NoError(err) + // Account funds of original owner + preTransferOwnerFunds := s.App.BankKeeper.GetAllBalances(s.Ctx, oldOwner) + + // Account funds of new owner + preTransferNewOwnerFunds := s.App.BankKeeper.GetAllBalances(s.Ctx, newOwner) + // System under test - err = s.App.ConcentratedLiquidityKeeper.TransferPositions(s.Ctx, tc.positionIds, s.TestAccs[0], s.TestAccs[1]) + err = s.App.ConcentratedLiquidityKeeper.TransferPositions(s.Ctx, tc.positionsToTransfer, oldOwner, newOwner) if tc.expectedError != nil { s.Require().Error(err) - s.Require().ErrorAs(err, &tc.expectedError) + s.Require().ErrorIs(err, tc.expectedError) } else { s.Require().NoError(err) - for i := 0; i < lastPositionId; i++ { - newPosition, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, uint64(i+1)) + // Check that the positions we wanted transferred were modified appropriately + for _, positionId := range tc.positionsToTransfer { + newPosition, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, positionId) s.Require().NoError(err) + oldPosition := model.Position{} + for _, initialPosition := range initialUserPositions { + if initialPosition.PositionId == newPosition.PositionId { + oldPosition = initialPosition + break + } + } + // All position values except the owner should be the same in the new position as it was in the old one. - s.Require().Equal(initialUserPositions[i].UpperTick, newPosition.UpperTick) - s.Require().Equal(initialUserPositions[i].LowerTick, newPosition.LowerTick) - s.Require().Equal(initialUserPositions[i].PoolId, newPosition.PoolId) - s.Require().Equal(initialUserPositions[i].JoinTime, newPosition.JoinTime) - s.Require().Equal(initialUserPositions[i].Liquidity, newPosition.Liquidity) + s.Require().Equal(oldPosition.UpperTick, newPosition.UpperTick) + s.Require().Equal(oldPosition.LowerTick, newPosition.LowerTick) + s.Require().Equal(oldPosition.PoolId, newPosition.PoolId) + s.Require().Equal(oldPosition.JoinTime, newPosition.JoinTime) + s.Require().Equal(oldPosition.Liquidity, newPosition.Liquidity) // The new position should have the new owner - s.Require().Equal(s.TestAccs[1].String(), newPosition.Address) + s.Require().Equal(newOwner.String(), newPosition.Address) + } + + allPositions := append(tc.inRangePositions, tc.outOfRangePositions...) + positionsNotTransfered := osmoutils.DifferenceBetweenUint64Arrays(allPositions, tc.positionsToTransfer) + + // Check that the positions not transferred were not modified + for _, positionId := range positionsNotTransfered { + oldPosition, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, positionId) + s.Require().NoError(err) + + newPosition := model.Position{} + for _, initialPosition := range initialUserPositions { + if initialPosition.PositionId == oldPosition.PositionId { + newPosition = initialPosition + break + } + } + + // All position values should be the same in the new position as it was in the old one. + s.Require().Equal(oldPosition, newPosition) + } + + // Check that the incentives and spread rewards went to the old owner + postTransferOriginalOwnerFunds := s.App.BankKeeper.GetAllBalances(s.Ctx, oldOwner) + expectedTransferOriginalOwnerFunds := preTransferOwnerFunds.Add(totalExpectedRewards...) + s.Require().Equal(expectedTransferOriginalOwnerFunds.String(), postTransferOriginalOwnerFunds.String()) + + // Check that the new owner does not have any new funds + postTransferNewOwnerFunds := s.App.BankKeeper.GetAllBalances(s.Ctx, newOwner) + s.Require().Equal(preTransferNewOwnerFunds, postTransferNewOwnerFunds) + + // Test that claiming incentives/spread rewards with the new owner returns nothing + for _, positionId := range tc.positionsToTransfer { + fundsToClaim, fundsToForefeit, err := s.App.ConcentratedLiquidityKeeper.GetClaimableIncentives(s.Ctx, positionId) + s.Require().NoError(err) + s.Require().Equal(sdk.Coins(nil), fundsToClaim) + s.Require().Equal(sdk.Coins(nil), fundsToForefeit) + + spreadRewards, err := s.App.ConcentratedLiquidityKeeper.GetClaimableSpreadRewards(s.Ctx, positionId) + s.Require().NoError(err) + s.Require().Equal(sdk.Coins(nil), spreadRewards) + } + + // Test that adding incentives/spread rewards and then claiming returns it to the new owner, and the old owner does not get anything + totalExpectedRewards = s.fundIncentiveAndSpreadRewardsAddr(s.Ctx, pool.GetIncentivesAddress(), pool.GetSpreadRewardsAddress(), tc.inRangePositions) + s.addUptimeGrowthInsideRange(s.Ctx, pool.GetId(), oldOwner, apptesting.DefaultLowerTick+1, DefaultLowerTick, DefaultUpperTick, expectedUptimes.hundredTokensMultiDenom) + s.AddToSpreadRewardAccumulator(pool.GetId(), sdk.NewDecCoin(ETH, osmomath.NewInt(10))) + for _, positionId := range tc.positionsToTransfer { + _, _, err := s.App.ConcentratedLiquidityKeeper.CollectIncentives(s.Ctx, newOwner, positionId) + s.Require().NoError(err) + _, err = s.App.ConcentratedLiquidityKeeper.CollectSpreadRewards(s.Ctx, newOwner, positionId) + s.Require().NoError(err) + } + // New owner balance check + postSecondTransferNewOwnerFunds := s.App.BankKeeper.GetAllBalances(s.Ctx, newOwner) + expectedSecondTransferNewOwnerFunds := postTransferNewOwnerFunds.Add(totalExpectedRewards...) + s.Require().Equal(expectedSecondTransferNewOwnerFunds.String(), postSecondTransferNewOwnerFunds.String()) + // Old owner balance check + postSecondTransferOriginalOwnerFunds := s.App.BankKeeper.GetAllBalances(s.Ctx, oldOwner) + s.Require().Equal(postTransferOriginalOwnerFunds, postSecondTransferOriginalOwnerFunds) + + // Test that withdrawing the positions returns the correct amount of funds to the new owner + for _, positionId := range tc.positionsToTransfer { + underlyingPositionsValue, err := s.App.ConcentratedLiquidityKeeper.UnderlyingPositionsValue(s.Ctx, []uint64{positionId}) + s.Require().NoError(err) + position, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, positionId) + s.Require().NoError(err) + amt0, amt1, err := s.App.ConcentratedLiquidityKeeper.WithdrawPosition(s.Ctx, newOwner, positionId, position.Liquidity) + s.Require().NoError(err) + coinsWithdrawn := sdk.NewCoins(sdk.NewCoin(pool.GetToken0(), amt0), sdk.NewCoin(pool.GetToken1(), amt1)) + // Amount we withdraw is one less than actual value due to rounding in favor of pool + for i, coin := range coinsWithdrawn { + osmoassert.Equal( + s.T(), + errTolerance, + underlyingPositionsValue[i].Amount, + coin.Amount, + ) + } } } }) } } + +func (s *KeeperTestSuite) fundIncentiveAndSpreadRewardsAddr(ctx sdk.Context, incentivesAddress, spreadRewardsAddress sdk.AccAddress, positionIds []uint64) (totalExpectedRewards sdk.Coins) { + expectedUptimes := getExpectedUptimes() + for _, positionId := range positionIds { + coinsToFundForIncentivesToUser := expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24, defaultMultiplier) + totalExpectedRewards = totalExpectedRewards.Add(coinsToFundForIncentivesToUser...) + s.FundAcc(incentivesAddress, coinsToFundForIncentivesToUser) + // Determine how much position will forfeit and fund + coinsToFundForForefeitToPool := expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24*14, defaultMultiplier).Sub(expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24, defaultMultiplier)) + s.FundAcc(incentivesAddress, coinsToFundForForefeitToPool) + + position, err := s.App.ConcentratedLiquidityKeeper.GetPosition(ctx, positionId) + s.Require().NoError(err) + + // We fund the account with roundedInt because, there occurs + expectedAmountToClaim := position.Liquidity.MulInt(osmomath.NewInt(10)).TruncateInt() + totalExpectedRewards = totalExpectedRewards.Add(sdk.NewCoin(ETH, expectedAmountToClaim)) + // Fund the spread rewards account with the expected rewards and add to the pool's accum + s.FundAcc(spreadRewardsAddress, totalExpectedRewards) + } + return +} diff --git a/x/concentrated-liquidity/spread_rewards.go b/x/concentrated-liquidity/spread_rewards.go index 242de3f4b61..1541fef20ad 100644 --- a/x/concentrated-liquidity/spread_rewards.go +++ b/x/concentrated-liquidity/spread_rewards.go @@ -258,7 +258,7 @@ func (k Keeper) prepareClaimableSpreadRewards(ctx sdk.Context, positionId uint64 return nil, err } - // add foreited dust back to the global accumulator + // add forfeited dust back to the global accumulator if !forfeitedDust.IsZero() { // Refetch the spread reward accumulator as the number of shares has changed after claiming. spreadRewardAccumulator, err := k.GetSpreadRewardAccumulator(ctx, position.PoolId) diff --git a/x/concentrated-liquidity/types/errors.go b/x/concentrated-liquidity/types/errors.go index 1e7c0f15c05..440c73beff4 100644 --- a/x/concentrated-liquidity/types/errors.go +++ b/x/concentrated-liquidity/types/errors.go @@ -904,3 +904,12 @@ type DuplicatePositionIdsError struct { func (e DuplicatePositionIdsError) Error() string { return fmt.Sprintf("duplicate position ids found (%v)", e.PositionIds) } + +type LastPositionTransferError struct { + PositionId uint64 + PoolId uint64 +} + +func (e LastPositionTransferError) Error() string { + return fmt.Sprintf("cannot transfer position %d because it is the last position in pool %d", e.PositionId, e.PoolId) +} From 4346b86e9ae3bf2ec71862fdb6fb613a6d293089 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 3 Oct 2023 16:04:24 -0600 Subject: [PATCH 11/34] godoc --- osmoutils/compare.go | 11 +++++++++++ x/concentrated-liquidity/fuzz_test.go | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/osmoutils/compare.go b/osmoutils/compare.go index f5f00719a03..3e3ef9644f2 100644 --- a/osmoutils/compare.go +++ b/osmoutils/compare.go @@ -58,6 +58,17 @@ func Max(values ...interface{}) interface{} { return max } +// DifferenceBetweenUint64Arrays takes two slices of uint64, 'a' and 'b', as input. +// It returns a new slice containing the elements that are in 'a' but not in 'b'. +// The function uses a map for efficient lookup of elements. +// +// Example: +// a := []uint64{1, 2, 3, 4, 5} +// b := []uint64{4, 5, 6, 7, 8} +// result := DifferenceBetweenUint64Arrays(a, b) +// result will be []uint64{1, 2, 3} +// +// Note: This function does not preserve the order of the elements. func DifferenceBetweenUint64Arrays(a, b []uint64) []uint64 { m := make(map[uint64]bool) diff --git a/x/concentrated-liquidity/fuzz_test.go b/x/concentrated-liquidity/fuzz_test.go index 176e6b29932..acd3d821bb4 100644 --- a/x/concentrated-liquidity/fuzz_test.go +++ b/x/concentrated-liquidity/fuzz_test.go @@ -39,9 +39,9 @@ type positionAndLiquidity struct { accountIndex int } -// func TestFuzz_Many(t *testing.T) { -// fuzz(t, defaultNumSwaps, defaultNumPositions, 10) -// } +func TestFuzz_Many(t *testing.T) { + fuzz(t, defaultNumSwaps, defaultNumPositions, 10) +} func (s *KeeperTestSuite) TestFuzz_GivenSeed() { // Seed 1688572291 - gives mismatch between tokenIn given to "out given in" and token in returned from "in given out" From 2528e966077ccc8218474ab9605d46d002dfa614 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 3 Oct 2023 22:09:33 +0000 Subject: [PATCH 12/34] Auto: update go.mod after push to adam/transfer-position-cl that modified dependencies locally --- go.mod | 11 ++++++----- go.sum | 22 ++++++++-------------- x/epochs/go.mod | 2 +- x/epochs/go.sum | 9 +++++++-- x/ibc-hooks/go.mod | 2 +- x/ibc-hooks/go.sum | 9 +++++++-- 6 files changed, 30 insertions(+), 25 deletions(-) diff --git a/go.mod b/go.mod index d6ed89b9f7b..0d1ca2d2a44 100644 --- a/go.mod +++ b/go.mod @@ -22,10 +22,10 @@ require ( github.com/mattn/go-sqlite3 v1.14.17 github.com/ory/dockertest/v3 v3.10.0 github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 - github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20230924192433-36cf2950dca4 - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51 - github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230911120014-b14342e08daf - github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230911120014-b14342e08daf + github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003220424-4346b86e9ae3 + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3 + github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231003220424-4346b86e9ae3 + github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231003220424-4346b86e9ae3 github.com/pkg/errors v0.9.1 github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.5.1 @@ -57,7 +57,7 @@ require ( github.com/benbjohnson/clock v1.3.0 // indirect github.com/butuzov/mirror v1.1.0 // indirect github.com/ccojocar/zxcvbn-go v1.0.1 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect + github.com/chenzhuoyu/iasm v0.9.0 // indirect github.com/cosmos/gogoproto v1.4.11 // indirect github.com/cosmos/iavl v0.19.7 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect @@ -81,6 +81,7 @@ require ( github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect github.com/timonwong/loggercheck v0.9.4 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/xen0n/gosmopolitan v1.2.1 // indirect github.com/ykadowak/zerologlint v0.1.3 // indirect github.com/zimmski/go-mutesting v0.0.0-20210610104036-6d9217011a00 // indirect diff --git a/go.sum b/go.sum index 53904c2c376..e6f4bc59611 100644 --- a/go.sum +++ b/go.sum @@ -197,8 +197,6 @@ github.com/butuzov/ireturn v0.2.0/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacM github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI= github.com/butuzov/mirror v1.1.0/go.mod h1:8Q0BdQU6rC6WILDiBM60DBfvV78OLJmMmixe7GF45AE= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= github.com/bytedance/sonic v1.10.1 h1:7a1wuFXL1cMy7a3f7/VFcEtriuXQnUBhtoVfOZiaysc= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= @@ -222,10 +220,7 @@ github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoG github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 h1:W9o46d2kbNL06lq7UNDPV0zYLzkrde/bjIqO02eoll0= github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8/go.mod h1:gakxgyXaaPkxvLw1XQxNGK4I37ys9iBRzNUx/B7pUCo= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo= github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -964,14 +959,14 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= 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.7-0.20230924192433-36cf2950dca4 h1:venI3u6DjxKcQbjiCO3V8s0ww/jx+cAZRkpwLHadms8= -github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20230924192433-36cf2950dca4/go.mod h1:IlCTpM2uoi8SUAigc9r9kAaoz7K5H9O84u7CwaTLDdY= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51 h1:iMcTtxurvgua69sd0jSqsWVimIc05BEIuQUfTQl3V8Y= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= -github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230911120014-b14342e08daf h1:8lkIsAj3L7zxvOZbqVLNJRpSdDxaYhYfAIG7XjPaJiU= -github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230911120014-b14342e08daf/go.mod h1:C0Uqe6X4N5ASA+1xZ6guaaJyUVKLcaVJIQa4Q4LG9Vk= -github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230911120014-b14342e08daf h1:ZEi+yJJPgpYtmNwZ1bMiP5cMBDQ83FK/YGgmTnWmoAI= -github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230911120014-b14342e08daf/go.mod h1:pqkAsS04Er1kFM41gg3aWTSaYHyLe8C9Dw3Sj8KMXk8= +github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003220424-4346b86e9ae3 h1:XAHKGJzX75KEXoaubMv0NeLsGHHgntOgZRsvdmnp/Ck= +github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003220424-4346b86e9ae3/go.mod h1:YEMUPuI9gBUATC4tp2MiW0oWRlShli0K95JqgNKJh9c= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3 h1:9tCsF1B0bG2xtdBENBpDtSNoAlitwGUZIVzusdmTYzo= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= +github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231003220424-4346b86e9ae3 h1:rIkBruURF/nK5l887a9z0sDDd/Rj5sN//vTblT9Q4nw= +github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231003220424-4346b86e9ae3/go.mod h1:kMtggRhE3Vr/+aLNBVg9AveVMXzRhYq9+PKS0wVvplU= +github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231003220424-4346b86e9ae3 h1:5+X8t4OjOMmzjiAQSrU46bEGEZ5XBiJttT23Mx8izHI= +github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231003220424-4346b86e9ae3/go.mod h1:UenEegYb+q5ETqQZim4KPn7DDK4VMoUL27VR2oLLA1s= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16 h1:X747cZYdnqc/+RV48iPVeGprpVb/fUWSaKGsZUWrdbg= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16/go.mod h1:Rf8zW/GgBQyFRRB4s62VQHWA6sTlMFSjoDQQpoq64iI= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= @@ -1332,7 +1327,6 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= diff --git a/x/epochs/go.mod b/x/epochs/go.mod index 809b175f71b..fbe060ce5f8 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -8,7 +8,7 @@ require ( github.com/golang/protobuf v1.5.3 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51 + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 github.com/tendermint/tendermint v0.37.0-rc1 diff --git a/x/epochs/go.sum b/x/epochs/go.sum index a669c2c0676..30f745152dc 100644 --- a/x/epochs/go.sum +++ b/x/epochs/go.sum @@ -41,6 +41,7 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= cosmossdk.io/math v1.1.3-rc.1 h1:NebCNWDqb1MJRNfvxr4YY7d8FSYgkuB3L75K6xvM+Zo= +cosmossdk.io/math v1.1.3-rc.1/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -720,8 +721,8 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= github.com/osmosis-labs/osmosis/osmomath v0.0.6 h1:WNkVmeeudAqRFk5a4CChWsdxfiY/XLClT1i845L78ss= github.com/osmosis-labs/osmosis/osmomath v0.0.6/go.mod h1:UlftwozB+QObT3o0YfkuuyL9fsVdgoWt0dm6J7MLYnU= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51 h1:iMcTtxurvgua69sd0jSqsWVimIc05BEIuQUfTQl3V8Y= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3 h1:9tCsF1B0bG2xtdBENBpDtSNoAlitwGUZIVzusdmTYzo= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= github.com/osmosis-labs/osmosis/v19 v19.0.0 h1:gqcas/XfxtEuZXsWGTO9vNMHiY78Qs09FBQw73djIVM= github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= @@ -759,6 +760,7 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -766,6 +768,7 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -775,6 +778,7 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -782,6 +786,7 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= diff --git a/x/ibc-hooks/go.mod b/x/ibc-hooks/go.mod index 9992b69f653..cb0a075308c 100644 --- a/x/ibc-hooks/go.mod +++ b/x/ibc-hooks/go.mod @@ -12,7 +12,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/osmosis-labs/osmosis/osmomath v0.0.6 - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51 + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3 github.com/spf13/cobra v1.7.0 github.com/tendermint/tendermint v0.37.0-rc1 google.golang.org/grpc v1.57.0 diff --git a/x/ibc-hooks/go.sum b/x/ibc-hooks/go.sum index a93d8051ef0..62fbdd7fc10 100644 --- a/x/ibc-hooks/go.sum +++ b/x/ibc-hooks/go.sum @@ -42,6 +42,7 @@ collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= cosmossdk.io/math v1.1.3-rc.1 h1:NebCNWDqb1MJRNfvxr4YY7d8FSYgkuB3L75K6xvM+Zo= +cosmossdk.io/math v1.1.3-rc.1/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -732,8 +733,8 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= github.com/osmosis-labs/osmosis/osmomath v0.0.6 h1:WNkVmeeudAqRFk5a4CChWsdxfiY/XLClT1i845L78ss= github.com/osmosis-labs/osmosis/osmomath v0.0.6/go.mod h1:UlftwozB+QObT3o0YfkuuyL9fsVdgoWt0dm6J7MLYnU= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51 h1:iMcTtxurvgua69sd0jSqsWVimIc05BEIuQUfTQl3V8Y= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003040219-efc7fbaf9c51/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3 h1:9tCsF1B0bG2xtdBENBpDtSNoAlitwGUZIVzusdmTYzo= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16 h1:X747cZYdnqc/+RV48iPVeGprpVb/fUWSaKGsZUWrdbg= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16/go.mod h1:Rf8zW/GgBQyFRRB4s62VQHWA6sTlMFSjoDQQpoq64iI= github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE= @@ -772,6 +773,7 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -779,6 +781,7 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -788,6 +791,7 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -795,6 +799,7 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= From 0dc912362575c2b87a36ef85fb6366b38becb593 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 3 Oct 2023 16:24:34 -0600 Subject: [PATCH 13/34] use helper methods --- x/concentrated-liquidity/msg_server_test.go | 39 +++++--------------- x/concentrated-liquidity/position_test.go | 40 ++++++++++++++++++--- 2 files changed, 45 insertions(+), 34 deletions(-) diff --git a/x/concentrated-liquidity/msg_server_test.go b/x/concentrated-liquidity/msg_server_test.go index c6fece17ae4..e9d92c88848 100644 --- a/x/concentrated-liquidity/msg_server_test.go +++ b/x/concentrated-liquidity/msg_server_test.go @@ -7,6 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/osmosis/osmomath" + "github.com/osmosis-labs/osmosis/v19/app/apptesting" cl "github.com/osmosis-labs/osmosis/v19/x/concentrated-liquidity" clmodel "github.com/osmosis-labs/osmosis/v19/x/concentrated-liquidity/model" "github.com/osmosis-labs/osmosis/v19/x/concentrated-liquidity/types" @@ -565,7 +566,7 @@ func (s *KeeperTestSuite) TestTransferPositions_Events() { positionIds: []uint64{DefaultPositionId}, numPositionsToCreate: 1, expectedTransferPositionsEvent: 1, - expectedMessageEvents: 1, // 1 for transfer, 1 for collect spread rewards + expectedMessageEvents: 1, // 1 for transfer }, "single position ID with claimable incentives": { positionIds: []uint64{DefaultPositionId}, @@ -638,40 +639,18 @@ func (s *KeeperTestSuite) TestTransferPositions_Events() { } if tc.hasIncentivesToClaim { - for _, positionId := range tc.positionIds { - // Determine how much position will claim and fund - coinsToFundForIncentivesToUser := expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24, defaultMultiplier) - s.FundAcc(pool.GetIncentivesAddress(), coinsToFundForIncentivesToUser) - // Determine how much position will forfeit and fund - coinsToFundForForefeitToPool := expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24*14, defaultMultiplier).Sub(expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24, defaultMultiplier)) - s.FundAcc(pool.GetIncentivesAddress(), coinsToFundForForefeitToPool) - // Add uptime growth to the pool that targets the position - position, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, positionId) - s.Require().NoError(err) - // only add to uptime growth once for simplicity - if positionId == tc.positionIds[0] { - s.addUptimeGrowthInsideRange(s.Ctx, pool.GetId(), s.TestAccs[0], position.LowerTick+1, position.LowerTick, position.UpperTick, expectedUptimes.hundredTokensMultiDenom) - } - } - // Move block time forward to allow for claiming incentives - s.Ctx = s.Ctx.WithBlockTime(s.Ctx.BlockTime().Add(time.Hour * 24)) + s.fundIncentiveAddr(s.Ctx, pool.GetIncentivesAddress(), tc.positionIds) + s.addUptimeGrowthInsideRange(s.Ctx, pool.GetId(), s.TestAccs[0], apptesting.DefaultLowerTick+1, DefaultLowerTick, DefaultUpperTick, expectedUptimes.hundredTokensMultiDenom) } if tc.hasSpreadRewardsToClaim { - for _, positionId := range tc.positionIds { - // Utilize the position liquidity value to determine how much spread rewards the position will claim - position, err := s.App.ConcentratedLiquidityKeeper.GetPosition(s.Ctx, positionId) - s.Require().NoError(err) - expectedAmountToClaim := position.Liquidity.MulInt(osmomath.NewInt(10)).TruncateInt() - // Fund the spread rewards account with the expected rewards and add to the pool's accum - s.FundAcc(pool.GetSpreadRewardsAddress(), sdk.NewCoins(sdk.NewCoin(ETH, expectedAmountToClaim))) - // only add to spread rewards accum once for simplicity - if positionId == tc.positionIds[0] { - s.AddToSpreadRewardAccumulator(pool.GetId(), sdk.NewDecCoin(ETH, osmomath.NewInt(10))) - } - } + s.fundSpreadRewardsAddr(s.Ctx, pool.GetSpreadRewardsAddress(), tc.positionIds) + s.AddToSpreadRewardAccumulator(pool.GetId(), sdk.NewDecCoin(ETH, osmomath.NewInt(10))) } + // Move block time forward one day to claim and forfeit part of the incentives. + s.Ctx = s.Ctx.WithBlockTime(s.Ctx.BlockTime().Add(time.Hour * 24)) + if !tc.isLastPositionInPool { // Setup a far out of range position that we do not touch, so when we transfer positions we do not transfer the last position in the pool. s.SetupPosition(pool.GetId(), s.TestAccs[2], sdk.NewCoins(DefaultCoin1), DefaultMinTick, DefaultMinTick+100, true) diff --git a/x/concentrated-liquidity/position_test.go b/x/concentrated-liquidity/position_test.go index 15698ece555..fcde7cc8ab4 100644 --- a/x/concentrated-liquidity/position_test.go +++ b/x/concentrated-liquidity/position_test.go @@ -2352,7 +2352,9 @@ func (s *KeeperTestSuite) TestTransferPositions() { } // For each position that is in range, add spread rewards and incentives to their respective addresses - totalExpectedRewards := s.fundIncentiveAndSpreadRewardsAddr(s.Ctx, pool.GetIncentivesAddress(), pool.GetSpreadRewardsAddress(), tc.inRangePositions) + totalSpreadRewards := s.fundSpreadRewardsAddr(s.Ctx, pool.GetSpreadRewardsAddress(), tc.inRangePositions) + totalIncentives := s.fundIncentiveAddr(s.Ctx, pool.GetIncentivesAddress(), tc.inRangePositions) + totalExpectedRewards := totalSpreadRewards.Add(totalIncentives...) // Add spread rewards and incentives to the pool s.addUptimeGrowthInsideRange(s.Ctx, pool.GetId(), oldOwner, apptesting.DefaultLowerTick+1, DefaultLowerTick, DefaultUpperTick, expectedUptimes.hundredTokensMultiDenom) @@ -2446,7 +2448,9 @@ func (s *KeeperTestSuite) TestTransferPositions() { } // Test that adding incentives/spread rewards and then claiming returns it to the new owner, and the old owner does not get anything - totalExpectedRewards = s.fundIncentiveAndSpreadRewardsAddr(s.Ctx, pool.GetIncentivesAddress(), pool.GetSpreadRewardsAddress(), tc.inRangePositions) + totalSpreadRewards := s.fundSpreadRewardsAddr(s.Ctx, pool.GetSpreadRewardsAddress(), tc.inRangePositions) + totalIncentives := s.fundIncentiveAddr(s.Ctx, pool.GetIncentivesAddress(), tc.inRangePositions) + totalExpectedRewards := totalSpreadRewards.Add(totalIncentives...) s.addUptimeGrowthInsideRange(s.Ctx, pool.GetId(), oldOwner, apptesting.DefaultLowerTick+1, DefaultLowerTick, DefaultUpperTick, expectedUptimes.hundredTokensMultiDenom) s.AddToSpreadRewardAccumulator(pool.GetId(), sdk.NewDecCoin(ETH, osmomath.NewInt(10))) for _, positionId := range tc.positionsToTransfer { @@ -2487,16 +2491,44 @@ func (s *KeeperTestSuite) TestTransferPositions() { } } -func (s *KeeperTestSuite) fundIncentiveAndSpreadRewardsAddr(ctx sdk.Context, incentivesAddress, spreadRewardsAddress sdk.AccAddress, positionIds []uint64) (totalExpectedRewards sdk.Coins) { +// fundIncentiveAddr funds the incentive address for each position ID in the provided slice. +// It calculates the expected incentives based on uptime growth and adds these incentives to the total expected rewards. +// It also determines how much position will forfeit and funds this amount to the incentive address. +// The function returns the total expected rewards after funding all the positions. +// +// Parameters: +// - ctx: The context of the operation. +// - incentivesAddress: The address to which the incentives will be funded. +// - positionIds: A slice of position IDs for which the incentives will be funded. +// +// Returns: +// - totalExpectedRewards: The total expected rewards after funding all the positions. +func (s *KeeperTestSuite) fundIncentiveAddr(ctx sdk.Context, incentivesAddress sdk.AccAddress, positionIds []uint64) (totalExpectedRewards sdk.Coins) { expectedUptimes := getExpectedUptimes() - for _, positionId := range positionIds { + for i := 0; i < len(positionIds); i++ { coinsToFundForIncentivesToUser := expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24, defaultMultiplier) totalExpectedRewards = totalExpectedRewards.Add(coinsToFundForIncentivesToUser...) s.FundAcc(incentivesAddress, coinsToFundForIncentivesToUser) // Determine how much position will forfeit and fund coinsToFundForForefeitToPool := expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24*14, defaultMultiplier).Sub(expectedIncentivesFromUptimeGrowth(expectedUptimes.hundredTokensMultiDenom, DefaultLiquidityAmt, time.Hour*24, defaultMultiplier)) s.FundAcc(incentivesAddress, coinsToFundForForefeitToPool) + } + return +} +// fundSpreadRewardsAddr funds the spread rewards address for each position ID in the provided slice. +// It calculates the expected amount to claim based on the position's liquidity and adds these rewards to the total expected rewards. +// The function then funds the spread rewards account with the total expected rewards. +// +// Parameters: +// - ctx: The context of the operation. +// - spreadRewardsAddress: The address to which the spread rewards will be funded. +// - positionIds: A slice of position IDs for which the spread rewards will be funded. +// +// Returns: +// - totalExpectedRewards: The total expected rewards after funding all the positions. +func (s *KeeperTestSuite) fundSpreadRewardsAddr(ctx sdk.Context, spreadRewardsAddress sdk.AccAddress, positionIds []uint64) (totalExpectedRewards sdk.Coins) { + for _, positionId := range positionIds { position, err := s.App.ConcentratedLiquidityKeeper.GetPosition(ctx, positionId) s.Require().NoError(err) From febb5d40fc1d5ae3451e16a4f5394f54328d6dab Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 3 Oct 2023 16:37:42 -0600 Subject: [PATCH 14/34] modify array diff method --- osmoutils/compare.go | 25 ++++++---- osmoutils/compare_test.go | 51 ++++++++++----------- x/concentrated-liquidity/msg_server_test.go | 1 + x/concentrated-liquidity/position.go | 5 -- x/concentrated-liquidity/position_test.go | 1 + 5 files changed, 44 insertions(+), 39 deletions(-) diff --git a/osmoutils/compare.go b/osmoutils/compare.go index 3e3ef9644f2..0e01a4a8cfe 100644 --- a/osmoutils/compare.go +++ b/osmoutils/compare.go @@ -59,30 +59,39 @@ func Max(values ...interface{}) interface{} { } // DifferenceBetweenUint64Arrays takes two slices of uint64, 'a' and 'b', as input. -// It returns a new slice containing the elements that are in 'a' but not in 'b'. -// The function uses a map for efficient lookup of elements. +// It returns a new slice containing the elements that are unique to either 'a' or 'b'. +// The function uses two maps for efficient lookup of elements. // // Example: // a := []uint64{1, 2, 3, 4, 5} // b := []uint64{4, 5, 6, 7, 8} // result := DifferenceBetweenUint64Arrays(a, b) -// result will be []uint64{1, 2, 3} +// result will be []uint64{1, 2, 3, 6, 7, 8} // // Note: This function does not preserve the order of the elements. func DifferenceBetweenUint64Arrays(a, b []uint64) []uint64 { - m := make(map[uint64]bool) + m1 := make(map[uint64]bool) + m2 := make(map[uint64]bool) for _, item := range a { - m[item] = true + m1[item] = true } for _, item := range b { - delete(m, item) + m2[item] = true } var result []uint64 - for item := range m { - result = append(result, item) + for item := range m1 { + if !m2[item] { + result = append(result, item) + } + } + + for item := range m2 { + if !m1[item] { + result = append(result, item) + } } return result diff --git a/osmoutils/compare_test.go b/osmoutils/compare_test.go index f4e5e7ed691..563000eac07 100644 --- a/osmoutils/compare_test.go +++ b/osmoutils/compare_test.go @@ -2,6 +2,7 @@ package osmoutils_test import ( "reflect" + "sort" "testing" "github.com/stretchr/testify/assert" @@ -40,38 +41,36 @@ func TestMax(t *testing.T) { } } -func TestDifferenceUint64(t *testing.T) { - testCases := []struct { - a []uint64 - b []uint64 - expected []uint64 +func TestDifferenceBetweenUint64Arrays(t *testing.T) { + tests := []struct { + name string + a []uint64 + b []uint64 + want []uint64 }{ { - a: []uint64{1, 2, 3, 4, 5}, - b: []uint64{4, 5, 6, 7, 8}, - expected: []uint64{1, 2, 3}, - }, - { - a: []uint64{10, 20, 30, 40, 50}, - b: []uint64{30, 40, 50, 60, 70}, - expected: []uint64{10, 20}, - }, - { - a: []uint64{}, - b: []uint64{1, 2, 3}, - expected: []uint64{}, + name: "Test 1", + a: []uint64{1, 2, 3, 4, 5}, + b: []uint64{4, 5, 6, 7, 8}, + want: []uint64{1, 2, 3, 6, 7, 8}, }, { - a: []uint64{1, 2, 3}, - b: []uint64{}, - expected: []uint64{1, 2, 3}, + name: "Test 2", + a: []uint64{10, 20, 30}, + b: []uint64{20, 30, 40}, + want: []uint64{10, 40}, }, } - for _, tc := range testCases { - result := osmoutils.DifferenceBetweenUint64Arrays(tc.a, tc.b) - if !reflect.DeepEqual(result, tc.expected) { - t.Errorf("DifferenceUint64(%v, %v) = %v; want %v", tc.a, tc.b, result, tc.expected) - } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := osmoutils.DifferenceBetweenUint64Arrays(tt.a, tt.b) + sort.Slice(got, func(i, j int) bool { return got[i] < got[j] }) + sort.Slice(tt.want, func(i, j int) bool { return tt.want[i] < tt.want[j] }) + + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("DifferenceBetweenUint64Arrays() = %v, want %v", got, tt.want) + } + }) } } diff --git a/x/concentrated-liquidity/msg_server_test.go b/x/concentrated-liquidity/msg_server_test.go index e9d92c88848..1f5fb7cf8f0 100644 --- a/x/concentrated-liquidity/msg_server_test.go +++ b/x/concentrated-liquidity/msg_server_test.go @@ -653,6 +653,7 @@ func (s *KeeperTestSuite) TestTransferPositions_Events() { if !tc.isLastPositionInPool { // Setup a far out of range position that we do not touch, so when we transfer positions we do not transfer the last position in the pool. + // This is because we special case this logic in the keeper to not allow the last position in the pool to be transferred. s.SetupPosition(pool.GetId(), s.TestAccs[2], sdk.NewCoins(DefaultCoin1), DefaultMinTick, DefaultMinTick+100, true) } diff --git a/x/concentrated-liquidity/position.go b/x/concentrated-liquidity/position.go index 51857555e2d..9bcfdf80017 100644 --- a/x/concentrated-liquidity/position.go +++ b/x/concentrated-liquidity/position.go @@ -24,11 +24,6 @@ const MinNumPositions = 2 var emptyOptions = &accum.Options{} -type PositionWithWithdrawnAmount struct { - Position model.Position - CoinsWithdrawn sdk.Coins -} - // getOrInitPosition retrieves the position's liquidity for the given tick range. // If it doesn't exist, it returns zero. func (k Keeper) getOrInitPosition( diff --git a/x/concentrated-liquidity/position_test.go b/x/concentrated-liquidity/position_test.go index fcde7cc8ab4..439a65cc258 100644 --- a/x/concentrated-liquidity/position_test.go +++ b/x/concentrated-liquidity/position_test.go @@ -2347,6 +2347,7 @@ func (s *KeeperTestSuite) TestTransferPositions() { } // Setup a far out of range position that we do not touch, so when we transfer positions we do not transfer the last position in the pool. + // This is because we special case this logic in the keeper to not allow the last position in the pool to be transferred. if !tc.isLastPositionInPool { s.SetupPosition(pool.GetId(), s.TestAccs[2], sdk.NewCoins(DefaultCoin0), DefaultMaxTick-100, DefaultMaxTick, true) } From 16e98299e3d1e2c50520e841cd73fdd79a76b314 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 3 Oct 2023 22:42:34 +0000 Subject: [PATCH 15/34] Auto: update go.mod after push to adam/transfer-position-cl that modified dependencies locally --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- x/epochs/go.mod | 2 +- x/epochs/go.sum | 4 ++-- x/ibc-hooks/go.mod | 2 +- x/ibc-hooks/go.sum | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 0d1ca2d2a44..a923e37b494 100644 --- a/go.mod +++ b/go.mod @@ -22,10 +22,10 @@ require ( github.com/mattn/go-sqlite3 v1.14.17 github.com/ory/dockertest/v3 v3.10.0 github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 - github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003220424-4346b86e9ae3 - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3 - github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231003220424-4346b86e9ae3 - github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231003220424-4346b86e9ae3 + github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003223742-febb5d40fc1d + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d + github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231003223742-febb5d40fc1d + github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231003223742-febb5d40fc1d github.com/pkg/errors v0.9.1 github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.5.1 diff --git a/go.sum b/go.sum index e6f4bc59611..34c2772fec4 100644 --- a/go.sum +++ b/go.sum @@ -959,14 +959,14 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= 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.7-0.20231003220424-4346b86e9ae3 h1:XAHKGJzX75KEXoaubMv0NeLsGHHgntOgZRsvdmnp/Ck= -github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003220424-4346b86e9ae3/go.mod h1:YEMUPuI9gBUATC4tp2MiW0oWRlShli0K95JqgNKJh9c= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3 h1:9tCsF1B0bG2xtdBENBpDtSNoAlitwGUZIVzusdmTYzo= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= -github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231003220424-4346b86e9ae3 h1:rIkBruURF/nK5l887a9z0sDDd/Rj5sN//vTblT9Q4nw= -github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231003220424-4346b86e9ae3/go.mod h1:kMtggRhE3Vr/+aLNBVg9AveVMXzRhYq9+PKS0wVvplU= -github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231003220424-4346b86e9ae3 h1:5+X8t4OjOMmzjiAQSrU46bEGEZ5XBiJttT23Mx8izHI= -github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231003220424-4346b86e9ae3/go.mod h1:UenEegYb+q5ETqQZim4KPn7DDK4VMoUL27VR2oLLA1s= +github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003223742-febb5d40fc1d h1:YU32IlPwa1CsnXXxJKnX9e0n4p8MC6txKp5RsyhC0Ec= +github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003223742-febb5d40fc1d/go.mod h1:YEMUPuI9gBUATC4tp2MiW0oWRlShli0K95JqgNKJh9c= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d h1:eQK6rkHA6bkP7Hq9huFtx8Fz/attOyKN7++ITam0p7U= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= +github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231003223742-febb5d40fc1d h1:2xfs4Pfzcp0qSRihbja0unfLPfHxueDmaQSplZz4FCM= +github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231003223742-febb5d40fc1d/go.mod h1:h2bGT8MCtEYdWk1Qg530P2quh29jVGefDsT94vSJ0ck= +github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231003223742-febb5d40fc1d h1:9uCwV3qXRjchR6Yzshmgrh0+6f7wrcUhWbz/C/i2WYM= +github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231003223742-febb5d40fc1d/go.mod h1:nEvp/Hj2TChJuKBokDyDy7dkvDufu0JAKdpJCUe1EZ0= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16 h1:X747cZYdnqc/+RV48iPVeGprpVb/fUWSaKGsZUWrdbg= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16/go.mod h1:Rf8zW/GgBQyFRRB4s62VQHWA6sTlMFSjoDQQpoq64iI= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= diff --git a/x/epochs/go.mod b/x/epochs/go.mod index fbe060ce5f8..df95baeabdb 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -8,7 +8,7 @@ require ( github.com/golang/protobuf v1.5.3 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3 + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 github.com/tendermint/tendermint v0.37.0-rc1 diff --git a/x/epochs/go.sum b/x/epochs/go.sum index 30f745152dc..977c14b895d 100644 --- a/x/epochs/go.sum +++ b/x/epochs/go.sum @@ -721,8 +721,8 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= github.com/osmosis-labs/osmosis/osmomath v0.0.6 h1:WNkVmeeudAqRFk5a4CChWsdxfiY/XLClT1i845L78ss= github.com/osmosis-labs/osmosis/osmomath v0.0.6/go.mod h1:UlftwozB+QObT3o0YfkuuyL9fsVdgoWt0dm6J7MLYnU= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3 h1:9tCsF1B0bG2xtdBENBpDtSNoAlitwGUZIVzusdmTYzo= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d h1:eQK6rkHA6bkP7Hq9huFtx8Fz/attOyKN7++ITam0p7U= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= github.com/osmosis-labs/osmosis/v19 v19.0.0 h1:gqcas/XfxtEuZXsWGTO9vNMHiY78Qs09FBQw73djIVM= github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= diff --git a/x/ibc-hooks/go.mod b/x/ibc-hooks/go.mod index cb0a075308c..921e28b1b15 100644 --- a/x/ibc-hooks/go.mod +++ b/x/ibc-hooks/go.mod @@ -12,7 +12,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/osmosis-labs/osmosis/osmomath v0.0.6 - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3 + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d github.com/spf13/cobra v1.7.0 github.com/tendermint/tendermint v0.37.0-rc1 google.golang.org/grpc v1.57.0 diff --git a/x/ibc-hooks/go.sum b/x/ibc-hooks/go.sum index 62fbdd7fc10..e24a174269b 100644 --- a/x/ibc-hooks/go.sum +++ b/x/ibc-hooks/go.sum @@ -733,8 +733,8 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= github.com/osmosis-labs/osmosis/osmomath v0.0.6 h1:WNkVmeeudAqRFk5a4CChWsdxfiY/XLClT1i845L78ss= github.com/osmosis-labs/osmosis/osmomath v0.0.6/go.mod h1:UlftwozB+QObT3o0YfkuuyL9fsVdgoWt0dm6J7MLYnU= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3 h1:9tCsF1B0bG2xtdBENBpDtSNoAlitwGUZIVzusdmTYzo= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003220424-4346b86e9ae3/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d h1:eQK6rkHA6bkP7Hq9huFtx8Fz/attOyKN7++ITam0p7U= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16 h1:X747cZYdnqc/+RV48iPVeGprpVb/fUWSaKGsZUWrdbg= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16/go.mod h1:Rf8zW/GgBQyFRRB4s62VQHWA6sTlMFSjoDQQpoq64iI= github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE= From 920b1a4d646edead5a1ce451f5d9a480d2d308a9 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 3 Oct 2023 16:57:31 -0600 Subject: [PATCH 16/34] address test --- x/concentrated-liquidity/msg_server_test.go | 2 +- x/concentrated-liquidity/spread_rewards_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x/concentrated-liquidity/msg_server_test.go b/x/concentrated-liquidity/msg_server_test.go index 1f5fb7cf8f0..512a59af72c 100644 --- a/x/concentrated-liquidity/msg_server_test.go +++ b/x/concentrated-liquidity/msg_server_test.go @@ -160,7 +160,7 @@ func (s *KeeperTestSuite) TestAddToPosition_Events() { }{ "happy path": { expectedAddedToPositionEvent: 1, - expectedMessageEvents: 5, + expectedMessageEvents: 4, }, "error: last position in pool": { lastPositionInPool: true, diff --git a/x/concentrated-liquidity/spread_rewards_test.go b/x/concentrated-liquidity/spread_rewards_test.go index 37e5bd86d92..8d708adb8b4 100644 --- a/x/concentrated-liquidity/spread_rewards_test.go +++ b/x/concentrated-liquidity/spread_rewards_test.go @@ -1476,7 +1476,7 @@ func (s *KeeperTestSuite) TestFunctional_SpreadRewards_LP() { collectedThree, err := s.App.ConcentratedLiquidityKeeper.CollectSpreadRewards(ctx, owner, positionDataThree.ID) s.Require().NoError(err) - s.Require().Equal(sdk.Coins(nil), collectedThree) + s.Require().Equal(sdk.Coins{}, collectedThree) } // This test validates that spread rewards are collected without issues From 1b04c86290aa140f478a6f472e209fb6efd1da4b Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 3 Oct 2023 19:51:26 -0600 Subject: [PATCH 17/34] last test fix --- x/concentrated-liquidity/spread_rewards_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/concentrated-liquidity/spread_rewards_test.go b/x/concentrated-liquidity/spread_rewards_test.go index 8d708adb8b4..572ab624fbe 100644 --- a/x/concentrated-liquidity/spread_rewards_test.go +++ b/x/concentrated-liquidity/spread_rewards_test.go @@ -1576,7 +1576,7 @@ func (s *KeeperTestSuite) tickStatusInvariance(ticksActivatedAfterEachSwap [][]i } } else { // If the position was not active, check that the spread rewards collected are zero - s.Require().Nil(coins) + s.Require().Equal(sdk.Coins{}, coins) } } } From 5d6f5103c42462cf699ca8a4499f07f871ad7162 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sun, 8 Oct 2023 14:02:48 -0500 Subject: [PATCH 18/34] Update x/concentrated-liquidity/client/cli/tx.go Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> --- x/concentrated-liquidity/client/cli/tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/concentrated-liquidity/client/cli/tx.go b/x/concentrated-liquidity/client/cli/tx.go index 3d28dfec294..9425f5f0bae 100644 --- a/x/concentrated-liquidity/client/cli/tx.go +++ b/x/concentrated-liquidity/client/cli/tx.go @@ -97,7 +97,7 @@ func NewFungifyChargedPositionsCmd() (*osmocli.TxCliDesc, *types.MsgFungifyCharg func NewTransferPositionsCmd() (*osmocli.TxCliDesc, *types.MsgTransferPositions) { return &osmocli.TxCliDesc{ - Use: "transfer-positions [position-ids] [new-owner]", + Use: "transfer-positions", Short: "transfer a list of concentrated liquidity positions to a new owner", Example: "osmosisd tx concentratedliquidity transfer-positions 56,89,1011 osmo10fhdy8zhepstpwsr9l4a8yxuyggqmpqx4ktheq --from val --chain-id osmosis-1 -b block --keyring-backend test --fees 1000uosmo", }, &types.MsgTransferPositions{} From bb936a1eecfd0fbf21ec89cf3501dbf5cb6bbedb Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sun, 8 Oct 2023 14:04:05 -0500 Subject: [PATCH 19/34] Update osmoutils/compare.go Co-authored-by: Roman --- osmoutils/compare.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osmoutils/compare.go b/osmoutils/compare.go index 0e01a4a8cfe..ba8256c645b 100644 --- a/osmoutils/compare.go +++ b/osmoutils/compare.go @@ -69,7 +69,7 @@ func Max(values ...interface{}) interface{} { // result will be []uint64{1, 2, 3, 6, 7, 8} // // Note: This function does not preserve the order of the elements. -func DifferenceBetweenUint64Arrays(a, b []uint64) []uint64 { +func DisjointArrays(a, b []uint64) []uint64 { m1 := make(map[uint64]bool) m2 := make(map[uint64]bool) From 9cd487e5fd1f00c2f1711cf0977eea7afae0c929 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sun, 8 Oct 2023 13:15:39 -0600 Subject: [PATCH 20/34] rename all uses --- osmoutils/compare_test.go | 4 ++-- x/concentrated-liquidity/position_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osmoutils/compare_test.go b/osmoutils/compare_test.go index 563000eac07..e9fb8854854 100644 --- a/osmoutils/compare_test.go +++ b/osmoutils/compare_test.go @@ -41,7 +41,7 @@ func TestMax(t *testing.T) { } } -func TestDifferenceBetweenUint64Arrays(t *testing.T) { +func TestDisjointArrays(t *testing.T) { tests := []struct { name string a []uint64 @@ -64,7 +64,7 @@ func TestDifferenceBetweenUint64Arrays(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got := osmoutils.DifferenceBetweenUint64Arrays(tt.a, tt.b) + got := osmoutils.DisjointArrays(tt.a, tt.b) sort.Slice(got, func(i, j int) bool { return got[i] < got[j] }) sort.Slice(tt.want, func(i, j int) bool { return tt.want[i] < tt.want[j] }) diff --git a/x/concentrated-liquidity/position_test.go b/x/concentrated-liquidity/position_test.go index 439a65cc258..ce70e38c907 100644 --- a/x/concentrated-liquidity/position_test.go +++ b/x/concentrated-liquidity/position_test.go @@ -2408,7 +2408,7 @@ func (s *KeeperTestSuite) TestTransferPositions() { } allPositions := append(tc.inRangePositions, tc.outOfRangePositions...) - positionsNotTransfered := osmoutils.DifferenceBetweenUint64Arrays(allPositions, tc.positionsToTransfer) + positionsNotTransfered := osmoutils.DisjointArrays(allPositions, tc.positionsToTransfer) // Check that the positions not transferred were not modified for _, positionId := range positionsNotTransfered { From 3ab50f12497c58db13a68ed1a50af123238e945d Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sun, 8 Oct 2023 14:33:27 -0600 Subject: [PATCH 21/34] sort the result, add tests for both sorted and unsorted --- osmoutils/compare.go | 9 +++++++-- osmoutils/compare_test.go | 32 ++++++++++++++++++++++++++++---- osmoutils/ibc.go | 1 + 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/osmoutils/compare.go b/osmoutils/compare.go index ba8256c645b..3ea276f4bc7 100644 --- a/osmoutils/compare.go +++ b/osmoutils/compare.go @@ -1,5 +1,7 @@ package osmoutils +import "sort" + // Max returns the maximum value among the given values of any type that supports comparison. func Max(values ...interface{}) interface{} { if len(values) == 0 { @@ -65,10 +67,11 @@ func Max(values ...interface{}) interface{} { // Example: // a := []uint64{1, 2, 3, 4, 5} // b := []uint64{4, 5, 6, 7, 8} -// result := DifferenceBetweenUint64Arrays(a, b) +// result := DisjointArrays(a, b) // result will be []uint64{1, 2, 3, 6, 7, 8} // -// Note: This function does not preserve the order of the elements. +// Note: This function returns the difference between the two arrays in ascending order, +// and does not preserve the order of the elements in the original arrays. func DisjointArrays(a, b []uint64) []uint64 { m1 := make(map[uint64]bool) m2 := make(map[uint64]bool) @@ -94,5 +97,7 @@ func DisjointArrays(a, b []uint64) []uint64 { } } + sort.Slice(result, func(i, j int) bool { return result[i] < result[j] }) + return result } diff --git a/osmoutils/compare_test.go b/osmoutils/compare_test.go index e9fb8854854..23f099e08c2 100644 --- a/osmoutils/compare_test.go +++ b/osmoutils/compare_test.go @@ -49,15 +49,39 @@ func TestDisjointArrays(t *testing.T) { want []uint64 }{ { - name: "Test 1", + name: "Both arrays contain unique elements, sorted", a: []uint64{1, 2, 3, 4, 5}, b: []uint64{4, 5, 6, 7, 8}, want: []uint64{1, 2, 3, 6, 7, 8}, }, { - name: "Test 2", - a: []uint64{10, 20, 30}, - b: []uint64{20, 30, 40}, + name: "Only array 'a' contains unique elements, sorted", + a: []uint64{10, 20, 30, 40}, + b: []uint64{20, 30}, + want: []uint64{10, 40}, + }, + { + name: "Only array 'b' contains unique elements, sorted", + a: []uint64{20, 30}, + b: []uint64{10, 20, 30, 40}, + want: []uint64{10, 40}, + }, + { + name: "Both arrays contain unique elements, unsorted", + a: []uint64{5, 4, 3, 2, 1}, + b: []uint64{8, 7, 6, 5, 4}, + want: []uint64{1, 2, 3, 6, 7, 8}, + }, + { + name: "Only array 'a' contains unique elements, unsorted", + a: []uint64{40, 30, 20, 10}, + b: []uint64{30, 20}, + want: []uint64{10, 40}, + }, + { + name: "Only array 'b' contains unique elements, unsorted", + a: []uint64{30, 20}, + b: []uint64{40, 30, 20, 10}, want: []uint64{10, 40}, }, } diff --git a/osmoutils/ibc.go b/osmoutils/ibc.go index 310059d7c56..4500a05e25e 100644 --- a/osmoutils/ibc.go +++ b/osmoutils/ibc.go @@ -3,6 +3,7 @@ package osmoutils import ( "encoding/json" "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" From 56eea8dbf48a3f0bfe3b05c385656e33d51bb425 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sun, 8 Oct 2023 14:52:53 -0600 Subject: [PATCH 22/34] extend tests --- osmoutils/compare.go | 8 ++++++ osmoutils/compare_test.go | 51 ++++++++++++++++++++++++++++++++------- 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/osmoutils/compare.go b/osmoutils/compare.go index 3ea276f4bc7..d6b01997175 100644 --- a/osmoutils/compare.go +++ b/osmoutils/compare.go @@ -73,6 +73,10 @@ func Max(values ...interface{}) interface{} { // Note: This function returns the difference between the two arrays in ascending order, // and does not preserve the order of the elements in the original arrays. func DisjointArrays(a, b []uint64) []uint64 { + if len(a) == 0 && len(b) == 0 { + return []uint64{} + } + m1 := make(map[uint64]bool) m2 := make(map[uint64]bool) @@ -97,6 +101,10 @@ func DisjointArrays(a, b []uint64) []uint64 { } } + if len(result) == 0 { + return []uint64{} + } + sort.Slice(result, func(i, j int) bool { return result[i] < result[j] }) return result diff --git a/osmoutils/compare_test.go b/osmoutils/compare_test.go index 23f099e08c2..4339a4b3c2a 100644 --- a/osmoutils/compare_test.go +++ b/osmoutils/compare_test.go @@ -2,7 +2,6 @@ package osmoutils_test import ( "reflect" - "sort" "testing" "github.com/stretchr/testify/assert" @@ -49,48 +48,82 @@ func TestDisjointArrays(t *testing.T) { want []uint64 }{ { - name: "Both arrays contain unique elements, sorted", + name: "Both arrays contain some unique elements, both sorted", a: []uint64{1, 2, 3, 4, 5}, b: []uint64{4, 5, 6, 7, 8}, want: []uint64{1, 2, 3, 6, 7, 8}, }, { - name: "Only array 'a' contains unique elements, sorted", + name: "Only array 'a' contains some unique elements, both sorted", a: []uint64{10, 20, 30, 40}, b: []uint64{20, 30}, want: []uint64{10, 40}, }, { - name: "Only array 'b' contains unique elements, sorted", + name: "Only array 'b' contains some unique elements, both sorted", a: []uint64{20, 30}, b: []uint64{10, 20, 30, 40}, want: []uint64{10, 40}, }, { - name: "Both arrays contain unique elements, unsorted", + name: "Both arrays contain some unique elements, both unsorted", a: []uint64{5, 4, 3, 2, 1}, b: []uint64{8, 7, 6, 5, 4}, want: []uint64{1, 2, 3, 6, 7, 8}, }, { - name: "Only array 'a' contains unique elements, unsorted", + name: "Both arrays contain some unique elements, a sorted, b unsorted", + a: []uint64{5, 4, 3, 2, 1}, + b: []uint64{6, 7, 8, 5, 4}, + want: []uint64{1, 2, 3, 6, 7, 8}, + }, + { + name: "Only array 'a' contains some unique elements, both unsorted", a: []uint64{40, 30, 20, 10}, b: []uint64{30, 20}, want: []uint64{10, 40}, }, { - name: "Only array 'b' contains unique elements, unsorted", + name: "Only array 'b' contains some unique elements, both unsorted", a: []uint64{30, 20}, b: []uint64{40, 30, 20, 10}, want: []uint64{10, 40}, }, + { + name: "Both arrays empty", + a: []uint64{}, + b: []uint64{}, + want: []uint64{}, + }, + { + name: "Array 'a' empty, unsorted", + a: []uint64{}, + b: []uint64{2, 1, 3}, + want: []uint64{1, 2, 3}, + }, + { + name: "Array 'b' empty, unsorted", + a: []uint64{2, 1, 3}, + b: []uint64{}, + want: []uint64{1, 2, 3}, + }, + { + name: "Both arrays contain completely different elements, both unsorted", + a: []uint64{2, 1, 3}, + b: []uint64{5, 4, 6}, + want: []uint64{1, 2, 3, 4, 5, 6}, + }, + { + name: "Both arrays equal, both unsorted", + a: []uint64{2, 1, 3}, + b: []uint64{2, 1, 3}, + want: []uint64{}, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got := osmoutils.DisjointArrays(tt.a, tt.b) - sort.Slice(got, func(i, j int) bool { return got[i] < got[j] }) - sort.Slice(tt.want, func(i, j int) bool { return tt.want[i] < tt.want[j] }) if !reflect.DeepEqual(got, tt.want) { t.Errorf("DifferenceBetweenUint64Arrays() = %v, want %v", got, tt.want) From 0254345894f4c885d7ab09f78b90b1978a4289db Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sun, 8 Oct 2023 14:55:50 -0600 Subject: [PATCH 23/34] unrelated lint --- osmoutils/osmocli/cli_tester.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osmoutils/osmocli/cli_tester.go b/osmoutils/osmocli/cli_tester.go index 4ef6aaf9bdb..285fbf88b7a 100644 --- a/osmoutils/osmocli/cli_tester.go +++ b/osmoutils/osmocli/cli_tester.go @@ -27,6 +27,7 @@ type QueryCliTestCase[Q proto.Message] struct { } func RunTxTestCases[M sdk.Msg](t *testing.T, desc *TxCliDesc, testcases map[string]TxCliTestCase[M]) { + t.Helper() for name, tc := range testcases { t.Run(name, func(t *testing.T) { RunTxTestCase(t, desc, &tc) @@ -35,6 +36,7 @@ func RunTxTestCases[M sdk.Msg](t *testing.T, desc *TxCliDesc, testcases map[stri } func RunQueryTestCases[Q proto.Message](t *testing.T, desc *QueryDescriptor, testcases map[string]QueryCliTestCase[Q]) { + t.Helper() for name, tc := range testcases { t.Run(name, func(t *testing.T) { RunQueryTestCase(t, desc, &tc) @@ -43,6 +45,7 @@ func RunQueryTestCases[Q proto.Message](t *testing.T, desc *QueryDescriptor, tes } func RunTxTestCase[M sdk.Msg](t *testing.T, desc *TxCliDesc, tc *TxCliTestCase[M]) { + t.Helper() cmd := BuildTxCli[M](desc) err := resetCommandFlagValues(cmd) require.NoError(t, err, "error in resetCommandFlagValues") @@ -66,6 +69,7 @@ func RunTxTestCase[M sdk.Msg](t *testing.T, desc *TxCliDesc, tc *TxCliTestCase[M } func RunQueryTestCase[Q proto.Message](t *testing.T, desc *QueryDescriptor, tc *QueryCliTestCase[Q]) { + t.Helper() cmd := BuildQueryCli[Q, int](desc, nil) err := resetCommandFlagValues(cmd) require.NoError(t, err, "error in resetCommandFlagValues") @@ -85,6 +89,7 @@ func RunQueryTestCase[Q proto.Message](t *testing.T, desc *QueryDescriptor, tc * // This logic is copied from the SDK, it should've just been publicly exposed. // But instead its buried within a mega-method. func newClientContextWithFrom(t *testing.T, fs *pflag.FlagSet) client.Context { + t.Helper() clientCtx := client.Context{} from, _ := fs.GetString(flags.FlagFrom) fromAddr, fromName, _, err := client.GetFromFields(nil, from, true) From b17bd2c9131aef6d05409c563cd2a900bf5644b3 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sun, 8 Oct 2023 15:16:58 -0600 Subject: [PATCH 24/34] add testing invariants comment to TestTransferPositions --- x/concentrated-liquidity/position_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/x/concentrated-liquidity/position_test.go b/x/concentrated-liquidity/position_test.go index ce70e38c907..c856530a9f1 100644 --- a/x/concentrated-liquidity/position_test.go +++ b/x/concentrated-liquidity/position_test.go @@ -2247,6 +2247,18 @@ func (s *KeeperTestSuite) TestNegativeTickRange_SpreadFactor() { s.clk.InitGenesis(s.Ctx, *export) } +// TestTransferPositions validates the following: +// - Positions can be transferred from one owner to another. +// - The transfer of positions does not modify the positions that are not transferred. +// - The outstanding incentives and spread rewards go to the old owner after the transfer. +// - The new owner does not receive the outstanding incentives and spread rewards after the transfer. +// - Claiming incentives/spread rewards with the new owner returns nothing after the transfer. +// - Adding incentives/spread rewards and then claiming returns it to the new owner, and the old owner does not get anything. +// - The new owner can withdraw the positions and receive the correct amount of funds. +// The test also checks for expected errors such as: +// - Attempting to transfer a position ID that does not exist. +// - Attempting to transfer a position that the sender does not own. +// - Attempting to transfer the last position in the pool. func (s *KeeperTestSuite) TestTransferPositions() { // expectedUptimes are used for claimable incentives tests expectedUptimes := getExpectedUptimes() From c96b5053c286f34080cbc3746c55a6d24eaedd09 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sun, 8 Oct 2023 15:19:58 -0600 Subject: [PATCH 25/34] add why actual amount should be less than expected --- x/concentrated-liquidity/position_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/concentrated-liquidity/position_test.go b/x/concentrated-liquidity/position_test.go index c856530a9f1..1c268a55c77 100644 --- a/x/concentrated-liquidity/position_test.go +++ b/x/concentrated-liquidity/position_test.go @@ -2265,7 +2265,8 @@ func (s *KeeperTestSuite) TestTransferPositions() { errTolerance := osmomath.ErrTolerance{ AdditiveTolerance: osmomath.NewDec(1), - // Actual should be less than expected, so we round down + // Actual amount should be less than expected, so we round down + // This is because when we withdraw the position, we always round in favor of the pool RoundingDir: osmomath.RoundDown, } From c9ecd14aa42ff00ba36e395e8808098f30dd2603 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 8 Oct 2023 21:37:04 +0000 Subject: [PATCH 26/34] Auto: update go.mod after push to adam/transfer-position-cl that modified dependencies locally --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- x/epochs/go.mod | 2 +- x/epochs/go.sum | 4 ++-- x/ibc-hooks/go.mod | 2 +- x/ibc-hooks/go.sum | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index a923e37b494..369e9386012 100644 --- a/go.mod +++ b/go.mod @@ -22,10 +22,10 @@ require ( github.com/mattn/go-sqlite3 v1.14.17 github.com/ory/dockertest/v3 v3.10.0 github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 - github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003223742-febb5d40fc1d - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d - github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231003223742-febb5d40fc1d - github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231003223742-febb5d40fc1d + github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231008211958-c96b5053c286 + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231008211958-c96b5053c286 + github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231008211958-c96b5053c286 + github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231008211958-c96b5053c286 github.com/pkg/errors v0.9.1 github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.5.1 diff --git a/go.sum b/go.sum index 34c2772fec4..8e989a0644e 100644 --- a/go.sum +++ b/go.sum @@ -959,14 +959,14 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= 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.7-0.20231003223742-febb5d40fc1d h1:YU32IlPwa1CsnXXxJKnX9e0n4p8MC6txKp5RsyhC0Ec= -github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003223742-febb5d40fc1d/go.mod h1:YEMUPuI9gBUATC4tp2MiW0oWRlShli0K95JqgNKJh9c= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d h1:eQK6rkHA6bkP7Hq9huFtx8Fz/attOyKN7++ITam0p7U= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= -github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231003223742-febb5d40fc1d h1:2xfs4Pfzcp0qSRihbja0unfLPfHxueDmaQSplZz4FCM= -github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231003223742-febb5d40fc1d/go.mod h1:h2bGT8MCtEYdWk1Qg530P2quh29jVGefDsT94vSJ0ck= -github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231003223742-febb5d40fc1d h1:9uCwV3qXRjchR6Yzshmgrh0+6f7wrcUhWbz/C/i2WYM= -github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231003223742-febb5d40fc1d/go.mod h1:nEvp/Hj2TChJuKBokDyDy7dkvDufu0JAKdpJCUe1EZ0= +github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231008211958-c96b5053c286 h1:pflVReT+iZwedfdwPx+z+MKfEGV40y7OiP/fmRtzKOU= +github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231008211958-c96b5053c286/go.mod h1:YEMUPuI9gBUATC4tp2MiW0oWRlShli0K95JqgNKJh9c= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231008211958-c96b5053c286 h1:ObizQgnIo8UEFFRu8or/6BWMm11JBCxXE+WDswo95+Q= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231008211958-c96b5053c286/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= +github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231008211958-c96b5053c286 h1:DLqme6gWzncIRdjmNFlDbDbIDEWHVrDtOPe/5Mbffos= +github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231008211958-c96b5053c286/go.mod h1:YuONuSN36R2dmfIOFA6EAA9KQN6ZenRgxnStI4xYYOw= +github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231008211958-c96b5053c286 h1:Ypdc8EfT9L49JmrcyuxsKSP/57LtU2XICKyfy+c+81U= +github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20231008211958-c96b5053c286/go.mod h1:RJC3mEmkrSc9ffEMlzIxiOVCvvzyEjfrxuEMMoG/BQY= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16 h1:X747cZYdnqc/+RV48iPVeGprpVb/fUWSaKGsZUWrdbg= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16/go.mod h1:Rf8zW/GgBQyFRRB4s62VQHWA6sTlMFSjoDQQpoq64iI= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= diff --git a/x/epochs/go.mod b/x/epochs/go.mod index df95baeabdb..143590100d0 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -8,7 +8,7 @@ require ( github.com/golang/protobuf v1.5.3 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231008211958-c96b5053c286 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 github.com/tendermint/tendermint v0.37.0-rc1 diff --git a/x/epochs/go.sum b/x/epochs/go.sum index 977c14b895d..bd739c63347 100644 --- a/x/epochs/go.sum +++ b/x/epochs/go.sum @@ -721,8 +721,8 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= github.com/osmosis-labs/osmosis/osmomath v0.0.6 h1:WNkVmeeudAqRFk5a4CChWsdxfiY/XLClT1i845L78ss= github.com/osmosis-labs/osmosis/osmomath v0.0.6/go.mod h1:UlftwozB+QObT3o0YfkuuyL9fsVdgoWt0dm6J7MLYnU= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d h1:eQK6rkHA6bkP7Hq9huFtx8Fz/attOyKN7++ITam0p7U= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231008211958-c96b5053c286 h1:ObizQgnIo8UEFFRu8or/6BWMm11JBCxXE+WDswo95+Q= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231008211958-c96b5053c286/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= github.com/osmosis-labs/osmosis/v19 v19.0.0 h1:gqcas/XfxtEuZXsWGTO9vNMHiY78Qs09FBQw73djIVM= github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= diff --git a/x/ibc-hooks/go.mod b/x/ibc-hooks/go.mod index 921e28b1b15..58af31967e5 100644 --- a/x/ibc-hooks/go.mod +++ b/x/ibc-hooks/go.mod @@ -12,7 +12,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/osmosis-labs/osmosis/osmomath v0.0.6 - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231008211958-c96b5053c286 github.com/spf13/cobra v1.7.0 github.com/tendermint/tendermint v0.37.0-rc1 google.golang.org/grpc v1.57.0 diff --git a/x/ibc-hooks/go.sum b/x/ibc-hooks/go.sum index 72944249149..225135dfa95 100644 --- a/x/ibc-hooks/go.sum +++ b/x/ibc-hooks/go.sum @@ -710,7 +710,7 @@ github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5 github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -733,8 +733,8 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= github.com/osmosis-labs/osmosis/osmomath v0.0.6 h1:WNkVmeeudAqRFk5a4CChWsdxfiY/XLClT1i845L78ss= github.com/osmosis-labs/osmosis/osmomath v0.0.6/go.mod h1:UlftwozB+QObT3o0YfkuuyL9fsVdgoWt0dm6J7MLYnU= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d h1:eQK6rkHA6bkP7Hq9huFtx8Fz/attOyKN7++ITam0p7U= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231003223742-febb5d40fc1d/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231008211958-c96b5053c286 h1:ObizQgnIo8UEFFRu8or/6BWMm11JBCxXE+WDswo95+Q= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231008211958-c96b5053c286/go.mod h1:Zmyx5zMUBN2KV94booSFn2v8KQcUKeCHqyWpKZ4PRMo= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16 h1:X747cZYdnqc/+RV48iPVeGprpVb/fUWSaKGsZUWrdbg= github.com/osmosis-labs/wasmd v0.31.0-osmo-v16/go.mod h1:Rf8zW/GgBQyFRRB4s62VQHWA6sTlMFSjoDQQpoq64iI= github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE= From bb9706c6203882295253d18e6fcb6e2aca491210 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sun, 8 Oct 2023 16:07:44 -0600 Subject: [PATCH 27/34] regen docs --- client/docs/static/openapi/index.html | 16 +- client/docs/static/openapi/openapi.yaml | 2197 +++++++++++++++++---- client/docs/static/swagger/swagger.yaml | 2368 +++++++++++++++++++---- client/docs/statik/statik.go | 2 +- 4 files changed, 3799 insertions(+), 784 deletions(-) diff --git a/client/docs/static/openapi/index.html b/client/docs/static/openapi/index.html index 997dc5b8e74..5c4ab2f96d5 100644 --- a/client/docs/static/openapi/index.html +++ b/client/docs/static/openapi/index.html @@ -472,7 +472,7 @@ parameters