drt_sc_scenario/
lib.rs

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