multiversx_sc_scenario/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#![allow(clippy::type_complexity)]

pub mod api;
pub mod bech32;
pub mod debug_executor;
pub mod display_util;
mod facade;
pub mod managed_test_util;
pub mod scenario;
pub mod scenario_macros;
mod vm_go_tool;

pub mod whitebox_legacy;

/// Keeping this for backwards compatibility.
/// Unfortunately, the `deprecated` annotation doesn't function for reexports.
pub use whitebox_legacy as testing_framework;

pub use api::DebugApi;
pub use multiversx_chain_vm;

/// Re-exporting for convenience.
pub use num_bigint;

pub use multiversx_sc;

pub use multiversx_sc_meta_lib as meta;

/// Exposing the scenario model. Might be moved in the future,
/// but the export will hopefully remain the same.
pub use crate::scenario::model as scenario_model;

/// For backwards compatibility, will be removed.
pub use crate::scenario as mandos_system;

// Re-exporting the whole mandos crate for easier use in tests.
pub use multiversx_chain_scenario_format as scenario_format;

pub use facade::{result_handlers::*, world_tx::*, ContractInfo, ScenarioWorld, WhiteboxContract};

use std::path::Path;

/// Imports normally needed in integration tests, grouped together.
pub mod imports;

/// Legacy function for running a scenario test using the Go VM tool.
///
/// Use `sc-meta test-gen` to replace all calls to it automatically.
#[deprecated(
    since = "0.42.0",
    note = "Call `sc-meta test-gen` in the project folder to automatically upgrade all scenario tests."
)]
pub fn run_go<P: AsRef<Path>>(relative_path: P) {
    ScenarioWorld::vm_go().run(relative_path);
}

#[deprecated(
    since = "0.39.0",
    note = "Call `sc-meta test-gen` in the project folder to automatically upgrade all scenario tests."
)]
pub fn mandos_go<P: AsRef<Path>>(relative_path: P) {
    ScenarioWorld::vm_go().run(relative_path);
}

/// Legacy function for running a scenario test using the Go VM tool.
///
/// Use `sc-meta test-gen` to replace all calls to it automatically.
#[deprecated(
    since = "0.42.0",
    note = "Call `sc-meta test-gen` in the project folder to automatically upgrade all scenario tests."
)]
pub fn run_rs<P: AsRef<Path>>(relative_path: P, world: ScenarioWorld) {
    world.run(relative_path);
}

#[deprecated(
    since = "0.39.0",
    note = "Call `sc-meta test-gen` in the project folder to automatically upgrade all scenario tests."
)]
pub fn mandos_rs<P: AsRef<Path>>(relative_path: P, world: ScenarioWorld) {
    world.run(relative_path);
}

#[deprecated(
    since = "0.39.0",
    note = "Alias provided for backwards compatibility. Do replace `BlockchainMock` with `ScenarioWorld` after upgrading, though."
)]
pub type BlockchainMock = ScenarioWorld;