38 std::vector<uint8_t> psbt_ser;
43 std::vector<uint8_t> roundtrip_ser;
45 Assert(psbt_ser == roundtrip_ser);
55 std::optional<CMutableTransaction> tx = psbt.
tx;
71 for (
size_t i = 0; i < psbt.
tx->vin.size(); ++i) {
94 (void)psbt_mut.
Merge(psbt_merge);
98 for (
unsigned int i = 0; i < psbt_merge.
tx->vin.size(); ++i) {
101 for (
unsigned int i = 0; i < psbt_merge.
tx->vout.size(); ++i) {
bool AddInput(const CTxIn &txin, PSBTInput &psbtin)
auto MakeByteSpan(const V &v) noexcept
bool FinalizePSBT(PartiallySignedTransaction &psbtx)
Finalizes a PSBT if possible, combining partial signatures.
A version of CTransaction with the PSBT format.
std::string ToString() const
bool CombinePSBTs(PartiallySignedTransaction &out, const std::vector< PartiallySignedTransaction > &psbtxs)
Combines PSBTs with the same underlying transaction, resulting in a single PSBT with all partial sign...
bool AddOutput(const CTxOut &txout, const PSBTOutput &psbtout)
bool FinalizeAndExtractPSBT(PartiallySignedTransaction &psbtx, CMutableTransaction &result)
Finalizes a PSBT if possible, and extracts it to a CMutableTransaction if it could be finalized...
std::string PSBTRoleName(PSBTRole role)
Minimal stream for reading from an existing byte array by std::span.
A structure for PSBTs which contains per output information.
std::vector< PSBTOutput > outputs
std::string ConsumeRandomLengthString(size_t max_length)
bool DecodeRawPSBT(PartiallySignedTransaction &psbt, std::span< const std::byte > tx_data, std::string &error)
Decode a raw (binary blob) PSBT into a PartiallySignedTransaction.
An output of a transaction.
std::vector< PSBTInput > inputs
std::vector< PSBTInputAnalysis > inputs
More information about the individual inputs of the transaction.
void SeedRandomStateForTest(SeedRand seedtype)
Seed the global RNG state for testing and log the seed value.
size_t CountPSBTUnsignedInputs(const PartiallySignedTransaction &psbt)
Counts the unsigned inputs of a PSBT.
bool Merge(const PartiallySignedTransaction &psbt)
Merge psbt into this.
FuzzedDataProvider & fuzzed_data_provider
Holds the results of AnalyzePSBT (miscellaneous information about a PSBT)
A mutable version of CTransaction.
bool PSBTInputSigned(const PSBTInput &input)
Checks whether a PSBTInput is already signed by checking for non-null finalized fields.
std::optional< CMutableTransaction > tx
Seed with a compile time constant of zeros.
PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
Provides helpful miscellaneous information about where a PSBT is in the signing workflow.
bool GetInputUTXO(CTxOut &utxo, int input_index) const
Finds the UTXO for a given input index.
PSBTRole next
Which of the BIP 174 roles needs to handle the transaction next.
std::map< std::vector< unsigned char >, std::vector< unsigned char > > unknown
#define Assert(val)
Identity function.