Skip to content

Commit

Permalink
Renamed fulfill method
Browse files Browse the repository at this point in the history
  • Loading branch information
crnbarr93 committed Feb 22, 2024
1 parent 206b15d commit 09c898a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts/orderbook/src/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ pub fn resolve_fulfillments(
// TODO: Add price detection for tick
let msg = fulfillment
.order
.fulfill(&denom, fulfillment.amount, Decimal::one())?;
.fill(&denom, fulfillment.amount, Decimal::one())?;
msgs.push(msg);
if fulfillment.order.quantity.is_zero() {
orders().remove(
Expand Down
2 changes: 1 addition & 1 deletion contracts/orderbook/src/tests/test_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ fn test_resolve_fulfillments() {
// Check message is generated as expected
let mut order = order.clone();
let denom = orderbook.get_expected_denom(&order.order_direction);
let msg = order.fulfill(denom, *amount, Decimal::one()).unwrap();
let msg = order.fill(denom, *amount, Decimal::one()).unwrap();

assert_eq!(response[idx], msg, "{}", format_test_name(test.name));
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/orderbook/src/types/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl LimitOrder {
}

// Transfers the specified quantity of the order's asset to the owner
pub fn fulfill(
pub fn fill(
&mut self,
denom: impl Into<String>,
quantity: Uint128,
Expand All @@ -56,7 +56,7 @@ impl LimitOrder {
reason: Some("Order does not have enough funds".to_string())
}
);
self.quantity = self.quantity.checked_sub(quantity.min(self.quantity))?;
self.quantity = self.quantity.checked_sub(quantity)?;
Ok(BankMsg::Send {
to_address: self.owner.to_string(),
amount: vec![coin(
Expand Down

0 comments on commit 09c898a

Please sign in to comment.