Skip to content

Commit

Permalink
Shortened get_expected_denom name
Browse files Browse the repository at this point in the history
  • Loading branch information
crnbarr93 committed Feb 18, 2024
1 parent b550181 commit 6ce5e83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions contracts/orderbook/src/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion contracts/orderbook/src/types/orderbook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 6ce5e83

Please sign in to comment.