diff --git a/packages/vm/examples/check_contract.rs b/packages/vm/examples/check_contract.rs index 1d53b164ee..8b17dec808 100644 --- a/packages/vm/examples/check_contract.rs +++ b/packages/vm/examples/check_contract.rs @@ -1,57 +1,9 @@ -use std::fs::File; -use std::io::Read; - -use clap::{App, Arg}; - -use cosmwasm_vm::capabilities_from_csv; -use cosmwasm_vm::internals::{check_wasm, compile}; - -const DEFAULT_AVAILABLE_CAPABILITIES: &str = "iterator,staking,stargate,cosmwasm_1_1"; - pub fn main() { - eprintln!("`check_contract` will be removed from the next version of `cosmwasm-vm` - please use `cosmwasm-check` instead."); + eprintln!("`check_contract` has been removed from `cosmwasm-vm` examples - please use `cosmwasm-check` instead."); + eprintln!("See https://crates.io/crates/cosmwasm-check"); + eprintln!(); eprintln!("> cargo install cosmwasm-check"); - - let matches = App::new("Contract checking") - .version("0.1.0") - .long_about("Checks the given wasm file (memories, exports, imports, available capabilities, and non-determinism).") - .author("Mauro Lacy ") - .arg( - Arg::with_name("CAPABILITIES") - // `long` setting required to turn the position argument into an option 🤷 - .long("available-capabilities") - .aliases(&["FEATURES", "supported-features"]) // Old names - .value_name("CAPABILITIES") - .help("Sets the available capabilities that the desired target chain has") - .takes_value(true) - ) - .arg( - Arg::with_name("WASM") - .help("Wasm file to read and compile") - .required(true) - .index(1), - ) - .get_matches(); - - // Available capabilities - let available_capabilities_csv = matches - .value_of("CAPABILITIES") - .unwrap_or(DEFAULT_AVAILABLE_CAPABILITIES); - let available_capabilities = capabilities_from_csv(available_capabilities_csv); - println!("Available capabilities: {:?}", available_capabilities); - - // File - let path = matches.value_of("WASM").expect("Error parsing file name"); - let mut file = File::open(path).unwrap(); - - // Read wasm - let mut wasm = Vec::::new(); - file.read_to_end(&mut wasm).unwrap(); - - // Check wasm - check_wasm(&wasm, &available_capabilities).unwrap(); - - // Compile module - compile(&wasm, None, &[]).unwrap(); - println!("contract checks passed.") + eprintln!("> cosmwasm-check --help"); + eprintln!(); + std::process::exit(74); }