mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 05:21:08 +00:00
Storage chains: serve transactions over IPFS/bitswap (#7963)
* IPFS server for transactions * Style * Indent * Log message * CLI option * Apply suggestions from code review Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com> * Style * Style * Minor fixes Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
@@ -215,6 +215,17 @@ pub trait Backend<Block: BlockT>: HeaderBackend<Block> + HeaderMetadata<Block, E
|
||||
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
/// Get single extrinsic by hash.
|
||||
fn extrinsic(
|
||||
&self,
|
||||
hash: &Block::Hash,
|
||||
) -> Result<Option<<Block as BlockT>::Extrinsic>>;
|
||||
|
||||
/// Check if extrinsic exists.
|
||||
fn have_extrinsic(&self, hash: &Block::Hash) -> Result<bool> {
|
||||
Ok(self.extrinsic(hash)?.is_some())
|
||||
}
|
||||
}
|
||||
|
||||
/// Provides access to the optional cache.
|
||||
|
||||
@@ -115,6 +115,11 @@ pub trait Database<H: Clone>: Send + Sync {
|
||||
/// `key` is not currently in the database.
|
||||
fn get(&self, col: ColumnId, key: &[u8]) -> Option<Vec<u8>>;
|
||||
|
||||
/// Check if the value exists in the database without retrieving it.
|
||||
fn contains(&self, col: ColumnId, key: &[u8]) -> bool {
|
||||
self.get(col, key).is_some()
|
||||
}
|
||||
|
||||
/// Call `f` with the value previously stored against `key`.
|
||||
///
|
||||
/// This may be faster than `get` since it doesn't allocate.
|
||||
|
||||
Reference in New Issue
Block a user