gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: Snack-machine demo changes.


From: gnunet
Subject: [libeufin] branch master updated: Snack-machine demo changes.
Date: Wed, 04 May 2022 08:35:30 +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 6647945e Snack-machine demo changes.
6647945e is described below

commit 6647945e3ebba4fce2fd8eabf871ffb448a9f274
Author: ms <ms@taler.net>
AuthorDate: Wed May 4 08:34:26 2022 +0200

    Snack-machine demo changes.
    
    CHF becomes the default currency.  Do not 500
    when the 'bank' username is tried to be registered.
---
 sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt | 3 ++-
 sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt    | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
index c5a2ea18..372fc9cc 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
@@ -169,11 +169,12 @@ fun getDefaultDemobank(): DemobankConfigEntity {
         "Default demobank is missing."
     )
 }
+
 fun maybeCreateDefaultDemobank() {
     transaction {
         if (DemobankConfigEntity.all().empty()) {
             DemobankConfigEntity.new {
-                currency = "EUR"
+                currency = "CHF"
                 bankDebtLimit = 1000000
                 usersDebtLimit = 10000
                 allowRegistrations = true
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 22f8243f..142b6ed2 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -1408,7 +1408,11 @@ val sandboxApp: Application.() -> Unit = {
                             DemobankCustomersTable.username eq req.username
                         }.firstOrNull()
                     }
-                    if (checkExist != null) {
+                    /**
+                     * Not allowing 'bank' username, as it's been assigned
+                     * to the default bank's bank account.
+                     */
+                    if (checkExist != null || req.username == "bank") {
                         throw SandboxError(
                             HttpStatusCode.Conflict,
                             "Username ${req.username} not available."

-- 
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]