diff --git a/src/Makefile.test.include b/src/Makefile.test.include --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -135,6 +135,7 @@ if ENABLE_WALLET BITCOIN_TESTS += \ wallet/test/accounting_tests.cpp \ + wallet/test/psbt_wallet_tests.cpp \ wallet/test/wallet_tests.cpp \ wallet/test/walletdb_tests.cpp \ wallet/test/wallet_crypto_tests.cpp \ diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -175,11 +175,12 @@ if(BUILD_BITCOIN_WALLET) target_sources(test_bitcoin PRIVATE - ../wallet/test/wallet_test_fixture.cpp ../wallet/test/accounting_tests.cpp + ../wallet/test/coinselector_tests.cpp + ../wallet/test/psbt_wallet_tests.cpp + ../wallet/test/wallet_test_fixture.cpp ../wallet/test/wallet_tests.cpp ../wallet/test/walletdb_tests.cpp ../wallet/test/wallet_crypto_tests.cpp - ../wallet/test/coinselector_tests.cpp ) endif() diff --git a/src/test/cashaddrenc_tests.cpp b/src/test/cashaddrenc_tests.cpp --- a/src/test/cashaddrenc_tests.cpp +++ b/src/test/cashaddrenc_tests.cpp @@ -322,6 +322,12 @@ {"prefix", CashAddrType(15), ParseHex("F5BF48B397DAE70BE82B3CCA4793F8EB2B6CDAC9"), "prefix:0r6m7j9njldwwzlg9v7v53unlr4jkmx6ey3qnjwsrf"}, + {"bchreg", PUBKEY_TYPE, + ParseHex("d85c2b71d0060b09c9886aeb815e50991dda124d"), + "bchreg:qrv9c2m36qrqkzwf3p4whq272zv3mksjf5ln6v9le5"}, + {"bchreg", PUBKEY_TYPE, + ParseHex("00aea9a2e5f0f876a588df5546e8742d1d87008f"), + "bchreg:qqq2a2dzuhc0sa493r0423hgwsk3mpcq3upac4z3wr"}, // 24 bytes {"bitcoincash", PUBKEY_TYPE, ParseHex("7ADBF6C17084BC86C1706827B41A56F5CA32865925E946EA"), diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5180,7 +5180,7 @@ // Fill in the bip32 keypaths and redeemscripts for the outputs so that // hardware wallets can identify change - for (unsigned int i = 0; i < txConst->vout.size(); ++i) { + for (size_t i = 0; i < txConst->vout.size(); ++i) { const CTxOut &out = txConst->vout.at(i); PSBTOutput &psbt_out = psbtx.outputs.at(i); diff --git a/src/wallet/test/psbt_wallet_tests.cpp b/src/wallet/test/psbt_wallet_tests.cpp new file mode 100644 --- /dev/null +++ b/src/wallet/test/psbt_wallet_tests.cpp @@ -0,0 +1,128 @@ +// Copyright (c) 2017 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include