Fill the witness with the data additional to the script satisfaction.
| 1019 | |
| 1020 | //! Fill the witness with the data additional to the script satisfaction. |
| 1021 | void 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. */ |
| 1030 | void TestNode(const MsCtx script_ctx, const std::optional<Node>& node, FuzzedDataProvider& provider) |
no test coverage detected