Coverage Report

Created: 2024-10-21 15:10

/root/bitcoin/src/test/util/script.h
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) 2021 The Bitcoin 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
#ifndef BITCOIN_TEST_UTIL_SCRIPT_H
6
#define BITCOIN_TEST_UTIL_SCRIPT_H
7
8
#include <crypto/sha256.h>
9
#include <script/script.h>
10
11
static const std::vector<uint8_t> WITNESS_STACK_ELEM_OP_TRUE{uint8_t{OP_TRUE}};
12
static const CScript P2WSH_OP_TRUE{
13
    CScript{}
14
    << OP_0
15
0
    << ToByteVector([] {
16
0
           uint256 hash;
17
0
           CSHA256().Write(WITNESS_STACK_ELEM_OP_TRUE.data(), WITNESS_STACK_ELEM_OP_TRUE.size()).Finalize(hash.begin());
18
0
           return hash;
19
0
       }())};
Unexecuted instantiation: mini_miner.cpp:_ZNK3$_0clEv
Unexecuted instantiation: p2p_headers_presync.cpp:_ZNK3$_0clEv
Unexecuted instantiation: package_eval.cpp:_ZNK3$_0clEv
Unexecuted instantiation: script_flags.cpp:_ZNK3$_0clEv
Unexecuted instantiation: signature_checker.cpp:_ZNK3$_0clEv
Unexecuted instantiation: tx_pool.cpp:_ZNK3$_0clEv
Unexecuted instantiation: util.cpp:_ZNK3$_0clEv
Unexecuted instantiation: mining.cpp:_ZNK3$_0clEv
Unexecuted instantiation: script.cpp:_ZNK3$_0clEv
20
21
static const std::vector<uint8_t> EMPTY{};
22
static const CScript P2WSH_EMPTY{
23
    CScript{}
24
    << OP_0
25
0
    << ToByteVector([] {
26
0
           uint256 hash;
27
0
           CSHA256().Write(EMPTY.data(), EMPTY.size()).Finalize(hash.begin());
28
0
           return hash;
29
0
       }())};
Unexecuted instantiation: mini_miner.cpp:_ZNK3$_1clEv
Unexecuted instantiation: p2p_headers_presync.cpp:_ZNK3$_1clEv
Unexecuted instantiation: package_eval.cpp:_ZNK3$_1clEv
Unexecuted instantiation: script_flags.cpp:_ZNK3$_1clEv
Unexecuted instantiation: signature_checker.cpp:_ZNK3$_1clEv
Unexecuted instantiation: tx_pool.cpp:_ZNK3$_1clEv
Unexecuted instantiation: util.cpp:_ZNK3$_1clEv
Unexecuted instantiation: mining.cpp:_ZNK3$_1clEv
Unexecuted instantiation: script.cpp:_ZNK3$_1clEv
30
static const std::vector<std::vector<uint8_t>> P2WSH_EMPTY_TRUE_STACK{{static_cast<uint8_t>(OP_TRUE)}, {}};
31
static const std::vector<std::vector<uint8_t>> P2WSH_EMPTY_TWO_STACK{{static_cast<uint8_t>(OP_2)}, {}};
32
33
/** Flags that are not forbidden by an assert in script validation */
34
bool IsValidFlagCombination(unsigned flags);
35
36
#endif // BITCOIN_TEST_UTIL_SCRIPT_H