Add src/wallet/* code to wallet:: namespace

This commit is contained in:
Russell Yanofsky
2021-11-12 11:13:29 -05:00
parent 90fc8b089d
commit f7086fd8ff
94 changed files with 294 additions and 75 deletions

View File

@@ -26,11 +26,13 @@
extern const std::function<void(const std::string&)> G_TEST_LOG_FUN;
// Enable BOOST_CHECK_EQUAL for enum class types
namespace std {
template <typename T>
std::ostream& operator<<(typename std::enable_if<std::is_enum<T>::value, std::ostream>::type& stream, const T& e)
{
return stream << static_cast<typename std::underlying_type<T>::type>(e);
}
} // namespace std
/**
* This global and the helpers that use it are not thread-safe.

View File

@@ -12,6 +12,8 @@
#include <wallet/wallet.h>
#endif
using wallet::CWallet;
const std::string ADDRESS_BCRT1_UNSPENDABLE = "bcrt1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3xueyj";
#ifdef ENABLE_WALLET

View File

@@ -7,7 +7,9 @@
#include <string>
namespace wallet {
class CWallet;
} // namespace wallet
// Constants //
@@ -16,9 +18,9 @@ extern const std::string ADDRESS_BCRT1_UNSPENDABLE;
// RPC-like //
/** Import the address to the wallet */
void importaddress(CWallet& wallet, const std::string& address);
void importaddress(wallet::CWallet& wallet, const std::string& address);
/** Returns a new address from the wallet */
std::string getnewaddress(CWallet& w);
std::string getnewaddress(wallet::CWallet& w);
#endif // BITCOIN_TEST_UTIL_WALLET_H