From: github-actions Date: Tue, 5 Jul 2022 10:40:53 +0000 (+0000) Subject: Publish autogenerated nightly docs X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/struct.BlockTransactions.html?a=commitdiff_plain;h=c163d263164f7f4575e56c97d8df832a68c2a36d;p=bitcoindevkit.org Publish autogenerated nightly docs --- diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/electrum/index.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/electrum/index.html index f02966cfaf..7ebde88a21 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/electrum/index.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/electrum/index.html @@ -6,7 +6,7 @@ logo

Module electrum

logo
This is supported on crate feature electrum only.
Expand description

Electrum

+

Module bdk::blockchain::electrum

source · []
This is supported on crate feature electrum only.
Expand description

Electrum

This module defines a Blockchain struct that wraps an [electrum_client::Client] and implements the logic required to populate the wallet’s database by querying the inner client.

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/electrum/struct.ElectrumBlockchain.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/electrum/struct.ElectrumBlockchain.html index 7d00e1f813..0eceaa4f68 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/electrum/struct.ElectrumBlockchain.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/electrum/struct.ElectrumBlockchain.html @@ -12,13 +12,13 @@

Trait Implementations

Return the set of Capability supported by this backend

Broadcast a transaction

Estimate the fee rate required to confirm a transaction in a given target of blocks

-

Type that contains the configuration

-

Create a new instance given a configuration

+

Type that contains the configuration

+

Create a new instance given a configuration

Performs the conversion.

Performs the conversion.

Return the current height

Fetch a transaction given its txid

-

Setup the backend and populate the internal database for the first time Read more

+

Setup the backend and populate the internal database for the first time Read more

If not overridden, it defaults to calling Self::wallet_setup internally. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html index ef37344dcc..be528a882b 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html @@ -6,7 +6,7 @@ logo

ElectrumBlockchainConfig

logo
pub struct ElectrumBlockchainConfig {
+    

Struct bdk::blockchain::electrum::ElectrumBlockchainConfig

source · []
pub struct ElectrumBlockchainConfig {
     pub url: String,
     pub socks5: Option<String>,
     pub retry: u8,
@@ -19,16 +19,16 @@
 
retry: u8

Request retry count

timeout: Option<u8>

Request timeout (seconds)

stop_gap: usize

Stop searching addresses for transactions after finding an unused gap of this length

-

Trait Implementations

Returns a copy of the value. Read more

+

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

-

Formats the value using the given formatter. Read more

-

Deserialize this value from the given Serde deserializer. Read more

+

Formats the value using the given formatter. Read more

+

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

-

This method tests for self and other values to be equal, and is used +

This method tests for self and other values to be equal, and is used by ==. Read more

-

This method tests for !=.

-

Serialize this value into the given Serde serializer. Read more

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

This method tests for !=.

+

Serialize this value into the given Serde serializer. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/esplora/index.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/esplora/index.html index bdcdddc685..c37c0988fd 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/esplora/index.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/esplora/index.html @@ -6,7 +6,7 @@ logo

Module esplora

logo
This is supported on crate feature esplora only.
Expand description

Esplora

+

Module bdk::blockchain::esplora

source · []
This is supported on crate feature esplora only.
Expand description

Esplora

This module defines a EsploraBlockchain struct that can query an Esplora backend populate the wallet’s database by:

Example

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/trait.ConfigurableBlockchain.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/trait.ConfigurableBlockchain.html index 96badade55..d4f6d71319 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/trait.ConfigurableBlockchain.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/trait.ConfigurableBlockchain.html @@ -12,5 +12,5 @@ }
Expand description

Trait for Blockchain types that can be created given a configuration

Associated Types

Type that contains the configuration

Required methods

Create a new instance given a configuration

-

Implementors

+

Implementors

\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/trait.WalletSync.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/trait.WalletSync.html index acc4aaa24a..d05563e312 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/trait.WalletSync.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/blockchain/trait.WalletSync.html @@ -28,5 +28,5 @@ in the blockchain to populate the database with BatchOperations::del_utxo.

The progress_update object can be used to give the caller updates about the progress by using Progress::update.

-

Implementations on Foreign Types

Implementors

+

Implementations on Foreign Types

Implementors

\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/blockchain/electrum.rs.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/blockchain/electrum.rs.html index d52d743945..3cc4de1172 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/blockchain/electrum.rs.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/blockchain/electrum.rs.html @@ -393,6 +393,26 @@ 386 387 388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408
// Bitcoin Dev Kit
 // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
 //
@@ -503,7 +523,10 @@
         let mut block_times = HashMap::<u32, u32>::new();
         let mut txid_to_height = HashMap::<Txid, u32>::new();
         let mut tx_cache = TxCache::new(database, &self.client);
-        let chunk_size = self.stop_gap;
+
+        // Set chunk_size to the smallest value capable of finding a gap greater than stop_gap.
+        let chunk_size = self.stop_gap + 1;
+
         // The electrum server has been inconsistent somehow in its responses during sync. For
         // example, we do a batch request of transactions and the response contains less
         // tranascations than in the request. This should never happen but we don't want to panic.
@@ -539,21 +562,12 @@
 
                 Request::Conftime(conftime_req) => {
                     // collect up to chunk_size heights to fetch from electrum
-                    let needs_block_height = {
-                        let mut needs_block_height_iter = conftime_req
-                            .request()
-                            .filter_map(|txid| txid_to_height.get(txid).cloned())
-                            .filter(|height| block_times.get(height).is_none());
-                        let mut needs_block_height = HashSet::new();
-
-                        while needs_block_height.len() < chunk_size {
-                            match needs_block_height_iter.next() {
-                                Some(height) => needs_block_height.insert(height),
-                                None => break,
-                            };
-                        }
-                        needs_block_height
-                    };
+                    let needs_block_height = conftime_req
+                        .request()
+                        .filter_map(|txid| txid_to_height.get(txid).cloned())
+                        .filter(|height| block_times.get(height).is_none())
+                        .take(chunk_size)
+                        .collect::<HashSet<u32>>();
 
                     let new_block_headers = self
                         .client
@@ -723,6 +737,7 @@
     use super::*;
     use crate::database::MemoryDatabase;
     use crate::testutils::blockchain_tests::TestClient;
+    use crate::testutils::configurable_blockchain_tests::ConfigurableBlockchainTester;
     use crate::wallet::{AddressIndex, Wallet};
 
     crate::bdk_blockchain_tests! {
@@ -780,6 +795,31 @@
 
         assert_eq!(wallet.get_balance().unwrap(), 50_000);
     }
+
+    #[test]
+    fn test_electrum_with_variable_configs() {
+        struct ElectrumTester;
+
+        impl ConfigurableBlockchainTester<ElectrumBlockchain> for ElectrumTester {
+            const BLOCKCHAIN_NAME: &'static str = "Electrum";
+
+            fn config_with_stop_gap(
+                &self,
+                test_client: &mut TestClient,
+                stop_gap: usize,
+            ) -> Option<ElectrumBlockchainConfig> {
+                Some(ElectrumBlockchainConfig {
+                    url: test_client.electrsd.electrum_url.clone(),
+                    socks5: None,
+                    retry: 0,
+                    timeout: None,
+                    stop_gap: stop_gap,
+                })
+            }
+        }
+
+        ElectrumTester.run();
+    }
 }
 
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/blockchain/esplora/mod.rs.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/blockchain/esplora/mod.rs.html index e125c43781..ffc5d60218 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/blockchain/esplora/mod.rs.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/blockchain/esplora/mod.rs.html @@ -217,6 +217,40 @@ 210 211 212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246
//! Esplora
 //!
 //! This module defines a [`EsploraBlockchain`] struct that can query an Esplora
@@ -428,6 +462,40 @@
             "should inherit from value for 25"
         );
     }
+
+    #[test]
+    #[cfg(feature = "test-esplora")]
+    fn test_esplora_with_variable_configs() {
+        use crate::testutils::{
+            blockchain_tests::TestClient,
+            configurable_blockchain_tests::ConfigurableBlockchainTester,
+        };
+
+        struct EsploraTester;
+
+        impl ConfigurableBlockchainTester<EsploraBlockchain> for EsploraTester {
+            const BLOCKCHAIN_NAME: &'static str = "Esplora";
+
+            fn config_with_stop_gap(
+                &self,
+                test_client: &mut TestClient,
+                stop_gap: usize,
+            ) -> Option<EsploraBlockchainConfig> {
+                Some(EsploraBlockchainConfig {
+                    base_url: format!(
+                        "http://{}",
+                        test_client.electrsd.esplora_url.as_ref().unwrap()
+                    ),
+                    proxy: None,
+                    concurrency: None,
+                    stop_gap: stop_gap,
+                    timeout: None,
+                })
+            }
+        }
+
+        EsploraTester.run();
+    }
 }
 
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/blockchain/esplora/ureq.rs.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/blockchain/esplora/ureq.rs.html index 00c530f1e8..629ba9f510 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/blockchain/esplora/ureq.rs.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/blockchain/esplora/ureq.rs.html @@ -476,7 +476,7 @@ } fn broadcast(&self, tx: &Transaction) -> Result<(), Error> { - let _txid = self.url_client._broadcast(tx)?; + self.url_client._broadcast(tx)?; Ok(()) } diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/testutils/mod.rs.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/testutils/mod.rs.html index 3213ed99bc..08498fb453 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/testutils/mod.rs.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/testutils/mod.rs.html @@ -237,6 +237,10 @@ 230 231 232 +233 +234 +235 +236
// Bitcoin Dev Kit
 // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
 //
@@ -253,6 +257,10 @@
 #[cfg(feature = "test-blockchains")]
 pub mod blockchain_tests;
 
+#[cfg(test)]
+#[cfg(feature = "test-blockchains")]
+pub mod configurable_blockchain_tests;
+
 use bitcoin::{Address, Txid};
 
 #[derive(Clone, Debug)]