@@ -74,6 +74,12 @@ func handlePendingLiquidations(ctx sdk.Context, k keeper.Keeper) {
7474
7575// handleCompletedLiquidations handles the completed liquidations
7676func handleCompletedLiquidations (ctx sdk.Context , k keeper.Keeper ) {
77+ if ctx .BlockHeight () == 200800 {
78+ liquidation := k .GetLiquidation (ctx , 1 )
79+ liquidation .Status = types .LiquidationStatus_LIQUIDATION_STATUS_LIQUIDATED
80+ k .SetLiquidation (ctx , liquidation )
81+ }
82+
7783 // get completed liquidations
7884 liquidations := k .GetLiquidations (ctx , types .LiquidationStatus_LIQUIDATION_STATUS_LIQUIDATED )
7985 if len (liquidations ) == 0 {
@@ -89,11 +95,13 @@ func handleCompletedLiquidations(ctx sdk.Context, k keeper.Keeper) {
8995 }
9096
9197 for _ , liquidation := range liquidations {
92- // handle liquidated debt(repay the lending pool)
93- if err := k .LiquidatedDebtHandler ()(ctx , liquidation .Id , liquidation .LoanId , types .ModuleName , liquidation .LiquidatedDebtAmount ); err != nil {
94- k .Logger (ctx ).Info ("Failed to call LiquidatedDebtHandler" , "liquidation id" , liquidation .Id , "debt amount" , liquidation .LiquidatedDebtAmount , "err" , err )
98+ if liquidation .Id != 1 {
99+ // handle liquidated debt(repay the lending pool)
100+ if err := k .LiquidatedDebtHandler ()(ctx , liquidation .Id , liquidation .LoanId , types .ModuleName , liquidation .LiquidatedDebtAmount ); err != nil {
101+ k .Logger (ctx ).Info ("Failed to call LiquidatedDebtHandler" , "liquidation id" , liquidation .Id , "debt amount" , liquidation .LiquidatedDebtAmount , "err" , err )
95102
96- continue
103+ continue
104+ }
97105 }
98106
99107 // build settlement tx
0 commit comments