Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a8a4a9b
feat(generic_logic): add test helper functions for directional roundi…
matchv Oct 21, 2025
64f21a3
feat(pool_logic): add test helper function for interest rate update t…
matchv Oct 21, 2025
efa160a
feat(a_token_factory): add test helper function for liquidation trans…
matchv Oct 21, 2025
1d692ab
test(directional_rounding): add test_ray_mul_down_boundary
matchv Oct 21, 2025
07a57b0
test(directional_rounding): add test_ray_mul_up_boundary
matchv Oct 21, 2025
900d968
test(directional_rounding): add test_ray_div_down_boundary
matchv Oct 21, 2025
8070932
test(directional_rounding): add test_ray_div_up_boundary
matchv Oct 21, 2025
f6db97d
test(directional_rounding): add test_directional_consistency
matchv Oct 21, 2025
3240bf6
test(directional_rounding): add test_ceil_div_small_debt
matchv Oct 21, 2025
7b5afc7
test(directional_rounding): add test_mint_scaled_with_rounding_down
matchv Oct 21, 2025
8792485
test(directional_rounding): add test_mint_scaled_with_rounding_up
matchv Oct 21, 2025
8223636
test(directional_rounding): add test_mint_burn_cycle_atoken
matchv Oct 21, 2025
7a1d0b5
test(directional_rounding): add test_dust_amount_mint_burn
matchv Oct 21, 2025
099104a
test(directional_rounding): add test_mint_to_treasury_normal_amount
matchv Oct 21, 2025
7da7d37
test(directional_rounding): add test_atoken_total_supply_direction
matchv Oct 21, 2025
3d6845c
test(directional_rounding): add test_mint_to_treasury_dust_handling
matchv Oct 21, 2025
b6568be
test(directional_rounding): add test_mint_to_treasury_zero_amount
matchv Oct 21, 2025
6fa5e4a
test(directional_rounding): add test_atoken_balance_never_overestimated
matchv Oct 21, 2025
9d856e0
test(directional_rounding): add test_atoken_mint_direction
matchv Oct 21, 2025
4b4e496
test(directional_rounding): add test_atoken_burn_direction
matchv Oct 21, 2025
45c0f42
test(directional_rounding): enhance test_mint_to_treasury_double_cons…
matchv Oct 21, 2025
f0a2163
test(directional_rounding): add test_transfer_on_liquidation_dust
matchv Oct 21, 2025
9cb8f63
test(directional_rounding): add test_vtoken_balance_of_direction
matchv Oct 21, 2025
df15dd1
test(directional_rounding): add test_vtoken_balance_never_underestimated
matchv Oct 21, 2025
8dfba39
test(directional_rounding): add test_small_debt_visibility
matchv Oct 21, 2025
a75eacb
test(directional_rounding): add test_vtoken_mint_uses_ray_div_up
matchv Oct 21, 2025
8b5d284
test(directional_rounding): add test_vtoken_burn_uses_ray_div_down
matchv Oct 21, 2025
bde225f
test(directional_rounding): add test_treasury_accrual_uses_ray_div_down
matchv Oct 21, 2025
c10b683
test(directional_rounding): add test_treasury_never_overaccrue
matchv Oct 21, 2025
1797259
test(directional_rounding): enhance test_interest_rate_input_uses_ray…
matchv Oct 21, 2025
0e1bee9
test(directional_rounding): add test_treasury_accrual_consistency
matchv Oct 21, 2025
adfd9e9
test(directional_rounding): add test_debt_for_interest_rate_conservative
matchv Oct 21, 2025
4fa97ff
test(directional_rounding): add test_small_debt_not_zero_issue2
matchv Oct 21, 2025
51fe305
test(directional_rounding): add test_debt_collateral_asymmetry
matchv Oct 21, 2025
dbcd4f6
refactor(directional_rounding): rewrite test_withdraw_balance_uses_ra…
matchv Oct 21, 2025
5a07aa6
test(directional_rounding): add test_borrow_mints_debt_conservatively
matchv Oct 21, 2025
46a6621
test(directional_rounding): add test_repay_burns_debt_conservatively
matchv Oct 21, 2025
a28f420
test(directional_rounding): add test_liquidation_amount_accuracy
matchv Oct 21, 2025
669436b
test(directional_rounding): add test_flashloan_liquidity_uses_ray_mul…
matchv Oct 21, 2025
3b0dcf6
test(directional_rounding): add test_full_supply_borrow_cycle_directi…
matchv Oct 21, 2025
4129fea
test(directional_rounding): add test_cross_module_consistency
matchv Oct 21, 2025
9ec90a0
test(directional_rounding): add test_long_term_accuracy_simulation
matchv Oct 21, 2025
568431d
test(directional_rounding): add test_no_arbitrage_opportunity
matchv Oct 21, 2025
111b1f2
test(directional_rounding): add test_edge_cases_robustness
matchv Oct 21, 2025
ef67100
Merge branch 'main' into mike/test/directional-rounding
matchv Oct 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions aave-core/sources/aave-logic/generic_logic.move
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,26 @@ module aave_pool::generic_logic {

available_borrows_in_base_currency - total_debt_in_base_currency
}

#[test_only]
/// Test helper function that exposes get_user_debt_in_base_currency for testing
public fun get_user_debt_in_base_currency_for_testing(
user: address,
reserve_data: Object<ReserveData>,
asset_price: u256,
asset_unit: u256
): u256 {
get_user_debt_in_base_currency(user, reserve_data, asset_price, asset_unit)
}

#[test_only]
/// Test helper function that exposes get_user_balance_in_base_currency for testing
public fun get_user_balance_in_base_currency_for_testing(
user: address,
reserve_data: Object<ReserveData>,
asset_price: u256,
asset_unit: u256
): u256 {
get_user_balance_in_base_currency(user, reserve_data, asset_price, asset_unit)
}
}
18 changes: 18 additions & 0 deletions aave-core/sources/aave-pool/pool_logic.move
Original file line number Diff line number Diff line change
Expand Up @@ -473,4 +473,22 @@ module aave_pool::pool_logic {
reserve_last_update_timestamp: 0
}
}

#[test_only]
/// Test helper function that exposes update_interest_rates_and_virtual_balance for testing
public fun update_interest_rates_and_virtual_balance_for_testing(
reserve_data: Object<ReserveData>,
reserve_cache: &ReserveCache,
reserve_address: address,
liquidity_added: u256,
liquidity_taken: u256
) {
update_interest_rates_and_virtual_balance(
reserve_data,
reserve_cache,
reserve_address,
liquidity_added,
liquidity_taken
)
}
}
12 changes: 12 additions & 0 deletions aave-core/sources/aave-tokens/a_token_factory.move
Original file line number Diff line number Diff line change
Expand Up @@ -746,4 +746,16 @@ module aave_pool::a_token_factory {
public fun assert_token_exists_for_testing(metadata_address: address) acquires TokenMap {
assert_token_exists(metadata_address);
}

#[test_only]
/// Test helper function that exposes transfer_on_liquidation for testing
public fun transfer_on_liquidation_for_testing(
from: address,
to: address,
amount: u256,
index: u256,
metadata_address: address
) acquires TokenMap {
transfer_on_liquidation(from, to, amount, index, metadata_address)
}
}
Loading
Loading