MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / SatisfactionToWitness

Function SatisfactionToWitness

src/test/fuzz/miniscript.cpp:1021–1027  ·  view source on GitHub ↗

Fill the witness with the data additional to the script satisfaction.

Source from the content-addressed store, hash-verified

1019
1020//! Fill the witness with the data additional to the script satisfaction.
1021void SatisfactionToWitness(MsCtx ctx, CScriptWitness& witness, const CScript& script, TaprootBuilder& builder) {
1022 // For P2WSH, it's only the witness script.
1023 witness.stack.emplace_back(script.begin(), script.end());
1024 if (!miniscript::IsTapscript(ctx)) return;
1025 // For Tapscript we also need the control block.
1026 witness.stack.push_back(*builder.GetSpendData().scripts.begin()->second.begin());
1027}
1028
1029/** Perform various applicable tests on a miniscript Node. */
1030void TestNode(const MsCtx script_ctx, const std::optional<Node>& node, FuzzedDataProvider& provider)

Callers 1

TestNodeFunction · 0.70

Calls 6

IsTapscriptFunction · 0.85
GetSpendDataMethod · 0.80
emplace_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected