Struct breez_sdk_core::lightning::util::test_utils::TestChainMonitor
pub struct TestChainMonitor<'a> {
pub added_monitors: Mutex<Vec<(OutPoint, ChannelMonitor<TestChannelSigner>)>>,
pub monitor_updates: Mutex<HashMap<ChannelId, Vec<ChannelMonitorUpdate>>>,
pub latest_monitor_update_id: Mutex<HashMap<ChannelId, (OutPoint, u64, MonitorUpdateId)>>,
pub chain_monitor: ChainMonitor<TestChannelSigner, &'a TestChainSource, &'a dyn BroadcasterInterface, &'a TestFeeEstimator, &'a TestLogger, &'a dyn Persist<TestChannelSigner>>,
pub keys_manager: &'a TestKeysInterface,
pub expect_channel_force_closed: Mutex<Option<(ChannelId, bool)>>,
pub expect_monitor_round_trip_fail: Mutex<Option<ChannelId>>,
}
Fields§
§added_monitors: Mutex<Vec<(OutPoint, ChannelMonitor<TestChannelSigner>)>>
§monitor_updates: Mutex<HashMap<ChannelId, Vec<ChannelMonitorUpdate>>>
§latest_monitor_update_id: Mutex<HashMap<ChannelId, (OutPoint, u64, MonitorUpdateId)>>
§chain_monitor: ChainMonitor<TestChannelSigner, &'a TestChainSource, &'a dyn BroadcasterInterface, &'a TestFeeEstimator, &'a TestLogger, &'a dyn Persist<TestChannelSigner>>
§keys_manager: &'a TestKeysInterface
§expect_channel_force_closed: Mutex<Option<(ChannelId, bool)>>
If this is set to Some(), the next update_channel call (not watch_channel) must be a ChannelForceClosed event for the given channel_id with should_broadcast set to the given boolean.
expect_monitor_round_trip_fail: Mutex<Option<ChannelId>>
If this is set to Some(), the next round trip serialization check will not hold after an update_channel call (not watch_channel) for the given channel_id.
Implementations§
§impl<'a> TestChainMonitor<'a>
impl<'a> TestChainMonitor<'a>
pub fn new( chain_source: Option<&'a TestChainSource>, broadcaster: &'a dyn BroadcasterInterface, logger: &'a TestLogger, fee_estimator: &'a TestFeeEstimator, persister: &'a dyn Persist<TestChannelSigner>, keys_manager: &'a TestKeysInterface, ) -> TestChainMonitor<'a>
pub fn complete_sole_pending_chan_update(&self, channel_id: &ChannelId)
Trait Implementations§
§impl<'a> Watch<TestChannelSigner> for TestChainMonitor<'a>
impl<'a> Watch<TestChannelSigner> for TestChainMonitor<'a>
§fn watch_channel(
&self,
funding_txo: OutPoint,
monitor: ChannelMonitor<TestChannelSigner>,
) -> Result<ChannelMonitorUpdateStatus, ()>
fn watch_channel( &self, funding_txo: OutPoint, monitor: ChannelMonitor<TestChannelSigner>, ) -> Result<ChannelMonitorUpdateStatus, ()>
§fn update_channel(
&self,
funding_txo: OutPoint,
update: &ChannelMonitorUpdate,
) -> ChannelMonitorUpdateStatus
fn update_channel( &self, funding_txo: OutPoint, update: &ChannelMonitorUpdate, ) -> ChannelMonitorUpdateStatus
§fn release_pending_monitor_events(
&self,
) -> Vec<(OutPoint, Vec<MonitorEvent>, Option<PublicKey>)>
fn release_pending_monitor_events( &self, ) -> Vec<(OutPoint, Vec<MonitorEvent>, Option<PublicKey>)>
Returns any monitor events since the last call. Subsequent calls must only return new
events. Read more
Auto Trait Implementations§
impl<'a> !Freeze for TestChainMonitor<'a>
impl<'a> !RefUnwindSafe for TestChainMonitor<'a>
impl<'a> !Send for TestChainMonitor<'a>
impl<'a> !Sync for TestChainMonitor<'a>
impl<'a> Unpin for TestChainMonitor<'a>
impl<'a> !UnwindSafe for TestChainMonitor<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Forward to the method defined on the type
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request