Skip to content

Commit

Permalink
Merge #49: Release/0.2.3
Browse files Browse the repository at this point in the history
e1681ef Bump to version 0.2.3 (Daniela Brozzoni)
80990d7 Revert "Bump to rust-bitcoin 0.29.1" (Daniela Brozzoni)

Pull request description:

ACKs for top commit:
  afilini:
    ACK e1681ef

Tree-SHA512: bd649be8be1c6eab5008647ad338fa791d78906cf20a65009cd4aad190ec6f706163d444f20b30c6267341f41c3467098d36306dca0b676877976c3a00eebecc
  • Loading branch information
danielabrozzoni committed Oct 12, 2022
2 parents 87610d9 + e1681ef commit 5a0bb9f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hwi"
version = "0.2.2"
version = "0.2.3"
authors = ["Daniela Brozzoni <[email protected]>"]
edition = "2018"
license = "MIT"
Expand All @@ -10,11 +10,10 @@ repository = "https://github.com/bitcoindevkit/rust-hwi"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bitcoin = { version = "0.29.1", features = ["serde", "base64"] }
bitcoin = { version = "0.28", features = ["use-serde", "base64"] }
serde = { version = "^1.0", features = ["derive"] }
serde_json = { version = "^1.0" }
pyo3 = { version = "0.15.1", features = ["auto-initialize"]}
base64 = "0.13.0"
once_cell = "=1.14"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bitcoin::consensus::encode::serialize;
use bitcoin::util::bip32::DerivationPath;
use bitcoin::util::psbt::PartiallySignedTransaction;

use base64;
use bitcoin::base64;

use serde_json::value::Value;

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ mod tests {

let previous_tx = Transaction {
version: 1,
lock_time: bitcoin::PackedLockTime(0),
lock_time: 0,
input: vec![TxIn::default()],
output: vec![TxOut {
value: 100,
Expand All @@ -188,7 +188,7 @@ mod tests {
let psbt = bitcoin::psbt::PartiallySignedTransaction {
unsigned_tx: Transaction {
version: 1,
lock_time: bitcoin::PackedLockTime(0),
lock_time: 0,
input: vec![previous_txin],
output: vec![TxOut {
value: 50,
Expand Down
4 changes: 2 additions & 2 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct HWISignature {

fn from_b64<'de, D: Deserializer<'de>>(d: D) -> Result<Vec<u8>, D::Error> {
let b64_string = String::deserialize(d)?;
base64::decode(&b64_string)
bitcoin::base64::decode(&b64_string)
.map_err(|_| serde::de::Error::custom("Error while Deserializing Signature"))
}

Expand All @@ -57,7 +57,7 @@ fn deserialize_psbt<'de, D: Deserializer<'de>>(
d: D,
) -> Result<PartiallySignedTransaction, D::Error> {
let b64_string = String::deserialize(d)?;
let bytes = base64::decode(&b64_string).map_err(serde::de::Error::custom)?;
let bytes = bitcoin::base64::decode(&b64_string).map_err(serde::de::Error::custom)?;
bitcoin::consensus::deserialize::<PartiallySignedTransaction>(&bytes[..])
.map_err(serde::de::Error::custom)
}
Expand Down

0 comments on commit 5a0bb9f

Please sign in to comment.