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 GetScriptForMultisig(int nRequired, const std::vector< CPubKey > &keys)
Generate a multisig script.
std::unique_ptr< interfaces::Chain > chain
BOOST_AUTO_TEST_CASE(ismine_standard)
CPubKey GetPubKey() const
Compute the public key from a private key.
CKey GenerateRandomKey(bool compressed) noexcept
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
wallet::DescriptorScriptPubKeyMan * CreateDescriptor(CWallet &keystore, const std::string &desc_str, const bool success)
BOOST_AUTO_TEST_SUITE_END()
TaprootBuilder & Finalize(const XOnlyPubKey &internal_key)
Finalize the construction.
An encapsulated public key.
void MakeNewKey(bool fCompressed)
Generate a new private key using a cryptographic PRNG.
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
""_hex is a compile-time user-defined literal returning a std::array<std::byte>, equivalent to ParseH...
is a home for public enum and struct type definitions that are used by internally by wallet code...
bool IsFullyValid() const
Determine if this pubkey is fully valid.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
Utility class to construct Taproot outputs from internal key and script tree.
std::unique_ptr< WalletDatabase > CreateMockableWalletDatabase(MockableData records)
#define BOOST_CHECK_EQUAL(v1, v2)
Serialized script, used inside transaction inputs and outputs.
CScript GetScriptForRawPubKey(const CPubKey &pubKey)
Generate a P2PK script for the given pubkey.
An encapsulated private key.
std::string EncodeSecret(const CKey &key)
#define Assert(val)
Identity function.
#define BOOST_CHECK(expr)