diff --git a/crates/wasm_cli/src/commands/testbalance/mod.rs b/crates/wasm_cli/src/commands/testbalance/mod.rs index 99294d7df..a1dbd291b 100644 --- a/crates/wasm_cli/src/commands/testbalance/mod.rs +++ b/crates/wasm_cli/src/commands/testbalance/mod.rs @@ -16,8 +16,7 @@ use crate::commands::testinitdb::*; #[derive(Parser, Debug, Clone)] pub struct TestBalanceOpts { - /// This is the path to the database to be created/used. #716, this path is what we'll feed - /// into the database driver. + /// This is the path to the database to be used. // TODO: Make this an option, and look for the db path in the file tree // using std::fs or std::env if we choose to allow it. // REASON: If the db path is the current directory, we should infer this. diff --git a/crates/wasm_cli/src/commands/testcontract/mod.rs b/crates/wasm_cli/src/commands/testcontract/mod.rs index f2d9c883b..11f14240d 100644 --- a/crates/wasm_cli/src/commands/testcontract/mod.rs +++ b/crates/wasm_cli/src/commands/testcontract/mod.rs @@ -31,8 +31,7 @@ use crate::commands::testinitdb; #[derive(Parser, Debug)] pub struct TestContractOpts { - /// This is the path to the database to be created/used. #716, this path is what we'll feed - /// into the database driver. + /// This is the path to the database to be used. #[clap(short, long)] pub dbpath: String, /// The path to the WASM object file to load and describe @@ -41,16 +40,14 @@ pub struct TestContractOpts { /// The contract caller's Address. #[clap(short, long, value_parser, value_name = "CONTRACT_CALLER")] pub contract_caller: primitives::Address, - /// The function to call within the smart contract. #716 this will influence the JSON we + /// The function to call within the smart contract. This will influence the JSON we /// generate below to pass into the smart contract when we execute it. TODO: mg@ needs to also /// remember to add some function-specific arguments here to allow those to be passed in. #[clap(short, long, value_parser, value_name = "FUNCTION")] pub function: String, /// The arguments to pass into the function as a JSON object. See the `versatus-rust` github /// repository for the inputs that supported functions take. For now, this is a string - /// interpretted as a JSON object, whereas later, it'll likely be more formal. #716, this JSON - /// will equate to the data in the FunctionInputs enum here: - /// https://github.com/versatus/versatus-rust/blob/main/src/versatus_rust.rs#L94 + /// interpretted as a JSON object, whereas later, it'll likely be more formal. #[clap(short, long, value_parser, value_name = "JSON", default_value = "[]")] pub inputs: String, /// An environment variable to pass to the running WASM module. May be used @@ -168,10 +165,7 @@ fn update_db(storage_connection: &Storage, contract_outputs: &SmartContractOutpu Ok(()) } -// #716 This JSON string is a placeholder to allow the code to compile. What we need to do is -// to build the JSON to match the JSON generated by the example in the versatus-rust -// repository, but build it from the contents of the database and command line inputs. We can -// assume (for now) that all contracts will be ERC20 when dealing with inputs and outputs. + fn create_contract_inputs( caller: &primitives::Address, function: &str, diff --git a/crates/wasm_cli/src/commands/testinitdb/mod.rs b/crates/wasm_cli/src/commands/testinitdb/mod.rs index 013963df7..2b1acd53d 100644 --- a/crates/wasm_cli/src/commands/testinitdb/mod.rs +++ b/crates/wasm_cli/src/commands/testinitdb/mod.rs @@ -40,18 +40,14 @@ pub const DEFAULT_ADDRESSES: &[Address; 10] = &[ #[derive(Clone, Parser, Debug)] pub struct TestInitDBOpts { - /// This is the path to the database to be created/used. #716, this path is what we'll feed - /// into the database driver. + /// This is the path to the database to be created. #[clap(short, long)] pub dbpath: String, - /// Force DB to be initialised, even if it already exists. #716 I think that if this option is - /// missing or false, we should only recreate the database from defaults if it doesn't already - /// exist. If it exists, we should exit with a failure and an error message indicating that the - /// database already exists and to use --force. + /// Force DB to be initialised, even if it already exists. #[clap(short, long)] pub force: bool, /// Default balance for new test accounts created. The protocol supports values up to - /// [ethnum::U256] in size, but u128 ought to be fine for now. + /// U256 in size. #[clap(short, long)] pub default_balance: Option, #[clap(short, long)]