gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: Avoid row collision with sample data.


From: gnunet
Subject: [libeufin] branch master updated: Avoid row collision with sample data.
Date: Wed, 01 Apr 2020 16:58:59 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new dcb5093  Avoid row collision with sample data.
dcb5093 is described below

commit dcb5093fc78ccdc61a328ea62c6c9d452d5a748e
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Apr 1 16:58:31 2020 +0200

    Avoid row collision with sample data.
---
 nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 28 +++++++++--------------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index c68b61a..15d20ee 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -73,21 +73,18 @@ fun testData() {
     val pairA = CryptoUtil.generateRsaKeyPair(2048)
     val pairB = CryptoUtil.generateRsaKeyPair(2048)
     val pairC = CryptoUtil.generateRsaKeyPair(2048)
-    try {
-        transaction {
-            addLogger(StdOutSqlLogger)
-            EbicsSubscriberEntity.new(id = "default-customer") {
-                ebicsURL = "http://localhost:5000/ebicsweb";
-                userID = "USER1"
-                partnerID = "PARTNER1"
-                hostID = "host01"
-                signaturePrivateKey = SerialBlob(pairA.private.encoded)
-                encryptionPrivateKey = SerialBlob(pairB.private.encoded)
-                authenticationPrivateKey = SerialBlob(pairC.private.encoded)
-            }
+    val salt = Random().nextLong()
+    transaction {
+        addLogger(StdOutSqlLogger)
+        EbicsSubscriberEntity.new(id = "default-customer-$salt") {
+            ebicsURL = "http://localhost:5000/ebicsweb";
+            userID = "USER1"
+            partnerID = "PARTNER1"
+            hostID = "host01"
+            signaturePrivateKey = SerialBlob(pairA.private.encoded)
+            encryptionPrivateKey = SerialBlob(pairB.private.encoded)
+            authenticationPrivateKey = SerialBlob(pairC.private.encoded)
         }
-    } catch (e: ExposedSQLException) {
-        logger.info("Likely primary key collision for sample data: accepted")
     }
 }
 
@@ -629,7 +626,6 @@ fun main() {
 
                 return@get
             }
-
             
post("/ebics/taler/{id}/accounts/{acctid}/refund-invalid-payments") {
                 transaction {
                     val subscriber = expectIdTransaction(call.parameters["id"])
@@ -763,7 +759,6 @@ fun main() {
             get("/ebics/subscribers/{id}/transactions") {
                 // FIXME(florian): Display local transaction history stored by 
the nexus.
             }
-
             post("/ebics/subscribers/{id}/sendC52") {
                 val id = expectId(call.parameters["id"])
                 val paramsJson = call.receive<EbicsStandardOrderParamsJson>()
@@ -786,7 +781,6 @@ fun main() {
                     }
                 }
             }
-
             post("/ebics/subscribers/{id}/sendCRZ") {
                 val id = expectId(call.parameters["id"])
                 val paramsJson = call.receive<EbicsStandardOrderParamsJson>()

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]