mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 23:57:56 +00:00
Storage chains: indexing, renewals and reference counting (#8265)
* Transaction indexing * Tests and fixes * Fixed a comment * Style * Build * Style * Apply suggestions from code review Co-authored-by: cheme <emericchevalier.pro@gmail.com> * Code review suggestions * Add missing impl * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * impl JoinInput * Don't store empty slices * JoinInput operates on slices Co-authored-by: cheme <emericchevalier.pro@gmail.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -96,15 +96,18 @@ pub trait BlockBackend<Block: BlockT> {
|
||||
/// Get block hash by number.
|
||||
fn block_hash(&self, number: NumberFor<Block>) -> sp_blockchain::Result<Option<Block::Hash>>;
|
||||
|
||||
/// Get single extrinsic by hash.
|
||||
fn extrinsic(
|
||||
/// Get single indexed transaction by content hash.
|
||||
///
|
||||
/// Note that this will only fetch transactions
|
||||
/// that are indexed by the runtime with `storage_index_transaction`.
|
||||
fn indexed_transaction(
|
||||
&self,
|
||||
hash: &Block::Hash,
|
||||
) -> sp_blockchain::Result<Option<<Block as BlockT>::Extrinsic>>;
|
||||
) -> sp_blockchain::Result<Option<Vec<u8>>>;
|
||||
|
||||
/// Check if extrinsic exists.
|
||||
fn have_extrinsic(&self, hash: &Block::Hash) -> sp_blockchain::Result<bool> {
|
||||
Ok(self.extrinsic(hash)?.is_some())
|
||||
/// Check if transaction index exists.
|
||||
fn has_indexed_transaction(&self, hash: &Block::Hash) -> sp_blockchain::Result<bool> {
|
||||
Ok(self.indexed_transaction(hash)?.is_some())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user