From 813c1ddcd050883a633e55ef111e7eba4acd3f87 Mon Sep 17 00:00:00 2001 From: Justin Moon Date: Tue, 17 Nov 2020 18:27:01 -0600 Subject: [PATCH 1/2] [blockchain] Upgrade tokio - Also upgrade reqwest - Switch to `tokio::runtime::Builder::new_single_thread()` because `tokio::runtime::Runtime::new()` changed it's behavior to create a multithreaded runtime. - `enable_all` enables time and io resource drivers as explained [here](https://docs.rs/tokio/0.2.24/tokio/runtime/index.html#resource-drivers) --- Cargo.toml | 6 +++--- macros/src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b4f392f0..51390328 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ readme = "README.md" license = "MIT" [dependencies] -bdk-macros = "0.2" +bdk-macros = { path = "./macros" } log = "^0.4" miniscript = "4.0" bitcoin = { version = "^0.25.2", features = ["use-serde"] } @@ -23,7 +23,7 @@ rand = "^0.7" # Optional dependencies sled = { version = "0.34", optional = true } electrum-client = { version = "0.5.0-beta.1", optional = true } -reqwest = { version = "0.10", optional = true, features = ["json"] } +reqwest = { version = "0.11", optional = true, features = ["json"] } futures = { version = "0.3", optional = true } async-trait = { version = "0.1", optional = true } rocksdb = { version = "0.14", optional = true } @@ -35,7 +35,7 @@ tiny-bip39 = { version = "^0.8", optional = true } # Platform-specific dependencies [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -tokio = { version = "0.2", features = ["rt-core"] } +tokio = { version = "1.0", features = ["rt"] } [target.'cfg(target_arch = "wasm32")'.dependencies] async-trait = "0.1" diff --git a/macros/src/lib.rs b/macros/src/lib.rs index ad305478..d1cd53b0 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -145,7 +145,7 @@ pub fn await_or_block(expr: TokenStream) -> TokenStream { { #[cfg(all(not(target_arch = "wasm32"), not(feature = "async-interface")))] { - tokio::runtime::Runtime::new().unwrap().block_on(#expr) + tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(#expr) } #[cfg(any(target_arch = "wasm32", feature = "async-interface"))] From 5c82789e57cec7040f08c955079f03cd7197699f Mon Sep 17 00:00:00 2001 From: Justin Moon Date: Wed, 13 Jan 2021 23:04:23 -0600 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a3f63f7..979de189 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Changed - Remove `BlockchainMarker`, `OfflineClient` and `OfflineWallet` in favor of just using the unit type to mark for a missing client. +- Upgrade `tokio` to `1.0`. ### CLI #### Changed