Skip to content

Commit

Permalink
Filter out orders which have 0 amount remaining (#5301)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Jan 31, 2024
1 parent 7f9834e commit b23fb29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/canisters/market_maker/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed

- Avoid usages of `make_c2c_call` and use macro instead ([#5252](https://github.com/open-chat-labs/open-chat/pull/5252))
- Filter out orders which have 0 amount remaining ([#5301](https://github.com/open-chat-labs/open-chat/pull/5301))

## [[2.0.999](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.999-market_maker)] - 2024-01-05

Expand Down
7 changes: 6 additions & 1 deletion backend/libraries/icdex_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ impl<M: Fn(MakeOrderRequest), C: Fn(CancelOrderRequest)> ICDexClient<M, C> {

let orders = icdex_canister_c2c_client::pending(self.dex_canister_id, args).await?.0;

Ok(orders.data.into_iter().map(|(_, o)| self.convert_order(o)).collect())
Ok(orders
.data
.into_iter()
.map(|(_, o)| self.convert_order(o))
.filter(|o| o.amount > 0)
.collect())
}

pub async fn orderbook(&self) -> CallResult<AggregatedOrders> {
Expand Down

0 comments on commit b23fb29

Please sign in to comment.