pub struct GlobalContext<'a> {
    pub event_batches: Vec<EventBatch>,
    pub database: ClarityDatabase<'a>,
    pub cost_track: LimitedCostTracker,
    pub mainnet: bool,
    pub coverage_reporting: Option<TestCoverageReport>,
    pub costs_reporting: Option<CostsReport>,
    pub eval_hooks: Option<Vec<Box<dyn EvalHook>>>,
    /* private fields */
}
Expand description

GlobalContext represents the outermost context for a single transaction’s execution. It tracks an asset changes that occurred during the processing of the transaction, whether or not the current context is read_only, and is responsible for committing/rolling-back transactions as they error or abort.

Fields

event_batches: Vec<EventBatch>database: ClarityDatabase<'a>cost_track: LimitedCostTrackermainnet: boolcoverage_reporting: Option<TestCoverageReport>costs_reporting: Option<CostsReport>eval_hooks: Option<Vec<Box<dyn EvalHook>>>

Implementations

Destroys this context, returning ownership of its database reference. If the context wasn’t top-level (i.e., it had uncommitted data), return None, because the database is not guaranteed to be in a sane state.

Trait Implementations

Check if the given contract-call should be short-circuited. If so: this charges the cost to the CostTracker, and return true If not: return false Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more