diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 315952660f5..b0eb064ff9f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -21,7 +21,7 @@ updates: - package-ecosystem: "pip" target-branch: "main" - directory: "/client_cli/pytests/" + directory: "/bins/iroha_cli/pytests/" schedule: interval: "daily" commit-message: @@ -39,7 +39,7 @@ updates: - package-ecosystem: "cargo" target-branch: "main" - directory: "/default_executor/" + directory: "/samples" schedule: interval: "daily" commit-message: diff --git a/.github/workflows/iroha2-dev-code-quality.yml b/.github/workflows/iroha2-dev-code-quality.yml index 49501278e3b..c5bc352c5f8 100644 --- a/.github/workflows/iroha2-dev-code-quality.yml +++ b/.github/workflows/iroha2-dev-code-quality.yml @@ -57,7 +57,7 @@ jobs: LLVM_PROFILE_FILE: "iroha-%p-%m.profraw" - name: Generate lcov report if: always() - run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/client_cli" --ignore "**/main.rs" -o lcov.info + run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/bins/iroha_cli" --ignore "**/main.rs" -o lcov.info - name: Upload lcov report artifact if: always() uses: actions/upload-artifact@v4 diff --git a/.github/workflows/iroha2-dev-pr-static.yml b/.github/workflows/iroha2-dev-pr-static.yml index c987af863e1..748dd45cf09 100644 --- a/.github/workflows/iroha2-dev-pr-static.yml +++ b/.github/workflows/iroha2-dev-pr-static.yml @@ -8,7 +8,7 @@ on: - '**.json' - '**.toml' - '.github/workflows/iroha2-dev-pr-static.yml' - - 'client_cli/pytests/**/*.py' + - 'bins/iroha_cli/pytests/**/*.py' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -25,13 +25,9 @@ jobs: steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - - name: Default executor format + - name: Format executors and smart contracts run: | - cd ./default_executor - mold --run cargo fmt --all -- --check - - name: Integration tests smart contracts format - run: | - cd ./client/tests/integration/smartcontracts + cd ./samples mold --run cargo fmt --all -- --check python_static_analysis: @@ -41,7 +37,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install dependencies using Poetry for client_cli/pytests - working-directory: client_cli/pytests + working-directory: bins/iroha_cli/pytests run: | poetry lock --no-update poetry install diff --git a/.github/workflows/iroha2-dev-pr-wasm.yaml b/.github/workflows/iroha2-dev-pr-wasm.yaml index 4a9a0f35e8f..719ef08e174 100644 --- a/.github/workflows/iroha2-dev-pr-wasm.yaml +++ b/.github/workflows/iroha2-dev-pr-wasm.yaml @@ -4,15 +4,15 @@ on: pull_request: branches: [main] paths: - - 'data_model/**.rs' - - 'data_model/**.yml' - - 'data_model/**.json' - - 'data_model/**.toml' + - 'libs/iroha_data_model/**.rs' + - 'libs/iroha_data_model/**.yml' + - 'libs/iroha_data_model/**.json' + - 'libs/iroha_data_model/**.toml' - - 'smart_contract/**.rs' - - 'smart_contract/**.yml' - - 'smart_contract/**.json' - - 'smart_contract/**.toml' + - 'libs/iroha_smart_contract/**.rs' + - 'libs/iroha_smart_contract/**.yml' + - 'libs/iroha_smart_contract/**.json' + - 'libs/iroha_smart_contract/**.toml' concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/iroha2-dev-pr.yml b/.github/workflows/iroha2-dev-pr.yml index 2e74c21a4d8..1616c79c06e 100644 --- a/.github/workflows/iroha2-dev-pr.yml +++ b/.github/workflows/iroha2-dev-pr.yml @@ -105,7 +105,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Build binaries run: | - cargo build -p iroha_client_cli -p kagami -p irohad + cargo build -p iroha_cli -p kagami -p irohad - name: Setup test Iroha 2 environment on the bare metal run: | pip3 install -r scripts/requirements.txt --no-input --break-system-packages @@ -114,23 +114,23 @@ jobs: run: | chmod +x ${{ env.CLIENT_CLI_DIR }} - name: Install torii api dependencies using Poetry - working-directory: torii/pytests + working-directory: libs/iroha_torii/pytests run: | poetry install - name: Run torii api tests - working-directory: torii/pytests + working-directory: libs/iroha_torii/pytests run: | poetry run pytest - name: Install client cli dependencies using Poetry - working-directory: client_cli/pytests + working-directory: bins/iroha_cli/pytests run: | poetry install - name: Run client cli tests - working-directory: client_cli/pytests + working-directory: bins/iroha_cli/pytests env: # prepared by `test_env.py` - CLIENT_CLI_BINARY: ../../test/iroha - CLIENT_CLI_CONFIG: ../../test/client.toml + CLIENT_CLI_BINARY: ../../../test/iroha + CLIENT_CLI_CONFIG: ../../../test/client.toml run: | poetry run pytest - name: Cleanup test environment diff --git a/.gitignore b/.gitignore index 3aa0264ee2f..818c333689d 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,5 @@ result /iroha-java/ /lcov.info **/test-smartcontracts/ + +test_docker \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index f0b1f3dcde6..49a31baf16a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team [here](./CONTRIBUTING.md/?#contact-developers). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team [here](./CONTRIBUTING.md/#contacts). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 361ec66310e..dbd9112236f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,6 +33,7 @@ A *bug* is an error, design flaw, failure or fault in Iroha that causes it to pr We track Iroha bugs via [Github Issues](https://github.com/hyperledger/iroha/issues?q=is%3Aopen+is%3Aissue+label%3ABug) labeled with the `Bug` tag. When you create a new issue, there is a template for you to fill in. Here's the checklist of what you should do when you are reporting bugs: + - [ ] Add the `Bug` tag - [ ] Explain the issue - [ ] Provide a minimum working example @@ -66,6 +67,7 @@ not to be able to mint negative values --- + **Note:** Issues such as outdated documentation, insufficient documentation, or feature requests should use the `Documentation` or `Enhancement` labels. They are not bugs. --- @@ -99,9 +101,7 @@ If you intend to implement the suggestion yourself, do the following: Closes #1234 ``` -4. If your change requires an API change, use the `api-changes` tag. - - **Note:** features that require API changes may take longer to implement and approve as they require Iroha library makers to update their code. +4. If your change requires an API change, use the `api-changes` tag. **Note:** features that require API changes may take longer to implement and approve as they require Iroha library makers to update their code. ### Asking Questions @@ -111,7 +111,7 @@ A question is any discussion that is neither a bug nor a feature or optimization Please post your questions to [one of our instant messaging platforms](#contacts) so that the staff and members of the community could help you in a timely manner. -You, as part of the aforementioned community, should consider helping others too. If you decide to help, please do so in a [respectful manner](CODE_OF_CONDUCT.md). +As part of the community, consider helping others too. If you decide to help, please do so [respectfully](CODE_OF_CONDUCT.md). @@ -127,37 +127,40 @@ You, as part of the aforementioned community, should consider helping others too Please [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the [repository](https://github.com/hyperledger/iroha/tree/main) and [create a feature branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository) for your contributions. When working with **PRs from forks**, check [this manual](https://help.github.com/articles/checking-out-pull-requests-locally). -Working on code contribution: +### Working on code contribution: + - Follow the [Rust Style Guide](#rust-style-guide) and the [Documentation Style Guide](#documentation-style-guide). - Ensure that the code you've written is covered by tests. If you fixed a bug, please turn the minimum working example that reproduces the bug into a test. -Committing your work: +### Committing your work: + - Follow the [Git Style Guide](#git-workflow). - Squash your commits [either before](https://www.git-tower.com/learn/git/faq/git-squash/) or [during the merge](https://rietta.com/blog/github-merge-types/). - If during the preparation of your pull request your branch got out of date, rebase it locally with `git pull --rebase upstream main`. Alternatively, you may use the drop-down menu for the `Update branch` button and choose the `Update with rebase` option. - In the interest of making this process easier for everyone, try not to have more than a handful of commits for a pull request, and avoid re-using feature branches. +In the interest of making this process easier for everyone, try not to have more than a handful of commits for a pull request, and avoid re-using feature branches. + +### Creating a pull request: -Creating a pull request: - Use an appropriate pull request description by filling in the [description template](.github/PULL_REQUEST_TEMPLATE.md). Avoid deviating from this template if possible. - Add an appropriately formatted [pull request title](#pull-request-titles). - If you feel like your code isn't ready to merge, but you want the maintainers to look through it, create a draft pull request. -Merging your work: +### Merging your work: + - A pull request must pass all automated checks before being merged. At a minimum, the code must be formatted, passing all tests, as well as having no outstanding `clippy` lints. - A pull request cannot be merged without two approving reviews from the active maintainers. -- Each pull request will automatically notify the code owners. An up to date list of current maintainers can be found in [MAINTAINERS.md](MAINTAINERS.md). +- Each pull request will automatically notify the code owners. An up-to-date list of current maintainers can be found in [MAINTAINERS.md](MAINTAINERS.md). ### Pull Request Titles -We parse the titles of all the merged pull requests to generate changelogs. We also check that the title follows the convention via the *`check-PR-title`* check. +We parse the titles of all the merged pull requests to generate changelogs. We also check that the title follows the convention via the *`I2::Dev::Title`* check. -To pass the *`check-PR-title`* check, the pull request title must adhere to the following guidelines: +To pass the PR title check, the pull request title must adhere to the following guidelines:
Expand to read the detailed title guidelines 1. Follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#commit-message-with-multi-paragraph-body-and-multiple-footers) format. - 2. If the pull request has a single commit, the PR title should be the same as the commit message.
@@ -167,27 +170,23 @@ To pass the *`check-PR-title`* check, the pull request title must adhere to the - [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the [repository](https://github.com/hyperledger/iroha/tree/main) and [create a feature branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository) for your contributions. - [Configure the remote](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-for-a-fork) to sync your fork with the [Hyperledger Iroha repository](https://github.com/hyperledger/iroha/tree/main). - Use the [Git Rebase Workflow](https://git-rebase.io/). Avoid using `git pull`. Use `git pull --rebase` instead. -- Use the provided [git hooks](./hooks/) to ease the development process. +- Use the provided [git hooks](./hooks) to ease the development process. Follow these commit guidelines: - **Sign-off every commit**. If you don't, [DCO](https://github.com/apps/dco) will not let you merge. - - Use `git commit -s` to automatically add `Signed-off-by: $NAME <$EMAIL>` as the final line of your commit message. Your name and email should be the same as specified in your GitHub account. - - We also encourage you to sign your commits with GPG key using `git commit -sS` ([learn more](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)). - - You may use [the `commit-msg` hook](./hooks/) to automatically sign-off your commits. - + - Use `git commit -s` to automatically add `Signed-off-by: $NAME <$EMAIL>` as the final line of your commit message. Your name and email should be the same as specified in your GitHub account. + - We also encourage you to sign your commits with GPG key using `git commit -sS` ([learn more](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)). + - You may use [the `commit-msg` hook](./hooks) to automatically sign-off your commits. - Commit messages must follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#commit-message-with-multi-paragraph-body-and-multiple-footers) and the same naming schema as for [pull request titles](#pull-request-titles). This means: - **Use present tense** ("Add feature", not "Added feature") - - **Use imperative mood** ("Deploy to docker..." not "Deploys to docker...") + - **Use the imperative mood** ("Deploy to docker..." not "Deploys to docker...") - Write a meaningful commit message. -- Try keeping a commit message short. +- Try keeping the commit message short. - If you need to have a longer commit message: - - Limit the first line of your commit message to 50 characters or less. + - Limit the first line of your commit message to 50 characters or fewer. - The first line of your commit message should contain the summary of the work you've done. If you need more than one line, leave a blank line between each paragraph and describe your changes in the middle. The last line must be the sign-off. -- If you modify the Schema (check by generating the schema with `kagami schema` and diff), you should make all changes to the schema in a separate commit with the message `[schema]`. +- If you modify the Schema (check by generating the schema with `kagami schema` and diff), you should make all changes to the schema in a separate commit with the commit type `schema:`. - Try to stick to one commit per meaningful change. - If you fixed several issues in one PR, give them separate commits. - As mentioned previously, changes to the `schema` and the API should be done in appropriate commits separate from the rest of your work. @@ -227,8 +226,7 @@ In this case you should compile Iroha with support of tokio console like that: RUSTFLAGS="--cfg tokio_unstable" cargo build --features tokio-console ``` -Port for tokio console can by configured through `LOG_TOKIO_CONSOLE_ADDR` configuration parameter (or environment variable). -Using tokio console require log level to be `TRACE`, can be enabled through configuration parameter or environment variable `LOG_LEVEL`. +Port for tokio console can by configured through `LOG_TOKIO_CONSOLE_ADDR` configuration parameter (or environment variable). Using tokio console require log level to be `TRACE`, can be enabled through configuration parameter or environment variable `LOG_LEVEL`. Example of running Iroha with tokio console support using `scripts/test_env.sh`: @@ -272,8 +270,7 @@ sudo perf record -g -p sudo perf report ``` -To be able to observe profile of the executor during Iroha profiling, executor should be compiled without stripping symbols. -It can be done by running: +To be able to observe profile of the executor during Iroha profiling, executor should be compiled without stripping symbols. It can be done by running: ```bash # compile executor without optimizations @@ -309,17 +306,11 @@ Code guidelines: - Unless otherwise specified, refer to [Rust best practices](https://github.com/mre/idiomatic-rust). - Use the `mod.rs` style. [Self-named modules](https://rust-lang.github.io/rust-clippy/master/) will not pass static analysis, except as [`trybuild`](https://crates.io/crates/trybuild) tests. -- Use a domain-first modules structure. - - Example: don't do `constants::logger`. Instead, invert the hierarchy, putting the object for which it is used first: `iroha_logger::constants`. +- Use a domain-first modules structure. Example: don't do `constants::logger`. Instead, invert the hierarchy, putting the object for which it is used first: `iroha_logger::constants`. - Use [`expect`](https://learning-rust.github.io/docs/e4.unwrap_and_expect.html) with an explicit error message or proof of infallibility instead of `unwrap`. - Never ignore an error. If you can't `panic` and can't recover, it at least needs to be recorded in the log. - Prefer to return a `Result` instead of `panic!`. - - Exception: when implementing something that uses `issue_send` instead of `send` ([more about actors](docs/source/guides/actor.md)). Actors and parallelism don't mix; you could deadlock the entire peer, so it's better to `panic!` if something goes wrong. This is a necessary concession for asynchronous programming. -- Group related functionality spatially, preferably inside appropriate modules. - - For example, instead of having a block with `struct` definitions and then `impl`s for each individual struct, it is better to have the `impl`s related to that `struct` next to it. +- Group related functionality spatially, preferably inside appropriate modules. For example, instead of having a block with `struct` definitions and then `impl`s for each individual struct, it is better to have the `impl`s related to that `struct` next to it. - Declare before implementation: `use` statements and constants at the top, unit tests at the bottom. - Try to avoid `use` statements if the imported name is used only once. This makes moving your code into a different file easier. - Do not silence `clippy` lints indiscriminately. If you do, explain your reasoning with a comment (or `expect` message). @@ -331,17 +322,20 @@ Code guidelines: - Avoid tying your code to concrete data structures; `rustc` is smart enough to turn a `Vec` into `impl IntoIterator` and vice versa when it needs to. Naming guidelines: + - Use only full words in *public* structure, variable, method, trait, constant, and module names. However, abbreviations are allowed if: - - The name is local (e.g. closure arguments). - - The name is abbreviated by Rust convention (e.g. `len`, `typ`). - - The name is an accepted abbreviation (e.g. `tx`, `wsv` etc) TODO link glossary. - - The full name would have been shadowed by a local variable (e.g. `msg <- message`). - - The full name would have made the code cumbersome with more than 5-6 words in it (e.g. `WorldStateViewReceiverTrait -> WSVRecvTrait`). -- If you change naming conventions, make sure that the new name that you've chosen is _much_ clearer than what we had before. + - The name is local (e.g. closure arguments). + - The name is abbreviated by Rust convention (e.g. `len`, `typ`). + - The name is an accepted abbreviation (e.g. `tx`, `wsv`, etc.) TODO link glossary. + - The full name would have been shadowed by a local variable (e.g. `msg <- message`). + - The full name would have made the code cumbersome with more than 5-6 words in it (e.g. `WorldStateViewReceiverTrait -> WSVRecvTrait`). +- If you change naming conventions, make sure that the new name that you've chosen is + _much_ clearer than what we had before. Comment guidelines: + - When writing non-doc comments, instead of describing *what* your function does, try to explain *why* it does something in a particular way. This will save you and the reviewer time. -- You may leave `TODO` markers in code as long as you reference an issue that you created for it. Not creating an issue means it doesn't get merged. +- You may leave `TODO(#issue)` markers in code as long as you reference an issue that you created for it. Not creating an issue means it doesn't get merged. We use pinned dependencies. Follow these guidelines for versioning: @@ -355,32 +349,28 @@ We use pinned dependencies. Follow these guidelines for versioning:
:book: Read documentation guidelines - - Use the [`Rust Docs`](https://doc.rust-lang.org/cargo/commands/cargo-doc.html) format. - Prefer the single-line comment syntax. Use `///` above inline modules and `//!` for file-based modules. - If you can link to a structure/module/function's docs, do it. - If you can provide an example of usage, do it. This [is also a test](https://doc.rust-lang.org/rustdoc/documentation-tests.html). - If a function can error or panic, avoid modal verbs. Example: `Fails if disk IO fails` instead of `Can possibly fail, if disk IO happens to fail`. - If a function can error or panic for more than one reason, use a bulleted list of failure conditions, with the appropriate `Error` variants (if any). -- Functions *do* things. Use imperative mood. +- Functions *do* things. Use the imperative mood. - Structures *are* things. Get to the point. For example `Log level for reloading from the environment` is better than `This struct encapsulates the idea of logging levels, and is used for reloading from the environment`. - Structures have fields, which also *are* things. - Modules *contain* things, and we know that. Get to the point. Example: use `Logger-related traits.` instead of `Module which contains logger-related logic`. -
-## Contact +## Contacts Our community members are active at: -| Service | Link | -| ------------- | ------------------------------------------------------------ | -| RocketChat | https://chat.hyperledger.org/channel/iroha | -| StackOverflow | https://stackoverflow.com/questions/tagged/hyperledger-iroha | -| Mailing List | hyperledger-iroha@lists.hyperledger.org | -| Gitter | https://gitter.im/hyperledger-iroha/Lobby | -| Telegram | https://t.me/hl_iroha | -| YouTube | https://www.youtube.com/channel/UCYlK9OrZo9hvNYFuf0vrwww | +| Service | Link | +|--------------|--------------------------------------------------------------------| +| Mailing List | https://lists.hyperledger.org/g/iroha | +| Telegram | https://t.me/hyperledgeriroha | +| Discord | https://discord.com/channels/905194001349627914/905205848547155968 | +| YouTube | https://www.youtube.com/channel/UCYlK9OrZo9hvNYFuf0vrwww | --- diff --git a/Cargo.lock b/Cargo.lock index a34ab91c43c..c696c5f2bd8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1651,17 +1651,6 @@ dependencies = [ "rustc_version", ] -[[package]] -name = "executor_custom_data_model" -version = "2.0.0-pre-rc.21" -dependencies = [ - "iroha_data_model", - "iroha_executor_data_model", - "iroha_schema", - "serde", - "serde_json", -] - [[package]] name = "expect-test" version = "1.5.0" @@ -2875,7 +2864,6 @@ dependencies = [ "derive_more", "displaydoc", "error-stack", - "executor_custom_data_model", "eyre", "futures-util", "hex", @@ -2884,11 +2872,14 @@ dependencies = [ "iroha_config_base", "iroha_crypto", "iroha_data_model", + "iroha_executor_custom_data_model", "iroha_executor_data_model", "iroha_genesis", "iroha_logger", "iroha_primitives", "iroha_telemetry", + "iroha_test_network", + "iroha_test_samples", "iroha_torii_const", "iroha_version", "iroha_wasm_builder", @@ -2901,8 +2892,6 @@ dependencies = [ "serde_json", "serde_with", "tempfile", - "test_network", - "test_samples", "thiserror", "tokio", "tokio-tungstenite", @@ -2915,7 +2904,7 @@ dependencies = [ ] [[package]] -name = "iroha_client_cli" +name = "iroha_cli" version = "2.0.0-pre-rc.21" dependencies = [ "clap", @@ -3025,6 +3014,7 @@ dependencies = [ "iroha_p2p", "iroha_primitives", "iroha_telemetry", + "iroha_test_samples", "iroha_version", "iroha_wasm_codec", "nonzero_ext", @@ -3036,7 +3026,6 @@ dependencies = [ "serde_json", "storage", "tempfile", - "test_samples", "thiserror", "tokio", "uuid", @@ -3170,6 +3159,17 @@ dependencies = [ "serde_json", ] +[[package]] +name = "iroha_executor_custom_data_model" +version = "2.0.0-pre-rc.21" +dependencies = [ + "iroha_data_model", + "iroha_executor_data_model", + "iroha_schema", + "serde", + "serde_json", +] + [[package]] name = "iroha_executor_data_model" version = "2.0.0-pre-rc.21" @@ -3266,11 +3266,11 @@ dependencies = [ "iroha_crypto", "iroha_data_model", "iroha_schema", + "iroha_test_samples", "once_cell", "parity-scale-codec", "serde", "serde_json", - "test_samples", "tracing", ] @@ -3344,9 +3344,9 @@ dependencies = [ "iroha_data_model", "iroha_logger", "iroha_primitives", + "iroha_test_network", "parity-scale-codec", "rand", - "test_network", "thiserror", "tokio", ] @@ -3431,8 +3431,8 @@ dependencies = [ "iroha_macro", "iroha_smart_contract_derive", "iroha_smart_contract_utils", + "iroha_test_samples", "parity-scale-codec", - "test_samples", "trybuild", "webassembly-test", ] @@ -3520,6 +3520,42 @@ dependencies = [ "trybuild", ] +[[package]] +name = "iroha_test_network" +version = "2.0.0-pre-rc.21" +dependencies = [ + "eyre", + "futures", + "iroha", + "iroha_config", + "iroha_core", + "iroha_crypto", + "iroha_data_model", + "iroha_executor_data_model", + "iroha_genesis", + "iroha_logger", + "iroha_primitives", + "iroha_test_samples", + "irohad", + "parity-scale-codec", + "rand", + "serde_json", + "tempfile", + "tokio", + "unique_port", +] + +[[package]] +name = "iroha_test_samples" +version = "2.0.0-pre-rc.21" +dependencies = [ + "iroha_crypto", + "iroha_data_model", + "once_cell", + "serde", + "toml 0.8.14", +] + [[package]] name = "iroha_torii" version = "2.0.0-pre-rc.21" @@ -3810,10 +3846,10 @@ dependencies = [ "iroha_genesis", "iroha_primitives", "iroha_schema_gen", + "iroha_test_samples", "parity-scale-codec", "serde", "serde_json", - "test_samples", ] [[package]] @@ -4343,12 +4379,12 @@ dependencies = [ "iroha_primitives", "iroha_schema", "iroha_schema_gen", + "iroha_test_samples", "iroha_version", "parity-scale-codec", "serde", "serde_json", "supports-color 2.1.0", - "test_samples", ] [[package]] @@ -5742,42 +5778,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "test_network" -version = "2.0.0-pre-rc.21" -dependencies = [ - "eyre", - "futures", - "iroha", - "iroha_config", - "iroha_core", - "iroha_crypto", - "iroha_data_model", - "iroha_executor_data_model", - "iroha_genesis", - "iroha_logger", - "iroha_primitives", - "irohad", - "parity-scale-codec", - "rand", - "serde_json", - "tempfile", - "test_samples", - "tokio", - "unique_port", -] - -[[package]] -name = "test_samples" -version = "2.0.0-pre-rc.21" -dependencies = [ - "iroha_crypto", - "iroha_data_model", - "once_cell", - "serde", - "toml 0.8.14", -] - [[package]] name = "thiserror" version = "1.0.62" diff --git a/Cargo.toml b/Cargo.toml index 2e73e3b3309..fcf28cb4c4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,41 +14,41 @@ keywords = ["blockchain", "crypto", "iroha", "ledger"] categories = ["cryptography::cryptocurrencies"] [workspace.dependencies] -iroha_core = { version = "=2.0.0-pre-rc.21 ", path = "core" } - -irohad = { version = "=2.0.0-pre-rc.21", path = "cli" } -iroha_torii = { version = "=2.0.0-pre-rc.21", path = "torii" } -iroha_torii_const = { version = "=2.0.0-pre-rc.21", path = "torii/const" } - -iroha = { version = "=2.0.0-pre-rc.21", path = "client" } - -iroha_macro_utils = { version = "=2.0.0-pre-rc.21", path = "macro/utils" } -iroha_telemetry = { version = "=2.0.0-pre-rc.21", path = "telemetry" } -iroha_p2p = { version = "=2.0.0-pre-rc.21", path = "p2p" } -iroha_primitives = { version = "=2.0.0-pre-rc.21", path = "primitives", default-features = false } -iroha_data_model = { version = "=2.0.0-pre-rc.21", path = "data_model", default-features = false } -iroha_config = { version = "=2.0.0-pre-rc.21", path = "config" } -iroha_config_base = { version = "=2.0.0-pre-rc.21", path = "config/base" } -iroha_schema_gen = { version = "=2.0.0-pre-rc.21", path = "schema/gen" } -iroha_schema = { version = "=2.0.0-pre-rc.21", path = "schema", default-features = false } -iroha_logger = { version = "=2.0.0-pre-rc.21", path = "logger" } -iroha_crypto = { version = "=2.0.0-pre-rc.21", path = "crypto", default-features = false } -iroha_macro = { version = "=2.0.0-pre-rc.21", path = "macro", default-features = false } -iroha_futures = { version = "=2.0.0-pre-rc.21", path = "futures" } -iroha_genesis = { version = "=2.0.0-pre-rc.21", path = "genesis" } -iroha_ffi = { version = "=2.0.0-pre-rc.21", path = "ffi" } -iroha_version = { version = "=2.0.0-pre-rc.21", path = "version", default-features = false } -iroha_wasm_codec = { version = "=2.0.0-pre-rc.21", path = "wasm_codec" } -iroha_wasm_builder = { version = "=2.0.0-pre-rc.21", path = "wasm_builder" } - -iroha_smart_contract = { version = "=2.0.0-pre-rc.21", path = "smart_contract" } -iroha_smart_contract_utils = { version = "=2.0.0-pre-rc.21", path = "smart_contract/utils" } - -iroha_executor = { version = "=2.0.0-pre-rc.21", path = "smart_contract/executor" } -iroha_executor_data_model = { version = "=2.0.0-pre-rc.21", path = "smart_contract/executor/data_model" } - -test_network = { version = "=2.0.0-pre-rc.21", path = "core/test_network" } -test_samples = { version = "=2.0.0-pre-rc.21", path = "test_samples" } +iroha_core = { version = "=2.0.0-pre-rc.21 ", path = "libs/iroha_core" } + +irohad = { version = "=2.0.0-pre-rc.21", path = "bins/irohad" } +iroha_torii = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_torii" } +iroha_torii_const = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_torii/const" } + +iroha = { version = "=2.0.0-pre-rc.21", path = "libs/iroha" } + +iroha_macro_utils = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_macro/utils" } +iroha_telemetry = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_telemetry" } +iroha_p2p = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_p2p" } +iroha_primitives = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_primitives", default-features = false } +iroha_data_model = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_data_model", default-features = false } +iroha_config = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_config" } +iroha_config_base = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_config/base" } +iroha_schema_gen = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_schema/gen" } +iroha_schema = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_schema", default-features = false } +iroha_logger = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_logger" } +iroha_crypto = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_crypto", default-features = false } +iroha_macro = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_macro", default-features = false } +iroha_futures = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_futures" } +iroha_genesis = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_genesis" } +iroha_ffi = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_ffi" } +iroha_version = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_version", default-features = false } +iroha_wasm_codec = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_wasm_codec" } +iroha_wasm_builder = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_wasm_builder" } + +iroha_smart_contract = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_smart_contract" } +iroha_smart_contract_utils = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_smart_contract/utils" } + +iroha_executor = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_executor" } +iroha_executor_data_model = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_executor/data_model" } + +iroha_test_network = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_core/iroha_test_network" } +iroha_test_samples = { version = "=2.0.0-pre-rc.21", path = "libs/iroha_test_samples" } proc-macro2 = "1.0.86" syn = { version = "2.0.71", default-features = false } @@ -92,6 +92,7 @@ criterion = "0.5.1" expect-test = "1.5.0" assertables = "7" +anyhow = { version = "1.0.86", default-features = false } eyre = "0.6.12" color-eyre = "0.6.3" thiserror = { version = "1.0.62", default-features = false } @@ -105,12 +106,14 @@ strum = { version = "0.25.0", default-features = false } getset = "0.1.2" hex-literal = "0.4.1" +getrandom = { version = "0.2.15", features = ["custom"] } rand = { version = "0.8.5", default-features = false, features = ["getrandom", "alloc"] } axum = { version = "0.7.5", default-features = false } wasmtime = "15.0.1" tracing = { version = "0.1.40", features = ["log"] } tracing-subscriber = { version = "0.3.18", default-features = false } +tracing-flame = "0.2.0" dashmap = "5.5.3" rustc-hash = "1.1.0" @@ -193,65 +196,55 @@ clippy.wildcard_dependencies = "deny" [workspace] resolver = "2" members = [ - "cli", - "client", - "client_cli", - "config", - "config/base", - "core", - "core/test_network", - "crypto", - "data_model", - "genesis", - - "logger", - "p2p", - - "futures", - "futures/derive", - - "primitives", - "primitives/derive", - "primitives/numeric", - - "ffi", - "ffi/derive", - - "schema", - "schema/gen", - "schema/derive", - - "smart_contract", - "smart_contract/derive", - "smart_contract/utils", - - "smart_contract/trigger", - "smart_contract/trigger/derive", - - "smart_contract/executor", - "smart_contract/executor/derive", - "smart_contract/executor/data_model", - "smart_contract/executor/data_model/derive", - - "telemetry", - "test_samples", - - "tools/swarm", - "tools/kagami", - "tools/kura_inspector", - "tools/parity_scale_cli", - "tools/wasm_builder_cli", - "tools/wasm_test_runner", - - "torii", - "torii/const", - - "version", - "version/derive", - - "wasm_codec", - "wasm_codec/derive", - "wasm_builder", + "libs/iroha", + "libs/iroha_config", + "libs/iroha_config/base", + "libs/iroha_core", + "libs/iroha_core/iroha_test_network", + "libs/iroha_crypto", + "libs/iroha_data_model", + "libs/iroha_genesis", + "libs/iroha_logger", + "libs/iroha_p2p", + "libs/iroha_futures", + "libs/iroha_futures/derive", + "libs/iroha_primitives", + "libs/iroha_primitives/derive", + "libs/iroha_primitives/numeric", + "libs/iroha_ffi", + "libs/iroha_ffi/derive", + "libs/iroha_schema", + "libs/iroha_schema/gen", + "libs/iroha_schema/derive", + "libs/iroha_smart_contract", + "libs/iroha_smart_contract/derive", + "libs/iroha_smart_contract/utils", + "libs/iroha_trigger", + "libs/iroha_trigger/derive", + "libs/iroha_executor", + "libs/iroha_executor/derive", + "libs/iroha_executor/data_model", + "libs/iroha_executor/data_model/derive", + "libs/iroha_telemetry", + "libs/iroha_test_samples", + "libs/iroha_torii", + "libs/iroha_torii/const", + "libs/iroha_version", + "libs/iroha_version/derive", + "libs/iroha_wasm_codec", + "libs/iroha_wasm_codec/derive", + "libs/iroha_wasm_builder", + "bins/irohad", + "bins/iroha_cli", + "bins/iroha_swarm", + "bins/kagami", + "bins/kura_inspector", + "bins/parity_scale_cli", + "bins/iroha_wasm_builder_cli", + "bins/iroha_wasm_test_runner", +] +exclude = [ + "samples", ] [profile.deploy] diff --git a/Dockerfile b/Dockerfile index 4623e1aba5f..25878ea632e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ WORKDIR /iroha COPY . . RUN cargo build \ -p irohad \ - -p iroha_client_cli \ + -p iroha_cli \ -p kagami \ --target x86_64-unknown-linux-musl \ --profile deploy diff --git a/README.md b/README.md index 11d8cfb1c72..7be298ab4fa 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Iroha offers: Engage with the community: - [Contribute](./CONTRIBUTING.md) to the repository -- [Contact us](./CONTRIBUTING.md#contact) to get help +- [Contact us](./CONTRIBUTING.md#contacts) to get help ## System Requirements @@ -93,7 +93,7 @@ To generate WASM files for smart contracts, use the provided script `generate_wa bash ./scripts/generate_wasm.sh [path/to/smartcontracts] ``` -The generated WASM files will be saved in a generated directory `test-smartcontracts`, relative to your current working directory. The default path for smart contracts in this project is `client/tests/integration/smartcontracts`. +The generated WASM files will be saved in a generated directory `test-smartcontracts`, relative to your current working directory. The default path for smart contracts in this project is `samples/smart_contracts`, and `samples/executors` for executors. @@ -108,7 +108,7 @@ The generated WASM files will be saved in a generated directory `test-smartcontr - (Optional) Build the latest Iroha image: ```bash - docker build . -t hyperledger/iroha2:dev + docker build . -t hyperledger/iroha:dev ``` If you skip this step, the Iroha container will be built using the latest available image. @@ -121,7 +121,7 @@ Once you have built Iroha, you can instantiate the minimum viable network: docker compose up ``` -With the `docker-compose` instance running, use [Iroha Client CLI](./client_cli/README.md): +With the `docker compose` instance running, use [Iroha Client CLI](./bins/iroha_cli/README.md): ```bash cargo run --bin iroha -- --config ./configs/swarm/client.toml @@ -131,21 +131,21 @@ cargo run --bin iroha -- --config ./configs/swarm/client.toml Iroha project mainly consists of the following crates: -* [`iroha`](client) provides a library for building clients that communicate with peers. -* [`irohad`](server cli) is the command-line application for deploying an Iroha peer. Contains the routing table and definitions of API endpoints. -* [`iroha_client_cli`](client cli) is the reference implementation of a client. -* [`iroha_core`](core) is the primary library used by all other crates, including the peer endpoint management. -* [`iroha_config`](config) handles configuration and documentation generation for options and run-time changes. -* [`iroha_crypto`](crypto) defines cryptographic aspects of Iroha. -* [`kagami`](tools/kagami) is used to generate cryptographic keys, default genesis, configuration reference, and schema. -* [`iroha_data_model`](data_model) defines common data models in Iroha. -* [`iroha_futures`](futures) is used for `async` programming. -* [`iroha_logger`](logger) uses `tracing` to provide logging facilities. -* [`iroha_macro`](macro) provides the convenience macros. -* [`iroha_p2p`](p2p) defines peer creation and handshake logic. -* [`iroha_default_executor`](default_executor) defines runtime validation logic. -* [`iroha_telemetry`](telemetry) is used for monitoring and analysis of telemetry data. -* [`iroha_version`](version) provides message versioning for non-simultaneous system updates. +* [`iroha`](libs/iroha) provides a library for building clients that communicate with peers. +* [`irohad`](bins/irohad) is the command-line application for deploying an Iroha peer. Contains the routing table and definitions of API endpoints. +* [`iroha_cli`](bins/iroha_cli) is the reference implementation of a client. +* [`iroha_core`](libs/iroha_core) is the primary library used by all other crates, including the peer endpoint management. +* [`iroha_config`](libs/iroha_config) handles configuration and documentation generation for options and run-time changes. +* [`iroha_crypto`](libs/iroha_crypto) defines cryptographic aspects of Iroha. +* [`kagami`](bins/kagami) is used to generate cryptographic keys, default genesis, configuration reference, and schema. +* [`iroha_data_model`](libs/iroha_data_model) defines common data models in Iroha. +* [`iroha_futures`](libs/iroha_futures) is used for `async` programming. +* [`iroha_logger`](libs/iroha_logger) uses `tracing` to provide logging facilities. +* [`iroha_macro`](libs/iroha_macro) provides the convenience macros. +* [`iroha_p2p`](libs/iroha_p2p) defines peer creation and handshake logic. +* [`iroha_default_executor`](samples/executors/default) defines runtime validation logic. +* [`iroha_telemetry`](libs/iroha_telemetry) is used for monitoring and analysis of telemetry data. +* [`iroha_version`](libs/iroha_version) provides message versioning for non-simultaneous system updates. ## Maintenance @@ -197,7 +197,7 @@ Output goes to `/dev/stdout`. Piping to files or [log rotation](https://www.comm The details of the `Health` endpoint can be found in the [API Reference > Torii Endpoints](https://hyperledger.github.io/iroha-2-docs/api/torii-endpoints#health). -Iroha can produce both JSON-formatted as well as `prometheus`-readable metrics at the `status` and `metrics` endpoints respectively. +Iroha can produce both JSON-formatted and `prometheus`-readable metrics at the `status` and `metrics` endpoints respectively. The [`prometheus`](https://prometheus.io/docs/introduction/overview/) monitoring system is the de-factor standard for monitoring long-running services such as an Iroha peer. In order to get started, [install `prometheus`](https://prometheus.io/docs/introduction/first_steps/) and use `configs/prometheus.template.yml` for configuration. @@ -211,18 +211,18 @@ Iroha stores blocks and snapshots in the `storage` directory, which is created a Multiple instances of Iroha peer and client binaries can be run on the same physical machine and in the same working directory. However, we recommend to give each instance a clean new working directory. -The provided `docker-compose` file showcases a minimum viable network and the general methods of using the `hyperledger/iroha2:dev` docker image for deploying a network of peers. +The provided `docker-compose` file showcases a minimum viable network and the general methods of using the `hyperledger/iroha:dev` docker image for deploying a network of peers. ## Further Reading -We encourage you to check out our [Iroha 2 Tutorial](https://hyperledger.github.io/iroha-2-docs/) first. It is suitable for both experienced developers and prospective users of Iroha 2, and it provides language-specific guides for Bash, Python, Rust, Kotlin/Java, and Javascript/TypeScript. +We encourage you to check out our [Iroha Tutorial](https://hyperledger.github.io/iroha-2-docs/) first. It is suitable for both experienced developers and prospective users of Iroha, and it provides language-specific guides for Bash, Python, Rust, Kotlin/Java, and Javascript/TypeScript. -* [Iroha 2 Documentation](https://hyperledger.github.io/iroha-2-docs/) +* [Iroha Documentation](https://hyperledger.github.io/iroha-2-docs/) * [Glossary](https://hyperledger.github.io/iroha-2-docs/guide/glossary) * [Iroha Special Instructions](https://hyperledger.github.io/iroha-2-docs/guide/blockchain/instructions) * [API Reference](https://hyperledger.github.io/iroha-2-docs/api/torii-endpoints) -* [Iroha 2 Whitepaper](./docs/source/iroha_2_whitepaper.md) +* [Iroha Whitepaper](./docs/source/iroha_2_whitepaper.md) Iroha SDKs: diff --git a/client_cli/.gitignore b/bins/iroha_cli/.gitignore similarity index 100% rename from client_cli/.gitignore rename to bins/iroha_cli/.gitignore diff --git a/client_cli/Cargo.toml b/bins/iroha_cli/Cargo.toml similarity index 66% rename from client_cli/Cargo.toml rename to bins/iroha_cli/Cargo.toml index ea49de44b9a..8d324fed8b7 100644 --- a/client_cli/Cargo.toml +++ b/bins/iroha_cli/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "iroha_client_cli" +name = "iroha_cli" edition.workspace = true version.workspace = true @@ -27,20 +27,20 @@ name = "iroha" path = "src/main.rs" [dependencies] -iroha = { workspace = true } -iroha_primitives = { workspace = true } -iroha_config_base = { workspace = true } +iroha.workspace = true +iroha_primitives.workspace = true +iroha_config_base.workspace = true -thiserror = { workspace = true } +thiserror.workspace = true error-stack = { workspace = true, features = ["eyre"] } -eyre = { workspace = true } +eyre.workspace = true clap = { workspace = true, features = ["derive"] } -json5 = { workspace = true } -once_cell = { workspace = true } -serde_json = { workspace = true } +json5.workspace = true +once_cell.workspace = true +serde_json.workspace = true erased-serde = "0.4.5" -supports-color = { workspace = true } +supports-color.workspace = true [build-dependencies] -vergen = { version = "8.3.1", default-features = false } -color-eyre = "0.6.3" +vergen.workspace = true +color-eyre.workspace = true diff --git a/client_cli/README.md b/bins/iroha_cli/README.md similarity index 100% rename from client_cli/README.md rename to bins/iroha_cli/README.md diff --git a/client_cli/build.rs b/bins/iroha_cli/build.rs similarity index 100% rename from client_cli/build.rs rename to bins/iroha_cli/build.rs diff --git a/client_cli/pytests/.gitignore b/bins/iroha_cli/pytests/.gitignore similarity index 100% rename from client_cli/pytests/.gitignore rename to bins/iroha_cli/pytests/.gitignore diff --git a/client_cli/pytests/README.md b/bins/iroha_cli/pytests/README.md similarity index 94% rename from client_cli/pytests/README.md rename to bins/iroha_cli/pytests/README.md index 4fc3cf60adb..d3a363e852b 100644 --- a/client_cli/pytests/README.md +++ b/bins/iroha_cli/pytests/README.md @@ -50,7 +50,7 @@ The test model has the following structure: > However, it is possible to run the tests in a custom environment, e.g., with Docker Compose. > For instructions on how to do so, see [Custom Test Environment with Docker Compose](#custom-test-environment-with-docker-compose). -1. Set up a test environment using the [`test_env.py`](../../scripts/test_env.py) script: +1. Set up a test environment using the [`test_env.py`](../../../scripts/test_env.py) script: ```shell # Must be executed from the repo root: @@ -66,7 +66,7 @@ The test model has the following structure: 3. Configure the tests by creating the following `.env` file in _this_ (`/client_cli/pytests/`) directory: ```shell - CLIENT_CLI_BINARY=/path/to/iroha_client_cli + CLIENT_CLI_BINARY=/path/to/iroha_cli CLIENT_CLI_CONFIG=/path/to/client.toml TORII_API_PORT_MIN=8080 TORII_API_PORT_MAX=8083 @@ -88,7 +88,7 @@ The test model has the following structure: ### Custom Test Environment with Docker Compose -By default, we provide the [`test_env.py`](../../scripts/test_env.py) script to set up a test environment. This environment is composed of a running network of Iroha peers and an Iroha client configuration to interact with it. +By default, we provide the [`test_env.py`](../../../scripts/test_env.py) script to set up a test environment. This environment is composed of a running network of Iroha peers and an Iroha client configuration to interact with it. However, if for any reason this approach is inconvenient, it is possible to set up a custom network of Iroha peers using the provided Docker Compose configurations. @@ -164,7 +164,7 @@ The variables: **Example**: ```shell -CLIENT_CLI_BINARY=/path/to/iroha_client_cli +CLIENT_CLI_BINARY=/path/to/iroha_cli CLIENT_CLI_CONFIG=/path/to/client.toml TORII_API_PORT_MIN=8080 TORII_API_PORT_MAX=8083 diff --git a/client_cli/pytests/common/__init__.py b/bins/iroha_cli/pytests/common/__init__.py similarity index 100% rename from client_cli/pytests/common/__init__.py rename to bins/iroha_cli/pytests/common/__init__.py diff --git a/client_cli/pytests/common/consts.py b/bins/iroha_cli/pytests/common/consts.py similarity index 100% rename from client_cli/pytests/common/consts.py rename to bins/iroha_cli/pytests/common/consts.py diff --git a/client_cli/pytests/common/helpers.py b/bins/iroha_cli/pytests/common/helpers.py similarity index 100% rename from client_cli/pytests/common/helpers.py rename to bins/iroha_cli/pytests/common/helpers.py diff --git a/client_cli/pytests/common/json_isi_examples/unregister_asset.json b/bins/iroha_cli/pytests/common/json_isi_examples/unregister_asset.json similarity index 100% rename from client_cli/pytests/common/json_isi_examples/unregister_asset.json rename to bins/iroha_cli/pytests/common/json_isi_examples/unregister_asset.json diff --git a/client_cli/pytests/common/settings.py b/bins/iroha_cli/pytests/common/settings.py similarity index 100% rename from client_cli/pytests/common/settings.py rename to bins/iroha_cli/pytests/common/settings.py diff --git a/client_cli/pytests/models/__init__.py b/bins/iroha_cli/pytests/models/__init__.py similarity index 100% rename from client_cli/pytests/models/__init__.py rename to bins/iroha_cli/pytests/models/__init__.py diff --git a/client_cli/pytests/models/account.py b/bins/iroha_cli/pytests/models/account.py similarity index 100% rename from client_cli/pytests/models/account.py rename to bins/iroha_cli/pytests/models/account.py diff --git a/client_cli/pytests/models/asset.py b/bins/iroha_cli/pytests/models/asset.py similarity index 100% rename from client_cli/pytests/models/asset.py rename to bins/iroha_cli/pytests/models/asset.py diff --git a/client_cli/pytests/models/domain.py b/bins/iroha_cli/pytests/models/domain.py similarity index 100% rename from client_cli/pytests/models/domain.py rename to bins/iroha_cli/pytests/models/domain.py diff --git a/client_cli/pytests/poetry.lock b/bins/iroha_cli/pytests/poetry.lock similarity index 100% rename from client_cli/pytests/poetry.lock rename to bins/iroha_cli/pytests/poetry.lock diff --git a/client_cli/pytests/pyproject.toml b/bins/iroha_cli/pytests/pyproject.toml similarity index 100% rename from client_cli/pytests/pyproject.toml rename to bins/iroha_cli/pytests/pyproject.toml diff --git a/client_cli/pytests/src/__init__.py b/bins/iroha_cli/pytests/src/__init__.py similarity index 100% rename from client_cli/pytests/src/__init__.py rename to bins/iroha_cli/pytests/src/__init__.py diff --git a/client_cli/pytests/src/client_cli/__init__.py b/bins/iroha_cli/pytests/src/client_cli/__init__.py similarity index 100% rename from client_cli/pytests/src/client_cli/__init__.py rename to bins/iroha_cli/pytests/src/client_cli/__init__.py diff --git a/client_cli/pytests/src/client_cli/client_cli.py b/bins/iroha_cli/pytests/src/client_cli/client_cli.py similarity index 100% rename from client_cli/pytests/src/client_cli/client_cli.py rename to bins/iroha_cli/pytests/src/client_cli/client_cli.py diff --git a/client_cli/pytests/src/client_cli/configuration.py b/bins/iroha_cli/pytests/src/client_cli/configuration.py similarity index 100% rename from client_cli/pytests/src/client_cli/configuration.py rename to bins/iroha_cli/pytests/src/client_cli/configuration.py diff --git a/client_cli/pytests/src/client_cli/have.py b/bins/iroha_cli/pytests/src/client_cli/have.py similarity index 100% rename from client_cli/pytests/src/client_cli/have.py rename to bins/iroha_cli/pytests/src/client_cli/have.py diff --git a/client_cli/pytests/src/client_cli/iroha.py b/bins/iroha_cli/pytests/src/client_cli/iroha.py similarity index 100% rename from client_cli/pytests/src/client_cli/iroha.py rename to bins/iroha_cli/pytests/src/client_cli/iroha.py diff --git a/client_cli/pytests/src/client_cli/match.py b/bins/iroha_cli/pytests/src/client_cli/match.py similarity index 100% rename from client_cli/pytests/src/client_cli/match.py rename to bins/iroha_cli/pytests/src/client_cli/match.py diff --git a/client_cli/pytests/test/__init__.py b/bins/iroha_cli/pytests/test/__init__.py similarity index 100% rename from client_cli/pytests/test/__init__.py rename to bins/iroha_cli/pytests/test/__init__.py diff --git a/client_cli/pytests/test/accounts/conftest.py b/bins/iroha_cli/pytests/test/accounts/conftest.py similarity index 100% rename from client_cli/pytests/test/accounts/conftest.py rename to bins/iroha_cli/pytests/test/accounts/conftest.py diff --git a/client_cli/pytests/test/accounts/test_accounts_query_filters.py b/bins/iroha_cli/pytests/test/accounts/test_accounts_query_filters.py similarity index 100% rename from client_cli/pytests/test/accounts/test_accounts_query_filters.py rename to bins/iroha_cli/pytests/test/accounts/test_accounts_query_filters.py diff --git a/client_cli/pytests/test/accounts/test_register_accounts.py b/bins/iroha_cli/pytests/test/accounts/test_register_accounts.py similarity index 100% rename from client_cli/pytests/test/accounts/test_register_accounts.py rename to bins/iroha_cli/pytests/test/accounts/test_register_accounts.py diff --git a/client_cli/pytests/test/assets/conftest.py b/bins/iroha_cli/pytests/test/assets/conftest.py similarity index 100% rename from client_cli/pytests/test/assets/conftest.py rename to bins/iroha_cli/pytests/test/assets/conftest.py diff --git a/client_cli/pytests/test/assets/test_assets_query_filters.py b/bins/iroha_cli/pytests/test/assets/test_assets_query_filters.py similarity index 100% rename from client_cli/pytests/test/assets/test_assets_query_filters.py rename to bins/iroha_cli/pytests/test/assets/test_assets_query_filters.py diff --git a/client_cli/pytests/test/assets/test_burn_assets.py b/bins/iroha_cli/pytests/test/assets/test_burn_assets.py similarity index 100% rename from client_cli/pytests/test/assets/test_burn_assets.py rename to bins/iroha_cli/pytests/test/assets/test_burn_assets.py diff --git a/client_cli/pytests/test/assets/test_mint_assets.py b/bins/iroha_cli/pytests/test/assets/test_mint_assets.py similarity index 100% rename from client_cli/pytests/test/assets/test_mint_assets.py rename to bins/iroha_cli/pytests/test/assets/test_mint_assets.py diff --git a/client_cli/pytests/test/assets/test_register_asset_definitions.py b/bins/iroha_cli/pytests/test/assets/test_register_asset_definitions.py similarity index 100% rename from client_cli/pytests/test/assets/test_register_asset_definitions.py rename to bins/iroha_cli/pytests/test/assets/test_register_asset_definitions.py diff --git a/client_cli/pytests/test/assets/test_transfer_assets.py b/bins/iroha_cli/pytests/test/assets/test_transfer_assets.py similarity index 100% rename from client_cli/pytests/test/assets/test_transfer_assets.py rename to bins/iroha_cli/pytests/test/assets/test_transfer_assets.py diff --git a/client_cli/pytests/test/assets/test_unregister_asset.py b/bins/iroha_cli/pytests/test/assets/test_unregister_asset.py similarity index 100% rename from client_cli/pytests/test/assets/test_unregister_asset.py rename to bins/iroha_cli/pytests/test/assets/test_unregister_asset.py diff --git a/client_cli/pytests/test/atomicity/conftest.py b/bins/iroha_cli/pytests/test/atomicity/conftest.py similarity index 100% rename from client_cli/pytests/test/atomicity/conftest.py rename to bins/iroha_cli/pytests/test/atomicity/conftest.py diff --git a/client_cli/pytests/test/atomicity/test_multiple_instructions_within_transaction.py b/bins/iroha_cli/pytests/test/atomicity/test_multiple_instructions_within_transaction.py similarity index 100% rename from client_cli/pytests/test/atomicity/test_multiple_instructions_within_transaction.py rename to bins/iroha_cli/pytests/test/atomicity/test_multiple_instructions_within_transaction.py diff --git a/client_cli/pytests/test/atomicity/test_pair_instructions_within_transaction.py b/bins/iroha_cli/pytests/test/atomicity/test_pair_instructions_within_transaction.py similarity index 100% rename from client_cli/pytests/test/atomicity/test_pair_instructions_within_transaction.py rename to bins/iroha_cli/pytests/test/atomicity/test_pair_instructions_within_transaction.py diff --git a/client_cli/pytests/test/atomicity/test_wrong_instructions_within_transaction.py b/bins/iroha_cli/pytests/test/atomicity/test_wrong_instructions_within_transaction.py similarity index 100% rename from client_cli/pytests/test/atomicity/test_wrong_instructions_within_transaction.py rename to bins/iroha_cli/pytests/test/atomicity/test_wrong_instructions_within_transaction.py diff --git a/client_cli/pytests/test/conftest.py b/bins/iroha_cli/pytests/test/conftest.py similarity index 100% rename from client_cli/pytests/test/conftest.py rename to bins/iroha_cli/pytests/test/conftest.py diff --git a/client_cli/pytests/test/domains/conftest.py b/bins/iroha_cli/pytests/test/domains/conftest.py similarity index 100% rename from client_cli/pytests/test/domains/conftest.py rename to bins/iroha_cli/pytests/test/domains/conftest.py diff --git a/client_cli/pytests/test/domains/test_domains_query_filters.py b/bins/iroha_cli/pytests/test/domains/test_domains_query_filters.py similarity index 100% rename from client_cli/pytests/test/domains/test_domains_query_filters.py rename to bins/iroha_cli/pytests/test/domains/test_domains_query_filters.py diff --git a/client_cli/pytests/test/domains/test_register_domains.py b/bins/iroha_cli/pytests/test/domains/test_register_domains.py similarity index 100% rename from client_cli/pytests/test/domains/test_register_domains.py rename to bins/iroha_cli/pytests/test/domains/test_register_domains.py diff --git a/client_cli/pytests/test/domains/test_transfer_domains.py b/bins/iroha_cli/pytests/test/domains/test_transfer_domains.py similarity index 100% rename from client_cli/pytests/test/domains/test_transfer_domains.py rename to bins/iroha_cli/pytests/test/domains/test_transfer_domains.py diff --git a/client_cli/pytests/test/triggers/conftest.py b/bins/iroha_cli/pytests/test/triggers/conftest.py similarity index 100% rename from client_cli/pytests/test/triggers/conftest.py rename to bins/iroha_cli/pytests/test/triggers/conftest.py diff --git a/client_cli/pytests/test/triggers/test_register_trigger.py b/bins/iroha_cli/pytests/test/triggers/test_register_trigger.py similarity index 100% rename from client_cli/pytests/test/triggers/test_register_trigger.py rename to bins/iroha_cli/pytests/test/triggers/test_register_trigger.py diff --git a/client_cli/src/main.rs b/bins/iroha_cli/src/main.rs similarity index 100% rename from client_cli/src/main.rs rename to bins/iroha_cli/src/main.rs diff --git a/tools/swarm/Cargo.toml b/bins/iroha_swarm/Cargo.toml similarity index 100% rename from tools/swarm/Cargo.toml rename to bins/iroha_swarm/Cargo.toml diff --git a/tools/swarm/README.md b/bins/iroha_swarm/README.md similarity index 100% rename from tools/swarm/README.md rename to bins/iroha_swarm/README.md diff --git a/tools/swarm/src/bin/cli.rs b/bins/iroha_swarm/src/bin/cli.rs similarity index 100% rename from tools/swarm/src/bin/cli.rs rename to bins/iroha_swarm/src/bin/cli.rs diff --git a/tools/swarm/src/lib.rs b/bins/iroha_swarm/src/lib.rs similarity index 100% rename from tools/swarm/src/lib.rs rename to bins/iroha_swarm/src/lib.rs diff --git a/tools/swarm/src/path.rs b/bins/iroha_swarm/src/path.rs similarity index 100% rename from tools/swarm/src/path.rs rename to bins/iroha_swarm/src/path.rs diff --git a/tools/swarm/src/peer.rs b/bins/iroha_swarm/src/peer.rs similarity index 100% rename from tools/swarm/src/peer.rs rename to bins/iroha_swarm/src/peer.rs diff --git a/tools/swarm/src/schema.rs b/bins/iroha_swarm/src/schema.rs similarity index 100% rename from tools/swarm/src/schema.rs rename to bins/iroha_swarm/src/schema.rs diff --git a/tools/swarm/src/schema/serde_impls.rs b/bins/iroha_swarm/src/schema/serde_impls.rs similarity index 100% rename from tools/swarm/src/schema/serde_impls.rs rename to bins/iroha_swarm/src/schema/serde_impls.rs diff --git a/tools/wasm_builder_cli/Cargo.toml b/bins/iroha_wasm_builder_cli/Cargo.toml similarity index 100% rename from tools/wasm_builder_cli/Cargo.toml rename to bins/iroha_wasm_builder_cli/Cargo.toml diff --git a/tools/wasm_builder_cli/README.md b/bins/iroha_wasm_builder_cli/README.md similarity index 100% rename from tools/wasm_builder_cli/README.md rename to bins/iroha_wasm_builder_cli/README.md diff --git a/tools/wasm_builder_cli/src/main.rs b/bins/iroha_wasm_builder_cli/src/main.rs similarity index 100% rename from tools/wasm_builder_cli/src/main.rs rename to bins/iroha_wasm_builder_cli/src/main.rs diff --git a/tools/wasm_test_runner/Cargo.toml b/bins/iroha_wasm_test_runner/Cargo.toml similarity index 84% rename from tools/wasm_test_runner/Cargo.toml rename to bins/iroha_wasm_test_runner/Cargo.toml index 1a3499c0553..153f630c525 100644 --- a/tools/wasm_test_runner/Cargo.toml +++ b/bins/iroha_wasm_test_runner/Cargo.toml @@ -12,5 +12,5 @@ workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -wasmtime = { workspace = true } -anyhow = "1.0.86" +wasmtime.workspace = true +anyhow.workspace = true diff --git a/tools/wasm_test_runner/src/main.rs b/bins/iroha_wasm_test_runner/src/main.rs similarity index 100% rename from tools/wasm_test_runner/src/main.rs rename to bins/iroha_wasm_test_runner/src/main.rs diff --git a/cli/Cargo.toml b/bins/irohad/Cargo.toml similarity index 72% rename from cli/Cargo.toml rename to bins/irohad/Cargo.toml index 6889d9baa09..17733c7a385 100644 --- a/cli/Cargo.toml +++ b/bins/irohad/Cargo.toml @@ -40,43 +40,43 @@ is-it-maintained-open-issues = { repository = "https://github.com/hyperledger/ir maintenance = { status = "actively-developed" } [dependencies] -iroha_core = { workspace = true } -iroha_logger = { workspace = true } -iroha_futures = { workspace = true } +iroha_core.workspace = true +iroha_logger.workspace = true +iroha_futures.workspace = true iroha_data_model = { workspace = true, features = ["http"] } -iroha_primitives = { workspace = true } +iroha_primitives.workspace = true iroha_telemetry = { workspace = true, optional = true } -iroha_config = { workspace = true } -iroha_crypto = { workspace = true } -iroha_torii = { workspace = true } -iroha_genesis = { workspace = true } -iroha_version = { workspace = true } -iroha_wasm_builder = { workspace = true } +iroha_config.workspace = true +iroha_crypto.workspace = true +iroha_torii.workspace = true +iroha_genesis.workspace = true +iroha_version.workspace = true +iroha_wasm_builder.workspace = true clap = { workspace = true, features = ["derive", "env", "string"] } -eyre = { workspace = true } +eyre.workspace = true error-stack = { workspace = true, features = ["eyre"] } -thiserror = { workspace = true } -tracing = { workspace = true } +thiserror.workspace = true +tracing.workspace = true tokio = { workspace = true, features = ["macros", "signal"] } -once_cell = { workspace = true } +once_cell.workspace = true owo-colors = { workspace = true, features = ["supports-colors"] } -supports-color = { workspace = true } -toml = { workspace = true } +supports-color.workspace = true +toml.workspace = true thread-local-panic-hook = { version = "0.1.0", optional = true } [dev-dependencies] serial_test = "3.1.1" -tempfile = { workspace = true } -json5 = { workspace = true } -futures = { workspace = true } -path-absolutize = { workspace = true } -assertables = { workspace = true } +tempfile.workspace = true +json5.workspace = true +futures.workspace = true +path-absolutize.workspace = true +assertables.workspace = true [build-dependencies] -iroha_wasm_builder = { workspace = true } -eyre = { workspace = true } +iroha_wasm_builder.workspace = true +eyre.workspace = true vergen = { workspace = true, features = ["cargo"] } diff --git a/cli/README.md b/bins/irohad/README.md similarity index 92% rename from cli/README.md rename to bins/irohad/README.md index a75c4f773a4..b7f901510bd 100644 --- a/cli/README.md +++ b/bins/irohad/README.md @@ -44,7 +44,7 @@ To run the Iroha peer binary, you must [generate the keys](#generating-keys) and ### Generating Keys -We highly recommend you to generate a new key pair for any non-testing deployment. We also recommend using the `Ed25519` algorithm. For convenience, you can use the provided [`kagami`](../tools/kagami/README.md) tool to generate key pairs. For example, +We highly recommend you to generate a new key pair for any non-testing deployment. We also recommend using the `Ed25519` algorithm. For convenience, you can use the provided [`kagami`](../kagami/README.md) tool to generate key pairs. For example, @@ -68,7 +68,7 @@ cargo run --bin kagami -- crypto --json ``` **NOTE**: The `kagami` binary can be run without `cargo` using the `/target/release/kagami` binary. -Refer to [generating key pairs with `kagami`](../tools/kagami#crypto) for more details. +Refer to [generating key pairs with `kagami`](../kagami#crypto) for more details. ### Configuration file @@ -110,7 +110,7 @@ You may deploy Iroha as a [native binary](#native-binary) or by using [Docker](# ### Docker -We provide a sample configuration for Docker in [`docker-compose.yml`](../configs/swarm/docker-compose.yml). We highly recommend that you adjust the `config.json` to include a set of new key pairs. +We provide a sample configuration for Docker in [`docker-compose.yml`](../../configs/swarm/docker-compose.yml). We highly recommend that you adjust the `config.json` to include a set of new key pairs. [Generate the keys](#generating-keys) and put them into `services.*.environment` in `docker-compose.yml`. Don't forget to update the public keys of `TRUSTED_PEERS`. diff --git a/cli/build.rs b/bins/irohad/build.rs similarity index 100% rename from cli/build.rs rename to bins/irohad/build.rs diff --git a/cli/src/lib.rs b/bins/irohad/src/lib.rs similarity index 100% rename from cli/src/lib.rs rename to bins/irohad/src/lib.rs diff --git a/cli/src/main.rs b/bins/irohad/src/main.rs similarity index 100% rename from cli/src/main.rs rename to bins/irohad/src/main.rs diff --git a/cli/src/samples.rs b/bins/irohad/src/samples.rs similarity index 100% rename from cli/src/samples.rs rename to bins/irohad/src/samples.rs diff --git a/tools/kagami/Cargo.toml b/bins/kagami/Cargo.toml similarity index 95% rename from tools/kagami/Cargo.toml rename to bins/kagami/Cargo.toml index 5af39ba2572..0f37503a1d4 100644 --- a/tools/kagami/Cargo.toml +++ b/bins/kagami/Cargo.toml @@ -20,7 +20,7 @@ iroha_config.workspace = true iroha_schema_gen.workspace = true iroha_primitives.workspace = true iroha_genesis.workspace = true -test_samples.workspace = true +iroha_test_samples.workspace = true clap = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] } diff --git a/tools/kagami/README.md b/bins/kagami/README.md similarity index 100% rename from tools/kagami/README.md rename to bins/kagami/README.md diff --git a/tools/kagami/src/crypto.rs b/bins/kagami/src/crypto.rs similarity index 100% rename from tools/kagami/src/crypto.rs rename to bins/kagami/src/crypto.rs diff --git a/tools/kagami/src/genesis.rs b/bins/kagami/src/genesis.rs similarity index 100% rename from tools/kagami/src/genesis.rs rename to bins/kagami/src/genesis.rs diff --git a/tools/kagami/src/genesis/generate.rs b/bins/kagami/src/genesis/generate.rs similarity index 99% rename from tools/kagami/src/genesis/generate.rs rename to bins/kagami/src/genesis/generate.rs index d4fd4129222..3bc572f78b7 100644 --- a/tools/kagami/src/genesis/generate.rs +++ b/bins/kagami/src/genesis/generate.rs @@ -11,7 +11,7 @@ use iroha_executor_data_model::permission::{ parameter::CanSetParameters, }; use iroha_genesis::{GenesisBuilder, RawGenesisTransaction, GENESIS_DOMAIN_ID}; -use test_samples::{gen_account_in, ALICE_ID, BOB_ID, CARPENTER_ID}; +use iroha_test_samples::{gen_account_in, ALICE_ID, BOB_ID, CARPENTER_ID}; use crate::{Outcome, RunArgs}; diff --git a/tools/kagami/src/genesis/sign.rs b/bins/kagami/src/genesis/sign.rs similarity index 100% rename from tools/kagami/src/genesis/sign.rs rename to bins/kagami/src/genesis/sign.rs diff --git a/tools/kagami/src/main.rs b/bins/kagami/src/main.rs similarity index 100% rename from tools/kagami/src/main.rs rename to bins/kagami/src/main.rs diff --git a/tools/kagami/src/schema.rs b/bins/kagami/src/schema.rs similarity index 100% rename from tools/kagami/src/schema.rs rename to bins/kagami/src/schema.rs diff --git a/tools/kura_inspector/Cargo.toml b/bins/kura_inspector/Cargo.toml similarity index 68% rename from tools/kura_inspector/Cargo.toml rename to bins/kura_inspector/Cargo.toml index 31854303380..823c02e1b5b 100644 --- a/tools/kura_inspector/Cargo.toml +++ b/bins/kura_inspector/Cargo.toml @@ -11,8 +11,8 @@ license.workspace = true workspace = true [dependencies] -iroha_core = { workspace = true } -iroha_version = { workspace = true } -iroha_data_model = { workspace = true } +iroha_core.workspace = true +iroha_version.workspace = true +iroha_data_model.workspace = true clap = { workspace = true, features = ["derive", "cargo"] } diff --git a/tools/kura_inspector/README.md b/bins/kura_inspector/README.md similarity index 100% rename from tools/kura_inspector/README.md rename to bins/kura_inspector/README.md diff --git a/tools/kura_inspector/src/main.rs b/bins/kura_inspector/src/main.rs similarity index 100% rename from tools/kura_inspector/src/main.rs rename to bins/kura_inspector/src/main.rs diff --git a/bins/parity_scale_cli/Cargo.toml b/bins/parity_scale_cli/Cargo.toml new file mode 100644 index 00000000000..59bf075fa7e --- /dev/null +++ b/bins/parity_scale_cli/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "parity_scale_cli" + +edition.workspace = true +version.workspace = true +authors.workspace = true + +license.workspace = true + +[lints] +workspace = true + +[dependencies] +iroha_data_model = { workspace = true, features = ["http"] } +iroha_executor_data_model.workspace = true +iroha_primitives.workspace = true +iroha_schema.workspace = true +iroha_schema_gen.workspace = true +iroha_crypto.workspace = true +iroha_version.workspace = true +iroha_genesis.workspace = true + +clap = { workspace = true, features = ["derive", "cargo", "env", "string"] } +eyre.workspace = true +parity-scale-codec.workspace = true +colored = "2.1.0" +serde_json = { workspace = true, features = ["std"]} +serde.workspace = true +supports-color.workspace = true + +[build-dependencies] +iroha_data_model.workspace = true + +parity-scale-codec.workspace = true +serde_json = { workspace = true, features = ["std"]} +serde.workspace = true +eyre.workspace = true + +[dev-dependencies] +iroha_test_samples.workspace = true diff --git a/tools/parity_scale_cli/README.md b/bins/parity_scale_cli/README.md similarity index 100% rename from tools/parity_scale_cli/README.md rename to bins/parity_scale_cli/README.md diff --git a/tools/parity_scale_cli/build.rs b/bins/parity_scale_cli/build.rs similarity index 100% rename from tools/parity_scale_cli/build.rs rename to bins/parity_scale_cli/build.rs diff --git a/tools/parity_scale_cli/samples/account.bin b/bins/parity_scale_cli/samples/account.bin similarity index 100% rename from tools/parity_scale_cli/samples/account.bin rename to bins/parity_scale_cli/samples/account.bin diff --git a/tools/parity_scale_cli/samples/account.json b/bins/parity_scale_cli/samples/account.json similarity index 100% rename from tools/parity_scale_cli/samples/account.json rename to bins/parity_scale_cli/samples/account.json diff --git a/tools/parity_scale_cli/samples/domain.bin b/bins/parity_scale_cli/samples/domain.bin similarity index 100% rename from tools/parity_scale_cli/samples/domain.bin rename to bins/parity_scale_cli/samples/domain.bin diff --git a/tools/parity_scale_cli/samples/domain.json b/bins/parity_scale_cli/samples/domain.json similarity index 100% rename from tools/parity_scale_cli/samples/domain.json rename to bins/parity_scale_cli/samples/domain.json diff --git a/tools/parity_scale_cli/samples/trigger.bin b/bins/parity_scale_cli/samples/trigger.bin similarity index 100% rename from tools/parity_scale_cli/samples/trigger.bin rename to bins/parity_scale_cli/samples/trigger.bin diff --git a/tools/parity_scale_cli/samples/trigger.json b/bins/parity_scale_cli/samples/trigger.json similarity index 100% rename from tools/parity_scale_cli/samples/trigger.json rename to bins/parity_scale_cli/samples/trigger.json diff --git a/tools/parity_scale_cli/src/main.rs b/bins/parity_scale_cli/src/main.rs similarity index 99% rename from tools/parity_scale_cli/src/main.rs rename to bins/parity_scale_cli/src/main.rs index c68cb4c8589..767786bc8d3 100644 --- a/tools/parity_scale_cli/src/main.rs +++ b/bins/parity_scale_cli/src/main.rs @@ -306,7 +306,7 @@ mod tests { use std::str::FromStr as _; use iroha_data_model::{ipfs::IpfsPath, prelude::*}; - use test_samples::ALICE_ID; + use iroha_test_samples::ALICE_ID; use super::*; diff --git a/client/tests/integration/smartcontracts/Cargo.toml b/client/tests/integration/smartcontracts/Cargo.toml deleted file mode 100644 index 3e058bf4d77..00000000000 --- a/client/tests/integration/smartcontracts/Cargo.toml +++ /dev/null @@ -1,57 +0,0 @@ -[workspace.package] -edition = "2021" -version = "2.0.0-pre-rc.21" -# TODO: teams are being deprecated update the authors URL -authors = ["Iroha 2 team "] - -license = "Apache-2.0" - -[workspace] -resolver = "2" -members = [ - "create_nft_for_every_user_trigger", - "mint_rose_trigger", - "mint_rose_trigger_args", - "executor_with_admin", - "executor_with_custom_permission", - "executor_with_custom_parameter", - "executor_remove_permission", - "executor_with_migration_fail", - "executor_custom_instructions_simple", - "executor_custom_instructions_complex", - "executor_custom_data_model", - "query_assets_and_save_cursor", - "smart_contract_can_filter_queries", - "multisig_register", - "multisig", -] - -[profile.dev] -panic = "abort" - -[profile.release] -strip = "debuginfo" # Remove debugging info from the binary -panic = "abort" # Panics are transcribed to Traps when compiling for wasm anyways -lto = true # Link-time-optimization produces notable decrease in binary size -opt-level = "z" # Optimize for size vs speed with "s"/"z"(removes vectorization) -codegen-units = 1 # Further reduces binary size but increases compilation time - -[workspace.dependencies] -executor_custom_data_model = { path = "executor_custom_data_model" } - -iroha_smart_contract = { version = "=2.0.0-pre-rc.21", path = "../../../../smart_contract", features = ["debug"] } -iroha_trigger = { version = "=2.0.0-pre-rc.21", path = "../../../../smart_contract/trigger", features = ["debug"] } -iroha_executor = { version = "=2.0.0-pre-rc.21", path = "../../../../smart_contract/executor", features = ["debug"] } -iroha_schema = { version = "=2.0.0-pre-rc.21", path = "../../../../schema" } -iroha_data_model = { version = "=2.0.0-pre-rc.21", path = "../../../../data_model", default-features = false } -iroha_executor_data_model = { version = "=2.0.0-pre-rc.21", path = "../../../../smart_contract/executor/data_model" } - -parity-scale-codec = { version = "3.2.1", default-features = false } -anyhow = { version = "1.0.71", default-features = false } -serde = { version = "1.0.151", default-features = false } -serde_json = { version = "1.0.91", default-features = false } -getrandom = { version = "0.2", features = ["custom"] } -nonzero_ext = { version = "0.3.0", default-features = false } - -lol_alloc = "0.4.0" -panic-halt = "0.2.0" diff --git a/client/tests/integration/smartcontracts/README.md b/client/tests/integration/smartcontracts/README.md deleted file mode 100644 index daf131336ad..00000000000 --- a/client/tests/integration/smartcontracts/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Smatcontracts - -This folder contains test smartcontracts that are used in tests. - -All this smartcontracts are being built **automatically** by the [`build-script`](../../../build.rs) which iterates over this directory. \ No newline at end of file diff --git a/client/tests/integration/smartcontracts/multisig/Cargo.toml b/client/tests/integration/smartcontracts/multisig/Cargo.toml deleted file mode 100644 index 3c4c6db935b..00000000000 --- a/client/tests/integration/smartcontracts/multisig/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "multisig" - -edition.workspace = true -version.workspace = true -authors.workspace = true - -license.workspace = true - -[lib] -crate-type = ['cdylib'] - -[dependencies] -iroha_trigger.workspace = true -executor_custom_data_model.workspace = true - -panic-halt.workspace = true -lol_alloc.workspace = true -getrandom.workspace = true - -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true, default-features = false } - -[build-dependencies] -iroha_wasm_builder = { version = "=2.0.0-pre-rc.21", path = "../../../../../wasm_builder" } diff --git a/client/tests/integration/smartcontracts/multisig_register/Cargo.toml b/client/tests/integration/smartcontracts/multisig_register/Cargo.toml deleted file mode 100644 index 09d62f6c25e..00000000000 --- a/client/tests/integration/smartcontracts/multisig_register/Cargo.toml +++ /dev/null @@ -1,26 +0,0 @@ -[package] -name = "multisig_register" - -edition.workspace = true -version.workspace = true -authors.workspace = true - -license.workspace = true - -[lib] -crate-type = ['cdylib'] - -[dependencies] -iroha_trigger.workspace = true -iroha_executor_data_model.workspace = true -executor_custom_data_model.workspace = true - -panic-halt.workspace = true -lol_alloc.workspace = true -getrandom.workspace = true - -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true, default-features = false } - -[build-dependencies] -iroha_wasm_builder = { version = "=2.0.0-pre-rc.21", path = "../../../../../wasm_builder" } diff --git a/config/Cargo.toml b/config/Cargo.toml deleted file mode 100644 index 0269103636c..00000000000 --- a/config/Cargo.toml +++ /dev/null @@ -1,43 +0,0 @@ -[package] -name = "iroha_config" - -edition.workspace = true -version.workspace = true -authors.workspace = true - -license.workspace = true - -[lints] -workspace = true - -[dependencies] -iroha_config_base = { workspace = true } -iroha_data_model = { workspace = true } -iroha_primitives = { workspace = true } -iroha_crypto = { workspace = true } -iroha_genesis = { workspace = true } - -error-stack = { workspace = true } -tracing = { workspace = true } -tracing-subscriber = { workspace = true, features = ["fmt", "ansi", "env-filter"] } -url = { workspace = true, features = ["serde"] } - -serde = { workspace = true, features = ["derive"] } -serde_with = { workspace = true } -strum = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } -json5 = { workspace = true } -thiserror = { workspace = true } -displaydoc = { workspace = true } -derive_more = { workspace = true } -cfg-if = { workspace = true } -once_cell = { workspace = true } -nonzero_ext = { workspace = true } -hex = { workspace = true, features = ["std"] } - -# for tracing -stderrlog = "0.6.0" - -[dev-dependencies] -expect-test = { workspace = true } -assertables = { workspace = true } diff --git a/configs/swarm/executor.wasm b/configs/swarm/executor.wasm index 1cc29162a85..dfb2271dcf7 100644 Binary files a/configs/swarm/executor.wasm and b/configs/swarm/executor.wasm differ diff --git a/default_executor/.cargo/config.toml b/default_executor/.cargo/config.toml deleted file mode 100644 index 435ed755ec2..00000000000 --- a/default_executor/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[build] -target = "wasm32-unknown-unknown" \ No newline at end of file diff --git a/default_executor/Cargo.toml b/default_executor/Cargo.toml deleted file mode 100644 index 9c83a1f69a1..00000000000 --- a/default_executor/Cargo.toml +++ /dev/null @@ -1,31 +0,0 @@ -[package] -name = "iroha_default_executor" - -edition = "2021" -version = "2.0.0-pre-rc.21" -# TODO: teams are being deprecated update the authors URL -authors = ["Iroha 2 team "] - -license = "Apache-2.0" - -[workspace] - -[lib] -crate-type = ['cdylib'] - -[profile.dev] -panic = "abort" - -[profile.release] -strip = "debuginfo" # Remove debugging info from the binary -panic = "abort" # Panics are transcribed to Traps when compiling for wasm anyways -lto = true # Link-time-optimization produces notable decrease in binary size -opt-level = "z" # Optimize for size vs speed with "s"/"z"(removes vectorization) -codegen-units = 1 # Further reduces binary size but increases compilation time - -[dependencies] -iroha_executor = { version = "2.0.0-pre-rc.21", path = "../smart_contract/executor", features = ["debug"] } -getrandom = { version = "0.2", features = ["custom"] } - -lol_alloc = "0.4.0" -panic-halt = "0.2.0" diff --git a/default_executor/LICENSE b/default_executor/LICENSE deleted file mode 100644 index 857e425343c..00000000000 --- a/default_executor/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Soramitsu LLC - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/default_executor/README.md b/default_executor/README.md deleted file mode 100644 index 45cff2f9d1d..00000000000 --- a/default_executor/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# `iroha_default_executor` - -Use the [Wasm Builder CLI](../tools/wasm_builder_cli) in order to build it: - -```bash -cargo run --bin iroha_wasm_builder -- \ - build ./default_executor --optimize --out-file ./configs/swarm/executor.wasm -``` diff --git a/docs/README.md b/docs/README.md index bf1c924a7ec..7dff866e07a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -11,13 +11,13 @@ This is the main Iroha 2 documentation that you will find useful: Documentation for Iroha 2 tools: -- [Kagami](../tools/kagami/README.md) -- [Kura Inspector](../tools/kura_inspector/README.md) -- [Parity Scale Decoder Tool](../tools/parity_scale_cli/README.md) +- [Kagami](../bins/kagami/README.md) +- [Kura Inspector](../bins/kura_inspector/README.md) +- [Parity Scale Decoder Tool](../bins/parity_scale_cli/README.md) ## Development The following is useful for development: - [Hot reload Iroha in a Docker container](./source/guides/hot-reload.md) -- [Benchmark your code](../client/benches/tps/README.md) +- [Benchmark your code](../libs/iroha/benches/tps/README.md) diff --git a/hooks/pre-commit.sample b/hooks/pre-commit.sample index 67effb47912..8bb4e1fb710 100755 --- a/hooks/pre-commit.sample +++ b/hooks/pre-commit.sample @@ -3,15 +3,12 @@ set -e # format checks cargo fmt --all -- --check -cd ./default_executor -cargo fmt --all -- --check -cd - -cd ./client/tests/integration/smartcontracts +cd ./samples cargo fmt --all -- --check cd - # update the default executor -cargo run --release --bin iroha_wasm_builder -- build ./default_executor --optimize --out-file ./configs/swarm/executor.wasm -# update the default genesis, assuming the transaction authority is `test_samples::SAMPLE_GENESIS_ACCOUNT_ID` +cargo run --release --bin iroha_wasm_builder -- build ./samples/executors/default --optimize --out-file ./configs/swarm/executor.wasm +# update the default genesis, assuming the transaction authority is `iroha_test_samples::SAMPLE_GENESIS_ACCOUNT_ID` cargo run --release --bin kagami -- genesis generate --executor-path-in-genesis ./executor.wasm --genesis-public-key ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 > ./configs/swarm/genesis.json # update schema cargo run --release --bin kagami -- schema > ./docs/source/references/schema.json diff --git a/client/Cargo.toml b/libs/iroha/Cargo.toml similarity index 64% rename from client/Cargo.toml rename to libs/iroha/Cargo.toml index 3e3b6eb3cc5..36e9f009093 100644 --- a/client/Cargo.toml +++ b/libs/iroha/Cargo.toml @@ -48,67 +48,67 @@ tls-rustls-webpki-roots = [ ] [dependencies] -iroha_config = { workspace = true } -iroha_config_base = { workspace = true } -iroha_crypto = { workspace = true } +iroha_config.workspace = true +iroha_config_base.workspace = true +iroha_crypto.workspace = true # FIXME: should remove `transparent_api` feature. Check the other FIXME comment in dev-dependencies iroha_data_model = { workspace = true, features = ["http", "transparent_api"] } -iroha_executor_data_model = { workspace = true } -iroha_primitives = { workspace = true } -iroha_logger = { workspace = true } -iroha_telemetry = { workspace = true } -iroha_torii_const = { workspace = true } -iroha_version = { workspace = true } -test_samples = { workspace = true } +iroha_executor_data_model.workspace = true +iroha_primitives.workspace = true +iroha_logger.workspace = true +iroha_telemetry.workspace = true +iroha_torii_const.workspace = true +iroha_version.workspace = true +iroha_test_samples.workspace = true attohttpc = { version = "0.28.0", default-features = false } -eyre = { workspace = true } -error-stack = { workspace = true } +eyre.workspace = true +error-stack.workspace = true http = "1.1.0" -url = { workspace = true } -rand = { workspace = true } +url.workspace = true +rand.workspace = true serde = { workspace = true, features = ["derive"] } -serde_with = { workspace = true } -serde_json = { workspace = true } -base64 = { workspace = true } -thiserror = { workspace = true } -displaydoc = { workspace = true } -derive_more = { workspace = true } +serde_with.workspace = true +serde_json.workspace = true +base64.workspace = true +thiserror.workspace = true +displaydoc.workspace = true +derive_more.workspace = true parity-scale-codec = { workspace = true, default-features = false, features = ["derive"] } tokio = { workspace = true, features = ["rt"] } -tokio-tungstenite = { workspace = true } -tungstenite = { workspace = true } +tokio-tungstenite.workspace = true +tungstenite.workspace = true futures-util = "0.3.30" -toml = { workspace = true } -nonzero_ext = { workspace = true } +toml.workspace = true +nonzero_ext.workspace = true [dev-dependencies] # FIXME: These three activate `transparent_api` but client should never activate this feature. # Additionally there is a dependency on iroha_core in dev-dependencies in telemetry/derive # Hopefully, once the integration tests migration is finished these can be removed -irohad = { workspace = true } +irohad.workspace = true -iroha_wasm_builder = { workspace = true } -iroha_genesis = { workspace = true } -test_network = { workspace = true } -executor_custom_data_model = { path = "tests/integration/smartcontracts/executor_custom_data_model" } +iroha_wasm_builder.workspace = true +iroha_genesis.workspace = true +iroha_test_network.workspace = true +iroha_executor_custom_data_model = { version = "=2.0.0-pre-rc.21", path = "../../samples/executors/custom_data_model" } tokio = { workspace = true, features = ["rt-multi-thread"] } criterion = { workspace = true, features = ["html_reports"] } -color-eyre = { workspace = true } -tempfile = { workspace = true } -hex = { workspace = true } -assertables = { workspace = true } +color-eyre.workspace = true +tempfile.workspace = true +hex.workspace = true +assertables.workspace = true tracing-subscriber = { workspace = true, features = ["fmt", "ansi"] } -tracing-flame = "0.2.0" -once_cell = { workspace = true } +tracing-flame.workspace = true +once_cell.workspace = true -trybuild = { workspace = true } +trybuild.workspace = true [build-dependencies] -eyre = { workspace = true } -iroha_wasm_builder = { workspace = true } +eyre.workspace = true +iroha_wasm_builder.workspace = true [[bench]] name = "torii" diff --git a/client/README.md b/libs/iroha/README.md similarity index 78% rename from client/README.md rename to libs/iroha/README.md index 9faa164a258..172b105b657 100644 --- a/client/README.md +++ b/libs/iroha/README.md @@ -21,4 +21,4 @@ iroha = { git = "https://github.com/hyperledger/iroha", branch = "main" } ## Examples -We highly recommend looking at the sample [`iroha`](../client_cli) implementation binary as well as our [tutorial](https://hyperledger.github.io/iroha-2-docs/guide/rust.html) for more examples and explanations. +We highly recommend looking at the sample [`iroha`](../../bins/iroha_cli) implementation binary as well as our [tutorial](https://hyperledger.github.io/iroha-2-docs/guide/rust.html) for more examples and explanations. diff --git a/client/benches/torii.rs b/libs/iroha/benches/torii.rs similarity index 87% rename from client/benches/torii.rs rename to libs/iroha/benches/torii.rs index 2a9b0114275..77106ef8875 100644 --- a/client/benches/torii.rs +++ b/libs/iroha/benches/torii.rs @@ -9,10 +9,10 @@ use iroha::{ }; use iroha_genesis::GenesisBuilder; use iroha_primitives::unique_vec; +use iroha_test_network::{get_chain_id, get_key_pair, Peer as TestPeer, PeerBuilder, TestRuntime}; +use iroha_test_samples::gen_account_in; use iroha_version::Encode; use irohad::samples::{construct_executor, get_config}; -use test_network::{get_chain_id, get_key_pair, Peer as TestPeer, PeerBuilder, TestRuntime}; -use test_samples::gen_account_in; use tokio::runtime::Runtime; const MINIMUM_SUCCESS_REQUEST_RATIO: f32 = 0.9; @@ -21,20 +21,25 @@ fn query_requests(criterion: &mut Criterion) { let mut peer = ::new().expect("Failed to create peer"); let chain_id = get_chain_id(); - let genesis_key_pair = get_key_pair(test_network::Signatory::Genesis); + let genesis_key_pair = get_key_pair(iroha_test_network::Signatory::Genesis); let configuration = get_config( unique_vec![peer.id.clone()], chain_id.clone(), - get_key_pair(test_network::Signatory::Peer), + get_key_pair(iroha_test_network::Signatory::Peer), genesis_key_pair.public_key(), ); let rt = Runtime::test(); - let executor = construct_executor("../default_executor").expect("Failed to construct executor"); + let executor = construct_executor("../../samples/executors/default") + .expect("Failed to construct executor"); let topology = vec![peer.id.clone()]; let genesis = GenesisBuilder::default() .domain("wonderland".parse().expect("Valid")) - .account(get_key_pair(test_network::Signatory::Alice).into_parts().0) + .account( + get_key_pair(iroha_test_network::Signatory::Alice) + .into_parts() + .0, + ) .finish_domain() .build_and_sign(executor, chain_id, &genesis_key_pair, topology); @@ -63,7 +68,7 @@ fn query_requests(criterion: &mut Criterion) { ); let client_config = iroha::samples::get_client_config( get_chain_id(), - get_key_pair(test_network::Signatory::Alice), + get_key_pair(iroha_test_network::Signatory::Alice), format!("http://{}", peer.api_address).parse().unwrap(), ); @@ -117,15 +122,16 @@ fn instruction_submits(criterion: &mut Criterion) { let mut peer = ::new().expect("Failed to create peer"); let chain_id = get_chain_id(); - let genesis_key_pair = get_key_pair(test_network::Signatory::Genesis); + let genesis_key_pair = get_key_pair(iroha_test_network::Signatory::Genesis); let topology = vec![peer.id.clone()]; let configuration = get_config( unique_vec![peer.id.clone()], chain_id.clone(), - get_key_pair(test_network::Signatory::Peer), + get_key_pair(iroha_test_network::Signatory::Peer), genesis_key_pair.public_key(), ); - let executor = construct_executor("../default_executor").expect("Failed to construct executor"); + let executor = construct_executor("../../samples/executors/default") + .expect("Failed to construct executor"); let genesis = GenesisBuilder::default() .domain("wonderland".parse().expect("Valid")) .account(configuration.common.key_pair.public_key().clone()) @@ -143,7 +149,7 @@ fn instruction_submits(criterion: &mut Criterion) { let asset_definition_id: AssetDefinitionId = "xor#domain".parse().expect("Valid"); let client_config = iroha::samples::get_client_config( get_chain_id(), - get_key_pair(test_network::Signatory::Alice), + get_key_pair(iroha_test_network::Signatory::Alice), format!("http://{}", peer.api_address).parse().unwrap(), ); let iroha = Client::new(client_config); diff --git a/client/benches/tps/README.md b/libs/iroha/benches/tps/README.md similarity index 100% rename from client/benches/tps/README.md rename to libs/iroha/benches/tps/README.md diff --git a/client/benches/tps/config.json b/libs/iroha/benches/tps/config.json similarity index 100% rename from client/benches/tps/config.json rename to libs/iroha/benches/tps/config.json diff --git a/client/benches/tps/dev.rs b/libs/iroha/benches/tps/dev.rs similarity index 100% rename from client/benches/tps/dev.rs rename to libs/iroha/benches/tps/dev.rs diff --git a/client/benches/tps/oneshot.rs b/libs/iroha/benches/tps/oneshot.rs similarity index 100% rename from client/benches/tps/oneshot.rs rename to libs/iroha/benches/tps/oneshot.rs diff --git a/client/benches/tps/utils.rs b/libs/iroha/benches/tps/utils.rs similarity index 99% rename from client/benches/tps/utils.rs rename to libs/iroha/benches/tps/utils.rs index cca409724ae..040c3f6ed5c 100644 --- a/client/benches/tps/utils.rs +++ b/libs/iroha/benches/tps/utils.rs @@ -10,10 +10,10 @@ use iroha::{ prelude::*, }, }; +use iroha_test_network::*; +use iroha_test_samples::ALICE_ID; use nonzero_ext::nonzero; use serde::Deserialize; -use test_network::*; -use test_samples::ALICE_ID; pub type Tps = f64; diff --git a/client/examples/million_accounts_genesis.rs b/libs/iroha/examples/million_accounts_genesis.rs similarity index 87% rename from client/examples/million_accounts_genesis.rs rename to libs/iroha/examples/million_accounts_genesis.rs index d871a2143e3..ce117c6e73d 100644 --- a/client/examples/million_accounts_genesis.rs +++ b/libs/iroha/examples/million_accounts_genesis.rs @@ -7,11 +7,11 @@ use iroha::{ }; use iroha_genesis::{GenesisBlock, GenesisBuilder}; use iroha_primitives::unique_vec; -use irohad::samples::{construct_executor, get_config}; -use test_network::{ +use iroha_test_network::{ get_chain_id, get_key_pair, wait_for_genesis_committed, Peer as TestPeer, PeerBuilder, TestRuntime, }; +use irohad::samples::{construct_executor, get_config}; use tokio::runtime::Runtime; fn generate_genesis( @@ -22,7 +22,9 @@ fn generate_genesis( ) -> GenesisBlock { let mut builder = GenesisBuilder::default(); - let signatory_alice = get_key_pair(test_network::Signatory::Alice).into_parts().0; + let signatory_alice = get_key_pair(iroha_test_network::Signatory::Alice) + .into_parts() + .0; for i in 0_u32..num_domains { builder = builder .domain(format!("wonderland-{i}").parse().expect("Valid")) @@ -34,7 +36,8 @@ fn generate_genesis( .finish_domain(); } - let executor = construct_executor("../default_executor").expect("Failed to construct executor"); + let executor = construct_executor("../../samples/executors/default") + .expect("Failed to construct executor"); builder.build_and_sign(executor, chain_id, genesis_key_pair, topology) } @@ -42,12 +45,12 @@ fn main_genesis() { let mut peer = ::new().expect("Failed to create peer"); let chain_id = get_chain_id(); - let genesis_key_pair = get_key_pair(test_network::Signatory::Genesis); + let genesis_key_pair = get_key_pair(iroha_test_network::Signatory::Genesis); let topology = vec![peer.id.clone()]; let configuration = get_config( unique_vec![peer.id.clone()], chain_id.clone(), - get_key_pair(test_network::Signatory::Peer), + get_key_pair(iroha_test_network::Signatory::Peer), genesis_key_pair.public_key(), ); let rt = Runtime::test(); diff --git a/client/examples/register_1000_triggers.rs b/libs/iroha/examples/register_1000_triggers.rs similarity index 85% rename from client/examples/register_1000_triggers.rs rename to libs/iroha/examples/register_1000_triggers.rs index a7f31bd2962..a5bfbb3c359 100644 --- a/client/examples/register_1000_triggers.rs +++ b/libs/iroha/examples/register_1000_triggers.rs @@ -11,12 +11,12 @@ use iroha::{ use iroha_data_model::parameter::{Parameter, SmartContractParameter}; use iroha_genesis::{GenesisBlock, GenesisBuilder}; use iroha_primitives::unique_vec; -use irohad::samples::{construct_executor, get_config}; -use test_network::{ +use iroha_test_network::{ get_chain_id, get_key_pair, wait_for_genesis_committed_with_max_retries, Peer as TestPeer, PeerBuilder, TestClient, TestRuntime, }; -use test_samples::gen_account_in; +use iroha_test_samples::gen_account_in; +use irohad::samples::{construct_executor, get_config}; use tokio::runtime::Runtime; fn generate_genesis( @@ -33,13 +33,11 @@ fn generate_genesis( SmartContractParameter::Memory(NonZeroU64::MAX), ))); - let wasm = iroha_wasm_builder::Builder::new( - "client/tests/integration/smartcontracts/mint_rose_trigger", - ) - .show_output() - .build()? - .optimize()? - .into_bytes()?; + let wasm = iroha_wasm_builder::Builder::new("samples/triggers/mint_rose_trigger") + .show_output() + .build()? + .optimize()? + .into_bytes()?; let wasm = WasmSmartContract::from_compiled(wasm); let (account_id, _account_keypair) = gen_account_in("wonderland"); @@ -65,7 +63,8 @@ fn generate_genesis( }) .fold(builder, GenesisBuilder::append_instruction); - let executor = construct_executor("default_executor").expect("Failed to construct executor"); + let executor = + construct_executor("../samples/executors/default").expect("Failed to construct executor"); Ok(builder.build_and_sign(executor, chain_id, genesis_key_pair, topology)) } @@ -73,12 +72,12 @@ fn main() -> Result<(), Box> { let mut peer: TestPeer = ::new().expect("Failed to create peer"); let chain_id = get_chain_id(); - let genesis_key_pair = get_key_pair(test_network::Signatory::Genesis); + let genesis_key_pair = get_key_pair(iroha_test_network::Signatory::Genesis); let topology = vec![peer.id.clone()]; let configuration = get_config( unique_vec![peer.id.clone()], chain_id.clone(), - get_key_pair(test_network::Signatory::Peer), + get_key_pair(iroha_test_network::Signatory::Peer), genesis_key_pair.public_key(), ); diff --git a/client/examples/tutorial.rs b/libs/iroha/examples/tutorial.rs similarity index 100% rename from client/examples/tutorial.rs rename to libs/iroha/examples/tutorial.rs diff --git a/client/src/client.rs b/libs/iroha/src/client.rs similarity index 99% rename from client/src/client.rs rename to libs/iroha/src/client.rs index 6902b054f0a..a92f1091f96 100644 --- a/client/src/client.rs +++ b/libs/iroha/src/client.rs @@ -379,8 +379,8 @@ impl QueryRequest { torii_url: format!("http://{torii_url}").parse().unwrap(), headers: HashMap::new(), request: crate::data_model::query::QueryRequest::Query( - ClientQueryBuilder::new(FindAllAccounts, test_samples::ALICE_ID.clone()) - .sign(&test_samples::ALICE_KEYPAIR), + ClientQueryBuilder::new(FindAllAccounts, iroha_test_samples::ALICE_ID.clone()) + .sign(&iroha_test_samples::ALICE_KEYPAIR), ), } } @@ -1590,7 +1590,7 @@ mod tests { use std::str::FromStr; use iroha_primitives::small::SmallStr; - use test_samples::gen_account_in; + use iroha_test_samples::gen_account_in; use super::*; use crate::config::{BasicAuth, Config, WebLogin}; diff --git a/client/src/config.rs b/libs/iroha/src/config.rs similarity index 100% rename from client/src/config.rs rename to libs/iroha/src/config.rs diff --git a/client/src/config/user.rs b/libs/iroha/src/config/user.rs similarity index 100% rename from client/src/config/user.rs rename to libs/iroha/src/config/user.rs diff --git a/client/src/http.rs b/libs/iroha/src/http.rs similarity index 100% rename from client/src/http.rs rename to libs/iroha/src/http.rs diff --git a/client/src/http_default.rs b/libs/iroha/src/http_default.rs similarity index 100% rename from client/src/http_default.rs rename to libs/iroha/src/http_default.rs diff --git a/client/src/lib.rs b/libs/iroha/src/lib.rs similarity index 100% rename from client/src/lib.rs rename to libs/iroha/src/lib.rs diff --git a/client/src/query_builder.rs b/libs/iroha/src/query_builder.rs similarity index 100% rename from client/src/query_builder.rs rename to libs/iroha/src/query_builder.rs diff --git a/client/tests/integration/asset.rs b/libs/iroha/tests/integration/asset.rs similarity index 99% rename from client/tests/integration/asset.rs rename to libs/iroha/tests/integration/asset.rs index af6a685a550..db656d027c4 100644 --- a/client/tests/integration/asset.rs +++ b/libs/iroha/tests/integration/asset.rs @@ -13,8 +13,8 @@ use iroha::{ }; use iroha_config::parameters::actual::Root as Config; use iroha_executor_data_model::permission::asset::CanTransferUserAsset; -use test_network::*; -use test_samples::{gen_account_in, ALICE_ID, BOB_ID}; +use iroha_test_network::*; +use iroha_test_samples::{gen_account_in, ALICE_ID, BOB_ID}; #[test] // This test is also covered at the UI level in the iroha_cli tests diff --git a/client/tests/integration/asset_propagation.rs b/libs/iroha/tests/integration/asset_propagation.rs similarity index 96% rename from client/tests/integration/asset_propagation.rs rename to libs/iroha/tests/integration/asset_propagation.rs index c191c5fdb82..1524216f1b0 100644 --- a/client/tests/integration/asset_propagation.rs +++ b/libs/iroha/tests/integration/asset_propagation.rs @@ -6,9 +6,9 @@ use iroha::{ data_model::{parameter::BlockParameter, prelude::*}, }; use iroha_config::parameters::actual::Root as Config; +use iroha_test_network::*; +use iroha_test_samples::gen_account_in; use nonzero_ext::nonzero; -use test_network::*; -use test_samples::gen_account_in; #[test] // This test is also covered at the UI level in the iroha_cli tests diff --git a/client/tests/integration/events/data.rs b/libs/iroha/tests/integration/events/data.rs similarity index 99% rename from client/tests/integration/events/data.rs rename to libs/iroha/tests/integration/events/data.rs index 4c9e32e6e2a..e42e119518a 100644 --- a/client/tests/integration/events/data.rs +++ b/libs/iroha/tests/integration/events/data.rs @@ -5,9 +5,9 @@ use iroha::data_model::{prelude::*, transaction::WasmSmartContract}; use iroha_executor_data_model::permission::account::{ CanRemoveKeyValueInAccount, CanSetKeyValueInAccount, }; +use iroha_test_network::*; +use iroha_test_samples::{ALICE_ID, BOB_ID}; use parity_scale_codec::Encode as _; -use test_network::*; -use test_samples::{ALICE_ID, BOB_ID}; /// Return string containing exported memory, dummy allocator, and /// host function imports which you can embed into your wasm module. diff --git a/client/tests/integration/events/mod.rs b/libs/iroha/tests/integration/events/mod.rs similarity index 100% rename from client/tests/integration/events/mod.rs rename to libs/iroha/tests/integration/events/mod.rs diff --git a/client/tests/integration/events/notification.rs b/libs/iroha/tests/integration/events/notification.rs similarity index 98% rename from client/tests/integration/events/notification.rs rename to libs/iroha/tests/integration/events/notification.rs index c1bb9440478..430127e8894 100644 --- a/client/tests/integration/events/notification.rs +++ b/libs/iroha/tests/integration/events/notification.rs @@ -2,8 +2,8 @@ use std::{str::FromStr as _, sync::mpsc, thread, time::Duration}; use eyre::{eyre, Result, WrapErr}; use iroha::data_model::prelude::*; -use test_network::*; -use test_samples::ALICE_ID; +use iroha_test_network::*; +use iroha_test_samples::ALICE_ID; #[test] fn trigger_completion_success_should_produce_event() -> Result<()> { diff --git a/client/tests/integration/events/pipeline.rs b/libs/iroha/tests/integration/events/pipeline.rs similarity index 99% rename from client/tests/integration/events/pipeline.rs rename to libs/iroha/tests/integration/events/pipeline.rs index f57d4382563..827f9f15efd 100644 --- a/client/tests/integration/events/pipeline.rs +++ b/libs/iroha/tests/integration/events/pipeline.rs @@ -16,8 +16,8 @@ use iroha::{ }; use iroha_config::parameters::actual::Root as Config; use iroha_data_model::query::error::FindError; +use iroha_test_network::*; use nonzero_ext::nonzero; -use test_network::*; // Needed to re-enable ignored tests. const PEER_COUNT: usize = 7; diff --git a/client/tests/integration/extra_functional/connected_peers.rs b/libs/iroha/tests/integration/extra_functional/connected_peers.rs similarity index 99% rename from client/tests/integration/extra_functional/connected_peers.rs rename to libs/iroha/tests/integration/extra_functional/connected_peers.rs index fb98d69e141..6d0a16e8d60 100644 --- a/client/tests/integration/extra_functional/connected_peers.rs +++ b/libs/iroha/tests/integration/extra_functional/connected_peers.rs @@ -10,8 +10,8 @@ use iroha::{ }; use iroha_config::parameters::actual::Root as Config; use iroha_primitives::unique_vec; +use iroha_test_network::*; use rand::{seq::SliceRandom, thread_rng, Rng}; -use test_network::*; use tokio::runtime::Runtime; #[ignore = "ignore, more in #2851"] diff --git a/client/tests/integration/extra_functional/genesis.rs b/libs/iroha/tests/integration/extra_functional/genesis.rs similarity index 92% rename from client/tests/integration/extra_functional/genesis.rs rename to libs/iroha/tests/integration/extra_functional/genesis.rs index eb2da99b843..3f1e7275b9b 100644 --- a/client/tests/integration/extra_functional/genesis.rs +++ b/libs/iroha/tests/integration/extra_functional/genesis.rs @@ -2,7 +2,7 @@ use iroha::data_model::{ domain::{Domain, DomainId}, isi::Register, }; -use test_network::{wait_for_genesis_committed, NetworkBuilder}; +use iroha_test_network::{wait_for_genesis_committed, NetworkBuilder}; #[test] fn all_peers_submit_genesis() { diff --git a/client/tests/integration/extra_functional/mod.rs b/libs/iroha/tests/integration/extra_functional/mod.rs similarity index 100% rename from client/tests/integration/extra_functional/mod.rs rename to libs/iroha/tests/integration/extra_functional/mod.rs diff --git a/client/tests/integration/extra_functional/multiple_blocks_created.rs b/libs/iroha/tests/integration/extra_functional/multiple_blocks_created.rs similarity index 97% rename from client/tests/integration/extra_functional/multiple_blocks_created.rs rename to libs/iroha/tests/integration/extra_functional/multiple_blocks_created.rs index 78d10cae935..2fa47df2f50 100644 --- a/client/tests/integration/extra_functional/multiple_blocks_created.rs +++ b/libs/iroha/tests/integration/extra_functional/multiple_blocks_created.rs @@ -6,9 +6,9 @@ use iroha::{ data_model::{parameter::BlockParameter, prelude::*}, }; use iroha_config::parameters::actual::Root as Config; +use iroha_test_network::*; +use iroha_test_samples::gen_account_in; use nonzero_ext::nonzero; -use test_network::*; -use test_samples::gen_account_in; const N_BLOCKS: usize = 510; diff --git a/client/tests/integration/extra_functional/normal.rs b/libs/iroha/tests/integration/extra_functional/normal.rs similarity index 98% rename from client/tests/integration/extra_functional/normal.rs rename to libs/iroha/tests/integration/extra_functional/normal.rs index 401d3b22626..33fce27c1e0 100644 --- a/client/tests/integration/extra_functional/normal.rs +++ b/libs/iroha/tests/integration/extra_functional/normal.rs @@ -2,8 +2,8 @@ use iroha::{ client, data_model::{asset::AssetDefinitionId, parameter::BlockParameter, prelude::*}, }; +use iroha_test_network::*; use nonzero_ext::nonzero; -use test_network::*; #[test] fn tranasctions_should_be_applied() { diff --git a/client/tests/integration/extra_functional/offline_peers.rs b/libs/iroha/tests/integration/extra_functional/offline_peers.rs similarity index 97% rename from client/tests/integration/extra_functional/offline_peers.rs rename to libs/iroha/tests/integration/extra_functional/offline_peers.rs index 0e1e179d986..a6ae7e0151e 100644 --- a/client/tests/integration/extra_functional/offline_peers.rs +++ b/libs/iroha/tests/integration/extra_functional/offline_peers.rs @@ -9,8 +9,8 @@ use iroha::{ }; use iroha_config::parameters::actual::Root as Config; use iroha_primitives::addr::socket_addr; -use test_network::*; -use test_samples::ALICE_ID; +use iroha_test_network::*; +use iroha_test_samples::ALICE_ID; #[test] fn genesis_block_is_committed_with_some_offline_peers() -> Result<()> { diff --git a/client/tests/integration/extra_functional/restart_peer.rs b/libs/iroha/tests/integration/extra_functional/restart_peer.rs similarity index 98% rename from client/tests/integration/extra_functional/restart_peer.rs rename to libs/iroha/tests/integration/extra_functional/restart_peer.rs index 03b1d6ba68a..e6375f33614 100644 --- a/client/tests/integration/extra_functional/restart_peer.rs +++ b/libs/iroha/tests/integration/extra_functional/restart_peer.rs @@ -6,9 +6,9 @@ use iroha::{ data_model::prelude::*, }; use iroha_config::parameters::actual::Root as Config; +use iroha_test_network::*; +use iroha_test_samples::ALICE_ID; use rand::{seq::SliceRandom, thread_rng, Rng}; -use test_network::*; -use test_samples::ALICE_ID; use tokio::runtime::Runtime; #[test] diff --git a/client/tests/integration/extra_functional/unregister_peer.rs b/libs/iroha/tests/integration/extra_functional/unregister_peer.rs similarity index 97% rename from client/tests/integration/extra_functional/unregister_peer.rs rename to libs/iroha/tests/integration/extra_functional/unregister_peer.rs index ebd9ff458a9..a747010d0e0 100644 --- a/client/tests/integration/extra_functional/unregister_peer.rs +++ b/libs/iroha/tests/integration/extra_functional/unregister_peer.rs @@ -6,9 +6,9 @@ use iroha::{ data_model::{parameter::BlockParameter, prelude::*}, }; use iroha_config::parameters::actual::Root as Config; +use iroha_test_network::*; +use iroha_test_samples::gen_account_in; use nonzero_ext::nonzero; -use test_network::*; -use test_samples::gen_account_in; // Note the test is marked as `unstable`, not the network. #[ignore = "ignore, more in #2851"] @@ -106,7 +106,7 @@ fn mint( fn init() -> Result<( tokio::runtime::Runtime, - test_network::Network, + iroha_test_network::Network, iroha::client::Client, std::time::Duration, AccountId, diff --git a/client/tests/integration/extra_functional/unstable_network.rs b/libs/iroha/tests/integration/extra_functional/unstable_network.rs similarity index 98% rename from client/tests/integration/extra_functional/unstable_network.rs rename to libs/iroha/tests/integration/extra_functional/unstable_network.rs index c917b85580d..eb5b739062d 100644 --- a/client/tests/integration/extra_functional/unstable_network.rs +++ b/libs/iroha/tests/integration/extra_functional/unstable_network.rs @@ -8,10 +8,10 @@ use iroha::{ }, }; use iroha_config::parameters::actual::Root as Config; +use iroha_test_network::*; +use iroha_test_samples::ALICE_ID; use nonzero_ext::nonzero; use rand::seq::SliceRandom; -use test_network::*; -use test_samples::ALICE_ID; #[test] fn unstable_network_5_peers_1_fault() { diff --git a/client/tests/integration/mod.rs b/libs/iroha/tests/integration/mod.rs similarity index 100% rename from client/tests/integration/mod.rs rename to libs/iroha/tests/integration/mod.rs diff --git a/client/tests/integration/multisig.rs b/libs/iroha/tests/integration/multisig.rs similarity index 93% rename from client/tests/integration/multisig.rs rename to libs/iroha/tests/integration/multisig.rs index c7fd8b0bb0c..25153bf08f5 100644 --- a/client/tests/integration/multisig.rs +++ b/libs/iroha/tests/integration/multisig.rs @@ -1,6 +1,5 @@ use std::{collections::BTreeMap, str::FromStr}; -use executor_custom_data_model::multisig::{MultisigArgs, MultisigRegisterArgs}; use eyre::Result; use iroha::{ client::{self, ClientQueryError}, @@ -11,9 +10,10 @@ use iroha::{ }, }; use iroha_data_model::parameter::SmartContractParameter; +use iroha_executor_custom_data_model::multisig::{MultisigArgs, MultisigRegisterArgs}; +use iroha_test_network::*; +use iroha_test_samples::{gen_account_in, ALICE_ID}; use nonzero_ext::nonzero; -use test_network::*; -use test_samples::{gen_account_in, ALICE_ID}; #[test] fn mutlisig() -> Result<()> { @@ -32,12 +32,11 @@ fn mutlisig() -> Result<()> { let account_id = ALICE_ID.clone(); let multisig_register_trigger_id = TriggerId::from_str("multisig_register")?; - let wasm = - iroha_wasm_builder::Builder::new("tests/integration/smartcontracts/multisig_register") - .show_output() - .build()? - .optimize()? - .into_bytes()?; + let wasm = iroha_wasm_builder::Builder::new("../../samples/triggers/multisig_register") + .show_output() + .build()? + .optimize()? + .into_bytes()?; let wasm = WasmSmartContract::from_compiled(wasm); let trigger = Trigger::new( diff --git a/client/tests/integration/non_mintable.rs b/libs/iroha/tests/integration/non_mintable.rs similarity index 98% rename from client/tests/integration/non_mintable.rs rename to libs/iroha/tests/integration/non_mintable.rs index 9c714c03961..59311d3e4cc 100644 --- a/client/tests/integration/non_mintable.rs +++ b/libs/iroha/tests/integration/non_mintable.rs @@ -5,8 +5,8 @@ use iroha::{ client::{self, QueryResult}, data_model::{isi::InstructionBox, prelude::*}, }; -use test_network::*; -use test_samples::ALICE_ID; +use iroha_test_network::*; +use iroha_test_samples::ALICE_ID; #[test] fn non_mintable_asset_can_be_minted_once_but_not_twice() -> Result<()> { diff --git a/client/tests/integration/pagination.rs b/libs/iroha/tests/integration/pagination.rs similarity index 98% rename from client/tests/integration/pagination.rs rename to libs/iroha/tests/integration/pagination.rs index 5bdeb175b09..9a5aadfeca2 100644 --- a/client/tests/integration/pagination.rs +++ b/libs/iroha/tests/integration/pagination.rs @@ -3,8 +3,8 @@ use iroha::{ client::{asset, Client, QueryResult}, data_model::{asset::AssetDefinition, prelude::*, query::Pagination}, }; +use iroha_test_network::*; use nonzero_ext::nonzero; -use test_network::*; #[test] fn limits_should_work() -> Result<()> { diff --git a/client/tests/integration/permissions.rs b/libs/iroha/tests/integration/permissions.rs similarity index 99% rename from client/tests/integration/permissions.rs rename to libs/iroha/tests/integration/permissions.rs index 02a9d4c2d2e..2a3370070c5 100644 --- a/client/tests/integration/permissions.rs +++ b/libs/iroha/tests/integration/permissions.rs @@ -14,8 +14,8 @@ use iroha_executor_data_model::permission::{ domain::CanSetKeyValueInDomain, }; use iroha_genesis::GenesisBlock; -use test_network::{PeerBuilder, *}; -use test_samples::{gen_account_in, ALICE_ID, BOB_ID}; +use iroha_test_network::{PeerBuilder, *}; +use iroha_test_samples::{gen_account_in, ALICE_ID, BOB_ID}; #[test] fn genesis_transactions_are_validated_by_executor() { diff --git a/client/tests/integration/queries/account.rs b/libs/iroha/tests/integration/queries/account.rs similarity index 96% rename from client/tests/integration/queries/account.rs rename to libs/iroha/tests/integration/queries/account.rs index 1f6addaf7f9..b9e064c52ea 100644 --- a/client/tests/integration/queries/account.rs +++ b/libs/iroha/tests/integration/queries/account.rs @@ -5,8 +5,8 @@ use iroha::{ client::{self, QueryResult}, data_model::prelude::*, }; -use test_network::*; -use test_samples::{gen_account_in, ALICE_ID}; +use iroha_test_network::*; +use iroha_test_samples::{gen_account_in, ALICE_ID}; #[test] fn find_accounts_with_asset() -> Result<()> { diff --git a/client/tests/integration/queries/asset.rs b/libs/iroha/tests/integration/queries/asset.rs similarity index 98% rename from client/tests/integration/queries/asset.rs rename to libs/iroha/tests/integration/queries/asset.rs index c7591c9c290..c8de2dcb3f1 100644 --- a/client/tests/integration/queries/asset.rs +++ b/libs/iroha/tests/integration/queries/asset.rs @@ -8,8 +8,8 @@ use iroha::{ query::{asset::FindTotalAssetQuantityByAssetDefinitionId, error::QueryExecutionFail}, }, }; -use test_network::*; -use test_samples::{gen_account_in, ALICE_ID}; +use iroha_test_network::*; +use iroha_test_samples::{gen_account_in, ALICE_ID}; #[test] #[allow(clippy::too_many_lines)] diff --git a/client/tests/integration/queries/mod.rs b/libs/iroha/tests/integration/queries/mod.rs similarity index 96% rename from client/tests/integration/queries/mod.rs rename to libs/iroha/tests/integration/queries/mod.rs index f9d15a11e62..756405036f2 100644 --- a/client/tests/integration/queries/mod.rs +++ b/libs/iroha/tests/integration/queries/mod.rs @@ -5,7 +5,7 @@ use iroha::{ query::{error::QueryExecutionFail, MAX_FETCH_SIZE}, }, }; -use test_network::*; +use iroha_test_network::*; mod account; mod asset; diff --git a/client/tests/integration/queries/query_errors.rs b/libs/iroha/tests/integration/queries/query_errors.rs similarity index 87% rename from client/tests/integration/queries/query_errors.rs rename to libs/iroha/tests/integration/queries/query_errors.rs index e3a756f1522..7da85063368 100644 --- a/client/tests/integration/queries/query_errors.rs +++ b/libs/iroha/tests/integration/queries/query_errors.rs @@ -5,11 +5,11 @@ use iroha::{ query::error::{FindError, QueryExecutionFail}, }, }; -use test_samples::gen_account_in; +use iroha_test_samples::gen_account_in; #[test] fn non_existent_account_is_specific_error() { - let (_rt, _peer, client) = ::new() + let (_rt, _peer, client) = ::new() .with_port(10_670) .start_with_runtime(); // we cannot wait for genesis committment diff --git a/client/tests/integration/queries/role.rs b/libs/iroha/tests/integration/queries/role.rs similarity index 98% rename from client/tests/integration/queries/role.rs rename to libs/iroha/tests/integration/queries/role.rs index 452a971efe7..1d6086ee488 100644 --- a/client/tests/integration/queries/role.rs +++ b/libs/iroha/tests/integration/queries/role.rs @@ -6,8 +6,8 @@ use iroha::{ data_model::{prelude::*, query::error::QueryExecutionFail}, }; use iroha_executor_data_model::permission::account::CanSetKeyValueInAccount; -use test_network::*; -use test_samples::ALICE_ID; +use iroha_test_network::*; +use iroha_test_samples::ALICE_ID; fn create_role_ids() -> [RoleId; 5] { [ diff --git a/client/tests/integration/queries/smart_contract.rs b/libs/iroha/tests/integration/queries/smart_contract.rs similarity index 91% rename from client/tests/integration/queries/smart_contract.rs rename to libs/iroha/tests/integration/queries/smart_contract.rs index e41c4bd985a..24e0adc553a 100644 --- a/client/tests/integration/queries/smart_contract.rs +++ b/libs/iroha/tests/integration/queries/smart_contract.rs @@ -5,7 +5,7 @@ use iroha::{ client::ClientQueryError, data_model::{prelude::*, query::error::QueryExecutionFail}, }; -use test_network::*; +use iroha_test_network::*; #[test] fn live_query_is_dropped_after_smart_contract_end() -> Result<()> { @@ -13,7 +13,7 @@ fn live_query_is_dropped_after_smart_contract_end() -> Result<()> { wait_for_genesis_committed(&[client.clone()], 0); let wasm = iroha_wasm_builder::Builder::new( - "tests/integration/smartcontracts/query_assets_and_save_cursor", + "../../samples/smart_contracts/query_assets_and_save_cursor", ) .show_output() .build()? @@ -50,7 +50,7 @@ fn smart_contract_can_filter_queries() -> Result<()> { wait_for_genesis_committed(&[client.clone()], 0); let wasm = iroha_wasm_builder::Builder::new( - "tests/integration/smartcontracts/smart_contract_can_filter_queries", + "../../samples/smart_contracts/query_and_filter_asset_definitions", ) .show_output() .build()? diff --git a/client/tests/integration/roles.rs b/libs/iroha/tests/integration/roles.rs similarity index 98% rename from client/tests/integration/roles.rs rename to libs/iroha/tests/integration/roles.rs index 17c935c7f5c..d95052e9c62 100644 --- a/client/tests/integration/roles.rs +++ b/libs/iroha/tests/integration/roles.rs @@ -1,15 +1,15 @@ -use executor_custom_data_model::permissions::CanControlDomainLives; use eyre::Result; use iroha::{ client::{self, QueryResult}, data_model::{prelude::*, transaction::error::TransactionRejectionReason}, }; +use iroha_executor_custom_data_model::permissions::CanControlDomainLives; use iroha_executor_data_model::permission::account::{ CanRemoveKeyValueInAccount, CanSetKeyValueInAccount, }; +use iroha_test_network::*; +use iroha_test_samples::{gen_account_in, ALICE_ID}; use serde_json::json; -use test_network::*; -use test_samples::{gen_account_in, ALICE_ID}; #[test] fn register_empty_role() -> Result<()> { diff --git a/client/tests/integration/set_parameter.rs b/libs/iroha/tests/integration/set_parameter.rs similarity index 97% rename from client/tests/integration/set_parameter.rs rename to libs/iroha/tests/integration/set_parameter.rs index ec376d3f817..5fc30bc94ae 100644 --- a/client/tests/integration/set_parameter.rs +++ b/libs/iroha/tests/integration/set_parameter.rs @@ -8,7 +8,7 @@ use iroha::{ prelude::*, }, }; -use test_network::*; +use iroha_test_network::*; #[test] fn can_change_parameter_value() -> Result<()> { diff --git a/client/tests/integration/sorting.rs b/libs/iroha/tests/integration/sorting.rs similarity index 99% rename from client/tests/integration/sorting.rs rename to libs/iroha/tests/integration/sorting.rs index bae12a3ed30..91bb73a15d6 100644 --- a/client/tests/integration/sorting.rs +++ b/libs/iroha/tests/integration/sorting.rs @@ -13,10 +13,10 @@ use iroha::{ }, }, }; +use iroha_test_network::*; +use iroha_test_samples::ALICE_ID; use nonzero_ext::nonzero; use rand::{seq::SliceRandom, thread_rng}; -use test_network::*; -use test_samples::ALICE_ID; #[test] #[ignore] diff --git a/client/tests/integration/status_response.rs b/libs/iroha/tests/integration/status_response.rs similarity index 96% rename from client/tests/integration/status_response.rs rename to libs/iroha/tests/integration/status_response.rs index 9136ee61d4c..0edc45866a6 100644 --- a/client/tests/integration/status_response.rs +++ b/libs/iroha/tests/integration/status_response.rs @@ -3,8 +3,8 @@ use std::str::FromStr as _; use eyre::Result; use iroha::{data_model::prelude::*, samples::get_status_json}; use iroha_telemetry::metrics::Status; -use test_network::*; -use test_samples::gen_account_in; +use iroha_test_network::*; +use iroha_test_samples::gen_account_in; fn status_eq_excluding_uptime_and_queue(lhs: &Status, rhs: &Status) -> bool { lhs.peers == rhs.peers diff --git a/client/tests/integration/transfer_asset.rs b/libs/iroha/tests/integration/transfer_asset.rs similarity index 98% rename from client/tests/integration/transfer_asset.rs rename to libs/iroha/tests/integration/transfer_asset.rs index 021e5be1b79..11bb627a823 100644 --- a/client/tests/integration/transfer_asset.rs +++ b/libs/iroha/tests/integration/transfer_asset.rs @@ -11,8 +11,8 @@ use iroha::{ Registered, }, }; -use test_network::*; -use test_samples::{gen_account_in, ALICE_ID}; +use iroha_test_network::*; +use iroha_test_samples::{gen_account_in, ALICE_ID}; #[test] // This test suite is also covered at the UI level in the iroha_cli tests diff --git a/client/tests/integration/transfer_domain.rs b/libs/iroha/tests/integration/transfer_domain.rs similarity index 99% rename from client/tests/integration/transfer_domain.rs rename to libs/iroha/tests/integration/transfer_domain.rs index f6f62a1d60c..d2917562cfe 100644 --- a/client/tests/integration/transfer_domain.rs +++ b/libs/iroha/tests/integration/transfer_domain.rs @@ -13,8 +13,8 @@ use iroha_executor_data_model::permission::{ }; use iroha_genesis::GenesisBlock; use iroha_primitives::json::JsonString; -use test_network::{Peer as TestPeer, *}; -use test_samples::{gen_account_in, ALICE_ID, BOB_ID, SAMPLE_GENESIS_ACCOUNT_ID}; +use iroha_test_network::{Peer as TestPeer, *}; +use iroha_test_samples::{gen_account_in, ALICE_ID, BOB_ID, SAMPLE_GENESIS_ACCOUNT_ID}; use tokio::runtime::Runtime; #[test] diff --git a/client/tests/integration/triggers/by_call_trigger.rs b/libs/iroha/tests/integration/triggers/by_call_trigger.rs similarity index 96% rename from client/tests/integration/triggers/by_call_trigger.rs rename to libs/iroha/tests/integration/triggers/by_call_trigger.rs index 293982cee0e..720179e322f 100644 --- a/client/tests/integration/triggers/by_call_trigger.rs +++ b/libs/iroha/tests/integration/triggers/by_call_trigger.rs @@ -1,6 +1,5 @@ use std::{str::FromStr as _, sync::mpsc, thread, time::Duration}; -use executor_custom_data_model::mint_rose_args::MintRoseArgs; use eyre::{eyre, Result, WrapErr}; use iroha::{ client::{self, Client}, @@ -11,11 +10,12 @@ use iroha::{ transaction::{Executable, WasmSmartContract}, }, }; +use iroha_executor_custom_data_model::mint_rose_args::MintRoseArgs; use iroha_executor_data_model::permission::trigger::CanRegisterUserTrigger; use iroha_genesis::GenesisBlock; use iroha_logger::info; -use test_network::{Peer as TestPeer, *}; -use test_samples::ALICE_ID; +use iroha_test_network::{Peer as TestPeer, *}; +use iroha_test_samples::ALICE_ID; use tokio::runtime::Runtime; const TRIGGER_NAME: &str = "mint_rose"; @@ -413,12 +413,11 @@ fn trigger_in_genesis_using_base64() -> Result<()> { // Building wasm trigger info!("Building trigger"); - let wasm = - iroha_wasm_builder::Builder::new("tests/integration/smartcontracts/mint_rose_trigger") - .show_output() - .build()? - .optimize()? - .into_bytes()?; + let wasm = iroha_wasm_builder::Builder::new("../../samples/triggers/mint_rose_trigger") + .show_output() + .build()? + .optimize()? + .into_bytes()?; info!("WASM size is {} bytes", wasm.len()); @@ -579,12 +578,11 @@ fn unregistering_one_of_two_triggers_with_identical_wasm_should_not_cause_origin let first_trigger_id = TriggerId::from_str("mint_rose_1")?; let second_trigger_id = TriggerId::from_str("mint_rose_2")?; - let wasm = - iroha_wasm_builder::Builder::new("tests/integration/smartcontracts/mint_rose_trigger") - .show_output() - .build()? - .optimize()? - .into_bytes()?; + let wasm = iroha_wasm_builder::Builder::new("../../samples/triggers/mint_rose_trigger") + .show_output() + .build()? + .optimize()? + .into_bytes()?; let wasm = WasmSmartContract::from_compiled(wasm); let build_trigger = |trigger_id: TriggerId| { @@ -661,12 +659,11 @@ fn call_execute_trigger_with_args() -> Result<()> { let prev_value = get_asset_value(&mut test_client, asset_id.clone()); let trigger_id = TriggerId::from_str(TRIGGER_NAME)?; - let wasm = - iroha_wasm_builder::Builder::new("tests/integration/smartcontracts/mint_rose_trigger_args") - .show_output() - .build()? - .optimize()? - .into_bytes()?; + let wasm = iroha_wasm_builder::Builder::new("../../samples/triggers/mint_rose_trigger_args") + .show_output() + .build()? + .optimize()? + .into_bytes()?; let wasm = WasmSmartContract::from_compiled(wasm); let trigger = Trigger::new( trigger_id.clone(), diff --git a/client/tests/integration/triggers/data_trigger.rs b/libs/iroha/tests/integration/triggers/data_trigger.rs similarity index 96% rename from client/tests/integration/triggers/data_trigger.rs rename to libs/iroha/tests/integration/triggers/data_trigger.rs index 06ce5a2400e..25dc74961c6 100644 --- a/client/tests/integration/triggers/data_trigger.rs +++ b/libs/iroha/tests/integration/triggers/data_trigger.rs @@ -1,7 +1,7 @@ use eyre::Result; use iroha::{client, data_model::prelude::*}; -use test_network::*; -use test_samples::{gen_account_in, ALICE_ID}; +use iroha_test_network::*; +use iroha_test_samples::{gen_account_in, ALICE_ID}; #[test] fn must_execute_both_triggers() -> Result<()> { diff --git a/client/tests/integration/triggers/event_trigger.rs b/libs/iroha/tests/integration/triggers/event_trigger.rs similarity index 96% rename from client/tests/integration/triggers/event_trigger.rs rename to libs/iroha/tests/integration/triggers/event_trigger.rs index 0221d770139..dc773f32fb2 100644 --- a/client/tests/integration/triggers/event_trigger.rs +++ b/libs/iroha/tests/integration/triggers/event_trigger.rs @@ -3,8 +3,8 @@ use iroha::{ client::{self, Client}, data_model::prelude::*, }; -use test_network::*; -use test_samples::ALICE_ID; +use iroha_test_network::*; +use iroha_test_samples::ALICE_ID; #[test] fn test_mint_asset_when_new_asset_definition_created() -> Result<()> { diff --git a/client/tests/integration/triggers/mod.rs b/libs/iroha/tests/integration/triggers/mod.rs similarity index 100% rename from client/tests/integration/triggers/mod.rs rename to libs/iroha/tests/integration/triggers/mod.rs diff --git a/client/tests/integration/triggers/orphans.rs b/libs/iroha/tests/integration/triggers/orphans.rs similarity index 95% rename from client/tests/integration/triggers/orphans.rs rename to libs/iroha/tests/integration/triggers/orphans.rs index 93f6f17e4fa..7455569e13e 100644 --- a/client/tests/integration/triggers/orphans.rs +++ b/libs/iroha/tests/integration/triggers/orphans.rs @@ -2,8 +2,8 @@ use iroha::{ client::{trigger, Client}, data_model::prelude::*, }; -use test_network::{wait_for_genesis_committed, Peer, PeerBuilder}; -use test_samples::gen_account_in; +use iroha_test_network::{wait_for_genesis_committed, Peer, PeerBuilder}; +use iroha_test_samples::gen_account_in; use tokio::runtime::Runtime; fn find_trigger(iroha: &Client, trigger_id: TriggerId) -> Option { diff --git a/client/tests/integration/triggers/time_trigger.rs b/libs/iroha/tests/integration/triggers/time_trigger.rs similarity index 97% rename from client/tests/integration/triggers/time_trigger.rs rename to libs/iroha/tests/integration/triggers/time_trigger.rs index c77ca97eea9..7ddffc53acb 100644 --- a/client/tests/integration/triggers/time_trigger.rs +++ b/libs/iroha/tests/integration/triggers/time_trigger.rs @@ -13,8 +13,8 @@ use iroha::{ }, }; use iroha_logger::info; -use test_network::*; -use test_samples::{gen_account_in, ALICE_ID}; +use iroha_test_network::*; +use iroha_test_samples::{gen_account_in, ALICE_ID}; /// Default estimation of consensus duration. pub fn default_consensus_estimation() -> Duration { @@ -220,13 +220,11 @@ fn mint_nft_for_every_user_every_1_sec() -> Result<()> { const EXPECTED_COUNT: u64 = 4; info!("Building trigger"); - let wasm = iroha_wasm_builder::Builder::new( - "tests/integration/smartcontracts/create_nft_for_every_user_trigger", - ) - .show_output() - .build()? - .optimize()? - .into_bytes()?; + let wasm = iroha_wasm_builder::Builder::new("../../samples/triggers/create_nft_for_every_user") + .show_output() + .build()? + .optimize()? + .into_bytes()?; info!("WASM size is {} bytes", wasm.len()); diff --git a/client/tests/integration/triggers/trigger_rollback.rs b/libs/iroha/tests/integration/triggers/trigger_rollback.rs similarity index 96% rename from client/tests/integration/triggers/trigger_rollback.rs rename to libs/iroha/tests/integration/triggers/trigger_rollback.rs index 754b19e0118..7bc9e3eda1c 100644 --- a/client/tests/integration/triggers/trigger_rollback.rs +++ b/libs/iroha/tests/integration/triggers/trigger_rollback.rs @@ -5,8 +5,8 @@ use iroha::{ client::QueryResult, data_model::{prelude::*, query::asset::FindAllAssetsDefinitions, trigger::TriggerId}, }; -use test_network::*; -use test_samples::ALICE_ID; +use iroha_test_network::*; +use iroha_test_samples::ALICE_ID; #[test] fn failed_trigger_revert() -> Result<()> { diff --git a/client/tests/integration/tx_chain_id.rs b/libs/iroha/tests/integration/tx_chain_id.rs similarity index 97% rename from client/tests/integration/tx_chain_id.rs rename to libs/iroha/tests/integration/tx_chain_id.rs index d8654725f32..974211e668b 100644 --- a/client/tests/integration/tx_chain_id.rs +++ b/libs/iroha/tests/integration/tx_chain_id.rs @@ -1,7 +1,7 @@ use iroha::data_model::prelude::*; use iroha_primitives::numeric::numeric; -use test_network::*; -use test_samples::gen_account_in; +use iroha_test_network::*; +use iroha_test_samples::gen_account_in; #[test] fn send_tx_with_different_chain_id() { diff --git a/client/tests/integration/tx_history.rs b/libs/iroha/tests/integration/tx_history.rs similarity index 97% rename from client/tests/integration/tx_history.rs rename to libs/iroha/tests/integration/tx_history.rs index be415f90eae..afbc8a58546 100644 --- a/client/tests/integration/tx_history.rs +++ b/libs/iroha/tests/integration/tx_history.rs @@ -6,9 +6,9 @@ use iroha::{ data_model::{prelude::*, query::Pagination}, }; use iroha_config::parameters::actual::Root as Config; +use iroha_test_network::*; +use iroha_test_samples::ALICE_ID; use nonzero_ext::nonzero; -use test_network::*; -use test_samples::ALICE_ID; #[ignore = "ignore, more in #2851"] #[test] diff --git a/client/tests/integration/tx_rollback.rs b/libs/iroha/tests/integration/tx_rollback.rs similarity index 96% rename from client/tests/integration/tx_rollback.rs rename to libs/iroha/tests/integration/tx_rollback.rs index b5afbbec927..393f0f8309d 100644 --- a/client/tests/integration/tx_rollback.rs +++ b/libs/iroha/tests/integration/tx_rollback.rs @@ -5,8 +5,8 @@ use iroha::{ client::{self, QueryResult}, data_model::prelude::*, }; -use test_network::*; -use test_samples::ALICE_ID; +use iroha_test_network::*; +use iroha_test_samples::ALICE_ID; #[test] fn client_sends_transaction_with_invalid_instruction_should_not_see_any_changes() -> Result<()> { diff --git a/client/tests/integration/upgrade.rs b/libs/iroha/tests/integration/upgrade.rs similarity index 91% rename from client/tests/integration/upgrade.rs rename to libs/iroha/tests/integration/upgrade.rs index 6baf7396168..26eefd09cd1 100644 --- a/client/tests/integration/upgrade.rs +++ b/libs/iroha/tests/integration/upgrade.rs @@ -1,6 +1,5 @@ use std::path::Path; -use executor_custom_data_model::permissions::CanControlDomainLives; use eyre::Result; use futures_util::TryStreamExt as _; use iroha::{ @@ -10,11 +9,12 @@ use iroha::{ prelude::*, }, }; +use iroha_executor_custom_data_model::permissions::CanControlDomainLives; use iroha_executor_data_model::permission::{domain::CanUnregisterDomain, Permission as _}; use iroha_logger::info; +use iroha_test_network::*; +use iroha_test_samples::{ALICE_ID, BOB_ID}; use nonzero_ext::nonzero; -use test_network::*; -use test_samples::{ALICE_ID, BOB_ID}; const ADMIN_PUBLIC_KEY_MULTIHASH: &str = "ed012076E5CA9698296AF9BE2CA45F525CB3BCFDEB7EE068BA56F973E9DD90564EF4FC"; @@ -54,10 +54,7 @@ fn executor_upgrade_should_work() -> Result<()> { .submit_transaction_blocking(&transfer_rose_tx) .expect_err("Should fail"); - upgrade_executor( - &client, - "tests/integration/smartcontracts/executor_with_admin", - )?; + upgrade_executor(&client, "../../samples/executors/admin")?; // Check that admin can transfer alice's rose now // Creating new transaction instead of cloning, because we need to update it's creation time @@ -98,10 +95,7 @@ fn executor_upgrade_should_run_migration() -> Result<()> { .is_ok_and(|permission| permission == can_unregister_domain) })); - upgrade_executor( - &client, - "tests/integration/smartcontracts/executor_with_custom_permission", - )?; + upgrade_executor(&client, "../../samples/executors/custom_permission")?; // Check that `CanUnregisterDomain` doesn't exist let data_model = client.request(FindExecutorDataModel)?; @@ -175,10 +169,7 @@ fn executor_upgrade_should_revoke_removed_permissions() -> Result<()> { .is_ok_and(|permission| permission == can_unregister_domain) })); - upgrade_executor( - &client, - "tests/integration/smartcontracts/executor_remove_permission", - )?; + upgrade_executor(&client, "../../samples/executors/remove_permission")?; // Check that permission doesn't exist assert!(!client @@ -215,14 +206,14 @@ fn executor_upgrade_should_revoke_removed_permissions() -> Result<()> { #[test] fn executor_custom_instructions_simple() -> Result<()> { - use executor_custom_data_model::simple_isi::MintAssetForAllAccounts; + use iroha_executor_custom_data_model::simple_isi::MintAssetForAllAccounts; let (_rt, _peer, client) = ::new().with_port(11_270).start_with_runtime(); wait_for_genesis_committed(&vec![client.clone()], 0); upgrade_executor( &client, - "tests/integration/smartcontracts/executor_custom_instructions_simple", + "../../samples/executors/custom_instructions_simple", )?; let asset_definition_id: AssetDefinitionId = "rose#wonderland".parse().unwrap(); @@ -255,7 +246,7 @@ fn executor_custom_instructions_simple() -> Result<()> { #[test] fn executor_custom_instructions_complex() -> Result<()> { - use executor_custom_data_model::complex_isi::{ + use iroha_executor_custom_data_model::complex_isi::{ ConditionalExpr, CoreExpr, EvaluatesTo, Expression, Greater, }; @@ -268,7 +259,7 @@ fn executor_custom_instructions_complex() -> Result<()> { client.submit_blocking(executor_fuel_limit)?; upgrade_executor( &client, - "tests/integration/smartcontracts/executor_custom_instructions_complex", + "../../samples/executors/custom_instructions_complex", )?; // Give 6 roses to bob @@ -333,11 +324,8 @@ fn migration_fail_should_not_cause_any_effects() { "failed_migration_test_domain".parse().expect("Valid"); assert_domain_does_not_exist(&client, &domain_registered_in_migration); - let _err = upgrade_executor( - &client, - "tests/integration/smartcontracts/executor_with_migration_fail", - ) - .expect_err("Upgrade should fail due to migration failure"); + let _err = upgrade_executor(&client, "../../samples/executors/migration_fail") + .expect_err("Upgrade should fail due to migration failure"); // Checking that things registered in migration does not exist after failed migration assert_domain_does_not_exist(&client, &domain_registered_in_migration); @@ -368,11 +356,7 @@ fn migration_should_cause_upgrade_event() { } }); - upgrade_executor( - &client, - "tests/integration/smartcontracts/executor_with_custom_permission", - ) - .unwrap(); + upgrade_executor(&client, "../../samples/executors/custom_permission").unwrap(); rt.block_on(async { tokio::time::timeout(core::time::Duration::from_secs(60), task) @@ -384,7 +368,7 @@ fn migration_should_cause_upgrade_event() { #[test] fn define_custom_parameter() -> Result<()> { - use executor_custom_data_model::parameters::DomainLimits; + use iroha_executor_custom_data_model::parameters::DomainLimits; let (_rt, _peer, client) = ::new().with_port(11_325).start_with_runtime(); wait_for_genesis_committed(&vec![client.clone()], 0); @@ -393,11 +377,7 @@ fn define_custom_parameter() -> Result<()> { let create_domain = Register::domain(Domain::new(long_domain_name)); client.submit_blocking(create_domain)?; - upgrade_executor( - &client, - "tests/integration/smartcontracts/executor_with_custom_parameter", - ) - .unwrap(); + upgrade_executor(&client, "../../samples/executors/custom_parameter").unwrap(); let too_long_domain_name = "1".repeat(2_usize.pow(5)).parse::()?; let create_domain = Register::domain(Domain::new(too_long_domain_name)); diff --git a/client/tests/mod.rs b/libs/iroha/tests/mod.rs similarity index 100% rename from client/tests/mod.rs rename to libs/iroha/tests/mod.rs diff --git a/client/tests/ui.rs b/libs/iroha/tests/ui.rs similarity index 100% rename from client/tests/ui.rs rename to libs/iroha/tests/ui.rs diff --git a/client/tests/ui_fail/cant_filter_singular_query.rs b/libs/iroha/tests/ui_fail/cant_filter_singular_query.rs similarity index 100% rename from client/tests/ui_fail/cant_filter_singular_query.rs rename to libs/iroha/tests/ui_fail/cant_filter_singular_query.rs diff --git a/client/tests/ui_fail/cant_filter_singular_query.stderr b/libs/iroha/tests/ui_fail/cant_filter_singular_query.stderr similarity index 94% rename from client/tests/ui_fail/cant_filter_singular_query.stderr rename to libs/iroha/tests/ui_fail/cant_filter_singular_query.stderr index b3388ad62ca..4cfb45b97ff 100644 --- a/client/tests/ui_fail/cant_filter_singular_query.stderr +++ b/libs/iroha/tests/ui_fail/cant_filter_singular_query.stderr @@ -9,7 +9,7 @@ error[E0599]: the method `with_filter` exists for struct `QueryRequestBuilder<'_ | |_________| | | - ::: $WORKSPACE/data_model/src/query/mod.rs + ::: $WORKSPACE/libs/iroha_data_model/src/query/mod.rs | | / queries! { | | /// [`FindAllDomains`] Iroha Query finds all [`Domain`]s presented in Iroha [`Peer`]. diff --git a/libs/iroha_config/Cargo.toml b/libs/iroha_config/Cargo.toml new file mode 100644 index 00000000000..4c6a28b0ac1 --- /dev/null +++ b/libs/iroha_config/Cargo.toml @@ -0,0 +1,43 @@ +[package] +name = "iroha_config" + +edition.workspace = true +version.workspace = true +authors.workspace = true + +license.workspace = true + +[lints] +workspace = true + +[dependencies] +iroha_config_base.workspace = true +iroha_data_model.workspace = true +iroha_primitives.workspace = true +iroha_crypto.workspace = true +iroha_genesis.workspace = true + +error-stack.workspace = true +tracing.workspace = true +tracing-subscriber = { workspace = true, features = ["fmt", "ansi", "env-filter"] } +url = { workspace = true, features = ["serde"] } + +serde = { workspace = true, features = ["derive"] } +serde_with.workspace = true +strum = { workspace = true, features = ["derive"] } +serde_json.workspace = true +json5.workspace = true +thiserror.workspace = true +displaydoc.workspace = true +derive_more.workspace = true +cfg-if.workspace = true +once_cell.workspace = true +nonzero_ext.workspace = true +hex = { workspace = true, features = ["std"] } + +# for tracing +stderrlog = "0.6.0" + +[dev-dependencies] +expect-test.workspace = true +assertables.workspace = true diff --git a/config/base/Cargo.toml b/libs/iroha_config/base/Cargo.toml similarity index 79% rename from config/base/Cargo.toml rename to libs/iroha_config/base/Cargo.toml index aa41d9b9162..09615524b8e 100644 --- a/config/base/Cargo.toml +++ b/libs/iroha_config/base/Cargo.toml @@ -13,18 +13,18 @@ workspace = true [dependencies] iroha_config_base_derive = { path = "derive" } -drop_bomb = { workspace = true } +drop_bomb.workspace = true serde = { workspace = true, features = ["derive"] } serde_with = { workspace = true, features = ["macros", "std"] } -thiserror = { workspace = true } +thiserror.workspace = true num-traits = "0.2.19" -toml = { workspace = true } -error-stack = { workspace = true } +toml.workspace = true +error-stack.workspace = true log = "0.4" derive_more = { workspace = true, features = ["constructor", "display"] } [dev-dependencies] -expect-test = { workspace = true } +expect-test.workspace = true strum = { workspace = true, features = ["derive", "std"] } hex = { workspace = true, features = ["std"] } serde_with = { workspace = true, features = ["hex"] } diff --git a/config/base/derive/Cargo.toml b/libs/iroha_config/base/derive/Cargo.toml similarity index 57% rename from config/base/derive/Cargo.toml rename to libs/iroha_config/base/derive/Cargo.toml index ec87ac8c2c8..6e2df508df5 100644 --- a/config/base/derive/Cargo.toml +++ b/libs/iroha_config/base/derive/Cargo.toml @@ -15,14 +15,14 @@ proc-macro = true [dependencies] syn = { workspace = true, features = ["default", "full", "extra-traits", "visit-mut"] } -quote = { workspace = true } -darling = { workspace = true } -proc-macro2 = { workspace = true } -manyhow = { workspace = true } -iroha_macro_utils = { workspace = true } +quote.workspace = true +darling.workspace = true +proc-macro2.workspace = true +manyhow.workspace = true +iroha_macro_utils.workspace = true [dev-dependencies] -trybuild = { workspace = true } -iroha_config_base = { workspace = true } -expect-test = { workspace = true } +trybuild.workspace = true +iroha_config_base.workspace = true +expect-test.workspace = true serde = { workspace = true, features = ["derive"] } diff --git a/config/base/derive/src/lib.rs b/libs/iroha_config/base/derive/src/lib.rs similarity index 100% rename from config/base/derive/src/lib.rs rename to libs/iroha_config/base/derive/src/lib.rs diff --git a/config/base/derive/tests/ui.rs b/libs/iroha_config/base/derive/tests/ui.rs similarity index 100% rename from config/base/derive/tests/ui.rs rename to libs/iroha_config/base/derive/tests/ui.rs diff --git a/config/base/derive/tests/ui_fail/generics.rs b/libs/iroha_config/base/derive/tests/ui_fail/generics.rs similarity index 100% rename from config/base/derive/tests/ui_fail/generics.rs rename to libs/iroha_config/base/derive/tests/ui_fail/generics.rs diff --git a/config/base/derive/tests/ui_fail/generics.stderr b/libs/iroha_config/base/derive/tests/ui_fail/generics.stderr similarity index 100% rename from config/base/derive/tests/ui_fail/generics.stderr rename to libs/iroha_config/base/derive/tests/ui_fail/generics.stderr diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_commas.rs b/libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_commas.rs similarity index 100% rename from config/base/derive/tests/ui_fail/invalid_attrs_commas.rs rename to libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_commas.rs diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_commas.stderr b/libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_commas.stderr similarity index 100% rename from config/base/derive/tests/ui_fail/invalid_attrs_commas.stderr rename to libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_commas.stderr diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_conflicts.rs b/libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_conflicts.rs similarity index 100% rename from config/base/derive/tests/ui_fail/invalid_attrs_conflicts.rs rename to libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_conflicts.rs diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_conflicts.stderr b/libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_conflicts.stderr similarity index 100% rename from config/base/derive/tests/ui_fail/invalid_attrs_conflicts.stderr rename to libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_conflicts.stderr diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_default_invalid_expr.rs b/libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_default_invalid_expr.rs similarity index 100% rename from config/base/derive/tests/ui_fail/invalid_attrs_default_invalid_expr.rs rename to libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_default_invalid_expr.rs diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_default_invalid_expr.stderr b/libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_default_invalid_expr.stderr similarity index 100% rename from config/base/derive/tests/ui_fail/invalid_attrs_default_invalid_expr.stderr rename to libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_default_invalid_expr.stderr diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_env_without_var.rs b/libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_env_without_var.rs similarity index 100% rename from config/base/derive/tests/ui_fail/invalid_attrs_env_without_var.rs rename to libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_env_without_var.rs diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_env_without_var.stderr b/libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_env_without_var.stderr similarity index 100% rename from config/base/derive/tests/ui_fail/invalid_attrs_env_without_var.stderr rename to libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_env_without_var.stderr diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_no_comma_between_attrs.rs b/libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_no_comma_between_attrs.rs similarity index 100% rename from config/base/derive/tests/ui_fail/invalid_attrs_no_comma_between_attrs.rs rename to libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_no_comma_between_attrs.rs diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_no_comma_between_attrs.stderr b/libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_no_comma_between_attrs.stderr similarity index 100% rename from config/base/derive/tests/ui_fail/invalid_attrs_no_comma_between_attrs.stderr rename to libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_no_comma_between_attrs.stderr diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_struct.rs b/libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_struct.rs similarity index 100% rename from config/base/derive/tests/ui_fail/invalid_attrs_struct.rs rename to libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_struct.rs diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_struct.stderr b/libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_struct.stderr similarity index 100% rename from config/base/derive/tests/ui_fail/invalid_attrs_struct.stderr rename to libs/iroha_config/base/derive/tests/ui_fail/invalid_attrs_struct.stderr diff --git a/config/base/derive/tests/ui_fail/unsupported_shapes.rs b/libs/iroha_config/base/derive/tests/ui_fail/unsupported_shapes.rs similarity index 100% rename from config/base/derive/tests/ui_fail/unsupported_shapes.rs rename to libs/iroha_config/base/derive/tests/ui_fail/unsupported_shapes.rs diff --git a/config/base/derive/tests/ui_fail/unsupported_shapes.stderr b/libs/iroha_config/base/derive/tests/ui_fail/unsupported_shapes.stderr similarity index 100% rename from config/base/derive/tests/ui_fail/unsupported_shapes.stderr rename to libs/iroha_config/base/derive/tests/ui_fail/unsupported_shapes.stderr diff --git a/config/base/derive/tests/ui_pass/happy_path.rs b/libs/iroha_config/base/derive/tests/ui_pass/happy_path.rs similarity index 100% rename from config/base/derive/tests/ui_pass/happy_path.rs rename to libs/iroha_config/base/derive/tests/ui_pass/happy_path.rs diff --git a/config/base/src/attach.rs b/libs/iroha_config/base/src/attach.rs similarity index 100% rename from config/base/src/attach.rs rename to libs/iroha_config/base/src/attach.rs diff --git a/config/base/src/env.rs b/libs/iroha_config/base/src/env.rs similarity index 100% rename from config/base/src/env.rs rename to libs/iroha_config/base/src/env.rs diff --git a/config/base/src/lib.rs b/libs/iroha_config/base/src/lib.rs similarity index 100% rename from config/base/src/lib.rs rename to libs/iroha_config/base/src/lib.rs diff --git a/config/base/src/read.rs b/libs/iroha_config/base/src/read.rs similarity index 100% rename from config/base/src/read.rs rename to libs/iroha_config/base/src/read.rs diff --git a/config/base/src/toml.rs b/libs/iroha_config/base/src/toml.rs similarity index 100% rename from config/base/src/toml.rs rename to libs/iroha_config/base/src/toml.rs diff --git a/config/base/src/util.rs b/libs/iroha_config/base/src/util.rs similarity index 100% rename from config/base/src/util.rs rename to libs/iroha_config/base/src/util.rs diff --git a/config/base/tests/bad.invalid-extends.toml b/libs/iroha_config/base/tests/bad.invalid-extends.toml similarity index 100% rename from config/base/tests/bad.invalid-extends.toml rename to libs/iroha_config/base/tests/bad.invalid-extends.toml diff --git a/config/base/tests/bad.invalid-nested-extends.base.toml b/libs/iroha_config/base/tests/bad.invalid-nested-extends.base.toml similarity index 100% rename from config/base/tests/bad.invalid-nested-extends.base.toml rename to libs/iroha_config/base/tests/bad.invalid-nested-extends.base.toml diff --git a/config/base/tests/bad.invalid-nested-extends.toml b/libs/iroha_config/base/tests/bad.invalid-nested-extends.toml similarity index 100% rename from config/base/tests/bad.invalid-nested-extends.toml rename to libs/iroha_config/base/tests/bad.invalid-nested-extends.toml diff --git a/config/base/tests/misc.rs b/libs/iroha_config/base/tests/misc.rs similarity index 100% rename from config/base/tests/misc.rs rename to libs/iroha_config/base/tests/misc.rs diff --git a/config/iroha_test_config.toml b/libs/iroha_config/iroha_test_config.toml similarity index 100% rename from config/iroha_test_config.toml rename to libs/iroha_config/iroha_test_config.toml diff --git a/config/src/client_api.rs b/libs/iroha_config/src/client_api.rs similarity index 100% rename from config/src/client_api.rs rename to libs/iroha_config/src/client_api.rs diff --git a/config/src/kura.rs b/libs/iroha_config/src/kura.rs similarity index 100% rename from config/src/kura.rs rename to libs/iroha_config/src/kura.rs diff --git a/config/src/lib.rs b/libs/iroha_config/src/lib.rs similarity index 100% rename from config/src/lib.rs rename to libs/iroha_config/src/lib.rs diff --git a/config/src/logger.rs b/libs/iroha_config/src/logger.rs similarity index 100% rename from config/src/logger.rs rename to libs/iroha_config/src/logger.rs diff --git a/config/src/parameters/actual.rs b/libs/iroha_config/src/parameters/actual.rs similarity index 100% rename from config/src/parameters/actual.rs rename to libs/iroha_config/src/parameters/actual.rs diff --git a/config/src/parameters/defaults.rs b/libs/iroha_config/src/parameters/defaults.rs similarity index 100% rename from config/src/parameters/defaults.rs rename to libs/iroha_config/src/parameters/defaults.rs diff --git a/config/src/parameters/mod.rs b/libs/iroha_config/src/parameters/mod.rs similarity index 100% rename from config/src/parameters/mod.rs rename to libs/iroha_config/src/parameters/mod.rs diff --git a/config/src/parameters/user.rs b/libs/iroha_config/src/parameters/user.rs similarity index 100% rename from config/src/parameters/user.rs rename to libs/iroha_config/src/parameters/user.rs diff --git a/config/src/snapshot.rs b/libs/iroha_config/src/snapshot.rs similarity index 100% rename from config/src/snapshot.rs rename to libs/iroha_config/src/snapshot.rs diff --git a/config/src/wasm.rs b/libs/iroha_config/src/wasm.rs similarity index 100% rename from config/src/wasm.rs rename to libs/iroha_config/src/wasm.rs diff --git a/config/tests/fixtures.rs b/libs/iroha_config/tests/fixtures.rs similarity index 100% rename from config/tests/fixtures.rs rename to libs/iroha_config/tests/fixtures.rs diff --git a/config/tests/fixtures/absolute_paths.toml b/libs/iroha_config/tests/fixtures/absolute_paths.toml similarity index 100% rename from config/tests/fixtures/absolute_paths.toml rename to libs/iroha_config/tests/fixtures/absolute_paths.toml diff --git a/config/tests/fixtures/bad.extra_fields.toml b/libs/iroha_config/tests/fixtures/bad.extra_fields.toml similarity index 100% rename from config/tests/fixtures/bad.extra_fields.toml rename to libs/iroha_config/tests/fixtures/bad.extra_fields.toml diff --git a/config/tests/fixtures/bad.missing_fields.toml b/libs/iroha_config/tests/fixtures/bad.missing_fields.toml similarity index 100% rename from config/tests/fixtures/bad.missing_fields.toml rename to libs/iroha_config/tests/fixtures/bad.missing_fields.toml diff --git a/config/tests/fixtures/bad.multiple_bad_envs.env b/libs/iroha_config/tests/fixtures/bad.multiple_bad_envs.env similarity index 100% rename from config/tests/fixtures/bad.multiple_bad_envs.env rename to libs/iroha_config/tests/fixtures/bad.multiple_bad_envs.env diff --git a/config/tests/fixtures/bad.torii_addr_eq_p2p_addr.toml b/libs/iroha_config/tests/fixtures/bad.torii_addr_eq_p2p_addr.toml similarity index 100% rename from config/tests/fixtures/bad.torii_addr_eq_p2p_addr.toml rename to libs/iroha_config/tests/fixtures/bad.torii_addr_eq_p2p_addr.toml diff --git a/config/tests/fixtures/base.toml b/libs/iroha_config/tests/fixtures/base.toml similarity index 100% rename from config/tests/fixtures/base.toml rename to libs/iroha_config/tests/fixtures/base.toml diff --git a/config/tests/fixtures/base_trusted_peers.toml b/libs/iroha_config/tests/fixtures/base_trusted_peers.toml similarity index 100% rename from config/tests/fixtures/base_trusted_peers.toml rename to libs/iroha_config/tests/fixtures/base_trusted_peers.toml diff --git a/config/tests/fixtures/full.env b/libs/iroha_config/tests/fixtures/full.env similarity index 100% rename from config/tests/fixtures/full.env rename to libs/iroha_config/tests/fixtures/full.env diff --git a/config/tests/fixtures/full.toml b/libs/iroha_config/tests/fixtures/full.toml similarity index 100% rename from config/tests/fixtures/full.toml rename to libs/iroha_config/tests/fixtures/full.toml diff --git a/config/tests/fixtures/minimal_alone_with_genesis.toml b/libs/iroha_config/tests/fixtures/minimal_alone_with_genesis.toml similarity index 100% rename from config/tests/fixtures/minimal_alone_with_genesis.toml rename to libs/iroha_config/tests/fixtures/minimal_alone_with_genesis.toml diff --git a/config/tests/fixtures/minimal_file_and_env.env b/libs/iroha_config/tests/fixtures/minimal_file_and_env.env similarity index 100% rename from config/tests/fixtures/minimal_file_and_env.env rename to libs/iroha_config/tests/fixtures/minimal_file_and_env.env diff --git a/config/tests/fixtures/minimal_file_and_env.toml b/libs/iroha_config/tests/fixtures/minimal_file_and_env.toml similarity index 100% rename from config/tests/fixtures/minimal_file_and_env.toml rename to libs/iroha_config/tests/fixtures/minimal_file_and_env.toml diff --git a/config/tests/fixtures/minimal_with_trusted_peers.toml b/libs/iroha_config/tests/fixtures/minimal_with_trusted_peers.toml similarity index 100% rename from config/tests/fixtures/minimal_with_trusted_peers.toml rename to libs/iroha_config/tests/fixtures/minimal_with_trusted_peers.toml diff --git a/core/Cargo.toml b/libs/iroha_core/Cargo.toml similarity index 68% rename from core/Cargo.toml rename to libs/iroha_core/Cargo.toml index 5a83eef9911..b8bc7a3923f 100644 --- a/core/Cargo.toml +++ b/libs/iroha_core/Cargo.toml @@ -34,47 +34,47 @@ maintenance = { status = "actively-developed" } [dependencies] iroha_data_model = { workspace = true, features = ["transparent_api"] } -iroha_macro = { workspace = true } -iroha_p2p = { workspace = true } -iroha_logger = { workspace = true } -iroha_crypto = { workspace = true } -iroha_version = { workspace = true } -iroha_config = { workspace = true } -iroha_futures = { workspace = true } -iroha_telemetry = { workspace = true } -iroha_primitives = { workspace = true } -iroha_genesis = { workspace = true } -iroha_wasm_codec = { workspace = true } +iroha_macro.workspace = true +iroha_p2p.workspace = true +iroha_logger.workspace = true +iroha_crypto.workspace = true +iroha_version.workspace = true +iroha_config.workspace = true +iroha_futures.workspace = true +iroha_telemetry.workspace = true +iroha_primitives.workspace = true +iroha_genesis.workspace = true +iroha_wasm_codec.workspace = true storage = { workspace = true, features = ["serde"] } -async-trait = { workspace = true } -dashmap = { workspace = true } -eyre = { workspace = true } +async-trait.workspace = true +dashmap.workspace = true +eyre.workspace = true futures = { workspace = true, features = ["std", "async-await"] } parity-scale-codec = { workspace = true, features = ["derive"] } -rand = { workspace = true } +rand.workspace = true serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } +serde_json.workspace = true tokio = { workspace = true, features = ["sync", "time", "rt", "io-util", "rt-multi-thread", "macros", "fs"] } -crossbeam-queue = { workspace = true } -thiserror = { workspace = true } -displaydoc = { workspace = true } -wasmtime = { workspace = true } +crossbeam-queue.workspace = true +thiserror.workspace = true +displaydoc.workspace = true +wasmtime.workspace = true parking_lot = { workspace = true, features = ["deadlock_detection"] } -derive_more = { workspace = true } -nonzero_ext = { workspace = true } +derive_more.workspace = true +nonzero_ext.workspace = true uuid = { version = "1.10.0", features = ["v4"] } indexmap = "2.2.6" [dev-dependencies] -iroha_executor_data_model = { workspace = true } -test_samples = { workspace = true } +iroha_executor_data_model.workspace = true +iroha_test_samples.workspace = true -criterion = { workspace = true } -hex = { workspace = true } -once_cell = { workspace = true } -tempfile = { workspace = true } +criterion.workspace = true +hex.workspace = true +once_cell.workspace = true +tempfile.workspace = true byte-unit = "5.1.4" diff --git a/core/benches/blocks/apply_blocks.rs b/libs/iroha_core/benches/blocks/apply_blocks.rs similarity index 98% rename from core/benches/blocks/apply_blocks.rs rename to libs/iroha_core/benches/blocks/apply_blocks.rs index b8ea2bd46a0..caab2cbc89f 100644 --- a/core/benches/blocks/apply_blocks.rs +++ b/libs/iroha_core/benches/blocks/apply_blocks.rs @@ -3,7 +3,7 @@ use iroha_core::{ block::CommittedBlock, prelude::*, state::State, sumeragi::network_topology::Topology, }; use iroha_data_model::peer::PeerId; -use test_samples::gen_account_in; +use iroha_test_samples::gen_account_in; #[path = "./common.rs"] mod common; diff --git a/core/benches/blocks/apply_blocks_benchmark.rs b/libs/iroha_core/benches/blocks/apply_blocks_benchmark.rs similarity index 100% rename from core/benches/blocks/apply_blocks_benchmark.rs rename to libs/iroha_core/benches/blocks/apply_blocks_benchmark.rs diff --git a/core/benches/blocks/apply_blocks_oneshot.rs b/libs/iroha_core/benches/blocks/apply_blocks_oneshot.rs similarity index 100% rename from core/benches/blocks/apply_blocks_oneshot.rs rename to libs/iroha_core/benches/blocks/apply_blocks_oneshot.rs diff --git a/core/benches/blocks/common.rs b/libs/iroha_core/benches/blocks/common.rs similarity index 100% rename from core/benches/blocks/common.rs rename to libs/iroha_core/benches/blocks/common.rs diff --git a/core/benches/blocks/validate_blocks.rs b/libs/iroha_core/benches/blocks/validate_blocks.rs similarity index 98% rename from core/benches/blocks/validate_blocks.rs rename to libs/iroha_core/benches/blocks/validate_blocks.rs index 47a495dbe40..6433a44f0e0 100644 --- a/core/benches/blocks/validate_blocks.rs +++ b/libs/iroha_core/benches/blocks/validate_blocks.rs @@ -1,6 +1,6 @@ use iroha_core::{prelude::*, state::State, sumeragi::network_topology::Topology}; use iroha_data_model::{isi::InstructionBox, prelude::*}; -use test_samples::gen_account_in; +use iroha_test_samples::gen_account_in; #[path = "./common.rs"] mod common; diff --git a/core/benches/blocks/validate_blocks_benchmark.rs b/libs/iroha_core/benches/blocks/validate_blocks_benchmark.rs similarity index 100% rename from core/benches/blocks/validate_blocks_benchmark.rs rename to libs/iroha_core/benches/blocks/validate_blocks_benchmark.rs diff --git a/core/benches/blocks/validate_blocks_oneshot.rs b/libs/iroha_core/benches/blocks/validate_blocks_oneshot.rs similarity index 100% rename from core/benches/blocks/validate_blocks_oneshot.rs rename to libs/iroha_core/benches/blocks/validate_blocks_oneshot.rs diff --git a/core/benches/kura.rs b/libs/iroha_core/benches/kura.rs similarity index 98% rename from core/benches/kura.rs rename to libs/iroha_core/benches/kura.rs index b16213b684b..10a2540bf1b 100644 --- a/core/benches/kura.rs +++ b/libs/iroha_core/benches/kura.rs @@ -15,8 +15,8 @@ use iroha_core::{ }; use iroha_crypto::KeyPair; use iroha_data_model::{parameter::TransactionParameters, prelude::*}; +use iroha_test_samples::gen_account_in; use nonzero_ext::nonzero; -use test_samples::gen_account_in; use tokio::{fs, runtime::Runtime}; async fn measure_block_size_for_n_executors(n_executors: u32) { diff --git a/core/benches/validation.rs b/libs/iroha_core/benches/validation.rs similarity index 99% rename from core/benches/validation.rs rename to libs/iroha_core/benches/validation.rs index 3f010144574..5385444409a 100644 --- a/core/benches/validation.rs +++ b/libs/iroha_core/benches/validation.rs @@ -15,9 +15,9 @@ use iroha_data_model::{ transaction::TransactionBuilder, }; use iroha_primitives::unique_vec::UniqueVec; +use iroha_test_samples::gen_account_in; use nonzero_ext::nonzero; use once_cell::sync::Lazy; -use test_samples::gen_account_in; static STARTER_DOMAIN: Lazy = Lazy::new(|| "start".parse().unwrap()); static STARTER_KEYPAIR: Lazy = Lazy::new(KeyPair::random); diff --git a/core/clippy.toml b/libs/iroha_core/clippy.toml similarity index 100% rename from core/clippy.toml rename to libs/iroha_core/clippy.toml diff --git a/core/test_network/Cargo.toml b/libs/iroha_core/iroha_test_network/Cargo.toml similarity index 92% rename from core/test_network/Cargo.toml rename to libs/iroha_core/iroha_test_network/Cargo.toml index 357ea5ce644..62f8cad7e0a 100644 --- a/core/test_network/Cargo.toml +++ b/libs/iroha_core/iroha_test_network/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "test_network" +name = "iroha_test_network" edition.workspace = true version.workspace = true @@ -19,7 +19,7 @@ iroha_data_model.workspace = true iroha_primitives.workspace = true iroha_logger.workspace = true iroha_genesis.workspace = true -test_samples.workspace = true +iroha_test_samples.workspace = true eyre.workspace = true rand.workspace = true diff --git a/core/test_network/src/lib.rs b/libs/iroha_core/iroha_test_network/src/lib.rs similarity index 99% rename from core/test_network/src/lib.rs rename to libs/iroha_core/iroha_test_network/src/lib.rs index 7bcb06598ba..4aeb206ae55 100644 --- a/core/test_network/src/lib.rs +++ b/libs/iroha_core/iroha_test_network/src/lib.rs @@ -28,10 +28,10 @@ use iroha_primitives::{ addr::{socket_addr, SocketAddr}, unique_vec::UniqueVec, }; +use iroha_test_samples::{ALICE_ID, ALICE_KEYPAIR, PEER_KEYPAIR, SAMPLE_GENESIS_ACCOUNT_KEYPAIR}; use irohad::Iroha; use rand::{prelude::SliceRandom, seq::IteratorRandom, thread_rng}; use tempfile::TempDir; -use test_samples::{ALICE_ID, ALICE_KEYPAIR, PEER_KEYPAIR, SAMPLE_GENESIS_ACCOUNT_KEYPAIR}; use tokio::{ runtime::{self, Runtime}, time, @@ -94,9 +94,10 @@ impl TestGenesis for GenesisBlock { // TODO: Fix this somehow. Probably we need to make `kagami` a library (#3253). let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); - let mut genesis = - RawGenesisTransaction::from_path(manifest_dir.join("../../configs/swarm/genesis.json")) - .expect("Failed to deserialize genesis block from file"); + let mut genesis = RawGenesisTransaction::from_path( + manifest_dir.join("../../../configs/swarm/genesis.json"), + ) + .expect("Failed to deserialize genesis block from file"); let rose_definition_id = "rose#wonderland".parse::().unwrap(); diff --git a/core/src/block.rs b/libs/iroha_core/src/block.rs similarity index 99% rename from core/src/block.rs rename to libs/iroha_core/src/block.rs index 6ed87ce18cc..bc38e7db3f6 100644 --- a/core/src/block.rs +++ b/libs/iroha_core/src/block.rs @@ -1019,7 +1019,7 @@ mod tests { use iroha_data_model::prelude::*; use iroha_genesis::GENESIS_DOMAIN_ID; use iroha_primitives::unique_vec::UniqueVec; - use test_samples::gen_account_in; + use iroha_test_samples::gen_account_in; use super::*; use crate::{ diff --git a/core/src/block_sync.rs b/libs/iroha_core/src/block_sync.rs similarity index 100% rename from core/src/block_sync.rs rename to libs/iroha_core/src/block_sync.rs diff --git a/core/src/executor.rs b/libs/iroha_core/src/executor.rs similarity index 100% rename from core/src/executor.rs rename to libs/iroha_core/src/executor.rs diff --git a/core/src/gossiper.rs b/libs/iroha_core/src/gossiper.rs similarity index 100% rename from core/src/gossiper.rs rename to libs/iroha_core/src/gossiper.rs diff --git a/core/src/kiso.rs b/libs/iroha_core/src/kiso.rs similarity index 97% rename from core/src/kiso.rs rename to libs/iroha_core/src/kiso.rs index 19982bc1949..ba8824cc686 100644 --- a/core/src/kiso.rs +++ b/libs/iroha_core/src/kiso.rs @@ -162,7 +162,9 @@ mod tests { fn test_config() -> Root { // if it fails, it is probably a bug ConfigReader::new() - .with_toml_source(TomlSource::from_file("../config/iroha_test_config.toml").unwrap()) + .with_toml_source( + TomlSource::from_file("../iroha_config/iroha_test_config.toml").unwrap(), + ) .read_and_complete::() .unwrap() .parse() diff --git a/core/src/kura.rs b/libs/iroha_core/src/kura.rs similarity index 100% rename from core/src/kura.rs rename to libs/iroha_core/src/kura.rs diff --git a/core/src/lib.rs b/libs/iroha_core/src/lib.rs similarity index 99% rename from core/src/lib.rs rename to libs/iroha_core/src/lib.rs index 0d25bf98ca7..2b31aea2ec5 100644 --- a/core/src/lib.rs +++ b/libs/iroha_core/src/lib.rs @@ -168,7 +168,7 @@ mod tests { use std::cmp::Ordering; use iroha_data_model::role::RoleId; - use test_samples::gen_account_in; + use iroha_test_samples::gen_account_in; use crate::role::RoleIdWithOwner; diff --git a/core/src/metrics.rs b/libs/iroha_core/src/metrics.rs similarity index 100% rename from core/src/metrics.rs rename to libs/iroha_core/src/metrics.rs diff --git a/core/src/query/cursor.rs b/libs/iroha_core/src/query/cursor.rs similarity index 100% rename from core/src/query/cursor.rs rename to libs/iroha_core/src/query/cursor.rs diff --git a/core/src/query/mod.rs b/libs/iroha_core/src/query/mod.rs similarity index 100% rename from core/src/query/mod.rs rename to libs/iroha_core/src/query/mod.rs diff --git a/core/src/query/pagination.rs b/libs/iroha_core/src/query/pagination.rs similarity index 100% rename from core/src/query/pagination.rs rename to libs/iroha_core/src/query/pagination.rs diff --git a/core/src/query/store.rs b/libs/iroha_core/src/query/store.rs similarity index 100% rename from core/src/query/store.rs rename to libs/iroha_core/src/query/store.rs diff --git a/core/src/queue.rs b/libs/iroha_core/src/queue.rs similarity index 99% rename from core/src/queue.rs rename to libs/iroha_core/src/queue.rs index 17218d9de33..62c2ee1a640 100644 --- a/core/src/queue.rs +++ b/libs/iroha_core/src/queue.rs @@ -378,9 +378,9 @@ pub mod tests { use std::{str::FromStr, sync::Arc, thread, time::Duration}; use iroha_data_model::{parameter::TransactionParameters, prelude::*}; + use iroha_test_samples::gen_account_in; use nonzero_ext::nonzero; use rand::Rng as _; - use test_samples::gen_account_in; use tokio::test; use super::*; diff --git a/core/src/smartcontracts/isi/account.rs b/libs/iroha_core/src/smartcontracts/isi/account.rs similarity index 99% rename from core/src/smartcontracts/isi/account.rs rename to libs/iroha_core/src/smartcontracts/isi/account.rs index 2ba18eea0e0..8bc2e0371f7 100644 --- a/core/src/smartcontracts/isi/account.rs +++ b/libs/iroha_core/src/smartcontracts/isi/account.rs @@ -459,7 +459,7 @@ pub mod isi { #[cfg(test)] mod test { use iroha_data_model::{prelude::AssetDefinition, ParseError}; - use test_samples::gen_account_in; + use iroha_test_samples::gen_account_in; use crate::smartcontracts::isi::Registrable as _; diff --git a/core/src/smartcontracts/isi/asset.rs b/libs/iroha_core/src/smartcontracts/isi/asset.rs similarity index 100% rename from core/src/smartcontracts/isi/asset.rs rename to libs/iroha_core/src/smartcontracts/isi/asset.rs diff --git a/core/src/smartcontracts/isi/block.rs b/libs/iroha_core/src/smartcontracts/isi/block.rs similarity index 100% rename from core/src/smartcontracts/isi/block.rs rename to libs/iroha_core/src/smartcontracts/isi/block.rs diff --git a/core/src/smartcontracts/isi/domain.rs b/libs/iroha_core/src/smartcontracts/isi/domain.rs similarity index 100% rename from core/src/smartcontracts/isi/domain.rs rename to libs/iroha_core/src/smartcontracts/isi/domain.rs diff --git a/core/src/smartcontracts/isi/mod.rs b/libs/iroha_core/src/smartcontracts/isi/mod.rs similarity index 99% rename from core/src/smartcontracts/isi/mod.rs rename to libs/iroha_core/src/smartcontracts/isi/mod.rs index a57ec6bd3c9..f824c008b3f 100644 --- a/core/src/smartcontracts/isi/mod.rs +++ b/libs/iroha_core/src/smartcontracts/isi/mod.rs @@ -229,7 +229,7 @@ mod tests { use core::str::FromStr as _; use std::sync::Arc; - use test_samples::{ + use iroha_test_samples::{ gen_account_in, ALICE_ID, SAMPLE_GENESIS_ACCOUNT_ID, SAMPLE_GENESIS_ACCOUNT_KEYPAIR, }; use tokio::test; diff --git a/core/src/smartcontracts/isi/query.rs b/libs/iroha_core/src/smartcontracts/isi/query.rs similarity index 99% rename from core/src/smartcontracts/isi/query.rs rename to libs/iroha_core/src/smartcontracts/isi/query.rs index 557db5644f7..0a5ccacbe43 100644 --- a/core/src/smartcontracts/isi/query.rs +++ b/libs/iroha_core/src/smartcontracts/isi/query.rs @@ -294,8 +294,8 @@ mod tests { use iroha_crypto::{Hash, HashOf, KeyPair}; use iroha_data_model::{parameter::TransactionParameters, query::error::FindError}; use iroha_primitives::json::JsonString; + use iroha_test_samples::{gen_account_in, ALICE_ID, ALICE_KEYPAIR}; use nonzero_ext::nonzero; - use test_samples::{gen_account_in, ALICE_ID, ALICE_KEYPAIR}; use tokio::test; use super::*; diff --git a/core/src/smartcontracts/isi/triggers/mod.rs b/libs/iroha_core/src/smartcontracts/isi/triggers/mod.rs similarity index 100% rename from core/src/smartcontracts/isi/triggers/mod.rs rename to libs/iroha_core/src/smartcontracts/isi/triggers/mod.rs diff --git a/core/src/smartcontracts/isi/triggers/set.rs b/libs/iroha_core/src/smartcontracts/isi/triggers/set.rs similarity index 100% rename from core/src/smartcontracts/isi/triggers/set.rs rename to libs/iroha_core/src/smartcontracts/isi/triggers/set.rs diff --git a/core/src/smartcontracts/isi/triggers/specialized.rs b/libs/iroha_core/src/smartcontracts/isi/triggers/specialized.rs similarity index 100% rename from core/src/smartcontracts/isi/triggers/specialized.rs rename to libs/iroha_core/src/smartcontracts/isi/triggers/specialized.rs diff --git a/core/src/smartcontracts/isi/tx.rs b/libs/iroha_core/src/smartcontracts/isi/tx.rs similarity index 100% rename from core/src/smartcontracts/isi/tx.rs rename to libs/iroha_core/src/smartcontracts/isi/tx.rs diff --git a/core/src/smartcontracts/isi/world.rs b/libs/iroha_core/src/smartcontracts/isi/world.rs similarity index 100% rename from core/src/smartcontracts/isi/world.rs rename to libs/iroha_core/src/smartcontracts/isi/world.rs diff --git a/core/src/smartcontracts/mod.rs b/libs/iroha_core/src/smartcontracts/mod.rs similarity index 100% rename from core/src/smartcontracts/mod.rs rename to libs/iroha_core/src/smartcontracts/mod.rs diff --git a/core/src/smartcontracts/wasm.rs b/libs/iroha_core/src/smartcontracts/wasm.rs similarity index 99% rename from core/src/smartcontracts/wasm.rs rename to libs/iroha_core/src/smartcontracts/wasm.rs index 215d6d9a40b..9fba3b43a13 100644 --- a/core/src/smartcontracts/wasm.rs +++ b/libs/iroha_core/src/smartcontracts/wasm.rs @@ -1705,9 +1705,9 @@ impl GetExport for (&wasmtime::Instance, C) { #[cfg(test)] mod tests { use iroha_data_model::query::{predicate::PredicateBox, sorting::Sorting, Pagination}; + use iroha_test_samples::gen_account_in; use nonzero_ext::nonzero; use parity_scale_codec::Encode; - use test_samples::gen_account_in; use tokio::test; use super::*; diff --git a/core/src/snapshot.rs b/libs/iroha_core/src/snapshot.rs similarity index 100% rename from core/src/snapshot.rs rename to libs/iroha_core/src/snapshot.rs diff --git a/core/src/state.rs b/libs/iroha_core/src/state.rs similarity index 99% rename from core/src/state.rs rename to libs/iroha_core/src/state.rs index 4b138674fd8..f9f636dd62e 100644 --- a/core/src/state.rs +++ b/libs/iroha_core/src/state.rs @@ -2035,7 +2035,7 @@ mod tests { use core::num::NonZeroU64; use iroha_data_model::block::BlockPayload; - use test_samples::gen_account_in; + use iroha_test_samples::gen_account_in; use super::*; use crate::{ diff --git a/core/src/sumeragi/main_loop.rs b/libs/iroha_core/src/sumeragi/main_loop.rs similarity index 99% rename from core/src/sumeragi/main_loop.rs rename to libs/iroha_core/src/sumeragi/main_loop.rs index c368f48afd2..f95ceb0a74a 100644 --- a/core/src/sumeragi/main_loop.rs +++ b/libs/iroha_core/src/sumeragi/main_loop.rs @@ -1360,8 +1360,8 @@ fn categorize_block_sync( #[cfg(test)] mod tests { use iroha_genesis::GENESIS_DOMAIN_ID; + use iroha_test_samples::gen_account_in; use nonzero_ext::nonzero; - use test_samples::gen_account_in; use tokio::test; use super::*; diff --git a/core/src/sumeragi/message.rs b/libs/iroha_core/src/sumeragi/message.rs similarity index 100% rename from core/src/sumeragi/message.rs rename to libs/iroha_core/src/sumeragi/message.rs diff --git a/core/src/sumeragi/mod.rs b/libs/iroha_core/src/sumeragi/mod.rs similarity index 100% rename from core/src/sumeragi/mod.rs rename to libs/iroha_core/src/sumeragi/mod.rs diff --git a/core/src/sumeragi/network_topology.rs b/libs/iroha_core/src/sumeragi/network_topology.rs similarity index 100% rename from core/src/sumeragi/network_topology.rs rename to libs/iroha_core/src/sumeragi/network_topology.rs diff --git a/core/src/sumeragi/view_change.rs b/libs/iroha_core/src/sumeragi/view_change.rs similarity index 100% rename from core/src/sumeragi/view_change.rs rename to libs/iroha_core/src/sumeragi/view_change.rs diff --git a/core/src/tx.rs b/libs/iroha_core/src/tx.rs similarity index 100% rename from core/src/tx.rs rename to libs/iroha_core/src/tx.rs diff --git a/crypto/Cargo.toml b/libs/iroha_crypto/Cargo.toml similarity index 94% rename from crypto/Cargo.toml rename to libs/iroha_crypto/Cargo.toml index 9e9107e9162..aa21be56e90 100644 --- a/crypto/Cargo.toml +++ b/libs/iroha_crypto/Cargo.toml @@ -44,20 +44,20 @@ ffi_export = ["std", "iroha_ffi", "iroha_primitives/ffi_export"] rand = [] [dependencies] -iroha_primitives = { workspace = true } -iroha_macro = { workspace = true } +iroha_primitives.workspace = true +iroha_macro.workspace = true iroha_ffi = { workspace = true, optional = true } -iroha_schema = { workspace = true } +iroha_schema.workspace = true derive_more = { workspace = true, features = ["deref", "deref_mut", "display"] } parity-scale-codec = { workspace = true, features = ["derive", "full"] } serde = { workspace = true, features = ["derive"] } serde_with = { workspace = true, features = ["macros", "hex"] } hex = { workspace = true, features = ["alloc", "serde"] } -getset = { workspace = true } +getset.workspace = true thiserror = { version = "1.0.62", optional = true } -displaydoc = { workspace = true } +displaydoc.workspace = true digest = { version = "0.10.7", default-features = false, features = ["alloc"] } blake2 = { version = "0.10.6", default-features = false } @@ -85,7 +85,7 @@ elliptic-curve = { version = "0.13.8", default-features = false } k256 = { version = "0.13.3", default-features = false, features = ["alloc", "ecdsa", "sha256"] } [dev-dependencies] -hex-literal = { workspace = true } +hex-literal.workspace = true serde_json = { workspace = true, features = ["std"] } # these crypto libraries are not used to implement actual crypto algorithms diff --git a/crypto/build.rs b/libs/iroha_crypto/build.rs similarity index 100% rename from crypto/build.rs rename to libs/iroha_crypto/build.rs diff --git a/crypto/src/encryption/chacha20poly1305.rs b/libs/iroha_crypto/src/encryption/chacha20poly1305.rs similarity index 100% rename from crypto/src/encryption/chacha20poly1305.rs rename to libs/iroha_crypto/src/encryption/chacha20poly1305.rs diff --git a/crypto/src/encryption/mod.rs b/libs/iroha_crypto/src/encryption/mod.rs similarity index 100% rename from crypto/src/encryption/mod.rs rename to libs/iroha_crypto/src/encryption/mod.rs diff --git a/crypto/src/hash.rs b/libs/iroha_crypto/src/hash.rs similarity index 100% rename from crypto/src/hash.rs rename to libs/iroha_crypto/src/hash.rs diff --git a/crypto/src/kex/mod.rs b/libs/iroha_crypto/src/kex/mod.rs similarity index 100% rename from crypto/src/kex/mod.rs rename to libs/iroha_crypto/src/kex/mod.rs diff --git a/crypto/src/kex/x25519.rs b/libs/iroha_crypto/src/kex/x25519.rs similarity index 100% rename from crypto/src/kex/x25519.rs rename to libs/iroha_crypto/src/kex/x25519.rs diff --git a/crypto/src/lib.rs b/libs/iroha_crypto/src/lib.rs similarity index 100% rename from crypto/src/lib.rs rename to libs/iroha_crypto/src/lib.rs diff --git a/crypto/src/merkle.rs b/libs/iroha_crypto/src/merkle.rs similarity index 100% rename from crypto/src/merkle.rs rename to libs/iroha_crypto/src/merkle.rs diff --git a/crypto/src/multihash.rs b/libs/iroha_crypto/src/multihash.rs similarity index 100% rename from crypto/src/multihash.rs rename to libs/iroha_crypto/src/multihash.rs diff --git a/crypto/src/secrecy.rs b/libs/iroha_crypto/src/secrecy.rs similarity index 100% rename from crypto/src/secrecy.rs rename to libs/iroha_crypto/src/secrecy.rs diff --git a/crypto/src/signature/bls/implementation.rs b/libs/iroha_crypto/src/signature/bls/implementation.rs similarity index 100% rename from crypto/src/signature/bls/implementation.rs rename to libs/iroha_crypto/src/signature/bls/implementation.rs diff --git a/crypto/src/signature/bls/mod.rs b/libs/iroha_crypto/src/signature/bls/mod.rs similarity index 100% rename from crypto/src/signature/bls/mod.rs rename to libs/iroha_crypto/src/signature/bls/mod.rs diff --git a/crypto/src/signature/bls/tests.rs b/libs/iroha_crypto/src/signature/bls/tests.rs similarity index 100% rename from crypto/src/signature/bls/tests.rs rename to libs/iroha_crypto/src/signature/bls/tests.rs diff --git a/crypto/src/signature/ed25519.rs b/libs/iroha_crypto/src/signature/ed25519.rs similarity index 100% rename from crypto/src/signature/ed25519.rs rename to libs/iroha_crypto/src/signature/ed25519.rs diff --git a/crypto/src/signature/mod.rs b/libs/iroha_crypto/src/signature/mod.rs similarity index 100% rename from crypto/src/signature/mod.rs rename to libs/iroha_crypto/src/signature/mod.rs diff --git a/crypto/src/signature/secp256k1.rs b/libs/iroha_crypto/src/signature/secp256k1.rs similarity index 100% rename from crypto/src/signature/secp256k1.rs rename to libs/iroha_crypto/src/signature/secp256k1.rs diff --git a/crypto/src/varint.rs b/libs/iroha_crypto/src/varint.rs similarity index 100% rename from crypto/src/varint.rs rename to libs/iroha_crypto/src/varint.rs diff --git a/data_model/Cargo.toml b/libs/iroha_data_model/Cargo.toml similarity index 84% rename from data_model/Cargo.toml rename to libs/iroha_data_model/Cargo.toml index bd19cd9804d..60e68329923 100644 --- a/data_model/Cargo.toml +++ b/libs/iroha_data_model/Cargo.toml @@ -29,31 +29,31 @@ transparent_api = [] [dependencies] iroha_data_model_derive = { path = "derive" } -iroha_primitives = { workspace = true } -iroha_crypto = { workspace = true } -iroha_macro = { workspace = true } +iroha_primitives.workspace = true +iroha_crypto.workspace = true +iroha_macro.workspace = true iroha_version = { workspace = true, features = ["derive", "json", "scale"] } -iroha_schema = { workspace = true } +iroha_schema.workspace = true iroha_ffi = { workspace = true, optional = true } parity-scale-codec = { workspace = true, features = ["derive"] } derive_more = { workspace = true, features = ["as_ref", "display", "constructor", "from_str", "from", "into"] } serde = { workspace = true, features = ["derive"] } serde_with = { workspace = true, features = ["macros"] } -serde_json = { workspace = true } +serde_json.workspace = true thiserror = { workspace = true, optional = true } -displaydoc = { workspace = true } -getset = { workspace = true } +displaydoc.workspace = true +getset.workspace = true strum = { workspace = true, features = ["derive"] } base64 = { workspace = true, features = ["alloc"] } once_cell = { workspace = true, optional = true } -nonzero_ext = { workspace = true } +nonzero_ext.workspace = true [dev-dependencies] iroha_crypto = { workspace = true, features = ["rand"] } -trybuild = { workspace = true } -criterion = { workspace = true } +trybuild.workspace = true +criterion.workspace = true [[bench]] name = "time_event_filter" diff --git a/data_model/benches/time_event_filter.rs b/libs/iroha_data_model/benches/time_event_filter.rs similarity index 100% rename from data_model/benches/time_event_filter.rs rename to libs/iroha_data_model/benches/time_event_filter.rs diff --git a/data_model/build.rs b/libs/iroha_data_model/build.rs similarity index 100% rename from data_model/build.rs rename to libs/iroha_data_model/build.rs diff --git a/data_model/clippy.toml b/libs/iroha_data_model/clippy.toml similarity index 100% rename from data_model/clippy.toml rename to libs/iroha_data_model/clippy.toml diff --git a/data_model/derive/Cargo.toml b/libs/iroha_data_model/derive/Cargo.toml similarity index 55% rename from data_model/derive/Cargo.toml rename to libs/iroha_data_model/derive/Cargo.toml index be1b79f628e..f06c3b04e44 100644 --- a/data_model/derive/Cargo.toml +++ b/libs/iroha_data_model/derive/Cargo.toml @@ -15,18 +15,18 @@ proc-macro = true [dependencies] syn = { workspace = true, features = ["default", "full", "extra-traits", "visit-mut"] } -quote = { workspace = true } -darling = { workspace = true } -proc-macro2 = { workspace = true } -manyhow = { workspace = true } -iroha_macro_utils = { workspace = true } +quote.workspace = true +darling.workspace = true +proc-macro2.workspace = true +manyhow.workspace = true +iroha_macro_utils.workspace = true [dev-dependencies] iroha_data_model = { workspace = true, features = ["http"] } -iroha_schema = { workspace = true } -parity-scale-codec = { workspace = true } -derive_more = { workspace = true } +iroha_schema.workspace = true +parity-scale-codec.workspace = true +derive_more.workspace = true serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } -trybuild = { workspace = true } +serde_json.workspace = true +trybuild.workspace = true diff --git a/data_model/derive/src/enum_ref.rs b/libs/iroha_data_model/derive/src/enum_ref.rs similarity index 100% rename from data_model/derive/src/enum_ref.rs rename to libs/iroha_data_model/derive/src/enum_ref.rs diff --git a/data_model/derive/src/event_set.rs b/libs/iroha_data_model/derive/src/event_set.rs similarity index 100% rename from data_model/derive/src/event_set.rs rename to libs/iroha_data_model/derive/src/event_set.rs diff --git a/data_model/derive/src/has_origin.rs b/libs/iroha_data_model/derive/src/has_origin.rs similarity index 100% rename from data_model/derive/src/has_origin.rs rename to libs/iroha_data_model/derive/src/has_origin.rs diff --git a/data_model/derive/src/id.rs b/libs/iroha_data_model/derive/src/id.rs similarity index 100% rename from data_model/derive/src/id.rs rename to libs/iroha_data_model/derive/src/id.rs diff --git a/data_model/derive/src/lib.rs b/libs/iroha_data_model/derive/src/lib.rs similarity index 100% rename from data_model/derive/src/lib.rs rename to libs/iroha_data_model/derive/src/lib.rs diff --git a/data_model/derive/src/model.rs b/libs/iroha_data_model/derive/src/model.rs similarity index 100% rename from data_model/derive/src/model.rs rename to libs/iroha_data_model/derive/src/model.rs diff --git a/data_model/derive/src/partially_tagged/mod.rs b/libs/iroha_data_model/derive/src/partially_tagged/mod.rs similarity index 100% rename from data_model/derive/src/partially_tagged/mod.rs rename to libs/iroha_data_model/derive/src/partially_tagged/mod.rs diff --git a/data_model/derive/src/partially_tagged/resolve_self.rs b/libs/iroha_data_model/derive/src/partially_tagged/resolve_self.rs similarity index 100% rename from data_model/derive/src/partially_tagged/resolve_self.rs rename to libs/iroha_data_model/derive/src/partially_tagged/resolve_self.rs diff --git a/data_model/derive/tests/event_set.rs b/libs/iroha_data_model/derive/tests/event_set.rs similarity index 100% rename from data_model/derive/tests/event_set.rs rename to libs/iroha_data_model/derive/tests/event_set.rs diff --git a/data_model/derive/tests/has_origin.rs b/libs/iroha_data_model/derive/tests/has_origin.rs similarity index 100% rename from data_model/derive/tests/has_origin.rs rename to libs/iroha_data_model/derive/tests/has_origin.rs diff --git a/data_model/derive/tests/has_origin_generics.rs b/libs/iroha_data_model/derive/tests/has_origin_generics.rs similarity index 100% rename from data_model/derive/tests/has_origin_generics.rs rename to libs/iroha_data_model/derive/tests/has_origin_generics.rs diff --git a/data_model/derive/tests/id_eq_ord_hash.rs b/libs/iroha_data_model/derive/tests/id_eq_ord_hash.rs similarity index 100% rename from data_model/derive/tests/id_eq_ord_hash.rs rename to libs/iroha_data_model/derive/tests/id_eq_ord_hash.rs diff --git a/data_model/derive/tests/partial_tagged_serde.rs b/libs/iroha_data_model/derive/tests/partial_tagged_serde.rs similarity index 100% rename from data_model/derive/tests/partial_tagged_serde.rs rename to libs/iroha_data_model/derive/tests/partial_tagged_serde.rs diff --git a/data_model/derive/tests/partial_tagged_serde_self.rs b/libs/iroha_data_model/derive/tests/partial_tagged_serde_self.rs similarity index 100% rename from data_model/derive/tests/partial_tagged_serde_self.rs rename to libs/iroha_data_model/derive/tests/partial_tagged_serde_self.rs diff --git a/data_model/derive/tests/ui.rs b/libs/iroha_data_model/derive/tests/ui.rs similarity index 100% rename from data_model/derive/tests/ui.rs rename to libs/iroha_data_model/derive/tests/ui.rs diff --git a/data_model/derive/tests/ui_fail/has_origin_multiple_attributes.rs b/libs/iroha_data_model/derive/tests/ui_fail/has_origin_multiple_attributes.rs similarity index 100% rename from data_model/derive/tests/ui_fail/has_origin_multiple_attributes.rs rename to libs/iroha_data_model/derive/tests/ui_fail/has_origin_multiple_attributes.rs diff --git a/data_model/derive/tests/ui_fail/has_origin_multiple_attributes.stderr b/libs/iroha_data_model/derive/tests/ui_fail/has_origin_multiple_attributes.stderr similarity index 100% rename from data_model/derive/tests/ui_fail/has_origin_multiple_attributes.stderr rename to libs/iroha_data_model/derive/tests/ui_fail/has_origin_multiple_attributes.stderr diff --git a/data_model/derive/tests/ui_fail/transparent_api_private_field.rs b/libs/iroha_data_model/derive/tests/ui_fail/transparent_api_private_field.rs similarity index 100% rename from data_model/derive/tests/ui_fail/transparent_api_private_field.rs rename to libs/iroha_data_model/derive/tests/ui_fail/transparent_api_private_field.rs diff --git a/data_model/derive/tests/ui_fail/transparent_api_private_field.stderr b/libs/iroha_data_model/derive/tests/ui_fail/transparent_api_private_field.stderr similarity index 100% rename from data_model/derive/tests/ui_fail/transparent_api_private_field.stderr rename to libs/iroha_data_model/derive/tests/ui_fail/transparent_api_private_field.stderr diff --git a/data_model/derive/tests/ui_fail/transparent_api_private_item.rs b/libs/iroha_data_model/derive/tests/ui_fail/transparent_api_private_item.rs similarity index 100% rename from data_model/derive/tests/ui_fail/transparent_api_private_item.rs rename to libs/iroha_data_model/derive/tests/ui_fail/transparent_api_private_item.rs diff --git a/data_model/derive/tests/ui_fail/transparent_api_private_item.stderr b/libs/iroha_data_model/derive/tests/ui_fail/transparent_api_private_item.stderr similarity index 86% rename from data_model/derive/tests/ui_fail/transparent_api_private_item.stderr rename to libs/iroha_data_model/derive/tests/ui_fail/transparent_api_private_item.stderr index 7a6d0b23a50..8cf954b063b 100644 --- a/data_model/derive/tests/ui_fail/transparent_api_private_item.stderr +++ b/libs/iroha_data_model/derive/tests/ui_fail/transparent_api_private_item.stderr @@ -5,7 +5,7 @@ error[E0603]: struct `ClientQueryPayload` is private | ^^^^^^^^^^^^^^^^^^ private struct | note: the struct `ClientQueryPayload` is defined here - --> $WORKSPACE/data_model/src/query/mod.rs + --> $WORKSPACE/libs/iroha_data_model/src/query/mod.rs | | pub use self::model::*; | ^^^^^^^^^^^ diff --git a/data_model/src/account.rs b/libs/iroha_data_model/src/account.rs similarity index 100% rename from data_model/src/account.rs rename to libs/iroha_data_model/src/account.rs diff --git a/data_model/src/asset.rs b/libs/iroha_data_model/src/asset.rs similarity index 100% rename from data_model/src/asset.rs rename to libs/iroha_data_model/src/asset.rs diff --git a/data_model/src/block.rs b/libs/iroha_data_model/src/block.rs similarity index 100% rename from data_model/src/block.rs rename to libs/iroha_data_model/src/block.rs diff --git a/data_model/src/domain.rs b/libs/iroha_data_model/src/domain.rs similarity index 100% rename from data_model/src/domain.rs rename to libs/iroha_data_model/src/domain.rs diff --git a/data_model/src/events/data/events.rs b/libs/iroha_data_model/src/events/data/events.rs similarity index 100% rename from data_model/src/events/data/events.rs rename to libs/iroha_data_model/src/events/data/events.rs diff --git a/data_model/src/events/data/filters.rs b/libs/iroha_data_model/src/events/data/filters.rs similarity index 100% rename from data_model/src/events/data/filters.rs rename to libs/iroha_data_model/src/events/data/filters.rs diff --git a/data_model/src/events/data/mod.rs b/libs/iroha_data_model/src/events/data/mod.rs similarity index 100% rename from data_model/src/events/data/mod.rs rename to libs/iroha_data_model/src/events/data/mod.rs diff --git a/data_model/src/events/execute_trigger.rs b/libs/iroha_data_model/src/events/execute_trigger.rs similarity index 100% rename from data_model/src/events/execute_trigger.rs rename to libs/iroha_data_model/src/events/execute_trigger.rs diff --git a/data_model/src/events/mod.rs b/libs/iroha_data_model/src/events/mod.rs similarity index 100% rename from data_model/src/events/mod.rs rename to libs/iroha_data_model/src/events/mod.rs diff --git a/data_model/src/events/pipeline.rs b/libs/iroha_data_model/src/events/pipeline.rs similarity index 100% rename from data_model/src/events/pipeline.rs rename to libs/iroha_data_model/src/events/pipeline.rs diff --git a/data_model/src/events/time.rs b/libs/iroha_data_model/src/events/time.rs similarity index 100% rename from data_model/src/events/time.rs rename to libs/iroha_data_model/src/events/time.rs diff --git a/data_model/src/events/trigger_completed.rs b/libs/iroha_data_model/src/events/trigger_completed.rs similarity index 100% rename from data_model/src/events/trigger_completed.rs rename to libs/iroha_data_model/src/events/trigger_completed.rs diff --git a/data_model/src/executor.rs b/libs/iroha_data_model/src/executor.rs similarity index 100% rename from data_model/src/executor.rs rename to libs/iroha_data_model/src/executor.rs diff --git a/data_model/src/ipfs.rs b/libs/iroha_data_model/src/ipfs.rs similarity index 100% rename from data_model/src/ipfs.rs rename to libs/iroha_data_model/src/ipfs.rs diff --git a/data_model/src/isi.rs b/libs/iroha_data_model/src/isi.rs similarity index 100% rename from data_model/src/isi.rs rename to libs/iroha_data_model/src/isi.rs diff --git a/data_model/src/lib.rs b/libs/iroha_data_model/src/lib.rs similarity index 100% rename from data_model/src/lib.rs rename to libs/iroha_data_model/src/lib.rs diff --git a/data_model/src/metadata.rs b/libs/iroha_data_model/src/metadata.rs similarity index 100% rename from data_model/src/metadata.rs rename to libs/iroha_data_model/src/metadata.rs diff --git a/data_model/src/name.rs b/libs/iroha_data_model/src/name.rs similarity index 100% rename from data_model/src/name.rs rename to libs/iroha_data_model/src/name.rs diff --git a/data_model/src/parameter.rs b/libs/iroha_data_model/src/parameter.rs similarity index 100% rename from data_model/src/parameter.rs rename to libs/iroha_data_model/src/parameter.rs diff --git a/data_model/src/peer.rs b/libs/iroha_data_model/src/peer.rs similarity index 100% rename from data_model/src/peer.rs rename to libs/iroha_data_model/src/peer.rs diff --git a/data_model/src/permission.rs b/libs/iroha_data_model/src/permission.rs similarity index 100% rename from data_model/src/permission.rs rename to libs/iroha_data_model/src/permission.rs diff --git a/data_model/src/query/cursor.rs b/libs/iroha_data_model/src/query/cursor.rs similarity index 100% rename from data_model/src/query/cursor.rs rename to libs/iroha_data_model/src/query/cursor.rs diff --git a/data_model/src/query/mod.rs b/libs/iroha_data_model/src/query/mod.rs similarity index 100% rename from data_model/src/query/mod.rs rename to libs/iroha_data_model/src/query/mod.rs diff --git a/data_model/src/query/pagination.rs b/libs/iroha_data_model/src/query/pagination.rs similarity index 100% rename from data_model/src/query/pagination.rs rename to libs/iroha_data_model/src/query/pagination.rs diff --git a/data_model/src/query/predicate.rs b/libs/iroha_data_model/src/query/predicate.rs similarity index 100% rename from data_model/src/query/predicate.rs rename to libs/iroha_data_model/src/query/predicate.rs diff --git a/data_model/src/query/sorting.rs b/libs/iroha_data_model/src/query/sorting.rs similarity index 100% rename from data_model/src/query/sorting.rs rename to libs/iroha_data_model/src/query/sorting.rs diff --git a/data_model/src/role.rs b/libs/iroha_data_model/src/role.rs similarity index 100% rename from data_model/src/role.rs rename to libs/iroha_data_model/src/role.rs diff --git a/data_model/src/smart_contract.rs b/libs/iroha_data_model/src/smart_contract.rs similarity index 100% rename from data_model/src/smart_contract.rs rename to libs/iroha_data_model/src/smart_contract.rs diff --git a/data_model/src/transaction.rs b/libs/iroha_data_model/src/transaction.rs similarity index 100% rename from data_model/src/transaction.rs rename to libs/iroha_data_model/src/transaction.rs diff --git a/data_model/src/trigger.rs b/libs/iroha_data_model/src/trigger.rs similarity index 100% rename from data_model/src/trigger.rs rename to libs/iroha_data_model/src/trigger.rs diff --git a/data_model/src/visit.rs b/libs/iroha_data_model/src/visit.rs similarity index 100% rename from data_model/src/visit.rs rename to libs/iroha_data_model/src/visit.rs diff --git a/data_model/tests/data_model.rs b/libs/iroha_data_model/tests/data_model.rs similarity index 100% rename from data_model/tests/data_model.rs rename to libs/iroha_data_model/tests/data_model.rs diff --git a/smart_contract/executor/Cargo.toml b/libs/iroha_executor/Cargo.toml similarity index 100% rename from smart_contract/executor/Cargo.toml rename to libs/iroha_executor/Cargo.toml diff --git a/smart_contract/executor/data_model/Cargo.toml b/libs/iroha_executor/data_model/Cargo.toml similarity index 100% rename from smart_contract/executor/data_model/Cargo.toml rename to libs/iroha_executor/data_model/Cargo.toml diff --git a/smart_contract/executor/data_model/derive/Cargo.toml b/libs/iroha_executor/data_model/derive/Cargo.toml similarity index 100% rename from smart_contract/executor/data_model/derive/Cargo.toml rename to libs/iroha_executor/data_model/derive/Cargo.toml diff --git a/smart_contract/executor/data_model/derive/src/lib.rs b/libs/iroha_executor/data_model/derive/src/lib.rs similarity index 100% rename from smart_contract/executor/data_model/derive/src/lib.rs rename to libs/iroha_executor/data_model/derive/src/lib.rs diff --git a/smart_contract/executor/data_model/derive/src/parameter.rs b/libs/iroha_executor/data_model/derive/src/parameter.rs similarity index 100% rename from smart_contract/executor/data_model/derive/src/parameter.rs rename to libs/iroha_executor/data_model/derive/src/parameter.rs diff --git a/smart_contract/executor/data_model/derive/src/permission.rs b/libs/iroha_executor/data_model/derive/src/permission.rs similarity index 100% rename from smart_contract/executor/data_model/derive/src/permission.rs rename to libs/iroha_executor/data_model/derive/src/permission.rs diff --git a/smart_contract/executor/data_model/src/lib.rs b/libs/iroha_executor/data_model/src/lib.rs similarity index 100% rename from smart_contract/executor/data_model/src/lib.rs rename to libs/iroha_executor/data_model/src/lib.rs diff --git a/smart_contract/executor/data_model/src/parameter.rs b/libs/iroha_executor/data_model/src/parameter.rs similarity index 100% rename from smart_contract/executor/data_model/src/parameter.rs rename to libs/iroha_executor/data_model/src/parameter.rs diff --git a/smart_contract/executor/data_model/src/permission.rs b/libs/iroha_executor/data_model/src/permission.rs similarity index 100% rename from smart_contract/executor/data_model/src/permission.rs rename to libs/iroha_executor/data_model/src/permission.rs diff --git a/smart_contract/executor/derive/Cargo.toml b/libs/iroha_executor/derive/Cargo.toml similarity index 61% rename from smart_contract/executor/derive/Cargo.toml rename to libs/iroha_executor/derive/Cargo.toml index 4a9a9c66fd1..33932510064 100644 --- a/smart_contract/executor/derive/Cargo.toml +++ b/libs/iroha_executor/derive/Cargo.toml @@ -15,10 +15,10 @@ workspace = true proc-macro = true [dependencies] -iroha_macro_utils = { workspace = true } +iroha_macro_utils.workspace = true syn = { workspace = true, features = ["full", "derive"] } -quote = { workspace = true } -proc-macro2 = { workspace = true } -manyhow = { workspace = true } -darling = { workspace = true } +quote.workspace = true +proc-macro2.workspace = true +manyhow.workspace = true +darling.workspace = true diff --git a/smart_contract/executor/derive/src/default.rs b/libs/iroha_executor/derive/src/default.rs similarity index 100% rename from smart_contract/executor/derive/src/default.rs rename to libs/iroha_executor/derive/src/default.rs diff --git a/smart_contract/executor/derive/src/entrypoint.rs b/libs/iroha_executor/derive/src/entrypoint.rs similarity index 100% rename from smart_contract/executor/derive/src/entrypoint.rs rename to libs/iroha_executor/derive/src/entrypoint.rs diff --git a/smart_contract/executor/derive/src/lib.rs b/libs/iroha_executor/derive/src/lib.rs similarity index 100% rename from smart_contract/executor/derive/src/lib.rs rename to libs/iroha_executor/derive/src/lib.rs diff --git a/smart_contract/executor/src/default.rs b/libs/iroha_executor/src/default.rs similarity index 100% rename from smart_contract/executor/src/default.rs rename to libs/iroha_executor/src/default.rs diff --git a/smart_contract/executor/src/lib.rs b/libs/iroha_executor/src/lib.rs similarity index 100% rename from smart_contract/executor/src/lib.rs rename to libs/iroha_executor/src/lib.rs diff --git a/smart_contract/executor/src/permission.rs b/libs/iroha_executor/src/permission.rs similarity index 100% rename from smart_contract/executor/src/permission.rs rename to libs/iroha_executor/src/permission.rs diff --git a/ffi/.cargo/config.toml b/libs/iroha_ffi/.cargo/config.toml similarity index 100% rename from ffi/.cargo/config.toml rename to libs/iroha_ffi/.cargo/config.toml diff --git a/ffi/Cargo.toml b/libs/iroha_ffi/Cargo.toml similarity index 95% rename from ffi/Cargo.toml rename to libs/iroha_ffi/Cargo.toml index bbf05e88a9a..9372d6efc71 100644 --- a/ffi/Cargo.toml +++ b/libs/iroha_ffi/Cargo.toml @@ -24,4 +24,4 @@ derive_more = { workspace = true, features = ["display", "constructor"] } [dev-dependencies] webassembly-test = "0.1.0" -getset = { workspace = true } +getset.workspace = true diff --git a/ffi/derive/Cargo.toml b/libs/iroha_ffi/derive/Cargo.toml similarity index 57% rename from ffi/derive/Cargo.toml rename to libs/iroha_ffi/derive/Cargo.toml index f02f7db7ed8..63c1ba0a8d8 100644 --- a/ffi/derive/Cargo.toml +++ b/libs/iroha_ffi/derive/Cargo.toml @@ -15,19 +15,19 @@ workspace = true proc-macro = true [dependencies] -iroha_macro_utils = { workspace = true } +iroha_macro_utils.workspace = true syn = { workspace = true, features = ["full", "visit", "visit-mut", "extra-traits"] } -quote = { workspace = true } -proc-macro2 = { workspace = true } -manyhow = { workspace = true } -darling = { workspace = true } -rustc-hash = { workspace = true } +quote.workspace = true +proc-macro2.workspace = true +manyhow.workspace = true +darling.workspace = true +rustc-hash.workspace = true strum = { workspace = true, features = ["derive"] } [dev-dependencies] -iroha_ffi = { workspace = true } +iroha_ffi.workspace = true -getset = { workspace = true } -trybuild = { workspace = true } +getset.workspace = true +trybuild.workspace = true diff --git a/ffi/derive/src/attr_parse/derive.rs b/libs/iroha_ffi/derive/src/attr_parse/derive.rs similarity index 100% rename from ffi/derive/src/attr_parse/derive.rs rename to libs/iroha_ffi/derive/src/attr_parse/derive.rs diff --git a/ffi/derive/src/attr_parse/doc.rs b/libs/iroha_ffi/derive/src/attr_parse/doc.rs similarity index 100% rename from ffi/derive/src/attr_parse/doc.rs rename to libs/iroha_ffi/derive/src/attr_parse/doc.rs diff --git a/ffi/derive/src/attr_parse/getset.rs b/libs/iroha_ffi/derive/src/attr_parse/getset.rs similarity index 100% rename from ffi/derive/src/attr_parse/getset.rs rename to libs/iroha_ffi/derive/src/attr_parse/getset.rs diff --git a/ffi/derive/src/attr_parse/mod.rs b/libs/iroha_ffi/derive/src/attr_parse/mod.rs similarity index 100% rename from ffi/derive/src/attr_parse/mod.rs rename to libs/iroha_ffi/derive/src/attr_parse/mod.rs diff --git a/ffi/derive/src/attr_parse/repr.rs b/libs/iroha_ffi/derive/src/attr_parse/repr.rs similarity index 100% rename from ffi/derive/src/attr_parse/repr.rs rename to libs/iroha_ffi/derive/src/attr_parse/repr.rs diff --git a/ffi/derive/src/convert.rs b/libs/iroha_ffi/derive/src/convert.rs similarity index 100% rename from ffi/derive/src/convert.rs rename to libs/iroha_ffi/derive/src/convert.rs diff --git a/ffi/derive/src/ffi_fn.rs b/libs/iroha_ffi/derive/src/ffi_fn.rs similarity index 100% rename from ffi/derive/src/ffi_fn.rs rename to libs/iroha_ffi/derive/src/ffi_fn.rs diff --git a/ffi/derive/src/getset_gen.rs b/libs/iroha_ffi/derive/src/getset_gen.rs similarity index 100% rename from ffi/derive/src/getset_gen.rs rename to libs/iroha_ffi/derive/src/getset_gen.rs diff --git a/ffi/derive/src/impl_visitor.rs b/libs/iroha_ffi/derive/src/impl_visitor.rs similarity index 100% rename from ffi/derive/src/impl_visitor.rs rename to libs/iroha_ffi/derive/src/impl_visitor.rs diff --git a/ffi/derive/src/lib.rs b/libs/iroha_ffi/derive/src/lib.rs similarity index 100% rename from ffi/derive/src/lib.rs rename to libs/iroha_ffi/derive/src/lib.rs diff --git a/ffi/derive/src/wrapper.rs b/libs/iroha_ffi/derive/src/wrapper.rs similarity index 100% rename from ffi/derive/src/wrapper.rs rename to libs/iroha_ffi/derive/src/wrapper.rs diff --git a/ffi/derive/tests/ui.rs b/libs/iroha_ffi/derive/tests/ui.rs similarity index 100% rename from ffi/derive/tests/ui.rs rename to libs/iroha_ffi/derive/tests/ui.rs diff --git a/ffi/derive/tests/ui_fail/array_as_ptr.rs b/libs/iroha_ffi/derive/tests/ui_fail/array_as_ptr.rs similarity index 100% rename from ffi/derive/tests/ui_fail/array_as_ptr.rs rename to libs/iroha_ffi/derive/tests/ui_fail/array_as_ptr.rs diff --git a/ffi/derive/tests/ui_fail/array_as_ptr.stderr b/libs/iroha_ffi/derive/tests/ui_fail/array_as_ptr.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/array_as_ptr.stderr rename to libs/iroha_ffi/derive/tests/ui_fail/array_as_ptr.stderr diff --git a/ffi/derive/tests/ui_fail/derive_skip_field.rs b/libs/iroha_ffi/derive/tests/ui_fail/derive_skip_field.rs similarity index 100% rename from ffi/derive/tests/ui_fail/derive_skip_field.rs rename to libs/iroha_ffi/derive/tests/ui_fail/derive_skip_field.rs diff --git a/ffi/derive/tests/ui_fail/derive_skip_field.stderr b/libs/iroha_ffi/derive/tests/ui_fail/derive_skip_field.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/derive_skip_field.stderr rename to libs/iroha_ffi/derive/tests/ui_fail/derive_skip_field.stderr diff --git a/ffi/derive/tests/ui_fail/derive_skip_struct.rs b/libs/iroha_ffi/derive/tests/ui_fail/derive_skip_struct.rs similarity index 100% rename from ffi/derive/tests/ui_fail/derive_skip_struct.rs rename to libs/iroha_ffi/derive/tests/ui_fail/derive_skip_struct.rs diff --git a/ffi/derive/tests/ui_fail/derive_skip_struct.stderr b/libs/iroha_ffi/derive/tests/ui_fail/derive_skip_struct.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/derive_skip_struct.stderr rename to libs/iroha_ffi/derive/tests/ui_fail/derive_skip_struct.stderr diff --git a/ffi/derive/tests/ui_fail/fallible_transmute_mut_ref.rs b/libs/iroha_ffi/derive/tests/ui_fail/fallible_transmute_mut_ref.rs similarity index 100% rename from ffi/derive/tests/ui_fail/fallible_transmute_mut_ref.rs rename to libs/iroha_ffi/derive/tests/ui_fail/fallible_transmute_mut_ref.rs diff --git a/ffi/derive/tests/ui_fail/fallible_transmute_mut_ref.stderr b/libs/iroha_ffi/derive/tests/ui_fail/fallible_transmute_mut_ref.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/fallible_transmute_mut_ref.stderr rename to libs/iroha_ffi/derive/tests/ui_fail/fallible_transmute_mut_ref.stderr diff --git a/ffi/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.rs b/libs/iroha_ffi/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.rs similarity index 100% rename from ffi/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.rs rename to libs/iroha_ffi/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.rs diff --git a/ffi/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.stderr b/libs/iroha_ffi/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.stderr rename to libs/iroha_ffi/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.stderr diff --git a/ffi/derive/tests/ui_fail/fieldless_enum_without_repr.rs b/libs/iroha_ffi/derive/tests/ui_fail/fieldless_enum_without_repr.rs similarity index 100% rename from ffi/derive/tests/ui_fail/fieldless_enum_without_repr.rs rename to libs/iroha_ffi/derive/tests/ui_fail/fieldless_enum_without_repr.rs diff --git a/ffi/derive/tests/ui_fail/fieldless_enum_without_repr.stderr b/libs/iroha_ffi/derive/tests/ui_fail/fieldless_enum_without_repr.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/fieldless_enum_without_repr.stderr rename to libs/iroha_ffi/derive/tests/ui_fail/fieldless_enum_without_repr.stderr diff --git a/ffi/derive/tests/ui_fail/generics_are_forbiden_in_ffi.rs b/libs/iroha_ffi/derive/tests/ui_fail/generics_are_forbiden_in_ffi.rs similarity index 100% rename from ffi/derive/tests/ui_fail/generics_are_forbiden_in_ffi.rs rename to libs/iroha_ffi/derive/tests/ui_fail/generics_are_forbiden_in_ffi.rs diff --git a/ffi/derive/tests/ui_fail/generics_are_forbiden_in_ffi.stderr b/libs/iroha_ffi/derive/tests/ui_fail/generics_are_forbiden_in_ffi.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/generics_are_forbiden_in_ffi.stderr rename to libs/iroha_ffi/derive/tests/ui_fail/generics_are_forbiden_in_ffi.stderr diff --git a/ffi/derive/tests/ui_fail/nested_owned_structure.rs b/libs/iroha_ffi/derive/tests/ui_fail/nested_owned_structure.rs similarity index 100% rename from ffi/derive/tests/ui_fail/nested_owned_structure.rs rename to libs/iroha_ffi/derive/tests/ui_fail/nested_owned_structure.rs diff --git a/ffi/derive/tests/ui_fail/nested_owned_structure.stderr b/libs/iroha_ffi/derive/tests/ui_fail/nested_owned_structure.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/nested_owned_structure.stderr rename to libs/iroha_ffi/derive/tests/ui_fail/nested_owned_structure.stderr diff --git a/ffi/derive/tests/ui_fail/non_robust_repr_c.rs b/libs/iroha_ffi/derive/tests/ui_fail/non_robust_repr_c.rs similarity index 100% rename from ffi/derive/tests/ui_fail/non_robust_repr_c.rs rename to libs/iroha_ffi/derive/tests/ui_fail/non_robust_repr_c.rs diff --git a/ffi/derive/tests/ui_fail/non_robust_repr_c.stderr b/libs/iroha_ffi/derive/tests/ui_fail/non_robust_repr_c.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/non_robust_repr_c.stderr rename to libs/iroha_ffi/derive/tests/ui_fail/non_robust_repr_c.stderr diff --git a/ffi/derive/tests/ui_fail/private_method_inside_impl_are_skipped.rs b/libs/iroha_ffi/derive/tests/ui_fail/private_method_inside_impl_are_skipped.rs similarity index 100% rename from ffi/derive/tests/ui_fail/private_method_inside_impl_are_skipped.rs rename to libs/iroha_ffi/derive/tests/ui_fail/private_method_inside_impl_are_skipped.rs diff --git a/ffi/derive/tests/ui_fail/private_method_inside_impl_are_skipped.stderr b/libs/iroha_ffi/derive/tests/ui_fail/private_method_inside_impl_are_skipped.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/private_method_inside_impl_are_skipped.stderr rename to libs/iroha_ffi/derive/tests/ui_fail/private_method_inside_impl_are_skipped.stderr diff --git a/ffi/derive/tests/ui_fail/raw_pointer_type.rs b/libs/iroha_ffi/derive/tests/ui_fail/raw_pointer_type.rs similarity index 100% rename from ffi/derive/tests/ui_fail/raw_pointer_type.rs rename to libs/iroha_ffi/derive/tests/ui_fail/raw_pointer_type.rs diff --git a/ffi/derive/tests/ui_fail/raw_pointer_type.stderr b/libs/iroha_ffi/derive/tests/ui_fail/raw_pointer_type.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/raw_pointer_type.stderr rename to libs/iroha_ffi/derive/tests/ui_fail/raw_pointer_type.stderr diff --git a/ffi/derive/tests/ui_fail/uninhabited_enum.rs b/libs/iroha_ffi/derive/tests/ui_fail/uninhabited_enum.rs similarity index 100% rename from ffi/derive/tests/ui_fail/uninhabited_enum.rs rename to libs/iroha_ffi/derive/tests/ui_fail/uninhabited_enum.rs diff --git a/ffi/derive/tests/ui_fail/uninhabited_enum.stderr b/libs/iroha_ffi/derive/tests/ui_fail/uninhabited_enum.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/uninhabited_enum.stderr rename to libs/iroha_ffi/derive/tests/ui_fail/uninhabited_enum.stderr diff --git a/ffi/derive/tests/ui_pass/ffi_export_arg_pattern.rs b/libs/iroha_ffi/derive/tests/ui_pass/ffi_export_arg_pattern.rs similarity index 100% rename from ffi/derive/tests/ui_pass/ffi_export_arg_pattern.rs rename to libs/iroha_ffi/derive/tests/ui_pass/ffi_export_arg_pattern.rs diff --git a/ffi/src/handle.rs b/libs/iroha_ffi/src/handle.rs similarity index 100% rename from ffi/src/handle.rs rename to libs/iroha_ffi/src/handle.rs diff --git a/ffi/src/ir.rs b/libs/iroha_ffi/src/ir.rs similarity index 100% rename from ffi/src/ir.rs rename to libs/iroha_ffi/src/ir.rs diff --git a/ffi/src/lib.rs b/libs/iroha_ffi/src/lib.rs similarity index 100% rename from ffi/src/lib.rs rename to libs/iroha_ffi/src/lib.rs diff --git a/ffi/src/option.rs b/libs/iroha_ffi/src/option.rs similarity index 100% rename from ffi/src/option.rs rename to libs/iroha_ffi/src/option.rs diff --git a/ffi/src/primitives.rs b/libs/iroha_ffi/src/primitives.rs similarity index 100% rename from ffi/src/primitives.rs rename to libs/iroha_ffi/src/primitives.rs diff --git a/ffi/src/repr_c.rs b/libs/iroha_ffi/src/repr_c.rs similarity index 100% rename from ffi/src/repr_c.rs rename to libs/iroha_ffi/src/repr_c.rs diff --git a/ffi/src/slice.rs b/libs/iroha_ffi/src/slice.rs similarity index 100% rename from ffi/src/slice.rs rename to libs/iroha_ffi/src/slice.rs diff --git a/ffi/src/std_impls.rs b/libs/iroha_ffi/src/std_impls.rs similarity index 100% rename from ffi/src/std_impls.rs rename to libs/iroha_ffi/src/std_impls.rs diff --git a/ffi/tests/export_getset.rs b/libs/iroha_ffi/tests/export_getset.rs similarity index 100% rename from ffi/tests/export_getset.rs rename to libs/iroha_ffi/tests/export_getset.rs diff --git a/ffi/tests/export_shared_fns.rs b/libs/iroha_ffi/tests/export_shared_fns.rs similarity index 100% rename from ffi/tests/export_shared_fns.rs rename to libs/iroha_ffi/tests/export_shared_fns.rs diff --git a/ffi/tests/ffi_export.rs b/libs/iroha_ffi/tests/ffi_export.rs similarity index 100% rename from ffi/tests/ffi_export.rs rename to libs/iroha_ffi/tests/ffi_export.rs diff --git a/ffi/tests/ffi_export_import_u128_i128.rs b/libs/iroha_ffi/tests/ffi_export_import_u128_i128.rs similarity index 100% rename from ffi/tests/ffi_export_import_u128_i128.rs rename to libs/iroha_ffi/tests/ffi_export_import_u128_i128.rs diff --git a/ffi/tests/ffi_import.rs b/libs/iroha_ffi/tests/ffi_import.rs similarity index 100% rename from ffi/tests/ffi_import.rs rename to libs/iroha_ffi/tests/ffi_import.rs diff --git a/ffi/tests/ffi_import_opaque.rs b/libs/iroha_ffi/tests/ffi_import_opaque.rs similarity index 100% rename from ffi/tests/ffi_import_opaque.rs rename to libs/iroha_ffi/tests/ffi_import_opaque.rs diff --git a/ffi/tests/generics.rs b/libs/iroha_ffi/tests/generics.rs similarity index 100% rename from ffi/tests/generics.rs rename to libs/iroha_ffi/tests/generics.rs diff --git a/ffi/tests/import_getset.rs b/libs/iroha_ffi/tests/import_getset.rs similarity index 100% rename from ffi/tests/import_getset.rs rename to libs/iroha_ffi/tests/import_getset.rs diff --git a/ffi/tests/import_shared_fns.rs b/libs/iroha_ffi/tests/import_shared_fns.rs similarity index 100% rename from ffi/tests/import_shared_fns.rs rename to libs/iroha_ffi/tests/import_shared_fns.rs diff --git a/ffi/tests/transparent.rs b/libs/iroha_ffi/tests/transparent.rs similarity index 100% rename from ffi/tests/transparent.rs rename to libs/iroha_ffi/tests/transparent.rs diff --git a/ffi/tests/unambiguous.rs b/libs/iroha_ffi/tests/unambiguous.rs similarity index 100% rename from ffi/tests/unambiguous.rs rename to libs/iroha_ffi/tests/unambiguous.rs diff --git a/futures/Cargo.toml b/libs/iroha_futures/Cargo.toml similarity index 79% rename from futures/Cargo.toml rename to libs/iroha_futures/Cargo.toml index 5cd4feba46f..361adefe258 100644 --- a/futures/Cargo.toml +++ b/libs/iroha_futures/Cargo.toml @@ -18,11 +18,11 @@ telemetry = ["iroha_futures_derive/telemetry"] [dependencies] iroha_futures_derive = { path = "derive" } -iroha_config = { workspace = true } -iroha_logger = { workspace = true } +iroha_config.workspace = true +iroha_logger.workspace = true -rand = { workspace = true } -serde_json = { workspace = true } +rand.workspace = true +serde_json.workspace = true serde = { workspace = true, features = ["derive"] } tokio = { workspace = true, features = ["rt", "rt-multi-thread", "macros"] } diff --git a/futures/derive/Cargo.toml b/libs/iroha_futures/derive/Cargo.toml similarity index 73% rename from futures/derive/Cargo.toml rename to libs/iroha_futures/derive/Cargo.toml index 6ff76ece52e..4a95da5e1ab 100644 --- a/futures/derive/Cargo.toml +++ b/libs/iroha_futures/derive/Cargo.toml @@ -19,9 +19,9 @@ telemetry = [] proc-macro = true [dependencies] -iroha_macro_utils = { workspace = true } +iroha_macro_utils.workspace = true syn = { workspace = true, features = ["default", "full"] } -quote = { workspace = true } -proc-macro2 = { workspace = true } -manyhow = { workspace = true } +quote.workspace = true +proc-macro2.workspace = true +manyhow.workspace = true diff --git a/futures/derive/src/lib.rs b/libs/iroha_futures/derive/src/lib.rs similarity index 100% rename from futures/derive/src/lib.rs rename to libs/iroha_futures/derive/src/lib.rs diff --git a/futures/src/lib.rs b/libs/iroha_futures/src/lib.rs similarity index 100% rename from futures/src/lib.rs rename to libs/iroha_futures/src/lib.rs diff --git a/futures/tests/basic.rs b/libs/iroha_futures/tests/basic.rs similarity index 100% rename from futures/tests/basic.rs rename to libs/iroha_futures/tests/basic.rs diff --git a/genesis/Cargo.toml b/libs/iroha_genesis/Cargo.toml similarity index 66% rename from genesis/Cargo.toml rename to libs/iroha_genesis/Cargo.toml index 838fbbc040a..af7867b81d9 100644 --- a/genesis/Cargo.toml +++ b/libs/iroha_genesis/Cargo.toml @@ -11,18 +11,18 @@ license.workspace = true workspace = true [dependencies] -iroha_crypto = { workspace = true } -iroha_schema = { workspace = true } +iroha_crypto.workspace = true +iroha_schema.workspace = true iroha_data_model = { workspace = true, features = ["http"] } derive_more = { workspace = true, features = ["deref"] } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["std"] } -once_cell = { workspace = true } -tracing = { workspace = true } -eyre = { workspace = true } -parity-scale-codec = { workspace = true } +once_cell.workspace = true +tracing.workspace = true +eyre.workspace = true +parity-scale-codec.workspace = true [dev-dependencies] iroha_crypto = { workspace = true, features = ["rand"] } -test_samples = { workspace = true } +iroha_test_samples.workspace = true diff --git a/genesis/src/lib.rs b/libs/iroha_genesis/src/lib.rs similarity index 99% rename from genesis/src/lib.rs rename to libs/iroha_genesis/src/lib.rs index 49c9526deff..bbcf9810168 100644 --- a/genesis/src/lib.rs +++ b/libs/iroha_genesis/src/lib.rs @@ -326,7 +326,7 @@ impl Decode for ExecutorPath { #[cfg(test)] mod tests { - use test_samples::{ALICE_KEYPAIR, BOB_KEYPAIR}; + use iroha_test_samples::{ALICE_KEYPAIR, BOB_KEYPAIR}; use super::*; diff --git a/logger/Cargo.toml b/libs/iroha_logger/Cargo.toml similarity index 79% rename from logger/Cargo.toml rename to libs/iroha_logger/Cargo.toml index b5bfd82d3d1..05495720acf 100644 --- a/logger/Cargo.toml +++ b/libs/iroha_logger/Cargo.toml @@ -11,21 +11,21 @@ license.workspace = true workspace = true [dependencies] -iroha_config = { workspace = true } -iroha_data_model = { workspace = true } +iroha_config.workspace = true +iroha_data_model.workspace = true -color-eyre = { workspace = true } -serde_json = { workspace = true } -tracing = { workspace = true } +color-eyre.workspace = true +serde_json.workspace = true +tracing.workspace = true tracing-core = "0.1.32" tracing-futures = { version = "0.2.5", default-features = false, features = ["std-future", "std"] } tracing-subscriber = { workspace = true, features = ["fmt", "ansi", "json", "env-filter"] } tokio = { workspace = true, features = ["sync", "rt", "macros"] } console-subscriber = { version = "0.3.0", optional = true } -once_cell = { workspace = true } -derive_more = { workspace = true } +once_cell.workspace = true +derive_more.workspace = true tracing-error = "0.2.0" -thiserror = { workspace = true } +thiserror.workspace = true [dev-dependencies] tokio = { workspace = true, features = ["macros", "time", "rt"] } diff --git a/logger/src/actor.rs b/libs/iroha_logger/src/actor.rs similarity index 100% rename from logger/src/actor.rs rename to libs/iroha_logger/src/actor.rs diff --git a/logger/src/layer.rs b/libs/iroha_logger/src/layer.rs similarity index 100% rename from logger/src/layer.rs rename to libs/iroha_logger/src/layer.rs diff --git a/logger/src/lib.rs b/libs/iroha_logger/src/lib.rs similarity index 100% rename from logger/src/lib.rs rename to libs/iroha_logger/src/lib.rs diff --git a/logger/src/telemetry.rs b/libs/iroha_logger/src/telemetry.rs similarity index 100% rename from logger/src/telemetry.rs rename to libs/iroha_logger/src/telemetry.rs diff --git a/logger/tests/configuration.rs b/libs/iroha_logger/tests/configuration.rs similarity index 100% rename from logger/tests/configuration.rs rename to libs/iroha_logger/tests/configuration.rs diff --git a/logger/tests/log_level.rs b/libs/iroha_logger/tests/log_level.rs similarity index 100% rename from logger/tests/log_level.rs rename to libs/iroha_logger/tests/log_level.rs diff --git a/logger/tests/setting_logger.rs b/libs/iroha_logger/tests/setting_logger.rs similarity index 100% rename from logger/tests/setting_logger.rs rename to libs/iroha_logger/tests/setting_logger.rs diff --git a/logger/tests/telemetry.rs b/libs/iroha_logger/tests/telemetry.rs similarity index 100% rename from logger/tests/telemetry.rs rename to libs/iroha_logger/tests/telemetry.rs diff --git a/macro/Cargo.toml b/libs/iroha_macro/Cargo.toml similarity index 100% rename from macro/Cargo.toml rename to libs/iroha_macro/Cargo.toml diff --git a/macro/README.md b/libs/iroha_macro/README.md similarity index 100% rename from macro/README.md rename to libs/iroha_macro/README.md diff --git a/macro/derive/Cargo.toml b/libs/iroha_macro/derive/Cargo.toml similarity index 55% rename from macro/derive/Cargo.toml rename to libs/iroha_macro/derive/Cargo.toml index dc9e23598d2..1faf8894b6e 100644 --- a/macro/derive/Cargo.toml +++ b/libs/iroha_macro/derive/Cargo.toml @@ -15,13 +15,13 @@ proc-macro = true [dependencies] syn = { workspace = true, features = ["default", "full"] } -quote = { workspace = true } -proc-macro2 = { workspace = true } -manyhow = { workspace = true } -darling = { workspace = true } +quote.workspace = true +proc-macro2.workspace = true +manyhow.workspace = true +darling.workspace = true [dev-dependencies] -iroha_macro = { workspace = true } +iroha_macro.workspace = true -trybuild = { workspace = true } -impls = { workspace = true } +trybuild.workspace = true +impls.workspace = true diff --git a/macro/derive/src/lib.rs b/libs/iroha_macro/derive/src/lib.rs similarity index 100% rename from macro/derive/src/lib.rs rename to libs/iroha_macro/derive/src/lib.rs diff --git a/macro/derive/tests/container_enum_from_variant.rs b/libs/iroha_macro/derive/tests/container_enum_from_variant.rs similarity index 100% rename from macro/derive/tests/container_enum_from_variant.rs rename to libs/iroha_macro/derive/tests/container_enum_from_variant.rs diff --git a/macro/derive/tests/enum_from_variant_attrs.rs b/libs/iroha_macro/derive/tests/enum_from_variant_attrs.rs similarity index 100% rename from macro/derive/tests/enum_from_variant_attrs.rs rename to libs/iroha_macro/derive/tests/enum_from_variant_attrs.rs diff --git a/macro/derive/tests/ui.rs b/libs/iroha_macro/derive/tests/ui.rs similarity index 100% rename from macro/derive/tests/ui.rs rename to libs/iroha_macro/derive/tests/ui.rs diff --git a/macro/derive/tests/ui_fail/from_variant_conflicting_implementation.rs b/libs/iroha_macro/derive/tests/ui_fail/from_variant_conflicting_implementation.rs similarity index 100% rename from macro/derive/tests/ui_fail/from_variant_conflicting_implementation.rs rename to libs/iroha_macro/derive/tests/ui_fail/from_variant_conflicting_implementation.rs diff --git a/macro/derive/tests/ui_fail/from_variant_conflicting_implementation.stderr b/libs/iroha_macro/derive/tests/ui_fail/from_variant_conflicting_implementation.stderr similarity index 100% rename from macro/derive/tests/ui_fail/from_variant_conflicting_implementation.stderr rename to libs/iroha_macro/derive/tests/ui_fail/from_variant_conflicting_implementation.stderr diff --git a/macro/derive/tests/ui_fail/from_variant_incorrect_attr_placement.rs b/libs/iroha_macro/derive/tests/ui_fail/from_variant_incorrect_attr_placement.rs similarity index 100% rename from macro/derive/tests/ui_fail/from_variant_incorrect_attr_placement.rs rename to libs/iroha_macro/derive/tests/ui_fail/from_variant_incorrect_attr_placement.rs diff --git a/macro/derive/tests/ui_fail/from_variant_incorrect_attr_placement.stderr b/libs/iroha_macro/derive/tests/ui_fail/from_variant_incorrect_attr_placement.stderr similarity index 100% rename from macro/derive/tests/ui_fail/from_variant_incorrect_attr_placement.stderr rename to libs/iroha_macro/derive/tests/ui_fail/from_variant_incorrect_attr_placement.stderr diff --git a/macro/derive/tests/ui_fail/from_variant_same_type.rs b/libs/iroha_macro/derive/tests/ui_fail/from_variant_same_type.rs similarity index 100% rename from macro/derive/tests/ui_fail/from_variant_same_type.rs rename to libs/iroha_macro/derive/tests/ui_fail/from_variant_same_type.rs diff --git a/macro/derive/tests/ui_fail/from_variant_same_type.stderr b/libs/iroha_macro/derive/tests/ui_fail/from_variant_same_type.stderr similarity index 100% rename from macro/derive/tests/ui_fail/from_variant_same_type.stderr rename to libs/iroha_macro/derive/tests/ui_fail/from_variant_same_type.stderr diff --git a/macro/derive/tests/ui_fail/struct_from_variant.rs b/libs/iroha_macro/derive/tests/ui_fail/struct_from_variant.rs similarity index 100% rename from macro/derive/tests/ui_fail/struct_from_variant.rs rename to libs/iroha_macro/derive/tests/ui_fail/struct_from_variant.rs diff --git a/macro/derive/tests/ui_fail/struct_from_variant.stderr b/libs/iroha_macro/derive/tests/ui_fail/struct_from_variant.stderr similarity index 100% rename from macro/derive/tests/ui_fail/struct_from_variant.stderr rename to libs/iroha_macro/derive/tests/ui_fail/struct_from_variant.stderr diff --git a/macro/derive/tests/ui_pass/enum_from_variant.rs b/libs/iroha_macro/derive/tests/ui_pass/enum_from_variant.rs similarity index 100% rename from macro/derive/tests/ui_pass/enum_from_variant.rs rename to libs/iroha_macro/derive/tests/ui_pass/enum_from_variant.rs diff --git a/macro/src/lib.rs b/libs/iroha_macro/src/lib.rs similarity index 100% rename from macro/src/lib.rs rename to libs/iroha_macro/src/lib.rs diff --git a/macro/utils/Cargo.toml b/libs/iroha_macro/utils/Cargo.toml similarity index 74% rename from macro/utils/Cargo.toml rename to libs/iroha_macro/utils/Cargo.toml index 2092e69889d..a29f50c5760 100644 --- a/macro/utils/Cargo.toml +++ b/libs/iroha_macro/utils/Cargo.toml @@ -14,8 +14,8 @@ maintenance = { status = "actively-developed" } [dependencies] syn = { workspace = true, features = ["default", "parsing", "printing"] } -darling = { workspace = true } -quote = { workspace = true } -proc-macro2 = { workspace = true } -manyhow = { workspace = true } -drop_bomb = { workspace = true } +darling.workspace = true +quote.workspace = true +proc-macro2.workspace = true +manyhow.workspace = true +drop_bomb.workspace = true diff --git a/macro/utils/src/emitter.rs b/libs/iroha_macro/utils/src/emitter.rs similarity index 100% rename from macro/utils/src/emitter.rs rename to libs/iroha_macro/utils/src/emitter.rs diff --git a/macro/utils/src/lib.rs b/libs/iroha_macro/utils/src/lib.rs similarity index 100% rename from macro/utils/src/lib.rs rename to libs/iroha_macro/utils/src/lib.rs diff --git a/p2p/Cargo.toml b/libs/iroha_p2p/Cargo.toml similarity index 61% rename from p2p/Cargo.toml rename to libs/iroha_p2p/Cargo.toml index 61ef83720ce..5b33d7fd2d4 100644 --- a/p2p/Cargo.toml +++ b/libs/iroha_p2p/Cargo.toml @@ -12,22 +12,22 @@ categories = ["network-programming"] workspace = true [dependencies] -iroha_logger = { workspace = true } +iroha_logger.workspace = true iroha_crypto = { workspace = true, default-features = true } iroha_data_model = { workspace = true, default-features = true, features = ["transparent_api"] } -iroha_primitives = { workspace = true } -iroha_config = { workspace = true } +iroha_primitives.workspace = true +iroha_config.workspace = true -rand = { workspace = true } +rand.workspace = true tokio = { workspace = true, features = ["rt-multi-thread", "macros", "io-util", "net", "time"] } futures = { workspace = true, features = ["alloc"] } -async-trait = { workspace = true } +async-trait.workspace = true parity-scale-codec = { workspace = true, features = ["derive"] } -thiserror = { workspace = true } -displaydoc = { workspace = true } -derive_more = { workspace = true } -bytes = { workspace = true } +thiserror.workspace = true +displaydoc.workspace = true +derive_more.workspace = true +bytes.workspace = true [dev-dependencies] -iroha_config_base = { workspace = true } -test_network = { workspace = true } +iroha_config_base.workspace = true +iroha_test_network.workspace = true diff --git a/p2p/src/lib.rs b/libs/iroha_p2p/src/lib.rs similarity index 100% rename from p2p/src/lib.rs rename to libs/iroha_p2p/src/lib.rs diff --git a/p2p/src/network.rs b/libs/iroha_p2p/src/network.rs similarity index 100% rename from p2p/src/network.rs rename to libs/iroha_p2p/src/network.rs diff --git a/p2p/src/peer.rs b/libs/iroha_p2p/src/peer.rs similarity index 100% rename from p2p/src/peer.rs rename to libs/iroha_p2p/src/peer.rs diff --git a/p2p/tests/integration/mod.rs b/libs/iroha_p2p/tests/integration/mod.rs similarity index 100% rename from p2p/tests/integration/mod.rs rename to libs/iroha_p2p/tests/integration/mod.rs diff --git a/p2p/tests/integration/p2p.rs b/libs/iroha_p2p/tests/integration/p2p.rs similarity index 100% rename from p2p/tests/integration/p2p.rs rename to libs/iroha_p2p/tests/integration/p2p.rs diff --git a/p2p/tests/mod.rs b/libs/iroha_p2p/tests/mod.rs similarity index 100% rename from p2p/tests/mod.rs rename to libs/iroha_p2p/tests/mod.rs diff --git a/primitives/Cargo.toml b/libs/iroha_primitives/Cargo.toml similarity index 91% rename from primitives/Cargo.toml rename to libs/iroha_primitives/Cargo.toml index 9576da88f09..0c663eb3ae7 100644 --- a/primitives/Cargo.toml +++ b/libs/iroha_primitives/Cargo.toml @@ -29,8 +29,8 @@ ffi_export = ["std", "iroha_ffi", "iroha_numeric/ffi_export"] [dependencies] iroha_primitives_derive = { path = "derive" } -iroha_macro = { workspace = true } -iroha_schema = { workspace = true } +iroha_macro.workspace = true +iroha_schema.workspace = true iroha_ffi = { workspace = true, optional = true } iroha_numeric = { path = "./numeric", default-features = false } @@ -41,11 +41,11 @@ serde_with = { workspace = true, features = ["macros"] } smallvec = { version = "1.13.2", default-features = false, features = ["serde", "union"] } smallstr = { version = "0.3.0", default-features = false, features = ["serde", "union"] } thiserror = { workspace = true, optional = true } -displaydoc = { workspace = true } +displaydoc.workspace = true parking_lot = { workspace = true, optional = true } -serde_json = { workspace = true } +serde_json.workspace = true [dev-dependencies] serde_json = { workspace = true, features = ["alloc"] } -trybuild = { workspace = true } +trybuild.workspace = true diff --git a/primitives/derive/Cargo.toml b/libs/iroha_primitives/derive/Cargo.toml similarity index 73% rename from primitives/derive/Cargo.toml rename to libs/iroha_primitives/derive/Cargo.toml index d6e018172a7..e6a1310eec5 100644 --- a/primitives/derive/Cargo.toml +++ b/libs/iroha_primitives/derive/Cargo.toml @@ -11,10 +11,10 @@ license.workspace = true proc-macro = true [dependencies] -quote = { workspace = true } -syn = { workspace = true } -manyhow = { workspace = true } -proc-macro2 = { workspace = true } +quote.workspace = true +syn.workspace = true +manyhow.workspace = true +proc-macro2.workspace = true iroha_numeric = { path = "../numeric", default-features = false } [dev-dependencies] diff --git a/primitives/derive/src/lib.rs b/libs/iroha_primitives/derive/src/lib.rs similarity index 100% rename from primitives/derive/src/lib.rs rename to libs/iroha_primitives/derive/src/lib.rs diff --git a/primitives/derive/src/numeric.rs b/libs/iroha_primitives/derive/src/numeric.rs similarity index 100% rename from primitives/derive/src/numeric.rs rename to libs/iroha_primitives/derive/src/numeric.rs diff --git a/primitives/derive/src/socket_addr.rs b/libs/iroha_primitives/derive/src/socket_addr.rs similarity index 100% rename from primitives/derive/src/socket_addr.rs rename to libs/iroha_primitives/derive/src/socket_addr.rs diff --git a/primitives/numeric/Cargo.toml b/libs/iroha_primitives/numeric/Cargo.toml similarity index 95% rename from primitives/numeric/Cargo.toml rename to libs/iroha_primitives/numeric/Cargo.toml index 132afe69a59..e7fa26c7059 100644 --- a/primitives/numeric/Cargo.toml +++ b/libs/iroha_primitives/numeric/Cargo.toml @@ -27,7 +27,7 @@ std = ["thiserror", "displaydoc/std"] ffi_export = ["std", "iroha_ffi", "rust_decimal/c-repr"] [dependencies] -iroha_schema = { workspace = true } +iroha_schema.workspace = true iroha_ffi = { workspace = true, optional = true } parity-scale-codec = { workspace = true, features = ["derive"] } @@ -35,7 +35,7 @@ derive_more = { workspace = true, features = ["display", "from", "as_ref", "as_m serde = { workspace = true, features = ["derive"] } serde_with = { workspace = true, features = ["macros"] } thiserror = { workspace = true, optional = true } -displaydoc = { workspace = true } +displaydoc.workspace = true rust_decimal = { version = "1.35", default-features = false, features = ["serde", "serde-with-str"] } diff --git a/primitives/numeric/src/lib.rs b/libs/iroha_primitives/numeric/src/lib.rs similarity index 100% rename from primitives/numeric/src/lib.rs rename to libs/iroha_primitives/numeric/src/lib.rs diff --git a/primitives/src/addr.rs b/libs/iroha_primitives/src/addr.rs similarity index 100% rename from primitives/src/addr.rs rename to libs/iroha_primitives/src/addr.rs diff --git a/primitives/src/cmpext.rs b/libs/iroha_primitives/src/cmpext.rs similarity index 100% rename from primitives/src/cmpext.rs rename to libs/iroha_primitives/src/cmpext.rs diff --git a/primitives/src/const_vec.rs b/libs/iroha_primitives/src/const_vec.rs similarity index 100% rename from primitives/src/const_vec.rs rename to libs/iroha_primitives/src/const_vec.rs diff --git a/primitives/src/conststr.rs b/libs/iroha_primitives/src/conststr.rs similarity index 100% rename from primitives/src/conststr.rs rename to libs/iroha_primitives/src/conststr.rs diff --git a/primitives/src/json.rs b/libs/iroha_primitives/src/json.rs similarity index 100% rename from primitives/src/json.rs rename to libs/iroha_primitives/src/json.rs diff --git a/primitives/src/lib.rs b/libs/iroha_primitives/src/lib.rs similarity index 100% rename from primitives/src/lib.rs rename to libs/iroha_primitives/src/lib.rs diff --git a/primitives/src/must_use.rs b/libs/iroha_primitives/src/must_use.rs similarity index 100% rename from primitives/src/must_use.rs rename to libs/iroha_primitives/src/must_use.rs diff --git a/primitives/src/numeric.rs b/libs/iroha_primitives/src/numeric.rs similarity index 100% rename from primitives/src/numeric.rs rename to libs/iroha_primitives/src/numeric.rs diff --git a/primitives/src/riffle_iter.rs b/libs/iroha_primitives/src/riffle_iter.rs similarity index 100% rename from primitives/src/riffle_iter.rs rename to libs/iroha_primitives/src/riffle_iter.rs diff --git a/primitives/src/small.rs b/libs/iroha_primitives/src/small.rs similarity index 100% rename from primitives/src/small.rs rename to libs/iroha_primitives/src/small.rs diff --git a/primitives/src/time.rs b/libs/iroha_primitives/src/time.rs similarity index 100% rename from primitives/src/time.rs rename to libs/iroha_primitives/src/time.rs diff --git a/primitives/src/unique_vec.rs b/libs/iroha_primitives/src/unique_vec.rs similarity index 100% rename from primitives/src/unique_vec.rs rename to libs/iroha_primitives/src/unique_vec.rs diff --git a/primitives/tests/ui.rs b/libs/iroha_primitives/tests/ui.rs similarity index 100% rename from primitives/tests/ui.rs rename to libs/iroha_primitives/tests/ui.rs diff --git a/primitives/tests/ui_fail/must_use_not_used.rs b/libs/iroha_primitives/tests/ui_fail/must_use_not_used.rs similarity index 100% rename from primitives/tests/ui_fail/must_use_not_used.rs rename to libs/iroha_primitives/tests/ui_fail/must_use_not_used.rs diff --git a/primitives/tests/ui_fail/must_use_not_used.stderr b/libs/iroha_primitives/tests/ui_fail/must_use_not_used.stderr similarity index 100% rename from primitives/tests/ui_fail/must_use_not_used.stderr rename to libs/iroha_primitives/tests/ui_fail/must_use_not_used.stderr diff --git a/schema/Cargo.toml b/libs/iroha_schema/Cargo.toml similarity index 94% rename from schema/Cargo.toml rename to libs/iroha_schema/Cargo.toml index 311d2ed4dc7..43502802f90 100644 --- a/schema/Cargo.toml +++ b/libs/iroha_schema/Cargo.toml @@ -18,4 +18,4 @@ serde = { workspace = true, features = ["derive", "alloc"] } [dev-dependencies] parity-scale-codec = { workspace = true, default-features = false, features = ["derive", "full"] } serde_json = { workspace = true, features = ["alloc"] } -impls = { workspace = true } +impls.workspace = true diff --git a/schema/derive/Cargo.toml b/libs/iroha_schema/derive/Cargo.toml similarity index 67% rename from schema/derive/Cargo.toml rename to libs/iroha_schema/derive/Cargo.toml index 5dc64ef0aad..6890050066a 100644 --- a/schema/derive/Cargo.toml +++ b/libs/iroha_schema/derive/Cargo.toml @@ -15,12 +15,12 @@ proc-macro = true [dependencies] syn = { workspace = true, features = ["default", "full"] } -proc-macro2 = { workspace = true } -quote = { workspace = true } +proc-macro2.workspace = true +quote.workspace = true manyhow = { workspace = true, features = ["darling"] } -darling = { workspace = true } +darling.workspace = true [dev-dependencies] -iroha_schema = { workspace = true } +iroha_schema.workspace = true -trybuild = { workspace = true } +trybuild.workspace = true diff --git a/schema/derive/src/lib.rs b/libs/iroha_schema/derive/src/lib.rs similarity index 100% rename from schema/derive/src/lib.rs rename to libs/iroha_schema/derive/src/lib.rs diff --git a/schema/derive/tests/ui.rs b/libs/iroha_schema/derive/tests/ui.rs similarity index 100% rename from schema/derive/tests/ui.rs rename to libs/iroha_schema/derive/tests/ui.rs diff --git a/schema/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.rs b/libs/iroha_schema/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.rs similarity index 100% rename from schema/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.rs rename to libs/iroha_schema/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.rs diff --git a/schema/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.stderr b/libs/iroha_schema/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.stderr similarity index 100% rename from schema/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.stderr rename to libs/iroha_schema/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.stderr diff --git a/schema/derive/tests/ui_pass/derive_into_schema.rs b/libs/iroha_schema/derive/tests/ui_pass/derive_into_schema.rs similarity index 100% rename from schema/derive/tests/ui_pass/derive_into_schema.rs rename to libs/iroha_schema/derive/tests/ui_pass/derive_into_schema.rs diff --git a/schema/gen/Cargo.toml b/libs/iroha_schema/gen/Cargo.toml similarity index 56% rename from schema/gen/Cargo.toml rename to libs/iroha_schema/gen/Cargo.toml index e1c1a416169..7ed42917ba5 100644 --- a/schema/gen/Cargo.toml +++ b/libs/iroha_schema/gen/Cargo.toml @@ -12,9 +12,9 @@ workspace = true [dependencies] iroha_data_model = { workspace = true, features = ["http", "transparent_api"] } -iroha_executor_data_model = { workspace = true } +iroha_executor_data_model.workspace = true -iroha_primitives = { workspace = true } -iroha_genesis = { workspace = true } -iroha_crypto = { workspace = true } -iroha_schema = { workspace = true } +iroha_primitives.workspace = true +iroha_genesis.workspace = true +iroha_crypto.workspace = true +iroha_schema.workspace = true diff --git a/schema/gen/src/lib.rs b/libs/iroha_schema/gen/src/lib.rs similarity index 100% rename from schema/gen/src/lib.rs rename to libs/iroha_schema/gen/src/lib.rs diff --git a/schema/src/lib.rs b/libs/iroha_schema/src/lib.rs similarity index 100% rename from schema/src/lib.rs rename to libs/iroha_schema/src/lib.rs diff --git a/schema/src/serialize.rs b/libs/iroha_schema/src/serialize.rs similarity index 100% rename from schema/src/serialize.rs rename to libs/iroha_schema/src/serialize.rs diff --git a/schema/tests/architecture-dependent.rs b/libs/iroha_schema/tests/architecture-dependent.rs similarity index 100% rename from schema/tests/architecture-dependent.rs rename to libs/iroha_schema/tests/architecture-dependent.rs diff --git a/schema/tests/enum_with_default_discriminants.rs b/libs/iroha_schema/tests/enum_with_default_discriminants.rs similarity index 100% rename from schema/tests/enum_with_default_discriminants.rs rename to libs/iroha_schema/tests/enum_with_default_discriminants.rs diff --git a/schema/tests/enum_with_various_discriminants.rs b/libs/iroha_schema/tests/enum_with_various_discriminants.rs similarity index 100% rename from schema/tests/enum_with_various_discriminants.rs rename to libs/iroha_schema/tests/enum_with_various_discriminants.rs diff --git a/schema/tests/fieldless_enum.rs b/libs/iroha_schema/tests/fieldless_enum.rs similarity index 100% rename from schema/tests/fieldless_enum.rs rename to libs/iroha_schema/tests/fieldless_enum.rs diff --git a/schema/tests/numbers_compact_and_fixed.rs b/libs/iroha_schema/tests/numbers_compact_and_fixed.rs similarity index 100% rename from schema/tests/numbers_compact_and_fixed.rs rename to libs/iroha_schema/tests/numbers_compact_and_fixed.rs diff --git a/schema/tests/schema_json.rs b/libs/iroha_schema/tests/schema_json.rs similarity index 100% rename from schema/tests/schema_json.rs rename to libs/iroha_schema/tests/schema_json.rs diff --git a/schema/tests/struct_with_generic_bounds.rs b/libs/iroha_schema/tests/struct_with_generic_bounds.rs similarity index 100% rename from schema/tests/struct_with_generic_bounds.rs rename to libs/iroha_schema/tests/struct_with_generic_bounds.rs diff --git a/schema/tests/struct_with_named_fields.rs b/libs/iroha_schema/tests/struct_with_named_fields.rs similarity index 100% rename from schema/tests/struct_with_named_fields.rs rename to libs/iroha_schema/tests/struct_with_named_fields.rs diff --git a/schema/tests/struct_with_unnamed_fields.rs b/libs/iroha_schema/tests/struct_with_unnamed_fields.rs similarity index 100% rename from schema/tests/struct_with_unnamed_fields.rs rename to libs/iroha_schema/tests/struct_with_unnamed_fields.rs diff --git a/schema/tests/transparent_types.rs b/libs/iroha_schema/tests/transparent_types.rs similarity index 100% rename from schema/tests/transparent_types.rs rename to libs/iroha_schema/tests/transparent_types.rs diff --git a/smart_contract/.cargo/config.toml b/libs/iroha_smart_contract/.cargo/config.toml similarity index 100% rename from smart_contract/.cargo/config.toml rename to libs/iroha_smart_contract/.cargo/config.toml diff --git a/smart_contract/Cargo.toml b/libs/iroha_smart_contract/Cargo.toml similarity index 83% rename from smart_contract/Cargo.toml rename to libs/iroha_smart_contract/Cargo.toml index 17d8afdd19d..eff72fdcdfd 100644 --- a/smart_contract/Cargo.toml +++ b/libs/iroha_smart_contract/Cargo.toml @@ -27,10 +27,10 @@ derive_more.workspace = true getrandom = "0.2" [dev-dependencies] -test_samples = { workspace = true } +iroha_test_samples.workspace = true webassembly-test = "0.1.0" # Not used directly but required for compilation -getrandom = { version = "0.2", features = ["custom"] } +getrandom.workspace = true -trybuild = { workspace = true } +trybuild.workspace = true diff --git a/smart_contract/README.md b/libs/iroha_smart_contract/README.md similarity index 100% rename from smart_contract/README.md rename to libs/iroha_smart_contract/README.md diff --git a/smart_contract/derive/Cargo.toml b/libs/iroha_smart_contract/derive/Cargo.toml similarity index 57% rename from smart_contract/derive/Cargo.toml rename to libs/iroha_smart_contract/derive/Cargo.toml index d6be1860ead..f0f5f0b392a 100644 --- a/smart_contract/derive/Cargo.toml +++ b/libs/iroha_smart_contract/derive/Cargo.toml @@ -14,9 +14,9 @@ workspace = true proc-macro = true [dependencies] -iroha_macro_utils = { workspace = true } +iroha_macro_utils.workspace = true -syn = { workspace = true } -manyhow = { workspace = true } -quote = { workspace = true } -proc-macro2 = { workspace = true } +syn.workspace = true +manyhow.workspace = true +quote.workspace = true +proc-macro2.workspace = true diff --git a/smart_contract/derive/src/entrypoint.rs b/libs/iroha_smart_contract/derive/src/entrypoint.rs similarity index 100% rename from smart_contract/derive/src/entrypoint.rs rename to libs/iroha_smart_contract/derive/src/entrypoint.rs diff --git a/smart_contract/derive/src/lib.rs b/libs/iroha_smart_contract/derive/src/lib.rs similarity index 100% rename from smart_contract/derive/src/lib.rs rename to libs/iroha_smart_contract/derive/src/lib.rs diff --git a/smart_contract/src/lib.rs b/libs/iroha_smart_contract/src/lib.rs similarity index 99% rename from smart_contract/src/lib.rs rename to libs/iroha_smart_contract/src/lib.rs index ee6e2ac2c0f..006561bb1c1 100644 --- a/smart_contract/src/lib.rs +++ b/libs/iroha_smart_contract/src/lib.rs @@ -61,7 +61,7 @@ unsafe extern "C" fn _iroha_smart_contract_dealloc(offset: *mut u8, len: usize) /// /// ``` /// // Cargo.toml -/// // getrandom = { version = "0.2", features = ["custom"] } +/// // getrandom.workspace = true /// /// getrandom::register_custom_getrandom!(iroha_smart_contract::stub_getrandom); /// ``` @@ -595,7 +595,7 @@ mod tests { str::FromStr, }; - let query = FindAccountById::new(test_samples::ALICE_ID.clone()); + let query = FindAccountById::new(iroha_test_samples::ALICE_ID.clone()); let smart_contract_filter: PredicateBox = iroha_data_model::query::predicate::value::QueryOutputPredicate::Identifiable( iroha_data_model::query::predicate::string::StringPredicate::EndsWith( diff --git a/smart_contract/tests/ui.rs b/libs/iroha_smart_contract/tests/ui.rs similarity index 100% rename from smart_contract/tests/ui.rs rename to libs/iroha_smart_contract/tests/ui.rs diff --git a/smart_contract/tests/ui_fail/cant_filter_singular_query.rs b/libs/iroha_smart_contract/tests/ui_fail/cant_filter_singular_query.rs similarity index 100% rename from smart_contract/tests/ui_fail/cant_filter_singular_query.rs rename to libs/iroha_smart_contract/tests/ui_fail/cant_filter_singular_query.rs diff --git a/smart_contract/tests/ui_fail/cant_filter_singular_query.stderr b/libs/iroha_smart_contract/tests/ui_fail/cant_filter_singular_query.stderr similarity index 95% rename from smart_contract/tests/ui_fail/cant_filter_singular_query.stderr rename to libs/iroha_smart_contract/tests/ui_fail/cant_filter_singular_query.stderr index 8bc8b9f6284..90f1500896f 100644 --- a/smart_contract/tests/ui_fail/cant_filter_singular_query.stderr +++ b/libs/iroha_smart_contract/tests/ui_fail/cant_filter_singular_query.stderr @@ -7,7 +7,7 @@ error[E0599]: the method `filter` exists for struct `FindDomainById`, but its tr | |_________| | | - ::: $WORKSPACE/data_model/src/query/mod.rs + ::: $WORKSPACE/libs/iroha_data_model/src/query/mod.rs | | / queries! { | | /// [`FindAllDomains`] Iroha Query finds all [`Domain`]s presented in Iroha [`Peer`]. diff --git a/smart_contract/utils/Cargo.toml b/libs/iroha_smart_contract/utils/Cargo.toml similarity index 100% rename from smart_contract/utils/Cargo.toml rename to libs/iroha_smart_contract/utils/Cargo.toml diff --git a/smart_contract/utils/src/debug.rs b/libs/iroha_smart_contract/utils/src/debug.rs similarity index 100% rename from smart_contract/utils/src/debug.rs rename to libs/iroha_smart_contract/utils/src/debug.rs diff --git a/smart_contract/utils/src/lib.rs b/libs/iroha_smart_contract/utils/src/lib.rs similarity index 100% rename from smart_contract/utils/src/lib.rs rename to libs/iroha_smart_contract/utils/src/lib.rs diff --git a/smart_contract/utils/src/log.rs b/libs/iroha_smart_contract/utils/src/log.rs similarity index 100% rename from smart_contract/utils/src/log.rs rename to libs/iroha_smart_contract/utils/src/log.rs diff --git a/telemetry/Cargo.toml b/libs/iroha_telemetry/Cargo.toml similarity index 71% rename from telemetry/Cargo.toml rename to libs/iroha_telemetry/Cargo.toml index f5b99948193..b9a595d439b 100644 --- a/telemetry/Cargo.toml +++ b/libs/iroha_telemetry/Cargo.toml @@ -20,29 +20,29 @@ metric-instrumentation = [] [dependencies] iroha_telemetry_derive = { path = "derive" } -iroha_config = { workspace = true } -iroha_logger = { workspace = true } +iroha_config.workspace = true +iroha_logger.workspace = true iroha_futures = { workspace = true, features = ["telemetry"] } -async-trait = { workspace = true } +async-trait.workspace = true chrono = "0.4.38" -eyre = { workspace = true } +eyre.workspace = true futures = { workspace = true, features = ["std", "async-await"] } -serde_json = { workspace = true } +serde_json.workspace = true streaming-stats = "0.2.3" serde = { workspace = true, features = ["derive"] } tokio = { workspace = true, features = ["rt", "rt-multi-thread", "macros"] } tokio-stream = { workspace = true, features = ["fs", "sync"] } -tokio-tungstenite = { workspace = true } +tokio-tungstenite.workspace = true url = { workspace = true, features = ["serde"] } -prometheus = { workspace = true } -parity-scale-codec = { workspace = true } +prometheus.workspace = true +parity-scale-codec.workspace = true [build-dependencies] -eyre = { workspace = true } +eyre.workspace = true vergen = { workspace = true, features = ["cargo", "git", "gitoxide"] } [dev-dependencies] -expect-test = { workspace = true } -hex = { workspace = true } +expect-test.workspace = true +hex.workspace = true diff --git a/telemetry/build.rs b/libs/iroha_telemetry/build.rs similarity index 100% rename from telemetry/build.rs rename to libs/iroha_telemetry/build.rs diff --git a/telemetry/derive/Cargo.toml b/libs/iroha_telemetry/derive/Cargo.toml similarity index 67% rename from telemetry/derive/Cargo.toml rename to libs/iroha_telemetry/derive/Cargo.toml index 3a4f7e9fe21..88cf104962b 100644 --- a/telemetry/derive/Cargo.toml +++ b/libs/iroha_telemetry/derive/Cargo.toml @@ -19,13 +19,13 @@ is-it-maintained-open-issues = { repository = "https://github.com/hyperledger/ir maintenance = { status = "actively-developed" } [dependencies] -syn = { workspace = true } -quote = { workspace = true } -proc-macro2 = { workspace = true } -manyhow = { workspace = true } -iroha_macro_utils = { workspace = true } +syn.workspace = true +quote.workspace = true +proc-macro2.workspace = true +manyhow.workspace = true +iroha_macro_utils.workspace = true [dev-dependencies] -iroha_core = { workspace = true } +iroha_core.workspace = true -trybuild = { workspace = true } +trybuild.workspace = true diff --git a/telemetry/derive/src/lib.rs b/libs/iroha_telemetry/derive/src/lib.rs similarity index 100% rename from telemetry/derive/src/lib.rs rename to libs/iroha_telemetry/derive/src/lib.rs diff --git a/telemetry/derive/tests/ui.rs b/libs/iroha_telemetry/derive/tests/ui.rs similarity index 100% rename from telemetry/derive/tests/ui.rs rename to libs/iroha_telemetry/derive/tests/ui.rs diff --git a/telemetry/derive/tests/ui_fail/args_no_wsv.rs b/libs/iroha_telemetry/derive/tests/ui_fail/args_no_wsv.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/args_no_wsv.rs rename to libs/iroha_telemetry/derive/tests/ui_fail/args_no_wsv.rs diff --git a/telemetry/derive/tests/ui_fail/args_no_wsv.stderr b/libs/iroha_telemetry/derive/tests/ui_fail/args_no_wsv.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/args_no_wsv.stderr rename to libs/iroha_telemetry/derive/tests/ui_fail/args_no_wsv.stderr diff --git a/telemetry/derive/tests/ui_fail/bare_spec.rs b/libs/iroha_telemetry/derive/tests/ui_fail/bare_spec.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/bare_spec.rs rename to libs/iroha_telemetry/derive/tests/ui_fail/bare_spec.rs diff --git a/telemetry/derive/tests/ui_fail/bare_spec.stderr b/libs/iroha_telemetry/derive/tests/ui_fail/bare_spec.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/bare_spec.stderr rename to libs/iroha_telemetry/derive/tests/ui_fail/bare_spec.stderr diff --git a/telemetry/derive/tests/ui_fail/doubled_plus.rs b/libs/iroha_telemetry/derive/tests/ui_fail/doubled_plus.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/doubled_plus.rs rename to libs/iroha_telemetry/derive/tests/ui_fail/doubled_plus.rs diff --git a/telemetry/derive/tests/ui_fail/doubled_plus.stderr b/libs/iroha_telemetry/derive/tests/ui_fail/doubled_plus.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/doubled_plus.stderr rename to libs/iroha_telemetry/derive/tests/ui_fail/doubled_plus.stderr diff --git a/telemetry/derive/tests/ui_fail/no_args.rs b/libs/iroha_telemetry/derive/tests/ui_fail/no_args.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/no_args.rs rename to libs/iroha_telemetry/derive/tests/ui_fail/no_args.rs diff --git a/telemetry/derive/tests/ui_fail/no_args.stderr b/libs/iroha_telemetry/derive/tests/ui_fail/no_args.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/no_args.stderr rename to libs/iroha_telemetry/derive/tests/ui_fail/no_args.stderr diff --git a/telemetry/derive/tests/ui_fail/non_snake_case_name.rs b/libs/iroha_telemetry/derive/tests/ui_fail/non_snake_case_name.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/non_snake_case_name.rs rename to libs/iroha_telemetry/derive/tests/ui_fail/non_snake_case_name.rs diff --git a/telemetry/derive/tests/ui_fail/non_snake_case_name.stderr b/libs/iroha_telemetry/derive/tests/ui_fail/non_snake_case_name.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/non_snake_case_name.stderr rename to libs/iroha_telemetry/derive/tests/ui_fail/non_snake_case_name.stderr diff --git a/telemetry/derive/tests/ui_fail/not_execute.rs b/libs/iroha_telemetry/derive/tests/ui_fail/not_execute.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/not_execute.rs rename to libs/iroha_telemetry/derive/tests/ui_fail/not_execute.rs diff --git a/telemetry/derive/tests/ui_fail/not_execute.stderr b/libs/iroha_telemetry/derive/tests/ui_fail/not_execute.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/not_execute.stderr rename to libs/iroha_telemetry/derive/tests/ui_fail/not_execute.stderr diff --git a/telemetry/derive/tests/ui_fail/not_return_result.rs b/libs/iroha_telemetry/derive/tests/ui_fail/not_return_result.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/not_return_result.rs rename to libs/iroha_telemetry/derive/tests/ui_fail/not_return_result.rs diff --git a/telemetry/derive/tests/ui_fail/not_return_result.stderr b/libs/iroha_telemetry/derive/tests/ui_fail/not_return_result.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/not_return_result.stderr rename to libs/iroha_telemetry/derive/tests/ui_fail/not_return_result.stderr diff --git a/telemetry/derive/tests/ui_fail/return_nothing.rs b/libs/iroha_telemetry/derive/tests/ui_fail/return_nothing.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/return_nothing.rs rename to libs/iroha_telemetry/derive/tests/ui_fail/return_nothing.rs diff --git a/telemetry/derive/tests/ui_fail/return_nothing.stderr b/libs/iroha_telemetry/derive/tests/ui_fail/return_nothing.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/return_nothing.stderr rename to libs/iroha_telemetry/derive/tests/ui_fail/return_nothing.stderr diff --git a/telemetry/derive/tests/ui_fail/trailing_plus.rs b/libs/iroha_telemetry/derive/tests/ui_fail/trailing_plus.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/trailing_plus.rs rename to libs/iroha_telemetry/derive/tests/ui_fail/trailing_plus.rs diff --git a/telemetry/derive/tests/ui_fail/trailing_plus.stderr b/libs/iroha_telemetry/derive/tests/ui_fail/trailing_plus.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/trailing_plus.stderr rename to libs/iroha_telemetry/derive/tests/ui_fail/trailing_plus.stderr diff --git a/telemetry/src/dev.rs b/libs/iroha_telemetry/src/dev.rs similarity index 100% rename from telemetry/src/dev.rs rename to libs/iroha_telemetry/src/dev.rs diff --git a/telemetry/src/futures.rs b/libs/iroha_telemetry/src/futures.rs similarity index 100% rename from telemetry/src/futures.rs rename to libs/iroha_telemetry/src/futures.rs diff --git a/telemetry/src/lib.rs b/libs/iroha_telemetry/src/lib.rs similarity index 100% rename from telemetry/src/lib.rs rename to libs/iroha_telemetry/src/lib.rs diff --git a/telemetry/src/metrics.rs b/libs/iroha_telemetry/src/metrics.rs similarity index 100% rename from telemetry/src/metrics.rs rename to libs/iroha_telemetry/src/metrics.rs diff --git a/telemetry/src/retry_period.rs b/libs/iroha_telemetry/src/retry_period.rs similarity index 100% rename from telemetry/src/retry_period.rs rename to libs/iroha_telemetry/src/retry_period.rs diff --git a/telemetry/src/ws.rs b/libs/iroha_telemetry/src/ws.rs similarity index 100% rename from telemetry/src/ws.rs rename to libs/iroha_telemetry/src/ws.rs diff --git a/test_samples/Cargo.toml b/libs/iroha_test_samples/Cargo.toml similarity index 76% rename from test_samples/Cargo.toml rename to libs/iroha_test_samples/Cargo.toml index 276af31906f..2fdaf8064ee 100644 --- a/test_samples/Cargo.toml +++ b/libs/iroha_test_samples/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "test_samples" +name = "iroha_test_samples" edition.workspace = true version.workspace = true authors.workspace = true @@ -14,12 +14,12 @@ categories.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -iroha_crypto = { workspace = true } -iroha_data_model = { workspace = true } +iroha_crypto.workspace = true +iroha_data_model.workspace = true -once_cell = { workspace = true } +once_cell.workspace = true serde = { workspace = true, features = ["derive"] } -toml = { workspace = true } +toml.workspace = true [lints] workspace = true diff --git a/test_samples/src/lib.rs b/libs/iroha_test_samples/src/lib.rs similarity index 100% rename from test_samples/src/lib.rs rename to libs/iroha_test_samples/src/lib.rs diff --git a/torii/Cargo.toml b/libs/iroha_torii/Cargo.toml similarity index 78% rename from torii/Cargo.toml rename to libs/iroha_torii/Cargo.toml index 662a37d2725..688294d9fc6 100644 --- a/torii/Cargo.toml +++ b/libs/iroha_torii/Cargo.toml @@ -26,31 +26,31 @@ profiling = ["pprof"] schema = ["iroha_schema", "iroha_schema_gen"] [dependencies] -iroha_core = { workspace = true } -iroha_config = { workspace = true } -iroha_primitives = { workspace = true } -iroha_logger = { workspace = true } +iroha_core.workspace = true +iroha_config.workspace = true +iroha_primitives.workspace = true +iroha_logger.workspace = true iroha_data_model = { workspace = true, features = ["http"] } -iroha_version = { workspace = true } -iroha_torii_const = { workspace = true } -iroha_futures = { workspace = true } -iroha_macro = { workspace = true } +iroha_version.workspace = true +iroha_torii_const.workspace = true +iroha_futures.workspace = true +iroha_macro.workspace = true iroha_schema = { workspace = true, optional = true } iroha_schema_gen = { workspace = true, optional = true } iroha_telemetry = { workspace = true, optional = true } -thiserror = { workspace = true } -displaydoc = { workspace = true } +thiserror.workspace = true +displaydoc.workspace = true futures = { workspace = true, features = ["std", "async-await"] } axum = { workspace = true, features = ["multipart", "ws", "query", "json", "tokio", "http1"] } tower-http = { version = "0.5.0", features = ["trace", "timeout"] } tokio = { workspace = true, features = ["sync", "time", "macros"] } -eyre = { workspace = true } +eyre.workspace = true error-stack = { workspace = true, features = ["eyre"] } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, optional = true } -async-trait = { workspace = true } +async-trait.workspace = true parity-scale-codec = { workspace = true, features = ["derive"] } # TODO: switch to original crate once fix is merged (https://github.com/tikv/pprof-rs/pull/241) pprof = { git = " https://github.com/Erigara/pprof-rs", branch = "fix_pointer_align", optional = true, default-features = false, features = ["protobuf-codec", "frame-pointer", "cpp"] } -nonzero_ext = { workspace = true } +nonzero_ext.workspace = true diff --git a/torii/const/Cargo.toml b/libs/iroha_torii/const/Cargo.toml similarity index 100% rename from torii/const/Cargo.toml rename to libs/iroha_torii/const/Cargo.toml diff --git a/torii/const/src/lib.rs b/libs/iroha_torii/const/src/lib.rs similarity index 100% rename from torii/const/src/lib.rs rename to libs/iroha_torii/const/src/lib.rs diff --git a/torii/pytests/README.md b/libs/iroha_torii/pytests/README.md similarity index 100% rename from torii/pytests/README.md rename to libs/iroha_torii/pytests/README.md diff --git a/torii/pytests/common/schemas/get_configuration_response_schema.json b/libs/iroha_torii/pytests/common/schemas/get_configuration_response_schema.json similarity index 100% rename from torii/pytests/common/schemas/get_configuration_response_schema.json rename to libs/iroha_torii/pytests/common/schemas/get_configuration_response_schema.json diff --git a/torii/pytests/common/schemas/get_schema_response.json b/libs/iroha_torii/pytests/common/schemas/get_schema_response.json similarity index 100% rename from torii/pytests/common/schemas/get_schema_response.json rename to libs/iroha_torii/pytests/common/schemas/get_schema_response.json diff --git a/torii/pytests/common/schemas/get_status_response.json b/libs/iroha_torii/pytests/common/schemas/get_status_response.json similarity index 100% rename from torii/pytests/common/schemas/get_status_response.json rename to libs/iroha_torii/pytests/common/schemas/get_status_response.json diff --git a/torii/pytests/common/settings.py b/libs/iroha_torii/pytests/common/settings.py similarity index 73% rename from torii/pytests/common/settings.py rename to libs/iroha_torii/pytests/common/settings.py index ed56a58eb51..08f60c1ed54 100644 --- a/torii/pytests/common/settings.py +++ b/libs/iroha_torii/pytests/common/settings.py @@ -5,7 +5,9 @@ load_dotenv() BASE_DIR = os.path.dirname( - os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + os.path.dirname( + os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + ) ) CONFIG_DIR = os.path.join(BASE_DIR, "configs/swarm/client.toml") diff --git a/torii/pytests/poetry.lock b/libs/iroha_torii/pytests/poetry.lock similarity index 100% rename from torii/pytests/poetry.lock rename to libs/iroha_torii/pytests/poetry.lock diff --git a/torii/pytests/pyproject.toml b/libs/iroha_torii/pytests/pyproject.toml similarity index 100% rename from torii/pytests/pyproject.toml rename to libs/iroha_torii/pytests/pyproject.toml diff --git a/torii/pytests/test/__init__.py b/libs/iroha_torii/pytests/test/__init__.py similarity index 100% rename from torii/pytests/test/__init__.py rename to libs/iroha_torii/pytests/test/__init__.py diff --git a/torii/pytests/test/api_version/conftest.py b/libs/iroha_torii/pytests/test/api_version/conftest.py similarity index 100% rename from torii/pytests/test/api_version/conftest.py rename to libs/iroha_torii/pytests/test/api_version/conftest.py diff --git a/torii/pytests/test/api_version/test_api_version.py b/libs/iroha_torii/pytests/test/api_version/test_api_version.py similarity index 100% rename from torii/pytests/test/api_version/test_api_version.py rename to libs/iroha_torii/pytests/test/api_version/test_api_version.py diff --git a/torii/pytests/test/configuration/conftest.py b/libs/iroha_torii/pytests/test/configuration/conftest.py similarity index 100% rename from torii/pytests/test/configuration/conftest.py rename to libs/iroha_torii/pytests/test/configuration/conftest.py diff --git a/torii/pytests/test/configuration/test_get_configuration.py b/libs/iroha_torii/pytests/test/configuration/test_get_configuration.py similarity index 100% rename from torii/pytests/test/configuration/test_get_configuration.py rename to libs/iroha_torii/pytests/test/configuration/test_get_configuration.py diff --git a/torii/pytests/test/configuration/test_post_configuration.py b/libs/iroha_torii/pytests/test/configuration/test_post_configuration.py similarity index 100% rename from torii/pytests/test/configuration/test_post_configuration.py rename to libs/iroha_torii/pytests/test/configuration/test_post_configuration.py diff --git a/torii/pytests/test/conftest.py b/libs/iroha_torii/pytests/test/conftest.py similarity index 100% rename from torii/pytests/test/conftest.py rename to libs/iroha_torii/pytests/test/conftest.py diff --git a/torii/pytests/test/general/conftest.py b/libs/iroha_torii/pytests/test/general/conftest.py similarity index 100% rename from torii/pytests/test/general/conftest.py rename to libs/iroha_torii/pytests/test/general/conftest.py diff --git a/torii/pytests/test/general/test_200_status_codes.py b/libs/iroha_torii/pytests/test/general/test_200_status_codes.py similarity index 100% rename from torii/pytests/test/general/test_200_status_codes.py rename to libs/iroha_torii/pytests/test/general/test_200_status_codes.py diff --git a/torii/pytests/test/general/test_400_status_codes.py b/libs/iroha_torii/pytests/test/general/test_400_status_codes.py similarity index 100% rename from torii/pytests/test/general/test_400_status_codes.py rename to libs/iroha_torii/pytests/test/general/test_400_status_codes.py diff --git a/torii/pytests/test/health/conftest.py b/libs/iroha_torii/pytests/test/health/conftest.py similarity index 100% rename from torii/pytests/test/health/conftest.py rename to libs/iroha_torii/pytests/test/health/conftest.py diff --git a/torii/pytests/test/health/test_health.py b/libs/iroha_torii/pytests/test/health/test_health.py similarity index 100% rename from torii/pytests/test/health/test_health.py rename to libs/iroha_torii/pytests/test/health/test_health.py diff --git a/torii/pytests/test/schema/conftest.py b/libs/iroha_torii/pytests/test/schema/conftest.py similarity index 100% rename from torii/pytests/test/schema/conftest.py rename to libs/iroha_torii/pytests/test/schema/conftest.py diff --git a/torii/pytests/test/schema/test_schema.py b/libs/iroha_torii/pytests/test/schema/test_schema.py similarity index 100% rename from torii/pytests/test/schema/test_schema.py rename to libs/iroha_torii/pytests/test/schema/test_schema.py diff --git a/torii/pytests/test/status/conftest.py b/libs/iroha_torii/pytests/test/status/conftest.py similarity index 100% rename from torii/pytests/test/status/conftest.py rename to libs/iroha_torii/pytests/test/status/conftest.py diff --git a/torii/pytests/test/status/test_status.py b/libs/iroha_torii/pytests/test/status/test_status.py similarity index 100% rename from torii/pytests/test/status/test_status.py rename to libs/iroha_torii/pytests/test/status/test_status.py diff --git a/torii/src/event.rs b/libs/iroha_torii/src/event.rs similarity index 100% rename from torii/src/event.rs rename to libs/iroha_torii/src/event.rs diff --git a/torii/src/lib.rs b/libs/iroha_torii/src/lib.rs similarity index 100% rename from torii/src/lib.rs rename to libs/iroha_torii/src/lib.rs diff --git a/torii/src/routing.rs b/libs/iroha_torii/src/routing.rs similarity index 100% rename from torii/src/routing.rs rename to libs/iroha_torii/src/routing.rs diff --git a/torii/src/stream.rs b/libs/iroha_torii/src/stream.rs similarity index 100% rename from torii/src/stream.rs rename to libs/iroha_torii/src/stream.rs diff --git a/torii/src/utils.rs b/libs/iroha_torii/src/utils.rs similarity index 100% rename from torii/src/utils.rs rename to libs/iroha_torii/src/utils.rs diff --git a/smart_contract/trigger/Cargo.toml b/libs/iroha_trigger/Cargo.toml similarity index 100% rename from smart_contract/trigger/Cargo.toml rename to libs/iroha_trigger/Cargo.toml diff --git a/smart_contract/trigger/derive/Cargo.toml b/libs/iroha_trigger/derive/Cargo.toml similarity index 52% rename from smart_contract/trigger/derive/Cargo.toml rename to libs/iroha_trigger/derive/Cargo.toml index 19a02bc9cc0..6278e1bc7f9 100644 --- a/smart_contract/trigger/derive/Cargo.toml +++ b/libs/iroha_trigger/derive/Cargo.toml @@ -15,10 +15,10 @@ workspace = true proc-macro = true [dependencies] -iroha_macro_utils = { workspace = true } +iroha_macro_utils.workspace = true -syn = { workspace = true } -manyhow = { workspace = true } -quote = { workspace = true } -proc-macro2 = { workspace = true } -darling = { workspace = true } +syn.workspace = true +manyhow.workspace = true +quote.workspace = true +proc-macro2.workspace = true +darling.workspace = true diff --git a/smart_contract/trigger/derive/src/entrypoint.rs b/libs/iroha_trigger/derive/src/entrypoint.rs similarity index 100% rename from smart_contract/trigger/derive/src/entrypoint.rs rename to libs/iroha_trigger/derive/src/entrypoint.rs diff --git a/smart_contract/trigger/derive/src/lib.rs b/libs/iroha_trigger/derive/src/lib.rs similarity index 100% rename from smart_contract/trigger/derive/src/lib.rs rename to libs/iroha_trigger/derive/src/lib.rs diff --git a/smart_contract/trigger/src/lib.rs b/libs/iroha_trigger/src/lib.rs similarity index 100% rename from smart_contract/trigger/src/lib.rs rename to libs/iroha_trigger/src/lib.rs diff --git a/version/Cargo.toml b/libs/iroha_version/Cargo.toml similarity index 90% rename from version/Cargo.toml rename to libs/iroha_version/Cargo.toml index 7dbb74aef92..dbda58e9d7d 100644 --- a/version/Cargo.toml +++ b/libs/iroha_version/Cargo.toml @@ -25,7 +25,7 @@ json = ["serde", "serde_json"] [dependencies] iroha_version_derive = { path = "derive", default-features = false, optional = true } -iroha_macro = { workspace = true } +iroha_macro.workspace = true parity-scale-codec = { workspace = true, optional = true, features = ["derive"] } serde_json = { workspace = true, optional = true, features = ["alloc"] } @@ -33,5 +33,5 @@ serde = { workspace = true, optional = true, features = ["derive"] } thiserror = { workspace = true, optional = true } [dev-dependencies] -iroha_data_model = { workspace = true } -iroha_logger = { workspace = true } +iroha_data_model.workspace = true +iroha_logger.workspace = true diff --git a/version/derive/Cargo.toml b/libs/iroha_version/derive/Cargo.toml similarity index 73% rename from version/derive/Cargo.toml rename to libs/iroha_version/derive/Cargo.toml index 0cb685b23b1..fc63375042b 100644 --- a/version/derive/Cargo.toml +++ b/libs/iroha_version/derive/Cargo.toml @@ -15,17 +15,17 @@ proc-macro = true [dependencies] syn = { workspace = true, features = ["default", "full"] } -quote = { workspace = true } -proc-macro2 = { workspace = true } -manyhow = { workspace = true } -darling = { workspace = true } +quote.workspace = true +proc-macro2.workspace = true +manyhow.workspace = true +darling.workspace = true [dev-dependencies] iroha_version = { workspace = true, features = ["scale", "json"] } -iroha_macro = { workspace = true } +iroha_macro.workspace = true parity-scale-codec = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["alloc"] } serde = { workspace = true, features = ["derive"] } -trybuild = { workspace = true } +trybuild.workspace = true diff --git a/version/derive/src/lib.rs b/libs/iroha_version/derive/src/lib.rs similarity index 100% rename from version/derive/src/lib.rs rename to libs/iroha_version/derive/src/lib.rs diff --git a/version/derive/tests/json.rs b/libs/iroha_version/derive/tests/json.rs similarity index 100% rename from version/derive/tests/json.rs rename to libs/iroha_version/derive/tests/json.rs diff --git a/version/derive/tests/scale.rs b/libs/iroha_version/derive/tests/scale.rs similarity index 100% rename from version/derive/tests/scale.rs rename to libs/iroha_version/derive/tests/scale.rs diff --git a/version/derive/tests/ui.rs b/libs/iroha_version/derive/tests/ui.rs similarity index 100% rename from version/derive/tests/ui.rs rename to libs/iroha_version/derive/tests/ui.rs diff --git a/version/derive/tests/ui_fail/field_missing_in_version_attribute.rs b/libs/iroha_version/derive/tests/ui_fail/field_missing_in_version_attribute.rs similarity index 100% rename from version/derive/tests/ui_fail/field_missing_in_version_attribute.rs rename to libs/iroha_version/derive/tests/ui_fail/field_missing_in_version_attribute.rs diff --git a/version/derive/tests/ui_fail/field_missing_in_version_attribute.stderr b/libs/iroha_version/derive/tests/ui_fail/field_missing_in_version_attribute.stderr similarity index 100% rename from version/derive/tests/ui_fail/field_missing_in_version_attribute.stderr rename to libs/iroha_version/derive/tests/ui_fail/field_missing_in_version_attribute.stderr diff --git a/version/derive/tests/ui_fail/field_typo_in_version_attribute.rs b/libs/iroha_version/derive/tests/ui_fail/field_typo_in_version_attribute.rs similarity index 100% rename from version/derive/tests/ui_fail/field_typo_in_version_attribute.rs rename to libs/iroha_version/derive/tests/ui_fail/field_typo_in_version_attribute.rs diff --git a/version/derive/tests/ui_fail/field_typo_in_version_attribute.stderr b/libs/iroha_version/derive/tests/ui_fail/field_typo_in_version_attribute.stderr similarity index 100% rename from version/derive/tests/ui_fail/field_typo_in_version_attribute.stderr rename to libs/iroha_version/derive/tests/ui_fail/field_typo_in_version_attribute.stderr diff --git a/version/derive/tests/ui_fail/invalid_range_equal.rs b/libs/iroha_version/derive/tests/ui_fail/invalid_range_equal.rs similarity index 100% rename from version/derive/tests/ui_fail/invalid_range_equal.rs rename to libs/iroha_version/derive/tests/ui_fail/invalid_range_equal.rs diff --git a/version/derive/tests/ui_fail/invalid_range_equal.stderr b/libs/iroha_version/derive/tests/ui_fail/invalid_range_equal.stderr similarity index 100% rename from version/derive/tests/ui_fail/invalid_range_equal.stderr rename to libs/iroha_version/derive/tests/ui_fail/invalid_range_equal.stderr diff --git a/version/derive/tests/ui_fail/invalid_range_less.rs b/libs/iroha_version/derive/tests/ui_fail/invalid_range_less.rs similarity index 100% rename from version/derive/tests/ui_fail/invalid_range_less.rs rename to libs/iroha_version/derive/tests/ui_fail/invalid_range_less.rs diff --git a/version/derive/tests/ui_fail/invalid_range_less.stderr b/libs/iroha_version/derive/tests/ui_fail/invalid_range_less.stderr similarity index 100% rename from version/derive/tests/ui_fail/invalid_range_less.stderr rename to libs/iroha_version/derive/tests/ui_fail/invalid_range_less.stderr diff --git a/version/derive/tests/ui_fail/unknown_field_in_version_attribute.rs b/libs/iroha_version/derive/tests/ui_fail/unknown_field_in_version_attribute.rs similarity index 100% rename from version/derive/tests/ui_fail/unknown_field_in_version_attribute.rs rename to libs/iroha_version/derive/tests/ui_fail/unknown_field_in_version_attribute.rs diff --git a/version/derive/tests/ui_fail/unknown_field_in_version_attribute.stderr b/libs/iroha_version/derive/tests/ui_fail/unknown_field_in_version_attribute.stderr similarity index 100% rename from version/derive/tests/ui_fail/unknown_field_in_version_attribute.stderr rename to libs/iroha_version/derive/tests/ui_fail/unknown_field_in_version_attribute.stderr diff --git a/version/derive/tests/ui_pass/declare_several_versioned.rs b/libs/iroha_version/derive/tests/ui_pass/declare_several_versioned.rs similarity index 100% rename from version/derive/tests/ui_pass/declare_several_versioned.rs rename to libs/iroha_version/derive/tests/ui_pass/declare_several_versioned.rs diff --git a/version/derive/tests/ui_pass/declare_versioned.rs b/libs/iroha_version/derive/tests/ui_pass/declare_versioned.rs similarity index 100% rename from version/derive/tests/ui_pass/declare_versioned.rs rename to libs/iroha_version/derive/tests/ui_pass/declare_versioned.rs diff --git a/version/derive/tests/ui_pass/declare_versioned_json.rs b/libs/iroha_version/derive/tests/ui_pass/declare_versioned_json.rs similarity index 100% rename from version/derive/tests/ui_pass/declare_versioned_json.rs rename to libs/iroha_version/derive/tests/ui_pass/declare_versioned_json.rs diff --git a/version/derive/tests/ui_pass/declare_versioned_scale.rs b/libs/iroha_version/derive/tests/ui_pass/declare_versioned_scale.rs similarity index 100% rename from version/derive/tests/ui_pass/declare_versioned_scale.rs rename to libs/iroha_version/derive/tests/ui_pass/declare_versioned_scale.rs diff --git a/version/src/lib.rs b/libs/iroha_version/src/lib.rs similarity index 100% rename from version/src/lib.rs rename to libs/iroha_version/src/lib.rs diff --git a/wasm_builder/Cargo.toml b/libs/iroha_wasm_builder/Cargo.toml similarity index 82% rename from wasm_builder/Cargo.toml rename to libs/iroha_wasm_builder/Cargo.toml index 90d70c615a5..686aea8a522 100644 --- a/wasm_builder/Cargo.toml +++ b/libs/iroha_wasm_builder/Cargo.toml @@ -12,8 +12,8 @@ categories = ["development-tools::build-utils"] workspace = true [dependencies] -eyre = { workspace = true } +eyre.workspace = true serde_json = { workspace = true, features = ["std"] } sha256 = "1.5.0" -path-absolutize = { workspace = true } +path-absolutize.workspace = true wasm-opt = "0.116.1" diff --git a/wasm_builder/src/lib.rs b/libs/iroha_wasm_builder/src/lib.rs similarity index 100% rename from wasm_builder/src/lib.rs rename to libs/iroha_wasm_builder/src/lib.rs diff --git a/wasm_codec/Cargo.toml b/libs/iroha_wasm_codec/Cargo.toml similarity index 81% rename from wasm_codec/Cargo.toml rename to libs/iroha_wasm_codec/Cargo.toml index 3757265e021..edfa960da62 100644 --- a/wasm_codec/Cargo.toml +++ b/libs/iroha_wasm_codec/Cargo.toml @@ -12,6 +12,6 @@ workspace = true [dependencies] iroha_core_wasm_codec_derive = { path = "derive" } -thiserror = { workspace = true } -wasmtime = { workspace = true } +thiserror.workspace = true +wasmtime.workspace = true parity-scale-codec = { workspace = true, features = ["derive"] } diff --git a/wasm_codec/derive/Cargo.toml b/libs/iroha_wasm_codec/derive/Cargo.toml similarity index 52% rename from wasm_codec/derive/Cargo.toml rename to libs/iroha_wasm_codec/derive/Cargo.toml index 13c66ba9e6c..36b2f57f1b4 100644 --- a/wasm_codec/derive/Cargo.toml +++ b/libs/iroha_wasm_codec/derive/Cargo.toml @@ -13,9 +13,9 @@ workspace = true proc-macro = true [dependencies] -syn = { workspace = true } -quote = { workspace = true } -proc-macro2 = { workspace = true } -once_cell = { workspace = true } -manyhow = { workspace = true } -iroha_macro_utils = { workspace = true } +syn.workspace = true +quote.workspace = true +proc-macro2.workspace = true +once_cell.workspace = true +manyhow.workspace = true +iroha_macro_utils.workspace = true diff --git a/wasm_codec/derive/src/lib.rs b/libs/iroha_wasm_codec/derive/src/lib.rs similarity index 100% rename from wasm_codec/derive/src/lib.rs rename to libs/iroha_wasm_codec/derive/src/lib.rs diff --git a/wasm_codec/src/lib.rs b/libs/iroha_wasm_codec/src/lib.rs similarity index 100% rename from wasm_codec/src/lib.rs rename to libs/iroha_wasm_codec/src/lib.rs diff --git a/client/tests/integration/smartcontracts/.cargo/config.toml b/samples/.cargo/config.toml similarity index 100% rename from client/tests/integration/smartcontracts/.cargo/config.toml rename to samples/.cargo/config.toml diff --git a/samples/Cargo.toml b/samples/Cargo.toml new file mode 100644 index 00000000000..395488d3173 --- /dev/null +++ b/samples/Cargo.toml @@ -0,0 +1,59 @@ +[workspace.package] +edition = "2021" +version = "2.0.0-pre-rc.21" +# TODO: teams are being deprecated update the authors URL +authors = ["Iroha 2 team "] + +license = "Apache-2.0" + +[workspace] +resolver = "2" +members = [ + "executors/default", + "executors/admin", + "executors/custom_permission", + "executors/custom_parameter", + "executors/remove_permission", + "executors/migration_fail", + "executors/custom_instructions_simple", + "executors/custom_instructions_complex", + "executors/custom_data_model", + "smart_contracts/query_assets_and_save_cursor", + "smart_contracts/query_and_filter_asset_definitions", + "triggers/create_nft_for_every_user", + "triggers/mint_rose_trigger", + "triggers/mint_rose_trigger_args", + "triggers/multisig_register", + "triggers/multisig", +] + +[profile.dev] +panic = "abort" + +[profile.release] +strip = "debuginfo" # Remove debugging info from the binary +panic = "abort" # Panics are transcribed to Traps when compiling for wasm anyway +lto = true # Link-time-optimization produces notable decrease in binary size +opt-level = "z" # Optimize for size vs speed with "s"/"z"(removes vectorization) +codegen-units = 1 # Further reduces binary size but increases compilation time + +[workspace.dependencies] +iroha_data_model = { version = "=2.0.0-pre-rc.21", path = "../libs/iroha_data_model", default-features = false } +iroha_schema = { version = "=2.0.0-pre-rc.21", path = "../libs/iroha_schema", default-features = false } + +iroha_smart_contract = { version = "=2.0.0-pre-rc.21", path = "../libs/iroha_smart_contract", features = ["debug"] } +iroha_trigger = { version = "=2.0.0-pre-rc.21", path = "../libs/iroha_trigger", features = ["debug"] } +iroha_executor = { version = "=2.0.0-pre-rc.21", path = "../libs/iroha_executor", features = ["debug"] } +iroha_executor_data_model = { version = "=2.0.0-pre-rc.21", path = "../libs/iroha_executor/data_model" } +iroha_executor_custom_data_model = { version = "=2.0.0-pre-rc.21", path = "executors/custom_data_model" } +iroha_wasm_builder = { version = "=2.0.0-pre-rc.21", path = "../libs/iroha_wasm_builder" } + +anyhow = { version = "1.0.86", default-features = false } +serde = { version = "1.0.204", default-features = false, features = ["derive"] } +serde_json = { version = "1.0.120", default-features = false } +getrandom = { version = "0.2.15", features = ["custom"] } +nonzero_ext = { version = "0.3.0", default-features = false } +parity-scale-codec = { version = "3.6.12", default-features = false } + +lol_alloc = "0.4.0" +panic-halt = "0.2.0" diff --git a/client/tests/integration/smartcontracts/LICENSE b/samples/LICENSE similarity index 100% rename from client/tests/integration/smartcontracts/LICENSE rename to samples/LICENSE diff --git a/samples/README.md b/samples/README.md new file mode 100644 index 00000000000..3bb6b1d71b5 --- /dev/null +++ b/samples/README.md @@ -0,0 +1,6 @@ +# Sample executors, smart contracts and triggers + +This folder contains sample executors, smart contracts and triggers, +as well as the [default executor](executors/default). + +You can use [this script](../scripts/generate_wasm.sh) to compile them to WASM. \ No newline at end of file diff --git a/client/tests/integration/smartcontracts/executor_with_admin/Cargo.toml b/samples/executors/admin/Cargo.toml similarity index 89% rename from client/tests/integration/smartcontracts/executor_with_admin/Cargo.toml rename to samples/executors/admin/Cargo.toml index 440bb0ac557..080abd2b17d 100644 --- a/client/tests/integration/smartcontracts/executor_with_admin/Cargo.toml +++ b/samples/executors/admin/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "executor_with_admin" +name = "iroha_executor_with_admin" edition.workspace = true version.workspace = true diff --git a/client/tests/integration/smartcontracts/executor_with_admin/src/lib.rs b/samples/executors/admin/src/lib.rs similarity index 100% rename from client/tests/integration/smartcontracts/executor_with_admin/src/lib.rs rename to samples/executors/admin/src/lib.rs diff --git a/client/tests/integration/smartcontracts/executor_custom_data_model/Cargo.toml b/samples/executors/custom_data_model/Cargo.toml similarity index 87% rename from client/tests/integration/smartcontracts/executor_custom_data_model/Cargo.toml rename to samples/executors/custom_data_model/Cargo.toml index 503cf90782f..d124658eaf1 100644 --- a/client/tests/integration/smartcontracts/executor_custom_data_model/Cargo.toml +++ b/samples/executors/custom_data_model/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "executor_custom_data_model" +name = "iroha_executor_custom_data_model" edition.workspace = true version.workspace = true diff --git a/client/tests/integration/smartcontracts/executor_custom_data_model/src/complex_isi.rs b/samples/executors/custom_data_model/src/complex_isi.rs similarity index 99% rename from client/tests/integration/smartcontracts/executor_custom_data_model/src/complex_isi.rs rename to samples/executors/custom_data_model/src/complex_isi.rs index c025c27b022..02c97047fa8 100644 --- a/client/tests/integration/smartcontracts/executor_custom_data_model/src/complex_isi.rs +++ b/samples/executors/custom_data_model/src/complex_isi.rs @@ -1,6 +1,6 @@ //! Example of custom expression system. //! Only few expressions are implemented to show proof-of-concept. -//! See `smartcontracts/executor_custom_instructions_complex`. +//! See `executors/custom_instructions_complex`. //! This is simplified version of expression system from Iroha v2.0.0-pre-rc.20 pub use evaluate::*; diff --git a/client/tests/integration/smartcontracts/executor_custom_data_model/src/lib.rs b/samples/executors/custom_data_model/src/lib.rs similarity index 100% rename from client/tests/integration/smartcontracts/executor_custom_data_model/src/lib.rs rename to samples/executors/custom_data_model/src/lib.rs diff --git a/client/tests/integration/smartcontracts/executor_custom_data_model/src/mint_rose_args.rs b/samples/executors/custom_data_model/src/mint_rose_args.rs similarity index 100% rename from client/tests/integration/smartcontracts/executor_custom_data_model/src/mint_rose_args.rs rename to samples/executors/custom_data_model/src/mint_rose_args.rs diff --git a/client/tests/integration/smartcontracts/executor_custom_data_model/src/multisig.rs b/samples/executors/custom_data_model/src/multisig.rs similarity index 100% rename from client/tests/integration/smartcontracts/executor_custom_data_model/src/multisig.rs rename to samples/executors/custom_data_model/src/multisig.rs diff --git a/client/tests/integration/smartcontracts/executor_custom_data_model/src/parameters.rs b/samples/executors/custom_data_model/src/parameters.rs similarity index 100% rename from client/tests/integration/smartcontracts/executor_custom_data_model/src/parameters.rs rename to samples/executors/custom_data_model/src/parameters.rs diff --git a/client/tests/integration/smartcontracts/executor_custom_data_model/src/permissions.rs b/samples/executors/custom_data_model/src/permissions.rs similarity index 100% rename from client/tests/integration/smartcontracts/executor_custom_data_model/src/permissions.rs rename to samples/executors/custom_data_model/src/permissions.rs diff --git a/client/tests/integration/smartcontracts/executor_custom_data_model/src/simple_isi.rs b/samples/executors/custom_data_model/src/simple_isi.rs similarity index 96% rename from client/tests/integration/smartcontracts/executor_custom_data_model/src/simple_isi.rs rename to samples/executors/custom_data_model/src/simple_isi.rs index e82e5b0a97f..5b2eae94c28 100644 --- a/client/tests/integration/smartcontracts/executor_custom_data_model/src/simple_isi.rs +++ b/samples/executors/custom_data_model/src/simple_isi.rs @@ -1,5 +1,5 @@ //! Example of one custom instruction. -//! See `smartcontracts/executor_custom_instructions_simple`. +//! See `executors/custom_instructions_simple`. use alloc::{format, string::String, vec::Vec}; diff --git a/client/tests/integration/smartcontracts/executor_custom_instructions_complex/Cargo.toml b/samples/executors/custom_instructions_complex/Cargo.toml similarity index 77% rename from client/tests/integration/smartcontracts/executor_custom_instructions_complex/Cargo.toml rename to samples/executors/custom_instructions_complex/Cargo.toml index 08d487860ee..11c915106fd 100644 --- a/client/tests/integration/smartcontracts/executor_custom_instructions_complex/Cargo.toml +++ b/samples/executors/custom_instructions_complex/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "executor_custom_instructions_complex" +name = "iroha_executor_custom_instructions_complex" edition.workspace = true version.workspace = true @@ -13,7 +13,7 @@ crate-type = ['cdylib'] [dependencies] iroha_executor.workspace = true iroha_schema.workspace = true -executor_custom_data_model.workspace = true +iroha_executor_custom_data_model.workspace = true serde_json.workspace = true serde.workspace = true diff --git a/client/tests/integration/smartcontracts/executor_custom_instructions_complex/src/lib.rs b/samples/executors/custom_instructions_complex/src/lib.rs similarity index 95% rename from client/tests/integration/smartcontracts/executor_custom_instructions_complex/src/lib.rs rename to samples/executors/custom_instructions_complex/src/lib.rs index a5243ec66cc..cdeec6f5b9a 100644 --- a/client/tests/integration/smartcontracts/executor_custom_instructions_complex/src/lib.rs +++ b/samples/executors/custom_instructions_complex/src/lib.rs @@ -10,13 +10,13 @@ extern crate alloc; #[cfg(not(test))] extern crate panic_halt; -use executor_custom_data_model::complex_isi::{ - ConditionalExpr, CoreExpr, CustomInstructionExpr, Evaluate, Value, -}; use iroha_executor::{ data_model::{isi::CustomInstruction, query::QueryOutputBox}, prelude::*, }; +use iroha_executor_custom_data_model::complex_isi::{ + ConditionalExpr, CoreExpr, CustomInstructionExpr, Evaluate, Value, +}; use lol_alloc::{FreeListAllocator, LockedAllocator}; #[global_allocator] @@ -66,7 +66,7 @@ fn execute_if(isi: ConditionalExpr) -> Result<(), ValidationFail> { struct Context; -impl executor_custom_data_model::complex_isi::Context for Context { +impl iroha_executor_custom_data_model::complex_isi::Context for Context { fn query(&self, query: &QueryBox) -> Result { // Note: supported only queries which return numeric result match query.execute()?.into_inner() { diff --git a/client/tests/integration/smartcontracts/executor_custom_instructions_simple/Cargo.toml b/samples/executors/custom_instructions_simple/Cargo.toml similarity index 77% rename from client/tests/integration/smartcontracts/executor_custom_instructions_simple/Cargo.toml rename to samples/executors/custom_instructions_simple/Cargo.toml index acae74a475c..2a708aa9379 100644 --- a/client/tests/integration/smartcontracts/executor_custom_instructions_simple/Cargo.toml +++ b/samples/executors/custom_instructions_simple/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "executor_custom_instructions_simple" +name = "iroha_executor_custom_instructions_simple" edition.workspace = true version.workspace = true @@ -13,7 +13,7 @@ crate-type = ['cdylib'] [dependencies] iroha_executor.workspace = true iroha_schema.workspace = true -executor_custom_data_model.workspace = true +iroha_executor_custom_data_model.workspace = true serde_json.workspace = true serde.workspace = true diff --git a/client/tests/integration/smartcontracts/executor_custom_instructions_simple/src/lib.rs b/samples/executors/custom_instructions_simple/src/lib.rs similarity index 95% rename from client/tests/integration/smartcontracts/executor_custom_instructions_simple/src/lib.rs rename to samples/executors/custom_instructions_simple/src/lib.rs index 2a8f5364abc..6966bebb8c6 100644 --- a/client/tests/integration/smartcontracts/executor_custom_instructions_simple/src/lib.rs +++ b/samples/executors/custom_instructions_simple/src/lib.rs @@ -8,8 +8,8 @@ extern crate alloc; #[cfg(not(test))] extern crate panic_halt; -use executor_custom_data_model::simple_isi::{CustomInstructionBox, MintAssetForAllAccounts}; use iroha_executor::{data_model::isi::CustomInstruction, debug::DebugExpectExt, prelude::*}; +use iroha_executor_custom_data_model::simple_isi::{CustomInstructionBox, MintAssetForAllAccounts}; use lol_alloc::{FreeListAllocator, LockedAllocator}; #[global_allocator] diff --git a/client/tests/integration/smartcontracts/executor_with_custom_permission/Cargo.toml b/samples/executors/custom_parameter/Cargo.toml similarity index 76% rename from client/tests/integration/smartcontracts/executor_with_custom_permission/Cargo.toml rename to samples/executors/custom_parameter/Cargo.toml index f4ce6650c77..385b4a20e43 100644 --- a/client/tests/integration/smartcontracts/executor_with_custom_permission/Cargo.toml +++ b/samples/executors/custom_parameter/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "executor_with_custom_permission" +name = "iroha_executor_with_custom_parameter" edition.workspace = true version.workspace = true @@ -12,11 +12,11 @@ crate-type = ['cdylib'] [dependencies] iroha_executor_data_model.workspace = true -executor_custom_data_model.workspace = true +iroha_executor_custom_data_model.workspace = true iroha_executor.workspace = true iroha_schema.workspace = true -parity-scale-codec.workspace = true +iroha_data_model.workspace = true anyhow.workspace = true serde_json.workspace = true serde.workspace = true diff --git a/client/tests/integration/smartcontracts/executor_with_custom_parameter/src/lib.rs b/samples/executors/custom_parameter/src/lib.rs similarity index 95% rename from client/tests/integration/smartcontracts/executor_with_custom_parameter/src/lib.rs rename to samples/executors/custom_parameter/src/lib.rs index 034747f5d9f..32b40315b3e 100644 --- a/client/tests/integration/smartcontracts/executor_with_custom_parameter/src/lib.rs +++ b/samples/executors/custom_parameter/src/lib.rs @@ -7,8 +7,8 @@ extern crate panic_halt; use alloc::format; -use executor_custom_data_model::parameters::DomainLimits; use iroha_executor::{prelude::*, DataModelBuilder}; +use iroha_executor_custom_data_model::parameters::DomainLimits; use iroha_executor_data_model::parameter::Parameter; use lol_alloc::{FreeListAllocator, LockedAllocator}; diff --git a/client/tests/integration/smartcontracts/executor_with_custom_parameter/Cargo.toml b/samples/executors/custom_permission/Cargo.toml similarity index 76% rename from client/tests/integration/smartcontracts/executor_with_custom_parameter/Cargo.toml rename to samples/executors/custom_permission/Cargo.toml index 376354bb16b..bf53d6f711c 100644 --- a/client/tests/integration/smartcontracts/executor_with_custom_parameter/Cargo.toml +++ b/samples/executors/custom_permission/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "executor_with_custom_parameter" +name = "iroha_executor_with_custom_permission" edition.workspace = true version.workspace = true @@ -12,11 +12,11 @@ crate-type = ['cdylib'] [dependencies] iroha_executor_data_model.workspace = true -executor_custom_data_model.workspace = true +iroha_executor_custom_data_model.workspace = true iroha_executor.workspace = true iroha_schema.workspace = true -parity-scale-codec.workspace = true +iroha_data_model.workspace = true anyhow.workspace = true serde_json.workspace = true serde.workspace = true diff --git a/client/tests/integration/smartcontracts/executor_with_custom_permission/src/lib.rs b/samples/executors/custom_permission/src/lib.rs similarity index 98% rename from client/tests/integration/smartcontracts/executor_with_custom_permission/src/lib.rs rename to samples/executors/custom_permission/src/lib.rs index 8f95b5f61d2..3deb6def243 100644 --- a/client/tests/integration/smartcontracts/executor_with_custom_permission/src/lib.rs +++ b/samples/executors/custom_permission/src/lib.rs @@ -16,10 +16,10 @@ extern crate alloc; #[cfg(not(test))] extern crate panic_halt; -use executor_custom_data_model::permissions::CanControlDomainLives; use iroha_executor::{ data_model::prelude::*, permission::ExecutorPermision as _, prelude::*, DataModelBuilder, }; +use iroha_executor_custom_data_model::permissions::CanControlDomainLives; use iroha_executor_data_model::permission::domain::CanUnregisterDomain; use lol_alloc::{FreeListAllocator, LockedAllocator}; diff --git a/samples/executors/default/Cargo.toml b/samples/executors/default/Cargo.toml new file mode 100644 index 00000000000..2effebd8723 --- /dev/null +++ b/samples/executors/default/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "iroha_default_executor" + +edition.workspace = true +version.workspace = true +authors.workspace = true + +license.workspace = true + +[lib] +crate-type = ['cdylib'] + +[dependencies] +iroha_executor.workspace = true +getrandom.workspace = true + +lol_alloc.workspace = true +panic-halt.workspace = true diff --git a/samples/executors/default/README.md b/samples/executors/default/README.md new file mode 100644 index 00000000000..ce9439dc248 --- /dev/null +++ b/samples/executors/default/README.md @@ -0,0 +1,8 @@ +# `iroha_default_executor` + +Use the [Wasm Builder CLI](../../../bins/iroha_wasm_builder_cli) in order to build it: + +```bash +cargo run --bin iroha_wasm_builder -- \ + build ./samples/executors/default --optimize --out-file ./configs/swarm/executor.wasm +``` diff --git a/default_executor/src/lib.rs b/samples/executors/default/src/lib.rs similarity index 100% rename from default_executor/src/lib.rs rename to samples/executors/default/src/lib.rs diff --git a/client/tests/integration/smartcontracts/executor_with_migration_fail/Cargo.toml b/samples/executors/migration_fail/Cargo.toml similarity index 87% rename from client/tests/integration/smartcontracts/executor_with_migration_fail/Cargo.toml rename to samples/executors/migration_fail/Cargo.toml index bee72c68c99..7db571dd8d5 100644 --- a/client/tests/integration/smartcontracts/executor_with_migration_fail/Cargo.toml +++ b/samples/executors/migration_fail/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "executor_with_migration_fail" +name = "iroha_executor_with_migration_fail" edition.workspace = true version.workspace = true diff --git a/client/tests/integration/smartcontracts/executor_with_migration_fail/src/lib.rs b/samples/executors/migration_fail/src/lib.rs similarity index 100% rename from client/tests/integration/smartcontracts/executor_with_migration_fail/src/lib.rs rename to samples/executors/migration_fail/src/lib.rs diff --git a/client/tests/integration/smartcontracts/executor_remove_permission/Cargo.toml b/samples/executors/remove_permission/Cargo.toml similarity index 84% rename from client/tests/integration/smartcontracts/executor_remove_permission/Cargo.toml rename to samples/executors/remove_permission/Cargo.toml index 31ca77b6631..ab93f0a1d85 100644 --- a/client/tests/integration/smartcontracts/executor_remove_permission/Cargo.toml +++ b/samples/executors/remove_permission/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "executor_remove_permission" +name = "iroha_executor_remove_permission" edition.workspace = true version.workspace = true @@ -15,7 +15,7 @@ iroha_executor_data_model.workspace = true iroha_executor.workspace = true iroha_schema.workspace = true -parity-scale-codec.workspace = true +iroha_data_model.workspace = true anyhow.workspace = true serde_json.workspace = true serde.workspace = true diff --git a/client/tests/integration/smartcontracts/executor_remove_permission/src/lib.rs b/samples/executors/remove_permission/src/lib.rs similarity index 100% rename from client/tests/integration/smartcontracts/executor_remove_permission/src/lib.rs rename to samples/executors/remove_permission/src/lib.rs diff --git a/client/tests/integration/smartcontracts/query_assets_and_save_cursor/Cargo.toml b/samples/smart_contracts/query_and_filter_asset_definitions/Cargo.toml similarity index 69% rename from client/tests/integration/smartcontracts/query_assets_and_save_cursor/Cargo.toml rename to samples/smart_contracts/query_and_filter_asset_definitions/Cargo.toml index 8c59c1ce8f1..3e7ca1f91d1 100644 --- a/client/tests/integration/smartcontracts/query_assets_and_save_cursor/Cargo.toml +++ b/samples/smart_contracts/query_and_filter_asset_definitions/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "query_assets_and_save_cursor" +name = "iroha_smart_contract_smart_contract_can_filter_queries" edition.workspace = true version.workspace = true @@ -16,6 +16,6 @@ iroha_smart_contract.workspace = true panic-halt.workspace = true lol_alloc.workspace = true getrandom.workspace = true -parity-scale-codec.workspace = true +iroha_data_model.workspace = true nonzero_ext.workspace = true -serde_json = { version = "1.0.108", default-features = false } +serde_json.workspace = true diff --git a/client/tests/integration/smartcontracts/smart_contract_can_filter_queries/src/lib.rs b/samples/smart_contracts/query_and_filter_asset_definitions/src/lib.rs similarity index 95% rename from client/tests/integration/smartcontracts/smart_contract_can_filter_queries/src/lib.rs rename to samples/smart_contracts/query_and_filter_asset_definitions/src/lib.rs index 0e45690ca93..09c7b3fd53b 100644 --- a/client/tests/integration/smartcontracts/smart_contract_can_filter_queries/src/lib.rs +++ b/samples/smart_contracts/query_and_filter_asset_definitions/src/lib.rs @@ -1,4 +1,4 @@ -//! Smart contract which executes [`FindAllAssets`] and saves cursor to the owner's metadata. +//! Smart contract which registers asset definitions and queries them with a filter. #![no_std] diff --git a/client/tests/integration/smartcontracts/smart_contract_can_filter_queries/Cargo.toml b/samples/smart_contracts/query_assets_and_save_cursor/Cargo.toml similarity index 66% rename from client/tests/integration/smartcontracts/smart_contract_can_filter_queries/Cargo.toml rename to samples/smart_contracts/query_assets_and_save_cursor/Cargo.toml index 8244730ed6d..9e75190c6f2 100644 --- a/client/tests/integration/smartcontracts/smart_contract_can_filter_queries/Cargo.toml +++ b/samples/smart_contracts/query_assets_and_save_cursor/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "smart_contract_can_filter_queries" +name = "iroha_smart_contract_query_assets_and_save_cursor" edition.workspace = true version.workspace = true @@ -16,6 +16,7 @@ iroha_smart_contract.workspace = true panic-halt.workspace = true lol_alloc.workspace = true getrandom.workspace = true -parity-scale-codec.workspace = true +iroha_data_model.workspace = true nonzero_ext.workspace = true -serde_json = { workspace = true, default-features = false } +serde_json.workspace = true +parity-scale-codec.workspace = true \ No newline at end of file diff --git a/client/tests/integration/smartcontracts/query_assets_and_save_cursor/src/lib.rs b/samples/smart_contracts/query_assets_and_save_cursor/src/lib.rs similarity index 100% rename from client/tests/integration/smartcontracts/query_assets_and_save_cursor/src/lib.rs rename to samples/smart_contracts/query_assets_and_save_cursor/src/lib.rs diff --git a/client/tests/integration/smartcontracts/create_nft_for_every_user_trigger/Cargo.toml b/samples/triggers/create_nft_for_every_user/Cargo.toml similarity index 82% rename from client/tests/integration/smartcontracts/create_nft_for_every_user_trigger/Cargo.toml rename to samples/triggers/create_nft_for_every_user/Cargo.toml index dcb0c06e985..abc2307dbeb 100644 --- a/client/tests/integration/smartcontracts/create_nft_for_every_user_trigger/Cargo.toml +++ b/samples/triggers/create_nft_for_every_user/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "create_nft_for_every_user_trigger" +name = "iroha_smart_contract_create_nft_for_every_user" edition.workspace = true version.workspace = true diff --git a/client/tests/integration/smartcontracts/create_nft_for_every_user_trigger/src/lib.rs b/samples/triggers/create_nft_for_every_user/src/lib.rs similarity index 100% rename from client/tests/integration/smartcontracts/create_nft_for_every_user_trigger/src/lib.rs rename to samples/triggers/create_nft_for_every_user/src/lib.rs diff --git a/client/tests/integration/smartcontracts/mint_rose_trigger/Cargo.toml b/samples/triggers/mint_rose_trigger/Cargo.toml similarity index 87% rename from client/tests/integration/smartcontracts/mint_rose_trigger/Cargo.toml rename to samples/triggers/mint_rose_trigger/Cargo.toml index 3c7447833a0..02d23348fc4 100644 --- a/client/tests/integration/smartcontracts/mint_rose_trigger/Cargo.toml +++ b/samples/triggers/mint_rose_trigger/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mint_rose" +name = "iroha_smart_contract_mint_rose" edition.workspace = true version.workspace = true diff --git a/client/tests/integration/smartcontracts/mint_rose_trigger/src/lib.rs b/samples/triggers/mint_rose_trigger/src/lib.rs similarity index 100% rename from client/tests/integration/smartcontracts/mint_rose_trigger/src/lib.rs rename to samples/triggers/mint_rose_trigger/src/lib.rs diff --git a/samples/triggers/mint_rose_trigger_args/Cargo.toml b/samples/triggers/mint_rose_trigger_args/Cargo.toml new file mode 100644 index 00000000000..cbe4f3c1150 --- /dev/null +++ b/samples/triggers/mint_rose_trigger_args/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "iroha_smart_contract_mint_rose_args" + +edition.workspace = true +version.workspace = true +authors.workspace = true + +license.workspace = true + +[lib] +crate-type = ['cdylib'] + +[dependencies] +iroha_trigger.workspace = true +iroha_executor_custom_data_model.workspace = true + +panic-halt.workspace = true +lol_alloc.workspace = true +getrandom.workspace = true + +serde.workspace = true +serde_json.workspace = true diff --git a/client/tests/integration/smartcontracts/mint_rose_trigger_args/src/lib.rs b/samples/triggers/mint_rose_trigger_args/src/lib.rs similarity index 94% rename from client/tests/integration/smartcontracts/mint_rose_trigger_args/src/lib.rs rename to samples/triggers/mint_rose_trigger_args/src/lib.rs index 41a35db8a6b..087ca851445 100644 --- a/client/tests/integration/smartcontracts/mint_rose_trigger_args/src/lib.rs +++ b/samples/triggers/mint_rose_trigger_args/src/lib.rs @@ -7,7 +7,7 @@ extern crate panic_halt; use core::str::FromStr as _; -use executor_custom_data_model::mint_rose_args::MintRoseArgs; +use iroha_executor_custom_data_model::mint_rose_args::MintRoseArgs; use iroha_trigger::{debug::dbg_panic, prelude::*}; use lol_alloc::{FreeListAllocator, LockedAllocator}; diff --git a/client/tests/integration/smartcontracts/mint_rose_trigger_args/Cargo.toml b/samples/triggers/multisig/Cargo.toml similarity index 58% rename from client/tests/integration/smartcontracts/mint_rose_trigger_args/Cargo.toml rename to samples/triggers/multisig/Cargo.toml index 19715ff3417..059c35deca3 100644 --- a/client/tests/integration/smartcontracts/mint_rose_trigger_args/Cargo.toml +++ b/samples/triggers/multisig/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mint_rose_args" +name = "iroha_smart_contract_multisig" edition.workspace = true version.workspace = true @@ -12,11 +12,14 @@ crate-type = ['cdylib'] [dependencies] iroha_trigger.workspace = true -executor_custom_data_model.workspace = true +iroha_executor_custom_data_model.workspace = true panic-halt.workspace = true lol_alloc.workspace = true getrandom.workspace = true -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true, default-features = false } +serde.workspace = true +serde_json.workspace = true + +[build-dependencies] +iroha_wasm_builder.workspace = true diff --git a/client/tests/integration/smartcontracts/multisig/src/lib.rs b/samples/triggers/multisig/src/lib.rs similarity index 98% rename from client/tests/integration/smartcontracts/multisig/src/lib.rs rename to samples/triggers/multisig/src/lib.rs index f26a9af2c5a..ba61c77087a 100644 --- a/client/tests/integration/smartcontracts/multisig/src/lib.rs +++ b/samples/triggers/multisig/src/lib.rs @@ -8,7 +8,7 @@ extern crate panic_halt; use alloc::{collections::btree_set::BTreeSet, format, vec::Vec}; -use executor_custom_data_model::multisig::MultisigArgs; +use iroha_executor_custom_data_model::multisig::MultisigArgs; use iroha_trigger::{debug::dbg_panic, prelude::*}; use lol_alloc::{FreeListAllocator, LockedAllocator}; diff --git a/samples/triggers/multisig_register/Cargo.toml b/samples/triggers/multisig_register/Cargo.toml new file mode 100644 index 00000000000..4598a723092 --- /dev/null +++ b/samples/triggers/multisig_register/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "iroha_smart_contract_multisig_register" + +edition.workspace = true +version.workspace = true +authors.workspace = true + +license.workspace = true + +[lib] +crate-type = ['cdylib'] + +[dependencies] +iroha_trigger.workspace = true +iroha_executor_data_model.workspace = true +iroha_executor_custom_data_model.workspace = true + +panic-halt.workspace = true +lol_alloc.workspace = true +getrandom.workspace = true + +serde.workspace = true +serde_json.workspace = true + +[build-dependencies] +iroha_wasm_builder.workspace = true diff --git a/client/tests/integration/smartcontracts/multisig_register/build.rs b/samples/triggers/multisig_register/build.rs similarity index 100% rename from client/tests/integration/smartcontracts/multisig_register/build.rs rename to samples/triggers/multisig_register/build.rs diff --git a/client/tests/integration/smartcontracts/multisig_register/src/lib.rs b/samples/triggers/multisig_register/src/lib.rs similarity index 97% rename from client/tests/integration/smartcontracts/multisig_register/src/lib.rs rename to samples/triggers/multisig_register/src/lib.rs index f3f2dfb6530..dd0961241b9 100644 --- a/client/tests/integration/smartcontracts/multisig_register/src/lib.rs +++ b/samples/triggers/multisig_register/src/lib.rs @@ -8,7 +8,7 @@ extern crate panic_halt; use alloc::format; -use executor_custom_data_model::multisig::MultisigRegisterArgs; +use iroha_executor_custom_data_model::multisig::MultisigRegisterArgs; use iroha_executor_data_model::permission::trigger::CanExecuteUserTrigger; use iroha_trigger::{debug::dbg_panic, prelude::*}; use lol_alloc::{FreeListAllocator, LockedAllocator}; diff --git a/scripts/generate_wasm.sh b/scripts/generate_wasm.sh index d91f9a3ca8a..e69a75fbbb4 100755 --- a/scripts/generate_wasm.sh +++ b/scripts/generate_wasm.sh @@ -1,28 +1,37 @@ #!/bin/sh -# Default source directory -DEFAULT_SOURCE_DIR="client/tests/integration/smartcontracts" - -# If no arguments are provided, use the default source directory -if [ "$#" -eq 0 ]; then - SOURCE_DIR="$DEFAULT_SOURCE_DIR" -else - SOURCE_DIR="$1" -fi - TARGET_DIR="test-smartcontracts" mkdir -p "$TARGET_DIR" -for folder in "$SOURCE_DIR"/*; do - if [ -d "$folder" ] && [ "$(basename "$folder")" != ".cargo" ]; then +generate() +{ + SOURCE_DIR="$1" + for folder in "$SOURCE_DIR"/*; do + if [ -d "$folder" ] && [ "$(basename "$folder")" != ".cargo" ]; then - folder_name=$(basename "$folder") - target_wasm_file_path="${TARGET_DIR}/${folder_name}.wasm" - # Build the smart contracts - cargo run --bin iroha_wasm_builder -- build "$folder" --optimize --out-file "$target_wasm_file_path" + folder_name=$(basename "$folder") + target_wasm_file_path="${TARGET_DIR}/${folder_name}.wasm" + # Build the smart contracts + cargo run --bin iroha_wasm_builder -- build "$folder" --optimize --out-file "$target_wasm_file_path" - fi -done + fi + done +} -echo "Smart contracts build complete." +# If no arguments are provided, use the sample directory +if [ "$#" -eq 0 ]; then + DEFAULT_EXECUTORS_DIR="samples/executors" + DEFAULT_SMART_CONTRACTS_DIR="samples/smart_contracts" + DEFAULT_TRIGGERS_DIR="samples/triggers" + + generate $DEFAULT_EXECUTORS_DIR + echo "Executors build complete." + generate $DEFAULT_SMART_CONTRACTS_DIR + echo "Smart contracts build complete." + generate $DEFAULT_TRIGGERS_DIR + echo "Triggers build complete." +else + generate "$1" + echo "Smart contracts build complete." +fi diff --git a/scripts/tests/consistency.sh b/scripts/tests/consistency.sh index 0331a16a7e1..37c5569c1b7 100755 --- a/scripts/tests/consistency.sh +++ b/scripts/tests/consistency.sh @@ -5,7 +5,7 @@ case $1 in "genesis") cargo run --release --bin kagami -- genesis generate --executor-path-in-genesis ./executor.wasm --genesis-public-key ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 | diff - configs/swarm/genesis.json || { echo 'Please re-generate the default genesis with `cargo run --release --bin kagami -- genesis --executor-path-in-genesis ./executor.wasm --genesis-public-key ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 > ./configs/swarm/genesis.json`' - echo 'The assumption here is that the authority of the default genesis transaction is `test_samples::SAMPLE_GENESIS_ACCOUNT_ID`' + echo 'The assumption here is that the authority of the default genesis transaction is `iroha_test_samples::SAMPLE_GENESIS_ACCOUNT_ID`' exit 1 };; "schema") diff --git a/smart_contract/LICENSE b/smart_contract/LICENSE deleted file mode 100644 index 857e425343c..00000000000 --- a/smart_contract/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Soramitsu LLC - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/tools/parity_scale_cli/Cargo.toml b/tools/parity_scale_cli/Cargo.toml deleted file mode 100644 index b076c9976eb..00000000000 --- a/tools/parity_scale_cli/Cargo.toml +++ /dev/null @@ -1,40 +0,0 @@ -[package] -name = "parity_scale_cli" - -edition.workspace = true -version.workspace = true -authors.workspace = true - -license.workspace = true - -[lints] -workspace = true - -[dependencies] -iroha_data_model = { workspace = true, features = ["http"] } -iroha_executor_data_model = { workspace = true } -iroha_primitives = { workspace = true } -iroha_schema = { workspace = true } -iroha_schema_gen = { workspace = true } -iroha_crypto = { workspace = true } -iroha_version = { workspace = true } -iroha_genesis = { workspace = true } - -clap = { workspace = true, features = ["derive", "cargo", "env", "string"] } -eyre = { workspace = true } -parity-scale-codec = { workspace = true } -colored = "2.1.0" -serde_json = { workspace = true, features = ["std"]} -serde = { workspace = true } -supports-color = { workspace = true } - -[build-dependencies] -iroha_data_model = { workspace = true } - -parity-scale-codec = { workspace = true } -serde_json = { workspace = true, features = ["std"]} -serde = { workspace = true } -eyre = { workspace = true } - -[dev-dependencies] -test_samples = { workspace = true }