From f06dd3d7b47aedf51d4fc3edfc152fb0a0044737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20P=C5=82askonka?= Date: Tue, 6 Feb 2024 14:04:01 +0100 Subject: [PATCH] Replaced remaining MockVM mentions to OdraVM. (#73) * Replaced remaining MockVM mentions to OdraVM. * Added available templates to help --- CHANGELOG.md | 2 +- README.md | 2 +- src/actions/test.rs | 10 +++++----- src/cli.rs | 8 +++++--- src/command.rs | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e4b0fe..f139238 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -88,7 +88,7 @@ this out. ### Added - `init` and `new` commands. - `backend` command to manage backends with subcommands `add` and `remove`. -- `test` command with possibility to run tests against MockVM and dedicated backend VM. +- `test` command with possibility to run tests against OdraVM and dedicated backend VM. - `clean` command which removes temporary files generated by cargo-odra. - `generate` command which can generate a new sample contract, ready to run and test. - `CHANGELOG.md` and `README.md` files. diff --git a/README.md b/README.md index 3da3de3..0af4d49 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ $ cargo odra new --name myproject && cd myproject ``` A sample contract - Flipper - will be created for you, with some sample tests. -To run them against MockVM, simply type: +To run them against OdraVM, simply type: ```bash $ cargo odra test diff --git a/src/actions/test.rs b/src/actions/test.rs index 8af9533..d6620aa 100644 --- a/src/actions/test.rs +++ b/src/actions/test.rs @@ -33,7 +33,7 @@ impl TestAction<'_> { /// Runs a test suite. pub fn test(&self) { if self.backend.is_none() { - self.test_mock_vm(); + self.test_odra_vm(); } else { if !self.skip_build { self.build_wasm_files(); @@ -42,10 +42,10 @@ impl TestAction<'_> { } } - /// Test code against MockVM. - fn test_mock_vm(&self) { - log::info("Testing against MockVM ..."); - command::cargo_test_mock_vm(self.project.project_root(), self.get_passthrough_args()); + /// Test code against OdraVM. + fn test_odra_vm(&self) { + log::info("Testing against OdraVM ..."); + command::cargo_test_odra_vm(self.project.project_root(), self.get_passthrough_args()); } /// Test specific backend. diff --git a/src/cli.rs b/src/cli.rs index 2781cd5..e443e40 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -53,7 +53,7 @@ pub enum OdraSubcommand { Build(BuildCommand), /// Generates schema for a given contract. Schema(SchemaCommand), - /// Runs test. Without the backend parameter, the tests will be run against Mock VM. + /// Runs test. Without the backend parameter, the tests will be run against OdraVM. Test(TestCommand), /// Generates boilerplate code for contracts. Generate(GenerateCommand), @@ -80,8 +80,10 @@ pub struct InitCommand { /// It can be a version, a branch, commit hash or a location on the filesystem. #[clap(value_parser, long, short)] pub source: Option, - /// Template to use. Default is "full", which contains a sample contract and a test. - /// To see all available templates, run `cargo odra new --list`. + /// Template to use. Default is "full" - which contains a sample contract and a test. + /// Other templates are: + /// "blank" - which only sets up Cargo.toml and directory structure and + /// "workspace" - which sets up a workspace with a sub crate. #[clap(value_parser, long, short, default_value = consts::ODRA_TEMPLATE_DEFAULT_TEMPLATE)] pub template: String, } diff --git a/src/command.rs b/src/command.rs index d69e679..74eda75 100644 --- a/src/command.rs +++ b/src/command.rs @@ -143,7 +143,7 @@ pub fn cargo_generate_schema_files(current_dir: PathBuf, contract_name: &str, mo } /// Runs cargo test. -pub fn cargo_test_mock_vm(current_dir: PathBuf, mut args: Vec<&str>) { +pub fn cargo_test_odra_vm(current_dir: PathBuf, mut args: Vec<&str>) { log::info("Running cargo test..."); let mut tail_args = vec!["--lib"]; tail_args.append(&mut args);