The spk for this script under the given context. If it's a Taproot output also record the spend data.
| 1008 | |
| 1009 | //! The spk for this script under the given context. If it's a Taproot output also record the spend data. |
| 1010 | CScript ScriptPubKey(MsCtx ctx, const CScript& script, TaprootBuilder& builder) |
| 1011 | { |
| 1012 | if (!miniscript::IsTapscript(ctx)) return CScript() << OP_0 << WitnessV0ScriptHash(script); |
| 1013 | |
| 1014 | // For Taproot outputs we always use a tree with a single script and a dummy internal key. |
| 1015 | builder.Add(0, script, TAPROOT_LEAF_TAPSCRIPT); |
| 1016 | builder.Finalize(XOnlyPubKey::NUMS_H); |
| 1017 | return GetScriptForDestination(builder.GetOutput()); |
| 1018 | } |
| 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) { |
no test coverage detected