From 0738615b7222b631cd08b7784ca81ebf3760b946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nurzhan=20Sak=C3=A9n?= Date: Wed, 14 Aug 2024 11:39:35 +0400 Subject: [PATCH] feat: rename `iroha_parity_scale_cli` to `iroha_codec` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nurzhan Sakén --- Cargo.lock | 44 +++++++++--------- Cargo.toml | 2 +- docs/README.md | 2 +- flake.nix | 2 +- .../Cargo.toml | 6 +-- .../README.md | 20 ++++---- .../build.rs | 0 .../samples/account.bin | Bin .../samples/account.json | 0 .../samples/domain.bin | 0 .../samples/domain.json | 0 .../samples/trigger.bin | Bin .../samples/trigger.json | 0 .../src/main.rs | 0 14 files changed, 36 insertions(+), 40 deletions(-) rename {iroha_parity_scale_cli => iroha_codec}/Cargo.toml (92%) rename {iroha_parity_scale_cli => iroha_codec}/README.md (82%) rename {iroha_parity_scale_cli => iroha_codec}/build.rs (100%) rename {iroha_parity_scale_cli => iroha_codec}/samples/account.bin (100%) rename {iroha_parity_scale_cli => iroha_codec}/samples/account.json (100%) rename {iroha_parity_scale_cli => iroha_codec}/samples/domain.bin (100%) rename {iroha_parity_scale_cli => iroha_codec}/samples/domain.json (100%) rename {iroha_parity_scale_cli => iroha_codec}/samples/trigger.bin (100%) rename {iroha_parity_scale_cli => iroha_codec}/samples/trigger.json (100%) rename {iroha_parity_scale_cli => iroha_codec}/src/main.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 78ab078be9b..192f4f3d85c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2934,6 +2934,28 @@ dependencies = [ "vergen", ] +[[package]] +name = "iroha_codec" +version = "2.0.0-rc.1.0" +dependencies = [ + "clap", + "colored", + "eyre", + "iroha_crypto", + "iroha_data_model", + "iroha_executor_data_model", + "iroha_genesis", + "iroha_primitives", + "iroha_schema", + "iroha_schema_gen", + "iroha_test_samples", + "iroha_version", + "parity-scale-codec", + "serde", + "serde_json", + "supports-color 2.1.0", +] + [[package]] name = "iroha_config" version = "2.0.0-rc.1.0" @@ -3371,28 +3393,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "iroha_parity_scale_cli" -version = "2.0.0-rc.1.0" -dependencies = [ - "clap", - "colored", - "eyre", - "iroha_crypto", - "iroha_data_model", - "iroha_executor_data_model", - "iroha_genesis", - "iroha_primitives", - "iroha_schema", - "iroha_schema_gen", - "iroha_test_samples", - "iroha_version", - "parity-scale-codec", - "serde", - "serde_json", - "supports-color 2.1.0", -] - [[package]] name = "iroha_primitives" version = "2.0.0-rc.1.0" diff --git a/Cargo.toml b/Cargo.toml index 735fb1373fb..ae864b6c4d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -229,7 +229,7 @@ members = [ "iroha_swarm", "iroha_kagami", "kura_inspector", - "iroha_parity_scale_cli", + "iroha_codec", "iroha_wasm_test_runner", "iroha_torii", "iroha_torii/const", diff --git a/docs/README.md b/docs/README.md index ef0352e80ea..88409016276 100644 --- a/docs/README.md +++ b/docs/README.md @@ -13,7 +13,7 @@ Documentation for Iroha 2 tools: - [Kagami](../iroha_kagami/README.md) - [Kura Inspector](../kura_inspector/README.md) -- [Parity Scale Decoder Tool](../iroha_parity_scale_cli/README.md) +- [Parity Scale Decoder Tool](../iroha_codec/README.md) ## Development diff --git a/flake.nix b/flake.nix index 7136e93ffcc..74d15a02cd7 100755 --- a/flake.nix +++ b/flake.nix @@ -49,7 +49,7 @@ "iroha" "kagami" "kura_inspector" - "parity_scale_cli" + "iroha_codec" ]; # HACK: A hook to filter out darwin-specific flags when cross-compiling. diff --git a/iroha_parity_scale_cli/Cargo.toml b/iroha_codec/Cargo.toml similarity index 92% rename from iroha_parity_scale_cli/Cargo.toml rename to iroha_codec/Cargo.toml index e0c27915944..694511cabc1 100644 --- a/iroha_parity_scale_cli/Cargo.toml +++ b/iroha_codec/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "iroha_parity_scale_cli" +name = "iroha_codec" edition.workspace = true version.workspace = true @@ -38,7 +38,3 @@ eyre = { workspace = true } [dev-dependencies] iroha_test_samples = { workspace = true } - -[[bin]] -name = "parity_scale_cli" -path = "src/main.rs" diff --git a/iroha_parity_scale_cli/README.md b/iroha_codec/README.md similarity index 82% rename from iroha_parity_scale_cli/README.md rename to iroha_codec/README.md index 91d7b7f9db0..80cb2dbd6bb 100644 --- a/iroha_parity_scale_cli/README.md +++ b/iroha_codec/README.md @@ -7,7 +7,7 @@ This tool helps you decode **Iroha 2** data types from binaries using [Parity Sc To build the tool, run: ```bash -cargo build --bin parity_scale_cli +cargo build --bin iroha_codec ``` ## Usage @@ -15,7 +15,7 @@ cargo build --bin parity_scale_cli Run Parity Scale Decoder Tool: ```bash -parity_scale_cli +iroha_codec ``` ### Subcommands @@ -33,7 +33,7 @@ parity_scale_cli To list all supported data types, run from the project main directory: ```bash -./target/debug/parity_scale_cli list-types +./target/debug/iroha_codec list-types ```
Expand to see expected output @@ -66,7 +66,7 @@ These commands require `--type` argument. If data type is not known, [`scale-to- * Decode the specified data type from a binary: ```bash - ./target/debug/parity_scale_cli scale-to-json --input --type + ./target/debug/iroha_codec scale-to-json --input --type ``` ### `scale-to-json` and `json-to-scale` usage examples @@ -74,13 +74,13 @@ These commands require `--type` argument. If data type is not known, [`scale-to- * Decode the `NewAccount` data type from the `samples/account.bin` binary: ```bash - ./target/debug/parity_scale_cli scale-to-json --input iroha_parity_scale_cli/samples/account.bin --type NewAccount + ./target/debug/iroha_codec scale-to-json --input iroha_codec/samples/account.bin --type NewAccount ``` * Encode the `NewAccount` data type from the `samples/account.json`: ```bash - ./target/debug/parity_scale_cli json-to-scale --input iroha_parity_scale_cli/samples/account.json --output result.bin --type NewAccount + ./target/debug/iroha_codec json-to-scale --input iroha_codec/samples/account.json --output result.bin --type NewAccount ``` ## `scale-to-rust` @@ -95,13 +95,13 @@ Decode the data type from a given binary. * Decode the specified data type from a binary: ```bash - ./target/debug/parity_scale_cli scale-to-rust --type + ./target/debug/iroha_codec scale-to-rust --type ``` * If you are not sure which data type is encoded in the binary, run the tool without the `--type` option: ```bash - ./target/debug/parity_scale_cli scale-to-rust + ./target/debug/iroha_codec scale-to-rust ``` ### `scale-to-rust` usage examples @@ -109,11 +109,11 @@ Decode the data type from a given binary. * Decode the `NewAccount` data type from the `samples/account.bin` binary: ```bash - ./target/debug/parity_scale_cli scale-to-rust iroha_parity_scale_cli/samples/account.bin --type NewAccount + ./target/debug/iroha_codec scale-to-rust iroha_codec/samples/account.bin --type NewAccount ``` * Decode the `NewDomain` data type from the `samples/domain.bin` binary: ```bash - ./target/debug/parity_scale_cli scale-to-rust iroha_parity_scale_cli/samples/domain.bin --type NewDomain + ./target/debug/iroha_codec scale-to-rust iroha_codec/samples/domain.bin --type NewDomain ``` diff --git a/iroha_parity_scale_cli/build.rs b/iroha_codec/build.rs similarity index 100% rename from iroha_parity_scale_cli/build.rs rename to iroha_codec/build.rs diff --git a/iroha_parity_scale_cli/samples/account.bin b/iroha_codec/samples/account.bin similarity index 100% rename from iroha_parity_scale_cli/samples/account.bin rename to iroha_codec/samples/account.bin diff --git a/iroha_parity_scale_cli/samples/account.json b/iroha_codec/samples/account.json similarity index 100% rename from iroha_parity_scale_cli/samples/account.json rename to iroha_codec/samples/account.json diff --git a/iroha_parity_scale_cli/samples/domain.bin b/iroha_codec/samples/domain.bin similarity index 100% rename from iroha_parity_scale_cli/samples/domain.bin rename to iroha_codec/samples/domain.bin diff --git a/iroha_parity_scale_cli/samples/domain.json b/iroha_codec/samples/domain.json similarity index 100% rename from iroha_parity_scale_cli/samples/domain.json rename to iroha_codec/samples/domain.json diff --git a/iroha_parity_scale_cli/samples/trigger.bin b/iroha_codec/samples/trigger.bin similarity index 100% rename from iroha_parity_scale_cli/samples/trigger.bin rename to iroha_codec/samples/trigger.bin diff --git a/iroha_parity_scale_cli/samples/trigger.json b/iroha_codec/samples/trigger.json similarity index 100% rename from iroha_parity_scale_cli/samples/trigger.json rename to iroha_codec/samples/trigger.json diff --git a/iroha_parity_scale_cli/src/main.rs b/iroha_codec/src/main.rs similarity index 100% rename from iroha_parity_scale_cli/src/main.rs rename to iroha_codec/src/main.rs