gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: Testing /history/incoming range.


From: gnunet
Subject: [libeufin] branch master updated: Testing /history/incoming range.
Date: Sat, 30 Sep 2023 23:49:08 +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 c28cc006 Testing /history/incoming range.
c28cc006 is described below

commit c28cc006be24e288ead9d89f40b2deaa61f08efa
Author: MS <ms@taler.net>
AuthorDate: Sat Sep 30 23:47:48 2023 +0200

    Testing /history/incoming range.
---
 bank/src/test/kotlin/TalerApiTest.kt | 31 ++++++++++++++++++++++++++-----
 build-system/taler-build-scripts     |  2 +-
 contrib/wallet-core                  |  2 +-
 3 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/bank/src/test/kotlin/TalerApiTest.kt 
b/bank/src/test/kotlin/TalerApiTest.kt
index cf6404f6..a0064206 100644
--- a/bank/src/test/kotlin/TalerApiTest.kt
+++ b/bank/src/test/kotlin/TalerApiTest.kt
@@ -142,10 +142,12 @@ class TalerApiTest {
         assert(db.customerCreate(customerBar) != null)
         assert(db.bankAccountCreate(bankAccountBar) != null)
         // Give Foo reasonable debt allowance:
-        assert(db.bankAccountSetMaxDebt(
-            1L,
-            TalerAmount(1000, 0, "KUDOS")
-        ))
+        assert(
+            db.bankAccountSetMaxDebt(
+                1L,
+                TalerAmount(1000000, 0, "KUDOS")
+            )
+        )
         // Foo pays Bar (the exchange) twice.
         val reservePubOne = 
"5ZFS98S1K4Y083W95GVZK638TSRE44RABVASB3AFA3R95VCW17V0"
         val reservePubTwo = 
"TFBT5NEVT8D2GETZ4DRF7C69XZHKHJ15296HRGB1R5ARNK0SP8A0"
@@ -157,7 +159,7 @@ class TalerApiTest {
         assert(
             db.bankTransactionCreate(genTx("payout", creditorId = 1, debtorId 
= 2)) ==
                     Database.BankTransactionResult.SUCCESS
-            )
+        )
         // Bar expects two entries in the incoming history
         testApplication {
             application {
@@ -169,6 +171,25 @@ class TalerApiTest {
             }
             val j: IncomingHistory = Json.decodeFromString(resp.bodyAsText())
             assert(j.incoming_transactions.size == 2)
+            // Testing ranges.
+            val mockReservePub = "X".repeat(52)
+            for (i in 1..400)
+                assert(db.bankTransactionCreate(genTx(mockReservePub)) == 
Database.BankTransactionResult.SUCCESS)
+            val range = 
client.get("/accounts/bar/taler-wire-gateway/history/incoming?delta=10&start=30")
 {
+                basicAuth("bar", "secret")
+                expectSuccess = true
+            }
+            val rangeObj = 
Json.decodeFromString<IncomingHistory>(range.bodyAsText())
+            // testing the size is like expected.
+            assert(rangeObj.incoming_transactions.size == 10) {
+                println("incoming_transaction has wrong size: 
${rangeObj.incoming_transactions.size}")
+                println("Response was: ${range.bodyAsText()}")
+            }
+            // testing that the first row_id is at least the 'start' query 
param.
+            assert(rangeObj.incoming_transactions[0].row_id >= 30)
+            // testing that the row_id increases.
+            for (idx in 1..9)
+                assert(rangeObj.incoming_transactions[idx].row_id > 
rangeObj.incoming_transactions[idx - 1].row_id)
         }
     }
 
diff --git a/build-system/taler-build-scripts b/build-system/taler-build-scripts
index 001f5dd0..47f14fcf 160000
--- a/build-system/taler-build-scripts
+++ b/build-system/taler-build-scripts
@@ -1 +1 @@
-Subproject commit 001f5dd081fc8729ff8def90c4a1c3f93eb8689a
+Subproject commit 47f14fcf1d03d9dad1bae59987488ea05ecd307b
diff --git a/contrib/wallet-core b/contrib/wallet-core
index 1708d49a..c5a3cd4c 160000
--- a/contrib/wallet-core
+++ b/contrib/wallet-core
@@ -1 +1 @@
-Subproject commit 1708d49a2d5da1f325173a030695223e5a24e75c
+Subproject commit c5a3cd4c50676c49fa6c67cbdeb609101c38e764

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