Struct clarity_repl::clarity::clarity::ClarityBlockConnection
source · [−]pub struct ClarityBlockConnection<'a> { /* private fields */ }
Expand description
A high-level interface for Clarity VM interactions within a single block.
Implementations
sourceimpl ClarityBlockConnection<'_>
impl ClarityBlockConnection<'_>
sourcepub fn reset_block_cost(&mut self, cost: ExecutionCost)
pub fn reset_block_cost(&mut self, cost: ExecutionCost)
Reset the block’s total execution to the given cost, if there is a cost tracker at all. Used by the miner to “undo” applying a transaction that exceeded the budget.
pub fn set_cost_tracker(
&mut self,
tracker: LimitedCostTracker
) -> LimitedCostTracker
sourcepub fn cost_so_far(&self) -> ExecutionCost
pub fn cost_so_far(&self) -> ExecutionCost
Get the current cost so far
sourceimpl<'a> ClarityBlockConnection<'a>
impl<'a> ClarityBlockConnection<'a>
sourcepub fn rollback_block(self)
pub fn rollback_block(self)
Rolls back all changes in the current block by (1) dropping all writes from the current MARF tip, (2) rolling back side-storage
sourcepub fn commit_to_block(self, final_bhh: &StacksBlockId) -> LimitedCostTracker
pub fn commit_to_block(self, final_bhh: &StacksBlockId) -> LimitedCostTracker
Commits all changes in the current block by (1) committing the current MARF tip to storage, (2) committing side-storage. Commits all changes in the current block by (1) committing the current MARF tip to storage, (2) committing side-storage. Commits to a different block hash than the one opened (i.e. since the caller may not have known the “real” block hash at the time of opening).
sourcepub fn commit_mined_block(self, bhh: &StacksBlockId) -> LimitedCostTracker
pub fn commit_mined_block(self, bhh: &StacksBlockId) -> LimitedCostTracker
Commits all changes in the current block by (1) committing the current MARF tip to storage, (2) committing side-storage. before this saves, it updates the metadata headers in the sidestore so that they don’t get stepped on after a miner re-executes a constructed block.
pub fn start_transaction_processing<'b>(
&'b mut self
) -> ClarityTransactionConnection<'b>
pub fn as_transaction<F, R>(&mut self, todo: F) -> R where
F: FnOnce(&mut ClarityTransactionConnection<'_>) -> R,
Trait Implementations
sourceimpl ClarityConnection for ClarityBlockConnection<'_>
impl ClarityConnection for ClarityBlockConnection<'_>
sourcefn with_clarity_db_readonly_owned<F, R>(&mut self, to_do: F) -> R where
F: FnOnce(ClarityDatabase<'_>) -> (R, ClarityDatabase<'_>),
fn with_clarity_db_readonly_owned<F, R>(&mut self, to_do: F) -> R where
F: FnOnce(ClarityDatabase<'_>) -> (R, ClarityDatabase<'_>),
Do something with ownership of the underlying DB that involves only reading.
fn with_analysis_db_readonly<F, R>(&mut self, to_do: F) -> R where
F: FnOnce(&mut AnalysisDatabase<'_>) -> R,
fn with_clarity_db_readonly<F, R>(&mut self, to_do: F) -> R where
F: FnOnce(&mut ClarityDatabase<'_>) -> R,
fn with_readonly_clarity_env<F, R>(
&mut self,
mainnet: bool,
sender: PrincipalData,
cost_track: LimitedCostTracker,
to_do: F
) -> Result<R, InterpreterError> where
F: FnOnce(&mut Environment<'_, '_>) -> Result<R, InterpreterError>,
Auto Trait Implementations
impl<'a> !RefUnwindSafe for ClarityBlockConnection<'a>
impl<'a> !Send for ClarityBlockConnection<'a>
impl<'a> !Sync for ClarityBlockConnection<'a>
impl<'a> Unpin for ClarityBlockConnection<'a>
impl<'a> !UnwindSafe for ClarityBlockConnection<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more