pub trait WalletOutputBatch<K>
where K: Keychain,
{
Show 21 methods // Required methods fn keychain(&mut self) -> &mut K; fn save(&mut self, out: OutputData) -> Result<(), Error>; fn save_output_history(&mut self, out: OutputData) -> Result<(), Error>; fn get( &self, id: &Identifier, mmr_index: &Option<u64> ) -> Result<OutputData, Error>; fn iter(&self) -> Box<dyn Iterator<Item = OutputData>>; fn history_iter(&self) -> Box<dyn Iterator<Item = OutputData>>; fn delete( &mut self, id: &Identifier, mmr_index: &Option<u64>, tx_id: &Option<u32> ) -> Result<(), Error>; fn save_child_index( &mut self, parent_key_id: &Identifier, child_n: u32 ) -> Result<(), Error>; fn save_last_confirmed_height( &mut self, parent_key_id: &Identifier, height: u64 ) -> Result<(), Error>; fn save_last_scanned_block( &mut self, block: ScannedBlockInfo ) -> Result<(), Error>; fn save_init_status<'a>( &mut self, value: WalletInitStatus ) -> Result<(), Error>; fn next_output_history_id(&mut self) -> Result<u32, Error>; fn next_tx_log_id( &mut self, parent_key_id: &Identifier ) -> Result<u32, Error>; fn tx_log_iter(&self) -> Box<dyn Iterator<Item = TxLogEntry>>; fn save_tx_log_entry( &mut self, t: TxLogEntry, parent_id: &Identifier ) -> Result<(), Error>; fn save_acct_path(&mut self, mapping: AcctPathMapping) -> Result<(), Error>; fn acct_path_iter(&self) -> Box<dyn Iterator<Item = AcctPathMapping>>; fn lock_output(&mut self, out: &mut OutputData) -> Result<(), Error>; fn save_private_context( &mut self, slate_id: &[u8], participant_id: usize, ctx: &Context ) -> Result<(), Error>; fn delete_private_context( &mut self, slate_id: &[u8], participant_id: usize ) -> Result<(), Error>; fn commit(&self) -> Result<(), Error>;
}
Expand description

Batch trait to update the output data backend atomically. Trying to use a batch after commit MAY result in a panic. Due to this being a trait, the commit method can’t take ownership. TODO: Should these be split into separate batch objects, for outputs, tx_log entries and meta/details?

Required Methods§

source

fn keychain(&mut self) -> &mut K

Return the keychain being used

source

fn save(&mut self, out: OutputData) -> Result<(), Error>

Add or update data about an output to the backend

source

fn save_output_history(&mut self, out: OutputData) -> Result<(), Error>

Add data about an output in the output history table

source

fn get( &self, id: &Identifier, mmr_index: &Option<u64> ) -> Result<OutputData, Error>

Gets output data by id

source

fn iter(&self) -> Box<dyn Iterator<Item = OutputData>>

Iterate over all output data stored by the backend

source

fn history_iter(&self) -> Box<dyn Iterator<Item = OutputData>>

Iterate over all outputs available in the output history table

source

fn delete( &mut self, id: &Identifier, mmr_index: &Option<u64>, tx_id: &Option<u32> ) -> Result<(), Error>

Delete data about an output from the backend

source

fn save_child_index( &mut self, parent_key_id: &Identifier, child_n: u32 ) -> Result<(), Error>

Save last stored child index of a given parent

source

fn save_last_confirmed_height( &mut self, parent_key_id: &Identifier, height: u64 ) -> Result<(), Error>

Save last confirmed height of outputs for a given parent

source

fn save_last_scanned_block( &mut self, block: ScannedBlockInfo ) -> Result<(), Error>

Save the last PMMR index that was scanned via a scan operation

source

fn save_init_status<'a>(&mut self, value: WalletInitStatus) -> Result<(), Error>

Save flag indicating whether wallet needs a full UTXO scan

source

fn next_output_history_id(&mut self) -> Result<u32, Error>

get next output history table id

source

fn next_tx_log_id(&mut self, parent_key_id: &Identifier) -> Result<u32, Error>

get next tx log entry for the parent

source

fn tx_log_iter(&self) -> Box<dyn Iterator<Item = TxLogEntry>>

Iterate over tx log data stored by the backend

source

fn save_tx_log_entry( &mut self, t: TxLogEntry, parent_id: &Identifier ) -> Result<(), Error>

save a tx log entry

source

fn save_acct_path(&mut self, mapping: AcctPathMapping) -> Result<(), Error>

save an account label -> path mapping

source

fn acct_path_iter(&self) -> Box<dyn Iterator<Item = AcctPathMapping>>

Iterate over account names stored in backend

source

fn lock_output(&mut self, out: &mut OutputData) -> Result<(), Error>

Save an output as locked in the backend

source

fn save_private_context( &mut self, slate_id: &[u8], participant_id: usize, ctx: &Context ) -> Result<(), Error>

Saves the private context associated with a slate id

source

fn delete_private_context( &mut self, slate_id: &[u8], participant_id: usize ) -> Result<(), Error>

Delete the private context associated with the slate id

source

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

Write the wallet data to backend file

Implementors§