forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathevo_utils_tests.cpp
More file actions
71 lines (62 loc) · 3.8 KB
/
evo_utils_tests.cpp
File metadata and controls
71 lines (62 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright (c) 2022-2025 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <test/util/setup_common.h>
#include <chainparams.h>
#include <llmq/options.h>
#include <validation.h>
#include <boost/test/unit_test.hpp>
using node::NodeContext;
/* TODO: rename this file and test to llmq_options_test */
BOOST_AUTO_TEST_SUITE(evo_utils_tests)
void Test(NodeContext& node)
{
using namespace llmq;
auto tip = node.chainman->ActiveTip();
const auto& consensus_params = Params().GetConsensus();
BOOST_CHECK_EQUAL(node.chainman->IsQuorumTypeEnabled(consensus_params.llmqTypeDIP0024InstantSend, tip,
/*optDIP0024IsActive=*/false, /*optHaveDIP0024Quorums=*/false),
false);
BOOST_CHECK_EQUAL(node.chainman->IsQuorumTypeEnabled(consensus_params.llmqTypeDIP0024InstantSend, tip,
/*optDIP0024IsActive=*/true, /*optHaveDIP0024Quorums=*/false),
true);
BOOST_CHECK_EQUAL(node.chainman->IsQuorumTypeEnabled(consensus_params.llmqTypeDIP0024InstantSend, tip,
/*optDIP0024IsActive=*/true, /*optHaveDIP0024Quorums=*/true),
true);
BOOST_CHECK_EQUAL(node.chainman->IsQuorumTypeEnabled(consensus_params.llmqTypeChainLocks, tip,
/*optDIP0024IsActive=*/false, /*optHaveDIP0024Quorums=*/false),
true);
BOOST_CHECK_EQUAL(node.chainman->IsQuorumTypeEnabled(consensus_params.llmqTypeChainLocks, tip,
/*optDIP0024IsActive=*/true, /*optHaveDIP0024Quorums=*/false),
true);
BOOST_CHECK_EQUAL(node.chainman->IsQuorumTypeEnabled(consensus_params.llmqTypeChainLocks, tip,
/*optDIP0024IsActive=*/true, /*optHaveDIP0024Quorums=*/true),
true);
BOOST_CHECK_EQUAL(node.chainman->IsQuorumTypeEnabled(consensus_params.llmqTypePlatform, tip,
/*optDIP0024IsActive=*/false, /*optHaveDIP0024Quorums=*/false),
Params().IsTestChain());
BOOST_CHECK_EQUAL(node.chainman->IsQuorumTypeEnabled(consensus_params.llmqTypePlatform, tip,
/*optDIP0024IsActive=*/true, /*optHaveDIP0024Quorums=*/false),
Params().IsTestChain());
BOOST_CHECK_EQUAL(node.chainman->IsQuorumTypeEnabled(consensus_params.llmqTypePlatform, tip,
/*optDIP0024IsActive=*/true, /*optHaveDIP0024Quorums=*/true),
Params().IsTestChain());
BOOST_CHECK_EQUAL(node.chainman->IsQuorumTypeEnabled(consensus_params.llmqTypeMnhf, tip,
/*optDIP0024IsActive=*/false, /*optHaveDIP0024Quorums=*/false),
true);
BOOST_CHECK_EQUAL(node.chainman->IsQuorumTypeEnabled(consensus_params.llmqTypeMnhf, tip,
/*optDIP0024IsActive=*/true, /*optHaveDIP0024Quorums=*/false),
true);
BOOST_CHECK_EQUAL(node.chainman->IsQuorumTypeEnabled(consensus_params.llmqTypeMnhf, tip,
/*optDIP0024IsActive=*/true, /*optHaveDIP0024Quorums=*/true),
true);
}
BOOST_FIXTURE_TEST_CASE(utils_IsQuorumTypeEnabled_tests_regtest, RegTestingSetup)
{
Test(m_node);
}
BOOST_FIXTURE_TEST_CASE(utils_IsQuorumTypeEnabled_tests_mainnet, TestingSetup)
{
Test(m_node);
}
BOOST_AUTO_TEST_SUITE_END()