Skip to content

Commit d3e067c

Browse files
committed
fix workflow tests
1 parent c938976 commit d3e067c

11 files changed

Lines changed: 8 additions & 56 deletions

File tree

common/proxies/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ edition = "2021"
66

77
[lib]
88
path = "src/mod.rs"
9+
doctest = false
910

1011
[dependencies.multiversx-sc]
1112
version = "0.57.0"

controller/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ publish = false
77

88
[lib]
99
path = "src/lib.rs"
10+
doctest = false
1011

1112
[dependencies.multiversx-sc-modules]
1213
version = "0.57.0"

controller/tests/borrow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use multiversx_sc::types::{
44
};
55
use multiversx_sc_scenario::{
66
api::StaticApi,
7-
imports::{BigUint, OptionalValue, TestAddress, TestTokenIdentifier},
7+
imports::{BigUint, OptionalValue, TestAddress},
88
};
99
pub mod constants;
1010
pub mod proxys;

controller/tests/liquidations.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ fn liquidate_multiple_debt_positions_sequential_success() {
140140

141141
// Verify position health improved
142142
let final_borrowed = state.get_total_borrow_in_egld(2);
143-
let final_health = state.get_account_health_factor(2);
144143
assert!(final_borrowed < borrowed);
145144
}
146145

@@ -269,7 +268,6 @@ fn liquidate_bulk_multiple_assets_with_overpayment_success() {
269268

270269
// Verify final position state
271270
let final_borrowed = state.get_total_borrow_in_egld(2);
272-
let final_health = state.get_account_health_factor(2);
273271
assert!(final_borrowed < borrowed);
274272
}
275273

@@ -595,8 +593,6 @@ fn liquidate_single_asset_position_high_interest_success() {
595593
// Verify initial state
596594
let borrowed = state.get_total_borrow_in_egld(2);
597595
let collateral = state.get_total_collateral_in_egld(2);
598-
let utilization = state.get_market_utilization(state.egld_market.clone());
599-
let health_factor = state.get_account_health_factor(2);
600596

601597
assert!(borrowed > ManagedDecimal::from_raw_units(BigUint::from(0u64), RAY_PRECISION));
602598
assert!(collateral > ManagedDecimal::from_raw_units(BigUint::from(0u64), RAY_PRECISION));
@@ -692,11 +688,6 @@ fn liquidate_severe_undercollateralization_bad_debt_success() {
692688
markets.push(EgldOrEsdtTokenIdentifier::esdt(USDC_TOKEN));
693689
state.update_markets(&supplier, markets.clone());
694690

695-
// Check health before liquidation
696-
let health = state.get_account_health_factor(2);
697-
let borrow_amount = state.get_total_borrow_in_egld(2);
698-
let collateral_amount = state.get_total_collateral_in_egld(2);
699-
700691
// Attempt liquidation with large amount
701692
state.liquidate_account(
702693
&liquidator,

controller/tests/supply.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use controller::{
66
use multiversx_sc::types::{EsdtTokenPayment, ManagedVec};
77
use multiversx_sc_scenario::{
88
api::StaticApi,
9-
imports::{BigUint, OptionalValue, TestAddress, TestTokenIdentifier},
9+
imports::{BigUint, OptionalValue, TestAddress},
1010
};
1111
pub mod constants;
1212
pub mod proxys;

controller/tests/tests.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use controller::{
44
AccountAttributes, PositionMode, ERROR_HEALTH_FACTOR_WITHDRAW,
55
ERROR_INVALID_LIQUIDATION_THRESHOLD, ERROR_UN_SAFE_PRICE_NOT_ALLOWED,
66
};
7-
use multiversx_sc::sc_print;
87
use multiversx_sc::types::{
98
EgldOrEsdtTokenIdentifier, ManagedDecimal, ManagedOption, MultiValueEncoded,
109
};
@@ -183,9 +182,6 @@ fn edge_case_overpayment_reserve_accumulation() {
183182
state.change_timestamp(1111u64);
184183
state.update_markets(&supplier, markets.clone());
185184

186-
let borrowed = state.get_borrow_amount_for_token(1, EGLD_TOKEN);
187-
let collateral = state.get_collateral_amount_for_token(1, EGLD_TOKEN);
188-
let revenue = state.get_market_revenue(state.egld_market.clone());
189185
let reserves = state.get_market_reserves(state.egld_market.clone());
190186

191187
// Verify initial reserves are zero
@@ -209,7 +205,6 @@ fn edge_case_overpayment_reserve_accumulation() {
209205

210206
// Check reserves accumulated from overpayment
211207
let collateral_after = state.get_collateral_amount_for_token(1, EGLD_TOKEN);
212-
let utilization_after = state.get_market_utilization(state.egld_market.clone());
213208
let revenue_after = state.get_market_revenue(state.egld_market.clone());
214209
let reserves_after = state.get_market_reserves(state.egld_market.clone());
215210

@@ -396,9 +391,6 @@ fn market_complete_exit_multi_user() {
396391

397392
// Owner withdraws remaining funds
398393
let supplied_collateral = state.get_collateral_amount_for_token(3, EGLD_TOKEN);
399-
let reserves = state.get_market_reserves(state.egld_market.clone());
400-
let revenue = state.get_market_revenue(state.egld_market.clone());
401-
402394
state.withdraw_asset_den(
403395
&OWNER_ADDRESS,
404396
EGLD_TOKEN,
@@ -473,10 +465,6 @@ fn interest_accrual_long_term_high_utilization() {
473465
let mut markets = MultiValueEncoded::new();
474466
markets.push(EgldOrEsdtTokenIdentifier::esdt(EGLD_TOKEN));
475467

476-
// Check initial market state
477-
let utilization = state.get_market_utilization(state.egld_market.clone());
478-
let borrow_rate = state.get_market_borrow_rate(state.egld_market.clone());
479-
480468
// Advance one year
481469
state.change_timestamp(SECONDS_PER_YEAR);
482470
state.update_markets(&supplier, markets.clone());
@@ -498,8 +486,6 @@ fn interest_accrual_long_term_high_utilization() {
498486

499487
// Verify final state
500488
let final_supply_after_repay = state.get_collateral_amount_for_token(1, EGLD_TOKEN);
501-
let reserves = state.get_market_reserves(state.egld_market.clone());
502-
let revenue = state.get_market_revenue(state.egld_market.clone());
503489

504490
// Supply should have grown from interest
505491
assert!(final_supply_after_repay > initial_supply);

controller/tests/views.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ fn views_liquidation_estimation_unhealthy_position() {
208208
));
209209

210210
// Get liquidation estimations
211-
let (seized_collaterals, protocol_fees, refunds, max_egld_payment, bonus_rate) =
211+
let (seized_collaterals, protocol_fees, _, max_egld_payment, bonus_rate) =
212212
state.liquidation_estimations(2, debt_payments);
213213

214214
// Verify estimations

controller/tests/withdraw.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,6 @@ fn withdraw_single_user_supply_borrow_full_cycle() {
222222
state.change_timestamp(1740275066);
223223
state.update_markets(&supplier, markets.clone());
224224

225-
// Get balances after interest accrual
226-
let initial_collateral = state.get_collateral_amount_for_token(1, EGLD_TOKEN);
227-
let initial_borrow = state.get_borrow_amount_for_token(1, EGLD_TOKEN);
228-
229225
// Repay exact borrow amount with interest
230226
state.repay_asset_deno(
231227
&supplier,
@@ -234,12 +230,6 @@ fn withdraw_single_user_supply_borrow_full_cycle() {
234230
1,
235231
);
236232

237-
// Check market state after repayment
238-
let reserve = state.get_market_reserves(state.egld_market.clone());
239-
let revenue = state.get_market_revenue(state.egld_market.clone());
240-
let borrow_index = state.get_market_borrow_index(state.egld_market.clone());
241-
let supply_index = state.get_market_supply_index(state.egld_market.clone());
242-
243233
state.change_timestamp(1740275594);
244234
state.update_markets(&supplier, markets.clone());
245235

@@ -255,10 +245,6 @@ fn withdraw_single_user_supply_borrow_full_cycle() {
255245
);
256246

257247
state.update_markets(&supplier, markets.clone());
258-
259-
// Verify final market state
260-
let final_reserve = state.get_market_reserves(state.egld_market.clone());
261-
let final_revenue = state.get_market_revenue(state.egld_market.clone());
262248
}
263249

264250
/// Tests withdrawal with prior market index update to ensure proper accounting.
@@ -306,7 +292,6 @@ fn withdraw_with_prior_index_update_success() {
306292
state.update_markets(&supplier, markets.clone());
307293

308294
// Get current positions
309-
let initial_collateral = state.get_collateral_amount_for_token(1, EGLD_TOKEN);
310295
let initial_borrow = state.get_borrow_amount_for_token(1, EGLD_TOKEN);
311296

312297
// Repay full borrow amount
@@ -320,13 +305,6 @@ fn withdraw_with_prior_index_update_success() {
320305
// Update markets after repayment
321306
state.update_markets(&supplier, markets.clone());
322307

323-
// Record market state
324-
let reserve = state.get_market_reserves(state.egld_market.clone());
325-
let revenue = state.get_market_revenue(state.egld_market.clone());
326-
let total_deposit = state.get_market_supplied(state.egld_market.clone());
327-
let borrow_index = state.get_market_borrow_index(state.egld_market.clone());
328-
let supply_index = state.get_market_supply_index(state.egld_market.clone());
329-
330308
state.change_timestamp(1740275594);
331309

332310
// Update markets twice to ensure proper synchronization
@@ -336,21 +314,13 @@ fn withdraw_with_prior_index_update_success() {
336314
// Get final collateral after all updates
337315
let final_collateral = state.get_collateral_amount_for_token(1, EGLD_TOKEN);
338316

339-
// Calculate expected difference
340-
let diff = (reserve.clone().into_signed() - final_collateral.clone().into_signed())
341-
- revenue.clone().into_signed();
342-
343317
// Withdraw full collateral
344318
state.withdraw_asset_den(
345319
&supplier,
346320
EGLD_TOKEN,
347321
final_collateral.into_raw_units().clone(),
348322
1,
349323
);
350-
351-
// Verify final reserves and revenue
352-
let final_reserve = state.get_market_reserves(state.egld_market.clone());
353-
let final_revenue = state.get_market_revenue(state.egld_market.clone());
354324
}
355325

356326
/// Tests that withdrawal triggering self-liquidation is prevented.

flash_mock/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2021"
77

88
[lib]
99
path = "src/lib.rs"
10+
doctest = false
1011

1112
[dev-dependencies.multiversx-sc-scenario]
1213
version = "0.57.0"

liquidity_layer/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ publish = false
77

88
[lib]
99
path = "src/lib.rs"
10+
doctest = false
1011

1112
[dependencies.multiversx-sc]
1213
version = "0.57.0"

0 commit comments

Comments
 (0)