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§
sourcefn save(&mut self, out: OutputData) -> Result<(), Error>
fn save(&mut self, out: OutputData) -> Result<(), Error>
Add or update data about an output to the backend
sourcefn save_output_history(&mut self, out: OutputData) -> Result<(), Error>
fn save_output_history(&mut self, out: OutputData) -> Result<(), Error>
Add data about an output in the output history table
sourcefn get(
&self,
id: &Identifier,
mmr_index: &Option<u64>
) -> Result<OutputData, Error>
fn get( &self, id: &Identifier, mmr_index: &Option<u64> ) -> Result<OutputData, Error>
Gets output data by id
sourcefn iter(&self) -> Box<dyn Iterator<Item = OutputData>>
fn iter(&self) -> Box<dyn Iterator<Item = OutputData>>
Iterate over all output data stored by the backend
sourcefn history_iter(&self) -> Box<dyn Iterator<Item = OutputData>>
fn history_iter(&self) -> Box<dyn Iterator<Item = OutputData>>
Iterate over all outputs available in the output history table
sourcefn delete(
&mut self,
id: &Identifier,
mmr_index: &Option<u64>,
tx_id: &Option<u32>
) -> Result<(), Error>
fn delete( &mut self, id: &Identifier, mmr_index: &Option<u64>, tx_id: &Option<u32> ) -> Result<(), Error>
Delete data about an output from the backend
sourcefn save_child_index(
&mut self,
parent_key_id: &Identifier,
child_n: u32
) -> Result<(), Error>
fn save_child_index( &mut self, parent_key_id: &Identifier, child_n: u32 ) -> Result<(), Error>
Save last stored child index of a given parent
sourcefn save_last_confirmed_height(
&mut self,
parent_key_id: &Identifier,
height: u64
) -> Result<(), Error>
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
sourcefn save_last_scanned_block(
&mut self,
block: ScannedBlockInfo
) -> Result<(), Error>
fn save_last_scanned_block( &mut self, block: ScannedBlockInfo ) -> Result<(), Error>
Save the last PMMR index that was scanned via a scan operation
sourcefn save_init_status<'a>(&mut self, value: WalletInitStatus) -> Result<(), Error>
fn save_init_status<'a>(&mut self, value: WalletInitStatus) -> Result<(), Error>
Save flag indicating whether wallet needs a full UTXO scan
sourcefn next_output_history_id(&mut self) -> Result<u32, Error>
fn next_output_history_id(&mut self) -> Result<u32, Error>
get next output history table id
sourcefn next_tx_log_id(&mut self, parent_key_id: &Identifier) -> Result<u32, Error>
fn next_tx_log_id(&mut self, parent_key_id: &Identifier) -> Result<u32, Error>
get next tx log entry for the parent
sourcefn tx_log_iter(&self) -> Box<dyn Iterator<Item = TxLogEntry>>
fn tx_log_iter(&self) -> Box<dyn Iterator<Item = TxLogEntry>>
Iterate over tx log data stored by the backend
sourcefn save_tx_log_entry(
&mut self,
t: TxLogEntry,
parent_id: &Identifier
) -> Result<(), Error>
fn save_tx_log_entry( &mut self, t: TxLogEntry, parent_id: &Identifier ) -> Result<(), Error>
save a tx log entry
sourcefn save_acct_path(&mut self, mapping: AcctPathMapping) -> Result<(), Error>
fn save_acct_path(&mut self, mapping: AcctPathMapping) -> Result<(), Error>
save an account label -> path mapping
sourcefn acct_path_iter(&self) -> Box<dyn Iterator<Item = AcctPathMapping>>
fn acct_path_iter(&self) -> Box<dyn Iterator<Item = AcctPathMapping>>
Iterate over account names stored in backend
sourcefn lock_output(&mut self, out: &mut OutputData) -> Result<(), Error>
fn lock_output(&mut self, out: &mut OutputData) -> Result<(), Error>
Save an output as locked in the backend
sourcefn save_private_context(
&mut self,
slate_id: &[u8],
participant_id: usize,
ctx: &Context
) -> Result<(), Error>
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