Skip to content

Commit

Permalink
feat: rename iroha_parity_scale_cli to iroha_codec
Browse files Browse the repository at this point in the history
Signed-off-by: Nurzhan Sakén <[email protected]>
  • Loading branch information
nxsaken committed Aug 14, 2024
1 parent 70fa00d commit 0738615
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 40 deletions.
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 1 addition & 5 deletions iroha_parity_scale_cli/Cargo.toml → iroha_codec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "iroha_parity_scale_cli"
name = "iroha_codec"

edition.workspace = true
version.workspace = true
Expand Down Expand Up @@ -38,7 +38,3 @@ eyre = { workspace = true }

[dev-dependencies]
iroha_test_samples = { workspace = true }

[[bin]]
name = "parity_scale_cli"
path = "src/main.rs"
20 changes: 10 additions & 10 deletions iroha_parity_scale_cli/README.md → iroha_codec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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

Run Parity Scale Decoder Tool:

```bash
parity_scale_cli <SUBCOMMAND>
iroha_codec <SUBCOMMAND>
```

### Subcommands
Expand All @@ -33,7 +33,7 @@ parity_scale_cli <SUBCOMMAND>
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
```

<details> <summary> Expand to see expected output</summary>
Expand Down Expand Up @@ -66,21 +66,21 @@ 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 <path_to_binary> --type <type>
./target/debug/iroha_codec scale-to-json --input <path_to_binary> --type <type>
```

### `scale-to-json` and `json-to-scale` usage examples

* 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`
Expand All @@ -95,25 +95,25 @@ 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 <path_to_binary> --type <type>
./target/debug/iroha_codec scale-to-rust <path_to_binary> --type <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 <path_to_binary>
./target/debug/iroha_codec scale-to-rust <path_to_binary>
```

### `scale-to-rust` usage examples

* 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
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0738615

Please sign in to comment.