Struct grin_chain::store::ChainStore
source · [−]pub struct ChainStore { /* private fields */ }
Expand description
All chain-related database operations
Implementations
sourceimpl 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 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.
Auto Trait Implementations
impl !RefUnwindSafe for ChainStore
impl Send for ChainStore
impl Sync for ChainStore
impl Unpin for ChainStore
impl !UnwindSafe for ChainStore
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> SafeBorrow<T> for T where
T: ?Sized,
impl<T> SafeBorrow<T> for T where
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
fn borrow_replacement(ptr: &T) -> &T
Given ptr
, which was obtained from a prior call to Self::borrow()
,
return a value with the same nominal lifetime which is guaranteed to
survive mutations to Self
. Read more