psbt: make PSBT structs into classes

This commit is contained in:
Ava Chow
2026-03-17 11:33:47 -07:00
parent f926c326bb
commit 7eacc21ff6
4 changed files with 9 additions and 6 deletions

View File

@@ -11,7 +11,7 @@
#include <string>
#include <vector>
struct PartiallySignedTransaction;
class PartiallySignedTransaction;
//! Enables interaction with an external signing device or service, such as
//! a hardware wallet. See doc/external-signer.md

View File

@@ -32,7 +32,7 @@ class CFeeRate;
class CKey;
enum class FeeReason;
enum class OutputType;
struct PartiallySignedTransaction;
class PartiallySignedTransaction;
struct bilingual_str;
namespace common {
enum class PSBTError;

View File

@@ -261,8 +261,9 @@ static inline void ExpectedKeySize(const std::string& key_name, const std::vecto
}
/** A structure for PSBTs which contain per-input information */
struct PSBTInput
class PSBTInput
{
public:
CTransactionRef non_witness_utxo;
CTxOut witness_utxo;
CScript redeem_script;
@@ -791,8 +792,9 @@ struct PSBTInput
};
/** A structure for PSBTs which contains per output information */
struct PSBTOutput
class PSBTOutput
{
public:
CScript redeem_script;
CScript witness_script;
std::map<CPubKey, KeyOriginInfo> hd_keypaths;
@@ -1027,8 +1029,9 @@ struct PSBTOutput
};
/** A version of CTransaction with the PSBT format*/
struct PartiallySignedTransaction
class PartiallySignedTransaction
{
public:
std::optional<CMutableTransaction> tx;
// We use a vector of CExtPubKey in the event that there happens to be the same KeyOriginInfos for different CExtPubKeys
// Note that this map swaps the key and values from the serialization

View File

@@ -74,7 +74,7 @@ struct CBlockLocator;
struct CExtKey;
struct FlatSigningProvider;
struct KeyOriginInfo;
struct PartiallySignedTransaction;
class PartiallySignedTransaction;
struct SignatureData;
using LoadWalletFn = std::function<void(std::unique_ptr<interfaces::Wallet> wallet)>;