multiversx_sc_scenario::scenario::run_vm

Struct ScenarioVMRunner

Source
pub struct ScenarioVMRunner {
    pub contract_map_ref: ContractMapRef,
    pub blockchain_mock: BlockchainMock,
}
Expand description

Wraps calls to the blockchain mock, while implementing the StepRunner interface.

Fields§

§contract_map_ref: ContractMapRef§blockchain_mock: BlockchainMock

Implementations§

Source§

impl ScenarioVMRunner

Source

pub fn perform_check_state(&mut self, check_state_step: &CheckStateStep)

Source

pub fn perform_dump_state(&mut self)

Source§

impl ScenarioVMRunner

Source

pub fn perform_sc_call_update_results(&mut self, step: &mut ScCallStep)

Adds a SC call step, as specified in the step argument, then executes it.

The result of the operation gets saved back in the step’s response field.

Source

pub fn perform_sc_call_get_result<OriginalResult, RequestedResult>( &mut self, typed_sc_call: TypedScCall<OriginalResult>, ) -> RequestedResult
where OriginalResult: TopEncodeMulti, RequestedResult: TopDecodeMulti + TypeAbiFrom<OriginalResult>,

👎Deprecated since 0.49.0: Please use the unified transaction syntax instead.

Adds a SC call step, executes it and retrieves the transaction result (“out” field).

The transaction is expected to complete successfully.

It takes the contract_call argument separately from the SC call step, so we can benefit from type inference in the result.

Source

pub fn perform_sc_call_lambda<F>( &mut self, sc_call_step: &ScCallStep, f: F, ) -> TxResult
where F: FnOnce(),

Source

pub fn perform_sc_call_lambda_and_check<F>( &mut self, sc_call_step: &ScCallStep, f: F, ) -> TxResult
where F: FnOnce(),

Source§

impl ScenarioVMRunner

Source

pub fn perform_sc_deploy_update_results(&mut self, step: &mut ScDeployStep)

Adds a SC deploy step, as specified in the step argument, then executes it.

The result of the operation gets saved back in the step’s response field.

Source

pub fn perform_sc_deploy_lambda<F>( &mut self, sc_deploy_step: &ScDeployStep, f: F, ) -> (Address, TxResult)
where F: FnOnce(),

Source

pub fn perform_sc_deploy_lambda_and_check<F>( &mut self, sc_deploy_step: &ScDeployStep, f: F, ) -> (Address, TxResult)
where F: FnOnce(),

Source§

impl ScenarioVMRunner

Source

pub fn perform_sc_query_update_results(&mut self, step: &mut ScQueryStep)

Adds a SC query step, as specified in the sc_query_step argument, then executes it.

The result of the operation gets saved back in the step’s response field.

Source

pub fn perform_sc_query_lambda<F>( &mut self, step: &ScQueryStep, f: F, ) -> TxResult
where F: FnOnce(),

Source

pub fn perform_sc_query_lambda_and_check<F>( &mut self, step: &ScQueryStep, f: F, ) -> TxResult
where F: FnOnce(),

Source§

impl ScenarioVMRunner

Source

pub fn perform_set_state(&mut self, set_state_step: &SetStateStep)

Source§

impl ScenarioVMRunner

Source

pub fn perform_transfer(&mut self, transfer_step: &TransferStep)

Source

pub fn perform_validator_reward( &mut self, validator_rewards_step: &ValidatorRewardStep, )

Source§

impl ScenarioVMRunner

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Debug for ScenarioVMRunner

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ScenarioVMRunner

Source§

fn default() -> ScenarioVMRunner

Returns the “default value” for a type. Read more
Source§

impl ScenarioRunner for ScenarioVMRunner

Source§

fn run_external_steps(&mut self, _step: &ExternalStepsStep)

Source§

fn run_set_state_step(&mut self, step: &SetStateStep)

Source§

fn run_sc_call_step(&mut self, step: &mut ScCallStep)

Source§

fn run_multi_sc_call_step(&mut self, steps: &mut [ScCallStep])

Source§

fn run_multi_sc_deploy_step(&mut self, steps: &mut [ScDeployStep])

Source§

fn run_sc_query_step(&mut self, step: &mut ScQueryStep)

Source§

fn run_sc_deploy_step(&mut self, step: &mut ScDeployStep)

Source§

fn run_transfer_step(&mut self, step: &TransferStep)

Source§

fn run_validator_reward_step(&mut self, step: &ValidatorRewardStep)

Source§

fn run_check_state_step(&mut self, step: &CheckStateStep)

Source§

fn run_dump_state_step(&mut self)

Source§

fn run_scenario(&mut self, scenario: &Scenario)

Utility method for running all steps in a scenario.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> InterpretableFrom<T> for T

Source§

fn interpret_from(from: T, _context: &InterpreterContext) -> T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ReconstructableFrom<T> for T

Source§

fn reconstruct_from(from: T, _builder: &ReconstructorContext) -> T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V