Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stackman27 committed Jun 24, 2023
1 parent 26b1589 commit 1e149f9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
12 changes: 0 additions & 12 deletions x/concentrated-liquidity/position_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package concentrated_liquidity_test

import (
"fmt"
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -14,7 +13,6 @@ import (
cl "github.com/osmosis-labs/osmosis/v16/x/concentrated-liquidity"
"github.com/osmosis-labs/osmosis/v16/x/concentrated-liquidity/model"
"github.com/osmosis-labs/osmosis/v16/x/concentrated-liquidity/types"
lockuptypes "github.com/osmosis-labs/osmosis/v16/x/lockup/types"
)

const (
Expand Down Expand Up @@ -2408,16 +2406,6 @@ func (s *KeeperTestSuite) TestCreateFullRangePositionLocked() {
concentratedLock, err := s.App.LockupKeeper.GetLockByID(s.Ctx, concentratedLockId)
s.Require().NoError(err)

// TODO: @stack, add assertion around what happens to the lock tokens once it expires
// TODO: @stack: Add assertions to check if the module aaccount recieved correct liquidity
moduleAccAddr := s.App.AccountKeeper.GetModuleAccount(s.Ctx, lockuptypes.ModuleName)

moduleCoins := s.App.BankKeeper.GetAllBalances(s.Ctx, moduleAccAddr.GetAddress())
ownerCoins := s.App.BankKeeper.GetAllBalances(s.Ctx, sdk.AccAddress([]byte(position.Address)))

fmt.Println("LOCK MODULE COINS: ", moduleCoins) // 70710678cl/pool/1
fmt.Println("LOCK OWNER COINS: ", ownerCoins) // 10000000000bar,10000000000baz,10000000000foo,9000000000uosmo

s.Require().Equal(concentratedLock.Coins[0].Amount.String(), liquidity.TruncateInt().String())
s.Require().False(concentratedLock.IsUnlocking())
})
Expand Down
1 change: 0 additions & 1 deletion x/lockup/keeper/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ func (k Keeper) ForceUnlock(ctx sdk.Context, lock types.PeriodLock) error {
return err
}
if !synthLock.IsNil() {
fmt.Println("REMOVEEE SYNTHETIC LOCKUPPP")
err = k.DeleteSyntheticLockup(ctx, lock.ID, synthLock.SynthDenom)
if err != nil {
return err
Expand Down
1 change: 0 additions & 1 deletion x/superfluid/keeper/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func (k Keeper) RouteLockedBalancerToConcentratedMigration(ctx sdk.Context, send
case NonSuperfluid:
positionId, amount0, amount1, liquidity, concentratedLockId, poolIdLeaving, poolIdEntering, err = k.migrateNonSuperfluidLockBalancerToConcentrated(ctx, sender, lockId, sharesToMigrate, tokenOutMins)
case Unlocked:
fmt.Println("unlocked case")
positionId, amount0, amount1, liquidity, poolIdLeaving, poolIdEntering, err = k.gk.MigrateUnlockedPositionFromBalancerToConcentrated(ctx, sender, sharesToMigrate, tokenOutMins)
concentratedLockId = 0
default:
Expand Down
6 changes: 2 additions & 4 deletions x/superfluid/keeper/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,7 @@ func (s *KeeperTestSuite) TestMigrateSuperfluidBondedBalancerToConcentrated() {
clIntermediaryAcc := superfluidKeeper.GetLockIdIntermediaryAccountConnection(s.Ctx, concentratedLockId)
delegation, found := stakingKeeper.GetDelegation(s.Ctx, clIntermediaryAcc, valAddr)
s.Require().True(found, "expected delegation, found delegation no delegation")
s.Require().Equal(balancerDelegationPre.Shares.Mul(tc.percentOfSharesToMigrate).RoundInt().Sub(sdk.OneInt()).String(), delegation.Shares.RoundInt().String(), "expected %d shares, found %d shares",
balancerDelegationPre.Shares.Mul(tc.percentOfSharesToMigrate).RoundInt().String(), delegation.Shares.String())
s.Require().Equal(balancerDelegationPre.Shares.Mul(tc.percentOfSharesToMigrate).RoundInt().Sub(sdk.OneInt()).String(), delegation.Shares.RoundInt().String(), "expected %d shares, found %d shares", balancerDelegationPre.Shares.Mul(tc.percentOfSharesToMigrate).RoundInt().String(), delegation.Shares.String())

// Check if the new intermediary account connection was created.
newConcentratedIntermediaryAccount := superfluidKeeper.GetLockIdIntermediaryAccountConnection(s.Ctx, concentratedLockId)
Expand All @@ -421,8 +420,7 @@ func (s *KeeperTestSuite) TestMigrateSuperfluidBondedBalancerToConcentrated() {
// Check newly created concentrated lock.
concentratedLock, err := lockupKeeper.GetLockByID(s.Ctx, concentratedLockId)
s.Require().NoError(err)
// ? This is off by one 5000 -> 4999
fmt.Println("LIQUIDITY", liquidityMigrated, coinsToMigrate, concentratedLock.Coins[0])

s.Require().Equal(liquidityMigrated.TruncateInt().String(), concentratedLock.Coins[0].Amount.String(), "expected %s shares, found %s shares", coinsToMigrate.Amount.String(), concentratedLock.Coins[0].Amount.String())
s.Require().Equal(balancerLock.Duration, concentratedLock.Duration)
s.Require().Equal(balancerLock.EndTime, concentratedLock.EndTime)
Expand Down

0 comments on commit 1e149f9

Please sign in to comment.