Skip to content

Commit

Permalink
expose test-only setup fn
Browse files Browse the repository at this point in the history
  • Loading branch information
0xxgen1 committed Jul 23, 2024
1 parent 07b0db1 commit ee4f962
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion contracts/sources/lending_market.move
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,36 @@ module suilend::lending_market {
}

#[test_only]
fun setup(reserve_args: Bag, scenario: &mut Scenario): State {
public fun new_args(initial_deposit: u64): ReserveArgs {
use suilend::reserve_config::{Self};

ReserveArgs {
config: reserve_config::default_reserve_config(),
initial_deposit,
}
}

#[test_only]
public fun destruct_state(state: State): (
Clock,
LendingMarketOwnerCap<LENDING_MARKET>,
LendingMarket<LENDING_MARKET>,
PriceState,
Bag
) {
let State {
clock,
owner_cap,
lending_market,
prices,
type_to_index,
} = state;

(clock, owner_cap, lending_market, prices, type_to_index)
}

#[test_only]
public fun setup(reserve_args: Bag, scenario: &mut Scenario): State {
use suilend::test_usdc::{TEST_USDC};
use suilend::test_sui::{TEST_SUI};
use suilend::reserve_config::{Self};
Expand Down

0 comments on commit ee4f962

Please sign in to comment.