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

Function SatisfactionToWitness

src/test/miniscript_tests.cpp:337–343  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

335
336//! Fill the witness with the data additional to the script satisfaction.
337void SatisfactionToWitness(miniscript::MiniscriptContext ctx, CScriptWitness& witness, const CScript& script, TaprootBuilder& builder) {
338 // For P2WSH, it's only the witness script.
339 witness.stack.emplace_back(script.begin(), script.end());
340 if (!miniscript::IsTapscript(ctx)) return;
341 // For Tapscript we also need the control block.
342 witness.stack.push_back(*builder.GetSpendData().scripts.begin()->second.begin());
343}
344
345struct MiniScriptTest : BasicTestingSetup {
346/** Run random satisfaction tests. */

Callers 1

TestSatisfyMethod · 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