12#include <test/util/setup_common.h>
14#include <boost/test/unit_test.hpp>
19 auto spk_man =
m_wallet.GetOrCreateLegacyScriptPubKeyMan();
24 ParseHex(
"020000000158e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f54"
25 "5887bb2abdd7501000000171600145f275f436b09a8cc9a2eb2a2f528485c"
26 "68a56323feffffff02d8231f1b0100000017a914aed962d6654f9a2b36608"
27 "eb9d64d2b260db4f1118700c2eb0b0000000017a914f6539307e3a48d1e01"
28 "36d061f5d1fe19e1a240898765000000"),
32 s_prev_tx1 >> prev_tx1;
33 m_wallet.mapWallet.emplace(std::piecewise_construct,
34 std::forward_as_tuple(prev_tx1->GetId()),
35 std::forward_as_tuple(prev_tx1));
39 "0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71"
40 "ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd3013"
41 "5aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f"
42 "0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9"
43 "463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74"
44 "f8a08f81999428185c97b5d852e4063f618765000000"),
47 s_prev_tx2 >> prev_tx2;
48 m_wallet.mapWallet.emplace(std::piecewise_construct,
49 std::forward_as_tuple(prev_tx2->GetId()),
50 std::forward_as_tuple(prev_tx2));
55 ParseHex(
"475221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c218"
56 "3f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54"
57 "dae4dba2fbfef536d752ae"),
60 spk_man->AddCScript(rs1);
64 ParseHex(
"47522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1"
65 "b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e8"
66 "6151926860221f0e7352ae"),
69 spk_man->AddCScript(rs2);
75 DecodeSecret(
"5KSSJQ7UNfFGwVgpCZDSHm5rVNhMFcFtvWM3zQ8mW4qNDEN7LFd");
76 CPubKey master_pub_key = spk_man->DeriveNewSeed(key);
77 spk_man->SetHDSeed(master_pub_key);
78 spk_man->NewKeyPool();
83 ParseHex(
"70736274ff0100a0020000000258e87a21b56daf0c23be8e7070456c336f7"
84 "cbaa5c8757924f545887bb2abdd750000000000ffffffff6b04ec37326fba"
85 "c8e468a73bf952c8877f84f96c3f9deadeab246455e34fe0cd0100000000f"
86 "fffffff0270aaf008000000001976a914d85c2b71d0060b09c9886aeb815e"
87 "50991dda124d88ac00e1f505000000001976a91400aea9a2e5f0f876a588d"
88 "f5546e8742d1d87008f88ac000000000000000000"),
104 std::string final_hex =
HexStr(ssTx);
107 "70736274ff0100a0020000000258e87a21b56daf0c23be8e7070456c336f7cbaa5c875"
108 "7924f545887bb2abdd750000000000ffffffff6b04ec37326fbac8e468a73bf952c887"
109 "7f84f96c3f9deadeab246455e34fe0cd0100000000ffffffff0270aaf0080000000019"
110 "76a914d85c2b71d0060b09c9886aeb815e50991dda124d88ac00e1f505000000001976"
111 "a91400aea9a2e5f0f876a588df5546e8742d1d87008f88ac000000000001002080f0fa"
112 "020000000017a9140fb9463421696b82c833af241c78c17ddbde493487010447522102"
113 "9583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102da"
114 "b61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752ae2206"
115 "029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f10d9"
116 "0c6a4f000000800000008000000080220602dab61ff49a14db6a7d02b0cd1fbb78fc4b"
117 "18312b5b4e54dae4dba2fbfef536d710d90c6a4f000000800000008001000080000100"
118 "2000c2eb0b0000000017a914f6539307e3a48d1e0136d061f5d1fe19e1a24089870104"
119 "47522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02"
120 "dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e73"
121 "52ae2206023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f"
122 "0e7310d90c6a4f000000800000008003000080220603089dc10c7ac6db54f91329af61"
123 "7333db388cead0c231f723379d1b99030b02dc10d90c6a4f0000008000000080020000"
124 "8000220203a9a4c37f5996d3aa25dbac6b570af0650394492942460b354753ed9eeca5"
125 "877110d90c6a4f000000800000008004000080002202027f6399757d2eff55a136ad02"
126 "c684b1838b6556e5f1b6b34282a94b6b5005109610d90c6a4f00000080000000800500"
131 std::vector<uint32_t> keypath;
134 "1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1", keypath));
138 "1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1'/1", keypath));
142 "1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/", keypath));
146 "1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1'/", keypath));
194 "00000000000000000000000000000000000000000000000"
195 "0000000000000000000000000000000000000",
198 "1111111111111111111111111111111111111111111111"
199 "11111111111111111111111111111111111111",
219BOOST_AUTO_TEST_SUITE_END()
bool ParseHDKeypath(const std::string &keypath_str, std::vector< uint32_t > &keypath)
Parse an HD keypaths like "m/7/0'/2000".
Double ended buffer combining vector and stream-like interfaces.
An encapsulated secp256k1 private key.
An encapsulated public key.
Signature hash type wrapper class.
CKey DecodeSecret(const std::string &str)
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
std::shared_ptr< const CTransaction > CTransactionRef
BOOST_AUTO_TEST_CASE(psbt_updater_test)
A version of CTransaction with the PSBT format.
Testing setup and teardown for wallet.
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
template std::vector< std::byte > ParseHex(std::string_view)
static const int PROTOCOL_VERSION
network protocol versioning
std::shared_ptr< CWallet > m_wallet