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