multiversx_sc_scenario/
lib.rs

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