gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] 07/08: fixes after wallet harness


From: gnunet
Subject: [libeufin] 07/08: fixes after wallet harness
Date: Wed, 10 Nov 2021 16:22:50 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

commit 145bfdbde140033f3761e8fc18905db2b62f7881
Author: ms <ms@taler.net>
AuthorDate: Sun Nov 7 21:48:26 2021 +0100

    fixes after wallet harness
---
 sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt      |  2 +-
 sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt | 14 ++++++++------
 sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt    |  5 +++--
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
index 73103756..e5f6a695 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
@@ -368,7 +368,7 @@ class BankAccountTransactionEntity(id: EntityID<Long>) : 
LongEntity(id) {
  */
 object BankAccountsTable : IntIdTable() {
     val iban = text("iban")
-    val bic = text("bic").default("EUSANDBOX")
+    val bic = text("bic").default("SANDBOXX")
     val label = text("label").uniqueIndex("accountLabelIndex")
     val isDebit = bool("isDebit").default(false)
     /**
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
index fdccb74e..81974703 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
@@ -134,12 +134,14 @@ fun getCustomer(username: String): DemobankCustomerEntity 
{
  */
 fun getPersonNameFromCustomer(ownerUsername: String): String {
     return if (ownerUsername == "admin") "admin" else {
-        val ownerCustomer = DemobankCustomerEntity.find(
-            DemobankCustomersTable.username eq ownerUsername
-        ).firstOrNull() ?: throw internalServerError(
-            "Person name of '$ownerUsername' not found"
-        )
-        ownerCustomer.name ?: "Name not given"
+        return transaction {
+            val ownerCustomer = DemobankCustomerEntity.find(
+                DemobankCustomersTable.username eq ownerUsername
+            ).firstOrNull() ?: throw internalServerError(
+                "Person name of '$ownerUsername' not found"
+            )
+            ownerCustomer.name ?: "Name not given"
+        }
     }
 }
 fun getDefaultDemobank(): DemobankConfigEntity {
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 99a99a20..454db034 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -1011,7 +1011,7 @@ val sandboxApp: Application.() -> Unit = {
                         if (wo.selectionDone) {
                             if (wo.confirmationDone) {
                                 logger.info("Wallet performs again this 
operation that was paid out earlier: idempotent")
-                                return@newSuspendedTransaction
+                                return@newSuspendedTransaction wo.selectionDone
                             }
                             // Selected already but NOT paid, check 
consistency.
                             if (body.reserve_pub != wo.reservePub) throw 
SandboxError(
@@ -1027,9 +1027,10 @@ val sandboxApp: Application.() -> Unit = {
                         wo.selectedExchangePayto = body.selected_exchange
                         wo.selectionDone = true
                         wo.confirmationDone
+                        false // not confirmed (AKA transferred)
                     }
                     call.respond(object {
-                        val transfer_done = transferDone
+                        val transfer_done: Boolean = transferDone
                     })
                     return@post
                 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]