Struct clarity_repl::repl::datastore::Datastore
source · pub struct Datastore { /* private fields */ }Implementations§
source§impl Datastore
impl Datastore
pub fn open( path_str: &str, miner_tip: Option<&StacksBlockId> ) -> Result<Datastore>
pub fn as_analysis_db(&mut self) -> AnalysisDatabase<'_>
sourcepub fn begin(&mut self, current: &StacksBlockId, next: &StacksBlockId)
pub fn begin(&mut self, current: &StacksBlockId, next: &StacksBlockId)
begin, commit, rollback a save point identified by key this is used to clean up any data from aborted blocks (NOT aborted transactions that is handled by the clarity vm directly). The block header hash is used for identifying savepoints. this cannot be used to rollback to arbitrary prior block hash, because that blockhash would already have committed and no longer exist in the save point stack. this is a “lower-level” rollback than the roll backs performed in ClarityDatabase or AnalysisDatabase – this is done at the backing store level.
pub fn rollback(&mut self)
pub fn commit_mined_block(&mut self, will_move_to: &StacksBlockId)
pub fn commit_to(&mut self, final_bhh: &StacksBlockId)
pub fn get_chain_tip(&self) -> &StacksBlockId
pub fn set_chain_tip(&mut self, bhh: &StacksBlockId)
pub fn put(&mut self, key: &str, value: &str)
pub fn make_contract_hash_key(contract: &QualifiedContractIdentifier) -> String
Trait Implementations§
source§impl ClarityBackingStore for Datastore
impl ClarityBackingStore for Datastore
source§fn set_block_hash(&mut self, bhh: StacksBlockId) -> Result<StacksBlockId>
fn set_block_hash(&mut self, bhh: StacksBlockId) -> Result<StacksBlockId>
change the current MARF context to service reads from a different chain_tip used to implement time-shifted evaluation. returns the previous block header hash on success
source§fn get_current_block_height(&mut self) -> u32
fn get_current_block_height(&mut self) -> u32
this function returns the current block height, as viewed by this marfed-kv structure, i.e., it changes on time-shifted evaluation. the open_chain_tip functions always return data about the chain tip that is currently open for writing.
source§fn make_contract_commitment(
&mut self,
contract_hash: Sha512Trunc256Sum
) -> String
fn make_contract_commitment( &mut self, contract_hash: Sha512Trunc256Sum ) -> String
The contract commitment is the hash of the contract, plus the block height in which the contract was initialized.
fn has_entry(&mut self, key: &str) -> bool
source§fn get_block_at_height(&mut self, height: u32) -> Option<StacksBlockId>
fn get_block_at_height(&mut self, height: u32) -> Option<StacksBlockId>
block_height >= the “currently” under construction Stacks block height.