Skip to content

Commit 582eacf

Browse files
authored
fix: /deposits, exclude pending deposits with amount 0 (#212)
* fix: /deposits, exclude pending deposits with amount 0 * Fix * Fix tests * Update service.ts
1 parent 683d72d commit 582eacf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: src/modules/deposit/service.ts

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export class DepositService {
9797
[deposits, total] = await this.depositRepository
9898
.createQueryBuilder("d")
9999
.where("d.status = :status", { status })
100+
.andWhere("d.amount > 0")
100101
.andWhere("d.depositDate > NOW() - INTERVAL '1 days'")
101102
.andWhere(`d.depositRelayerFeePct * :multiplier >= d.suggestedRelayerFeePct`, {
102103
multiplier: this.appConfig.values.suggestedFees.deviationBufferMultiplier,

Diff for: test/deposit.e2e-spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ describe("GET /deposits", () => {
2525
// filled deposits with depositIds 10 - 19 and ascending depositDate
2626
const FILLED_DEPOSITS = mockManyDepositEntities(10, {
2727
depositIdStartIndex: 10,
28-
overrides: { status: "filled", depositorAddr: depositorAddress },
28+
overrides: { status: "filled", depositorAddr: depositorAddress, amount: "10", filled: "10" },
2929
});
3030
// pending deposits with depositIds 20 - 29 and ascending depositDate
3131
const PENDING_DEPOSITS = mockManyDepositEntities(10, {
3232
depositIdStartIndex: 20,
33-
overrides: { status: "pending", depositorAddr: depositorAddress },
33+
overrides: { status: "pending", depositorAddr: depositorAddress, amount: "10" },
3434
});
3535

3636
beforeAll(async () => {

0 commit comments

Comments
 (0)