libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

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

fixes after wallet harness

Diffstat:
Msandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt | 2+-
Msandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt | 14++++++++------
Msandbox/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 @@ -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 @@ -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 @@ -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 }