X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchanmon_update_fail_tests.rs;h=a78cf50acb97006ec19456e75e2be45a9e52de2c;hb=a6609d6d6ae94939e92324534e39a60088e32a51;hp=11434ce3a89f8a7d3bdef67e5547fb19489599c2;hpb=958601f1afd754c65e5ba0bbc946a2798970695c;p=rust-lightning diff --git a/lightning/src/ln/chanmon_update_fail_tests.rs b/lightning/src/ln/chanmon_update_fail_tests.rs index 11434ce3..a78cf50a 100644 --- a/lightning/src/ln/chanmon_update_fail_tests.rs +++ b/lightning/src/ln/chanmon_update_fail_tests.rs @@ -16,29 +16,29 @@ use bitcoin::blockdata::block::{Block, BlockHeader}; use bitcoin::blockdata::constants::genesis_block; use bitcoin::hash_types::BlockHash; use bitcoin::network::constants::Network; -use chain::channelmonitor::{ANTI_REORG_DELAY, ChannelMonitor}; -use chain::transaction::OutPoint; -use chain::{ChannelMonitorUpdateStatus, Listen, Watch}; -use ln::channelmanager::{self, ChannelManager, ChannelManagerReadArgs, RAACommitmentOrder, PaymentSendFailure}; -use ln::channel::AnnouncementSigsState; -use ln::msgs; -use ln::msgs::{ChannelMessageHandler, RoutingMessageHandler}; -use util::config::UserConfig; -use util::enforcing_trait_impls::EnforcingSigner; -use util::events::{Event, MessageSendEvent, MessageSendEventsProvider, PaymentPurpose, ClosureReason, HTLCDestination}; -use util::errors::APIError; -use util::ser::{ReadableArgs, Writeable}; -use util::test_utils::TestBroadcaster; - -use ln::functional_test_utils::*; - -use util::test_utils; - -use io; +use crate::chain::channelmonitor::{ANTI_REORG_DELAY, ChannelMonitor}; +use crate::chain::transaction::OutPoint; +use crate::chain::{ChannelMonitorUpdateStatus, Listen, Watch}; +use crate::ln::channelmanager::{self, ChannelManager, ChannelManagerReadArgs, RAACommitmentOrder, PaymentSendFailure}; +use crate::ln::channel::AnnouncementSigsState; +use crate::ln::msgs; +use crate::ln::msgs::{ChannelMessageHandler, RoutingMessageHandler}; +use crate::util::config::UserConfig; +use crate::util::enforcing_trait_impls::EnforcingSigner; +use crate::util::events::{Event, MessageSendEvent, MessageSendEventsProvider, PaymentPurpose, ClosureReason, HTLCDestination}; +use crate::util::errors::APIError; +use crate::util::ser::{ReadableArgs, Writeable}; +use crate::util::test_utils::TestBroadcaster; + +use crate::ln::functional_test_utils::*; + +use crate::util::test_utils; + +use crate::io; use bitcoin::hashes::Hash; use bitcoin::TxMerkleNode; -use prelude::*; -use sync::{Arc, Mutex}; +use crate::prelude::*; +use crate::sync::{Arc, Mutex}; #[test] fn test_simple_monitor_permanent_update_fail() { @@ -2231,7 +2231,7 @@ fn do_channel_holding_cell_serialize(disconnect: bool, reload_a: bool) { let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]); let persister: test_utils::TestPersister; let new_chain_monitor: test_utils::TestChainMonitor; - let nodes_0_deserialized: ChannelManager; + let nodes_0_deserialized: ChannelManager<&test_utils::TestChainMonitor, &test_utils::TestBroadcaster, &test_utils::TestKeysInterface, &test_utils::TestFeeEstimator, &test_utils::TestLogger>; let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs); let chan_id = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 15_000_000, 7_000_000_000, channelmanager::provided_init_features(), channelmanager::provided_init_features()).2; @@ -2305,7 +2305,7 @@ fn do_channel_holding_cell_serialize(disconnect: bool, reload_a: bool) { nodes_0_deserialized = { let mut channel_monitors = HashMap::new(); channel_monitors.insert(chan_0_monitor.get_funding_txo().0, &mut chan_0_monitor); - <(BlockHash, ChannelManager)>::read(&mut nodes_0_read, ChannelManagerReadArgs { + <(BlockHash, ChannelManager<&test_utils::TestChainMonitor, &test_utils::TestBroadcaster, &test_utils::TestKeysInterface, &test_utils::TestFeeEstimator, &test_utils::TestLogger>)>::read(&mut nodes_0_read, ChannelManagerReadArgs { default_config: config, keys_manager, fee_estimator: node_cfgs[0].fee_estimator, @@ -2756,7 +2756,7 @@ fn do_test_outbound_reload_without_init_mon(use_0conf: bool) { let persister: test_utils::TestPersister; let new_chain_monitor: test_utils::TestChainMonitor; - let nodes_0_deserialized: ChannelManager; + let nodes_0_deserialized: ChannelManager<&test_utils::TestChainMonitor, &test_utils::TestBroadcaster, &test_utils::TestKeysInterface, &test_utils::TestFeeEstimator, &test_utils::TestLogger>; let mut chan_config = test_default_channel_config(); chan_config.manually_accept_inbound_channels = true; @@ -2834,7 +2834,7 @@ fn do_test_outbound_reload_without_init_mon(use_0conf: bool) { let mut nodes_0_read = &nodes_0_serialized[..]; let config = UserConfig::default(); nodes_0_deserialized = { - <(BlockHash, ChannelManager)>::read(&mut nodes_0_read, ChannelManagerReadArgs { + <(BlockHash, ChannelManager<&test_utils::TestChainMonitor, &test_utils::TestBroadcaster, &test_utils::TestKeysInterface, &test_utils::TestFeeEstimator, &test_utils::TestLogger>)>::read(&mut nodes_0_read, ChannelManagerReadArgs { default_config: config, keys_manager, fee_estimator: node_cfgs[0].fee_estimator, @@ -2866,7 +2866,7 @@ fn do_test_inbound_reload_without_init_mon(use_0conf: bool, lock_commitment: boo let persister: test_utils::TestPersister; let new_chain_monitor: test_utils::TestChainMonitor; - let nodes_1_deserialized: ChannelManager; + let nodes_1_deserialized: ChannelManager<&test_utils::TestChainMonitor, &test_utils::TestBroadcaster, &test_utils::TestKeysInterface, &test_utils::TestFeeEstimator, &test_utils::TestLogger>; let mut chan_config = test_default_channel_config(); chan_config.manually_accept_inbound_channels = true; @@ -2940,7 +2940,7 @@ fn do_test_inbound_reload_without_init_mon(use_0conf: bool, lock_commitment: boo let mut nodes_1_read = &nodes_1_serialized[..]; let config = UserConfig::default(); nodes_1_deserialized = { - <(BlockHash, ChannelManager)>::read(&mut nodes_1_read, ChannelManagerReadArgs { + <(BlockHash, ChannelManager<&test_utils::TestChainMonitor, &test_utils::TestBroadcaster, &test_utils::TestKeysInterface, &test_utils::TestFeeEstimator, &test_utils::TestLogger>)>::read(&mut nodes_1_read, ChannelManagerReadArgs { default_config: config, keys_manager, fee_estimator: node_cfgs[1].fee_estimator,