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

libbitcoin / libbitcoin-system / 8057926070

27 Feb 2024 01:00AM UTC coverage: 82.614% (-0.02%) from 82.629%
8057926070

Pull #1411

github

web-flow
Merge 24b08470c into e8296511c
Pull Request #1411: Add settings, checkpoint.equals, uint256_t serialize, chain_state.cumulative_work.

19 of 31 new or added lines in 4 files covered. (61.29%)

2 existing lines in 1 file now uncovered.

9641 of 11670 relevant lines covered (82.61%)

4887990.42 hits per line

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

90.91
/src/endian/uintx_t.cpp
1
/**
2
 * Copyright (c) 2011-2023 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/define.hpp>
20
#include <bitcoin/system/stream/stream.hpp>
21

22
namespace libbitcoin {
23
namespace system {
24

25
std::istream& operator>>(std::istream& stream, uint256_t& out) THROWS
1✔
26
{
27
    std::string value{};
1✔
28
    stream >> value;
1✔
29

30
    hash_digest hash{};
1✔
31
    if (!decode_hash(hash, value))
1✔
NEW
32
        throw istream_exception(value);
×
33

34
    out = to_uintx(hash);
1✔
35
    return stream;
1✔
36
}
37

38
std::ostream& operator<<(std::ostream& stream, const uint256_t& in) NOEXCEPT
1✔
39
{
40
    stream << encode_hash(from_uintx(in));
1✔
41
    return stream;
1✔
42
}
43

44
} // namespace system
45
} // 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

© 2026 Coveralls, Inc