Skip to content

Commit 1d6cc0f

Browse files
committed
Upgrade bitcoin dependency
Upgrade `rust-bitcoin` dependency to the newly released version (0.29.0). Includes fixing newly deprecated APIs.
1 parent f0754ef commit 1d6cc0f

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

client/src/client.rs

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 8 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)