diff --git a/Cargo.lock b/Cargo.lock index 5b93bb189fbd6..2689331314c37 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11129,16 +11129,6 @@ dependencies = [ "move-stdlib", ] -[[package]] -name = "move-explain" -version = "0.1.0" -dependencies = [ - "bcs 0.1.4", - "clap 4.5.21", - "move-command-line-common", - "move-core-types", -] - [[package]] name = "move-ir-compiler" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 9b4c2901adf5e..bbe50f0681894 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -246,7 +246,6 @@ members = [ "third_party/move/tools/move-coverage", "third_party/move/tools/move-decompiler", "third_party/move/tools/move-disassembler", - "third_party/move/tools/move-explain", "third_party/move/tools/move-linter", "third_party/move/tools/move-package", "third_party/move/tools/move-resource-viewer", diff --git a/third_party/move/tools/README.md b/third_party/move/tools/README.md index cdcc842bdaf3e..64ede747afdc7 100644 --- a/third_party/move/tools/README.md +++ b/third_party/move/tools/README.md @@ -12,7 +12,6 @@ that are used by the [`move-cli`](./move-cli) `package` subcommand: * `move-bytecode-viewer` * `move-disassembler` -* `move-explain` * `move-unit-test` * `move-package` * `move-coverage` diff --git a/third_party/move/tools/move-explain/Cargo.toml b/third_party/move/tools/move-explain/Cargo.toml deleted file mode 100644 index 7002b14395079..0000000000000 --- a/third_party/move/tools/move-explain/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "move-explain" -version = "0.1.0" -authors = ["Diem Association "] -description = "Explain Move abort codes. Errors are defined as a global category + module-specific reason for the error" -repository = "https://github.com/diem/diem" -homepage = "https://diem.com" -license = "Apache-2.0" -publish = false -edition = "2021" - -[dependencies] -bcs = { workspace = true } -clap = { workspace = true, features = ["derive"] } -move-command-line-common = { workspace = true } -move-core-types = { workspace = true } - -[features] -default = [] diff --git a/third_party/move/tools/move-explain/src/main.rs b/third_party/move/tools/move-explain/src/main.rs deleted file mode 100644 index d7d012fe55cbf..0000000000000 --- a/third_party/move/tools/move-explain/src/main.rs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) The Diem Core Contributors -// Copyright (c) The Move Contributors -// SPDX-License-Identifier: Apache-2.0 - -use clap::Parser; -use move_command_line_common::files::MOVE_ERROR_DESC_EXTENSION; -use move_core_types::errmap::ErrorMapping; -#[derive(Debug, Parser)] -#[clap(author, version, about)] -struct Args { - /// The location (module id) returned with a `MoveAbort` error - #[clap(long = "location", short = 'l')] - location: String, - /// The abort code returned with a `MoveAbort` error - #[clap(long = "abort-code", short = 'a')] - abort_code: u64, - /// Path to the error code mapping file - #[clap(long = MOVE_ERROR_DESC_EXTENSION, short = 'e')] - errmap_path: String, -} - -fn main() { - let args = Args::parse(); - - let errmap_bytes = std::fs::read(&args.errmap_path).expect("Could not load errmap from file"); - let errmap: ErrorMapping = - bcs::from_bytes(&errmap_bytes).expect("Failed to deserialize errmap"); - - match errmap.get_explanation(&args.location, args.abort_code) { - None => println!( - "Unable to find a description for {}::{}", - args.location, args.abort_code - ), - Some(error_desc) => println!( - "Name: {}\nDescription: {}", - error_desc.code_name, error_desc.code_description, - ), - } -} - -#[test] -fn verify_tool() { - use clap::CommandFactory; - Args::command().debug_assert() -}