From 6ce5e83de2ec7f2756c8d99646a2ba5e9bb5ce6b Mon Sep 17 00:00:00 2001 From: Connor Barr Date: Sun, 18 Feb 2024 15:38:57 +0000 Subject: [PATCH] Shortened get_expected_denom name --- contracts/orderbook/src/order.rs | 4 ++-- contracts/orderbook/src/types/orderbook.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/orderbook/src/order.rs b/contracts/orderbook/src/order.rs index dd63467..55b2a17 100644 --- a/contracts/orderbook/src/order.rs +++ b/contracts/orderbook/src/order.rs @@ -35,7 +35,7 @@ pub fn place_limit( ); // Determine the correct denom based on order direction - let expected_denom = orderbook.get_expected_denom_for_direction(&order_direction); + let expected_denom = orderbook.get_expected_denom(&order_direction); // Verify the funds sent with the message match the `quantity` for the correct denom // We reject any quantity that is not exactly equal to the amount in the limit order being placed @@ -123,7 +123,7 @@ pub fn cancel_limit( })?; // Generate refund - let expected_denom = orderbook.get_expected_denom_for_direction(&order.order_direction); + let expected_denom = orderbook.get_expected_denom(&order.order_direction); let refund_msg = SubMsg::reply_on_error( BankMsg::Send { to_address: order.owner.to_string(), diff --git a/contracts/orderbook/src/types/orderbook.rs b/contracts/orderbook/src/types/orderbook.rs index c9482d9..b5df767 100644 --- a/contracts/orderbook/src/types/orderbook.rs +++ b/contracts/orderbook/src/types/orderbook.rs @@ -36,7 +36,7 @@ impl Orderbook { /// Get the expected denomination for a given order direction. #[inline] - pub fn get_expected_denom_for_direction(&self, order_direction: &OrderDirection) -> String { + pub fn get_expected_denom(&self, order_direction: &OrderDirection) -> String { match order_direction { OrderDirection::Bid => self.quote_denom.clone(), OrderDirection::Ask => self.base_denom.clone(),