The spk for this script under the given context. If it's a Taproot output also record the spend data.
| 324 | |
| 325 | //! The spk for this script under the given context. If it's a Taproot output also record the spend data. |
| 326 | CScript ScriptPubKey(miniscript::MiniscriptContext ctx, const CScript& script, TaprootBuilder& builder) |
| 327 | { |
| 328 | if (!miniscript::IsTapscript(ctx)) return CScript() << OP_0 << WitnessV0ScriptHash(script); |
| 329 | |
| 330 | // For Taproot outputs we always use a tree with a single script and a dummy internal key. |
| 331 | builder.Add(0, script, TAPROOT_LEAF_TAPSCRIPT); |
| 332 | builder.Finalize(XOnlyPubKey::NUMS_H); |
| 333 | return GetScriptForDestination(builder.GetOutput()); |
| 334 | } |
| 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) { |
no test coverage detected