[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: balance accounting
From: |
gnunet |
Subject: |
[libeufin] branch master updated: balance accounting |
Date: |
Sat, 29 Jul 2023 09:11:48 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 4332cd27 balance accounting
4332cd27 is described below
commit 4332cd279ce2a330be7e84baac6685522606629c
Author: MS <ms@taler.net>
AuthorDate: Sat Jul 29 09:10:41 2023 +0200
balance accounting
avoiding passing DB objects as function arguments.
---
sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 12 ++++++------
sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt | 2 +-
sandbox/src/test/kotlin/BalanceTest.kt | 6 +++---
sandbox/src/test/kotlin/DBTest.kt | 1 +
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 0dc7b742..cd886e55 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -545,14 +545,14 @@ private suspend fun confirmWithdrawal(call:
ApplicationCall) {
logger.debug("Withdrawal ${wo.wopid} confirmed?
${wo.confirmationDone}")
if (!wo.confirmationDone) {
wireTransfer(
- debitAccount = wo.walletBankAccount,
- creditAccount = exchangeBankAccount,
+ debitAccount = wo.walletBankAccount.label,
+ creditAccount = exchangeBankAccount.label,
amount = wo.amount,
subject = wo.reservePub ?: throw internalServerError(
"Cannot transfer funds without reserve public key."
),
// provide the currency.
- demobank = ensureDemobank(call)
+ demobank = ensureDemobank(call).name
)
wo.confirmationDone = true
}
@@ -1347,9 +1347,9 @@ val sandboxApp: Application.() -> Unit = {
* of 'bankAccount' be correctly accessed. */
transaction {
wireTransfer(
- debitAccount = bankAccount,
- creditAccount = getBankAccountFromIban(payto.iban),
- demobank = bankAccount.demoBank,
+ debitAccount = bankAccount.label,
+ creditAccount =
getBankAccountFromIban(payto.iban).label,
+ demobank = bankAccount.demoBank.name,
subject = payto.message ?: throw badRequest(
"'message' query parameter missing in Payto
address"
),
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt
index 9a449f84..f867fca2 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt
@@ -160,7 +160,7 @@ fun wireTransfer(
}
// Book a CRDT and a DBIT transaction and return the unique reference thereof.
-fun wireTransfer(
+private fun wireTransfer(
debitAccount: BankAccountEntity,
creditAccount: BankAccountEntity,
demobank: DemobankConfigEntity,
diff --git a/sandbox/src/test/kotlin/BalanceTest.kt
b/sandbox/src/test/kotlin/BalanceTest.kt
index aabf2051..eb09cc64 100644
--- a/sandbox/src/test/kotlin/BalanceTest.kt
+++ b/sandbox/src/test/kotlin/BalanceTest.kt
@@ -91,13 +91,13 @@ class BalanceTest {
this.demobank = demobank
}
wireTransfer(
- other, one, demobank, "one gets 1", "EUR:1"
+ other.label, one.label, demobank.name, "one gets 1",
"EUR:1"
)
wireTransfer(
- other, one, demobank, "one gets another 1", "EUR:1"
+ other.label, one.label, demobank.name, "one gets another
1", "EUR:1"
)
wireTransfer(
- one, other, demobank, "one gives 1", "EUR:1"
+ one.label, other.label, demobank.name, "one gives 1",
"EUR:1"
)
val maybeOneBalance: BigDecimal = getBalance(one)
println(maybeOneBalance)
diff --git a/sandbox/src/test/kotlin/DBTest.kt
b/sandbox/src/test/kotlin/DBTest.kt
index e85d0ea9..bc5a33c5 100644
--- a/sandbox/src/test/kotlin/DBTest.kt
+++ b/sandbox/src/test/kotlin/DBTest.kt
@@ -56,6 +56,7 @@ class DBTest {
*/
@Test
fun connectionStringTest() {
+ getJdbcConnectionFromPg("postgres://auditor-basedb")
var conv = getJdbcConnectionFromPg("postgresql:///libeufincheck")
connectWithSchema(getJdbcConnectionFromPg("postgres:///libeufincheck"))
connectWithSchema(conv)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libeufin] branch master updated: balance accounting,
gnunet <=