Skip to content

Commit

Permalink
Fix to received funds check, tests broken
Browse files Browse the repository at this point in the history
  • Loading branch information
crnbarr93 committed Mar 1, 2024
1 parent cf8f06a commit ada9f1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contracts/orderbook/src/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ pub fn place_limit(
// 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
let received = must_pay(&info, &expected_denom)?;
let expected_amount = amount_to_value(order_direction, quantity, tick_to_price(tick_id)?)?;
ensure_eq!(
received,
quantity,
expected_amount,
ContractError::InsufficientFunds {
sent: received,
required: quantity,
required: expected_amount,
}
);

Expand Down

0 comments on commit ada9f1f

Please sign in to comment.