gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: block wire transfers of zero


From: gnunet
Subject: [libeufin] branch master updated: block wire transfers of zero
Date: Mon, 31 Jan 2022 15:08:09 +0100

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 51ef739f block wire transfers of zero
51ef739f is described below

commit 51ef739f19b05877f201ae179369d5ea7f29c09a
Author: ms <ms@taler.net>
AuthorDate: Mon Jan 31 15:08:05 2022 +0100

    block wire transfers of zero
---
 sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
index 408a42c9..c5a2ea18 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
@@ -29,6 +29,7 @@ import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
 import org.jetbrains.exposed.sql.and
 import org.jetbrains.exposed.sql.transactions.transaction
 import tech.libeufin.util.*
+import java.math.BigDecimal
 
 /**
  * Helps to communicate Camt values without having
@@ -252,7 +253,8 @@ fun wireTransfer(
     amount: String,
 ): String {
     // sanity check on the amount, no currency allowed here.
-    parseDecimal(amount)
+    val checkAmount = parseDecimal(amount)
+    if (checkAmount == BigDecimal.ZERO) throw badRequest("Wire transfers of 
zero not possible.")
     val timeStamp = getUTCnow().toInstant().toEpochMilli()
     val transactionRef = getRandomString(8)
     transaction {

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