The motivation for this PR came while reviewing PR#35553, I noticed on corecheck that the IsNull() functions of PartiallySignedTransaction, PSBTInput, PSBTOutput weren't covered by any test.
This PR adds coverage for all of them.
This cases can be tested with the next diffs that don't cause test failure prior to this PR, but with this new test do:
<details> <summary>Diff for <code>PartiallySignedTransaction</code></summary>
diff --git a/src/psbt.cpp b/src/psbt.cpp
index 8f2e9ab16f..59bb05822d 100644
--- a/src/psbt.cpp
+++ b/src/psbt.cpp
@@ -33,7 +33,7 @@ PartiallySignedTransaction::PartiallySignedTransaction(const CMutableTransaction
bool PartiallySignedTransaction::IsNull() const
{
- return inputs.empty() && outputs.empty() && unknown.empty();
+ return inputs.empty() && outputs.empty() && !unknown.empty();
}
</details>
<details> <summary>Diff for <code>PSBTInput</code></summary>
diff --git a/src/psbt.cpp b/src/psbt.cpp
index 8f2e9ab16f..20c745f7a4 100644
--- a/src/psbt.cpp
+++ b/src/psbt.cpp
@@ -291,7 +291,7 @@ COutPoint PSBTInput::GetOutPoint() const
bool PSBTInput::IsNull() const
{
- return !non_witness_utxo && witness_utxo.IsNull() && partial_sigs.empty() && unknown.empty() && hd_keypaths.empty() && redeem_script.empty() && witness_script.empty();
+ return non_witness_utxo && witness_utxo.IsNull() && partial_sigs.empty() && unknown.empty() && hd_keypaths.empty() && redeem_script.empty() && witness_script.empty();
}
</details>
<details> <summary>Diff for <code>PSBTOutput</code></summary>
diff --git a/src/psbt.cpp b/src/psbt.cpp
index 8f2e9ab16f..fdfdfe903f 100644
--- a/src/psbt.cpp
+++ b/src/psbt.cpp
@@ -530,7 +530,7 @@ void PSBTOutput::FromSignatureData(const SignatureData& sigdata)
bool PSBTOutput::IsNull() const
{
- return redeem_script.empty() && witness_script.empty() && hd_keypaths.empty() && unknown.empty();
+ return !redeem_script.empty() && witness_script.empty() && hd_keypaths.empty() && unknown.empty();
}
</details>