[−][src]Struct clarity_repl::clarity::clarity::ClarityTransactionConnection
Interface for Clarity VM interactions within a given transaction.
commit the transaction to the block with .commit() rollback the transaction by dropping this struct.
Implementations
impl<'a> ClarityTransactionConnection<'a>
[src]
pub fn with_clarity_db<F, R>(&mut self, to_do: F) -> Result<R, Error> where
F: FnOnce(&mut ClarityDatabase<'_>) -> Result<R, Error>,
[src]
F: FnOnce(&mut ClarityDatabase<'_>) -> Result<R, Error>,
Do something to the underlying DB that involves writing.
pub fn cost_so_far(&self) -> ExecutionCost
[src]
What's our total (block-wide) resource use so far?
pub fn analyze_smart_contract(
&mut self,
identifier: &QualifiedContractIdentifier,
contract_content: &str
) -> Result<(ContractAST, ContractAnalysis), Error>
[src]
&mut self,
identifier: &QualifiedContractIdentifier,
contract_content: &str
) -> Result<(ContractAST, ContractAnalysis), Error>
Analyze a provided smart contract, but do not write the analysis to the AnalysisDatabase
pub fn save_analysis(
&mut self,
identifier: &QualifiedContractIdentifier,
contract_analysis: &ContractAnalysis
) -> Result<(), CheckError>
[src]
&mut self,
identifier: &QualifiedContractIdentifier,
contract_analysis: &ContractAnalysis
) -> Result<(), CheckError>
Save a contract analysis output to the AnalysisDatabase An error here would indicate that something has gone terribly wrong in the processing of a contract insert. the caller should likely abort the whole block or panic
pub fn run_contract_call<F>(
&mut self,
sender: &PrincipalData,
contract: &QualifiedContractIdentifier,
public_function: &str,
args: &[Value],
abort_call_back: F
) -> Result<(Value, AssetMap, Vec<StacksTransactionEvent>), Error> where
F: FnOnce(&AssetMap, &mut ClarityDatabase<'_>) -> bool,
[src]
&mut self,
sender: &PrincipalData,
contract: &QualifiedContractIdentifier,
public_function: &str,
args: &[Value],
abort_call_back: F
) -> Result<(Value, AssetMap, Vec<StacksTransactionEvent>), Error> where
F: FnOnce(&AssetMap, &mut ClarityDatabase<'_>) -> bool,
Execute a contract call in the current block. If an error occurs while processing the transaction, it's modifications will be rolled back. abort_call_back is called with an AssetMap and a ClarityDatabase reference, if abort_call_back returns false, all modifications from this transaction will be rolled back. otherwise, they will be committed (though they may later be rolled back if the block itself is rolled back).
pub fn initialize_smart_contract<F>(
&mut self,
identifier: &QualifiedContractIdentifier,
contract_ast: &ContractAST,
contract_str: &str,
abort_call_back: F
) -> Result<(AssetMap, Vec<StacksTransactionEvent>), Error> where
F: FnOnce(&AssetMap, &mut ClarityDatabase<'_>) -> bool,
[src]
&mut self,
identifier: &QualifiedContractIdentifier,
contract_ast: &ContractAST,
contract_str: &str,
abort_call_back: F
) -> Result<(AssetMap, Vec<StacksTransactionEvent>), Error> where
F: FnOnce(&AssetMap, &mut ClarityDatabase<'_>) -> bool,
Initialize a contract in the current block. If an error occurs while processing the initialization, it's modifications will be rolled back. abort_call_back is called with an AssetMap and a ClarityDatabase reference, if abort_call_back returns false, all modifications from this transaction will be rolled back. otherwise, they will be committed (though they may later be rolled back if the block itself is rolled back).
pub fn commit(self)
[src]
Commit the changes from the edit log. panics if there is more than one open savepoint
Trait Implementations
impl<'_> ClarityConnection for ClarityTransactionConnection<'_>
[src]
fn with_clarity_db_readonly_owned<F, R>(&mut self, to_do: F) -> R where
F: FnOnce(ClarityDatabase<'_>) -> (R, ClarityDatabase<'_>),
[src]
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,
[src]
F: FnOnce(&mut AnalysisDatabase<'_>) -> R,
fn with_clarity_db_readonly<F, R>(&mut self, to_do: F) -> R where
F: FnOnce(&mut ClarityDatabase<'_>) -> R,
[src]
F: FnOnce(&mut ClarityDatabase<'_>) -> R,
fn with_readonly_clarity_env<F, R>(
&mut self,
sender: PrincipalData,
cost_track: LimitedCostTracker,
to_do: F
) -> Result<R, InterpreterError> where
F: FnOnce(&mut Environment<'_, '_>) -> Result<R, InterpreterError>,
[src]
&mut self,
sender: PrincipalData,
cost_track: LimitedCostTracker,
to_do: F
) -> Result<R, InterpreterError> where
F: FnOnce(&mut Environment<'_, '_>) -> Result<R, InterpreterError>,
impl<'a> Drop for ClarityTransactionConnection<'a>
[src]
Auto Trait Implementations
impl<'a> !RefUnwindSafe for ClarityTransactionConnection<'a>
impl<'a> !Send for ClarityTransactionConnection<'a>
impl<'a> !Sync for ClarityTransactionConnection<'a>
impl<'a> Unpin for ClarityTransactionConnection<'a>
impl<'a> !UnwindSafe for ClarityTransactionConnection<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,