Fill the witness with the data additional to the script satisfaction.
| 335 | |
| 336 | //! Fill the witness with the data additional to the script satisfaction. |
| 337 | void 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 | |
| 345 | struct MiniScriptTest : BasicTestingSetup { |
| 346 | /** Run random satisfaction tests. */ |
no test coverage detected