mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-02 09:46:14 +00:00
Suggested by @l0rinc in #34004 Message by @l0rinc: This adds a consteval constructor to transaction_identifier (Txid/Wtxid) to allow parsing hex strings at compile-time. This replaces runtime FromHex checks in tests, ensuring that malformed hardcoded hashes cause build failures rather than runtime test failures. Test variables are explicitly marked constexpr. This is required to workaround a regression in GCC 14 (Bug 117501) where the compiler incorrectly flags consteval initialization of non-constexpr variables as "statements with no effect". GCC Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117501 Reproducer: https://godbolt.org/z/xb5TMaPs6 Co-authored-by: l0rinc <pap.lorinc@gmail.com>