Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/test/psbt_wallet_tests.cpp
// Copyright (c) 2017 The Bitcoin Core developers | // Copyright (c) 2017 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 <key_io.h> | #include <key_io.h> | ||||
#include <util/bip32.h> | #include <util/bip32.h> | ||||
#include <util/error.h> | #include <util/error.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <wallet/psbtwallet.h> | |||||
#include <wallet/test/wallet_test_fixture.h> | #include <wallet/test/wallet_test_fixture.h> | ||||
#include <wallet/wallet.h> | #include <wallet/wallet.h> | ||||
#include <test/util/setup_common.h> | #include <test/util/setup_common.h> | ||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
BOOST_FIXTURE_TEST_SUITE(psbt_wallet_tests, WalletTestingSetup) | BOOST_FIXTURE_TEST_SUITE(psbt_wallet_tests, WalletTestingSetup) | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(psbt_updater_test) { | ||||
ssData >> psbtx; | ssData >> psbtx; | ||||
// FIXME: input 2 hd path is missing. | // FIXME: input 2 hd path is missing. | ||||
// The path missing comes from the HD masterkey. | // The path missing comes from the HD masterkey. | ||||
// Fill transaction with our data | // Fill transaction with our data | ||||
bool complete = true; | bool complete = true; | ||||
BOOST_REQUIRE_EQUAL( | BOOST_REQUIRE_EQUAL( | ||||
FillPSBT(&m_wallet, psbtx, complete, SigHashType(), false, true), | m_wallet.FillPSBT(psbtx, complete, SigHashType(), false, true), | ||||
TransactionError::OK); | TransactionError::OK); | ||||
// Get the final tx | // Get the final tx | ||||
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); | CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); | ||||
ssTx << psbtx; | ssTx << psbtx; | ||||
std::string final_hex = HexStr(ssTx.begin(), ssTx.end()); | std::string final_hex = HexStr(ssTx.begin(), ssTx.end()); | ||||
BOOST_CHECK_EQUAL( | BOOST_CHECK_EQUAL( | ||||
final_hex, | final_hex, | ||||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |