From 235d0f9a31b1650c5b8be724c4c0bfdf52b19824 Mon Sep 17 00:00:00 2001 From: Mateo Date: Fri, 19 Apr 2024 13:42:20 +0200 Subject: [PATCH] Reduce diff --- .../driver/src/tests/cases/internalization.rs | 8 ++------ .../src/tests/cases/order_prioritization.rs | 17 +++++++---------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/crates/driver/src/tests/cases/internalization.rs b/crates/driver/src/tests/cases/internalization.rs index 6b7f49f97e..19468dafbb 100644 --- a/crates/driver/src/tests/cases/internalization.rs +++ b/crates/driver/src/tests/cases/internalization.rs @@ -10,9 +10,7 @@ use crate::tests::{ async fn valid_internalization() { let test = setup() .pool(ab_pool()) - .order(ab_order() - .internalize() - ) + .order(ab_order().internalize()) // Marks "A" as trusted and hence OK to use for internalization. .trust("A") .solution(ab_solution()) @@ -31,9 +29,7 @@ async fn valid_internalization() { async fn untrusted_internalization() { let test = setup() .pool(ab_pool()) - .order(ab_order() - .internalize() - ) + .order(ab_order().internalize()) .solution(ab_solution()) // Note: does not mark "A" as trusted, despite the order being internalized. .done() diff --git a/crates/driver/src/tests/cases/order_prioritization.rs b/crates/driver/src/tests/cases/order_prioritization.rs index b53c83f0e0..51bd0bc972 100644 --- a/crates/driver/src/tests/cases/order_prioritization.rs +++ b/crates/driver/src/tests/cases/order_prioritization.rs @@ -13,23 +13,21 @@ use crate::{ #[tokio::test] #[ignore] async fn sorting() { - let base_order = ab_order(); let test = setup() .solvers(vec![ test_solver().fee_handler(FeeHandler::Driver) ]) .pool(ab_pool()) // Orders with better price ratios come first. - .order(base_order.clone()) - .order(base_order.clone().reduce_amount("1e-3".ether().into_wei()).rename("second order")) + .order(ab_order()) + .order(ab_order().reduce_amount("1e-3".ether().into_wei()).rename("second order")) // Limit orders come after market orders. .order( - base_order - .clone() + ab_order() .rename("third order") .limit() ) - .order(base_order.reduce_amount("1e-3".ether().into_wei()).rename("fourth order").limit()) + .order(ab_order().reduce_amount("1e-3".ether().into_wei()).rename("fourth order").limit()) .solution(ab_solution()) .done() .await; @@ -44,15 +42,14 @@ async fn sorting() { #[tokio::test] #[ignore] async fn filtering() { - let base_order = ab_order(); let test = setup() .pool(ab_pool()) // Orders with better price ratios come first. - .order(base_order.clone()) - .order(base_order.clone().reduce_amount("1e-3".ether().into_wei()).rename("second order")) + .order(ab_order()) + .order(ab_order().reduce_amount("1e-3".ether().into_wei()).rename("second order")) // Filter out the next order, because the trader doesn't have enough balance to cover it. .order( - base_order + ab_order() .rename("third order") .multiply_amount("0.1".ether().into_wei()) .filtered()