Repository: rust-bitcoin/rust-bitcoin
Pull request #3681 (2024-11-28 14:49:56)

hashes: Documents C-QUESTION-MARK
To conform to Rust API guidelines in Issue #3633 examples should use ?, not try!, not unwrap (C-QUESTION-MARK).

The examples were originally labelled `## Commonly used operations`, change the label to `# Examples`.
Replace `unwrap()` with `expect()` since these cases cannot error.  

Two uses of `unwrap()` have been left since they are in a set of three writes with an engine that can not error and the first case uses `expect()` with the relevant error message.

coveralls: ## Pull Request Test Coverage Report for [Build 12071150055](https://coveralls.io/builds/71102696)


### Details

* **0** of **0**   changed or added relevant lines in **0** files are covered.
* No unchanged relevant lines lost coverage.
* Overall coverage remained the same at **82.791%**

---



|  Totals | [![Coverage Status](https://coveralls.io/builds/71102696/badge)](https://coveralls.io/builds/71102696) |
| :-- | --: |
| Change from base [Build 12069835083](https://coveralls.io/builds/71101277): |  0.0% |
| Covered Lines: | 20139 |
| Relevant Lines: | 24325 |

---
##### 💛  - [Coveralls](https://coveralls.io)

apoelstra: In 0828555ee1e09ddbc614414f373e8b2cdc519377:

In these examples the error paths literally cannot occur. Writing to an io engine never errors and reading from a `&[u8]` never errors.
jamillambert: I have changed it to use `expect()` in all cases where `unwrap()` was used, instead of `?`.

Patch:
diff --git a/bitcoin/Cargo.toml b/bitcoin/Cargo.toml
index ee854c75..c4ba294c 100644
--- a/bitcoin/Cargo.toml
+++ b/bitcoin/Cargo.toml
@@ -71,10 +71,6 @@ required-features = ["std", "bitcoinconsensus"]
 name = "ecdsa-psbt-simple"
 required-features = ["rand-std"]
 
-[[example]]
-name = "create-p2wpkh-address"
-required-features = ["rand-std"]
-
 [[example]]
 name = "sign-tx-segwit-v0"
 required-features = ["rand-std"]
diff --git a/bitcoin/examples/create-p2wpkh-address.rs b/bitcoin/examples/create-p2wpkh-address.rs
deleted file mode 100644
index b8ec758f..00000000
--- a/bitcoin/examples/create-p2wpkh-address.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-use bitcoin::secp256k1::{rand, Secp256k1};
-use bitcoin::{Address, CompressedPublicKey, Network, PrivateKey};
-
-/// Generate a P2WPKH (pay-to-witness-public-key-hash) address and print it
-/// along with the associated private key needed to transact.
-fn main() {
-    // Create new secp256k1 instance.
-    let secp = Secp256k1::new();
-
-    // Generate secp256k1 public and private key pair.
-    let (secret_key, public_key) = secp.generate_keypair(&mut rand::thread_rng());
-
-    // Create a Bitcoin private key to be used on the Bitcoin mainnet.
-    let private_key = PrivateKey::new(secret_key, Network::Bitcoin);
-
-    // Create a compressed Bitcoin public key from the secp256k1 public key.
-    let public_key = CompressedPublicKey(public_key);
-
-    // Create a Bitcoin P2WPKH address.
-    let address = Address::p2wpkh(public_key, Network::Bitcoin);
-
-    println!("Private Key: {}", private_key);
-    println!("Address: {}", address);
-}
diff --git a/bitcoin/src/blockdata/script/borrowed.rs b/bitcoin/src/blockdata/script/borrowed.rs
index a922d731..e1fe91b7 100644
--- a/bitcoin/src/blockdata/script/borrowed.rs
+++ b/bitcoin/src/blockdata/script/borrowed.rs
@@ -12,7 +12,7 @@
 use crate::consensus::Encodable;
 use crate::opcodes::all::*;
 use crate::opcodes::{self, Opcode};
-use crate::policy::{DUST_RELAY_TX_FEE, MAX_OP_RETURN_RELAY};
+use crate::policy::DUST_RELAY_TX_FEE;
 use crate::prelude::{sink, DisplayHex, String, ToString};
 use crate::taproot::{LeafVersion, TapLeafHash, TapLeafHashExt as _};
 use crate::FeeRate;
@@ -217,7 +217,7 @@ fn is_op_return(&self) -> bool {
         /// What this function considers to be standard may change without warning pending Bitcoin Core
         /// changes.
         #[inline]
-        fn is_standard_op_return(&self) -> bool { self.is_op_return() && self.len() <= MAX_OP_RETURN_RELAY }
+        fn is_standard_op_return(&self) -> bool { self.is_op_return() && self.len() <= 80 }
 
         /// Checks whether a script is trivially known to have no satisfying input.
         ///
diff --git a/bitcoin/src/blockdata/transaction.rs b/bitcoin/src/blockdata/transaction.rs
index 137110f4..0ed381ef 100644
--- a/bitcoin/src/blockdata/transaction.rs
+++ b/bitcoin/src/blockdata/transaction.rs
@@ -920,14 +920,14 @@ pub const fn predict_weight_from_slices(
     inputs: &[InputWeightPrediction],
     output_script_lens: &[usize],
 ) -> Weight {
-    let mut input_weight = 0;
+    let mut partial_input_weight = 0;
     let mut inputs_with_witnesses = 0;
 
     // for loops not supported in const fn
     let mut i = 0;
     while i < inputs.len() {
         let prediction = inputs[i];
-        input_weight += prediction.total_weight().to_wu() as usize;
+        partial_input_weight += prediction.witness_weight().to_wu() as usize;
         inputs_with_witnesses += (prediction.witness_size > 0) as usize;
         i += 1;
     }
@@ -943,7 +943,7 @@ pub const fn predict_weight_from_slices(
 
     predict_weight_internal(
         inputs.len(),
-        input_weight,
+        partial_input_weight,
         inputs_with_witnesses,
         output_script_lens.len(),
         output_scripts_size,
@@ -1964,21 +1964,6 @@ fn weight_predictions() {
         );
     }
 
-    #[test]
-    fn weight_prediction_const_from_slices() {
-        let predict = [
-            InputWeightPrediction::P2WPKH_MAX,
-            InputWeightPrediction::NESTED_P2WPKH_MAX,
-            InputWeightPrediction::P2PKH_COMPRESSED_MAX,
-            InputWeightPrediction::P2PKH_UNCOMPRESSED_MAX,
-            InputWeightPrediction::P2TR_KEY_DEFAULT_SIGHASH,
-            InputWeightPrediction::P2TR_KEY_NON_DEFAULT_SIGHASH
-        ];
-
-        let weight = predict_weight_from_slices(&predict, &[1]);
-        assert_eq!(weight, Weight::from_wu(2493));
-    }
-
     #[test]
     fn sequence_debug_output() {
         let seq = Sequence::from_seconds_floor(1000);
diff --git a/bitcoin/src/crypto/sighash.rs b/bitcoin/src/crypto/sighash.rs
index ccbac973..d5651de3 100644
--- a/bitcoin/src/crypto/sighash.rs
+++ b/bitcoin/src/crypto/sighash.rs
@@ -1862,7 +1862,6 @@ struct UtxoSpent {
             #[serde(rename = "scriptPubKey")]
             script_pubkey: ScriptBuf,
             #[serde(rename = "amountSats")]
-            #[serde(with = "crate::amount::serde::as_sat")]
             value: Amount,
         }
 
diff --git a/bitcoin/src/network/params.rs b/bitcoin/src/network/params.rs
index e322009b..eecc42cb 100644
--- a/bitcoin/src/network/params.rs
+++ b/bitcoin/src/network/params.rs
@@ -113,7 +113,7 @@ pub struct Params {
     /// Expected amount of time to mine one block.
     pub pow_target_spacing: u64,
     /// Difficulty recalculation interval.
-    pub pow_target_timespan: u32,
+    pub pow_target_timespan: u64,
     /// Determines whether minimal difficulty may be used for blocks or not.
     pub allow_min_difficulty_blocks: bool,
     /// Determines whether retargeting is disabled for this network or not.
@@ -261,7 +261,7 @@ pub const fn new(network: Network) -> Self {
 
     /// Calculates the number of blocks between difficulty adjustments.
     pub fn difficulty_adjustment_interval(&self) -> u64 {
-        u64::from(self.pow_target_timespan) / self.pow_target_spacing
+        self.pow_target_timespan / self.pow_target_spacing
     }
 }
 
diff --git a/bitcoin/src/policy.rs b/bitcoin/src/policy.rs
index 89eb0826..35c2dda8 100644
--- a/bitcoin/src/policy.rs
+++ b/bitcoin/src/policy.rs
@@ -43,9 +43,6 @@
 /// mempools.
 pub const DEFAULT_MEMPOOL_EXPIRY: u32 = 336;
 
-// 80 bytes of data, +1 for OP_RETURN, +2 for the pushdata opcodes.
-pub(crate) const MAX_OP_RETURN_RELAY: usize = 83;
-
 /// The virtual transaction size, as computed by default by bitcoind node.
 pub fn get_virtual_tx_size(weight: i64, n_sigops: i64) -> i64 {
     (cmp::max(weight, n_sigops * DEFAULT_BYTES_PER_SIGOP as i64) + WITNESS_SCALE_FACTOR as i64 - 1)
diff --git a/bitcoin/src/pow.rs b/bitcoin/src/pow.rs
index b6d531cb..7566e73b 100644
--- a/bitcoin/src/pow.rs
+++ b/bitcoin/src/pow.rs
@@ -357,7 +357,7 @@ fn from_unprefixed_hex(s: &str) -> Result<CompactTarget, UnprefixedHexError> {
         /// ref: <https://github.com/bitcoin/bitcoin/blob/0503cbea9aab47ec0a87d34611e5453158727169/src/pow.cpp>
         ///
         /// Given the previous Target, represented as a [`CompactTarget`], the difficulty is adjusted
-        /// by taking the timespan between them, and multiplying the current [`CompactTarget`] by a factor
+        /// by taking the timespan between them, and multipling the current [`CompactTarget`] by a factor
         /// of the net timespan and expected timespan. The [`CompactTarget`] may not adjust by more than
         /// a factor of 4, or adjust beyond the maximum threshold for the network.
         ///
@@ -371,14 +371,12 @@ fn from_unprefixed_hex(s: &str) -> Result<CompactTarget, UnprefixedHexError> {
         /// Take the example of the first difficulty adjustment. Block 2016 introduces a new [`CompactTarget`],
         /// which takes the net timespan between Block 2015 and Block 0, and recomputes the difficulty.
         ///
-        /// To calculate the timespan, users should first convert their u32 timestamps to i64s before subtracting them
-        ///
         /// # Returns
         ///
         /// The expected [`CompactTarget`] recalculation.
         fn from_next_work_required(
             last: CompactTarget,
-            timespan: i64,
+            timespan: u64,
             params: impl AsRef<Params>,
         ) -> CompactTarget {
             let params = params.as_ref();
@@ -389,11 +387,11 @@ fn from_next_work_required(
             // ref: <https://github.com/bitcoin/bitcoin/blob/0503cbea9aab47ec0a87d34611e5453158727169/src/pow.cpp>
             let min_timespan = params.pow_target_timespan >> 2; // Lines 56/57
             let max_timespan = params.pow_target_timespan << 2; // Lines 58/59
-            let actual_timespan = timespan.clamp(min_timespan.into(), max_timespan.into());
+            let actual_timespan = timespan.clamp(min_timespan, max_timespan);
             let prev_target: Target = last.into();
             let maximum_retarget = prev_target.max_transition_threshold(params); // bnPowLimit
             let retarget = prev_target.0; // bnNew
-            let retarget = retarget.mul(u128::try_from(actual_timespan).expect("clamped value won't be negative").into());
+            let retarget = retarget.mul(actual_timespan.into());
             let retarget = retarget.div(params.pow_target_timespan.into());
             let retarget = Target(retarget);
             if retarget.ge(&maximum_retarget) {
@@ -1752,8 +1750,8 @@ fn compact_target_lower_hex_and_upper_hex() {
     fn compact_target_from_upwards_difficulty_adjustment() {
         let params = Params::new(crate::Network::Signet);
         let starting_bits = CompactTarget::from_consensus(503543726); // Genesis compact target on Signet
-        let start_time: i64 = 1598918400; // Genesis block unix time
-        let end_time: i64 = 1599332177; // Block 2015 unix time
+        let start_time: u64 = 1598918400; // Genesis block unix time
+        let end_time: u64 = 1599332177; // Block 2015 unix time
         let timespan = end_time - start_time; // Faster than expected
         let adjustment = CompactTarget::from_next_work_required(starting_bits, timespan, &params);
         let adjustment_bits = CompactTarget::from_consensus(503394215); // Block 2016 compact target
@@ -1764,8 +1762,8 @@ fn compact_target_from_upwards_difficulty_adjustment() {
     fn compact_target_from_downwards_difficulty_adjustment() {
         let params = Params::new(crate::Network::Signet);
         let starting_bits = CompactTarget::from_consensus(503394215); // Block 2016 compact target
-        let start_time: i64 = 1599332844; // Block 2016 unix time
-        let end_time: i64 = 1600591200; // Block 4031 unix time
+        let start_time: u64 = 1599332844; // Block 2016 unix time
+        let end_time: u64 = 1600591200; // Block 4031 unix time
         let timespan = end_time - start_time; // Slower than expected
         let adjustment = CompactTarget::from_next_work_required(starting_bits, timespan, &params);
         let adjustment_bits = CompactTarget::from_consensus(503397348); // Block 4032 compact target
@@ -1831,18 +1829,7 @@ fn compact_target_from_downwards_difficulty_adjustment_using_headers() {
     fn compact_target_from_maximum_upward_difficulty_adjustment() {
         let params = Params::new(crate::Network::Signet);
         let starting_bits = CompactTarget::from_consensus(503403001);
-        let timespan = params.pow_target_timespan / 5;
-        let got = CompactTarget::from_next_work_required(starting_bits, timespan.into(), params);
-        let want =
-            Target::from_compact(starting_bits).min_transition_threshold().to_compact_lossy();
-        assert_eq!(got, want);
-    }
-
-    #[test]
-    fn compact_target_from_maximum_upward_difficulty_adjustment_with_negative_timespan() {
-        let params = Params::new(crate::Network::Signet);
-        let starting_bits = CompactTarget::from_consensus(503403001);
-        let timespan: i64 = -i64::from(params.pow_target_timespan);
+        let timespan = (0.2 * params.pow_target_timespan as f64) as u64;
         let got = CompactTarget::from_next_work_required(starting_bits, timespan, params);
         let want =
             Target::from_compact(starting_bits).min_transition_threshold().to_compact_lossy();
@@ -1854,7 +1841,7 @@ fn compact_target_from_minimum_downward_difficulty_adjustment() {
         let params = Params::new(crate::Network::Signet);
         let starting_bits = CompactTarget::from_consensus(403403001); // High difficulty for Signet
         let timespan = 5 * params.pow_target_timespan; // Really slow.
-        let got = CompactTarget::from_next_work_required(starting_bits, timespan.into(), &params);
+        let got = CompactTarget::from_next_work_required(starting_bits, timespan, &params);
         let want =
             Target::from_compact(starting_bits).max_transition_threshold(params).to_compact_lossy();
         assert_eq!(got, want);
@@ -1865,7 +1852,7 @@ fn compact_target_from_adjustment_is_max_target() {
         let params = Params::new(crate::Network::Signet);
         let starting_bits = CompactTarget::from_consensus(503543726); // Genesis compact target on Signet
         let timespan = 5 * params.pow_target_timespan; // Really slow.
-        let got = CompactTarget::from_next_work_required(starting_bits, timespan.into(), &params);
+        let got = CompactTarget::from_next_work_required(starting_bits, timespan, &params);
         let want = params.max_attainable_target.to_compact_lossy();
         assert_eq!(got, want);
     }
diff --git a/bitcoin/src/psbt/mod.rs b/bitcoin/src/psbt/mod.rs
index 7bf5791f..5adc8165 100644
--- a/bitcoin/src/psbt/mod.rs
+++ b/bitcoin/src/psbt/mod.rs
@@ -255,9 +255,8 @@ pub fn combine(&mut self, other: Self) -> Result<(), Error> {
                                 == derivation2[derivation2.len() - derivation1.len()..])
                     {
                         continue;
-                    } else if derivation2.len() <= derivation1.len()
-                        && derivation2[..]
-                                == derivation1[derivation1.len() - derivation2.len()..]
+                    } else if derivation2[..]
+                        == derivation1[derivation1.len() - derivation2.len()..]
                     {
                         entry.insert((fingerprint1, derivation1));
                         continue;
@@ -2117,16 +2116,6 @@ fn combine_psbts_commutative() {
         assert_eq!(psbt1, psbt2);
     }
 
-
-    // https://github.com/rust-bitcoin/rust-bitcoin/issues/3628
-    #[test]
-    fn test_combine_psbt_fuzz_3628() {
-        let mut psbt1 = hex_psbt(include_str!("../../tests/data/psbt_fuzz1.hex")).unwrap();
-        let psbt2 = hex_psbt(include_str!("../../tests/data/psbt_fuzz2.hex")).unwrap();
-
-        assert!(matches!(psbt1.combine(psbt2).unwrap_err(), Error::CombineInconsistentKeySources(_)));
-    }
-
     #[cfg(feature = "rand-std")]
     fn gen_keys() -> (PrivateKey, PublicKey, Secp256k1<All>) {
         use secp256k1::rand::thread_rng;
diff --git a/hashes/src/lib.rs b/hashes/src/lib.rs
index bc6206d3..44b13523 100644
--- a/hashes/src/lib.rs
+++ b/hashes/src/lib.rs
@@ -5,7 +5,7 @@
 //! This library implements the hash functions needed by Bitcoin. As an ancillary thing, it exposes
 //! hexadecimal serialization and deserialization, since these are needed to display hashes.
 //!
-//! ## Commonly used operations
+//! # Examples
 //!
 //! Hashing a single byte slice or a string:
 //!
@@ -26,7 +26,7 @@
 //!
 //! let mut reader: &[u8] = b"hello"; // In real code, this could be a `File` or `TcpStream`.
 //! let mut engine = Sha256::engine();
-//! std::io::copy(&mut reader, &mut engine).unwrap();
+//! std::io::copy(&mut reader, &mut engine).expect("engine writes don't error");
 //! let _hash = Sha256::from_engine(engine);
 //! # }
 //! ```
diff --git a/nightly-version b/nightly-version
index c3f22bff..b5c32f9d 100644
--- a/nightly-version
+++ b/nightly-version
@@ -1,1 +1,1 @@
-nightly-2024-11-22
+nightly-2024-11-20
diff --git a/primitives/src/transaction.rs b/primitives/src/transaction.rs
index 4a4c6f66..639f0c52 100644
--- a/primitives/src/transaction.rs
+++ b/primitives/src/transaction.rs
@@ -343,7 +343,6 @@ impl TxIn {
 #[cfg(feature = "alloc")]
 pub struct TxOut {
     /// The value of the output, in satoshis.
-    #[cfg_attr(feature = "serde", serde(with = "crate::amount::serde::as_sat"))]
     pub value: Amount,
     /// The script which must be satisfied for the output to be spent.
     pub script_pubkey: ScriptBuf,
diff --git a/units/src/amount/signed.rs b/units/src/amount/signed.rs
index 266a5d32..b90fdd5e 100644
--- a/units/src/amount/signed.rs
+++ b/units/src/amount/signed.rs
@@ -17,9 +17,9 @@
 
 /// A signed amount.
 ///
-/// The [`SignedAmount`] type can be used to express Bitcoin amounts that support arithmetic and
-/// conversion to various denominations. The `Amount` type does not implement `serde` traits but we
-/// do provide modules for serializing as satoshis or bitcoin.
+/// The [`SignedAmount`] type can be used to express Bitcoin amounts that support
+/// arithmetic and conversion to various denominations.
+///
 ///
 /// Warning!
 ///
@@ -29,21 +29,6 @@
 /// start with `checked_`.  The operations from [`core::ops`] that [`Amount`]
 /// implements will panic when overflow or underflow occurs.
 ///
-/// # Examples
-///
-/// ```
-/// # #[cfg(feature = "serde")] {
-/// use serde::{Serialize, Deserialize};
-/// use bitcoin_units::SignedAmount;
-///
-/// #[derive(Serialize, Deserialize)]
-/// struct Foo {
-///     // If you are using `rust-bitcoin` then `bitcoin::amount::serde::as_sat` also works.
-///     #[serde(with = "bitcoin_units::amount::serde::as_sat")]  // Also `serde::as_btc`.
-///     amount: SignedAmount,
-/// }
-/// # }
-/// ```
 #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 pub struct SignedAmount(i64);
 
diff --git a/units/src/amount/unsigned.rs b/units/src/amount/unsigned.rs
index c2e6de9a..a6826238 100644
--- a/units/src/amount/unsigned.rs
+++ b/units/src/amount/unsigned.rs
@@ -7,6 +7,8 @@
 use core::str::FromStr;
 use core::{default, fmt, ops};
 
+#[cfg(feature = "serde")]
+use ::serde::{Deserialize, Serialize};
 #[cfg(feature = "arbitrary")]
 use arbitrary::{Arbitrary, Unstructured};
 
@@ -19,9 +21,9 @@
 
 /// An amount.
 ///
-/// The [`Amount`] type can be used to express Bitcoin amounts that support arithmetic and
-/// conversion to various denominations. The `Amount` type does not implement `serde` traits but we
-/// do provide modules for serializing as satoshis or bitcoin.
+/// The [`Amount`] type can be used to express Bitcoin amounts that support
+/// arithmetic and conversion to various denominations.
+///
 ///
 /// Warning!
 ///
@@ -34,22 +36,8 @@
 /// zero is considered an underflow and will cause a panic if you're not using
 /// the checked arithmetic methods.
 ///
-/// # Examples
-///
-/// ```
-/// # #[cfg(feature = "serde")] {
-/// use serde::{Serialize, Deserialize};
-/// use bitcoin_units::Amount;
-///
-/// #[derive(Serialize, Deserialize)]
-/// struct Foo {
-///     // If you are using `rust-bitcoin` then `bitcoin::amount::serde::as_sat` also works.
-///     #[serde(with = "bitcoin_units::amount::serde::as_sat")]  // Also `serde::as_btc`.
-///     amount: Amount,
-/// }
-/// # }
-/// ```
 #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
 pub struct Amount(u64);
 
 impl Amount {


Test patch:
diff --git a/bitcoin/src/blockdata/script/tests.rs b/bitcoin/src/blockdata/script/tests.rs
index 8d8932ce..5a3409af 100644
--- a/bitcoin/src/blockdata/script/tests.rs
+++ b/bitcoin/src/blockdata/script/tests.rs
@@ -416,10 +416,8 @@ fn standard_op_return() {
     assert!(ScriptBuf::from_hex("6a48656c6c6f2c2074686973206973206d7920666972737420636f6e747269627574696f6e20746f207275737420626974636f696e2e20506c6561736520617070726f7665206d79205052206672656e")
         .unwrap()
         .is_standard_op_return());
-    assert!(ScriptBuf::from_hex("6a48656c6c6f2c2074686973206973206d7920666972737420636f6e747269627574696f6e20746f207275737420626974636f696e2e20506c6561736520617070726f7665206d79205052206672656e21")
-        .unwrap()
-        .is_standard_op_return());
-    assert!(!ScriptBuf::from_hex("6a48656c6c6f2c2074686973206973206d7920666972737420636f6e747269627574696f6e20746f207275737420626974636f696e2e20506c6561736520617070726f7665206d79205052206672656e21524f42")
+
+    assert!(!ScriptBuf::from_hex("6a48656c6c6f2c2074686973206973206d7920666972737420636f6e747269627574696f6e20746f207275737420626974636f696e2e20506c6561736520617070726f7665206d79205052206672656e21")
         .unwrap()
         .is_standard_op_return());
 }
@@ -485,6 +483,10 @@ fn script_json_serialize() {
 
 #[test]
 fn script_asm() {
+    assert_eq!(
+        ScriptBuf::from_hex("6363636363686868686800").unwrap().to_string(),
+        "OP_IF OP_IF OP_IF OP_IF OP_IF OP_ENDIF OP_ENDIF OP_ENDIF OP_ENDIF OP_ENDIF OP_0"
+    );
     assert_eq!(
         ScriptBuf::from_hex("6363636363686868686800").unwrap().to_string(),
         "OP_IF OP_IF OP_IF OP_IF OP_IF OP_ENDIF OP_ENDIF OP_ENDIF OP_ENDIF OP_ENDIF OP_0"
diff --git a/bitcoin/tests/data/psbt_fuzz1.hex b/bitcoin/tests/data/psbt_fuzz1.hex
deleted file mode 100644
index dd3c9b7e..00000000
--- a/bitcoin/tests/data/psbt_fuzz1.hex
+++ /dev/null
@@ -1,1 +0,0 @@
-70736274ff01000a000000ff0000000074ff4f010488b21eff02000001004a92244992244902030203030303030303030303030303030303030303030303030303030303030303f4000000000000000a000208ffffffff08080804000000000000000c080808000b0000000000010000
\ No newline at end of file
diff --git a/bitcoin/tests/data/psbt_fuzz2.hex b/bitcoin/tests/data/psbt_fuzz2.hex
deleted file mode 100644
index 8a33cf01..00000000
--- a/bitcoin/tests/data/psbt_fuzz2.hex
+++ /dev/null
@@ -1,1 +0,0 @@
-70736274ff01000a000000ff0000000074ff4f010488b21eff02000001004a92244992244902030203030303030303030303030303030303030303030303030303030303030303f4000000000000000a000208ffffffff080808040000000000000008000000000000001000
\ No newline at end of file