This commit is contained in:
boufni95 2025-11-26 17:22:13 +00:00
parent 8e3198f3e7
commit fe098c9e3e
3 changed files with 7 additions and 8 deletions

View file

@ -28,7 +28,6 @@ const testSuccessfulExternalPayment = async (T: TestBase) => {
T.d("user1 balance is now 1490 (2000 - (500 + 10fee))") T.d("user1 balance is now 1490 (2000 - (500 + 10fee))")
expect(owner.balance_sats).to.be.equal(9) expect(owner.balance_sats).to.be.equal(9)
T.d("app balance is 9 sats") T.d("app balance is 9 sats")
} }
const testFailedExternalPayment = async (T: TestBase) => { const testFailedExternalPayment = async (T: TestBase) => {
@ -41,11 +40,11 @@ const testFailedExternalPayment = async (T: TestBase) => {
await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application), "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") T.d("payment failed as expected, with the expected error message")
const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId) const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId)
expect(u1.balance_sats).to.be.equal(1496) expect(u1.balance_sats).to.be.equal(1490)
T.d("user1 balance is still 1496") T.d("user1 balance is still 1490")
const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id)
expect(owner.balance_sats).to.be.equal(3) expect(owner.balance_sats).to.be.equal(9)
T.d("app balance is still 3 sats") T.d("app balance is still 9 sats")
} }
const testSuccesfulReceivedExternalChainPayment = async (T: TestBase) => { const testSuccesfulReceivedExternalChainPayment = async (T: TestBase) => {

View file

@ -45,6 +45,6 @@ const testOutboundPaymentFromProvider = async (T: TestBase, bootstrapped: Main,
T.expect(userBalance.balance).to.equal(988) // 3000 - (2000 + 12) T.expect(userBalance.balance).to.equal(988) // 3000 - (2000 + 12)
const providerBalance = await bootstrapped.liquidityProvider.GetLatestBalance() const providerBalance = await bootstrapped.liquidityProvider.GetLatestBalance()
T.expect(providerBalance).to.equal(998) // 3000 - (2000 + 12) T.expect(providerBalance).to.equal(988) // 3000 - (2000 + 12)
T.d("testOutboundPaymentFromProvider done") T.d("testOutboundPaymentFromProvider done")
} }

View file

@ -37,7 +37,7 @@ const testSpamExternalPayment = async (T: TestBase) => {
const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id)
expect(u.balance_sats).to.be.equal(470) expect(u.balance_sats).to.be.equal(470)
T.d("user1 balance is now 470 (2000 - (500 + 10 fee) * 3)") T.d("user1 balance is now 470 (2000 - (500 + 10 fee) * 3)")
expect(owner.balance_sats).to.be.equal(9) expect(owner.balance_sats).to.be.equal(27)
T.d("app balance is 9 sats") T.d("app balance is 27 sats")
} }