Trait sapio_base::txindex::TxIndex
source · pub trait TxIndex {
// Required methods
fn lookup_tx(&self, b: &Txid) -> Result<Arc<Transaction>, TxIndexError>;
fn add_tx(&self, tx: Arc<Transaction>) -> Result<Txid, TxIndexError>;
// Provided method
fn lookup_output(&self, b: &OutPoint) -> Result<TxOut, TxIndexError> { ... }
}
Expand description
Generic interface for any txindex
Required Methods§
sourcefn lookup_tx(&self, b: &Txid) -> Result<Arc<Transaction>, TxIndexError>
fn lookup_tx(&self, b: &Txid) -> Result<Arc<Transaction>, TxIndexError>
lookup a tx
sourcefn add_tx(&self, tx: Arc<Transaction>) -> Result<Txid, TxIndexError>
fn add_tx(&self, tx: Arc<Transaction>) -> Result<Txid, TxIndexError>
locally add a tx for tracking
Provided Methods§
sourcefn lookup_output(&self, b: &OutPoint) -> Result<TxOut, TxIndexError>
fn lookup_output(&self, b: &OutPoint) -> Result<TxOut, TxIndexError>
lookup a particular output