Skip to content

Commit

Permalink
Remove base64 dependency
Browse files Browse the repository at this point in the history
We don't need base64 because rust-bitcoin already exposes a version of
that crate that we can use. Removing one more parallel dependency.
  • Loading branch information
rajarshimaitra committed Jun 27, 2022
1 parent 1e70ff9 commit b09c405
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ bdk-macros = "0.6"
structopt = "0.3"
serde_json = "1.0"
log = "0.4"
base64 = "0.11"
zeroize = "<1.4.0"
dirs-next = "2.0"
env_logger = "0.7"
Expand Down
2 changes: 1 addition & 1 deletion src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ mod test {
fn encode_psbt(psbt: PartiallySignedTransaction) -> Vec<u8> {
let mut encoded = Vec::<u8>::new();
psbt.consensus_encode(&mut encoded).unwrap();
let base64_psbt = base64::encode(&encoded);
let base64_psbt = bdk::bitcoin::base64::encode(&encoded);

base64_psbt.as_bytes().to_vec()
}
Expand Down
3 changes: 2 additions & 1 deletion src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use bdk::{database::BatchDatabase, wallet::AddressIndex, Error, FeeRate, Keychai

use structopt::StructOpt;

use bdk::bitcoin::base64;
use bdk::bitcoin::consensus::encode::{deserialize, serialize, serialize_hex};
#[cfg(any(
feature = "electrum",
Expand Down Expand Up @@ -503,7 +504,7 @@ pub fn handle_ext_reserves_subcommand(
let outpoints_per_addr = addresses
.iter()
.map(|address| {
let address = Address::from_str(&address)
let address = Address::from_str(address)
.map_err(|e| Error::Generic(format!("Invalid address: {:?}", e)))?;
get_outpoints_for_address(address, &client, max_confirmation_height)
})
Expand Down
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ pub(crate) fn new_blockchain(
&Secp256k1::new(),
)?;

let rpc_url = "http://".to_string() + &url;
let rpc_url = "http://".to_string() + url;

let rpc_config = RpcConfig {
url: rpc_url,
Expand All @@ -295,7 +295,7 @@ pub(crate) fn new_blockchain(
AnyBlockchainConfig::Rpc(rpc_config)
};

Ok(AnyBlockchain::from_config(&config)?)
AnyBlockchain::from_config(&config)
}

/// Create a new wallet from given wallet configuration options
Expand Down

0 comments on commit b09c405

Please sign in to comment.