This commit is contained in:
boufni95 2025-03-10 22:59:04 +00:00
parent edd7476af1
commit 3cc66f4cc4
5 changed files with 3 additions and 4 deletions

View file

@ -337,7 +337,6 @@ class StorageProcessor {
private async handleFindOne(operation: FindOneOperation<any>) {
const manager = this.getManager(operation.txId);
console.log(operation.q.where)
const res = await manager.getRepository(MainDbEntities[operation.entity]).findOne(operation.q)
this.sendResponse({

View file

@ -4,7 +4,6 @@ export const ignore = false
export const dev = false
export default async (T: TestBase) => {
T.main.storage.dbs.setDebug(true)
await safelySetUserBalance(T, T.user1, 2000)
await openAdminChannel(T)
await runSanityCheck(T)

View file

@ -36,7 +36,7 @@ const testFailedExternalPayment = async (T: TestBase) => {
expect(invoice.payRequest).to.startWith("lnbcrt15u")
T.d("generated 1500 sats invoice for external node")
await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application), "Error: not enough balance to decrement")
await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application), "not enough balance to decrement")
T.d("payment failed as expected, with the expected error message")
const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId)
expect(u1.balance_sats).to.be.equal(1496)

View file

@ -35,7 +35,7 @@ const testFailedInternalPayment = async (T: TestBase) => {
const invoice = await T.main.paymentManager.NewInvoice(T.user2.userId, { amountSats: 1000, memo: "test" }, { linkedApplication: application, expiry: defaultInvoiceExpiry })
expect(invoice.invoice).to.startWith("lnbcrt10u")
T.d("generated 1000 sats invoice for user2")
await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.invoice, amount: 0 }, application), "Error: not enough balance to decrement")
await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.invoice, amount: 0 }, application), "not enough balance to decrement")
T.d("payment failed as expected, with the expected error message")
}

View file

@ -27,6 +27,7 @@ const testSpamExternalPayment = async (T: TestBase) => {
const successfulPayments = res.filter(r => r.success)
const failedPayments = res.filter(r => !r.success)
console.log(failedPayments)
failedPayments.forEach(f => expect(f.err).to.be.equal("Error: not enough balance to decrement"))
successfulPayments.forEach(s => expect(s.result).to.contain({ amount_paid: 500, network_fee: 1, service_fee: 3 }))
expect(successfulPayments.length).to.be.equal(3)