let persister = payjoin::persist::NoopSessionPersister::<ReceiverSessionEvent>::default();
let checked_max_fee_rate = max_fee_rate
- .map(|rate| FeeRate::from_sat_per_kwu(rate))
+ .map(FeeRate::from_sat_per_kwu)
.unwrap_or(FeeRate::BROADCAST_MIN);
let receiver = payjoin::receive::v2::ReceiverBuilder::new(
.await
}
ReceiveSession::HasReplyableError(error) => self.handle_error(error, persister).await,
- ReceiveSession::Closed(_) => return Err(Error::Generic("Session closed".to_string())),
+ ReceiveSession::Closed(_) => Err(Error::Generic("Session closed".to_string())),
}
}
Err(e) => {
return Err(Error::Generic(format!(
"Error occurred when polling for Payjoin proposal from the directory: {}",
- e.to_string()
+ e
)));
}
}
return Err(ImplementationError::from("Cannot find the transaction in the mempool or the blockchain"));
};
- let is_seen = match tx_details.chain_position {
- bdk_wallet::chain::ChainPosition::Confirmed { .. } => true,
- bdk_wallet::chain::ChainPosition::Unconfirmed { first_seen: Some(_), .. } => true,
- _ => false
- };
+ let is_seen = matches!(
+ tx_details.chain_position, bdk_wallet::chain::ChainPosition::Confirmed { .. }
+ | bdk_wallet::chain::ChainPosition::Unconfirmed { first_seen: Some(_), .. }
+ );
if is_seen {
return Ok(Some(tx_details.tx.as_ref().clone()));
}
- return Err(ImplementationError::from("Cannot find the transaction in the mempool or the blockchain"));
+ Err(ImplementationError::from("Cannot find the transaction in the mempool or the blockchain"))
},
|outpoint| {
let utxo = self.wallet.get_utxo(outpoint);
}
#[cfg(feature = "esplora")]
ClientType::Esplora => {
- let client = bdk_esplora::esplora_client::Builder::new(&url).build_async()?;
+ let client = bdk_esplora::esplora_client::Builder::new(url).build_async()?;
BlockchainClient::Esplora {
client: Box::new(client),
parallel_requests: wallet_opts.parallel_requests,