chore: remove allow_shrinking

This commit is contained in:
Matthew 2024-05-01 09:17:27 -05:00
parent ebaa6fda2f
commit 6522dfdd26
No known key found for this signature in database
GPG Key ID: 8D4FCD82DD54DDD2
3 changed files with 1 additions and 27 deletions

View File

@ -337,8 +337,6 @@ interface TxBuilder {
interface BumpFeeTxBuilder {
constructor(string txid, FeeRate fee_rate);
BumpFeeTxBuilder allow_shrinking(Script script_pubkey);
BumpFeeTxBuilder enable_rbf();
BumpFeeTxBuilder enable_rbf_with_sequence(u32 nsequence);

View File

@ -6,7 +6,7 @@ use bdk::chain::tx_graph::CalculateFeeError as BdkCalculateFeeError;
use bdk::descriptor::DescriptorError as BdkDescriptorError;
use bdk::wallet::error::BuildFeeBumpError;
use bdk::wallet::signer::SignerError as BdkSignerError;
use bdk::wallet::tx_builder::{AddUtxoError, AllowShrinkingError};
use bdk::wallet::tx_builder::AddUtxoError;
use bdk::wallet::NewOrLoadError;
use bdk_esplora::esplora_client::{Error as BdkEsploraError, Error};
use bdk_file_store::FileError as BdkFileError;
@ -504,16 +504,6 @@ impl From<AddUtxoError> for CreateTxError {
}
}
impl From<AllowShrinkingError> for CreateTxError {
fn from(error: AllowShrinkingError) -> Self {
match error {
AllowShrinkingError::MissingScriptPubKey(_script) => {
CreateTxError::ChangePolicyDescriptor
}
}
}
}
impl From<BuildFeeBumpError> for CreateTxError {
fn from(error: BuildFeeBumpError) -> Self {
match error {

View File

@ -355,7 +355,6 @@ impl TxBuilder {
pub(crate) struct BumpFeeTxBuilder {
pub(crate) txid: String,
pub(crate) fee_rate: Arc<FeeRate>,
pub(crate) allow_shrinking: Option<Arc<Script>>,
pub(crate) rbf: Option<RbfValue>,
}
@ -364,18 +363,10 @@ impl BumpFeeTxBuilder {
Self {
txid,
fee_rate,
allow_shrinking: None,
rbf: None,
}
}
pub(crate) fn allow_shrinking(&self, script_pubkey: Arc<Script>) -> Arc<Self> {
Arc::new(Self {
allow_shrinking: Some(script_pubkey),
..self.clone()
})
}
pub(crate) fn enable_rbf(&self) -> Arc<Self> {
Arc::new(Self {
rbf: Some(RbfValue::Default),
@ -397,11 +388,6 @@ impl BumpFeeTxBuilder {
let mut wallet = wallet.get_wallet();
let mut tx_builder = wallet.build_fee_bump(txid).map_err(CreateTxError::from)?;
tx_builder.fee_rate(self.fee_rate.0);
if let Some(allow_shrinking) = &self.allow_shrinking {
tx_builder
.allow_shrinking(allow_shrinking.0.clone())
.map_err(CreateTxError::from)?;
}
if let Some(rbf) = &self.rbf {
match *rbf {
RbfValue::Default => {