Changeset View
Changeset View
Standalone View
Standalone View
src/qt/test/paymentservertests.cpp
Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | void PaymentServerTests::paymentServerTests() { | ||||
// Payment request with amount overflow (amount is set to 21000001 BCH): | // 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, Amount>> sendingTos = r.paymentRequest.getPayTo(); | ||||
for (const std::pair<CScript, CAmount> &sendingTo : sendingTos) { | for (const std::pair<CScript, Amount> &sendingTo : sendingTos) { | ||||
CTxDestination dest; | CTxDestination dest; | ||||
if (ExtractDestination(sendingTo.first, dest)) | if (ExtractDestination(sendingTo.first, dest)) | ||||
QCOMPARE(PaymentServer::verifyAmount(sendingTo.second), false); | QCOMPARE(PaymentServer::verifyAmount(sendingTo.second), false); | ||||
} | } | ||||
delete server; | delete server; | ||||
} | } | ||||
void RecipientCatcher::getRecipient(SendCoinsRecipient r) { | void RecipientCatcher::getRecipient(SendCoinsRecipient r) { | ||||
recipient = r; | recipient = r; | ||||
} | } |