forked from libbitcoin/libbitcoin-node
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsettings.cpp
More file actions
65 lines (58 loc) · 2.78 KB
/
settings.cpp
File metadata and controls
65 lines (58 loc) · 2.78 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
/**
* Copyright (c) 2011-2026 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "test.hpp"
BOOST_AUTO_TEST_SUITE(settings_tests)
using namespace bc::network;
using namespace bc::system::chain;
// [node]
BOOST_AUTO_TEST_CASE(settings__node__default_context__expected)
{
using namespace network;
const node::settings node{};
BOOST_REQUIRE_EQUAL(node.delay_inbound, true);
BOOST_REQUIRE_EQUAL(node.headers_first, true);
BOOST_REQUIRE_EQUAL(node.memory_priority, true);
BOOST_REQUIRE_EQUAL(node.thread_priority, true);
BOOST_REQUIRE_EQUAL(node.allow_overlapped, true);
BOOST_REQUIRE_EQUAL(node.defer_validation, false);
BOOST_REQUIRE_EQUAL(node.defer_confirmation, false);
BOOST_REQUIRE_EQUAL(node.minimum_fee_rate, 0.0);
BOOST_REQUIRE_EQUAL(node.minimum_bump_rate, 0.0);
BOOST_REQUIRE_EQUAL(node.allowed_deviation, 1.5);
BOOST_REQUIRE_EQUAL(node.announcement_cache, 42_u16);
BOOST_REQUIRE_EQUAL(node.allocation_multiple, 20_u16);
////BOOST_REQUIRE_EQUAL(node.snapshot_bytes, 200'000'000'000_u64);
////BOOST_REQUIRE_EQUAL(node.snapshot_valid, 250'000_u32);
////BOOST_REQUIRE_EQUAL(node.snapshot_confirm, 500'000_u32);
BOOST_REQUIRE_EQUAL(node.maximum_height, 0_u32);
BOOST_REQUIRE_EQUAL(node.maximum_height_(), max_size_t);
BOOST_REQUIRE_EQUAL(node.maximum_concurrency, 50000_u32);
BOOST_REQUIRE_EQUAL(node.maximum_concurrency_(), 50000_size);
BOOST_REQUIRE_EQUAL(node.sample_period_seconds, 10_u16);
BOOST_REQUIRE_EQUAL(node.currency_window_minutes, 1440_u32);
BOOST_REQUIRE_EQUAL(node.threads, 1_u32);
BOOST_REQUIRE_EQUAL(node.threads_(), one);
BOOST_REQUIRE_EQUAL(node.maximum_height_(), max_size_t);
BOOST_REQUIRE_EQUAL(node.maximum_concurrency_(), 50'000_size);
BOOST_REQUIRE(node.sample_period() == steady_clock::duration(seconds(10)));
BOOST_REQUIRE(node.currency_window() == steady_clock::duration(minutes(1440)));
BOOST_REQUIRE(node.thread_priority_() == network::processing_priority::high);
BOOST_REQUIRE(node.memory_priority_() == network::memory_priority::highest);
}
BOOST_AUTO_TEST_SUITE_END()