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

Function ScriptPubKey

src/test/fuzz/miniscript.cpp:1010–1018  ·  view source on GitHub ↗

The spk for this script under the given context. If it's a Taproot output also record the spend data.

Source from the content-addressed store, hash-verified

1008
1009//! The spk for this script under the given context. If it's a Taproot output also record the spend data.
1010CScript 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.
1021void SatisfactionToWitness(MsCtx ctx, CScriptWitness& witness, const CScript& script, TaprootBuilder& builder) {

Callers 1

TestNodeFunction · 0.70

Calls 7

IsTapscriptFunction · 0.85
WitnessV0ScriptHashClass · 0.85
GetScriptForDestinationFunction · 0.85
CScriptClass · 0.50
AddMethod · 0.45
FinalizeMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected