pub struct Schema<T> { /* private fields */ }
Expand description
Information schema for indexes maintained by the Exonum core logic.
Indexes defined by this schema are present in the blockchain regardless of the deployed services and store general-purpose information, such as committed transactions.
Implementations§
Source§impl<T: Access> Schema<T>
impl<T: Access> Schema<T>
Sourcepub fn transactions(&self) -> MapIndex<T::Base, Hash, Verified<AnyTx>>
pub fn transactions(&self) -> MapIndex<T::Base, Hash, Verified<AnyTx>>
Returns a table that represents a map with a key-value pair of a transaction hash and raw transaction message.
Sourcepub fn call_records(&self, block_height: Height) -> Option<CallRecords<T>>
pub fn call_records(&self, block_height: Height) -> Option<CallRecords<T>>
Returns a record of errors that occurred during execution of a particular block.
If the block is not committed, returns None
.
Sourcepub fn transaction_result(
&self,
location: TxLocation,
) -> Option<Result<(), ExecutionError>>
pub fn transaction_result( &self, location: TxLocation, ) -> Option<Result<(), ExecutionError>>
Returns the result of the execution for a transaction with the specified location.
If the location does not correspond to a transaction, returns None
.
Sourcepub fn transactions_len(&self) -> u64
pub fn transactions_len(&self) -> u64
Returns the number of committed transactions in the blockchain.
Sourcepub fn transactions_pool(&self) -> KeySetIndex<T::Base, Hash>
pub fn transactions_pool(&self) -> KeySetIndex<T::Base, Hash>
Returns a table that represents a set of uncommitted transactions hashes.
§Stability
Since a signature of this method could be changed in the future due to performance reasons, this method is considered unstable.
Sourcepub fn transactions_pool_len(&self) -> u64
pub fn transactions_pool_len(&self) -> u64
Returns the number of transactions in the pool.
Sourcepub fn transactions_locations(&self) -> MapIndex<T::Base, Hash, TxLocation>
pub fn transactions_locations(&self) -> MapIndex<T::Base, Hash, TxLocation>
Returns a table that keeps the block height and transaction position inside the block for every transaction hash.
Sourcepub fn blocks(&self) -> MapIndex<T::Base, Hash, Block>
pub fn blocks(&self) -> MapIndex<T::Base, Hash, Block>
Returns a table that stores a block object for every block height.
Sourcepub fn block_hashes_by_height(&self) -> ListIndex<T::Base, Hash>
pub fn block_hashes_by_height(&self) -> ListIndex<T::Base, Hash>
Returns a table that keeps block hashes for corresponding block heights.
Sourcepub fn block_transactions(
&self,
height: Height,
) -> ProofListIndex<T::Base, Hash>
pub fn block_transactions( &self, height: Height, ) -> ProofListIndex<T::Base, Hash>
Returns a table that keeps a list of transactions for each block.
Sourcepub fn block_skip(&self) -> Option<Block>
pub fn block_skip(&self) -> Option<Block>
Returns the recorded block skip, if any.
Sourcepub fn block_skip_and_precommits(&self) -> Option<BlockProof>
pub fn block_skip_and_precommits(&self) -> Option<BlockProof>
Returns the recorded block skip together with authenticating information.
Sourcepub fn precommits(&self, hash: &Hash) -> ListIndex<T::Base, Verified<Precommit>>
pub fn precommits(&self, hash: &Hash) -> ListIndex<T::Base, Verified<Precommit>>
Returns a table that keeps a list of precommits for the block with the given hash.
Sourcepub fn block_hash_by_height(&self, height: Height) -> Option<Hash>
pub fn block_hash_by_height(&self, height: Height) -> Option<Hash>
Returns the block hash for the given height.
Sourcepub fn block_and_precommits(&self, height: Height) -> Option<BlockProof>
pub fn block_and_precommits(&self, height: Height) -> Option<BlockProof>
Returns the block for the given height with the proof of its inclusion.
Sourcepub fn last_block(&self) -> Block
pub fn last_block(&self) -> Block
Sourcepub fn height(&self) -> Height
pub fn height(&self) -> Height
Returns the height of the latest committed block.
§Panics
Panics if invoked before the genesis block was created, e.g. within
after_transactions
hook for genesis block.
Sourcepub fn next_height(&self) -> Height
pub fn next_height(&self) -> Height
Returns the height of the block to be committed.
Unlike height
, this method never panics.
Sourcepub fn consensus_config(&self) -> ConsensusConfig
pub fn consensus_config(&self) -> ConsensusConfig
Returns an actual consensus configuration of the blockchain.
§Panics
Panics if the genesis block was not created.
Sourcepub fn validator_id(&self, service_public_key: PublicKey) -> Option<ValidatorId>
pub fn validator_id(&self, service_public_key: PublicKey) -> Option<ValidatorId>
Attempts to find a ValidatorId
by the provided service public key.