multiversx_sc_scenario/facade/
scenario_world_steps.rs

1use crate::{
2    facade::ScenarioWorld,
3    scenario::{model::*, ScenarioRunner},
4};
5
6impl ScenarioWorld {
7    /// Imports and processes steps from an external scenario file.
8    pub fn external_steps(&mut self, step: ExternalStepsStep) -> &mut Self {
9        self.run_external_steps(&step);
10        self
11    }
12
13    /// Adds a SC call step, then executes it.
14    pub fn set_state_step(&mut self, step: SetStateStep) -> &mut Self {
15        self.run_set_state_step(&step);
16        self
17    }
18
19    /// Adds a SC call step, then executes it.
20    pub fn sc_call<S>(&mut self, mut step: S) -> &mut Self
21    where
22        S: AsMut<ScCallStep>,
23    {
24        self.run_sc_call_step(step.as_mut());
25        self
26    }
27
28    /// Adds a SC query step, then executes it.
29    pub fn sc_query<S>(&mut self, mut step: S) -> &mut Self
30    where
31        S: AsMut<ScQueryStep>,
32    {
33        self.run_sc_query_step(step.as_mut());
34        self
35    }
36
37    /// Adds a SC deploy step, then executes it.
38    pub fn sc_deploy<S>(&mut self, mut step: S) -> &mut Self
39    where
40        S: AsMut<ScDeployStep>,
41    {
42        self.run_sc_deploy_step(step.as_mut());
43        self
44    }
45
46    /// Adds a simple transfer step, then executes it.
47    pub fn transfer_step(&mut self, step: TransferStep) -> &mut Self {
48        self.run_transfer_step(&step);
49        self
50    }
51
52    /// Adds a validator reward step, then executes it.
53    pub fn validator_reward_step(&mut self, step: ValidatorRewardStep) -> &mut Self {
54        self.run_validator_reward_step(&step);
55        self
56    }
57
58    /// Adds a check state step, then executes it.
59    pub fn check_state_step(&mut self, step: CheckStateStep) -> &mut Self {
60        self.run_check_state_step(&step);
61        self
62    }
63
64    /// Adds a dump state step, then executes it.
65    pub fn dump_state_step(&mut self) -> &mut Self {
66        self.run_dump_state_step();
67        self
68    }
69}