mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
scripted-diff: Use std::span over Span
-BEGIN VERIFY SCRIPT-
ren() { sed -i "s!\<$1\>!$2!g" $( git grep -l "$1" -- "./src" ":(exclude)src/span.h" ":(exclude)src/leveldb/db/log_test.cc" ) ; }
ren Span std::span
ren AsBytes std::as_bytes
ren AsWritableBytes std::as_writable_bytes
sed -i 's!SpanPopBack(Span!SpanPopBack(std::span!g' ./src/span.h
-END VERIFY SCRIPT-
This commit is contained in:
@@ -258,7 +258,7 @@ public:
|
||||
CScript scriptPubKey = script;
|
||||
if (wm == WitnessMode::PKH) {
|
||||
uint160 hash;
|
||||
CHash160().Write(Span{script}.subspan(1)).Finalize(hash);
|
||||
CHash160().Write(std::span{script}.subspan(1)).Finalize(hash);
|
||||
script = CScript() << OP_DUP << OP_HASH160 << ToByteVector(hash) << OP_EQUALVERIFY << OP_CHECKSIG;
|
||||
scriptPubKey = CScript() << witnessversion << ToByteVector(hash);
|
||||
} else if (wm == WitnessMode::SH) {
|
||||
@@ -1719,8 +1719,8 @@ BOOST_AUTO_TEST_CASE(compute_tapleaf)
|
||||
constexpr uint256 tlc0{"edbc10c272a1215dcdcc11d605b9027b5ad6ed97cd45521203f136767b5b9c06"};
|
||||
constexpr uint256 tlc2{"8b5c4f90ae6bf76e259dbef5d8a59df06359c391b59263741b25eca76451b27a"};
|
||||
|
||||
BOOST_CHECK_EQUAL(ComputeTapleafHash(0xc0, Span(script)), tlc0);
|
||||
BOOST_CHECK_EQUAL(ComputeTapleafHash(0xc2, Span(script)), tlc2);
|
||||
BOOST_CHECK_EQUAL(ComputeTapleafHash(0xc0, std::span(script)), tlc0);
|
||||
BOOST_CHECK_EQUAL(ComputeTapleafHash(0xc2, std::span(script)), tlc2);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user