multiversx_sc_scenario/
lib.rs

1// TODO: remove once minimum version is 1.87+
2#![allow(unknown_lints)]
3#![allow(clippy::collapsible_if)]
4#![allow(clippy::manual_is_multiple_of)]
5
6pub mod api;
7pub mod display_util;
8pub mod executor;
9mod facade;
10pub mod managed_test_util;
11pub mod scenario;
12pub mod scenario_macros;
13mod vm_go_tool;
14
15pub mod whitebox_legacy;
16
17/// Keeping this for backwards compatibility.
18/// Unfortunately, the `deprecated` annotation doesn't function for reexports.
19pub use whitebox_legacy as testing_framework;
20
21pub use api::DebugApi;
22pub use multiversx_chain_vm;
23
24/// Re-exporting for convenience.
25pub use num_bigint;
26
27pub use multiversx_sc;
28
29pub use multiversx_sc_meta_lib as meta;
30
31/// Exposing the scenario model. Might be moved in the future,
32/// but the export will hopefully remain the same.
33pub use crate::scenario::model as scenario_model;
34
35/// For backwards compatibility, will be removed.
36pub use crate::scenario as mandos_system;
37
38// Re-exporting the whole mandos crate for easier use in tests.
39pub use multiversx_chain_scenario_format as scenario_format;
40
41pub use facade::{ContractInfo, ScenarioWorld, WhiteboxContract, result_handlers::*, world_tx::*};
42
43use std::path::Path;
44
45/// Imports normally needed in integration tests, grouped together.
46pub mod imports;
47
48/// Legacy function for running a scenario test using the Go VM tool.
49///
50/// Use `sc-meta test-gen` to replace all calls to it automatically.
51#[deprecated(
52    since = "0.42.0",
53    note = "Call `sc-meta test-gen` in the project folder to automatically upgrade all scenario tests."
54)]
55pub fn run_go<P: AsRef<Path>>(relative_path: P) {
56    ScenarioWorld::vm_go().run(relative_path);
57}
58
59#[deprecated(
60    since = "0.39.0",
61    note = "Call `sc-meta test-gen` in the project folder to automatically upgrade all scenario tests."
62)]
63pub fn mandos_go<P: AsRef<Path>>(relative_path: P) {
64    ScenarioWorld::vm_go().run(relative_path);
65}
66
67/// Legacy function for running a scenario test using the Go VM tool.
68///
69/// Use `sc-meta test-gen` to replace all calls to it automatically.
70#[deprecated(
71    since = "0.42.0",
72    note = "Call `sc-meta test-gen` in the project folder to automatically upgrade all scenario tests."
73)]
74pub fn run_rs<P: AsRef<Path>>(relative_path: P, world: ScenarioWorld) {
75    world.run(relative_path);
76}
77
78#[deprecated(
79    since = "0.39.0",
80    note = "Call `sc-meta test-gen` in the project folder to automatically upgrade all scenario tests."
81)]
82pub fn mandos_rs<P: AsRef<Path>>(relative_path: P, world: ScenarioWorld) {
83    world.run(relative_path);
84}
85
86#[deprecated(
87    since = "0.39.0",
88    note = "Alias provided for backwards compatibility. Do replace `BlockchainMock` with `ScenarioWorld` after upgrading, though."
89)]
90pub type BlockchainMock = ScenarioWorld;