MCPcopy Create free account
hub / github.com/ElementsProject/elements / ToStringSubScriptHelper

Method ToStringSubScriptHelper

src/script/descriptor.cpp:865–885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

863 return Vector(GetScriptForDestination(output));
864 }
865 bool ToStringSubScriptHelper(const SigningProvider* arg, std::string& ret, const StringType type, const DescriptorCache* cache = nullptr) const override
866 {
867 if (m_depths.empty()) return true;
868 std::vector<bool> path;
869 for (size_t pos = 0; pos < m_depths.size(); ++pos) {
870 if (pos) ret += ',';
871 while ((int)path.size() <= m_depths[pos]) {
872 if (path.size()) ret += '{';
873 path.push_back(false);
874 }
875 std::string tmp;
876 if (!m_subdescriptor_args[pos]->ToStringHelper(arg, tmp, type, cache)) return false;
877 ret += std::move(tmp);
878 while (!path.empty() && path.back()) {
879 if (path.size() > 1) ret += '}';
880 path.pop_back();
881 }
882 if (!path.empty()) path.back() = true;
883 }
884 return true;
885 }
886public:
887 TRDescriptor(std::unique_ptr<PubkeyProvider> internal_key, std::vector<std::unique_ptr<DescriptorImpl>> descs, std::vector<int> depths) :
888 DescriptorImpl(Vector(std::move(internal_key)), std::move(descs), "tr"), m_depths(std::move(depths))

Callers

nothing calls this directly

Calls 5

ToStringHelperMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected