Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from CollinsMunene/multi-tenant-webhook
Browse files Browse the repository at this point in the history
feat:run code pnpm format
CollinsMunene authored Jan 21, 2025
2 parents fdd04d9 + ed9c82e commit 304ff41
Showing 3 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -114,5 +114,4 @@ export enum LifecycleError {

// To be thrown when a Quote has expired
QuoteExpired = 'QuoteExpired'

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LifecycleError, OutgoingPaymentError } from './errors'
import { LifecycleError } from './errors'
import {
OutgoingPayment,
OutgoingPaymentState,
@@ -20,7 +20,7 @@ export async function handleSending(
// Check if the current time is greater than or equal to when the Quote should be expiring
if (Date.now() >= payment.quote.expiresAt.getTime()) {
throw LifecycleError.QuoteExpired
}
}

const receiver = await deps.receiverService.get(payment.receiver)

Original file line number Diff line number Diff line change
@@ -1766,23 +1766,20 @@ describe('OutgoingPaymentService', (): void => {
const createdPayment = await setup({
receiver,
debitAmount,
method: 'ilp',
});
method: 'ilp'
})

// Test case for `expiresAt` in the past (greater than current time)
await createdPayment.quote.$query(knex).patch({
expiresAt: new Date(Date.now() - 60 * 60 * 1000), // 1 hour ago
});
expiresAt: new Date(Date.now() - 60 * 60 * 1000) // 1 hour ago
})

await processNext(
createdPayment.id,
OutgoingPaymentState.Failed,
LifecycleError.QuoteExpired
);

});


)
})
})

describe('fund', (): void => {

0 comments on commit 304ff41

Please sign in to comment.