From 81f64107d7bb4dc66b670ffad7408fc4fc83221e Mon Sep 17 00:00:00 2001 From: alpo Date: Wed, 26 Jun 2024 15:11:03 -0700 Subject: [PATCH] add unit tests for fix --- .../sumtree-orderbook/src/tests/test_order.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/contracts/sumtree-orderbook/src/tests/test_order.rs b/contracts/sumtree-orderbook/src/tests/test_order.rs index 485f99d..c831702 100644 --- a/contracts/sumtree-orderbook/src/tests/test_order.rs +++ b/contracts/sumtree-orderbook/src/tests/test_order.rs @@ -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(),