aboutsummaryrefslogtreecommitdiff
path: root/src/qt/test
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2015-01-15 09:13:32 +0100
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2015-08-10 14:12:15 +0200
commitbe942def4baac40b1031ba26491a24a55e1a6a6c (patch)
tree78f382f60b7caf81d71ecde2a6eebc563d5379df /src/qt/test
parentc0f66ce44abdc44ddbff892720d5b85f6a95436d (diff)
[Qt] add verifySize() function to PaymentServer
- add static verifySize() function to PaymentServer and move the logging on error into the function - also use the new function in the unit test - the function checks if the size is allowed as per BIP70
Diffstat (limited to 'src/qt/test')
-rw-r--r--src/qt/test/paymentservertests.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qt/test/paymentservertests.cpp b/src/qt/test/paymentservertests.cpp
index b28934cd31..fa5696325d 100644
--- a/src/qt/test/paymentservertests.cpp
+++ b/src/qt/test/paymentservertests.cpp
@@ -185,7 +185,8 @@ void PaymentServerTests::paymentServerTests()
tempFile.open();
tempFile.write((const char*)randData, sizeof(randData));
tempFile.close();
- QCOMPARE(PaymentServer::readPaymentRequestFromFile(tempFile.fileName(), r.paymentRequest), false);
+ // compares 50001 <= BIP70_MAX_PAYMENTREQUEST_SIZE == false
+ QCOMPARE(PaymentServer::verifySize(tempFile.size()), false);
// Payment request with amount overflow (amount is set to 21000001 BTC):
data = DecodeBase64(paymentrequest5_cert2_BASE64);