Skip to content

Commit

Permalink
return of orders
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Dec 7, 2023
1 parent 29107d2 commit 3041d1c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions contracts/cosmwasm/order/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ impl OrderContract<'_> {
self.orders
.range_raw(ctx.deps.storage, None, None, Order::Ascending)
.map(|r| r.map(|(_, order)| order))
.collect::<StdResult<Vec<OrderItem>>>()
.collect()
}

#[msg(query)]
Expand All @@ -384,8 +384,11 @@ impl OrderContract<'_> {
}

#[msg(query)]
pub fn get_all_drained_orders(&self, ctx: QueryCtx) -> StdResult<Vec<SolutionItem>> {
todo!()
pub fn get_all_tracked_orders(&self, ctx: QueryCtx) -> StdResult<Vec<TrackedOrderItem>> {
self.tracked_orders
.range_raw(ctx.deps.storage, None, None, Order::Ascending)
.map(|r| r.map(|(_, order)| order))
.collect()
}

/// (partially) fills orders.
Expand Down

0 comments on commit 3041d1c

Please sign in to comment.