Skip to content

Commit

Permalink
add unit tests for fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpinYukseloglu committed Jun 26, 2024
1 parent 4ff608d commit 81f6410
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions contracts/sumtree-orderbook/src/tests/test_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2773,6 +2773,20 @@ fn test_claim_order() {
.unwrap();
}

// Ensure that a claimable order cannot be cancelled
if test.expected_error.is_none() {
let mut info_with_sender = info.clone();
info_with_sender.sender = sender.clone();
let res = cancel_limit(
deps.as_mut(),
env.clone(),
info_with_sender.clone(),
test.tick_id,
test.order_id,
);
assert_eq!(res, Err(ContractError::CancelFilledOrder));
}

// Claim designated order
let res = claim_limit(
deps.as_mut(),
Expand Down

0 comments on commit 81f6410

Please sign in to comment.