Struct lightning_signer::util::test_utils::TestChainMonitor[][src]

pub struct TestChainMonitor<'a> {
    pub added_monitors: Mutex<Vec<(OutPoint, ())>>,
    pub latest_monitor_update_id: Mutex<Map<[u8; 32], (OutPoint, u64)>>,
    pub chain_monitor: ChainMonitor<LoopbackChannelSigner, &'a TestChainSource, &'a dyn BroadcasterInterface, &'a TestFeeEstimator, &'a TestLogger, &'a dyn Persist<LoopbackChannelSigner>>,
    pub update_ret: Mutex<Option<Result<(), ChannelMonitorUpdateErr>>>,
    pub next_update_ret: Mutex<Option<Result<(), ChannelMonitorUpdateErr>>>,
}

Fields

added_monitors: Mutex<Vec<(OutPoint, ())>>latest_monitor_update_id: Mutex<Map<[u8; 32], (OutPoint, u64)>>chain_monitor: ChainMonitor<LoopbackChannelSigner, &'a TestChainSource, &'a dyn BroadcasterInterface, &'a TestFeeEstimator, &'a TestLogger, &'a dyn Persist<LoopbackChannelSigner>>update_ret: Mutex<Option<Result<(), ChannelMonitorUpdateErr>>>next_update_ret: Mutex<Option<Result<(), ChannelMonitorUpdateErr>>>

Implementations

impl<'a> TestChainMonitor<'a>[src]

pub fn new(
    chain_source: Option<&'a TestChainSource>,
    broadcaster: &'a dyn BroadcasterInterface,
    logger: &'a TestLogger,
    fee_estimator: &'a TestFeeEstimator,
    persister: &'a dyn Persist<LoopbackChannelSigner>
) -> Self
[src]

Trait Implementations

impl<'a> Watch<LoopbackChannelSigner> for TestChainMonitor<'a>[src]

fn watch_channel(
    &self,
    funding_txo: OutPoint,
    monitor: ChannelMonitor<LoopbackChannelSigner>
) -> Result<(), ChannelMonitorUpdateErr>
[src]

Watches a channel identified by funding_txo using monitor. Read more

fn update_channel(
    &self,
    funding_txo: OutPoint,
    update: ChannelMonitorUpdate
) -> Result<(), ChannelMonitorUpdateErr>
[src]

Updates a channel identified by funding_txo by applying update to its monitor. Read more

fn release_pending_monitor_events(&self) -> Vec<MonitorEvent>[src]

Returns any monitor events since the last call. Subsequent calls must only return new events. Read more

Auto Trait Implementations

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<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.