mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Merge ElementsProject/elements#1043: fuzz: update psbt fuzztest for PSBT2 changes
bcd7de55a4fuzz: update psbt fuzztest for PSBT2 changes (Andrew Poelstra) Pull request description: The `psbt.tx` Optional is no longer safe to dereference just because decoding succeeded. ACKs for top commit: achow101: ACKbcd7de55a4Tree-SHA512: 701ace683a2615a944903ec69a20d1808da03009bec6e7af76954476d4e66b122fe01657285252b90fad92cc8aadd46095c80a1ccf454ae11f0e86a550ce1a0b
This commit is contained in:
commit
787ee1e91f
1 changed files with 4 additions and 7 deletions
|
|
@ -42,11 +42,8 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
|||
|
||||
(void)psbt.IsNull();
|
||||
|
||||
Optional<CMutableTransaction> tx = psbt.tx;
|
||||
if (tx) {
|
||||
const CMutableTransaction& mtx = *tx;
|
||||
const PartiallySignedTransaction psbt_from_tx{mtx};
|
||||
}
|
||||
const CMutableTransaction& mtx = psbt.GetUnsignedTx();
|
||||
const PartiallySignedTransaction psbt_from_tx{mtx};
|
||||
|
||||
for (const PSBTInput& input : psbt.inputs) {
|
||||
(void)PSBTInputSigned(input);
|
||||
|
|
@ -57,9 +54,9 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
|||
(void)output.IsNull();
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < psbt.tx->vin.size(); ++i) {
|
||||
for (const auto& input : psbt.inputs) {
|
||||
CTxOut tx_out;
|
||||
if (psbt.inputs.at(i).GetUTXO(tx_out)) {
|
||||
if (input.GetUTXO(tx_out)) {
|
||||
(void)tx_out.IsNull();
|
||||
(void)tx_out.ToString();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue