mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-14 06:32:33 +01:00
[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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user