Changeset View
Changeset View
Standalone View
Standalone View
src/qt/test/paymentservertests.cpp
Show First 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | void PaymentServerTests::paymentServerTests() { | ||||
// Write data to a temp file: | // Write data to a temp file: | ||||
QTemporaryFile tempFile; | QTemporaryFile tempFile; | ||||
tempFile.open(); | tempFile.open(); | ||||
tempFile.write((const char *)randData, sizeof(randData)); | tempFile.write((const char *)randData, sizeof(randData)); | ||||
tempFile.close(); | tempFile.close(); | ||||
// compares 50001 <= BIP70_MAX_PAYMENTREQUEST_SIZE == false | // compares 50001 <= BIP70_MAX_PAYMENTREQUEST_SIZE == false | ||||
QCOMPARE(PaymentServer::verifySize(tempFile.size()), false); | QCOMPARE(PaymentServer::verifySize(tempFile.size()), false); | ||||
// Payment request with amount overflow (amount is set to 21000001 BCC): | // Payment request with amount overflow (amount is set to 21000001 BCH): | ||||
data = DecodeBase64(paymentrequest5_cert2_BASE64); | data = DecodeBase64(paymentrequest5_cert2_BASE64); | ||||
byteArray = QByteArray((const char *)&data[0], data.size()); | byteArray = QByteArray((const char *)&data[0], data.size()); | ||||
r.paymentRequest.parse(byteArray); | r.paymentRequest.parse(byteArray); | ||||
// Ensure the request is initialized | // Ensure the request is initialized | ||||
QVERIFY(r.paymentRequest.IsInitialized()); | QVERIFY(r.paymentRequest.IsInitialized()); | ||||
// Extract address and amount from the request | // Extract address and amount from the request | ||||
QList<std::pair<CScript, CAmount>> sendingTos = r.paymentRequest.getPayTo(); | QList<std::pair<CScript, CAmount>> sendingTos = r.paymentRequest.getPayTo(); | ||||
for (const std::pair<CScript, CAmount> &sendingTo : sendingTos) { | for (const std::pair<CScript, CAmount> &sendingTo : sendingTos) { | ||||
Show All 11 Lines |