libeufin

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

commit 154e1d6631b2427eaf4225a3819c428cf0104cee
parent c1a218fa71a971c0d5317eb91b442bd4a2b88f06
Author: ms <ms@taler.net>
Date:   Sat, 23 Oct 2021 08:43:21 +0200

Create default DB on main launcher.

Diffstat:
Msandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 6+-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt @@ -273,6 +273,7 @@ class Serve : CliktCommand("Run sandbox HTTP server") { exitProcess(1) } execThrowableOrTerminate { dbCreateTables(getDbConnFromEnv(SANDBOX_DB_ENV_VAR_NAME)) } + maybeCreateDefaultDemobank() if (withUnixSocket != null) { startServer( withUnixSocket ?: throw Exception("Could not use the Unix domain socket path value!"), @@ -284,11 +285,6 @@ class Serve : CliktCommand("Run sandbox HTTP server") { } } -private fun getCustomerFromDb(username: String): DemobankCustomerEntity { - return transaction { DemobankCustomerEntity.find { - DemobankCustomersTable.username eq username - }.firstOrNull() } ?: throw notFound("Customer with username '$username' not found") -} private fun getJsonFromDemobankConfig(fromDb: DemobankConfigEntity): Demobank { return Demobank( currency = fromDb.currency,