logo
pub struct EngineState<S> { /* private fields */ }
Expand description

Main implementation of an execution engine state.

Takes an engine’s configuration and a provider of a state (aka the global state) to operate on. Methods implemented on this structure are the external API intended to be used by the users such as the node, test framework, and others.

Implementations

Flushes the LMDB environment to disk when manual sync is enabled in the config.toml.

Creates new engine state.

Returns engine config.

Updates current engine config with a new instance.

Commits genesis process.

This process is run only once per network to initiate the system. By definition users are unable to execute smart contracts on a network without a genesis.

Takes genesis configuration passed through ExecConfig and creates the system contracts, sets up the genesis accounts, and sets up the auction state based on that. At the end of the process, SystemContractRegistry is persisted under the special global state space Key::SystemContractRegistry.

Returns a GenesisSuccess for a successful operation, or an error otherwise.

Commits upgrade.

This process applies changes to the global state.

Returns UpgradeSuccess.

Creates a new tracking copy instance.

Executes a query.

For a given root Key it does a path lookup through the named keys.

Returns the value stored under a URef wrapped in a QueryResult.

Runs a deploy execution request.

For each deploy stored in the request it will execute it.

Currently a special shortcut is taken to distinguish a native transfer, from a deploy.

Return execution results which contains results from each deploy ran.

Get the balance of a passed purse referenced by its URef.

Executes a native transfer.

Native transfers do not involve WASM at all, and also skip executing payment code. Therefore this is the fastest and cheapest way to transfer tokens from account to account.

Returns an ExecutionResult for a successful native transfer.

Executes a deploy.

A deploy execution consists of running the payment code, which is expected to deposit funds into the payment purse, and then running the session code with a specific gas limit. For running payment code, we lock MAX_PAYMENT amount of motes from the user as collateral. If both the payment code and the session code execute successfully, a fraction of the unspent collateral will be transferred back to the proposer of the deploy, as specified in the request.

Returns ExecutionResult, or an error condition.

Apply effects of the execution.

This is also referred to as “committing” the effects into the global state. This method has to be run after an execution has been made to persists the effects of it.

Returns new state root hash.

Gets a trie object for given state root hash.

Puts a trie and finds missing descendant trie keys.

Performs a lookup for a list of missing root hashes.

Obtains validator weights for given era.

This skips execution of auction’s get_era_validator entry point logic to avoid creating an executor instance, and going through the execution flow. It follows the same process but uses queries rather than execution to get the snapshot.

Gets current bids from the auction system.

Executes a step request.

Gets the balance of a given public key.

Obtains an instance of a system contract registry for a given state root hash.

Returns mint system contract hash.

Returns auction system contract hash.

Returns handle payment system contract hash.

Returns standard payment system contract hash.

Trait Implementations

Formats the value using the given formatter. 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

Converts self into a target type. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. 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.

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Should always be Self

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

Attempts to convert self into a target type. Read more

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