]> Untitled Git - bdk/commitdiff
docs(wallet): add warning on TxBuilder::allow_shrinking() and deprecate it
authorSteve Myers <steve@notmandatory.org>
Mon, 4 Mar 2024 00:11:12 +0000 (18:11 -0600)
committerSteve Myers <steve@notmandatory.org>
Mon, 21 Oct 2024 17:34:02 +0000 (12:34 -0500)
test(wallet): add test_bump_fee_allow_shrinking test

CHANGELOG.md
src/wallet/mod.rs
src/wallet/tx_builder.rs

index b4357dcb4f8d3fe053bfe28b3508af53365e3570..123db434773a2cdb61ff3d2e85af552c0efdf958 100644 (file)
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
+## [v0.30.0]
+
+### Summary
+
+This maintenance release updates the project MSRV to 1.63.0 and deprecates `TxBuilder::allow_shrinking()`.
+
 ## [v0.29.0]
 
 ### Summary
@@ -693,4 +699,5 @@ final transaction is created by calling `finish` on the builder.
 [v0.28.1]: https://github.com/bitcoindevkit/bdk/compare/v0.28.0...v0.28.1
 [v0.28.2]: https://github.com/bitcoindevkit/bdk/compare/v0.28.1...v0.28.2
 [v0.29.0]: https://github.com/bitcoindevkit/bdk/compare/v0.28.2...v0.29.0
-[Unreleased]: https://github.com/bitcoindevkit/bdk/compare/v0.29.0...HEAD
+[v0.30.0]: https://github.com/bitcoindevkit/bdk/compare/v0.29.0...v0.30.0
+[Unreleased]: https://github.com/bitcoindevkit/bdk/compare/v0.30.0...HEAD
index 485cb9ce2d4d92fe83ed69e7a051382478a88974..976562676fe3ebf3d1c2de9dde269190b1ca2daf 100644 (file)
@@ -3526,6 +3526,7 @@ pub(crate) mod test {
         assert_eq!(details.fee.unwrap_or(0), 200);
     }
 
+    #[allow(deprecated)]
     #[test]
     fn test_bump_fee_reduce_single_recipient() {
         let (wallet, _, _) = get_funded_wallet(get_test_wpkh());
@@ -3572,6 +3573,7 @@ pub(crate) mod test {
         assert_fee_rate!(psbt, details.fee.unwrap_or(0), FeeRate::from_sat_per_vb(2.5), @add_signature);
     }
 
+    #[allow(deprecated)]
     #[test]
     fn test_bump_fee_absolute_reduce_single_recipient() {
         let (wallet, _, _) = get_funded_wallet(get_test_wpkh());
@@ -3618,6 +3620,7 @@ pub(crate) mod test {
         assert_eq!(details.fee.unwrap_or(0), 300);
     }
 
+    #[allow(deprecated)]
     #[test]
     fn test_bump_fee_drain_wallet() {
         let (wallet, descriptors, _) = get_funded_wallet(get_test_wpkh());
@@ -4208,6 +4211,7 @@ pub(crate) mod test {
         builder.finish().unwrap();
     }
 
+    #[allow(deprecated)]
     #[test]
     fn test_bump_fee_unconfirmed_input() {
         // We create a tx draining the wallet and spending one confirmed
index fff704072c3f0a76f46d5c70db58f92442485d23..990578743937ab2bf33ddc5291c386bbad6cdecf 100644 (file)
@@ -653,12 +653,20 @@ impl<'a, D: BatchDatabase> TxBuilder<'a, D, DefaultCoinSelectionAlgorithm, BumpF
     /// `script_pubkey` in order to bump the transaction fee. Without specifying this the wallet
     /// will attempt to find a change output to shrink instead.
     ///
+    /// **Warning**, use with extreme caution. The specified `script_pubkey` will be used _instead_
+    /// of a change address and if the total transaction input amounts are greater than the required
+    /// outputs + transaction fee the remaining change sats will also be sent to this address.
+    ///
     /// **Note** that the output may shrink to below the dust limit and therefore be removed. If it is
     /// preserved then it is currently not guaranteed to be in the same position as it was
     /// originally.
     ///
     /// Returns an `Err` if `script_pubkey` can't be found among the recipients of the
     /// transaction we are bumping.
+    #[deprecated(
+        since = "0.30.0",
+        note = "This function will be removed in the next release."
+    )]
     pub fn allow_shrinking(&mut self, script_pubkey: ScriptBuf) -> Result<&mut Self, Error> {
         match self
             .params