Struct grin_chain::store::ChainStore
source · pub struct ChainStore { /* private fields */ }
Expand description
All chain-related database operations
Implementations§
source§impl ChainStore
impl ChainStore
sourcepub fn header_head(&self) -> Result<Tip, Error>
pub fn header_head(&self) -> Result<Tip, Error>
The current header head (may differ from chain head).
sourcepub fn tail(&self) -> Result<Tip, Error>
pub fn tail(&self) -> Result<Tip, Error>
The current chain “tail” (earliest block in the store).
sourcepub fn pibd_head(&self) -> Result<Tip, Error>
pub fn pibd_head(&self) -> Result<Tip, Error>
The current PIBD head (will differ from the other heads. Return genesis block if PIBD head doesn’t exist).
sourcepub fn head_header(&self) -> Result<BlockHeader, Error>
pub fn head_header(&self) -> Result<BlockHeader, Error>
Header of the block at the head of the block chain (not the same thing as header_head).
sourcepub fn get_block_sums(&self, h: &Hash) -> Result<BlockSums, Error>
pub fn get_block_sums(&self, h: &Hash) -> Result<BlockSums, Error>
Get block_sums for the block hash.
sourcepub fn get_previous_header(
&self,
header: &BlockHeader
) -> Result<BlockHeader, Error>
pub fn get_previous_header( &self, header: &BlockHeader ) -> Result<BlockHeader, Error>
Get previous header.
sourcepub fn get_previous_header_skip_proof(
&self,
header: &BlockHeader
) -> Result<BlockHeader, Error>
pub fn get_previous_header_skip_proof( &self, header: &BlockHeader ) -> Result<BlockHeader, Error>
Get previous header without deserializing the proof nonces
sourcepub fn get_block_header(&self, h: &Hash) -> Result<BlockHeader, Error>
pub fn get_block_header(&self, h: &Hash) -> Result<BlockHeader, Error>
Get block header.
sourcepub fn get_block_header_skip_proof(
&self,
h: &Hash
) -> Result<BlockHeader, Error>
pub fn get_block_header_skip_proof( &self, h: &Hash ) -> Result<BlockHeader, Error>
Get block header without deserializing the full PoW Proof; currently used for difficulty iterator which is called many times but doesn’t need the proof
sourcepub fn get_output_pos(&self, commit: &Commitment) -> Result<u64, Error>
pub fn get_output_pos(&self, commit: &Commitment) -> Result<u64, Error>
Get PMMR pos for the given output commitment.
sourcepub fn get_output_pos_height(
&self,
commit: &Commitment
) -> Result<Option<CommitPos>, Error>
pub fn get_output_pos_height( &self, commit: &Commitment ) -> Result<Option<CommitPos>, Error>
Get PMMR pos and block height for the given output commitment.
Auto Trait Implementations§
impl Freeze for ChainStore
impl !RefUnwindSafe for ChainStore
impl Send for ChainStore
impl Sync for ChainStore
impl Unpin for ChainStore
impl !UnwindSafe for ChainStore
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more