Enum move_cli::SandboxCommand
source · pub enum SandboxCommand {
Publish {
source_files: Vec<String>,
no_republish: bool,
ignore_breaking_changes: bool,
override_ordering: Option<Vec<String>>,
},
Run {
script_file: String,
script_name: Option<String>,
signers: Vec<String>,
args: Vec<TransactionArgument>,
type_args: Vec<TypeTag>,
gas_budget: Option<u64>,
dry_run: bool,
},
Test {
path: String,
use_temp_dir: bool,
track_cov: bool,
create: bool,
},
View {
file: String,
},
Clean {},
Doctor {},
Link {
source_files: Vec<String>,
no_republish: bool,
},
Generate {
cmd: GenerateCommand,
},
}
Variants§
Publish
Fields
no_republish: bool
If set, fail during compilation when attempting to publish a module that already exists in global storage
Compile the specified modules and publish the resulting bytecodes in global storage
Run
Fields
script_file: String
Path to .mv file containing either script or module bytecodes. If the file is a module, the
script_name
parameter must be set.
script_name: Option<String>
Name of the script function inside script_file
to call. Should only be set if script_file
points to a module.
signers: Vec<String>
Possibly-empty list of signers for the current transaction (e.g., account
in
main(&account: signer)
). Must match the number of signers expected by script_file
.
args: Vec<TransactionArgument>
Possibly-empty list of arguments passed to the transaction (e.g., i
in
main(i: u64)
). Must match the arguments types expected by script_file
.
Supported argument types are
bool literals (true, false),
u64 literals (e.g., 10, 58),
address literals (e.g., 0x12, 0x0000000000000000000000000000000f),
hexadecimal strings (e.g., x“0012“ will parse as the vector
type_args: Vec<TypeTag>
Possibly-empty list of type arguments passed to the transaction (e.g., T
in
main<T>()
). Must match the type arguments kinds expected by script_file
.
Compile/run a Move script that reads/writes resources stored on disk in storage
.
This command compiles the script first before running it.
Test
Fields
use_temp_dir: bool
Use an ephemeral directory to serve as the testing workspace.
By default, the directory containing the args.txt
will be the workspace
Run expected value tests using the given batch file
View
View Move resources, events files, and modules stored on disk
Clean
Fields
Delete all resources, events, and modules stored on disk under storage
.
Does not delete anything in src
.
Doctor
Fields
Run well-formedness checks on the storage
and build
directories.
Link
Fields
Typecheck and verify the scripts and/or modules under src
.
Generate
Fields
cmd: GenerateCommand
Generate struct layout bindings for the modules stored on disk under storage
Trait Implementations§
source§impl StructOpt for SandboxCommand
impl StructOpt for SandboxCommand
source§fn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
clap::ArgMatches
. It’s guaranteed to succeed
if matches
originates from an App
generated by [StructOpt::clap
] called on
the same type, otherwise it must panic.§fn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere Self: Sized,
std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program.§fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
fn from_args_safe() -> Result<Self, Error>where Self: Sized,
std::env::args_os
).
Unlike [StructOpt::from_args
], returns clap::Error
on failure instead of aborting the program,
so calling .exit
is up to you.§fn from_iter<I>(iter: I) -> Selfwhere
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
fn from_iter<I>(iter: I) -> Selfwhere Self: Sized, I: IntoIterator, <I as IntoIterator>::Item: Into<OsString> + Clone,
Vec
of your making.
Print the error message and quit the program in case of failure. Read more§fn from_iter_safe<I>(iter: I) -> Result<Self, Error>where
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error>where Self: Sized, I: IntoIterator, <I as IntoIterator>::Item: Into<OsString> + Clone,
Vec
of your making. Read more