From 030176e132ee8efdeb6b855bb24a6a4fafe3c802 Mon Sep 17 00:00:00 2001 From: Connor Barr Date: Wed, 3 Jul 2024 12:18:13 +0100 Subject: [PATCH] chore: claim fuzz operation cleanup --- .../src/tests/e2e/cases/test_fuzz.rs | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/contracts/sumtree-orderbook/src/tests/e2e/cases/test_fuzz.rs b/contracts/sumtree-orderbook/src/tests/e2e/cases/test_fuzz.rs index 620463c..f1114b1 100644 --- a/contracts/sumtree-orderbook/src/tests/e2e/cases/test_fuzz.rs +++ b/contracts/sumtree-orderbook/src/tests/e2e/cases/test_fuzz.rs @@ -430,23 +430,16 @@ impl MixedFuzzOperation { }; // Claim the order - match orders::claim_and_assert_balance(t, claimant, &username, tick_id, order_id) { - Ok(_) => { - let order = t.contract.get_order( - t.accounts[&username].address(), - tick_id, - order_id, - ); - if order.is_none() { - // Remove the order once we know its claimable - orders.remove(&order_id).unwrap(); - } - Ok(true) - } - Err(e) => { - panic!("{e}") - } + orders::claim_and_assert_balance(t, claimant, &username, tick_id, order_id) + .unwrap(); + let order = + t.contract + .get_order(t.accounts[&username].address(), tick_id, order_id); + if order.is_none() { + // Remove the order once we know its claimable + orders.remove(&order_id).unwrap(); } + Ok(true) } } }