File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ BITCOIN_TESTS =\
6868 test/policyestimator_tests.cpp \
6969 test/pow_tests.cpp \
7070 test/prevector_tests.cpp \
71+ test/privatesend_tests.cpp \
7172 test/raii_event_tests.cpp \
7273 test/random_tests.cpp \
7374 test/ratecheck_tests.cpp \
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2020 The Dash Core developers
2+ // Distributed under the MIT software license, see the accompanying
3+ // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+ #include " test/test_dash.h"
6+
7+ #include " amount.h"
8+ #include " privatesend/privatesend.h"
9+
10+ #include < boost/test/unit_test.hpp>
11+
12+ BOOST_FIXTURE_TEST_SUITE (privatesend_tests, BasicTestingSetup)
13+
14+ BOOST_AUTO_TEST_CASE(ps_collatoral_tests)
15+ {
16+ // Good collateral values
17+ BOOST_CHECK (CPrivateSend::IsCollateralAmount (0.00010000 * COIN));
18+ BOOST_CHECK (CPrivateSend::IsCollateralAmount (0.00012345 * COIN));
19+ BOOST_CHECK (CPrivateSend::IsCollateralAmount (0.00032123 * COIN));
20+ BOOST_CHECK (CPrivateSend::IsCollateralAmount (0.00019000 * COIN));
21+
22+ // Bad collateral values
23+ BOOST_CHECK (!CPrivateSend::IsCollateralAmount (0.00009999 * COIN));
24+ BOOST_CHECK (!CPrivateSend::IsCollateralAmount (0.00040001 * COIN));
25+ BOOST_CHECK (!CPrivateSend::IsCollateralAmount (0.00100000 * COIN));
26+ BOOST_CHECK (!CPrivateSend::IsCollateralAmount (0.00100001 * COIN));
27+ }
28+
29+ BOOST_AUTO_TEST_SUITE_END ()
Original file line number Diff line number Diff line change 2626#include " evo/deterministicmns.h"
2727#include " evo/cbtx.h"
2828#include " llmq/quorums_init.h"
29+ #include " privatesend/privatesend.h"
2930
3031#include < memory>
3132
@@ -57,6 +58,7 @@ BasicTestingSetup::BasicTestingSetup(const std::string& chainName)
5758 SetupNetworking ();
5859 InitSignatureCache ();
5960 InitScriptExecutionCache ();
61+ CPrivateSend::InitStandardDenominations ();
6062 fPrintToDebugLog = false ; // don't want to write to debug.log file
6163 fCheckBlockIndex = true ;
6264 SelectParams (chainName);
You can’t perform that action at this time.
0 commit comments