Skip to content

Commit

Permalink
remove legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
amityadav0 committed Jan 15, 2025
1 parent 00c225a commit 1f7621c
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 2,521 deletions.
1,114 changes: 63 additions & 1,051 deletions api/elys/leveragelp/types.pulsar.go

Large diffs are not rendered by default.

626 changes: 17 additions & 609 deletions api/elys/stablestake/types.pulsar.go

Large diffs are not rendered by default.

27 changes: 0 additions & 27 deletions proto/elys/leveragelp/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,33 +41,6 @@ message Position {
uint64 borrow_pool_id = 9;
}

message LegacyPosition {
string address = 1;
cosmos.base.v1beta1.Coin collateral = 2 [ (gogoproto.nullable) = false ];
string liabilities = 3 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
]; // For recording
string leveraged_lp_amount = 4 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
string position_health = 5 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
uint64 id = 6;
uint64 amm_pool_id = 7;
string stop_loss_price = 8 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
}

message QueryPosition {
Position position = 1;
string updated_leverage = 2 [
Expand Down
10 changes: 0 additions & 10 deletions proto/elys/stablestake/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,3 @@ message InterestBlock {
uint64 block_height = 3;
uint64 pool_id = 4;
}

message LegacyInterestBlock {
string interest_rate = 1 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
int64 block_time = 2;
uint64 block_height = 3;
}
16 changes: 3 additions & 13 deletions x/leveragelp/keeper/position.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,20 +359,10 @@ func (k Keeper) SetAllPositions(ctx sdk.Context) {
iterator := k.GetPositionIterator(ctx)

for ; iterator.Valid(); iterator.Next() {
var position types.LegacyPosition
var position types.Position
bytesValue := iterator.Value()
k.cdc.Unmarshal(bytesValue, &position)
k.SetPosition(ctx, &types.Position{
Id: position.Id,
Address: position.Address,
AmmPoolId: position.AmmPoolId,
Collateral: position.Collateral,
LeveragedLpAmount: position.LeveragedLpAmount,
PositionHealth: position.PositionHealth,
StopLossPrice: position.StopLossPrice,
Liabilities: position.Liabilities,
BorrowPoolId: stabletypes.PoolId,
})
position.BorrowPoolId = stabletypes.PoolId
k.SetPosition(ctx, &position)
}

Check warning on line 367 in x/leveragelp/keeper/position.go

View check run for this annotation

Codecov / codecov/patch

x/leveragelp/keeper/position.go#L358-L367

Added lines #L358 - L367 were not covered by tests
return
}
Loading

0 comments on commit 1f7621c

Please sign in to comment.