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§

impl SendSync for DummyPersister

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, 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
§

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

§

fn vzip(self) -> V