16#include <boost/test/unit_test.hpp>
27 for (
int i = 0; i < 2; i++) {
34 std::unique_ptr<interfaces::Chain>& chain =
m_node.
chain;
42 std::string desc_str =
"pk(" +
EncodeSecret(keys[0]) +
")";
47 result = spk_manager->IsMine(scriptPubKey);
54 std::string desc_str =
"pk(" +
EncodeSecret(uncompressedKey) +
")";
59 result = spk_manager->IsMine(scriptPubKey);
66 std::string desc_str =
"pkh(" +
EncodeSecret(keys[0]) +
")";
71 result = spk_manager->IsMine(scriptPubKey);
78 std::string desc_str =
"pkh(" +
EncodeSecret(uncompressedKey) +
")";
83 result = spk_manager->IsMine(scriptPubKey);
90 std::string desc_str =
"sh(pkh(" +
EncodeSecret(keys[0]) +
"))";
96 result = spk_manager->IsMine(scriptPubKey);
103 std::string desc_str =
"sh(sh(" +
EncodeSecret(keys[0]) +
"))";
112 std::string desc_str =
"wsh(sh(" +
EncodeSecret(keys[0]) +
"))";
121 std::string desc_str =
"wsh(wpkh(" +
EncodeSecret(keys[0]) +
"))";
130 std::string desc_str =
"wsh(wsh(" +
EncodeSecret(keys[0]) +
"))";
139 std::string desc_str =
"wpkh(" +
EncodeSecret(keys[0]) +
")";
144 result = spk_manager->IsMine(scriptPubKey);
151 std::string desc_str =
"wpkh(" +
EncodeSecret(uncompressedKey) +
")";
165 result = spk_manager->IsMine(scriptPubKey);
179 result = spk_manager->IsMine(scriptPubKey);
193 result = spk_manager->IsMine(scriptPubKey);
218 result = spk_manager->IsMine(scriptPubKey);
226 std::string desc_str =
"combo(" +
EncodeSecret(keys[0]) +
")";
241 result = spk_manager->IsMine(scriptPubKey);
246 result = spk_manager->IsMine(scriptPubKey);
252 result = spk_manager->IsMine(scriptPubKey);
262 result = spk_manager->IsMine(scriptPubKey);
270 std::string desc_str =
"tr(" +
EncodeSecret(keys[0]) +
")";
280 result = spk_manager->IsMine(scriptPubKey);
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
#define Assert(val)
Identity function.
An encapsulated private key.
void MakeNewKey(bool fCompressed)
Generate a new private key using a cryptographic PRNG.
CPubKey GetPubKey() const
Compute the public key from a private key.
An encapsulated public key.
Serialized script, used inside transaction inputs and outputs.
Utility class to construct Taproot outputs from internal key and script tree.
WitnessV1Taproot GetOutput()
Compute scriptPubKey (after Finalize()).
TaprootBuilder & Finalize(const XOnlyPubKey &internal_key)
Finalize the construction.
bool IsFullyValid() const
Determine if this pubkey is fully valid.
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
CKey GenerateRandomKey(bool compressed) noexcept
std::string EncodeSecret(const CKey &key)
""_hex is a compile-time user-defined literal returning a std::array<std::byte>, equivalent to ParseH...
wallet::ScriptPubKeyMan * CreateDescriptor(CWallet &keystore, const std::string &desc_str, const bool success)
std::unique_ptr< WalletDatabase > CreateMockableWalletDatabase(MockableData records)
BOOST_AUTO_TEST_CASE(bnb_test)
isminetype
IsMine() return codes, which depend on ScriptPubKeyMan implementation.
#define BOOST_CHECK_EQUAL(v1, v2)
CScript GetScriptForMultisig(int nRequired, const std::vector< CPubKey > &keys)
Generate a multisig script.
CScript GetScriptForRawPubKey(const CPubKey &pubKey)
Generate a P2PK script for the given pubkey.
std::unique_ptr< interfaces::Chain > chain
is a home for public enum and struct type definitions that are used by internally by wallet code,...