Skip to content

Commit

Permalink
fix: cancel cash out bug (#1213)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinenerio authored Jan 6, 2024
1 parent 5a2764a commit 577104f
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class OffRampOrderService implements Disposable {
final query = _db.select(_db.offRampOrderRows)
..where(
(tbl) => tbl.status.equalsValue(OffRampOrderStatus.completed).not(),
)
..where(
(tbl) => tbl.status.equalsValue(OffRampOrderStatus.cancelled).not(),
);

return query
Expand Down Expand Up @@ -164,12 +167,7 @@ class OffRampOrderService implements Disposable {

switch (order.status) {
case OffRampOrderStatus.depositError:
await updateQuery.write(
const OffRampOrderRowsCompanion(
status: Value(OffRampOrderStatus.cancelled),
),
);

await updateQuery.write(_cancelled);
case OffRampOrderStatus.depositTxRequired:
case OffRampOrderStatus.creatingDepositTx:
case OffRampOrderStatus.depositTxReady:
Expand Down Expand Up @@ -277,7 +275,6 @@ class OffRampOrderService implements Disposable {
),
);
case OffRampOrderStatus.cancelled:
return Stream.fromIterable([_cancelled]);
case OffRampOrderStatus.failure:
case OffRampOrderStatus.completed:
_subscriptions[orderId]?.cancel();
Expand Down

0 comments on commit 577104f

Please sign in to comment.