gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: start of default demobank policy


From: gnunet
Subject: [libeufin] branch master updated: start of default demobank policy
Date: Thu, 21 Oct 2021 17:00:33 +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 c1c00b7  start of default demobank policy
c1c00b7 is described below

commit c1c00b7f5b55ac7b0ddbaee19c72528569e6294b
Author: ms <ms@taler.net>
AuthorDate: Thu Oct 21 16:59:58 2021 +0200

    start of default demobank policy
---
 sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt   |  1 +
 sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 18 +++++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
index 47b1e34..90405f6 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
@@ -32,6 +32,7 @@ import org.jetbrains.exposed.dao.id.LongIdTable
 import org.jetbrains.exposed.sql.*
 import org.jetbrains.exposed.sql.transactions.TransactionManager
 import org.jetbrains.exposed.sql.transactions.transaction
+import tech.libeufin.util.internalServerError
 import java.sql.Connection
 
 /**
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 6e431d4..b220e0f 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -82,7 +82,6 @@ import kotlin.system.exitProcess
 
 private val logger: Logger = LoggerFactory.getLogger("tech.libeufin.sandbox")
 private val currencyEnv: String? = System.getenv("LIBEUFIN_SANDBOX_CURRENCY")
-private val envName: String? = System.getenv("TALER_ENV_NAME")
 const val SANDBOX_DB_ENV_VAR_NAME = "LIBEUFIN_SANDBOX_DB_CONNECTION"
 private val adminPassword: String? = 
System.getenv("LIBEUFIN_SANDBOX_ADMIN_PASSWORD")
 private var WITH_AUTH = true
@@ -210,6 +209,23 @@ class MakeTransaction : CliktCommand("Wire-transfer money 
between Sandbox bank a
     override fun run() {
         val dbConnString = getDbConnFromEnv(SANDBOX_DB_ENV_VAR_NAME)
         Database.connect(dbConnString)
+        transaction {
+            /**
+             * No Demobank was configured so far - for example,
+             * current tests do not.  This branch provides a default.
+             *
+             * Not used yet.
+             */
+            if (DemobankConfigEntity.all().empty()) {
+                DemobankConfigEntity.new {
+                    currency = "EUR"
+                    bankDebtLimit = 1000000
+                    usersDebtLimit = 10000
+                    allowRegistrations = true
+                    name = "default"
+                }
+            }
+        }
         try {
             wireTransfer(debitAccount, creditAccount, amount, subjectArg)
         } catch (e: SandboxError) {

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