Add ChainPoller implementation of Poll trait
[rust-lightning] / lightning-block-sync / src / lib.rs
index 4f004b8f284c85438b53deae185e26c40be28995..f2716ccc437f26f83220d56b17d6f21c97a0084b 100644 (file)
 #[cfg(any(feature = "rest-client", feature = "rpc-client"))]
 pub mod http;
 
+pub mod poll;
+
 #[cfg(feature = "rest-client")]
 pub mod rest;
 
 #[cfg(feature = "rpc-client")]
 pub mod rpc;
 
+#[cfg(any(feature = "rest-client", feature = "rpc-client"))]
+mod convert;
+
+#[cfg(test)]
+mod test_utils;
+
+#[cfg(any(feature = "rest-client", feature = "rpc-client"))]
+mod utils;
+
 use bitcoin::blockdata::block::{Block, BlockHeader};
 use bitcoin::hash_types::BlockHash;
 use bitcoin::util::uint::Uint256;
@@ -59,13 +70,14 @@ type AsyncBlockSourceResult<'a, T> = Pin<Box<dyn Future<Output = BlockSourceResu
 ///
 /// Transient errors may be resolved when re-polling, but no attempt will be made to re-poll on
 /// persistent errors.
+#[derive(Debug)]
 pub struct BlockSourceError {
        kind: BlockSourceErrorKind,
        error: Box<dyn std::error::Error + Send + Sync>,
 }
 
 /// The kind of `BlockSourceError`, either persistent or transient.
-#[derive(Clone, Copy)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 pub enum BlockSourceErrorKind {
        /// Indicates an error that won't resolve when retrying a request (e.g., invalid data).
        Persistent,