Struct ledger_mob_core::engine::Engine
source · pub struct Engine<DRV: Driver, RNG: CryptoRngCore = OsRng> { /* private fields */ }
Expand description
Engine provides hardware-independent support for MobileCoin wallet operations
Implementations§
source§impl<DRV: Driver, RNG: CryptoRngCore> Engine<DRV, RNG>
impl<DRV: Driver, RNG: CryptoRngCore> Engine<DRV, RNG>
sourcepub const fn new_with_rng(drv: DRV, rng: RNG) -> Self
pub const fn new_with_rng(drv: DRV, rng: RNG) -> Self
Create a new transaction engine instance with the provided driver and rng
sourcepub unsafe fn init(p: *mut Self, drv: DRV, rng: RNG)
pub unsafe fn init(p: *mut Self, drv: DRV, rng: RNG)
Initialise an uninitialised engine instance pointer, another adventure in stack frame reduction TODO: add checks that init and new_with_rng match
Safety
per-field init is okay so long as we init all fields
sourcepub fn update(&mut self, evt: &Event) -> Result<Output, Error>
pub fn update(&mut self, evt: &Event) -> Result<Output, Error>
Handle incoming transaction events
sourcepub fn get_account(&self, account_index: u32) -> Account
pub fn get_account(&self, account_index: u32) -> Account
Fetch an [Account
] instance for a given wallet index
sourcepub fn get_subaddress(
&self,
account_index: u32,
subaddress_index: u64,
fog_id: FogId
) -> OutputAddress
pub fn get_subaddress( &self, account_index: u32, subaddress_index: u64, fog_id: FogId ) -> OutputAddress
Fetch a Subaddress instance for a given wallet and subaddress index
sourcepub fn is_unlocked(&self) -> bool
pub fn is_unlocked(&self) -> bool
Check whether engine is unlocked (ie. key requests and scanning have been approved)
sourcepub fn progress(&self) -> Option<usize>
pub fn progress(&self) -> Option<usize>
Fetch progress for non-interactive states (summary, ring signing)
sourcepub fn report(&self) -> Option<&TxSummaryUnblindingReport<MAX_RECORDS>>
pub fn report(&self) -> Option<&TxSummaryUnblindingReport<MAX_RECORDS>>
Return report if available
sourcepub fn address(&self, h: &ShortAddressHash) -> Option<&OutputAddress>
pub fn address(&self, h: &ShortAddressHash) -> Option<&OutputAddress>
Resolve address if available
sourcepub fn ident_approve(&mut self, approve: bool)
pub fn ident_approve(&mut self, approve: bool)
Approve or deny a pending identity request, updating the IdentState