[−][src]Struct db::BlockChainDatabase
Methods
impl BlockChainDatabase<CacheDatabase<AutoFlushingOverlayDatabase<DiskDatabase>>>[src]
impl BlockChainDatabase<CacheDatabase<AutoFlushingOverlayDatabase<DiskDatabase>>>pub fn open_at_path<P>(path: P, total_cache: usize) -> Result<Self, Error> where
P: AsRef<Path>, [src]
pub fn open_at_path<P>(path: P, total_cache: usize) -> Result<Self, Error> where
P: AsRef<Path>, impl BlockChainDatabase<MemoryDatabase>[src]
impl BlockChainDatabase<MemoryDatabase>pub fn init_test_chain(blocks: Vec<IndexedBlock>) -> Self[src]
pub fn init_test_chain(blocks: Vec<IndexedBlock>) -> Selfimpl<T> BlockChainDatabase<CacheDatabase<AutoFlushingOverlayDatabase<T>>> where
T: KeyValueDatabase, [src]
impl<T> BlockChainDatabase<CacheDatabase<AutoFlushingOverlayDatabase<T>>> where
T: KeyValueDatabase, pub fn open_with_cache(db: T) -> Self[src]
pub fn open_with_cache(db: T) -> Selfimpl<T> BlockChainDatabase<T> where
T: KeyValueDatabase, [src]
impl<T> BlockChainDatabase<T> where
T: KeyValueDatabase, pub fn open(db: T) -> Self[src]
pub fn open(db: T) -> Selfpub fn best_block(&self) -> BestBlock[src]
pub fn best_block(&self) -> BestBlockpub fn fork(
&self,
side_chain: SideChainOrigin
) -> Result<ForkChainDatabase<T>, Error>[src]
pub fn fork(
&self,
side_chain: SideChainOrigin
) -> Result<ForkChainDatabase<T>, Error>pub fn switch_to_fork(&self, fork: ForkChainDatabase<T>) -> Result<(), Error>[src]
pub fn switch_to_fork(&self, fork: ForkChainDatabase<T>) -> Result<(), Error>pub fn block_origin(
&self,
header: &IndexedBlockHeader
) -> Result<BlockOrigin, Error>[src]
pub fn block_origin(
&self,
header: &IndexedBlockHeader
) -> Result<BlockOrigin, Error>pub fn insert(&self, block: IndexedBlock) -> Result<(), Error>[src]
pub fn insert(&self, block: IndexedBlock) -> Result<(), Error>pub fn canonize(&self, hash: &H256) -> Result<(), Error>[src]
pub fn canonize(&self, hash: &H256) -> Result<(), Error>Marks block as a new best block. Block must be already inserted into db, and it's parent must be current best block. Updates meta data.
pub fn decanonize(&self) -> Result<H256, Error>[src]
pub fn decanonize(&self) -> Result<H256, Error>Trait Implementations
impl<T> BlockHeaderProvider for BlockChainDatabase<T> where
T: KeyValueDatabase, [src]
impl<T> BlockHeaderProvider for BlockChainDatabase<T> where
T: KeyValueDatabase, fn block_header_bytes(&self, block_ref: BlockRef) -> Option<Bytes>[src]
fn block_header_bytes(&self, block_ref: BlockRef) -> Option<Bytes>resolves header bytes by block reference (number/hash)
fn block_header(&self, block_ref: BlockRef) -> Option<BlockHeader>[src]
fn block_header(&self, block_ref: BlockRef) -> Option<BlockHeader>resolves header bytes by block reference (number/hash)
impl<T> BlockProvider for BlockChainDatabase<T> where
T: KeyValueDatabase, [src]
impl<T> BlockProvider for BlockChainDatabase<T> where
T: KeyValueDatabase, fn block_number(&self, hash: &H256) -> Option<u32>[src]
fn block_number(&self, hash: &H256) -> Option<u32>resolves number by block hash
fn block_hash(&self, number: u32) -> Option<H256>[src]
fn block_hash(&self, number: u32) -> Option<H256>resolves hash by block number
fn block(&self, block_ref: BlockRef) -> Option<Block>[src]
fn block(&self, block_ref: BlockRef) -> Option<Block>resolves deserialized block body by block reference (number/hash)
fn contains_block(&self, block_ref: BlockRef) -> bool[src]
fn contains_block(&self, block_ref: BlockRef) -> boolreturns true if store contains given block
fn block_transaction_hashes(&self, block_ref: BlockRef) -> Vec<H256>[src]
fn block_transaction_hashes(&self, block_ref: BlockRef) -> Vec<H256>resolves list of block transactions by block reference (number/hash)
fn block_transactions(&self, block_ref: BlockRef) -> Vec<Transaction>[src]
fn block_transactions(&self, block_ref: BlockRef) -> Vec<Transaction>returns all transactions in the block by block reference (number/hash)
impl<T> IndexedBlockProvider for BlockChainDatabase<T> where
T: KeyValueDatabase, [src]
impl<T> IndexedBlockProvider for BlockChainDatabase<T> where
T: KeyValueDatabase, fn indexed_block_header(
&self,
block_ref: BlockRef
) -> Option<IndexedBlockHeader>[src]
fn indexed_block_header(
&self,
block_ref: BlockRef
) -> Option<IndexedBlockHeader>fn indexed_block(&self, block_ref: BlockRef) -> Option<IndexedBlock>[src]
fn indexed_block(&self, block_ref: BlockRef) -> Option<IndexedBlock>fn indexed_block_transactions(
&self,
block_ref: BlockRef
) -> Vec<IndexedTransaction>[src]
fn indexed_block_transactions(
&self,
block_ref: BlockRef
) -> Vec<IndexedTransaction>impl<T> TransactionMetaProvider for BlockChainDatabase<T> where
T: KeyValueDatabase, [src]
impl<T> TransactionMetaProvider for BlockChainDatabase<T> where
T: KeyValueDatabase, fn transaction_meta(&self, hash: &H256) -> Option<TransactionMeta>[src]
fn transaction_meta(&self, hash: &H256) -> Option<TransactionMeta>Returns None if transactin with given hash does not exist Otherwise returns transaction meta object Read more
impl<T> TransactionProvider for BlockChainDatabase<T> where
T: KeyValueDatabase, [src]
impl<T> TransactionProvider for BlockChainDatabase<T> where
T: KeyValueDatabase, fn transaction_bytes(&self, hash: &H256) -> Option<Bytes>[src]
fn transaction_bytes(&self, hash: &H256) -> Option<Bytes>Resolves transaction body bytes by transaction hash.
fn transaction(&self, hash: &H256) -> Option<Transaction>[src]
fn transaction(&self, hash: &H256) -> Option<Transaction>Resolves serialized transaction info by transaction hash.
fn contains_transaction(&self, hash: &H256) -> bool
fn contains_transaction(&self, hash: &H256) -> boolReturns true if store contains given transaction.
impl<T> TransactionOutputProvider for BlockChainDatabase<T> where
T: KeyValueDatabase, [src]
impl<T> TransactionOutputProvider for BlockChainDatabase<T> where
T: KeyValueDatabase, fn transaction_output(
&self,
prevout: &OutPoint,
_transaction_index: usize
) -> Option<TransactionOutput>[src]
fn transaction_output(
&self,
prevout: &OutPoint,
_transaction_index: usize
) -> Option<TransactionOutput>Returns transaction output.
fn is_spent(&self, prevout: &OutPoint) -> bool[src]
fn is_spent(&self, prevout: &OutPoint) -> boolReturns true if we know that output is double spent.
impl<T> BlockChain for BlockChainDatabase<T> where
T: KeyValueDatabase, [src]
impl<T> BlockChain for BlockChainDatabase<T> where
T: KeyValueDatabase, fn insert(&self, block: IndexedBlock) -> Result<(), Error>[src]
fn insert(&self, block: IndexedBlock) -> Result<(), Error>Inserts new block into blockchain
fn rollback_best(&self) -> Result<H256, Error>[src]
fn rollback_best(&self) -> Result<H256, Error>Rollbacks single best block. Returns new best block hash
fn canonize(&self, block_hash: &H256) -> Result<(), Error>[src]
fn canonize(&self, block_hash: &H256) -> Result<(), Error>Canonizes block with given hash
fn decanonize(&self) -> Result<H256, Error>[src]
fn decanonize(&self) -> Result<H256, Error>Decanonizes best block
fn block_origin(
&self,
header: &IndexedBlockHeader
) -> Result<BlockOrigin, Error>[src]
fn block_origin(
&self,
header: &IndexedBlockHeader
) -> Result<BlockOrigin, Error>Checks block origin
impl<T> Forkable for BlockChainDatabase<T> where
T: KeyValueDatabase, [src]
impl<T> Forkable for BlockChainDatabase<T> where
T: KeyValueDatabase, fn fork<'a>(
&'a self,
side_chain: SideChainOrigin
) -> Result<Box<ForkChain + 'a>, Error>[src]
fn fork<'a>(
&'a self,
side_chain: SideChainOrigin
) -> Result<Box<ForkChain + 'a>, Error>Forks current blockchain. Lifetime guarantees fork relationship with canon chain. Read more
fn switch_to_fork<'a>(&self, fork: Box<ForkChain + 'a>) -> Result<(), Error>[src]
fn switch_to_fork<'a>(&self, fork: Box<ForkChain + 'a>) -> Result<(), Error>Switches blockchain to given fork. Lifetime guarantees that fork comes from this canon chain. Read more
impl<T> CanonStore for BlockChainDatabase<T> where
T: KeyValueDatabase, [src]
impl<T> CanonStore for BlockChainDatabase<T> where
T: KeyValueDatabase, impl<T> Store for BlockChainDatabase<T> where
T: KeyValueDatabase, [src]
impl<T> Store for BlockChainDatabase<T> where
T: KeyValueDatabase, fn best_block(&self) -> BestBlock[src]
fn best_block(&self) -> BestBlockget best block
fn best_header(&self) -> BlockHeader[src]
fn best_header(&self) -> BlockHeaderget best header
fn difficulty(&self) -> f64[src]
fn difficulty(&self) -> f64get blockchain difficulty
impl<T> ConfigStore for BlockChainDatabase<T> where
T: KeyValueDatabase, [src]
impl<T> ConfigStore for BlockChainDatabase<T> where
T: KeyValueDatabase, fn consensus_fork(&self) -> Result<Option<String>, Error>[src]
fn consensus_fork(&self) -> Result<Option<String>, Error>get consensus_fork this database is configured for
fn set_consensus_fork(&self, consensus_fork: &str) -> Result<(), Error>[src]
fn set_consensus_fork(&self, consensus_fork: &str) -> Result<(), Error>set consensus_fork this database is configured for
Auto Trait Implementations
impl<T> Send for BlockChainDatabase<T>
impl<T> Send for BlockChainDatabase<T>impl<T> Sync for BlockChainDatabase<T>
impl<T> Sync for BlockChainDatabase<T>Blanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T[src]
fn borrow(&self) -> &TImmutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more
impl<T> Erased for T
impl<T> Erased for Timpl<T> AsSubstore for T where
T: BlockChain + IndexedBlockProvider + TransactionProvider + TransactionMetaProvider + TransactionOutputProvider,
impl<T> AsSubstore for T where
T: BlockChain + IndexedBlockProvider + TransactionProvider + TransactionMetaProvider + TransactionOutputProvider, fn as_block_provider(&self) -> &BlockProvider
fn as_block_provider(&self) -> &BlockProviderfn as_block_header_provider(&self) -> &BlockHeaderProvider
fn as_block_header_provider(&self) -> &BlockHeaderProviderfn as_transaction_provider(&self) -> &TransactionProvider
fn as_transaction_provider(&self) -> &TransactionProviderfn as_transaction_output_provider(&self) -> &TransactionOutputProvider
fn as_transaction_output_provider(&self) -> &TransactionOutputProviderfn as_transaction_meta_provider(&self) -> &TransactionMetaProvider
fn as_transaction_meta_provider(&self) -> &TransactionMetaProvider