• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

libbitcoin / libbitcoin-system / 4541988544

pending completion
4541988544

Pull #1344

github

GitHub
Merge 76663c241 into b3a9246c4
Pull Request #1344: Remove dead code, add context equality operators.

18 of 18 new or added lines in 2 files covered. (100.0%)

9429 of 11315 relevant lines covered (83.33%)

6748552.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/chain/context.cpp
1
/**
2
 * Copyright (c) 2011-2022 libbitcoin developers (see AUTHORS)
3
 *
4
 * This file is part of libbitcoin.
5
 *
6
 * This program is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU Affero General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU Affero General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Affero General Public License
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 */
19
#include <bitcoin/system/chain/context.hpp>
20

21
#include <bitcoin/system/chain/enums/forks.hpp>
22
#include <bitcoin/system/chain/enums/policy.hpp>
23

24
namespace libbitcoin {
25
namespace system {
26
namespace chain {
27

28
bool context::is_enabled(chain::forks fork) const NOEXCEPT
×
29
{
30
    return to_bool(fork & forks);
×
31
}
32

33
bool operator==(const context& left, const context& right) NOEXCEPT
×
34
{
35
    return left.forks == right.forks
×
36
        && left.timestamp == right.timestamp
×
37
        && left.median_time_past == right.median_time_past
×
38
        && left.height == right.height
×
39
        && left.minimum_block_version == right.minimum_block_version
40
        && left.work_required == right.work_required;
×
41
}
42

43
bool operator!=(const context& left, const context& right) NOEXCEPT
×
44
{
45
    return !(left == right);
×
46
}
47

48
} // namespace chain
49
} // namespace system
50
} // namespace libbitcoin
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc