aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorBen Woosley <[email protected]>2018-04-29 15:45:44 +0000
committerBen Woosley <[email protected]>2018-11-13 00:04:13 -0500
commit3002d6cf31821622e9f21d51e536cafc5cfb10ae (patch)
treea0831d207b5ca61d08285ac71212929817e5d8d4 /src/test
parentMake CWallet::ScanForWalletTransactions args and return value const (diff)
downloaddiscoin-3002d6cf31821622e9f21d51e536cafc5cfb10ae.tar.xz
discoin-3002d6cf31821622e9f21d51e536cafc5cfb10ae.zip
Return a status enum from ScanForWalletTransactions
Return the failed block as an out var. This clarifies the outcome as the prior return value could be null due to user abort or failure.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_bitcoin.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test_bitcoin.h b/src/test/test_bitcoin.h
index 387276713..182571b00 100644
--- a/src/test/test_bitcoin.h
+++ b/src/test/test_bitcoin.h
@@ -15,9 +15,17 @@
#include <txmempool.h>
#include <memory>
+#include <type_traits>
#include <boost/thread.hpp>
+// Enable BOOST_CHECK_EQUAL for enum class types
+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);
+}
+
extern uint256 insecure_rand_seed;
extern FastRandomContext insecure_rand_ctx;