diff options
author | fanquake <fanquake@gmail.com> | 2022-07-22 08:36:00 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-07-22 08:40:36 +0100 |
commit | 510ac41eac068d58fd0cedf2e8f99f8c7ef533aa (patch) | |
tree | 338c49011a4b0a6d463c93579cc0baddda1c936a /src/test | |
parent | 86133df7a2be80203fa439bf344e1f45dc2be41d (diff) | |
parent | faf9accd662974a69390213fee1b5c6237846b42 (diff) | |
download | bitcoin-510ac41eac068d58fd0cedf2e8f99f8c7ef533aa.tar.xz |
Merge bitcoin/bitcoin#25331: Add HashWriter without ser-type and ser-version and use it where possible
faf9accd662974a69390213fee1b5c6237846b42 Use HashWriter where possible (MacroFake)
faa5425629d35708326b255570c51139aef0c8c4 Add HashWriter without ser-type and ser-version (MacroFake)
Pull request description:
This was done in the context of https://github.com/bitcoin/bitcoin/pull/25284 , but I think it also makes sense standalone.
The basic idea is that serialization type should not be initialized when it is not needed. Same for the serialization version.
So do this here for `HashWriter`. `CHashWriter` remains in places where it is not yet possible.
ACKs for top commit:
sipa:
utACK faf9accd662974a69390213fee1b5c6237846b42
Empact:
utACK https://github.com/bitcoin/bitcoin/pull/25331/commits/faf9accd662974a69390213fee1b5c6237846b42
Tree-SHA512: 544cc712436e49f6e608120bcd3ddc5ea72dd236554ce30fb6cfff34a92d7e67b6e6527336ad0f5b6365e2b2884f4c6508aef775953ccd9312f17752729703f2
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/script_tests.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 05bb89ab55..fbcf1f14ef 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -1813,7 +1813,7 @@ BOOST_AUTO_TEST_CASE(bip341_keypath_test_vectors) BOOST_CHECK_EQUAL(HexStr(sighash), input["intermediary"]["sigHash"].get_str()); // To verify the sigmsg, hash the expected sigmsg, and compare it with the (expected) sighash. - BOOST_CHECK_EQUAL(HexStr((CHashWriter(HASHER_TAPSIGHASH) << Span{ParseHex(input["intermediary"]["sigMsg"].get_str())}).GetSHA256()), input["intermediary"]["sigHash"].get_str()); + BOOST_CHECK_EQUAL(HexStr((HashWriter{HASHER_TAPSIGHASH} << Span{ParseHex(input["intermediary"]["sigMsg"].get_str())}).GetSHA256()), input["intermediary"]["sigHash"].get_str()); } } |