diff --git a/CHANGELOG.md b/CHANGELOG.md index a22d96d2914..771185234da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,7 +71,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#5187](https://github.com/osmosis-labs/osmosis/pull/5187) Expand `IncentivizedPools` query to include internally incentivized CL pools. * [#5239](https://github.com/osmosis-labs/osmosis/pull/5239) Implement `GetTotalPoolShares` public keeper function for GAMM. * [#5261](https://github.com/osmosis-labs/osmosis/pull/5261) Allows `UpdateFeeTokenProposal` to take in multiple fee tokens instead of just one. - + * [#5265](https://github.com/osmosis-labs/osmosis/pull/5265) Ensure a lock cannot point to multiple synthetic locks. Deprecates `SyntheticLockupsByLockupID` in favor of `SyntheticLockupByLockupID`. + ### API breaks * [#4336](https://github.com/osmosis-labs/osmosis/pull/4336) Move epochs module into its own go.mod diff --git a/proto/osmosis/lockup/query.proto b/proto/osmosis/lockup/query.proto index e48433e8a97..7ab93331194 100644 --- a/proto/osmosis/lockup/query.proto +++ b/proto/osmosis/lockup/query.proto @@ -88,13 +88,22 @@ service Query { option (google.api.http).get = "/osmosis/lockup/v1beta1/next_lock_id"; } - // Returns synthetic lockups by native lockup id + // Returns synthetic lockup by native lockup id + // Deprecated: use SyntheticLockupByLockupID instead rpc SyntheticLockupsByLockupID(SyntheticLockupsByLockupIDRequest) returns (SyntheticLockupsByLockupIDResponse) { + option deprecated = true; option (google.api.http).get = "/osmosis/lockup/v1beta1/synthetic_lockups_by_lock_id/{lock_id}"; } + // Returns synthetic lockup by native lockup id + rpc SyntheticLockupByLockupID(SyntheticLockupByLockupIDRequest) + returns (SyntheticLockupByLockupIDResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/synthetic_lockup_by_lock_id/{lock_id}"; + } + // Returns account locked records with longer duration rpc AccountLockedLongerDuration(AccountLockedLongerDurationRequest) returns (AccountLockedLongerDurationResponse) { @@ -247,11 +256,20 @@ message LockedResponse { PeriodLock lock = 1; }; message NextLockIDRequest {}; message NextLockIDResponse { uint64 lock_id = 1; }; -message SyntheticLockupsByLockupIDRequest { uint64 lock_id = 1; } +message SyntheticLockupsByLockupIDRequest { + option deprecated = true; + uint64 lock_id = 1; +} message SyntheticLockupsByLockupIDResponse { + option deprecated = true; repeated SyntheticLock synthetic_locks = 1 [ (gogoproto.nullable) = false ]; } +message SyntheticLockupByLockupIDRequest { uint64 lock_id = 1; } +message SyntheticLockupByLockupIDResponse { + SyntheticLock synthetic_lock = 1 [ (gogoproto.nullable) = false ]; +} + message AccountLockedLongerDurationRequest { string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; google.protobuf.Duration duration = 2 [ diff --git a/x/lockup/client/cli/query.go b/x/lockup/client/cli/query.go index 8041c88ef09..715074b1352 100644 --- a/x/lockup/client/cli/query.go +++ b/x/lockup/client/cli/query.go @@ -43,6 +43,7 @@ func GetQueryCmd() *cobra.Command { GetCmdAccountLockedLongerDurationDenom(), GetCmdOutputLocksJson(), GetCmdSyntheticLockupsByLockupID(), + GetCmdSyntheticLockupByLockupID(), GetCmdAccountLockedDuration(), GetCmdNextLockID(), osmocli.GetParams[*types.QueryParamsRequest]( @@ -200,10 +201,19 @@ func GetCmdNextLockID() *cobra.Command { } // GetCmdSyntheticLockupsByLockupID returns synthetic lockups by lockup id. +// nolint: staticcheck func GetCmdSyntheticLockupsByLockupID() *cobra.Command { return osmocli.SimpleQueryCmd[*types.SyntheticLockupsByLockupIDRequest]( "synthetic-lockups-by-lock-id ", - "Query synthetic lockups by lockup id", + "Query synthetic lockups by lockup id (is deprecated for synthetic-lockup-by-lock-id)", + `{{.Short}}`, types.ModuleName, types.NewQueryClient) +} + +// GetCmdSyntheticLockupByLockupID returns synthetic lockup by lockup id. +func GetCmdSyntheticLockupByLockupID() *cobra.Command { + return osmocli.SimpleQueryCmd[*types.SyntheticLockupByLockupIDRequest]( + "synthetic-lockup-by-lock-id ", + "Query synthetic lock by underlying lockup id", `{{.Short}}`, types.ModuleName, types.NewQueryClient) } diff --git a/x/lockup/keeper/grpc_query.go b/x/lockup/keeper/grpc_query.go index f51d8ca952a..c28ed459818 100644 --- a/x/lockup/keeper/grpc_query.go +++ b/x/lockup/keeper/grpc_query.go @@ -178,14 +178,33 @@ func (q Querier) NextLockID(goCtx context.Context, req *types.NextLockIDRequest) } // SyntheticLockupsByLockupID returns synthetic lockups by native lockup id. +// Deprecated: use SyntheticLockupByLockupID instead. +// nolint: staticcheck func (q Querier) SyntheticLockupsByLockupID(goCtx context.Context, req *types.SyntheticLockupsByLockupIDRequest) (*types.SyntheticLockupsByLockupIDResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } ctx := sdk.UnwrapSDKContext(goCtx) - synthLocks := q.Keeper.GetAllSyntheticLockupsByLockup(ctx, req.LockId) - return &types.SyntheticLockupsByLockupIDResponse{SyntheticLocks: synthLocks}, nil + synthLock, err := q.Keeper.GetSyntheticLockupByUnderlyingLockId(ctx, req.LockId) + if err != nil { + return nil, err + } + return &types.SyntheticLockupsByLockupIDResponse{SyntheticLocks: []types.SyntheticLock{synthLock}}, nil +} + +// SyntheticLockupByLockupID returns synthetic lockup by native lockup id. +func (q Querier) SyntheticLockupByLockupID(goCtx context.Context, req *types.SyntheticLockupByLockupIDRequest) (*types.SyntheticLockupByLockupIDResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + synthLock, err := q.Keeper.GetSyntheticLockupByUnderlyingLockId(ctx, req.LockId) + if err != nil { + return nil, err + } + return &types.SyntheticLockupByLockupIDResponse{SyntheticLock: synthLock}, nil } // AccountLockedLongerDuration returns locks of an account with duration longer than specified. diff --git a/x/lockup/keeper/lock.go b/x/lockup/keeper/lock.go index 16ec390dcba..885ab53e38f 100644 --- a/x/lockup/keeper/lock.go +++ b/x/lockup/keeper/lock.go @@ -105,9 +105,11 @@ func (k Keeper) AddTokensToLockByID(ctx sdk.Context, lockID uint64, owner sdk.Ac return nil, err } - for _, synthlock := range k.GetAllSyntheticLockupsByLockup(ctx, lock.ID) { - k.accumulationStore(ctx, synthlock.SynthDenom).Increase(accumulationKey(synthlock.Duration), tokensToAdd.Amount) + synthlock, err := k.GetSyntheticLockupByUnderlyingLockId(ctx, lock.ID) + if err != nil { + return nil, err } + k.accumulationStore(ctx, synthlock.SynthDenom).Increase(accumulationKey(synthlock.Duration), tokensToAdd.Amount) if k.hooks == nil { return lock, nil @@ -375,15 +377,20 @@ func (k Keeper) PartialForceUnlock(ctx sdk.Context, lock types.PeriodLock, coins // ForceUnlock ignores unlock duration and immediately unlocks the lock and refunds tokens to lock owner. func (k Keeper) ForceUnlock(ctx sdk.Context, lock types.PeriodLock) error { // Steps: - // 1) Break associated synthetic locks. (Superfluid data) + // 1) Break associated synthetic lock. (Superfluid data) // 2) If lock is bonded, move it to unlocking // 3) Run logic to delete unlocking metadata, and send tokens to owner. - synthLocks := k.GetAllSyntheticLockupsByLockup(ctx, lock.ID) - err := k.DeleteAllSyntheticLocks(ctx, lock, synthLocks) + synthLock, err := k.GetSyntheticLockupByUnderlyingLockId(ctx, lock.ID) if err != nil { return err } + if !synthLock.IsNil() { + err = k.DeleteSyntheticLockup(ctx, lock.ID, synthLock.SynthDenom) + if err != nil { + return err + } + } if !lock.IsUnlocking() { _, err := k.BeginUnlock(ctx, lock.ID, nil) @@ -727,13 +734,14 @@ func (k Keeper) removeTokensFromLock(ctx sdk.Context, lock *types.PeriodLock, co } // increase synthetic lockup's accumulation store - synthLocks := k.GetAllSyntheticLockupsByLockup(ctx, lock.ID) + synthLock, err := k.GetSyntheticLockupByUnderlyingLockId(ctx, lock.ID) + if err != nil { + return err + } // Note: since synthetic lockup deletion is using native lockup's coins to reduce accumulation store // all the synthetic lockups' accumulation should be decreased - for _, synthlock := range synthLocks { - k.accumulationStore(ctx, synthlock.SynthDenom).Decrease(accumulationKey(synthlock.Duration), coins[0].Amount) - } + k.accumulationStore(ctx, synthLock.SynthDenom).Decrease(accumulationKey(synthLock.Duration), coins[0].Amount) return nil } diff --git a/x/lockup/keeper/lock_test.go b/x/lockup/keeper/lock_test.go index c1433f60211..15f10c958ad 100644 --- a/x/lockup/keeper/lock_test.go +++ b/x/lockup/keeper/lock_test.go @@ -8,6 +8,7 @@ import ( cl "github.com/osmosis-labs/osmosis/v15/x/concentrated-liquidity" cltypes "github.com/osmosis-labs/osmosis/v15/x/concentrated-liquidity/types" "github.com/osmosis-labs/osmosis/v15/x/lockup/types" + lockuptypes "github.com/osmosis-labs/osmosis/v15/x/lockup/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -852,11 +853,12 @@ func (s *KeeperTestSuite) AddTokensToLockForSynth() { for i, synthlock := range s.App.LockupKeeper.GetAllSyntheticLockups(s.Ctx) { s.Require().Equal(synthlock, synthlocks[i]) } - // by GetAllSyntheticLockupsByLockup + // by GetSyntheticLockupByUnderlyingLockId for i := uint64(1); i <= 3; i++ { - for j, synthlockByLockup := range s.App.LockupKeeper.GetAllSyntheticLockupsByLockup(s.Ctx, i) { - s.Require().Equal(synthlockByLockup, synthlocks[(int(i)-1)*3+j]) - } + synthlockByLockup, err := s.App.LockupKeeper.GetSyntheticLockupByUnderlyingLockId(s.Ctx, i) + s.Require().NoError(err) + s.Require().Equal(synthlockByLockup, synthlocks[(int(i)-1)*3+int(i)]) + } // by GetAllSyntheticLockupsByAddr for i, synthlock := range s.App.LockupKeeper.GetAllSyntheticLockupsByAddr(s.Ctx, addr1) { @@ -1313,9 +1315,10 @@ func (s *KeeperTestSuite) TestForceUnlock() { s.Require().Equal(balances, coinsToLock) // if it was superfluid delegated lock, - // confirm that we don't have associated synth locks - synthLocks := s.App.LockupKeeper.GetAllSyntheticLockupsByLockup(s.Ctx, lock.ID) - s.Require().Equal(0, len(synthLocks)) + // confirm that we don't have associated synth lock + synthLock, err := s.App.LockupKeeper.GetSyntheticLockupByUnderlyingLockId(s.Ctx, lock.ID) + s.Require().NoError(err) + s.Require().Equal((lockuptypes.SyntheticLock{}), synthLock) // check if lock is deleted by checking trying to get lock ID _, err = s.App.LockupKeeper.GetLockByID(s.Ctx, lock.ID) diff --git a/x/lockup/keeper/msg_server.go b/x/lockup/keeper/msg_server.go index 35755b464d6..160acf0037a 100644 --- a/x/lockup/keeper/msg_server.go +++ b/x/lockup/keeper/msg_server.go @@ -208,8 +208,11 @@ func (server msgServer) ForceUnlock(goCtx context.Context, msg *types.MsgForceUn } // check that given lock is not superfluid staked - synthLocks := server.keeper.GetAllSyntheticLockupsByLockup(ctx, lock.ID) - if len(synthLocks) > 0 { + synthLock, err := server.keeper.GetSyntheticLockupByUnderlyingLockId(ctx, lock.ID) + if err != nil { + return &types.MsgForceUnlockResponse{Success: false}, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + } + if !synthLock.IsNil() { return &types.MsgForceUnlockResponse{Success: false}, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "superfluid delegation exists for lock") } diff --git a/x/lockup/keeper/synthetic_lock.go b/x/lockup/keeper/synthetic_lock.go index 5fb79401c55..7a7a51fc257 100644 --- a/x/lockup/keeper/synthetic_lock.go +++ b/x/lockup/keeper/synthetic_lock.go @@ -36,8 +36,10 @@ func (k Keeper) GetSyntheticLockup(ctx sdk.Context, lockID uint64, synthdenom st return &synthLock, err } -// GetAllSyntheticLockupsByLockup gets all the synthetic lockup object of the original lockup. -func (k Keeper) GetAllSyntheticLockupsByLockup(ctx sdk.Context, lockID uint64) []types.SyntheticLock { +// Error is returned if: +// - there are more than one synthetic lockup objects with the same underlying lock ID. +// - there is no synthetic lockup object with the given underlying lock ID. +func (k Keeper) GetSyntheticLockupByUnderlyingLockId(ctx sdk.Context, lockID uint64) (types.SyntheticLock, error) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, combineKeys(types.KeyPrefixSyntheticLockup, sdk.Uint64ToBigEndian(lockID))) defer iterator.Close() @@ -47,11 +49,17 @@ func (k Keeper) GetAllSyntheticLockupsByLockup(ctx sdk.Context, lockID uint64) [ synthLock := types.SyntheticLock{} err := proto.Unmarshal(iterator.Value(), &synthLock) if err != nil { - panic(err) + return types.SyntheticLock{}, err } synthLocks = append(synthLocks, synthLock) } - return synthLocks + if len(synthLocks) > 1 { + return types.SyntheticLock{}, fmt.Errorf("synthetic lockup with same lock id should not exist") + } + if len(synthLocks) == 0 { + return types.SyntheticLock{}, nil + } + return synthLocks[0], nil } // GetAllSyntheticLockupsByAddr gets all the synthetic lockups from all the locks owned by the given address. @@ -59,7 +67,11 @@ func (k Keeper) GetAllSyntheticLockupsByAddr(ctx sdk.Context, owner sdk.AccAddre synthLocks := []types.SyntheticLock{} locks := k.GetAccountPeriodLocks(ctx, owner) for _, lock := range locks { - synthLocks = append(synthLocks, k.GetAllSyntheticLockupsByLockup(ctx, lock.ID)...) + synthLock, err := k.GetSyntheticLockupByUnderlyingLockId(ctx, lock.ID) + if err != nil { + panic(err) + } + synthLocks = append(synthLocks, synthLock) } return synthLocks } @@ -96,8 +108,11 @@ func (k Keeper) CreateSyntheticLockup(ctx sdk.Context, lockID uint64, synthDenom // There is no relationship between unbonding and bonding synthetic lockup, it's managed separately // A separate accumulation store is incremented with the synth denom. - _, err := k.GetSyntheticLockup(ctx, lockID, synthDenom) - if err == nil { + synthLock, err := k.GetSyntheticLockupByUnderlyingLockId(ctx, lockID) + if err != nil { + return err + } + if !synthLock.IsNil() { return types.ErrSyntheticLockupAlreadyExists } @@ -115,7 +130,7 @@ func (k Keeper) CreateSyntheticLockup(ctx sdk.Context, lockID uint64, synthDenom } // set synthetic lockup object - synthLock := types.SyntheticLock{ + synthLock = types.SyntheticLock{ UnderlyingLockId: lockID, SynthDenom: synthDenom, EndTime: endTime, @@ -141,21 +156,6 @@ func (k Keeper) CreateSyntheticLockup(ctx sdk.Context, lockID uint64, synthDenom return nil } -// DeleteAllSyntheticLocks iterates over given array of synthetic locks and deletes all individual synthetic locks. -func (k Keeper) DeleteAllSyntheticLocks(ctx sdk.Context, lock types.PeriodLock, synthLocks []types.SyntheticLock) error { - if len(synthLocks) == 0 { - return nil - } - - for _, synthLock := range synthLocks { - err := k.DeleteSyntheticLockup(ctx, lock.ID, synthLock.SynthDenom) - if err != nil { - return err - } - } - return nil -} - // DeleteSyntheticLockup delete synthetic lockup with lock id and synthdenom. // Synthetic lock has three relevant state entries. // - synthetic lock object itself diff --git a/x/lockup/keeper/synthetic_lock_test.go b/x/lockup/keeper/synthetic_lock_test.go index 92781c184b6..9cc16207b8c 100644 --- a/x/lockup/keeper/synthetic_lock_test.go +++ b/x/lockup/keeper/synthetic_lock_test.go @@ -4,23 +4,29 @@ import ( "time" "github.com/osmosis-labs/osmosis/v15/x/lockup/types" + lockuptypes "github.com/osmosis-labs/osmosis/v15/x/lockup/types" sdk "github.com/cosmos/cosmos-sdk/types" ) func (s *KeeperTestSuite) TestSyntheticLockupCreation() { s.SetupTest() + numLocks := 3 // lock coins addr1 := sdk.AccAddress([]byte("addr1---------------")) coins := sdk.Coins{sdk.NewInt64Coin("stake", 10)} - s.LockTokens(addr1, coins, time.Second) + for i := 0; i < numLocks; i++ { + s.LockTokens(addr1, coins, time.Second) + } // check locks locks, err := s.App.LockupKeeper.GetPeriodLocks(s.Ctx) s.Require().NoError(err) - s.Require().Len(locks, 1) - s.Require().Equal(locks[0].Coins, coins) + s.Require().Len(locks, numLocks) + for i := 0; i < numLocks; i++ { + s.Require().Equal(locks[i].Coins, coins) + } // create not unbonding synthetic lockup err = s.App.LockupKeeper.CreateSyntheticLockup(s.Ctx, 1, "suffix1", time.Second, false) @@ -30,12 +36,16 @@ func (s *KeeperTestSuite) TestSyntheticLockupCreation() { err = s.App.LockupKeeper.CreateSyntheticLockup(s.Ctx, 1, "suffix1", time.Second, true) s.Require().Error(err) - // create unbonding synthetic lockup + // create unbonding synthetic lockup, lock already has a synthetic lock associated with it so it should fail err = s.App.LockupKeeper.CreateSyntheticLockup(s.Ctx, 1, "suffix2", time.Second, true) + s.Require().Error(err) + + // create unbonding synthetic lockup with new lock id, should succeed + err = s.App.LockupKeeper.CreateSyntheticLockup(s.Ctx, 2, "suffix2", time.Second, true) s.Require().NoError(err) // try creating unbonding synthetic lockup that is long than native lockup unbonding duration - err = s.App.LockupKeeper.CreateSyntheticLockup(s.Ctx, 1, "suffix3", time.Second*2, true) + err = s.App.LockupKeeper.CreateSyntheticLockup(s.Ctx, 3, "suffix3", time.Second*2, true) s.Require().Error(err) } @@ -127,12 +137,13 @@ func (s *KeeperTestSuite) TestSyntheticLockupCreateGetDeleteAccumulation() { Duration: time.Second, }) - expectedSynthLocks := []types.SyntheticLock{*synthLock} - synthLocks := s.App.LockupKeeper.GetAllSyntheticLockupsByLockup(s.Ctx, 1) - s.Require().Equal(synthLocks, expectedSynthLocks) + expectedSynthLock := *synthLock + actualSynthLock, err := s.App.LockupKeeper.GetSyntheticLockupByUnderlyingLockId(s.Ctx, 1) + s.Require().NoError(err) + s.Require().Equal(expectedSynthLock, actualSynthLock) - synthLocks = s.App.LockupKeeper.GetAllSyntheticLockups(s.Ctx) - s.Require().Equal(synthLocks, expectedSynthLocks) + allSynthLocks := s.App.LockupKeeper.GetAllSyntheticLockups(s.Ctx) + s.Require().Equal([]lockuptypes.SyntheticLock{expectedSynthLock}, allSynthLocks) // check accumulation store is correctly updated for synthetic lockup accum = s.App.LockupKeeper.GetPeriodLocksAccumulation(s.Ctx, types.QueryCondition{ @@ -211,22 +222,27 @@ func (s *KeeperTestSuite) TestSyntheticLockupCreateGetDeleteAccumulation() { func (s *KeeperTestSuite) TestSyntheticLockupDeleteAllMaturedSyntheticLocks() { s.SetupTest() + numLocks := 2 // lock coins addr1 := sdk.AccAddress([]byte("addr1---------------")) coins := sdk.Coins{sdk.NewInt64Coin("stake", 10)} - s.LockTokens(addr1, coins, time.Second) + for i := 0; i < numLocks; i++ { + s.LockTokens(addr1, coins, time.Second) + } // check locks locks, err := s.App.LockupKeeper.GetPeriodLocks(s.Ctx) s.Require().NoError(err) - s.Require().Len(locks, 1) - s.Require().Equal(locks[0].Coins, coins) + s.Require().Len(locks, numLocks) + for i := 0; i < numLocks; i++ { + s.Require().Equal(locks[i].Coins, coins) + } err = s.App.LockupKeeper.CreateSyntheticLockup(s.Ctx, 1, "synthstakestakedtovalidator1", time.Second, false) s.Require().NoError(err) - err = s.App.LockupKeeper.CreateSyntheticLockup(s.Ctx, 1, "synthstakestakedtovalidator2", time.Second, true) + err = s.App.LockupKeeper.CreateSyntheticLockup(s.Ctx, 2, "synthstakestakedtovalidator2", time.Second, true) s.Require().NoError(err) synthLock, err := s.App.LockupKeeper.GetSyntheticLockup(s.Ctx, 1, "synthstakestakedtovalidator1") @@ -237,10 +253,10 @@ func (s *KeeperTestSuite) TestSyntheticLockupDeleteAllMaturedSyntheticLocks() { EndTime: time.Time{}, Duration: time.Second, }) - synthLock, err = s.App.LockupKeeper.GetSyntheticLockup(s.Ctx, 1, "synthstakestakedtovalidator2") + synthLock, err = s.App.LockupKeeper.GetSyntheticLockup(s.Ctx, 2, "synthstakestakedtovalidator2") s.Require().NoError(err) s.Require().Equal(*synthLock, types.SyntheticLock{ - UnderlyingLockId: 1, + UnderlyingLockId: 2, SynthDenom: "synthstakestakedtovalidator2", EndTime: s.Ctx.BlockTime().Add(time.Second), Duration: time.Second, @@ -250,7 +266,7 @@ func (s *KeeperTestSuite) TestSyntheticLockupDeleteAllMaturedSyntheticLocks() { _, err = s.App.LockupKeeper.GetSyntheticLockup(s.Ctx, 1, "synthstakestakedtovalidator1") s.Require().NoError(err) - _, err = s.App.LockupKeeper.GetSyntheticLockup(s.Ctx, 1, "synthstakestakedtovalidator2") + _, err = s.App.LockupKeeper.GetSyntheticLockup(s.Ctx, 2, "synthstakestakedtovalidator2") s.Require().NoError(err) s.Ctx = s.Ctx.WithBlockTime(s.Ctx.BlockTime().Add(time.Second * 2)) @@ -258,7 +274,7 @@ func (s *KeeperTestSuite) TestSyntheticLockupDeleteAllMaturedSyntheticLocks() { _, err = s.App.LockupKeeper.GetSyntheticLockup(s.Ctx, 1, "synthstakestakedtovalidator1") s.Require().NoError(err) - _, err = s.App.LockupKeeper.GetSyntheticLockup(s.Ctx, 1, "synthstakestakedtovalidator2") + _, err = s.App.LockupKeeper.GetSyntheticLockup(s.Ctx, 2, "synthstakestakedtovalidator2") s.Require().Error(err) } diff --git a/x/lockup/types/errors.go b/x/lockup/types/errors.go index ee98a1ff567..5a16cbada2e 100644 --- a/x/lockup/types/errors.go +++ b/x/lockup/types/errors.go @@ -9,7 +9,7 @@ import ( // x/lockup module sentinel errors. var ( ErrNotLockOwner = errorsmod.Register(ModuleName, 1, "msg sender is not the owner of specified lock") - ErrSyntheticLockupAlreadyExists = errorsmod.Register(ModuleName, 2, "synthetic lockup already exists for same lock and suffix") + ErrSyntheticLockupAlreadyExists = errorsmod.Register(ModuleName, 2, "synthetic lockup already exists for same lock") ErrSyntheticDurationLongerThanNative = errorsmod.Register(ModuleName, 3, "synthetic lockup duration should be shorter than native lockup duration") ErrLockupNotFound = errorsmod.Register(ModuleName, 4, "lockup not found") ) diff --git a/x/lockup/types/lock.go b/x/lockup/types/lock.go index 24cd878115c..aa53681c9be 100644 --- a/x/lockup/types/lock.go +++ b/x/lockup/types/lock.go @@ -29,6 +29,11 @@ func (p SyntheticLock) IsUnlocking() bool { return !p.EndTime.Equal(time.Time{}) } +// IsNil returns if the synthetic lock is nil. +func (p SyntheticLock) IsNil() bool { + return p == (SyntheticLock{}) +} + // OwnerAddress returns locks owner address. func (p PeriodLock) OwnerAddress() sdk.AccAddress { addr, err := sdk.AccAddressFromBech32(p.Owner) diff --git a/x/lockup/types/query.pb.go b/x/lockup/types/query.pb.go index b8312026eb5..37e4508ee70 100644 --- a/x/lockup/types/query.pb.go +++ b/x/lockup/types/query.pb.go @@ -1116,6 +1116,7 @@ func (m *NextLockIDResponse) GetLockId() uint64 { return 0 } +// Deprecated: Do not use. type SyntheticLockupsByLockupIDRequest struct { LockId uint64 `protobuf:"varint,1,opt,name=lock_id,json=lockId,proto3" json:"lock_id,omitempty"` } @@ -1160,6 +1161,7 @@ func (m *SyntheticLockupsByLockupIDRequest) GetLockId() uint64 { return 0 } +// Deprecated: Do not use. type SyntheticLockupsByLockupIDResponse struct { SyntheticLocks []SyntheticLock `protobuf:"bytes,1,rep,name=synthetic_locks,json=syntheticLocks,proto3" json:"synthetic_locks"` } @@ -1204,6 +1206,94 @@ func (m *SyntheticLockupsByLockupIDResponse) GetSyntheticLocks() []SyntheticLock return nil } +type SyntheticLockupByLockupIDRequest struct { + LockId uint64 `protobuf:"varint,1,opt,name=lock_id,json=lockId,proto3" json:"lock_id,omitempty"` +} + +func (m *SyntheticLockupByLockupIDRequest) Reset() { *m = SyntheticLockupByLockupIDRequest{} } +func (m *SyntheticLockupByLockupIDRequest) String() string { return proto.CompactTextString(m) } +func (*SyntheticLockupByLockupIDRequest) ProtoMessage() {} +func (*SyntheticLockupByLockupIDRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e906fda01cffd91a, []int{26} +} +func (m *SyntheticLockupByLockupIDRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SyntheticLockupByLockupIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SyntheticLockupByLockupIDRequest.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 *SyntheticLockupByLockupIDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SyntheticLockupByLockupIDRequest.Merge(m, src) +} +func (m *SyntheticLockupByLockupIDRequest) XXX_Size() int { + return m.Size() +} +func (m *SyntheticLockupByLockupIDRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SyntheticLockupByLockupIDRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SyntheticLockupByLockupIDRequest proto.InternalMessageInfo + +func (m *SyntheticLockupByLockupIDRequest) GetLockId() uint64 { + if m != nil { + return m.LockId + } + return 0 +} + +type SyntheticLockupByLockupIDResponse struct { + SyntheticLock SyntheticLock `protobuf:"bytes,1,opt,name=synthetic_lock,json=syntheticLock,proto3" json:"synthetic_lock"` +} + +func (m *SyntheticLockupByLockupIDResponse) Reset() { *m = SyntheticLockupByLockupIDResponse{} } +func (m *SyntheticLockupByLockupIDResponse) String() string { return proto.CompactTextString(m) } +func (*SyntheticLockupByLockupIDResponse) ProtoMessage() {} +func (*SyntheticLockupByLockupIDResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e906fda01cffd91a, []int{27} +} +func (m *SyntheticLockupByLockupIDResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SyntheticLockupByLockupIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SyntheticLockupByLockupIDResponse.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 *SyntheticLockupByLockupIDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SyntheticLockupByLockupIDResponse.Merge(m, src) +} +func (m *SyntheticLockupByLockupIDResponse) XXX_Size() int { + return m.Size() +} +func (m *SyntheticLockupByLockupIDResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SyntheticLockupByLockupIDResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SyntheticLockupByLockupIDResponse proto.InternalMessageInfo + +func (m *SyntheticLockupByLockupIDResponse) GetSyntheticLock() SyntheticLock { + if m != nil { + return m.SyntheticLock + } + return SyntheticLock{} +} + type AccountLockedLongerDurationRequest struct { Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` Duration time.Duration `protobuf:"bytes,2,opt,name=duration,proto3,stdduration" json:"duration" yaml:"duration"` @@ -1213,7 +1303,7 @@ func (m *AccountLockedLongerDurationRequest) Reset() { *m = AccountLocke func (m *AccountLockedLongerDurationRequest) String() string { return proto.CompactTextString(m) } func (*AccountLockedLongerDurationRequest) ProtoMessage() {} func (*AccountLockedLongerDurationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e906fda01cffd91a, []int{26} + return fileDescriptor_e906fda01cffd91a, []int{28} } func (m *AccountLockedLongerDurationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1264,7 +1354,7 @@ func (m *AccountLockedLongerDurationResponse) Reset() { *m = AccountLock func (m *AccountLockedLongerDurationResponse) String() string { return proto.CompactTextString(m) } func (*AccountLockedLongerDurationResponse) ProtoMessage() {} func (*AccountLockedLongerDurationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e906fda01cffd91a, []int{27} + return fileDescriptor_e906fda01cffd91a, []int{29} } func (m *AccountLockedLongerDurationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1309,7 +1399,7 @@ func (m *AccountLockedDurationRequest) Reset() { *m = AccountLockedDurat func (m *AccountLockedDurationRequest) String() string { return proto.CompactTextString(m) } func (*AccountLockedDurationRequest) ProtoMessage() {} func (*AccountLockedDurationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e906fda01cffd91a, []int{28} + return fileDescriptor_e906fda01cffd91a, []int{30} } func (m *AccountLockedDurationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1360,7 +1450,7 @@ func (m *AccountLockedDurationResponse) Reset() { *m = AccountLockedDura func (m *AccountLockedDurationResponse) String() string { return proto.CompactTextString(m) } func (*AccountLockedDurationResponse) ProtoMessage() {} func (*AccountLockedDurationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e906fda01cffd91a, []int{29} + return fileDescriptor_e906fda01cffd91a, []int{31} } func (m *AccountLockedDurationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1409,7 +1499,7 @@ func (m *AccountLockedLongerDurationNotUnlockingOnlyRequest) String() string { } func (*AccountLockedLongerDurationNotUnlockingOnlyRequest) ProtoMessage() {} func (*AccountLockedLongerDurationNotUnlockingOnlyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e906fda01cffd91a, []int{30} + return fileDescriptor_e906fda01cffd91a, []int{32} } func (m *AccountLockedLongerDurationNotUnlockingOnlyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1464,7 +1554,7 @@ func (m *AccountLockedLongerDurationNotUnlockingOnlyResponse) String() string { } func (*AccountLockedLongerDurationNotUnlockingOnlyResponse) ProtoMessage() {} func (*AccountLockedLongerDurationNotUnlockingOnlyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e906fda01cffd91a, []int{31} + return fileDescriptor_e906fda01cffd91a, []int{33} } func (m *AccountLockedLongerDurationNotUnlockingOnlyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1512,7 +1602,7 @@ func (m *AccountLockedLongerDurationDenomRequest) Reset() { func (m *AccountLockedLongerDurationDenomRequest) String() string { return proto.CompactTextString(m) } func (*AccountLockedLongerDurationDenomRequest) ProtoMessage() {} func (*AccountLockedLongerDurationDenomRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e906fda01cffd91a, []int{32} + return fileDescriptor_e906fda01cffd91a, []int{34} } func (m *AccountLockedLongerDurationDenomRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1572,7 +1662,7 @@ func (m *AccountLockedLongerDurationDenomResponse) Reset() { func (m *AccountLockedLongerDurationDenomResponse) String() string { return proto.CompactTextString(m) } func (*AccountLockedLongerDurationDenomResponse) ProtoMessage() {} func (*AccountLockedLongerDurationDenomResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e906fda01cffd91a, []int{33} + return fileDescriptor_e906fda01cffd91a, []int{35} } func (m *AccountLockedLongerDurationDenomResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1615,7 +1705,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e906fda01cffd91a, []int{34} + return fileDescriptor_e906fda01cffd91a, []int{36} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1652,7 +1742,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e906fda01cffd91a, []int{35} + return fileDescriptor_e906fda01cffd91a, []int{37} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1715,6 +1805,8 @@ func init() { proto.RegisterType((*NextLockIDResponse)(nil), "osmosis.lockup.NextLockIDResponse") proto.RegisterType((*SyntheticLockupsByLockupIDRequest)(nil), "osmosis.lockup.SyntheticLockupsByLockupIDRequest") proto.RegisterType((*SyntheticLockupsByLockupIDResponse)(nil), "osmosis.lockup.SyntheticLockupsByLockupIDResponse") + proto.RegisterType((*SyntheticLockupByLockupIDRequest)(nil), "osmosis.lockup.SyntheticLockupByLockupIDRequest") + proto.RegisterType((*SyntheticLockupByLockupIDResponse)(nil), "osmosis.lockup.SyntheticLockupByLockupIDResponse") proto.RegisterType((*AccountLockedLongerDurationRequest)(nil), "osmosis.lockup.AccountLockedLongerDurationRequest") proto.RegisterType((*AccountLockedLongerDurationResponse)(nil), "osmosis.lockup.AccountLockedLongerDurationResponse") proto.RegisterType((*AccountLockedDurationRequest)(nil), "osmosis.lockup.AccountLockedDurationRequest") @@ -1730,104 +1822,107 @@ func init() { func init() { proto.RegisterFile("osmosis/lockup/query.proto", fileDescriptor_e906fda01cffd91a) } var fileDescriptor_e906fda01cffd91a = []byte{ - // 1541 bytes of a gzipped FileDescriptor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 0xed, 0x21, 0x82, 0x48, 0x9e, 0x62, 0x00, 0x27, 0x71, 0x2a, 0x0a, 0x20, 0x97, - 0x40, 0xb9, 0xfc, 0xfd, 0x47, 0x29, 0xf4, 0xe0, 0x51, 0x0a, 0xfd, 0xf1, 0x28, 0x85, 0xee, 0x2e, - 0xa5, 0x86, 0x1e, 0x2c, 0xa5, 0x86, 0x7e, 0x5b, 0x4a, 0x0d, 0xbd, 0x31, 0xdb, 0xf1, 0x79, 0x4d, - 0xc4, 0xc8, 0xd6, 0xb4, 0x92, 0xe9, 0x06, 0xbc, 0x36, 0xf3, 0xac, 0x7a, 0xdd, 0x09, 0xcb, 0x3e, - 0xb7, 0x95, 0x46, 0x98, 0xce, 0xdc, 0xff, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x4c, 0x44, - 0xce, 0x07, 0x1d, 0x00, 0x00, + // 1599 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x73, 0x14, 0x45, + 0x1b, 0x4f, 0x07, 0x92, 0xf7, 0xe5, 0xe1, 0x4d, 0xe0, 0x6d, 0x02, 0x26, 0x13, 0xd8, 0x0d, 0x0d, + 0xc4, 0xa8, 0xc9, 0x0c, 0x09, 0x08, 0x88, 0x7c, 0x2e, 0x11, 0x2b, 0xb8, 0x22, 0x2c, 0x28, 0xe5, + 0x57, 0x6d, 0xcd, 0xee, 0x0e, 0xcb, 0x14, 0xbb, 0xd3, 0xcb, 0xce, 0x2c, 0xb2, 0x52, 0x48, 0x09, + 0x1e, 0x3c, 0x78, 0xc0, 0xf2, 0x62, 0x79, 0xb0, 0xd4, 0x9b, 0x1e, 0x2c, 0x2f, 0x1e, 0x28, 0xef, + 0x4a, 0x59, 0xa5, 0x45, 0x95, 0x17, 0xcb, 0x43, 0xb0, 0x88, 0x7f, 0x01, 0x27, 0x8f, 0xd6, 0x74, + 0xf7,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0x6d, 0xdd, 0xb2, 0xd0, 0x2d, 0x9f, 0xa0, 0xba, + 0x91, 0xd9, 0x7d, 0x6f, 0x31, 0xdd, 0xf7, 0xcd, 0x83, 0xf4, 0x54, 0x59, 0xb7, 0x2e, 0x35, 0x0a, + 0x72, 0x91, 0x56, 0x15, 0x51, 0x24, 0xfe, 0x33, 0x63, 0x96, 0x2e, 0x2b, 0x56, 0xb3, 0xa6, 0x99, + 0xac, 0x83, 0x99, 0xe3, 0xc8, 0x64, 0x1c, 0xc6, 0x78, 0xee, 0x2c, 0x2d, 0x5e, 0xd6, 0x4a, 0xc7, + 0xab, 0xb4, 0x61, 0x58, 0x0e, 0xb1, 0x9b, 0x20, 0x85, 0x35, 0xae, 0x1c, 0xbb, 0x17, 0x61, 0xdb, + 0xf1, 0x62, 0xd1, 0xce, 0xfa, 0xaa, 0x61, 0x57, 0x54, 0x2d, 0x54, 0x34, 0x1e, 0xc0, 0x19, 0xe2, + 0x49, 0x18, 0xa0, 0xef, 0x18, 0x5a, 0x7d, 0x14, 0x4d, 0xa0, 0xa9, 0x75, 0x99, 0x8d, 0x8f, 0x16, + 0xd3, 0xff, 0x6b, 0xaa, 0xd5, 0xca, 0x41, 0xc2, 0x5e, 0x93, 0x1c, 0x6f, 0x26, 0xb7, 0x11, 0xa4, + 0xa2, 0x90, 0x56, 0x4e, 0xce, 0x49, 0xd8, 0xea, 0x21, 0xa1, 0x1b, 0xe5, 0xae, 0xd4, 0xdc, 0x42, + 0xbe, 0xba, 0x2c, 0x03, 0xad, 0x9c, 0x98, 0x13, 0x30, 0x26, 0x38, 0xf0, 0xd9, 0xd1, 0x95, 0x92, + 0x9b, 0x20, 0x85, 0x81, 0xac, 0x9c, 0x8a, 0xcf, 0x91, 0x3b, 0x26, 0x9c, 0xc1, 0x19, 0xd5, 0xb4, + 0xce, 0xeb, 0x55, 0xad, 0x43, 0x25, 0xf8, 0x35, 0x58, 0xe7, 0xee, 0x23, 0xa3, 0xfd, 0x13, 0x68, +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2, 0x10, 0x03, 0x36, 0x79, 0xf2, 0x0b, 0x39, 0x17, + 0x60, 0x50, 0x65, 0xa7, 0xb3, 0x18, 0x8b, 0xa3, 0x36, 0xda, 0x1f, 0x8b, 0xe9, 0xc9, 0x04, 0xfb, + 0xe1, 0x82, 0x61, 0x3d, 0x5a, 0x4c, 0x0f, 0xf1, 0xbc, 0x1c, 0x85, 0xe4, 0x04, 0x1c, 0x99, 0x82, + 0x21, 0x9e, 0xcf, 0x91, 0xfa, 0x04, 0xfc, 0xc7, 0xae, 0x44, 0x5e, 0x2f, 0xb1, 0x54, 0x6b, 0x73, + 0x83, 0xf6, 0xe3, 0x42, 0x89, 0x1c, 0x83, 0x61, 0x27, 0x52, 0x90, 0x92, 0x61, 0xad, 0xdd, 0xc6, + 0xe2, 0x62, 0x4b, 0x9c, 0x63, 0x71, 0x64, 0x13, 0xfc, 0xff, 0xb4, 0x76, 0x8d, 0x0d, 0xdb, 0xc2, + 0xbc, 0x73, 0x07, 0x99, 0x01, 0xdc, 0xfa, 0x52, 0x40, 0xc7, 0xb0, 0xd8, 0x7e, 0xae, 0x69, 0x58, + 0x97, 0x34, 0x4b, 0x2f, 0x66, 0x59, 0x1e, 0x33, 0xd3, 0xe4, 0x7f, 0x5c, 0xcc, 0xc8, 0xde, 0x07, + 0xfb, 0x47, 0x11, 0xb9, 0x0a, 0x24, 0x0e, 0x41, 0x10, 0xc8, 0xc2, 0x06, 0xd3, 0x89, 0xca, 0xb7, + 0xce, 0xa4, 0x6d, 0x7e, 0x99, 0x1e, 0x30, 0x31, 0x99, 0x86, 0xcd, 0xd6, 0x97, 0x26, 0xcb, 0xfb, + 0x3c, 0x4c, 0xf8, 0xf2, 0x26, 0x27, 0x4e, 0x68, 0x40, 0x76, 0x08, 0xe7, 0x53, 0x30, 0xec, 0xe5, + 0x2c, 0x46, 0x26, 0x11, 0xe5, 0x21, 0x0f, 0x65, 0xf2, 0x05, 0xf2, 0x2d, 0xb3, 0x2c, 0x35, 0xca,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37, 0xe6, 0x5a, 0xbe, 0x70, 0x0a, 0x8c, 0x99, 0x8a, 0x5a, 0x30, + 0x5d, 0xc0, 0xab, 0xb3, 0xcf, 0x2a, 0xd7, 0x1c, 0x58, 0xf6, 0xc5, 0xb3, 0x30, 0xc8, 0x4c, 0xf3, + 0x9e, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xdd, 0x97, 0x7f, 0x32, 0x8a, 0x1e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1867,8 +1962,11 @@ type QueryClient interface { LockedByID(ctx context.Context, in *LockedRequest, opts ...grpc.CallOption) (*LockedResponse, error) // Returns next lock ID NextLockID(ctx context.Context, in *NextLockIDRequest, opts ...grpc.CallOption) (*NextLockIDResponse, error) - // Returns synthetic lockups by native lockup id + // Returns synthetic lockup by native lockup id + // Deprecated: use SyntheticLockupByLockupID instead SyntheticLockupsByLockupID(ctx context.Context, in *SyntheticLockupsByLockupIDRequest, opts ...grpc.CallOption) (*SyntheticLockupsByLockupIDResponse, error) + // Returns synthetic lockup by native lockup id + SyntheticLockupByLockupID(ctx context.Context, in *SyntheticLockupByLockupIDRequest, opts ...grpc.CallOption) (*SyntheticLockupByLockupIDResponse, error) // Returns account locked records with longer duration AccountLockedLongerDuration(ctx context.Context, in *AccountLockedLongerDurationRequest, opts ...grpc.CallOption) (*AccountLockedLongerDurationResponse, error) // Returns account locked records with a specific duration @@ -1998,6 +2096,7 @@ func (c *queryClient) NextLockID(ctx context.Context, in *NextLockIDRequest, opt return out, nil } +// Deprecated: Do not use. func (c *queryClient) SyntheticLockupsByLockupID(ctx context.Context, in *SyntheticLockupsByLockupIDRequest, opts ...grpc.CallOption) (*SyntheticLockupsByLockupIDResponse, error) { out := new(SyntheticLockupsByLockupIDResponse) err := c.cc.Invoke(ctx, "/osmosis.lockup.Query/SyntheticLockupsByLockupID", in, out, opts...) @@ -2007,6 +2106,15 @@ func (c *queryClient) SyntheticLockupsByLockupID(ctx context.Context, in *Synthe return out, nil } +func (c *queryClient) SyntheticLockupByLockupID(ctx context.Context, in *SyntheticLockupByLockupIDRequest, opts ...grpc.CallOption) (*SyntheticLockupByLockupIDResponse, error) { + out := new(SyntheticLockupByLockupIDResponse) + err := c.cc.Invoke(ctx, "/osmosis.lockup.Query/SyntheticLockupByLockupID", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) AccountLockedLongerDuration(ctx context.Context, in *AccountLockedLongerDurationRequest, opts ...grpc.CallOption) (*AccountLockedLongerDurationResponse, error) { out := new(AccountLockedLongerDurationResponse) err := c.cc.Invoke(ctx, "/osmosis.lockup.Query/AccountLockedLongerDuration", in, out, opts...) @@ -2079,8 +2187,11 @@ type QueryServer interface { LockedByID(context.Context, *LockedRequest) (*LockedResponse, error) // Returns next lock ID NextLockID(context.Context, *NextLockIDRequest) (*NextLockIDResponse, error) - // Returns synthetic lockups by native lockup id + // Returns synthetic lockup by native lockup id + // Deprecated: use SyntheticLockupByLockupID instead SyntheticLockupsByLockupID(context.Context, *SyntheticLockupsByLockupIDRequest) (*SyntheticLockupsByLockupIDResponse, error) + // Returns synthetic lockup by native lockup id + SyntheticLockupByLockupID(context.Context, *SyntheticLockupByLockupIDRequest) (*SyntheticLockupByLockupIDResponse, error) // Returns account locked records with longer duration AccountLockedLongerDuration(context.Context, *AccountLockedLongerDurationRequest) (*AccountLockedLongerDurationResponse, error) // Returns account locked records with a specific duration @@ -2137,6 +2248,9 @@ func (*UnimplementedQueryServer) NextLockID(ctx context.Context, req *NextLockID func (*UnimplementedQueryServer) SyntheticLockupsByLockupID(ctx context.Context, req *SyntheticLockupsByLockupIDRequest) (*SyntheticLockupsByLockupIDResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SyntheticLockupsByLockupID not implemented") } +func (*UnimplementedQueryServer) SyntheticLockupByLockupID(ctx context.Context, req *SyntheticLockupByLockupIDRequest) (*SyntheticLockupByLockupIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SyntheticLockupByLockupID not implemented") +} func (*UnimplementedQueryServer) AccountLockedLongerDuration(ctx context.Context, req *AccountLockedLongerDurationRequest) (*AccountLockedLongerDurationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AccountLockedLongerDuration not implemented") } @@ -2391,6 +2505,24 @@ func _Query_SyntheticLockupsByLockupID_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _Query_SyntheticLockupByLockupID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SyntheticLockupByLockupIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SyntheticLockupByLockupID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.lockup.Query/SyntheticLockupByLockupID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SyntheticLockupByLockupID(ctx, req.(*SyntheticLockupByLockupIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_AccountLockedLongerDuration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AccountLockedLongerDurationRequest) if err := dec(in); err != nil { @@ -2537,6 +2669,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "SyntheticLockupsByLockupID", Handler: _Query_SyntheticLockupsByLockupID_Handler, }, + { + MethodName: "SyntheticLockupByLockupID", + Handler: _Query_SyntheticLockupByLockupID_Handler, + }, { MethodName: "AccountLockedLongerDuration", Handler: _Query_AccountLockedLongerDuration_Handler, @@ -3440,6 +3576,67 @@ func (m *SyntheticLockupsByLockupIDResponse) MarshalToSizedBuffer(dAtA []byte) ( return len(dAtA) - i, nil } +func (m *SyntheticLockupByLockupIDRequest) 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 *SyntheticLockupByLockupIDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyntheticLockupByLockupIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LockId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.LockId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyntheticLockupByLockupIDResponse) 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 *SyntheticLockupByLockupIDResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyntheticLockupByLockupIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.SyntheticLock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *AccountLockedLongerDurationRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3460,12 +3657,12 @@ func (m *AccountLockedLongerDurationRequest) MarshalToSizedBuffer(dAtA []byte) ( _ = i var l int _ = l - n7, err7 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) - if err7 != nil { - return 0, err7 + n8, err8 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) + if err8 != nil { + return 0, err8 } - i -= n7 - i = encodeVarintQuery(dAtA, i, uint64(n7)) + i -= n8 + i = encodeVarintQuery(dAtA, i, uint64(n8)) i-- dAtA[i] = 0x12 if len(m.Owner) > 0 { @@ -3535,12 +3732,12 @@ func (m *AccountLockedDurationRequest) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l - n8, err8 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) - if err8 != nil { - return 0, err8 + n9, err9 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) + if err9 != nil { + return 0, err9 } - i -= n8 - i = encodeVarintQuery(dAtA, i, uint64(n8)) + i -= n9 + i = encodeVarintQuery(dAtA, i, uint64(n9)) i-- dAtA[i] = 0x12 if len(m.Owner) > 0 { @@ -3610,12 +3807,12 @@ func (m *AccountLockedLongerDurationNotUnlockingOnlyRequest) MarshalToSizedBuffe _ = i var l int _ = l - n9, err9 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) - if err9 != nil { - return 0, err9 + n10, err10 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) + if err10 != nil { + return 0, err10 } - i -= n9 - i = encodeVarintQuery(dAtA, i, uint64(n9)) + i -= n10 + i = encodeVarintQuery(dAtA, i, uint64(n10)) i-- dAtA[i] = 0x12 if len(m.Owner) > 0 { @@ -3692,12 +3889,12 @@ func (m *AccountLockedLongerDurationDenomRequest) MarshalToSizedBuffer(dAtA []by i-- dAtA[i] = 0x1a } - n10, err10 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) - if err10 != nil { - return 0, err10 + n11, err11 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) + if err11 != nil { + return 0, err11 } - i -= n10 - i = encodeVarintQuery(dAtA, i, uint64(n10)) + i -= n11 + i = encodeVarintQuery(dAtA, i, uint64(n11)) i-- dAtA[i] = 0x12 if len(m.Owner) > 0 { @@ -4169,6 +4366,29 @@ func (m *SyntheticLockupsByLockupIDResponse) Size() (n int) { return n } +func (m *SyntheticLockupByLockupIDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LockId != 0 { + n += 1 + sovQuery(uint64(m.LockId)) + } + return n +} + +func (m *SyntheticLockupByLockupIDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.SyntheticLock.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *AccountLockedLongerDurationRequest) Size() (n int) { if m == nil { return 0 @@ -6539,6 +6759,158 @@ func (m *SyntheticLockupsByLockupIDResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *SyntheticLockupByLockupIDRequest) 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 ErrIntOverflowQuery + } + 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: SyntheticLockupByLockupIDRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyntheticLockupByLockupIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LockId", wireType) + } + m.LockId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LockId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyntheticLockupByLockupIDResponse) 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 ErrIntOverflowQuery + } + 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: SyntheticLockupByLockupIDResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyntheticLockupByLockupIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SyntheticLock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SyntheticLock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *AccountLockedLongerDurationRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/lockup/types/query.pb.gw.go b/x/lockup/types/query.pb.gw.go index cc3f30a7c7d..715754ac318 100644 --- a/x/lockup/types/query.pb.gw.go +++ b/x/lockup/types/query.pb.gw.go @@ -681,6 +681,60 @@ func local_request_Query_SyntheticLockupsByLockupID_0(ctx context.Context, marsh } +func request_Query_SyntheticLockupByLockupID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SyntheticLockupByLockupIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["lock_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "lock_id") + } + + protoReq.LockId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "lock_id", err) + } + + msg, err := client.SyntheticLockupByLockupID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SyntheticLockupByLockupID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SyntheticLockupByLockupIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["lock_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "lock_id") + } + + protoReq.LockId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "lock_id", err) + } + + msg, err := server.SyntheticLockupByLockupID(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_AccountLockedLongerDuration_0 = &utilities.DoubleArray{Encoding: map[string]int{"owner": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) @@ -1292,6 +1346,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_SyntheticLockupByLockupID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_SyntheticLockupByLockupID_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SyntheticLockupByLockupID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_AccountLockedLongerDuration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1708,6 +1785,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_SyntheticLockupByLockupID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_SyntheticLockupByLockupID_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SyntheticLockupByLockupID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_AccountLockedLongerDuration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1838,6 +1935,8 @@ var ( pattern_Query_SyntheticLockupsByLockupID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "lockup", "v1beta1", "synthetic_lockups_by_lock_id", "lock_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_SyntheticLockupByLockupID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "lockup", "v1beta1", "synthetic_lockup_by_lock_id", "lock_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_AccountLockedLongerDuration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "lockup", "v1beta1", "account_locked_longer_duration", "owner"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AccountLockedDuration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "lockup", "v1beta1", "account_locked_duration", "owner"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1876,6 +1975,8 @@ var ( forward_Query_SyntheticLockupsByLockupID_0 = runtime.ForwardResponseMessage + forward_Query_SyntheticLockupByLockupID_0 = runtime.ForwardResponseMessage + forward_Query_AccountLockedLongerDuration_0 = runtime.ForwardResponseMessage forward_Query_AccountLockedDuration_0 = runtime.ForwardResponseMessage diff --git a/x/superfluid/keeper/export_test.go b/x/superfluid/keeper/export_test.go index c830be7462f..a24665b74e0 100644 --- a/x/superfluid/keeper/export_test.go +++ b/x/superfluid/keeper/export_test.go @@ -38,7 +38,7 @@ func (k Keeper) ValidateSharesToMigrateUnlockAndExitBalancerPool(ctx sdk.Context return k.validateSharesToMigrateUnlockAndExitBalancerPool(ctx, sender, poolIdLeaving, lock, sharesToMigrate, tokenOutMins, remainingLockTime) } -func (k Keeper) RouteMigration(ctx sdk.Context, sender sdk.AccAddress, lockId uint64, sharesToMigrate sdk.Coin) (synthLocksBeforeMigration []lockuptypes.SyntheticLock, migrationType MigrationType, err error) { +func (k Keeper) RouteMigration(ctx sdk.Context, sender sdk.AccAddress, lockId uint64, sharesToMigrate sdk.Coin) (synthLockBeforeMigration lockuptypes.SyntheticLock, migrationType MigrationType, err error) { return k.routeMigration(ctx, sender, lockId, sharesToMigrate) } diff --git a/x/superfluid/keeper/migrate.go b/x/superfluid/keeper/migrate.go index 7d001eb27b4..234f8d52ffa 100644 --- a/x/superfluid/keeper/migrate.go +++ b/x/superfluid/keeper/migrate.go @@ -28,16 +28,16 @@ const ( // If the lock is locked or unlocking but not superfluid delegated/undelegating, it will migrate the position and either start unlocking or continue unlocking where it left off. // Errors if the lock is not found, if the lock is not a balancer pool lock, or if the lock is not owned by the sender. func (k Keeper) RouteLockedBalancerToConcentratedMigration(ctx sdk.Context, sender sdk.AccAddress, lockId uint64, sharesToMigrate sdk.Coin, tokenOutMins sdk.Coins) (positionId uint64, amount0, amount1 sdk.Int, liquidity sdk.Dec, joinTime time.Time, poolIdLeaving, poolIdEntering, concentratedLockId uint64, err error) { - synthLocksBeforeMigration, migrationType, err := k.routeMigration(ctx, sender, lockId, sharesToMigrate) + synthLockBeforeMigration, migrationType, err := k.routeMigration(ctx, sender, lockId, sharesToMigrate) if err != nil { return 0, sdk.Int{}, sdk.Int{}, sdk.Dec{}, time.Time{}, 0, 0, 0, err } switch migrationType { case SuperfluidBonded: - positionId, amount0, amount1, liquidity, joinTime, concentratedLockId, poolIdLeaving, poolIdEntering, err = k.migrateSuperfluidBondedBalancerToConcentrated(ctx, sender, lockId, sharesToMigrate, synthLocksBeforeMigration[0].SynthDenom, tokenOutMins) + positionId, amount0, amount1, liquidity, joinTime, concentratedLockId, poolIdLeaving, poolIdEntering, err = k.migrateSuperfluidBondedBalancerToConcentrated(ctx, sender, lockId, sharesToMigrate, synthLockBeforeMigration.SynthDenom, tokenOutMins) case SuperfluidUnbonding: - positionId, amount0, amount1, liquidity, joinTime, concentratedLockId, poolIdLeaving, poolIdEntering, err = k.migrateSuperfluidUnbondingBalancerToConcentrated(ctx, sender, lockId, sharesToMigrate, synthLocksBeforeMigration[0].SynthDenom, tokenOutMins) + positionId, amount0, amount1, liquidity, joinTime, concentratedLockId, poolIdLeaving, poolIdEntering, err = k.migrateSuperfluidUnbondingBalancerToConcentrated(ctx, sender, lockId, sharesToMigrate, synthLockBeforeMigration.SynthDenom, tokenOutMins) case NonSuperfluid: positionId, amount0, amount1, liquidity, joinTime, concentratedLockId, poolIdLeaving, poolIdEntering, err = k.migrateNonSuperfluidLockBalancerToConcentrated(ctx, sender, lockId, sharesToMigrate, tokenOutMins) default: @@ -207,23 +207,23 @@ func (k Keeper) migrateNonSuperfluidLockBalancerToConcentrated(ctx sdk.Context, // routeMigration determines the status of the provided lock which is used to determine the method for migration. // It also returns the underlying synthetic locks of the provided lock, if any exist. -func (k Keeper) routeMigration(ctx sdk.Context, sender sdk.AccAddress, lockId uint64, sharesToMigrate sdk.Coin) (synthLocksBeforeMigration []lockuptypes.SyntheticLock, migrationType MigrationType, err error) { - synthLocksBeforeMigration = k.lk.GetAllSyntheticLockupsByLockup(ctx, lockId) - if len(synthLocksBeforeMigration) > 1 { - return nil, Unsupported, fmt.Errorf("lock %d contains more than one synthetic lock", lockId) +func (k Keeper) routeMigration(ctx sdk.Context, sender sdk.AccAddress, lockId uint64, sharesToMigrate sdk.Coin) (synthLockBeforeMigration lockuptypes.SyntheticLock, migrationType MigrationType, err error) { + synthLockBeforeMigration, err = k.lk.GetSyntheticLockupByUnderlyingLockId(ctx, lockId) + if err != nil { + return lockuptypes.SyntheticLock{}, Unsupported, err } - if len(synthLocksBeforeMigration) == 0 { + if synthLockBeforeMigration == (lockuptypes.SyntheticLock{}) { migrationType = NonSuperfluid - } else if strings.Contains(synthLocksBeforeMigration[0].SynthDenom, "superbonding") { + } else if strings.Contains(synthLockBeforeMigration.SynthDenom, "superbonding") { migrationType = SuperfluidBonded - } else if strings.Contains(synthLocksBeforeMigration[0].SynthDenom, "superunbonding") { + } else if strings.Contains(synthLockBeforeMigration.SynthDenom, "superunbonding") { migrationType = SuperfluidUnbonding } else { - return nil, Unsupported, fmt.Errorf("lock %d contains an unsupported synthetic lock", lockId) + return lockuptypes.SyntheticLock{}, Unsupported, fmt.Errorf("lock %d contains an unsupported synthetic lock", lockId) } - return synthLocksBeforeMigration, migrationType, nil + return synthLockBeforeMigration, migrationType, nil } // validateMigration performs validation for the migration of gamm LP tokens from a Balancer pool to the canonical Concentrated pool. It performs the following steps: diff --git a/x/superfluid/keeper/migrate_test.go b/x/superfluid/keeper/migrate_test.go index e5fd70a5c98..2375937a7f1 100644 --- a/x/superfluid/keeper/migrate_test.go +++ b/x/superfluid/keeper/migrate_test.go @@ -310,10 +310,10 @@ func (s *KeeperTestSuite) TestMigrateSuperfluidBondedBalancerToConcentrated() { // Modify migration inputs if necessary if tc.overwriteValidatorAddress { - synthDenomParts := strings.Split(synthLockBeforeMigration[0].SynthDenom, "/") + synthDenomParts := strings.Split(synthLockBeforeMigration.SynthDenom, "/") synthDenomParts[4] = "osmovaloper1n69ghlk6404gzxtmtq0w7ma59n9vd9ed9dplg" // invalid, too short newSynthDenom := strings.Join(synthDenomParts, "/") - synthLockBeforeMigration[0].SynthDenom = newSynthDenom + synthLockBeforeMigration.SynthDenom = newSynthDenom } if tc.overwriteLockId { @@ -323,7 +323,7 @@ func (s *KeeperTestSuite) TestMigrateSuperfluidBondedBalancerToConcentrated() { balancerDelegationPre, _ := stakingKeeper.GetDelegation(ctx, balancerIntermediaryAcc.GetAccAddress(), valAddr) // System under test. - positionId, amount0, amount1, liquidityMigrated, _, concentratedLockId, poolIdLeaving, poolIdEntering, err := superfluidKeeper.MigrateSuperfluidBondedBalancerToConcentrated(ctx, poolJoinAcc, originalGammLockId, coinsToMigrate, synthLockBeforeMigration[0].SynthDenom, tc.tokenOutMins) + positionId, amount0, amount1, liquidityMigrated, _, concentratedLockId, poolIdLeaving, poolIdEntering, err := superfluidKeeper.MigrateSuperfluidBondedBalancerToConcentrated(ctx, poolJoinAcc, originalGammLockId, coinsToMigrate, synthLockBeforeMigration.SynthDenom, tc.tokenOutMins) if tc.expectedError != nil { s.Require().Error(err) s.Require().ErrorContains(err, tc.expectedError.Error()) @@ -470,14 +470,14 @@ func (s *KeeperTestSuite) TestMigrateSuperfluidUnbondingBalancerToConcentrated() // Modify migration inputs if necessary if tc.overwriteValidatorAddress { - synthDenomParts := strings.Split(synthLockBeforeMigration[0].SynthDenom, "/") + synthDenomParts := strings.Split(synthLockBeforeMigration.SynthDenom, "/") synthDenomParts[4] = "osmovaloper1n69ghlk6404gzxtmtq0w7ma59n9vd9ed9dplg" // invalid, too short newSynthDenom := strings.Join(synthDenomParts, "/") - synthLockBeforeMigration[0].SynthDenom = newSynthDenom + synthLockBeforeMigration.SynthDenom = newSynthDenom } // System under test. - positionId, amount0, amount1, liquidityMigrated, _, concentratedLockId, poolIdLeaving, poolIdEntering, err := superfluidKeeper.MigrateSuperfluidUnbondingBalancerToConcentrated(ctx, poolJoinAcc, originalGammLockId, coinsToMigrate, synthLockBeforeMigration[0].SynthDenom, tc.tokenOutMins) + positionId, amount0, amount1, liquidityMigrated, _, concentratedLockId, poolIdLeaving, poolIdEntering, err := superfluidKeeper.MigrateSuperfluidUnbondingBalancerToConcentrated(ctx, poolJoinAcc, originalGammLockId, coinsToMigrate, synthLockBeforeMigration.SynthDenom, tc.tokenOutMins) if tc.expectedError != nil { s.Require().Error(err) s.Require().ErrorContains(err, tc.expectedError.Error()) @@ -580,7 +580,7 @@ func (s *KeeperTestSuite) TestMigrateNonSuperfluidLockBalancerToConcentrated() { // RouteMigration is called via the migration message router and is always run prior to the migration itself synthLockBeforeMigration, migrationType, err := superfluidKeeper.RouteMigration(ctx, poolJoinAcc, originalGammLockId, coinsToMigrate) s.Require().NoError(err) - s.Require().Equal(0, len(synthLockBeforeMigration)) + s.Require().Equal((lockuptypes.SyntheticLock{}), synthLockBeforeMigration) s.Require().Equal(migrationType, keeper.NonSuperfluid) // System under test. diff --git a/x/superfluid/keeper/stake.go b/x/superfluid/keeper/stake.go index 9fd3fb273f3..e0eeeb64373 100644 --- a/x/superfluid/keeper/stake.go +++ b/x/superfluid/keeper/stake.go @@ -469,11 +469,14 @@ func (k Keeper) unbondLock(ctx sdk.Context, underlyingLockId uint64, sender stri if err != nil { return 0, err } - synthLocks := k.lk.GetAllSyntheticLockupsByLockup(ctx, underlyingLockId) - if len(synthLocks) != 1 { + synthLock, err := k.lk.GetSyntheticLockupByUnderlyingLockId(ctx, underlyingLockId) + if err != nil { + return 0, err + } + if synthLock == (lockuptypes.SyntheticLock{}) { return 0, types.ErrNotSuperfluidUsedLockup } - if !synthLocks[0].IsUnlocking() { + if !synthLock.IsUnlocking() { return 0, types.ErrBondingLockupNotSupported } return k.lk.BeginForceUnlock(ctx, underlyingLockId, coins) @@ -493,8 +496,11 @@ func (k Keeper) alreadySuperfluidStaking(ctx sdk.Context, lockID uint64) bool { return true } - synthLocks := k.lk.GetAllSyntheticLockupsByLockup(ctx, lockID) - return len(synthLocks) > 0 + synthLock, err := k.lk.GetSyntheticLockupByUnderlyingLockId(ctx, lockID) + if err != nil { + return false + } + return synthLock != (lockuptypes.SyntheticLock{}) } // mintOsmoTokensAndDelegate mints osmoAmount of OSMO tokens, and immediately delegate them to validator on behalf of intermediary account. diff --git a/x/superfluid/types/expected_keepers.go b/x/superfluid/types/expected_keepers.go index 394728f3c0d..ec181c2220a 100644 --- a/x/superfluid/types/expected_keepers.go +++ b/x/superfluid/types/expected_keepers.go @@ -41,7 +41,7 @@ type LockupKeeper interface { GetAllSyntheticLockups(ctx sdk.Context) []lockuptypes.SyntheticLock CreateSyntheticLockup(ctx sdk.Context, lockID uint64, suffix string, unlockDuration time.Duration, isUnlocking bool) error DeleteSyntheticLockup(ctx sdk.Context, lockID uint64, suffix string) error - GetAllSyntheticLockupsByLockup(ctx sdk.Context, lockID uint64) []lockuptypes.SyntheticLock + GetSyntheticLockupByUnderlyingLockId(ctx sdk.Context, lockID uint64) (lockuptypes.SyntheticLock, error) } type LockupMsgServer interface { diff --git a/x/valset-pref/types/expected_interfaces.go b/x/valset-pref/types/expected_interfaces.go index 7eb585b4c31..03fe0191332 100644 --- a/x/valset-pref/types/expected_interfaces.go +++ b/x/valset-pref/types/expected_interfaces.go @@ -33,7 +33,7 @@ type DistributionKeeper interface { } type LockupKeeper interface { GetLockByID(ctx sdk.Context, lockID uint64) (*lockuptypes.PeriodLock, error) - GetAllSyntheticLockupsByLockup(ctx sdk.Context, lockID uint64) []lockuptypes.SyntheticLock + GetSyntheticLockupByUnderlyingLockId(ctx sdk.Context, lockID uint64) (lockuptypes.SyntheticLock, error) ForceUnlock(ctx sdk.Context, lock lockuptypes.PeriodLock) error BeginUnlock(ctx sdk.Context, lockID uint64, coins sdk.Coins) (uint64, error) GetPeriodLocks(ctx sdk.Context) ([]lockuptypes.PeriodLock, error) diff --git a/x/valset-pref/validator_set.go b/x/valset-pref/validator_set.go index 4d4d6f2471f..599606696ac 100644 --- a/x/valset-pref/validator_set.go +++ b/x/valset-pref/validator_set.go @@ -353,8 +353,11 @@ func (k Keeper) ForceUnlockBondedOsmo(ctx sdk.Context, lockID uint64, delegatorA } // Ensured the lock has no superfluid relation by checking that there are no synthetic locks - synthLocks := k.lockupKeeper.GetAllSyntheticLockupsByLockup(ctx, lockID) - if len(synthLocks) != 0 { + synthLocks, err := k.lockupKeeper.GetSyntheticLockupByUnderlyingLockId(ctx, lockID) + if err != nil { + return sdk.Coin{}, err + } + if synthLocks != (lockuptypes.SyntheticLock{}) { return sdk.Coin{}, fmt.Errorf("cannot use DelegateBondedTokens being used for superfluid.") }