diff options
author | Pieter Wuille <pieter@wuille.net> | 2021-11-01 16:32:53 -0400 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2021-11-29 17:58:53 -0500 |
commit | 568dd2f83900a11a4dbba1250722791a135bf0a9 (patch) | |
tree | b9091ef5f60075570c9f0e0c487282450e152ec0 /src/script | |
parent | 383d350bd5107bfe00e3b90a00cab9a3c1397c72 (diff) | |
download | bitcoin-568dd2f83900a11a4dbba1250722791a135bf0a9.tar.xz |
Replace MakeSpan helper with Span deduction guide
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/descriptor.cpp | 6 | ||||
-rw-r--r-- | src/script/sign.cpp | 2 | ||||
-rw-r--r-- | src/script/sign.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp index c3b4d1ddaa..1c99df147b 100644 --- a/src/script/descriptor.cpp +++ b/src/script/descriptor.cpp @@ -631,7 +631,7 @@ public: out.origins.emplace(entry.first.GetID(), std::make_pair<CPubKey, KeyOriginInfo>(CPubKey(entry.first), std::move(entry.second))); } - output_scripts = MakeScripts(pubkeys, MakeSpan(subscripts), out); + output_scripts = MakeScripts(pubkeys, Span{subscripts}, out); return true; } @@ -974,10 +974,10 @@ std::unique_ptr<PubkeyProvider> ParsePubkeyInner(uint32_t key_exp_index, const S } KeyPath path; DeriveType type = DeriveType::NO; - if (split.back() == MakeSpan("*").first(1)) { + if (split.back() == Span{"*"}.first(1)) { split.pop_back(); type = DeriveType::UNHARDENED; - } else if (split.back() == MakeSpan("*'").first(2) || split.back() == MakeSpan("*h").first(2)) { + } else if (split.back() == Span{"*'"}.first(2) || split.back() == Span{"*h"}.first(2)) { split.pop_back(); type = DeriveType::HARDENED; } diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 8e044b1e00..3f7060879c 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -167,7 +167,7 @@ static bool SignTaprootScript(const SigningProvider& provider, const BaseSignatu // <xonly pubkey> OP_CHECKSIG if (script.size() == 34 && script[33] == OP_CHECKSIG && script[0] == 0x20) { - XOnlyPubKey pubkey(MakeSpan(script).subspan(1, 32)); + XOnlyPubKey pubkey{Span{script}.subspan(1, 32)}; std::vector<unsigned char> sig; if (CreateTaprootScriptSig(creator, sigdata, provider, sig, pubkey, leaf_hash, sigversion)) { result = Vector(std::move(sig)); diff --git a/src/script/sign.h b/src/script/sign.h index 62335b644a..50525af332 100644 --- a/src/script/sign.h +++ b/src/script/sign.h @@ -149,7 +149,7 @@ void SerializeHDKeypaths(Stream& s, const std::map<CPubKey, KeyOriginInfo>& hd_k if (!keypath_pair.first.IsValid()) { throw std::ios_base::failure("Invalid CPubKey being serialized"); } - SerializeToVector(s, type, MakeSpan(keypath_pair.first)); + SerializeToVector(s, type, Span{keypath_pair.first}); WriteCompactSize(s, (keypath_pair.second.path.size() + 1) * sizeof(uint32_t)); s << keypath_pair.second.fingerprint; for (const auto& path : keypath_pair.second.path) { |