Trait WalletTest

Source
pub trait WalletTest: InputSource + WalletRead {
    // Required methods
    fn get_tx_history(
        &self,
    ) -> Result<Vec<TransactionSummary<<Self as WalletRead>::AccountId>>, <Self as WalletRead>::Error>;
    fn get_sent_note_ids(
        &self,
        _txid: &TxId,
        _protocol: ShieldedProtocol,
    ) -> Result<Vec<NoteId>, <Self as WalletRead>::Error>;
    fn get_sent_outputs(
        &self,
        txid: &TxId,
    ) -> Result<Vec<OutputOfSentTx>, <Self as WalletRead>::Error>;
    fn get_checkpoint_history(
        &self,
        protocol: &ShieldedProtocol,
    ) -> Result<Vec<(BlockHeight, Option<Position>)>, <Self as WalletRead>::Error>;
    fn get_transparent_output(
        &self,
        outpoint: &OutPoint,
        allow_unspendable: bool,
    ) -> Result<Option<WalletTransparentOutput>, <Self as InputSource>::Error>;
    fn get_notes(
        &self,
        protocol: ShieldedProtocol,
    ) -> Result<Vec<ReceivedNote<Self::NoteRef, Note>>, <Self as InputSource>::Error>;
}
Expand description

Read-only operations required for testing light wallet functions.

These methods expose internal details or unstable interfaces, primarily to enable use of the testing framework. They should not be used in production software.

Required Methods§

Source

fn get_tx_history( &self, ) -> Result<Vec<TransactionSummary<<Self as WalletRead>::AccountId>>, <Self as WalletRead>::Error>

Returns a vector of transaction summaries.

Currently test-only, as production use could return a very large number of results; either pagination or a streaming design will be necessary to stabilize this feature for production use.

Source

fn get_sent_note_ids( &self, _txid: &TxId, _protocol: ShieldedProtocol, ) -> Result<Vec<NoteId>, <Self as WalletRead>::Error>

Returns the note IDs for shielded notes sent by the wallet in a particular transaction.

Source

fn get_sent_outputs( &self, txid: &TxId, ) -> Result<Vec<OutputOfSentTx>, <Self as WalletRead>::Error>

Returns the outputs for a transaction sent by the wallet.

Source

fn get_checkpoint_history( &self, protocol: &ShieldedProtocol, ) -> Result<Vec<(BlockHeight, Option<Position>)>, <Self as WalletRead>::Error>

Source

fn get_transparent_output( &self, outpoint: &OutPoint, allow_unspendable: bool, ) -> Result<Option<WalletTransparentOutput>, <Self as InputSource>::Error>

Available on crate feature transparent-inputs only.

Fetches the transparent output corresponding to the provided outpoint. Allows selecting unspendable outputs for testing purposes.

Returns Ok(None) if the UTXO is not known to belong to the wallet or is not spendable as of the chain tip height.

Source

fn get_notes( &self, protocol: ShieldedProtocol, ) -> Result<Vec<ReceivedNote<Self::NoteRef, Note>>, <Self as InputSource>::Error>

Returns all the notes that have been received by the wallet.

Implementors§