/
githubmirror
/
bitcoin
Обзор
Документация
Войти
/
githubmirror
/
bitcoin
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/test/util/script.h
37 строк
1 KB
MarcoFalke
scripted-diff: [doc] Unify stale copyright headers
17 дек 2025, 00:21
17 дек 2025, 00:21
fa5f297
Код
Авторство
О чём код?
// Copyright (c) 2021-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_TEST_UTIL_SCRIPT_H #define BITCOIN_TEST_UTIL_SCRIPT_H #include <crypto/sha256.h> #include <script/script.h> #include <script/verify_flags.h> static const std::vector<uint8_t> WITNESS_STACK_ELEM_OP_TRUE{uint8_t{OP_TRUE}}; static const CScript P2WSH_OP_TRUE{ CScript{} << OP_0 << ToByteVector([] { uint256 hash; CSHA256().Write(WITNESS_STACK_ELEM_OP_TRUE.data(), WITNESS_STACK_ELEM_OP_TRUE.size()).Finalize(hash.begin()); return hash; }())}; static const std::vector<uint8_t> EMPTY{}; static const CScript P2WSH_EMPTY{ CScript{} << OP_0 << ToByteVector([] { uint256 hash; CSHA256().Write(EMPTY.data(), EMPTY.size()).Finalize(hash.begin()); return hash; }())}; static const std::vector<std::vector<uint8_t>> P2WSH_EMPTY_TRUE_STACK{{static_cast<uint8_t>(OP_TRUE)}, {}}; static const std::vector<std::vector<uint8_t>> P2WSH_EMPTY_TWO_STACK{{static_cast<uint8_t>(OP_2)}, {}}; /** Flags that are not forbidden by an assert in script validation */ bool IsValidFlagCombination(script_verify_flags flags); #endif // BITCOIN_TEST_UTIL_SCRIPT_H