Skip to content

Commit 661b58d

Browse files
authored
Merge pull request #234 from tcharding/08-09-upgrade-bitcoin
Upgrade bitcoin dependency
2 parents f0754ef + e6f334f commit 661b58d

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 0.16.0
2+
3+
- bump bitcoin crate version to 0.29.0
14

25
# 0.15.0
36

client/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bitcoincore-rpc"
3-
version = "0.15.0"
3+
version = "0.16.0"
44
authors = [
55
"Steven Roose <[email protected]>",
66
"Jean Pierre Dudey <[email protected]>",
@@ -19,7 +19,7 @@ name = "bitcoincore_rpc"
1919
path = "src/lib.rs"
2020

2121
[dependencies]
22-
bitcoincore-rpc-json = { version = "0.15.0", path = "../json" }
22+
bitcoincore-rpc-json = { version = "0.16.0", path = "../json" }
2323

2424
log = "0.4.5"
2525
jsonrpc = "0.12.0"

client/src/client.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ pub trait RpcApi: Sized {
730730
replaceable: Option<bool>,
731731
) -> Result<String> {
732732
let outs_converted = serde_json::Map::from_iter(
733-
outs.iter().map(|(k, v)| (k.clone(), serde_json::Value::from(v.as_btc()))),
733+
outs.iter().map(|(k, v)| (k.clone(), serde_json::Value::from(v.to_btc()))),
734734
);
735735
let mut args = [
736736
into_json(utxos)?,
@@ -903,7 +903,7 @@ pub trait RpcApi: Sized {
903903
) -> Result<bitcoin::Txid> {
904904
let mut args = [
905905
address.to_string().into(),
906-
into_json(amount.as_btc())?,
906+
into_json(amount.to_btc())?,
907907
opt_into_json(comment)?,
908908
opt_into_json(comment_to)?,
909909
opt_into_json(subtract_fee)?,
@@ -1061,7 +1061,7 @@ pub trait RpcApi: Sized {
10611061
bip32derivs: Option<bool>,
10621062
) -> Result<json::WalletCreateFundedPsbtResult> {
10631063
let outputs_converted = serde_json::Map::from_iter(
1064-
outputs.iter().map(|(k, v)| (k.clone(), serde_json::Value::from(v.as_btc()))),
1064+
outputs.iter().map(|(k, v)| (k.clone(), serde_json::Value::from(v.to_btc()))),
10651065
);
10661066
let mut args = [
10671067
into_json(inputs)?,

integration_test/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ edition = "2018"
66

77
[dependencies]
88
bitcoincore-rpc = { path = "../client" }
9-
bitcoin = { version = "0.28.0", features = [ "use-serde", "rand" ] }
9+
bitcoin = { version = "0.29.0", features = ["serde", "rand"]}
1010
lazy_static = "1.4.0"
1111
log = "0.4"

integration_test/src/main.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ use bitcoin::hashes::hex::{FromHex, ToHex};
2525
use bitcoin::hashes::Hash;
2626
use bitcoin::secp256k1;
2727
use bitcoin::{
28-
Address, Amount, EcdsaSighashType, Network, OutPoint, PrivateKey, Script, SignedAmount,
29-
Transaction, TxIn, TxOut, Txid, Witness,
28+
Address, Amount, PackedLockTime, Network, OutPoint, PrivateKey, Script, EcdsaSighashType, SignedAmount,
29+
Sequence, Transaction, TxIn, TxOut, Txid, Witness,
3030
};
3131
use bitcoincore_rpc::bitcoincore_rpc_json::{
3232
GetBlockTemplateModes, GetBlockTemplateRules, ScanTxOutRequest,
@@ -548,18 +548,18 @@ fn test_sign_raw_transaction_with_send_raw_transaction(cl: &Client) {
548548

549549
let tx = Transaction {
550550
version: 1,
551-
lock_time: 0,
551+
lock_time: PackedLockTime::ZERO,
552552
input: vec![TxIn {
553553
previous_output: OutPoint {
554554
txid: unspent.txid,
555555
vout: unspent.vout,
556556
},
557-
sequence: 0xFFFFFFFF,
557+
sequence: Sequence::MAX,
558558
script_sig: Script::new(),
559559
witness: Witness::new(),
560560
}],
561561
output: vec![TxOut {
562-
value: (unspent.amount - *FEE).as_sat(),
562+
value: (unspent.amount - *FEE).to_sat(),
563563
script_pubkey: addr.script_pubkey(),
564564
}],
565565
};
@@ -577,18 +577,18 @@ fn test_sign_raw_transaction_with_send_raw_transaction(cl: &Client) {
577577

578578
let tx = Transaction {
579579
version: 1,
580-
lock_time: 0,
580+
lock_time: PackedLockTime::ZERO,
581581
input: vec![TxIn {
582582
previous_output: OutPoint {
583583
txid: txid,
584584
vout: 0,
585585
},
586586
script_sig: Script::new(),
587-
sequence: 0xFFFFFFFF,
587+
sequence: Sequence::MAX,
588588
witness: Witness::new(),
589589
}],
590590
output: vec![TxOut {
591-
value: (unspent.amount - *FEE - *FEE).as_sat(),
591+
value: (unspent.amount - *FEE - *FEE).to_sat(),
592592
script_pubkey: RANDOM_ADDRESS.script_pubkey(),
593593
}],
594594
};

json/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bitcoincore-rpc-json"
3-
version = "0.15.0"
3+
version = "0.16.0"
44
authors = [
55
"Steven Roose <[email protected]>",
66
"Jean Pierre Dudey <[email protected]>",
@@ -22,4 +22,4 @@ path = "src/lib.rs"
2222
serde = { version = "1", features = [ "derive" ] }
2323
serde_json = "1"
2424

25-
bitcoin = { version = "0.28.0", features = [ "use-serde" ] }
25+
bitcoin = { version = "0.29.0", features = ["serde"]}

0 commit comments

Comments
 (0)