Trait ckb_store::ChainStore [−][src]
pub trait ChainStore<'a>: Send + Sync + Sized {
type Vector: AsRef<[u8]>;
Show 38 methods
fn cache(&'a self) -> Option<&'a StoreCache>;
fn freezer(&'a self) -> Option<&'a Freezer>;
fn get(&'a self, col: Col, key: &[u8]) -> Option<Self::Vector>;
fn get_iter(&self, col: Col, mode: IteratorMode<'_>) -> DBIter<'_>;
fn cell_provider(&self) -> CellProviderWrapper<'_, Self> { ... }
fn as_data_provider(&'a self) -> DataLoaderWrapper<'a, Self> { ... }
fn get_block(&'a self, h: &Byte32) -> Option<BlockView> { ... }
fn get_block_header(&'a self, hash: &Byte32) -> Option<HeaderView> { ... }
fn get_block_body(&'a self, hash: &Byte32) -> Vec<TransactionView> { ... }
fn get_unfrozen_block(&'a self, hash: &Byte32) -> Option<BlockView> { ... }
fn get_block_txs_hashes(&'a self, hash: &Byte32) -> Vec<Byte32> { ... }
fn get_block_proposal_txs_ids(
&'a self,
hash: &Byte32
) -> Option<ProposalShortIdVec> { ... }
fn get_block_uncles(&'a self, hash: &Byte32) -> Option<UncleBlockVecView> { ... }
fn get_block_extension(&'a self, hash: &Byte32) -> Option<Bytes> { ... }
fn get_block_ext(&'a self, block_hash: &Byte32) -> Option<BlockExt> { ... }
fn get_block_hash(&'a self, number: BlockNumber) -> Option<Byte32> { ... }
fn get_block_number(&'a self, hash: &Byte32) -> Option<BlockNumber> { ... }
fn is_main_chain(&'a self, hash: &Byte32) -> bool { ... }
fn get_tip_header(&'a self) -> Option<HeaderView> { ... }
fn transaction_exists(&'a self, hash: &Byte32) -> bool { ... }
fn get_transaction(
&'a self,
hash: &Byte32
) -> Option<(TransactionView, Byte32)> { ... }
fn get_transaction_info(&'a self, hash: &Byte32) -> Option<TransactionInfo> { ... }
fn get_transaction_with_info(
&'a self,
hash: &Byte32
) -> Option<(TransactionView, TransactionInfo)> { ... }
fn have_cell(&'a self, out_point: &OutPoint) -> bool { ... }
fn get_cell(&'a self, out_point: &OutPoint) -> Option<CellMeta> { ... }
fn get_cell_data(&'a self, out_point: &OutPoint) -> Option<(Bytes, Byte32)> { ... }
fn get_cell_data_hash(&'a self, out_point: &OutPoint) -> Option<Byte32> { ... }
fn get_current_epoch_ext(&'a self) -> Option<EpochExt> { ... }
fn get_epoch_ext(&'a self, hash: &Byte32) -> Option<EpochExt> { ... }
fn get_epoch_index(&'a self, number: EpochNumber) -> Option<Byte32> { ... }
fn get_block_epoch_index(&'a self, block_hash: &Byte32) -> Option<Byte32> { ... }
fn get_block_epoch(&'a self, hash: &Byte32) -> Option<EpochExt> { ... }
fn is_uncle(&'a self, hash: &Byte32) -> bool { ... }
fn get_uncle_header(&'a self, hash: &Byte32) -> Option<HeaderView> { ... }
fn block_exists(&'a self, hash: &Byte32) -> bool { ... }
fn get_cellbase(&'a self, hash: &Byte32) -> Option<TransactionView> { ... }
fn get_packed_block(&'a self, hash: &Byte32) -> Option<Block> { ... }
fn get_packed_block_header(&'a self, hash: &Byte32) -> Option<Header> { ... }
}
Expand description
TODO(doc): @quake
Associated Types
Required methods
fn cache(&'a self) -> Option<&'a StoreCache>
fn cache(&'a self) -> Option<&'a StoreCache>
TODO(doc): @quake
Return the bytes associated with a key value and the given column family.
Provided methods
fn cell_provider(&self) -> CellProviderWrapper<'_, Self>
fn cell_provider(&self) -> CellProviderWrapper<'_, Self>
TODO(doc): @quake
fn as_data_provider(&'a self) -> DataLoaderWrapper<'a, Self>
fn as_data_provider(&'a self) -> DataLoaderWrapper<'a, Self>
Return the provider trait default implementation
fn get_block_header(&'a self, hash: &Byte32) -> Option<HeaderView>
fn get_block_header(&'a self, hash: &Byte32) -> Option<HeaderView>
Get header by block header hash
fn get_block_body(&'a self, hash: &Byte32) -> Vec<TransactionView>
fn get_block_body(&'a self, hash: &Byte32) -> Vec<TransactionView>
Get block body by block header hash
fn get_unfrozen_block(&'a self, hash: &Byte32) -> Option<BlockView>
fn get_unfrozen_block(&'a self, hash: &Byte32) -> Option<BlockView>
Get unfrozen block from ky-store with given hash
fn get_block_txs_hashes(&'a self, hash: &Byte32) -> Vec<Byte32>
fn get_block_txs_hashes(&'a self, hash: &Byte32) -> Vec<Byte32>
Get all transaction-hashes in block body by block header hash
fn get_block_proposal_txs_ids(
&'a self,
hash: &Byte32
) -> Option<ProposalShortIdVec>
fn get_block_proposal_txs_ids(
&'a self,
hash: &Byte32
) -> Option<ProposalShortIdVec>
Get proposal short id by block header hash
fn get_block_uncles(&'a self, hash: &Byte32) -> Option<UncleBlockVecView>
fn get_block_uncles(&'a self, hash: &Byte32) -> Option<UncleBlockVecView>
Get block uncles by block header hash
fn get_block_extension(&'a self, hash: &Byte32) -> Option<Bytes>
fn get_block_extension(&'a self, hash: &Byte32) -> Option<Bytes>
Get block extension by block header hash
fn get_block_ext(&'a self, block_hash: &Byte32) -> Option<BlockExt>
fn get_block_ext(&'a self, block_hash: &Byte32) -> Option<BlockExt>
Get block ext by block header hash
fn get_block_hash(&'a self, number: BlockNumber) -> Option<Byte32>
fn get_block_hash(&'a self, number: BlockNumber) -> Option<Byte32>
Get block header hash by block number
fn get_block_number(&'a self, hash: &Byte32) -> Option<BlockNumber>
fn get_block_number(&'a self, hash: &Byte32) -> Option<BlockNumber>
Get block number by block header hash
fn is_main_chain(&'a self, hash: &Byte32) -> bool
fn is_main_chain(&'a self, hash: &Byte32) -> bool
TODO(doc): @quake
fn get_tip_header(&'a self) -> Option<HeaderView>
fn get_tip_header(&'a self) -> Option<HeaderView>
TODO(doc): @quake
fn transaction_exists(&'a self, hash: &Byte32) -> bool
fn transaction_exists(&'a self, hash: &Byte32) -> bool
Returns true if the transaction confirmed in main chain.
This function is base on transaction index COLUMN_TRANSACTION_INFO
.
Current release maintains a full index of historical transaction by default, this may be changed in future
fn get_transaction(&'a self, hash: &Byte32) -> Option<(TransactionView, Byte32)>
fn get_transaction(&'a self, hash: &Byte32) -> Option<(TransactionView, Byte32)>
Get commit transaction and block hash by its hash
fn get_transaction_info(&'a self, hash: &Byte32) -> Option<TransactionInfo>
fn get_transaction_info(&'a self, hash: &Byte32) -> Option<TransactionInfo>
TODO(doc): @quake
fn get_transaction_with_info(
&'a self,
hash: &Byte32
) -> Option<(TransactionView, TransactionInfo)>
fn get_transaction_with_info(
&'a self,
hash: &Byte32
) -> Option<(TransactionView, TransactionInfo)>
Gets transaction and associated info with correspond hash
Gets cell meta data with out_point
fn get_cell_data_hash(&'a self, out_point: &OutPoint) -> Option<Byte32>
fn get_cell_data_hash(&'a self, out_point: &OutPoint) -> Option<Byte32>
TODO(doc): @quake
fn get_current_epoch_ext(&'a self) -> Option<EpochExt>
fn get_current_epoch_ext(&'a self) -> Option<EpochExt>
Gets current epoch ext
fn get_epoch_ext(&'a self, hash: &Byte32) -> Option<EpochExt>
fn get_epoch_ext(&'a self, hash: &Byte32) -> Option<EpochExt>
Gets epoch ext by epoch index
fn get_epoch_index(&'a self, number: EpochNumber) -> Option<Byte32>
fn get_epoch_index(&'a self, number: EpochNumber) -> Option<Byte32>
Gets epoch index by epoch number
fn get_block_epoch_index(&'a self, block_hash: &Byte32) -> Option<Byte32>
fn get_block_epoch_index(&'a self, block_hash: &Byte32) -> Option<Byte32>
Gets epoch index by block hash
fn get_block_epoch(&'a self, hash: &Byte32) -> Option<EpochExt>
fn get_block_epoch(&'a self, hash: &Byte32) -> Option<EpochExt>
TODO(doc): @quake
fn get_uncle_header(&'a self, hash: &Byte32) -> Option<HeaderView>
fn get_uncle_header(&'a self, hash: &Byte32) -> Option<HeaderView>
Gets header by uncle header hash
fn block_exists(&'a self, hash: &Byte32) -> bool
fn block_exists(&'a self, hash: &Byte32) -> bool
TODO(doc): @quake
fn get_cellbase(&'a self, hash: &Byte32) -> Option<TransactionView>
fn get_cellbase(&'a self, hash: &Byte32) -> Option<TransactionView>
Gets cellbase by block hash
fn get_packed_block(&'a self, hash: &Byte32) -> Option<Block>
fn get_packed_block(&'a self, hash: &Byte32) -> Option<Block>
TODO(doc): @quake
fn get_packed_block_header(&'a self, hash: &Byte32) -> Option<Header>
fn get_packed_block_header(&'a self, hash: &Byte32) -> Option<Header>
TODO(doc): @quake