Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leecchh committed Oct 18, 2024
1 parent f417ac7 commit 7f0cde8
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions packages/deepbook/tests/pool_tests.move
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,17 @@ fun test_place_order_bid() {

#[test]
fun test_update_pool_book_params_ok() {
test_update_pool_book_params(true);
test_update_pool_book_params(0);
}

#[test, expected_failure(abort_code = ::deepbook::order_info::EOrderInvalidLotSize)]
fun test_update_pool_book_params_e() {
test_update_pool_book_params(false);
fun test_update_pool_book_params_trade_e() {
test_update_pool_book_params(1);
}

#[test, expected_failure(abort_code = ::deepbook::pool::EInvalidLotSize)]
fun test_update_pool_book_params_update_e() {
test_update_pool_book_params(2);
}

#[test]
Expand Down Expand Up @@ -4908,7 +4913,7 @@ fun test_cancel_orders(is_bid: bool) {
}

fun test_update_pool_book_params(
is_ok: bool,
error: u8,
){
let mut test = begin(OWNER);
let registry_id = setup_test(OWNER, &mut test);
Expand Down Expand Up @@ -4946,7 +4951,8 @@ fun test_update_pool_book_params(
expire_timestamp,
&mut test,
);
if (is_ok) {

if (error == 0) {
adjust_min_lot_size_admin<SUI, USDC>(
OWNER,
pool_id,
Expand All @@ -4956,6 +4962,16 @@ fun test_update_pool_book_params(
);
};

if (error == 2){
adjust_min_lot_size_admin<SUI, USDC>(
OWNER,
pool_id,
600,
6000,
&mut test,
);
};

place_limit_order<SUI, USDC>(
ALICE,
pool_id,
Expand Down

0 comments on commit 7f0cde8

Please sign in to comment.