Skip to content

Commit 9e07344

Browse files
authored
Merge pull request #28 from delta1/master
2 parents bb51390 + 236d918 commit 9e07344

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ license = "MIT"
88

99
[dependencies]
1010
base64 = "0.12.3"
11-
bitcoin = { version = "0.28", features = ["use-serde"] }
12-
bitcoincore-rpc-json = "0.15"
11+
bitcoin = { version = "0.29", features = ["serde"] }
12+
bitcoincore-rpc-json = "0.16"
1313
futures = "0.3.5"
1414
hex = "0.4.2"
1515
jsonrpc_client = { version = "0.7", features = ["reqwest"] }

src/bitcoind_rpc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl Client {
7979
) -> Result<Txid> {
8080
let txid = self
8181
.with_wallet(wallet_name)?
82-
.sendtoaddress(address, amount.as_btc())
82+
.sendtoaddress(address, amount.to_btc())
8383
.await?;
8484
let txid = Txid::from_hex(&txid)?;
8585

@@ -131,7 +131,7 @@ impl Client {
131131
amount: Amount,
132132
) -> Result<String> {
133133
let mut outputs_converted = HashMap::new();
134-
outputs_converted.insert(address.to_string(), amount.as_btc());
134+
outputs_converted.insert(address.to_string(), amount.to_btc());
135135
let psbt = self
136136
.with_wallet(wallet_name)?
137137
.walletcreatefundedpsbt(inputs, outputs_converted)

src/wallet.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl Wallet {
8383
let txid = self
8484
.client
8585
.with_wallet(&self.name)?
86-
.sendtoaddress(address, amount.as_btc())
86+
.sendtoaddress(address, amount.to_btc())
8787
.await?;
8888
let txid = Txid::from_hex(&txid)?;
8989

@@ -241,7 +241,7 @@ mod test {
241241
});
242242
// add shared output with twice the btc to fit change addresses
243243
outputs.push(TxOut {
244-
value: Amount::from_btc(2.0).unwrap().as_sat(),
244+
value: Amount::from_btc(2.0).unwrap().to_sat(),
245245
script_pubkey: joined_address.clone().script_pubkey(),
246246
});
247247

0 commit comments

Comments
 (0)