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;
61 std::string desc_str =
"pk(" +
EncodeSecret(keys[0]) +
")";
66 result = spk_manager->IsMine(scriptPubKey);
92 std::string desc_str =
"pk(" +
EncodeSecret(uncompressedKey) +
")";
97 result = spk_manager->IsMine(scriptPubKey);
123 std::string desc_str =
"pkh(" +
EncodeSecret(keys[0]) +
")";
128 result = spk_manager->IsMine(scriptPubKey);
154 std::string desc_str =
"pkh(" +
EncodeSecret(uncompressedKey) +
")";
159 result = spk_manager->IsMine(scriptPubKey);
193 std::string desc_str =
"sh(pkh(" +
EncodeSecret(keys[0]) +
"))";
199 result = spk_manager->IsMine(scriptPubKey);
225 std::string desc_str =
"sh(sh(" +
EncodeSecret(keys[0]) +
"))";
253 std::string desc_str =
"wsh(sh(" +
EncodeSecret(keys[0]) +
"))";
279 std::string desc_str =
"wsh(wpkh(" +
EncodeSecret(keys[0]) +
"))";
307 std::string desc_str =
"wsh(wsh(" +
EncodeSecret(keys[0]) +
"))";
332 std::string desc_str =
"wpkh(" +
EncodeSecret(keys[0]) +
")";
337 result = spk_manager->IsMine(scriptPubKey);
365 std::string desc_str =
"wpkh(" +
EncodeSecret(uncompressedKey) +
")";
414 result = spk_manager->IsMine(scriptPubKey);
451 result = spk_manager->IsMine(scriptPubKey);
494 result = spk_manager->IsMine(scriptPubKey);
578 result = spk_manager->IsMine(scriptPubKey);
586 std::string desc_str =
"combo(" +
EncodeSecret(keys[0]) +
")";
601 result = spk_manager->IsMine(scriptPubKey);
606 result = spk_manager->IsMine(scriptPubKey);
612 result = spk_manager->IsMine(scriptPubKey);
622 result = spk_manager->IsMine(scriptPubKey);
630 std::string desc_str =
"tr(" +
EncodeSecret(keys[0]) +
")";
640 result = spk_manager->IsMine(scriptPubKey);
651 scriptPubKey.
clear();
666 scriptPubKey.
clear();
667 scriptPubKey <<
OP_0 <<
"aabb"_hex;
681 scriptPubKey.
clear();
682 scriptPubKey <<
OP_16 <<
"aabb"_hex;
696 scriptPubKey.
clear();
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.
virtual bool AddKey(const CKey &key)
RecursiveMutex cs_KeyStore
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...
LegacyScriptPubKeyMan * GetLegacyScriptPubKeyMan() const
Get the LegacyScriptPubKeyMan which is used for all types, internal, and external.
void SetupLegacyScriptPubKeyMan()
Make a Legacy(Data)SPKM and set it for all types, internal, and external.
isminetype IsMine(const CScript &script) const override
std::unordered_set< CScript, SaltedSipHasher > GetScriptPubKeys() const override
Returns a set of all the scriptPubKeys that this ScriptPubKeyMan watches.
bool AddCScript(const CScript &redeemScript) override
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)
isminetype
IsMine() return codes, which depend on ScriptPubKeyMan implementation.
BOOST_AUTO_TEST_CASE(bnb_search_test)
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
std::vector< unsigned char > ToByteVector(const T &in)
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,...