diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28cf0ee..31435db 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,7 +72,7 @@ jobs: strategy: fail-fast: false matrix: - toolchain: [ "1.41.1", "stable", "nightly" ] + toolchain: [ "1.42", "stable", "nightly" ] steps: - uses: actions/checkout@v2 diff --git a/Cargo.toml b/Cargo.toml index 54f3593..b78fbf5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ documentation = "https://docs.rs/bitcoind/" edition = "2018" [dependencies] -bitcoincore-rpc = "0.16.0" +bitcoincore-rpc = "0.15.0" tempfile = "3.1" log = "0.4" which = "4.2.5" @@ -18,14 +18,12 @@ which = "4.2.5" env_logger = "0.8" [build-dependencies] -bitcoin_hashes = "0.11" +bitcoin_hashes = "0.10" +ureq = "2.1" +flate2 = "1.0" tar = "0.4" zip = "0.5" - -# allows to keep MSRV 1.41.1 -ureq = "1.0" filetime = "=0.2.15" -flate2 = "=1.0.22" [features] "23_0" = [] diff --git a/build.rs b/build.rs index 80be5c9..69d1aa9 100644 --- a/build.rs +++ b/build.rs @@ -103,10 +103,19 @@ fn main() { ); println!("url:{}", url); let mut downloaded_bytes = Vec::new(); - let resp = ureq::get(&url).call(); - assert_eq!(resp.status(), 200, "url {} didn't return 200", url); - let _size = resp + let http_proxy = std::env::var("HTTPS_PROXY").or_else(|_| std::env::var("HTTP_PROXY")); + let agent = if let Ok(proxy) = http_proxy { + let proxy = ureq::Proxy::new(proxy).unwrap(); + ureq::AgentBuilder::new().proxy(proxy).build() + } else { + ureq::AgentBuilder::new().build() + }; + + let _size = agent + .get(&url) + .call() + .unwrap() .into_reader() .read_to_end(&mut downloaded_bytes) .unwrap(); diff --git a/src/lib.rs b/src/lib.rs index a22c067..f3ac865 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -642,7 +642,7 @@ mod test { // bob wallet may not be immediately updated for _ in 0..30 { - if bob.get_balances().unwrap().mine.untrusted_pending.to_sat() > 0 { + if bob.get_balances().unwrap().mine.untrusted_pending.as_sat() > 0 { break; } std::thread::sleep(std::time::Duration::from_millis(100));