Changeset View
Changeset View
Standalone View
Standalone View
src/qt/test/paymentservertests.cpp
// Copyright (c) 2009-2015 The Bitcoin Core developers | // Copyright (c) 2009-2015 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <qt/test/paymentservertests.h> | #include <qt/test/paymentservertests.h> | ||||
#include <amount.h> | #include <amount.h> | ||||
#include <interfaces/node.h> | #include <interfaces/node.h> | ||||
#include <qt/optionsmodel.h> | #include <qt/optionsmodel.h> | ||||
#include <qt/test/paymentrequestdata.h> | #include <qt/test/paymentrequestdata.h> | ||||
#include <random.h> | #include <random.h> | ||||
#include <script/script.h> | #include <script/script.h> | ||||
#include <script/standard.h> | #include <script/standard.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <util/system.h> | |||||
#include <test/setup_common.h> | |||||
#include <openssl/x509.h> | #include <openssl/x509.h> | ||||
#include <openssl/x509_vfy.h> | #include <openssl/x509_vfy.h> | ||||
#include <QFileOpenEvent> | #include <QFileOpenEvent> | ||||
#include <QTemporaryFile> | #include <QTemporaryFile> | ||||
X509 *parse_b64der_cert(const char *cert_data) { | X509 *parse_b64der_cert(const char *cert_data) { | ||||
Show All 33 Lines | static SendCoinsRecipient handleRequest(PaymentServer *server, | ||||
QObject::disconnect(server, &PaymentServer::receivedPaymentRequest, | QObject::disconnect(server, &PaymentServer::receivedPaymentRequest, | ||||
&sigCatcher, &RecipientCatcher::getRecipient); | &sigCatcher, &RecipientCatcher::getRecipient); | ||||
// Return results from sigCatcher | // Return results from sigCatcher | ||||
return sigCatcher.recipient; | return sigCatcher.recipient; | ||||
} | } | ||||
void PaymentServerTests::paymentServerTests() { | void PaymentServerTests::paymentServerTests() { | ||||
SelectParams(CBaseChainParams::MAIN); | BasicTestingSetup testing_setup(CBaseChainParams::MAIN); | ||||
auto node = interfaces::MakeNode(); | auto node = interfaces::MakeNode(); | ||||
OptionsModel optionsModel(*node); | OptionsModel optionsModel(*node); | ||||
PaymentServer *server = new PaymentServer(nullptr, false); | PaymentServer *server = new PaymentServer(nullptr, false); | ||||
X509_STORE *caStore = X509_STORE_new(); | X509_STORE *caStore = X509_STORE_new(); | ||||
X509_STORE_add_cert(caStore, parse_b64der_cert(caCert1_BASE64)); | X509_STORE_add_cert(caStore, parse_b64der_cert(caCert1_BASE64)); | ||||
PaymentServer::LoadRootCAs(caStore); | PaymentServer::LoadRootCAs(caStore); | ||||
server->setOptionsModel(&optionsModel); | server->setOptionsModel(&optionsModel); | ||||
server->uiReady(); | server->uiReady(); | ||||
▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines |