Bitcoin Core 28.99.0
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
wallet::DummyDescriptor Class Referencefinal
Inheritance diagram for wallet::DummyDescriptor:
[legend]
Collaboration diagram for wallet::DummyDescriptor:
[legend]

Public Member Functions

 DummyDescriptor (const std::string &descriptor)
 
 ~DummyDescriptor ()=default
 
std::string ToString (bool compat_format) const override
 Convert the descriptor back to a string, undoing parsing. More...
 
std::optional< OutputTypeGetOutputType () const override
 
bool IsRange () const override
 Whether the expansion of this descriptor depends on the position. More...
 
bool IsSolvable () const override
 Whether this descriptor has all information about signing ignoring lack of private keys. More...
 
bool IsSingleType () const override
 Whether this descriptor will return one scriptPubKey or multiple (aka is or is not combo) More...
 
bool ToPrivateString (const SigningProvider &provider, std::string &out) const override
 Convert the descriptor to a private string. More...
 
bool ToNormalizedString (const SigningProvider &provider, std::string &out, const DescriptorCache *cache=nullptr) const override
 Convert the descriptor to a normalized string. More...
 
bool Expand (int pos, const SigningProvider &provider, std::vector< CScript > &output_scripts, FlatSigningProvider &out, DescriptorCache *write_cache=nullptr) const override
 Expand a descriptor at a specified position. More...
 
bool ExpandFromCache (int pos, const DescriptorCache &read_cache, std::vector< CScript > &output_scripts, FlatSigningProvider &out) const override
 Expand a descriptor at a specified position using cached expansion data. More...
 
void ExpandPrivate (int pos, const SigningProvider &provider, FlatSigningProvider &out) const override
 Expand the private key for a descriptor at a specified position, if possible. More...
 
std::optional< int64_t > ScriptSize () const override
 Get the size of the scriptPubKey for this descriptor. More...
 
std::optional< int64_t > MaxSatisfactionWeight (bool) const override
 Get the maximum size of a satisfaction for this descriptor, in weight units. More...
 
std::optional< int64_t > MaxSatisfactionElems () const override
 Get the maximum size number of stack elements for satisfying this descriptor. More...
 
void GetPubKeys (std::set< CPubKey > &pubkeys, std::set< CExtPubKey > &ext_pubs) const override
 Return all (extended) public keys for this descriptor, including any from subdescriptors. More...
 
- Public Member Functions inherited from Descriptor
virtual ~Descriptor ()=default
 
virtual bool IsRange () const =0
 Whether the expansion of this descriptor depends on the position. More...
 
virtual bool IsSolvable () const =0
 Whether this descriptor has all information about signing ignoring lack of private keys. More...
 
virtual std::string ToString (bool compat_format=false) const =0
 Convert the descriptor back to a string, undoing parsing. More...
 
virtual bool IsSingleType () const =0
 Whether this descriptor will return one scriptPubKey or multiple (aka is or is not combo) More...
 
virtual bool ToPrivateString (const SigningProvider &provider, std::string &out) const =0
 Convert the descriptor to a private string. More...
 
virtual bool ToNormalizedString (const SigningProvider &provider, std::string &out, const DescriptorCache *cache=nullptr) const =0
 Convert the descriptor to a normalized string. More...
 
virtual bool Expand (int pos, const SigningProvider &provider, std::vector< CScript > &output_scripts, FlatSigningProvider &out, DescriptorCache *write_cache=nullptr) const =0
 Expand a descriptor at a specified position. More...
 
virtual bool ExpandFromCache (int pos, const DescriptorCache &read_cache, std::vector< CScript > &output_scripts, FlatSigningProvider &out) const =0
 Expand a descriptor at a specified position using cached expansion data. More...
 
virtual void ExpandPrivate (int pos, const SigningProvider &provider, FlatSigningProvider &out) const =0
 Expand the private key for a descriptor at a specified position, if possible. More...
 
virtual std::optional< OutputTypeGetOutputType () const =0
 
virtual std::optional< int64_t > ScriptSize () const =0
 Get the size of the scriptPubKey for this descriptor. More...
 
virtual std::optional< int64_t > MaxSatisfactionWeight (bool use_max_sig) const =0
 Get the maximum size of a satisfaction for this descriptor, in weight units. More...
 
virtual std::optional< int64_t > MaxSatisfactionElems () const =0
 Get the maximum size number of stack elements for satisfying this descriptor. More...
 
virtual void GetPubKeys (std::set< CPubKey > &pubkeys, std::set< CExtPubKey > &ext_pubs) const =0
 Return all (extended) public keys for this descriptor, including any from subdescriptors. More...
 

Private Attributes

std::string desc
 

Detailed Description

Definition at line 16 of file walletload_tests.cpp.

Constructor & Destructor Documentation

◆ DummyDescriptor()

wallet::DummyDescriptor::DummyDescriptor ( const std::string &  descriptor)
inlineexplicit

Definition at line 20 of file walletload_tests.cpp.

◆ ~DummyDescriptor()

wallet::DummyDescriptor::~DummyDescriptor ( )
default

Member Function Documentation

◆ Expand()

bool wallet::DummyDescriptor::Expand ( int  pos,
const SigningProvider provider,
std::vector< CScript > &  output_scripts,
FlatSigningProvider out,
DescriptorCache write_cache = nullptr 
) const
inlineoverridevirtual

Expand a descriptor at a specified position.

Parameters
[in]posThe position at which to expand the descriptor. If IsRange() is false, this is ignored.
[in]providerThe provider to query for private keys in case of hardened derivation.
[out]output_scriptsThe expanded scriptPubKeys.
[out]outScripts and public keys necessary for solving the expanded scriptPubKeys (may be equal to provider).
[out]write_cacheCache data necessary to evaluate the descriptor at this point without access to private keys.

Implements Descriptor.

Definition at line 31 of file walletload_tests.cpp.

◆ ExpandFromCache()

bool wallet::DummyDescriptor::ExpandFromCache ( int  pos,
const DescriptorCache read_cache,
std::vector< CScript > &  output_scripts,
FlatSigningProvider out 
) const
inlineoverridevirtual

Expand a descriptor at a specified position using cached expansion data.

Parameters
[in]posThe position at which to expand the descriptor. If IsRange() is false, this is ignored.
[in]read_cacheCached expansion data.
[out]output_scriptsThe expanded scriptPubKeys.
[out]outScripts and public keys necessary for solving the expanded scriptPubKeys (may be equal to provider).

Implements Descriptor.

Definition at line 32 of file walletload_tests.cpp.

◆ ExpandPrivate()

void wallet::DummyDescriptor::ExpandPrivate ( int  pos,
const SigningProvider provider,
FlatSigningProvider out 
) const
inlineoverridevirtual

Expand the private key for a descriptor at a specified position, if possible.

Parameters
[in]posThe position at which to expand the descriptor. If IsRange() is false, this is ignored.
[in]providerThe provider to query for the private keys.
[out]outAny private keys available for the specified pos.

Implements Descriptor.

Definition at line 33 of file walletload_tests.cpp.

◆ GetOutputType()

std::optional< OutputType > wallet::DummyDescriptor::GetOutputType ( ) const
inlineoverridevirtual
Returns
The OutputType of the scriptPubKey(s) produced by this descriptor. Or nullopt if indeterminate (multiple or none)

Implements Descriptor.

Definition at line 24 of file walletload_tests.cpp.

◆ GetPubKeys()

void wallet::DummyDescriptor::GetPubKeys ( std::set< CPubKey > &  pubkeys,
std::set< CExtPubKey > &  ext_pubs 
) const
inlineoverridevirtual

Return all (extended) public keys for this descriptor, including any from subdescriptors.

Parameters
[out]pubkeysAny public keys
[out]ext_pubsAny extended public keys

Implements Descriptor.

Definition at line 37 of file walletload_tests.cpp.

◆ IsRange()

bool wallet::DummyDescriptor::IsRange ( ) const
inlineoverridevirtual

Whether the expansion of this descriptor depends on the position.

Implements Descriptor.

Definition at line 26 of file walletload_tests.cpp.

◆ IsSingleType()

bool wallet::DummyDescriptor::IsSingleType ( ) const
inlineoverridevirtual

Whether this descriptor will return one scriptPubKey or multiple (aka is or is not combo)

Implements Descriptor.

Definition at line 28 of file walletload_tests.cpp.

◆ IsSolvable()

bool wallet::DummyDescriptor::IsSolvable ( ) const
inlineoverridevirtual

Whether this descriptor has all information about signing ignoring lack of private keys.

This is true for all descriptors except ones that use raw or addr constructions.

Implements Descriptor.

Definition at line 27 of file walletload_tests.cpp.

◆ MaxSatisfactionElems()

std::optional< int64_t > wallet::DummyDescriptor::MaxSatisfactionElems ( ) const
inlineoverridevirtual

Get the maximum size number of stack elements for satisfying this descriptor.

Implements Descriptor.

Definition at line 36 of file walletload_tests.cpp.

◆ MaxSatisfactionWeight()

std::optional< int64_t > wallet::DummyDescriptor::MaxSatisfactionWeight ( bool  use_max_sig) const
inlineoverridevirtual

Get the maximum size of a satisfaction for this descriptor, in weight units.

Parameters
use_max_sigWhether to assume ECDSA signatures will have a high-r.

Implements Descriptor.

Definition at line 35 of file walletload_tests.cpp.

◆ ScriptSize()

std::optional< int64_t > wallet::DummyDescriptor::ScriptSize ( ) const
inlineoverridevirtual

Get the size of the scriptPubKey for this descriptor.

Implements Descriptor.

Definition at line 34 of file walletload_tests.cpp.

◆ ToNormalizedString()

bool wallet::DummyDescriptor::ToNormalizedString ( const SigningProvider provider,
std::string &  out,
const DescriptorCache cache = nullptr 
) const
inlineoverridevirtual

Convert the descriptor to a normalized string.

Normalized descriptors have the xpub at the last hardened step. This fails if the provided provider does not have the private keys to derive that xpub.

Implements Descriptor.

Definition at line 30 of file walletload_tests.cpp.

◆ ToPrivateString()

bool wallet::DummyDescriptor::ToPrivateString ( const SigningProvider provider,
std::string &  out 
) const
inlineoverridevirtual

Convert the descriptor to a private string.

This fails if the provided provider does not have the relevant private keys.

Implements Descriptor.

Definition at line 29 of file walletload_tests.cpp.

◆ ToString()

std::string wallet::DummyDescriptor::ToString ( bool  compat_format) const
inlineoverridevirtual

Convert the descriptor back to a string, undoing parsing.

Implements Descriptor.

Definition at line 23 of file walletload_tests.cpp.

Member Data Documentation

◆ desc

std::string wallet::DummyDescriptor::desc
private

Definition at line 18 of file walletload_tests.cpp.


The documentation for this class was generated from the following file: