Struct aleo_rust::snarkvm_types::BlockMemory
source · pub struct BlockMemory<N>where
N: Network,{ /* private fields */ }
Expand description
An in-memory block storage.
Trait Implementations§
source§impl<N> BlockStorage<N> for BlockMemory<N>where
N: Network,
impl<N> BlockStorage<N> for BlockMemory<N>where N: Network,
source§fn state_root_map(&self) -> &<BlockMemory<N> as BlockStorage<N>>::StateRootMap
fn state_root_map(&self) -> &<BlockMemory<N> as BlockStorage<N>>::StateRootMap
Returns the state root map.
source§fn reverse_state_root_map(
&self
) -> &<BlockMemory<N> as BlockStorage<N>>::ReverseStateRootMap
fn reverse_state_root_map( &self ) -> &<BlockMemory<N> as BlockStorage<N>>::ReverseStateRootMap
Returns the reverse state root map.
source§fn id_map(&self) -> &<BlockMemory<N> as BlockStorage<N>>::IDMap
fn id_map(&self) -> &<BlockMemory<N> as BlockStorage<N>>::IDMap
Returns the ID map.
source§fn reverse_id_map(&self) -> &<BlockMemory<N> as BlockStorage<N>>::ReverseIDMap
fn reverse_id_map(&self) -> &<BlockMemory<N> as BlockStorage<N>>::ReverseIDMap
Returns the reverse ID map.
source§fn header_map(&self) -> &<BlockMemory<N> as BlockStorage<N>>::HeaderMap
fn header_map(&self) -> &<BlockMemory<N> as BlockStorage<N>>::HeaderMap
Returns the header map.
source§fn transactions_map(
&self
) -> &<BlockMemory<N> as BlockStorage<N>>::TransactionsMap
fn transactions_map( &self ) -> &<BlockMemory<N> as BlockStorage<N>>::TransactionsMap
Returns the transactions map.
source§fn confirmed_transactions_map(
&self
) -> &<BlockMemory<N> as BlockStorage<N>>::ConfirmedTransactionsMap
fn confirmed_transactions_map( &self ) -> &<BlockMemory<N> as BlockStorage<N>>::ConfirmedTransactionsMap
Returns the confirmed transactions map.
source§fn transaction_store(
&self
) -> &TransactionStore<N, <BlockMemory<N> as BlockStorage<N>>::TransactionStorage>
fn transaction_store( &self ) -> &TransactionStore<N, <BlockMemory<N> as BlockStorage<N>>::TransactionStorage>
Returns the transaction store.
source§fn ratifications_map(
&self
) -> &<BlockMemory<N> as BlockStorage<N>>::RatificationsMap
fn ratifications_map( &self ) -> &<BlockMemory<N> as BlockStorage<N>>::RatificationsMap
Returns the ratifications map.
source§fn coinbase_solution_map(
&self
) -> &<BlockMemory<N> as BlockStorage<N>>::CoinbaseSolutionMap
fn coinbase_solution_map( &self ) -> &<BlockMemory<N> as BlockStorage<N>>::CoinbaseSolutionMap
Returns the coinbase solution map.
source§fn coinbase_puzzle_commitment_map(
&self
) -> &<BlockMemory<N> as BlockStorage<N>>::CoinbasePuzzleCommitmentMap
fn coinbase_puzzle_commitment_map( &self ) -> &<BlockMemory<N> as BlockStorage<N>>::CoinbasePuzzleCommitmentMap
Returns the coinbase puzzle commitment map.
source§fn signature_map(&self) -> &<BlockMemory<N> as BlockStorage<N>>::SignatureMap
fn signature_map(&self) -> &<BlockMemory<N> as BlockStorage<N>>::SignatureMap
Returns the signature map.
§type StateRootMap = MemoryMap<u32, <N as Network>::StateRoot>
type StateRootMap = MemoryMap<u32, <N as Network>::StateRoot>
The mapping of
block height
to state root
.§type ReverseStateRootMap = MemoryMap<<N as Network>::StateRoot, u32>
type ReverseStateRootMap = MemoryMap<<N as Network>::StateRoot, u32>
The mapping of
state root
to block height
.§type ReverseIDMap = MemoryMap<<N as Network>::BlockHash, u32>
type ReverseIDMap = MemoryMap<<N as Network>::BlockHash, u32>
The mapping of
block hash
to block height
.§type HeaderMap = MemoryMap<<N as Network>::BlockHash, Header<N>>
type HeaderMap = MemoryMap<<N as Network>::BlockHash, Header<N>>
The mapping of
block hash
to block header
.§type TransactionsMap = MemoryMap<<N as Network>::BlockHash, Vec<<N as Network>::TransactionID, Global>>
type TransactionsMap = MemoryMap<<N as Network>::BlockHash, Vec<<N as Network>::TransactionID, Global>>
The mapping of
block hash
to [transaction ID]
.§type ConfirmedTransactionsMap = MemoryMap<<N as Network>::TransactionID, (<N as Network>::BlockHash, ConfirmedTxType, Vec<u8, Global>)>
type ConfirmedTransactionsMap = MemoryMap<<N as Network>::TransactionID, (<N as Network>::BlockHash, ConfirmedTxType, Vec<u8, Global>)>
The mapping of
transaction ID
to (block hash, confirmed tx type, confirmed blob)
.§type TransactionStorage = TransactionMemory<N>
type TransactionStorage = TransactionMemory<N>
The transaction storage.
§type TransitionStorage = TransitionMemory<N>
type TransitionStorage = TransitionMemory<N>
The transition storage.
§type RatificationsMap = MemoryMap<<N as Network>::BlockHash, Vec<Ratify<N>, Global>>
type RatificationsMap = MemoryMap<<N as Network>::BlockHash, Vec<Ratify<N>, Global>>
The mapping of
block hash
to block ratifications
.§type CoinbaseSolutionMap = MemoryMap<<N as Network>::BlockHash, Option<CoinbaseSolution<N>>>
type CoinbaseSolutionMap = MemoryMap<<N as Network>::BlockHash, Option<CoinbaseSolution<N>>>
The mapping of
block hash
to block coinbase solution
.§type CoinbasePuzzleCommitmentMap = MemoryMap<PuzzleCommitment<N>, u32>
type CoinbasePuzzleCommitmentMap = MemoryMap<PuzzleCommitment<N>, u32>
The mapping of
puzzle commitment
to block height
.§type SignatureMap = MemoryMap<<N as Network>::BlockHash, Signature<N>>
type SignatureMap = MemoryMap<<N as Network>::BlockHash, Signature<N>>
The mapping of
block hash
to block signature
.source§fn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage>
fn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage>
Returns the transition store.
source§fn start_atomic(&self)
fn start_atomic(&self)
Starts an atomic batch write operation.
source§fn is_atomic_in_progress(&self) -> bool
fn is_atomic_in_progress(&self) -> bool
Checks if an atomic batch is in progress.
source§fn atomic_checkpoint(&self)
fn atomic_checkpoint(&self)
Checkpoints the atomic batch.
source§fn clear_latest_checkpoint(&self)
fn clear_latest_checkpoint(&self)
Clears the latest atomic batch checkpoint.
source§fn atomic_rewind(&self)
fn atomic_rewind(&self)
Rewinds the atomic batch to the previous checkpoint.
source§fn abort_atomic(&self)
fn abort_atomic(&self)
Aborts an atomic batch write operation.
source§fn insert(
&self,
state_root: <N as Network>::StateRoot,
block: &Block<N>
) -> Result<(), Error>
fn insert( &self, state_root: <N as Network>::StateRoot, block: &Block<N> ) -> Result<(), Error>
Stores the given
(state root, block)
pair into storage.source§fn remove(&self, block_hash: &<N as Network>::BlockHash) -> Result<(), Error>
fn remove(&self, block_hash: &<N as Network>::BlockHash) -> Result<(), Error>
Removes the block for the given
block hash
.source§fn find_block_height_from_state_root(
&self,
state_root: <N as Network>::StateRoot
) -> Result<Option<u32>, Error>
fn find_block_height_from_state_root( &self, state_root: <N as Network>::StateRoot ) -> Result<Option<u32>, Error>
Returns the block height that contains the given
state root
.source§fn find_block_hash(
&self,
transaction_id: &<N as Network>::TransactionID
) -> Result<Option<<N as Network>::BlockHash>, Error>
fn find_block_hash( &self, transaction_id: &<N as Network>::TransactionID ) -> Result<Option<<N as Network>::BlockHash>, Error>
Returns the block hash that contains the given
transaction ID
.source§fn find_block_height_from_puzzle_commitment(
&self,
puzzle_commitment: &PuzzleCommitment<N>
) -> Result<Option<u32>, Error>
fn find_block_height_from_puzzle_commitment( &self, puzzle_commitment: &PuzzleCommitment<N> ) -> Result<Option<u32>, Error>
Returns the block height that contains the given
puzzle commitment
.source§fn get_state_root(
&self,
block_height: u32
) -> Result<Option<<N as Network>::StateRoot>, Error>
fn get_state_root( &self, block_height: u32 ) -> Result<Option<<N as Network>::StateRoot>, Error>
Returns the state root that contains the given
block height
.source§fn get_state_path_for_commitment(
&self,
commitment: &Field<N>,
block_tree: &MerkleTree<N, BHP<N, 8, 54>, BHP<N, 6, 43>, snarkvm_console_program::::state_path::configuration::BlockTree::{constant#0}>
) -> Result<StatePath<N>, Error>
fn get_state_path_for_commitment( &self, commitment: &Field<N>, block_tree: &MerkleTree<N, BHP<N, 8, 54>, BHP<N, 6, 43>, snarkvm_console_program::::state_path::configuration::BlockTree::{constant#0}> ) -> Result<StatePath<N>, Error>
Returns a state path for the given
commitment
.source§fn get_previous_block_hash(
&self,
height: u32
) -> Result<Option<<N as Network>::BlockHash>, Error>
fn get_previous_block_hash( &self, height: u32 ) -> Result<Option<<N as Network>::BlockHash>, Error>
Returns the previous block hash of the given
block height
.source§fn get_block_hash(
&self,
height: u32
) -> Result<Option<<N as Network>::BlockHash>, Error>
fn get_block_hash( &self, height: u32 ) -> Result<Option<<N as Network>::BlockHash>, Error>
Returns the block hash for the given
block height
.source§fn get_block_height(
&self,
block_hash: &<N as Network>::BlockHash
) -> Result<Option<u32>, Error>
fn get_block_height( &self, block_hash: &<N as Network>::BlockHash ) -> Result<Option<u32>, Error>
Returns the block height for the given
block hash
.source§fn get_block_header(
&self,
block_hash: &<N as Network>::BlockHash
) -> Result<Option<Header<N>>, Error>
fn get_block_header( &self, block_hash: &<N as Network>::BlockHash ) -> Result<Option<Header<N>>, Error>
Returns the block header for the given
block hash
.source§fn get_block_transactions(
&self,
block_hash: &<N as Network>::BlockHash
) -> Result<Option<Transactions<N>>, Error>
fn get_block_transactions( &self, block_hash: &<N as Network>::BlockHash ) -> Result<Option<Transactions<N>>, Error>
Returns the block transactions for the given
block hash
.source§fn get_confirmed_transaction(
&self,
transaction_id: <N as Network>::TransactionID
) -> Result<Option<ConfirmedTransaction<N>>, Error>
fn get_confirmed_transaction( &self, transaction_id: <N as Network>::TransactionID ) -> Result<Option<ConfirmedTransaction<N>>, Error>
Returns the confirmed transaction for the given
transaction ID
.source§fn get_block_ratifications(
&self,
block_hash: &<N as Network>::BlockHash
) -> Result<Option<Vec<Ratify<N>, Global>>, Error>
fn get_block_ratifications( &self, block_hash: &<N as Network>::BlockHash ) -> Result<Option<Vec<Ratify<N>, Global>>, Error>
Returns the block ratifications for the given
block hash
.source§fn get_block_coinbase(
&self,
block_hash: &<N as Network>::BlockHash
) -> Result<Option<CoinbaseSolution<N>>, Error>
fn get_block_coinbase( &self, block_hash: &<N as Network>::BlockHash ) -> Result<Option<CoinbaseSolution<N>>, Error>
Returns the block coinbase solution for the given
block hash
.source§impl<N> Clone for BlockMemory<N>where
N: Clone + Network,
<N as Network>::StateRoot: Clone,
<N as Network>::BlockHash: Clone,
<N as Network>::TransactionID: Clone,
impl<N> Clone for BlockMemory<N>where N: Clone + Network, <N as Network>::StateRoot: Clone, <N as Network>::BlockHash: Clone, <N as Network>::TransactionID: Clone,
source§fn clone(&self) -> BlockMemory<N>
fn clone(&self) -> BlockMemory<N>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<N> !RefUnwindSafe for BlockMemory<N>
impl<N> Send for BlockMemory<N>
impl<N> Sync for BlockMemory<N>
impl<N> Unpin for BlockMemory<N>where N: Unpin,
impl<N> !UnwindSafe for BlockMemory<N>
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