DummyPersister

Struct DummyPersister 

Source
pub struct DummyPersister;
Expand description

A null persister for testing

Trait Implementations§

Source§

impl Persist for DummyPersister

Source§

fn new_node( &self, node_id: &PublicKey, config: &NodeConfig, state: &NodeState, ) -> Result<(), Error>

Create a new node
Source§

fn update_node( &self, node_id: &PublicKey, state: &NodeState, ) -> Result<(), Error>

Update node enforcement state
Source§

fn delete_node(&self, node_id: &PublicKey) -> Result<(), Error>

Delete a node and all of its channels. Used in test mode.
Source§

fn new_channel( &self, node_id: &PublicKey, stub: &ChannelStub, ) -> Result<(), Error>

Will error if exists
Source§

fn delete_channel( &self, node_id: &PublicKey, channel_id: &ChannelId, ) -> Result<(), Error>

Delete a channel
Source§

fn new_tracker( &self, node_id: &PublicKey, tracker: &ChainTracker<ChainMonitor>, ) -> Result<(), Error>

Create a new tracker
Source§

fn update_tracker( &self, node_id: &PublicKey, tracker: &ChainTracker<ChainMonitor>, ) -> Result<(), Error>

Update the tracker
Source§

fn get_tracker( &self, node_id: PublicKey, validator_factory: Arc<dyn ValidatorFactory>, ) -> Result<(ChainTracker<ChainMonitor>, Vec<ChainTrackerListenerEntry>), Error>

Get the tracker
Source§

fn update_channel( &self, node_id: &PublicKey, channel: &Channel, ) -> Result<(), Error>

Will error if doesn’t exist. Read more
Source§

fn get_channel( &self, node_id: &PublicKey, channel_id: &ChannelId, ) -> Result<ChannelEntry, Error>

Get a channel from store
Source§

fn get_node_channels( &self, node_id: &PublicKey, ) -> Result<Vec<(ChannelId, ChannelEntry)>, Error>

Get all channels for a node from store
Source§

fn update_node_allowlist( &self, node_id: &PublicKey, allowlist: Vec<String>, ) -> Result<(), Error>

Persist the allowlist to the store.
Source§

fn get_node_allowlist(&self, node_id: &PublicKey) -> Result<Vec<String>, Error>

Get the allowlist from the store.
Source§

fn get_nodes(&self) -> Result<Vec<(PublicKey, NodeEntry)>, Error>

Get all nodes from store
Source§

fn clear_database(&self) -> Result<(), Error>

Clears the database. Not for production use.
Source§

fn signer_id(&self) -> [u8; 16]

Get our unique 128-bit signer ID
Source§

fn enter(&self) -> Result<(), Error>

Enter a persistence context Read more
Source§

fn prepare(&self) -> Mutations

Get the logged mutations since the last call to enter(). Read more
Source§

fn commit(&self) -> Result<(), Error>

Commit the logged mutations. Read more
Source§

fn put_batch_unlogged(&self, _m: Mutations) -> Result<(), Error>

Update the persister with the given mutations. Read more
Source§

fn on_initial_restore(&self) -> bool

Notifies the persister that the initial restore from persistence is done and queries whether a sync is required. Read more
Source§

fn recovery_required(&self) -> bool

Whether recovery from backup is required on signer startup. Should return true if the persister is in a state where it needs to recover from a backup (e.g. empty).
Source§

fn begin_replication(&self) -> Result<Mutations, Error>

Start replication by putting the local store into a compatible starting state for a cloud persister. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more