Skip to content

Commit

Permalink
Replaced remaining MockVM mentions to OdraVM. (#73)
Browse files Browse the repository at this point in the history
* Replaced remaining MockVM mentions to OdraVM.

* Added available templates to help
  • Loading branch information
kubaplas authored Feb 6, 2024
1 parent f9edb33 commit f06dd3d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/actions/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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<String>,
/// 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,
}
Expand Down
2 changes: 1 addition & 1 deletion src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f06dd3d

Please sign in to comment.