diff --git a/Cargo.toml b/Cargo.toml index bf40e6f..251a617 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,13 +14,13 @@ bitcoin = { version = "0.25", features = ["use-serde"] } bitcoincore-rpc-json = "0.12" futures = "0.3.5" hex = "0.4.2" -jsonrpc_client = { git = "https://github.com/thomaseizinger/rust-jsonrpc-client", rev = "c7010817e0f86ab24b3dc10d6bb0463faa0aace4", features = ["reqwest"] } -reqwest = { version = "0.10", default-features = false, features = ["json", "native-tls"] } +jsonrpc_client = { git = "https://github.com/thomaseizinger/rust-jsonrpc-client", rev = "f60c839481c1ac68909ada0141a3a3bf085bb1af", features = ["reqwest"] } +reqwest = { version = "0.11", default-features = false, features = ["json", "native-tls"] } serde = "1.0" serde_json = "1.0" testcontainers = "0.11" thiserror = "1.0" -tokio = { version = "0.2", default-features = false, features = ["blocking", "macros", "rt-core", "time"] } +tokio = { version = "1.0", default-features = false, features = ["rt-multi-thread", "macros", "time"] } tracing = "0.1" url = "2" diff --git a/src/bitcoind_rpc.rs b/src/bitcoind_rpc.rs index 27c646c..0c44f57 100644 --- a/src/bitcoind_rpc.rs +++ b/src/bitcoind_rpc.rs @@ -230,7 +230,7 @@ mod test { use crate::Bitcoind; use std::time::Duration; use testcontainers::clients; - use tokio::time::delay_for; + use tokio::time::sleep; #[tokio::test] async fn get_network_info() { @@ -267,7 +267,7 @@ mod test { let client = Client::new(bitcoind.node_url.clone()); let height_0 = client.getblockcount().await.unwrap(); - delay_for(Duration::from_secs(2)).await; + sleep(Duration::from_secs(2)).await; let height_1 = client.getblockcount().await.unwrap(); diff --git a/src/lib.rs b/src/lib.rs index d5f0976..50ede05 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -160,7 +160,7 @@ impl<'c> Bitcoind<'c> { async fn mine(bitcoind_client: Client, reward_address: bitcoin::Address) -> Result<()> { loop { - tokio::time::delay_for(Duration::from_secs(1)).await; + tokio::time::sleep(Duration::from_secs(1)).await; bitcoind_client .generatetoaddress(1, reward_address.clone(), None) .await?; diff --git a/src/wallet.rs b/src/wallet.rs index 7bde86e..a8f7f12 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -168,7 +168,7 @@ mod test { use crate::{Bitcoind, Wallet}; use bitcoin::util::psbt::PartiallySignedTransaction; use bitcoin::{Amount, Transaction, TxOut}; - use tokio::time::delay_for; + use tokio::time::sleep; #[tokio::test] async fn get_wallet_transaction() { @@ -304,7 +304,7 @@ mod test { // wait for the transaction to be included in a block, so that // it has a block height field assigned to it when calling // `getrawtransaction` - delay_for(Duration::from_secs(2)).await; + sleep(Duration::from_secs(2)).await; let _res = wallet.transaction_block_height(txid).await.unwrap(); }