From be942def4baac40b1031ba26491a24a55e1a6a6c Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 15 Jan 2015 09:13:32 +0100 Subject: [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 --- src/qt/test/paymentservertests.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qt/test') 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); -- cgit v1.2.3