projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test utils: include payment_metadata in PassAlongPathArgs.
[rust-lightning]
/
lightning-block-sync
/
src
/
init.rs
diff --git
a/lightning-block-sync/src/init.rs
b/lightning-block-sync/src/init.rs
index 866b247edee0b5e6e4b7a0b1faff0a857bfbfbc8..ba93d12f5bcd7ff49d703e530c448b27707bd1a5 100644
(file)
--- a/
lightning-block-sync/src/init.rs
+++ b/
lightning-block-sync/src/init.rs
@@
-4,7
+4,7
@@
use crate::{BlockSource, BlockSourceResult, Cache, ChainNotifier};
use crate::poll::{ChainPoller, Validate, ValidatedBlockHeader};
use crate::{BlockSource, BlockSourceResult, Cache, ChainNotifier};
use crate::poll::{ChainPoller, Validate, ValidatedBlockHeader};
-use bitcoin::blockdata::block::
Block
Header;
+use bitcoin::blockdata::block::Header;
use bitcoin::hash_types::BlockHash;
use bitcoin::network::constants::Network;
use bitcoin::hash_types::BlockHash;
use bitcoin::network::constants::Network;
@@
-47,8
+47,8
@@
BlockSourceResult<ValidatedBlockHeader> where B::Target: BlockSource {
/// use lightning::chain::channelmonitor::ChannelMonitor;
/// use lightning::chain::chaininterface::BroadcasterInterface;
/// use lightning::chain::chaininterface::FeeEstimator;
/// use lightning::chain::channelmonitor::ChannelMonitor;
/// use lightning::chain::chaininterface::BroadcasterInterface;
/// use lightning::chain::chaininterface::FeeEstimator;
-/// use lightning::
chain::keysinterface
;
-/// use lightning::
chain::keysinterface
::{EntropySource, NodeSigner, SignerProvider};
+/// use lightning::
sign
;
+/// use lightning::
sign
::{EntropySource, NodeSigner, SignerProvider};
/// use lightning::ln::channelmanager::{ChannelManager, ChannelManagerReadArgs};
/// use lightning::routing::router::Router;
/// use lightning::util::config::UserConfig;
/// use lightning::ln::channelmanager::{ChannelManager, ChannelManagerReadArgs};
/// use lightning::routing::router::Router;
/// use lightning::util::config::UserConfig;
@@
-69,10
+69,10
@@
BlockSourceResult<ValidatedBlockHeader> where B::Target: BlockSource {
/// R: Router,
/// L: Logger,
/// C: chain::Filter,
/// R: Router,
/// L: Logger,
/// C: chain::Filter,
-/// P: chainmonitor::Persist<SP::Signer>,
+/// P: chainmonitor::Persist<SP::
Ecdsa
Signer>,
/// >(
/// block_source: &B,
/// >(
/// block_source: &B,
-/// chain_monitor: &ChainMonitor<SP::Signer, &C, &T, &F, &L, &P>,
+/// chain_monitor: &ChainMonitor<SP::
Ecdsa
Signer, &C, &T, &F, &L, &P>,
/// config: UserConfig,
/// entropy_source: &ES,
/// node_signer: &NS,
/// config: UserConfig,
/// entropy_source: &ES,
/// node_signer: &NS,
@@
-85,7
+85,7
@@
BlockSourceResult<ValidatedBlockHeader> where B::Target: BlockSource {
/// ) {
/// // Read a serialized channel monitor paired with the block hash when it was persisted.
/// let serialized_monitor = "...";
/// ) {
/// // Read a serialized channel monitor paired with the block hash when it was persisted.
/// let serialized_monitor = "...";
-/// let (monitor_block_hash, mut monitor) = <(BlockHash, ChannelMonitor<SP::Signer>)>::read(
+/// let (monitor_block_hash, mut monitor) = <(BlockHash, ChannelMonitor<SP::
Ecdsa
Signer>)>::read(
/// &mut Cursor::new(&serialized_monitor), (entropy_source, signer_provider)).unwrap();
///
/// // Read the channel manager paired with the block hash when it was persisted.
/// &mut Cursor::new(&serialized_monitor), (entropy_source, signer_provider)).unwrap();
///
/// // Read the channel manager paired with the block hash when it was persisted.
@@
-103,7
+103,7
@@
BlockSourceResult<ValidatedBlockHeader> where B::Target: BlockSource {
/// config,
/// vec![&mut monitor],
/// );
/// config,
/// vec![&mut monitor],
/// );
-/// <(BlockHash, ChannelManager<&ChainMonitor<SP::Signer, &C, &T, &F, &L, &P>, &T, &ES, &NS, &SP, &F, &R, &L>)>::read(
+/// <(BlockHash, ChannelManager<&ChainMonitor<SP::
Ecdsa
Signer, &C, &T, &F, &L, &P>, &T, &ES, &NS, &SP, &F, &R, &L>)>::read(
/// &mut Cursor::new(&serialized_manager), read_args).unwrap()
/// };
///
/// &mut Cursor::new(&serialized_manager), read_args).unwrap()
/// };
///
@@
-211,11
+211,11
@@
impl<'a, C: Cache> Cache for ReadOnlyCache<'a, C> {
struct DynamicChainListener<'a, L: chain::Listen + ?Sized>(&'a L);
impl<'a, L: chain::Listen + ?Sized> chain::Listen for DynamicChainListener<'a, L> {
struct DynamicChainListener<'a, L: chain::Listen + ?Sized>(&'a L);
impl<'a, L: chain::Listen + ?Sized> chain::Listen for DynamicChainListener<'a, L> {
- fn filtered_block_connected(&self, _header: &
Block
Header, _txdata: &chain::transaction::TransactionData, _height: u32) {
+ fn filtered_block_connected(&self, _header: &Header, _txdata: &chain::transaction::TransactionData, _height: u32) {
unreachable!()
}
unreachable!()
}
- fn block_disconnected(&self, header: &
Block
Header, height: u32) {
+ fn block_disconnected(&self, header: &Header, height: u32) {
self.0.block_disconnected(header, height)
}
}
self.0.block_disconnected(header, height)
}
}
@@
-234,7
+234,7
@@
impl<'a, L: chain::Listen + ?Sized> chain::Listen for ChainListenerSet<'a, L> {
}
}
}
}
- fn filtered_block_connected(&self, header: &
Block
Header, txdata: &chain::transaction::TransactionData, height: u32) {
+ fn filtered_block_connected(&self, header: &Header, txdata: &chain::transaction::TransactionData, height: u32) {
for (starting_height, chain_listener) in self.0.iter() {
if height > *starting_height {
chain_listener.filtered_block_connected(header, txdata, height);
for (starting_height, chain_listener) in self.0.iter() {
if height > *starting_height {
chain_listener.filtered_block_connected(header, txdata, height);
@@
-242,7
+242,7
@@
impl<'a, L: chain::Listen + ?Sized> chain::Listen for ChainListenerSet<'a, L> {
}
}
}
}
- fn block_disconnected(&self, _header: &
Block
Header, _height: u32) {
+ fn block_disconnected(&self, _header: &Header, _height: u32) {
unreachable!()
}
}
unreachable!()
}
}
@@
-252,8
+252,6
@@
mod tests {
use crate::test_utils::{Blockchain, MockChainListener};
use super::*;
use crate::test_utils::{Blockchain, MockChainListener};
use super::*;
- use bitcoin::network::constants::Network;
-
#[tokio::test]
async fn sync_from_same_chain() {
let chain = Blockchain::default().with_height(4);
#[tokio::test]
async fn sync_from_same_chain() {
let chain = Blockchain::default().with_height(4);