Skip to content

Commit

Permalink
Merge pull request #52 from wizardsardine/remove-base64-dep
Browse files Browse the repository at this point in the history
remove base64 dependency
  • Loading branch information
edouardparis authored Jan 11, 2024
2 parents 00dbf44 + 965a8fe commit e467dfe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ specter = ["tokio", "tokio-serial", "serialport"]
ledger = ["regex", "tokio", "ledger_bitcoin_client", "ledger-transport-hidapi", "ledger-apdu", "hidapi"]

[dependencies]
base64 = "0.13.0"
async-trait = "0.1.52"
futures = "0.3"
bitcoin = { version = "0.30.0", default-features = false, features = ["base64", "serde", "no-std"] }
Expand Down
10 changes: 2 additions & 8 deletions src/specter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,9 @@ impl<T: Transport> Specter<T> {

pub async fn sign(&self, psbt: &Psbt) -> Result<Psbt, SpecterError> {
self.transport
.request(&format!(
"\r\n\r\nsign {}\r\n",
base64::encode(psbt.serialize())
))
.request(&format!("\r\n\r\nsign {}\r\n", psbt))
.await
.and_then(|resp| base64::decode(resp).map_err(|e| SpecterError::Device(e.to_string())))
.and_then(|bytes| {
Psbt::deserialize(&bytes).map_err(|e| SpecterError::Device(e.to_string()))
})
.and_then(|resp| Psbt::from_str(&resp).map_err(|e| SpecterError::Device(e.to_string())))
}
}

Expand Down

0 comments on commit e467dfe

Please sign in to comment.