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
impl ScenarioVMRunner
pub fn perform_check_state(&mut self, check_state_step: &CheckStateStep)
pub fn perform_dump_state(&mut self)
Source§impl ScenarioVMRunner
impl ScenarioVMRunner
Sourcepub fn perform_sc_call_update_results(&mut self, step: &mut ScCallStep)
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.
Sourcepub fn perform_sc_call_get_result<OriginalResult, RequestedResult>(
&mut self,
typed_sc_call: TypedScCall<OriginalResult>,
) -> RequestedResultwhere
OriginalResult: TopEncodeMulti,
RequestedResult: TopDecodeMulti + TypeAbiFrom<OriginalResult>,
👎Deprecated since 0.49.0: Please use the unified transaction syntax instead.
pub fn perform_sc_call_get_result<OriginalResult, RequestedResult>(
&mut self,
typed_sc_call: TypedScCall<OriginalResult>,
) -> RequestedResultwhere
OriginalResult: TopEncodeMulti,
RequestedResult: TopDecodeMulti + TypeAbiFrom<OriginalResult>,
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.
pub fn perform_sc_call_lambda<F>(
&mut self,
sc_call_step: &ScCallStep,
f: F,
) -> TxResultwhere
F: FnOnce(),
pub fn perform_sc_call_lambda_and_check<F>(
&mut self,
sc_call_step: &ScCallStep,
f: F,
) -> TxResultwhere
F: FnOnce(),
Source§impl ScenarioVMRunner
impl ScenarioVMRunner
Sourcepub fn perform_sc_deploy_update_results(&mut self, step: &mut ScDeployStep)
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.
pub fn perform_sc_deploy_lambda<F>(
&mut self,
sc_deploy_step: &ScDeployStep,
f: F,
) -> (Address, TxResult)where
F: FnOnce(),
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
impl ScenarioVMRunner
Sourcepub fn perform_sc_query_update_results(&mut self, step: &mut ScQueryStep)
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.
pub fn perform_sc_query_lambda<F>(
&mut self,
step: &ScQueryStep,
f: F,
) -> TxResultwhere
F: FnOnce(),
pub fn perform_sc_query_lambda_and_check<F>(
&mut self,
step: &ScQueryStep,
f: F,
) -> TxResultwhere
F: FnOnce(),
Source§impl ScenarioVMRunner
impl ScenarioVMRunner
pub fn perform_set_state(&mut self, set_state_step: &SetStateStep)
Source§impl ScenarioVMRunner
impl ScenarioVMRunner
pub fn perform_transfer(&mut self, transfer_step: &TransferStep)
pub fn perform_validator_reward( &mut self, validator_rewards_step: &ValidatorRewardStep, )
Trait Implementations§
Source§impl Debug for ScenarioVMRunner
impl Debug for ScenarioVMRunner
Source§impl Default for ScenarioVMRunner
impl Default for ScenarioVMRunner
Source§fn default() -> ScenarioVMRunner
fn default() -> ScenarioVMRunner
Source§impl ScenarioRunner for ScenarioVMRunner
impl ScenarioRunner for ScenarioVMRunner
fn run_external_steps(&mut self, _step: &ExternalStepsStep)
fn run_set_state_step(&mut self, step: &SetStateStep)
fn run_sc_call_step(&mut self, step: &mut ScCallStep)
fn run_multi_sc_call_step(&mut self, steps: &mut [ScCallStep])
fn run_multi_sc_deploy_step(&mut self, steps: &mut [ScDeployStep])
fn run_sc_query_step(&mut self, step: &mut ScQueryStep)
fn run_sc_deploy_step(&mut self, step: &mut ScDeployStep)
fn run_transfer_step(&mut self, step: &TransferStep)
fn run_validator_reward_step(&mut self, step: &ValidatorRewardStep)
fn run_check_state_step(&mut self, step: &CheckStateStep)
fn run_dump_state_step(&mut self)
Source§fn run_scenario(&mut self, scenario: &Scenario)
fn run_scenario(&mut self, scenario: &Scenario)
Auto Trait Implementations§
impl Freeze for ScenarioVMRunner
impl !RefUnwindSafe for ScenarioVMRunner
impl Send for ScenarioVMRunner
impl Sync for ScenarioVMRunner
impl Unpin for ScenarioVMRunner
impl !UnwindSafe for ScenarioVMRunner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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