[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: remove last transparent demobank creat
From: |
gnunet |
Subject: |
[libeufin] branch master updated: remove last transparent demobank creation |
Date: |
Wed, 04 May 2022 12:00:00 +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 8e198543 remove last transparent demobank creation
8e198543 is described below
commit 8e198543423b6bd5e90b5d96ac73676ea5070b57
Author: ms <ms@taler.net>
AuthorDate: Wed May 4 11:59:54 2022 +0200
remove last transparent demobank creation
---
.../main/kotlin/tech/libeufin/sandbox/Helpers.kt | 24 ----------------------
.../src/main/kotlin/tech/libeufin/sandbox/Main.kt | 14 ++++++-------
2 files changed, 7 insertions(+), 31 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
index 53df73fd..79844e87 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
@@ -173,30 +173,6 @@ fun getDefaultDemobank(): DemobankConfigEntity {
)
}
-fun maybeCreateDefaultDemobank(withSignupBonus: Boolean = false) {
- transaction {
- if (DemobankConfigEntity.all().empty()) {
- DemobankConfigEntity.new {
- currency = "CHF"
- bankDebtLimit = 1000000
- usersDebtLimit = 10000
- allowRegistrations = true
- name = "default"
- this.withSignupBonus = withSignupBonus
- }
- // Give one demobank a own bank account, mainly to award
- // customer upon registration.
- BankAccountEntity.new {
- iban = getIban()
- label = "bank" // used by the wire helper
- owner = "bank" // used by the person name finder
- // For now, the model assumes always one demobank
- demoBank = getFirstDemobank()
- }
- }
- }
-}
-
fun wireTransfer(
debitAccount: String,
creditAccount: String,
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index a06e8c51..c0b67997 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -247,13 +247,13 @@ class MakeTransaction : CliktCommand("Wire-transfer money
between Sandbox bank a
override fun run() {
val dbConnString = getDbConnFromEnv(SANDBOX_DB_ENV_VAR_NAME)
Database.connect(dbConnString)
- /**
- * The function below create a default demobank
- * if the 'config' command was never run before this point.
- *
- * This helps porting current tests to the "demobank model".
- */
- maybeCreateDefaultDemobank()
+ // Refuse to operate without a default demobank.
+ val demobank = getDemobank("default")
+ if (demobank == null) {
+ println("Sandbox cannot operate without a 'default' demobank.")
+ println("Please make one with the 'libeufin-cli config' command.")
+ exitProcess(1)
+ }
try {
wireTransfer(debitAccount, creditAccount, demobankArg, subjectArg,
amount)
} catch (e: SandboxError) {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: remove last transparent demobank creation,
gnunet <=