diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6fffbb34d9b..332db91fbce 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -21,7 +21,8 @@ updates: - package-ecosystem: "pip" target-branch: "main" - directory: "/client_cli/pytests/" + directories: + - /pytests/* schedule: interval: "daily" commit-message: @@ -30,16 +31,9 @@ updates: - package-ecosystem: "cargo" target-branch: "main" - directory: "/" - schedule: - interval: "daily" - commit-message: - prefix: chore - include: scope - - - package-ecosystem: "cargo" - target-branch: "main" - directory: "/wasm_samples/" + directories: + - / + - /wasm_samples schedule: interval: "daily" commit-message: diff --git a/.github/labeler.yml b/.github/labeler.yml index e5b190e9e61..30d84951f20 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -4,8 +4,8 @@ api-changes: - changed-files: - any-glob-to-any-file: - 'docs/source/references/schema.json' - - 'torii/src/**' - - 'torii/const/src/**' + - 'crates/iroha_torii/src/**' + - 'crates/iroha_torii_const/src/**' config-changes: - all: diff --git a/.github/workflows/iroha2-dev-pr-static.yml b/.github/workflows/iroha2-dev-pr-static.yml index fe01695eab8..99df610996b 100644 --- a/.github/workflows/iroha2-dev-pr-static.yml +++ b/.github/workflows/iroha2-dev-pr-static.yml @@ -2,13 +2,13 @@ name: I2::Dev::Static on: pull_request: - branches: [main] + branches: [ main ] paths: - '**.rs' - '**.json' - '**.toml' - '.github/workflows/iroha2-dev-pr-static.yml' - - 'client_cli/pytests/**/*.py' + - 'pytests/**.py' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -62,39 +62,25 @@ jobs: runs-on: ubuntu-latest container: image: hyperledger/iroha2-ci:nightly-2024-09-09 + strategy: + matrix: + suite: [ iroha_cli_tests, iroha_torii_tests ] steps: - uses: actions/checkout@v4 - - name: Install dependencies using Poetry for client_cli/pytests - working-directory: client_cli/pytests + - name: Install dependencies using Poetry for pytests/${{ matrix.suite }} + working-directory: pytests/${{ matrix.suite }} run: | poetry lock --no-update poetry install - - name: Install dependencies using Poetry for torii/pytests - working-directory: torii/pytests - run: | - poetry lock --no-update - poetry install - - name: Check code formatting with Black in client_cli/pytests - working-directory: client_cli/pytests - run: | - poetry run black --check . - - name: Check code formatting with Black in torii/pytests - working-directory: torii/pytests + - name: Check code formatting with Black in pytests/${{ matrix.suite }} + working-directory: pytests/${{ matrix.suite }} run: | poetry run black --check . - - name: Run mypy (Type Checker) in client_cli/pytests - working-directory: client_cli/pytests + - name: Run mypy (Type Checker) in pytests/${{ matrix.suite }} + working-directory: pytests/${{ matrix.suite }} run: | poetry run mypy --explicit-package-bases --ignore-missing-imports . - - name: Run mypy (Type Checker) in torii/pytests - working-directory: torii/pytests - run: | - poetry run mypy --explicit-package-bases --ignore-missing-imports . - - name: Run flake8 (Linter) in client_cli/pytests - working-directory: client_cli/pytests - run: | - poetry run flake8 . --max-line-length=110 --ignore=F401,W503,E203 - - name: Run flake8 (Linter) in torii/pytests - working-directory: torii/pytests + - name: Run flake8 (Linter) in pytests/${{ matrix.suite }} + working-directory: pytests/${{ matrix.suite }} run: | poetry run flake8 . --max-line-length=110 --ignore=F401,W503,E203 diff --git a/.github/workflows/iroha2-dev-pr-wasm.yaml b/.github/workflows/iroha2-dev-pr-wasm.yaml index f977092f3d4..eadeee1597f 100644 --- a/.github/workflows/iroha2-dev-pr-wasm.yaml +++ b/.github/workflows/iroha2-dev-pr-wasm.yaml @@ -4,15 +4,25 @@ on: pull_request: branches: [main] paths: - - 'data_model/**.rs' - - 'data_model/**.yml' - - 'data_model/**.json' - - 'data_model/**.toml' + - 'crates/iroha_data_model/**.rs' + - 'crates/iroha_data_model/**.yml' + - 'crates/iroha_data_model/**.json' + - 'crates/iroha_data_model/**.toml' - - 'smart_contract/**.rs' - - 'smart_contract/**.yml' - - 'smart_contract/**.json' - - 'smart_contract/**.toml' + - 'crates/iroha_smart_contract/**.rs' + - 'crates/iroha_smart_contract/**.yml' + - 'crates/iroha_smart_contract/**.json' + - 'crates/iroha_smart_contract/**.toml' + + - 'crates/iroha_executor/**.rs' + - 'crates/iroha_executor/**.yml' + - 'crates/iroha_executor/**.json' + - 'crates/iroha_executor/**.toml' + + - 'crates/iroha_trigger/**.rs' + - 'crates/iroha_trigger/**.yml' + - 'crates/iroha_trigger/**.json' + - 'crates/iroha_trigger/**.toml' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -54,7 +64,7 @@ jobs: name: executor.wasm path: ${{ env.DOCKER_COMPOSE_PATH }} - name: Install iroha_wasm_test_runner - run: cargo install --path tools/wasm_test_runner + run: cargo install --path crates/iroha_wasm_test_runner - name: Run smart contract tests on WebAssembly VM - working-directory: smart_contract + working-directory: crates/iroha_smart_contract run: mold --run cargo test -p iroha_smart_contract -p iroha_smart_contract_utils --release --tests --target wasm32-unknown-unknown --no-fail-fast --quiet diff --git a/.github/workflows/iroha2-dev-pr.yml b/.github/workflows/iroha2-dev-pr.yml index 58cf964a962..2a8d18bf7a9 100644 --- a/.github/workflows/iroha2-dev-pr.yml +++ b/.github/workflows/iroha2-dev-pr.yml @@ -17,7 +17,7 @@ concurrency: env: CARGO_TERM_COLOR: always - CLIENT_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test" + IROHA_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test" DOCKER_COMPOSE_PATH: defaults TEST_DIR: "tmp/test" IROHA_BIN: "iroha" @@ -60,7 +60,7 @@ jobs: path: ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm retention-days: 1 - # exclude: client/tests/integration/ + # exclude: iroha/tests/integration/ with_coverage: runs-on: [self-hosted, Linux, iroha2] needs: build_executor @@ -83,7 +83,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 "crates/iroha_cli" --ignore "**/main.rs" -o lcov.info - name: Upload lcov report artifact if: always() uses: actions/upload-artifact@v4 @@ -91,8 +91,8 @@ jobs: name: lcov.info path: lcov.info - # include: client/tests/integration/ - # exclude: client/tests/integration/extra_functional + # include: iroha/tests/integration/ + # exclude: iroha/tests/integration/extra_functional integration: runs-on: [self-hosted, Linux, iroha2] needs: build_executor @@ -110,7 +110,7 @@ jobs: - name: Run tests, with no-default-features run: mold --run cargo test --no-default-features --no-fail-fast -p iroha integration -- --skip extra_functional - # include: client/tests/integration/extra_functional + # include: iroha/tests/integration/extra_functional extra_functional: runs-on: [self-hosted, Linux, iroha2] needs: build_executor @@ -230,18 +230,21 @@ jobs: docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.local.yml down - name: Run docker-compose.yml containers run: docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.yml up --wait || exit 1 + - name: Install Python and Poetry run: | yum install -y python${{ env.PYTHON_VERSION }} python${{ env.PYTHON_VERSION }}-devel curl -sSL https://install.python-poetry.org | python3 - echo 'export PATH="${{ env.POETRY_PATH }}:$PATH"' >> /etc/profile source /etc/profile + - name: Install Torii API Dependencies - working-directory: torii/pytests + working-directory: pytests/iroha_torii_tests run: ${{ env.POETRY_PATH }} install - name: Run Torii API Tests - working-directory: torii/pytests + working-directory: pytests/iroha_torii_tests run: ${{ env.POETRY_PATH }} run pytest + - name: Copy Client CLI Binary from Iroha Container if: always() run: | @@ -251,14 +254,15 @@ jobs: - name: Make Binaries Executable run: chmod +x ${{ env.TEST_DIR }}/${{ env.IROHA_BIN }} - name: Install Client CLI Dependencies - working-directory: client_cli/pytests + working-directory: pytests/iroha_cli_tests run: ${{ env.POETRY_PATH }} install - name: Run Client CLI Tests - working-directory: client_cli/pytests + working-directory: pytests/iroha_cli_tests env: - CLIENT_CLI_BINARY: ../../${{ env.TEST_DIR }}/${{ env.IROHA_BIN }} - CLIENT_CLI_CONFIG: ../../${{ env.TEST_DIR }}/client.toml + IROHA_CLI_BINARY: ../../${{ env.TEST_DIR }}/${{ env.IROHA_BIN }} + IROHA_CLI_CONFIG: ../../${{ env.TEST_DIR }}/client.toml run: ${{ env.POETRY_PATH }} run pytest + - name: Wipe docker-compose.yml containers if: always() run: docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.yml down diff --git a/.github/workflows/iroha2-pr-ui.yml b/.github/workflows/iroha2-pr-ui.yml index 1da9f8638ee..b107361f161 100644 --- a/.github/workflows/iroha2-pr-ui.yml +++ b/.github/workflows/iroha2-pr-ui.yml @@ -4,7 +4,8 @@ on: pull_request: branches: [main, stable, lts] paths: - - '**/derive/**.rs' + - 'crates/*_derive/**.rs' + - 'crates/*_macro*/**.rs' - '**/tests/ui.rs' - '**/tests/ui_*/**' - 'rust-toolchain.toml' diff --git a/.gitignore b/.gitignore index 8f43e18e0ca..4fc48324b89 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ **/rusty-tags.vi /**/Cargo.lock -config/__pycaсhe__ +crates/iroha_config/__pycaсhe__ **/__pycache__/* __pycache__/* build/* @@ -32,7 +32,7 @@ CMakeFiles/* cmake-build-debu/* cmake-build-debug/* external/* -core/infra/protobuf +crates/iroha_core/infra/protobuf include/generated/* .obsidian/ .scannerwork/ @@ -50,5 +50,5 @@ result /iroha-java/ /lcov.info **/test-smartcontracts/ - +test_docker **/*.wasm diff --git a/Cargo.lock b/Cargo.lock index 8fd8c318947..a3b2578a5cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2902,6 +2902,8 @@ dependencies = [ "iroha_logger", "iroha_primitives", "iroha_telemetry", + "iroha_test_network", + "iroha_test_samples", "iroha_torii_const", "iroha_version", "iroha_wasm_builder", @@ -2913,8 +2915,6 @@ dependencies = [ "serde_json", "serde_with", "tempfile", - "test_network", - "test_samples", "thiserror", "tokio", "tokio-tungstenite", @@ -2927,7 +2927,7 @@ dependencies = [ ] [[package]] -name = "iroha_client_cli" +name = "iroha_cli" version = "2.0.0-rc.1.0" dependencies = [ "clap", @@ -2946,6 +2946,28 @@ dependencies = [ "vergen", ] +[[package]] +name = "iroha_codec" +version = "2.0.0-rc.1.0" +dependencies = [ + "clap", + "colored", + "eyre", + "iroha_crypto", + "iroha_data_model", + "iroha_executor_data_model", + "iroha_genesis", + "iroha_primitives", + "iroha_schema", + "iroha_schema_gen", + "iroha_test_samples", + "iroha_version", + "parity-scale-codec", + "serde", + "serde_json", + "supports-color 2.1.0", +] + [[package]] name = "iroha_config" version = "2.0.0-rc.1.0" @@ -3036,6 +3058,7 @@ dependencies = [ "iroha_p2p", "iroha_primitives", "iroha_telemetry", + "iroha_test_samples", "iroha_version", "iroha_wasm_codec", "mv", @@ -3046,24 +3069,12 @@ dependencies = [ "serde", "serde_json", "tempfile", - "test_samples", "thiserror", "tokio", "uuid", "wasmtime", ] -[[package]] -name = "iroha_core_wasm_codec_derive" -version = "2.0.0-rc.1.0" -dependencies = [ - "iroha_macro_utils", - "manyhow", - "proc-macro2", - "quote", - "syn 2.0.75", -] - [[package]] name = "iroha_crypto" version = "2.0.0-rc.1.0" @@ -3277,13 +3288,33 @@ dependencies = [ "iroha_crypto", "iroha_data_model", "iroha_schema", + "iroha_test_samples", "parity-scale-codec", "serde", "serde_json", - "test_samples", "tracing", ] +[[package]] +name = "iroha_kagami" +version = "2.0.0-rc.1.0" +dependencies = [ + "clap", + "color-eyre", + "derive_more", + "iroha_config", + "iroha_crypto", + "iroha_data_model", + "iroha_executor_data_model", + "iroha_genesis", + "iroha_primitives", + "iroha_schema_gen", + "iroha_test_samples", + "parity-scale-codec", + "serde", + "serde_json", +] + [[package]] name = "iroha_logger" version = "2.0.0-rc.1.0" @@ -3354,9 +3385,9 @@ dependencies = [ "iroha_futures", "iroha_logger", "iroha_primitives", + "iroha_test_network", "parity-scale-codec", "rand", - "test_network", "thiserror", "tokio", ] @@ -3442,8 +3473,8 @@ dependencies = [ "iroha_macro", "iroha_smart_contract_derive", "iroha_smart_contract_utils", + "iroha_test_samples", "parity-scale-codec", - "test_samples", "trybuild", "webassembly-test", ] @@ -3531,6 +3562,43 @@ dependencies = [ "trybuild", ] +[[package]] +name = "iroha_test_network" +version = "2.0.0-rc.1.0" +dependencies = [ + "eyre", + "futures", + "iroha", + "iroha_config", + "iroha_core", + "iroha_crypto", + "iroha_data_model", + "iroha_executor_data_model", + "iroha_futures", + "iroha_genesis", + "iroha_logger", + "iroha_primitives", + "iroha_test_samples", + "iroha_wasm_builder", + "irohad", + "parity-scale-codec", + "rand", + "serde_json", + "tempfile", + "tokio", + "unique_port", +] + +[[package]] +name = "iroha_test_samples" +version = "2.0.0-rc.1.0" +dependencies = [ + "iroha_crypto", + "iroha_data_model", + "serde", + "toml", +] + [[package]] name = "iroha_torii" version = "2.0.0-rc.1.0" @@ -3628,32 +3696,36 @@ dependencies = [ name = "iroha_wasm_builder" version = "2.0.0-rc.1.0" dependencies = [ + "clap", + "color-eyre", "eyre", + "owo-colors", "path-absolutize", "serde_json", "sha256", + "spinoff", "wasm-opt", ] [[package]] -name = "iroha_wasm_builder_cli" +name = "iroha_wasm_codec" version = "2.0.0-rc.1.0" dependencies = [ - "clap", - "color-eyre", - "iroha_wasm_builder", - "owo-colors", - "spinoff", + "iroha_wasm_codec_derive", + "parity-scale-codec", + "thiserror", + "wasmtime", ] [[package]] -name = "iroha_wasm_codec" +name = "iroha_wasm_codec_derive" version = "2.0.0-rc.1.0" dependencies = [ - "iroha_core_wasm_codec_derive", - "parity-scale-codec", - "thiserror", - "wasmtime", + "iroha_macro_utils", + "manyhow", + "proc-macro2", + "quote", + "syn 2.0.75", ] [[package]] @@ -3807,26 +3879,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "kagami" -version = "2.0.0-rc.1.0" -dependencies = [ - "clap", - "color-eyre", - "derive_more", - "iroha_config", - "iroha_crypto", - "iroha_data_model", - "iroha_executor_data_model", - "iroha_genesis", - "iroha_primitives", - "iroha_schema_gen", - "parity-scale-codec", - "serde", - "serde_json", - "test_samples", -] - [[package]] name = "keccak" version = "0.1.5" @@ -4376,28 +4428,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "parity_scale_cli" -version = "2.0.0-rc.1.0" -dependencies = [ - "clap", - "colored", - "eyre", - "iroha_crypto", - "iroha_data_model", - "iroha_executor_data_model", - "iroha_genesis", - "iroha_primitives", - "iroha_schema", - "iroha_schema_gen", - "iroha_version", - "parity-scale-codec", - "serde", - "serde_json", - "supports-color 2.1.0", - "test_samples", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -5813,43 +5843,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "test_network" -version = "2.0.0-rc.1.0" -dependencies = [ - "eyre", - "futures", - "iroha", - "iroha_config", - "iroha_core", - "iroha_crypto", - "iroha_data_model", - "iroha_executor_data_model", - "iroha_futures", - "iroha_genesis", - "iroha_logger", - "iroha_primitives", - "iroha_wasm_builder", - "irohad", - "parity-scale-codec", - "rand", - "serde_json", - "tempfile", - "test_samples", - "tokio", - "unique_port", -] - -[[package]] -name = "test_samples" -version = "2.0.0-rc.1.0" -dependencies = [ - "iroha_crypto", - "iroha_data_model", - "serde", - "toml", -] - [[package]] name = "thiserror" version = "1.0.63" diff --git a/Cargo.toml b/Cargo.toml index 8690586bf51..f1e82af249e 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-rc.1.0 ", path = "core" } - -irohad = { version = "=2.0.0-rc.1.0", path = "cli" } -iroha_torii = { version = "=2.0.0-rc.1.0", path = "torii" } -iroha_torii_const = { version = "=2.0.0-rc.1.0", path = "torii/const" } - -iroha = { version = "=2.0.0-rc.1.0", path = "client" } - -iroha_macro_utils = { version = "=2.0.0-rc.1.0", path = "macro/utils" } -iroha_telemetry = { version = "=2.0.0-rc.1.0", path = "telemetry" } -iroha_p2p = { version = "=2.0.0-rc.1.0", path = "p2p" } -iroha_primitives = { version = "=2.0.0-rc.1.0", path = "primitives", default-features = false } -iroha_data_model = { version = "=2.0.0-rc.1.0", path = "data_model", default-features = false } -iroha_config = { version = "=2.0.0-rc.1.0", path = "config" } -iroha_config_base = { version = "=2.0.0-rc.1.0", path = "config/base" } -iroha_schema_gen = { version = "=2.0.0-rc.1.0", path = "schema/gen" } -iroha_schema = { version = "=2.0.0-rc.1.0", path = "schema", default-features = false } -iroha_logger = { version = "=2.0.0-rc.1.0", path = "logger" } -iroha_crypto = { version = "=2.0.0-rc.1.0", path = "crypto", default-features = false } -iroha_macro = { version = "=2.0.0-rc.1.0", path = "macro", default-features = false } -iroha_futures = { version = "=2.0.0-rc.1.0", path = "futures" } -iroha_genesis = { version = "=2.0.0-rc.1.0", path = "genesis" } -iroha_ffi = { version = "=2.0.0-rc.1.0", path = "ffi" } -iroha_version = { version = "=2.0.0-rc.1.0", path = "version", default-features = false } -iroha_wasm_codec = { version = "=2.0.0-rc.1.0", path = "wasm_codec" } -iroha_wasm_builder = { version = "=2.0.0-rc.1.0", path = "wasm_builder" } - -iroha_smart_contract = { version = "=2.0.0-rc.1.0", path = "smart_contract" } -iroha_smart_contract_utils = { version = "=2.0.0-rc.1.0", path = "smart_contract/utils" } - -iroha_executor = { version = "=2.0.0-rc.1.0", path = "smart_contract/executor" } -iroha_executor_data_model = { version = "=2.0.0-rc.1.0", path = "smart_contract/executor/data_model" } - -test_network = { version = "=2.0.0-rc.1.0", path = "core/test_network" } -test_samples = { version = "=2.0.0-rc.1.0", path = "test_samples" } +iroha_core = { version = "=2.0.0-rc.1.0 ", path = "crates/iroha_core" } + +irohad = { version = "=2.0.0-rc.1.0", path = "crates/irohad" } +iroha_torii = { version = "=2.0.0-rc.1.0", path = "crates/iroha_torii" } +iroha_torii_const = { version = "=2.0.0-rc.1.0", path = "crates/iroha_torii_const" } + +iroha = { version = "=2.0.0-rc.1.0", path = "crates/iroha" } + +iroha_macro_utils = { version = "=2.0.0-rc.1.0", path = "crates/iroha_macro_utils" } +iroha_telemetry = { version = "=2.0.0-rc.1.0", path = "crates/iroha_telemetry" } +iroha_p2p = { version = "=2.0.0-rc.1.0", path = "crates/iroha_p2p" } +iroha_primitives = { version = "=2.0.0-rc.1.0", path = "crates/iroha_primitives", default-features = false } +iroha_data_model = { version = "=2.0.0-rc.1.0", path = "crates/iroha_data_model", default-features = false } +iroha_config = { version = "=2.0.0-rc.1.0", path = "crates/iroha_config" } +iroha_config_base = { version = "=2.0.0-rc.1.0", path = "crates/iroha_config_base" } +iroha_schema_gen = { version = "=2.0.0-rc.1.0", path = "crates/iroha_schema_gen" } +iroha_schema = { version = "=2.0.0-rc.1.0", path = "crates/iroha_schema", default-features = false } +iroha_logger = { version = "=2.0.0-rc.1.0", path = "crates/iroha_logger" } +iroha_crypto = { version = "=2.0.0-rc.1.0", path = "crates/iroha_crypto", default-features = false } +iroha_macro = { version = "=2.0.0-rc.1.0", path = "crates/iroha_macro", default-features = false } +iroha_futures = { version = "=2.0.0-rc.1.0", path = "crates/iroha_futures" } +iroha_genesis = { version = "=2.0.0-rc.1.0", path = "crates/iroha_genesis" } +iroha_ffi = { version = "=2.0.0-rc.1.0", path = "crates/iroha_ffi" } +iroha_version = { version = "=2.0.0-rc.1.0", path = "crates/iroha_version", default-features = false } +iroha_wasm_codec = { version = "=2.0.0-rc.1.0", path = "crates/iroha_wasm_codec" } +iroha_wasm_builder = { version = "=2.0.0-rc.1.0", path = "crates/iroha_wasm_builder" } + +iroha_smart_contract = { version = "=2.0.0-rc.1.0", path = "crates/iroha_smart_contract" } +iroha_smart_contract_utils = { version = "=2.0.0-rc.1.0", path = "crates/iroha_smart_contract_utils" } + +iroha_executor = { version = "=2.0.0-rc.1.0", path = "crates/iroha_executor" } +iroha_executor_data_model = { version = "=2.0.0-rc.1.0", path = "crates/iroha_executor_data_model" } + +iroha_test_network = { version = "=2.0.0-rc.1.0", path = "crates/iroha_test_network" } +iroha_test_samples = { version = "=2.0.0-rc.1.0", path = "crates/iroha_test_samples" } proc-macro2 = "1.0.86" syn = { version = "2.0.72", default-features = false } @@ -194,65 +194,7 @@ 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", + "crates/*" ] exclude = [ "wasm_samples", diff --git a/Dockerfile b/Dockerfile index 62291d32590..2c7f15773ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,9 +36,9 @@ ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=/x86_64-linux-musl-native/bin/ WORKDIR /iroha COPY . . RUN cargo build \ - -p irohad \ - -p iroha_client_cli \ - -p kagami \ + --bin irohad \ + --bin iroha \ + --bin kagami \ --target x86_64-unknown-linux-musl \ --profile deploy diff --git a/README.md b/README.md index 3ae649008ac..02fea5edf46 100644 --- a/README.md +++ b/README.md @@ -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](crates/iroha_cli/README.md): ```bash cargo run --bin iroha -- --config ./defaults/client.toml @@ -131,21 +131,21 @@ cargo run --bin iroha -- --config ./defaults/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`](crates/iroha) provides a library for building clients that communicate with peers. +* [`irohad`](crates/irohad) is the command-line application for deploying an Iroha peer. Contains the routing table and definitions of API endpoints. +* [`iroha_cli`](crates/iroha_cli) is the command-line client, a reference application using the client SDK. +* [`iroha_core`](crates/iroha_core) is the primary library used by all other crates, including the peer endpoint management. +* [`iroha_config`](crates/iroha_config) handles configuration and documentation generation for options and run-time changes. +* [`iroha_crypto`](crates/iroha_crypto) defines cryptographic aspects of Iroha. +* [`kagami`](crates/iroha_kagami) is used to generate cryptographic keys, default genesis, configuration reference, and schema. +* [`iroha_data_model`](crates/iroha_data_model) defines common data models in Iroha. +* [`iroha_futures`](crates/iroha_futures) is used for `async` programming. +* [`iroha_logger`](crates/iroha_logger) uses `tracing` to provide logging facilities. +* [`iroha_macro`](crates/iroha_macro) provides the convenience macros. +* [`iroha_p2p`](crates/iroha_p2p) defines peer creation and handshake logic. * [`iroha_default_executor`](wasm_samples/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_telemetry`](crates/iroha_telemetry) is used for monitoring and analysis of telemetry data. +* [`iroha_version`](crates/iroha_version) provides message versioning for non-simultaneous system updates. ## Maintenance diff --git a/client_cli/pytests/src/client_cli/__init__.py b/client_cli/pytests/src/client_cli/__init__.py deleted file mode 100644 index dd9bea09b2a..00000000000 --- a/client_cli/pytests/src/client_cli/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -""" -This module initializes the Iroha client and configuration using environment variables. -""" - -from common.settings import PATH_CONFIG_CLIENT_CLI, PORT_MAX, PORT_MIN -from src.client_cli.client_cli import ClientCli -from src.client_cli.configuration import Config -from src.client_cli.iroha import Iroha - -config = Config(PORT_MIN, PORT_MAX) -config.load(PATH_CONFIG_CLIENT_CLI) -client_cli = ClientCli(config) -iroha = Iroha(config) diff --git a/client/Cargo.toml b/crates/iroha/Cargo.toml similarity index 95% rename from client/Cargo.toml rename to crates/iroha/Cargo.toml index b83a5306ddd..c3d8adcc10b 100644 --- a/client/Cargo.toml +++ b/crates/iroha/Cargo.toml @@ -59,7 +59,7 @@ iroha_logger = { workspace = true } iroha_telemetry = { workspace = true } iroha_torii_const = { workspace = true } iroha_version = { workspace = true } -test_samples = { workspace = true } +iroha_test_samples = { workspace = true } attohttpc = { version = "0.28.0", default-features = false } eyre = { workspace = true } @@ -84,14 +84,14 @@ 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 +# Additionally there is a dependency on iroha_core in dev-dependencies in iroha_telemetry/derive # Hopefully, once the integration tests migration is finished these can be removed irohad = { workspace = true } iroha_wasm_builder = { workspace = true } iroha_genesis = { workspace = true } -test_network = { workspace = true } -executor_custom_data_model = { version = "=2.0.0-rc.1.0", path = "../wasm_samples/executor_custom_data_model" } +iroha_test_network = { workspace = true } +executor_custom_data_model = { version = "=2.0.0-rc.1.0", path = "../../wasm_samples/executor_custom_data_model" } tokio = { workspace = true, features = ["rt-multi-thread"] } criterion = { workspace = true, features = ["html_reports"] } diff --git a/client/README.md b/crates/iroha/README.md similarity index 79% rename from client/README.md rename to crates/iroha/README.md index 9faa164a258..12b58623472 100644 --- a/client/README.md +++ b/crates/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`](../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/crates/iroha/benches/torii.rs similarity index 89% rename from client/benches/torii.rs rename to crates/iroha/benches/torii.rs index b7e04595e2f..a9e5ded3523 100644 --- a/client/benches/torii.rs +++ b/crates/iroha/benches/torii.rs @@ -9,11 +9,11 @@ use iroha::{ }; use iroha_genesis::GenesisBuilder; use iroha_primitives::unique_vec; -use irohad::samples::get_config; -use test_network::{ +use iroha_test_network::{ construct_executor, get_chain_id, get_key_pair, Peer as TestPeer, PeerBuilder, TestRuntime, }; -use test_samples::gen_account_in; +use iroha_test_samples::gen_account_in; +use irohad::samples::get_config; use tokio::runtime::Runtime; const MINIMUM_SUCCESS_REQUEST_RATIO: f32 = 0.9; @@ -22,21 +22,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("../wasm_samples/default_executor") + let executor = construct_executor("../../wasm_samples/default_executor") .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(chain_id, executor, topology, &genesis_key_pair); @@ -65,7 +69,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(), ); @@ -121,15 +125,15 @@ 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("../wasm_samples/default_executor") + let executor = construct_executor("../../wasm_samples/default_executor") .expect("Failed to construct executor"); let genesis = GenesisBuilder::default() .domain("wonderland".parse().expect("Valid")) @@ -148,7 +152,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/crates/iroha/benches/tps/README.md similarity index 100% rename from client/benches/tps/README.md rename to crates/iroha/benches/tps/README.md diff --git a/client/benches/tps/config.json b/crates/iroha/benches/tps/config.json similarity index 100% rename from client/benches/tps/config.json rename to crates/iroha/benches/tps/config.json diff --git a/client/benches/tps/dev.rs b/crates/iroha/benches/tps/dev.rs similarity index 100% rename from client/benches/tps/dev.rs rename to crates/iroha/benches/tps/dev.rs diff --git a/client/benches/tps/oneshot.rs b/crates/iroha/benches/tps/oneshot.rs similarity index 100% rename from client/benches/tps/oneshot.rs rename to crates/iroha/benches/tps/oneshot.rs diff --git a/client/benches/tps/utils.rs b/crates/iroha/benches/tps/utils.rs similarity index 99% rename from client/benches/tps/utils.rs rename to crates/iroha/benches/tps/utils.rs index 1aed91b37ef..08a95111946 100644 --- a/client/benches/tps/utils.rs +++ b/crates/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/crates/iroha/examples/million_accounts_genesis.rs similarity index 89% rename from client/examples/million_accounts_genesis.rs rename to crates/iroha/examples/million_accounts_genesis.rs index 18fe51f3197..6fe2e5e5b63 100644 --- a/client/examples/million_accounts_genesis.rs +++ b/crates/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::get_config; -use test_network::{ +use iroha_test_network::{ construct_executor, get_chain_id, get_key_pair, wait_for_genesis_committed, Peer as TestPeer, PeerBuilder, TestRuntime, }; +use irohad::samples::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,7 @@ fn generate_genesis( .finish_domain(); } - let executor = construct_executor("../wasm_samples/default_executor") + let executor = construct_executor("../../wasm_samples/default_executor") .expect("Failed to construct executor"); builder.build_and_sign(chain_id, executor, topology, genesis_key_pair) } @@ -43,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/crates/iroha/examples/register_1000_triggers.rs similarity index 91% rename from client/examples/register_1000_triggers.rs rename to crates/iroha/examples/register_1000_triggers.rs index e4d7533c8b1..c54a9df41c8 100644 --- a/client/examples/register_1000_triggers.rs +++ b/crates/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::get_config; -use test_network::{ +use iroha_test_network::{ construct_executor, 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::get_config; use tokio::runtime::Runtime; fn generate_genesis( @@ -63,7 +63,7 @@ fn generate_genesis( }) .fold(builder, GenesisBuilder::append_instruction); - let executor = construct_executor("../wasm_samples/default_executor") + let executor = construct_executor("../../wasm_samples/default_executor") .expect("Failed to construct executor"); Ok(builder.build_and_sign(chain_id, executor, topology, genesis_key_pair)) } @@ -72,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/crates/iroha/examples/tutorial.rs similarity index 99% rename from client/examples/tutorial.rs rename to crates/iroha/examples/tutorial.rs index 0ea88e49751..28a882e0518 100644 --- a/client/examples/tutorial.rs +++ b/crates/iroha/examples/tutorial.rs @@ -9,7 +9,7 @@ use iroha_primitives::numeric::Numeric; fn main() { // #region rust_config_load - let config = Config::load("../defaults/client.toml").unwrap(); + let config = Config::load("../../defaults/client.toml").unwrap(); // #endregion rust_config_load // Your code goes here… diff --git a/client/src/client.rs b/crates/iroha/src/client.rs similarity index 99% rename from client/src/client.rs rename to crates/iroha/src/client.rs index 7e88470ace5..dfcf644b0d3 100644 --- a/client/src/client.rs +++ b/crates/iroha/src/client.rs @@ -1097,7 +1097,7 @@ pub mod executor { #[cfg(test)] mod tests { 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}; diff --git a/client/src/config.rs b/crates/iroha/src/config.rs similarity index 100% rename from client/src/config.rs rename to crates/iroha/src/config.rs diff --git a/client/src/config/user.rs b/crates/iroha/src/config/user.rs similarity index 100% rename from client/src/config/user.rs rename to crates/iroha/src/config/user.rs diff --git a/client/src/http.rs b/crates/iroha/src/http.rs similarity index 100% rename from client/src/http.rs rename to crates/iroha/src/http.rs diff --git a/client/src/http_default.rs b/crates/iroha/src/http_default.rs similarity index 100% rename from client/src/http_default.rs rename to crates/iroha/src/http_default.rs diff --git a/client/src/lib.rs b/crates/iroha/src/lib.rs similarity index 100% rename from client/src/lib.rs rename to crates/iroha/src/lib.rs diff --git a/client/src/query.rs b/crates/iroha/src/query.rs similarity index 100% rename from client/src/query.rs rename to crates/iroha/src/query.rs diff --git a/client/tests/integration/asset.rs b/crates/iroha/tests/integration/asset.rs similarity index 99% rename from client/tests/integration/asset.rs rename to crates/iroha/tests/integration/asset.rs index 764a1f73857..41c3216b51f 100644 --- a/client/tests/integration/asset.rs +++ b/crates/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/crates/iroha/tests/integration/asset_propagation.rs similarity index 96% rename from client/tests/integration/asset_propagation.rs rename to crates/iroha/tests/integration/asset_propagation.rs index 4f45922229b..33254264e6b 100644 --- a/client/tests/integration/asset_propagation.rs +++ b/crates/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/crates/iroha/tests/integration/events/data.rs similarity index 99% rename from client/tests/integration/events/data.rs rename to crates/iroha/tests/integration/events/data.rs index 4c9e32e6e2a..e42e119518a 100644 --- a/client/tests/integration/events/data.rs +++ b/crates/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/crates/iroha/tests/integration/events/mod.rs similarity index 100% rename from client/tests/integration/events/mod.rs rename to crates/iroha/tests/integration/events/mod.rs diff --git a/client/tests/integration/events/notification.rs b/crates/iroha/tests/integration/events/notification.rs similarity index 98% rename from client/tests/integration/events/notification.rs rename to crates/iroha/tests/integration/events/notification.rs index d5937aef20d..5bf381c1543 100644 --- a/client/tests/integration/events/notification.rs +++ b/crates/iroha/tests/integration/events/notification.rs @@ -2,8 +2,8 @@ use std::{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/crates/iroha/tests/integration/events/pipeline.rs similarity index 96% rename from client/tests/integration/events/pipeline.rs rename to crates/iroha/tests/integration/events/pipeline.rs index 475beb8418b..d8078b0d8b3 100644 --- a/client/tests/integration/events/pipeline.rs +++ b/crates/iroha/tests/integration/events/pipeline.rs @@ -16,8 +16,8 @@ use iroha::{ }, }; use iroha_config::parameters::actual::Root as Config; +use iroha_test_network::*; use nonzero_ext::nonzero; -use test_network::*; // Needed to re-enable ignored tests. const PEER_COUNT: usize = 7; @@ -32,7 +32,7 @@ fn transaction_with_no_instructions_should_be_committed() -> Result<()> { // #[ignore = "Experiment"] #[test] fn transaction_with_fail_instruction_should_be_rejected() -> Result<()> { - let unknown_domain_id = "dummy".parse::().unwrap(); + let unknown_domain_id = "dummy".parse::()?; let fail_isi = Unregister::domain(unknown_domain_id.clone()); test_with_instruction_and_status_and_port( @@ -52,7 +52,7 @@ fn test_with_instruction_and_status_and_port( port: u16, ) -> Result<()> { let (_rt, network, client) = - Network::start_test_with_runtime(PEER_COUNT.try_into().unwrap(), Some(port)); + Network::start_test_with_runtime(PEER_COUNT.try_into()?, Some(port)); let clients = network.clients(); wait_for_genesis_committed(&clients, 0); let pipeline_time = Config::pipeline_time(); diff --git a/client/tests/integration/extra_functional/connected_peers.rs b/crates/iroha/tests/integration/extra_functional/connected_peers.rs similarity index 99% rename from client/tests/integration/extra_functional/connected_peers.rs rename to crates/iroha/tests/integration/extra_functional/connected_peers.rs index 46882575a72..4bc748200d3 100644 --- a/client/tests/integration/extra_functional/connected_peers.rs +++ b/crates/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/crates/iroha/tests/integration/extra_functional/genesis.rs similarity index 92% rename from client/tests/integration/extra_functional/genesis.rs rename to crates/iroha/tests/integration/extra_functional/genesis.rs index eb2da99b843..3f1e7275b9b 100644 --- a/client/tests/integration/extra_functional/genesis.rs +++ b/crates/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/crates/iroha/tests/integration/extra_functional/mod.rs similarity index 100% rename from client/tests/integration/extra_functional/mod.rs rename to crates/iroha/tests/integration/extra_functional/mod.rs diff --git a/client/tests/integration/extra_functional/multiple_blocks_created.rs b/crates/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 crates/iroha/tests/integration/extra_functional/multiple_blocks_created.rs index c64b8d7d918..f66da0e4425 100644 --- a/client/tests/integration/extra_functional/multiple_blocks_created.rs +++ b/crates/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/crates/iroha/tests/integration/extra_functional/normal.rs similarity index 98% rename from client/tests/integration/extra_functional/normal.rs rename to crates/iroha/tests/integration/extra_functional/normal.rs index 126ce871d2d..4185cd2c6fd 100644 --- a/client/tests/integration/extra_functional/normal.rs +++ b/crates/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/crates/iroha/tests/integration/extra_functional/offline_peers.rs similarity index 97% rename from client/tests/integration/extra_functional/offline_peers.rs rename to crates/iroha/tests/integration/extra_functional/offline_peers.rs index e80e0490783..cecd19ee96d 100644 --- a/client/tests/integration/extra_functional/offline_peers.rs +++ b/crates/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/crates/iroha/tests/integration/extra_functional/restart_peer.rs similarity index 98% rename from client/tests/integration/extra_functional/restart_peer.rs rename to crates/iroha/tests/integration/extra_functional/restart_peer.rs index 94988c78702..4b51e7c2d8d 100644 --- a/client/tests/integration/extra_functional/restart_peer.rs +++ b/crates/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/crates/iroha/tests/integration/extra_functional/unregister_peer.rs similarity index 97% rename from client/tests/integration/extra_functional/unregister_peer.rs rename to crates/iroha/tests/integration/extra_functional/unregister_peer.rs index f24be88c0c0..d5e485c7d45 100644 --- a/client/tests/integration/extra_functional/unregister_peer.rs +++ b/crates/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"] @@ -104,7 +104,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/crates/iroha/tests/integration/extra_functional/unstable_network.rs similarity index 98% rename from client/tests/integration/extra_functional/unstable_network.rs rename to crates/iroha/tests/integration/extra_functional/unstable_network.rs index e5bf53308cd..31dc816084a 100644 --- a/client/tests/integration/extra_functional/unstable_network.rs +++ b/crates/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/crates/iroha/tests/integration/mod.rs similarity index 100% rename from client/tests/integration/mod.rs rename to crates/iroha/tests/integration/mod.rs diff --git a/client/tests/integration/multisig.rs b/crates/iroha/tests/integration/multisig.rs similarity index 96% rename from client/tests/integration/multisig.rs rename to crates/iroha/tests/integration/multisig.rs index b9de2a2124f..f1eba4fc63e 100644 --- a/client/tests/integration/multisig.rs +++ b/crates/iroha/tests/integration/multisig.rs @@ -12,9 +12,9 @@ use iroha::{ transaction::{TransactionBuilder, WasmSmartContract}, }, }; +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<()> { @@ -33,7 +33,7 @@ fn mutlisig() -> Result<()> { let account_id = ALICE_ID.clone(); let multisig_register_trigger_id = "multisig_register".parse::()?; - let wasm = iroha_wasm_builder::Builder::new("../wasm_samples/multisig_register") + let wasm = iroha_wasm_builder::Builder::new("../../wasm_samples/multisig_register") .show_output() .build()? .optimize()? diff --git a/client/tests/integration/non_mintable.rs b/crates/iroha/tests/integration/non_mintable.rs similarity index 98% rename from client/tests/integration/non_mintable.rs rename to crates/iroha/tests/integration/non_mintable.rs index e9c9d62dd9a..cd9954eefca 100644 --- a/client/tests/integration/non_mintable.rs +++ b/crates/iroha/tests/integration/non_mintable.rs @@ -3,8 +3,8 @@ use iroha::{ client, 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/crates/iroha/tests/integration/pagination.rs similarity index 99% rename from client/tests/integration/pagination.rs rename to crates/iroha/tests/integration/pagination.rs index db47e944622..97415ca55ed 100644 --- a/client/tests/integration/pagination.rs +++ b/crates/iroha/tests/integration/pagination.rs @@ -3,8 +3,8 @@ use iroha::{ client::{asset, Client}, data_model::{asset::AssetDefinition, prelude::*}, }; +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/crates/iroha/tests/integration/permissions.rs similarity index 99% rename from client/tests/integration/permissions.rs rename to crates/iroha/tests/integration/permissions.rs index f8fc9a5341d..66c79041a0b 100644 --- a/client/tests/integration/permissions.rs +++ b/crates/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/crates/iroha/tests/integration/queries/account.rs similarity index 97% rename from client/tests/integration/queries/account.rs rename to crates/iroha/tests/integration/queries/account.rs index f4a8447e403..83b63d17e05 100644 --- a/client/tests/integration/queries/account.rs +++ b/crates/iroha/tests/integration/queries/account.rs @@ -2,8 +2,8 @@ use std::collections::HashSet; 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 find_accounts_with_asset() -> Result<()> { diff --git a/client/tests/integration/queries/asset.rs b/crates/iroha/tests/integration/queries/asset.rs similarity index 98% rename from client/tests/integration/queries/asset.rs rename to crates/iroha/tests/integration/queries/asset.rs index 12576fb19a0..b7f66833047 100644 --- a/client/tests/integration/queries/asset.rs +++ b/crates/iroha/tests/integration/queries/asset.rs @@ -5,8 +5,8 @@ use iroha::{ asset::AssetValue, isi::Instruction, prelude::*, query::builder::SingleQueryError, }, }; -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/crates/iroha/tests/integration/queries/mod.rs similarity index 96% rename from client/tests/integration/queries/mod.rs rename to crates/iroha/tests/integration/queries/mod.rs index 277c1eadca0..bf07f4d29c3 100644 --- a/client/tests/integration/queries/mod.rs +++ b/crates/iroha/tests/integration/queries/mod.rs @@ -5,7 +5,7 @@ use iroha::{ query::{error::QueryExecutionFail, parameters::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/crates/iroha/tests/integration/queries/query_errors.rs similarity index 84% rename from client/tests/integration/queries/query_errors.rs rename to crates/iroha/tests/integration/queries/query_errors.rs index cb72febabae..69d7586c9b1 100644 --- a/client/tests/integration/queries/query_errors.rs +++ b/crates/iroha/tests/integration/queries/query_errors.rs @@ -2,11 +2,11 @@ use iroha::{ client, data_model::{prelude::QueryBuilderExt, query::builder::SingleQueryError}, }; -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/crates/iroha/tests/integration/queries/role.rs similarity index 98% rename from client/tests/integration/queries/role.rs rename to crates/iroha/tests/integration/queries/role.rs index e9212044f87..bd88e982302 100644 --- a/client/tests/integration/queries/role.rs +++ b/crates/iroha/tests/integration/queries/role.rs @@ -6,8 +6,8 @@ use iroha::{ data_model::{prelude::*, query::builder::SingleQueryError}, }; 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/crates/iroha/tests/integration/queries/smart_contract.rs similarity index 88% rename from client/tests/integration/queries/smart_contract.rs rename to crates/iroha/tests/integration/queries/smart_contract.rs index e40c556df45..698b148845a 100644 --- a/client/tests/integration/queries/smart_contract.rs +++ b/crates/iroha/tests/integration/queries/smart_contract.rs @@ -3,14 +3,14 @@ use iroha::{ client::QueryError, data_model::{prelude::*, query::error::QueryExecutionFail}, }; -use test_network::*; +use iroha_test_network::*; #[test] fn live_query_is_dropped_after_smart_contract_end() -> Result<()> { let (_rt, _peer, client) = ::new().with_port(11_140).start_with_runtime(); wait_for_genesis_committed(&[client.clone()], 0); - let wasm = iroha_wasm_builder::Builder::new("../wasm_samples/query_assets_and_save_cursor") + let wasm = iroha_wasm_builder::Builder::new("../../wasm_samples/query_assets_and_save_cursor") .show_output() .build()? .optimize()? @@ -47,7 +47,7 @@ fn smart_contract_can_filter_queries() -> Result<()> { wait_for_genesis_committed(&[client.clone()], 0); let wasm = - iroha_wasm_builder::Builder::new("../wasm_samples/smart_contract_can_filter_queries") + iroha_wasm_builder::Builder::new("../../wasm_samples/smart_contract_can_filter_queries") .show_output() .build()? .optimize()? diff --git a/client/tests/integration/roles.rs b/crates/iroha/tests/integration/roles.rs similarity index 99% rename from client/tests/integration/roles.rs rename to crates/iroha/tests/integration/roles.rs index dc43608fcc6..1430c8a6a4e 100644 --- a/client/tests/integration/roles.rs +++ b/crates/iroha/tests/integration/roles.rs @@ -7,9 +7,9 @@ use iroha::{ 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/crates/iroha/tests/integration/set_parameter.rs similarity index 97% rename from client/tests/integration/set_parameter.rs rename to crates/iroha/tests/integration/set_parameter.rs index 62a5f621362..78821fd9464 100644 --- a/client/tests/integration/set_parameter.rs +++ b/crates/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/crates/iroha/tests/integration/sorting.rs similarity index 99% rename from client/tests/integration/sorting.rs rename to crates/iroha/tests/integration/sorting.rs index 10d0dc325d7..729ab76a77f 100644 --- a/client/tests/integration/sorting.rs +++ b/crates/iroha/tests/integration/sorting.rs @@ -9,10 +9,10 @@ use iroha::{ query::predicate::predicate_atoms::asset::AssetPredicateBox, }, }; +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/crates/iroha/tests/integration/status_response.rs similarity index 96% rename from client/tests/integration/status_response.rs rename to crates/iroha/tests/integration/status_response.rs index 64af76057b0..5b59691cbf3 100644 --- a/client/tests/integration/status_response.rs +++ b/crates/iroha/tests/integration/status_response.rs @@ -1,8 +1,8 @@ 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/crates/iroha/tests/integration/transfer_asset.rs similarity index 98% rename from client/tests/integration/transfer_asset.rs rename to crates/iroha/tests/integration/transfer_asset.rs index dbeee6c545d..20ba04a331a 100644 --- a/client/tests/integration/transfer_asset.rs +++ b/crates/iroha/tests/integration/transfer_asset.rs @@ -8,8 +8,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/crates/iroha/tests/integration/transfer_domain.rs similarity index 99% rename from client/tests/integration/transfer_domain.rs rename to crates/iroha/tests/integration/transfer_domain.rs index d7013c6e2cd..4f006b20818 100644 --- a/client/tests/integration/transfer_domain.rs +++ b/crates/iroha/tests/integration/transfer_domain.rs @@ -14,8 +14,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/crates/iroha/tests/integration/triggers/by_call_trigger.rs similarity index 98% rename from client/tests/integration/triggers/by_call_trigger.rs rename to crates/iroha/tests/integration/triggers/by_call_trigger.rs index 1e84558f615..eb11b0c9b3f 100644 --- a/client/tests/integration/triggers/by_call_trigger.rs +++ b/crates/iroha/tests/integration/triggers/by_call_trigger.rs @@ -15,8 +15,8 @@ use iroha_data_model::query::{builder::SingleQueryError, trigger::FindTriggers}; 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"; @@ -427,7 +427,7 @@ fn trigger_in_genesis_using_base64() -> Result<()> { // Building wasm trigger info!("Building trigger"); - let wasm = iroha_wasm_builder::Builder::new("../wasm_samples/mint_rose_trigger") + let wasm = iroha_wasm_builder::Builder::new("../../wasm_samples/mint_rose_trigger") .show_output() .build()? .optimize()? @@ -592,7 +592,7 @@ fn unregistering_one_of_two_triggers_with_identical_wasm_should_not_cause_origin let first_trigger_id = "mint_rose_1".parse::()?; let second_trigger_id = "mint_rose_2".parse::()?; - let wasm = iroha_wasm_builder::Builder::new("../wasm_samples/mint_rose_trigger") + let wasm = iroha_wasm_builder::Builder::new("../../wasm_samples/mint_rose_trigger") .show_output() .build()? .optimize()? @@ -676,7 +676,7 @@ fn call_execute_trigger_with_args() -> Result<()> { let prev_value = get_asset_value(&mut test_client, asset_id.clone()); let trigger_id = TRIGGER_NAME.parse::()?; - let wasm = iroha_wasm_builder::Builder::new("../wasm_samples/mint_rose_trigger_args") + let wasm = iroha_wasm_builder::Builder::new("../../wasm_samples/mint_rose_trigger_args") .show_output() .build()? .optimize()? diff --git a/client/tests/integration/triggers/data_trigger.rs b/crates/iroha/tests/integration/triggers/data_trigger.rs similarity index 96% rename from client/tests/integration/triggers/data_trigger.rs rename to crates/iroha/tests/integration/triggers/data_trigger.rs index 262a644a39c..2970fe57f9b 100644 --- a/client/tests/integration/triggers/data_trigger.rs +++ b/crates/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/crates/iroha/tests/integration/triggers/event_trigger.rs similarity index 96% rename from client/tests/integration/triggers/event_trigger.rs rename to crates/iroha/tests/integration/triggers/event_trigger.rs index 6c7afeaaa74..b0e67f982bf 100644 --- a/client/tests/integration/triggers/event_trigger.rs +++ b/crates/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/crates/iroha/tests/integration/triggers/mod.rs similarity index 100% rename from client/tests/integration/triggers/mod.rs rename to crates/iroha/tests/integration/triggers/mod.rs diff --git a/client/tests/integration/triggers/orphans.rs b/crates/iroha/tests/integration/triggers/orphans.rs similarity index 95% rename from client/tests/integration/triggers/orphans.rs rename to crates/iroha/tests/integration/triggers/orphans.rs index 8a0abce9cda..41dfc874f3d 100644 --- a/client/tests/integration/triggers/orphans.rs +++ b/crates/iroha/tests/integration/triggers/orphans.rs @@ -1,7 +1,7 @@ use iroha::{client::Client, data_model::prelude::*}; use iroha_data_model::query::trigger::FindTriggers; -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/crates/iroha/tests/integration/triggers/time_trigger.rs similarity index 98% rename from client/tests/integration/triggers/time_trigger.rs rename to crates/iroha/tests/integration/triggers/time_trigger.rs index 76672d5adbc..d42fafb926a 100644 --- a/client/tests/integration/triggers/time_trigger.rs +++ b/crates/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 { @@ -221,7 +221,7 @@ fn mint_nft_for_every_user_every_1_sec() -> Result<()> { info!("Building trigger"); let wasm = - iroha_wasm_builder::Builder::new("../wasm_samples/create_nft_for_every_user_trigger") + iroha_wasm_builder::Builder::new("../../wasm_samples/create_nft_for_every_user_trigger") .show_output() .build()? .optimize()? diff --git a/client/tests/integration/triggers/trigger_rollback.rs b/crates/iroha/tests/integration/triggers/trigger_rollback.rs similarity index 96% rename from client/tests/integration/triggers/trigger_rollback.rs rename to crates/iroha/tests/integration/triggers/trigger_rollback.rs index 36756ac56a1..33215299914 100644 --- a/client/tests/integration/triggers/trigger_rollback.rs +++ b/crates/iroha/tests/integration/triggers/trigger_rollback.rs @@ -3,8 +3,8 @@ use iroha::{ client, data_model::{prelude::*, 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/crates/iroha/tests/integration/tx_chain_id.rs similarity index 97% rename from client/tests/integration/tx_chain_id.rs rename to crates/iroha/tests/integration/tx_chain_id.rs index d8654725f32..974211e668b 100644 --- a/client/tests/integration/tx_chain_id.rs +++ b/crates/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/crates/iroha/tests/integration/tx_history.rs similarity index 97% rename from client/tests/integration/tx_history.rs rename to crates/iroha/tests/integration/tx_history.rs index 24811b4fb76..1b20be0054f 100644 --- a/client/tests/integration/tx_history.rs +++ b/crates/iroha/tests/integration/tx_history.rs @@ -6,9 +6,9 @@ use iroha::{ data_model::{prelude::*, query::parameters::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/crates/iroha/tests/integration/tx_rollback.rs similarity index 95% rename from client/tests/integration/tx_rollback.rs rename to crates/iroha/tests/integration/tx_rollback.rs index 0815bb73958..b69828974d4 100644 --- a/client/tests/integration/tx_rollback.rs +++ b/crates/iroha/tests/integration/tx_rollback.rs @@ -1,7 +1,7 @@ use eyre::Result; use iroha::{client, 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/crates/iroha/tests/integration/upgrade.rs similarity index 94% rename from client/tests/integration/upgrade.rs rename to crates/iroha/tests/integration/upgrade.rs index 88fd230fbb7..a2309416cc0 100644 --- a/client/tests/integration/upgrade.rs +++ b/crates/iroha/tests/integration/upgrade.rs @@ -12,9 +12,9 @@ use iroha::{ }; 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"; @@ -55,7 +55,7 @@ fn executor_upgrade_should_work() -> Result<()> { .submit_transaction_blocking(&transfer_rose_tx) .expect_err("Should fail"); - upgrade_executor(&client, "../wasm_samples/executor_with_admin")?; + upgrade_executor(&client, "../../wasm_samples/executor_with_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 @@ -95,7 +95,10 @@ fn executor_upgrade_should_run_migration() -> Result<()> { .is_ok_and(|permission| permission == can_unregister_domain) })); - upgrade_executor(&client, "../wasm_samples/executor_with_custom_permission")?; + upgrade_executor( + &client, + "../../wasm_samples/executor_with_custom_permission", + )?; // Check that `CanUnregisterDomain` doesn't exist let data_model = client.query_single(FindExecutorDataModel)?; @@ -168,7 +171,7 @@ fn executor_upgrade_should_revoke_removed_permissions() -> Result<()> { .is_ok_and(|permission| permission == can_unregister_domain) })); - upgrade_executor(&client, "../wasm_samples/executor_remove_permission")?; + upgrade_executor(&client, "../../wasm_samples/executor_remove_permission")?; // Check that permission doesn't exist assert!(!client @@ -212,7 +215,7 @@ fn executor_custom_instructions_simple() -> Result<()> { upgrade_executor( &client, - "../wasm_samples/executor_custom_instructions_simple", + "../../wasm_samples/executor_custom_instructions_simple", )?; let asset_definition_id: AssetDefinitionId = "rose#wonderland".parse().unwrap(); @@ -258,7 +261,7 @@ fn executor_custom_instructions_complex() -> Result<()> { client.submit_blocking(executor_fuel_limit)?; upgrade_executor( &client, - "../wasm_samples/executor_custom_instructions_complex", + "../../wasm_samples/executor_custom_instructions_complex", )?; // Give 6 roses to bob @@ -329,7 +332,7 @@ 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, "../wasm_samples/executor_with_migration_fail") + let _err = upgrade_executor(&client, "../../wasm_samples/executor_with_migration_fail") .expect_err("Upgrade should fail due to migration failure"); // Checking that things registered in migration does not exist after failed migration @@ -361,7 +364,11 @@ fn migration_should_cause_upgrade_event() { } }); - upgrade_executor(&client, "../wasm_samples/executor_with_custom_permission").unwrap(); + upgrade_executor( + &client, + "../../wasm_samples/executor_with_custom_permission", + ) + .unwrap(); rt.block_on(async { tokio::time::timeout(core::time::Duration::from_secs(60), task) @@ -382,7 +389,7 @@ fn define_custom_parameter() -> Result<()> { let create_domain = Register::domain(Domain::new(long_domain_name)); client.submit_blocking(create_domain)?; - upgrade_executor(&client, "../wasm_samples/executor_with_custom_parameter").unwrap(); + upgrade_executor(&client, "../../wasm_samples/executor_with_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/crates/iroha/tests/mod.rs similarity index 100% rename from client/tests/mod.rs rename to crates/iroha/tests/mod.rs diff --git a/client/tests/ui_fail/cant_filter_singular_query.rs b/crates/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 crates/iroha/tests/ui_fail/cant_filter_singular_query.rs diff --git a/client_cli/.gitignore b/crates/iroha_cli/.gitignore similarity index 100% rename from client_cli/.gitignore rename to crates/iroha_cli/.gitignore diff --git a/client_cli/Cargo.toml b/crates/iroha_cli/Cargo.toml similarity index 97% rename from client_cli/Cargo.toml rename to crates/iroha_cli/Cargo.toml index 1a80836e164..019db3bcd9b 100644 --- a/client_cli/Cargo.toml +++ b/crates/iroha_cli/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "iroha_client_cli" +name = "iroha_cli" edition.workspace = true version.workspace = true diff --git a/client_cli/README.md b/crates/iroha_cli/README.md similarity index 100% rename from client_cli/README.md rename to crates/iroha_cli/README.md diff --git a/client_cli/build.rs b/crates/iroha_cli/build.rs similarity index 100% rename from client_cli/build.rs rename to crates/iroha_cli/build.rs diff --git a/client_cli/src/main.rs b/crates/iroha_cli/src/main.rs similarity index 100% rename from client_cli/src/main.rs rename to crates/iroha_cli/src/main.rs diff --git a/tools/parity_scale_cli/Cargo.toml b/crates/iroha_codec/Cargo.toml similarity index 94% rename from tools/parity_scale_cli/Cargo.toml rename to crates/iroha_codec/Cargo.toml index b076c9976eb..694511cabc1 100644 --- a/tools/parity_scale_cli/Cargo.toml +++ b/crates/iroha_codec/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "parity_scale_cli" +name = "iroha_codec" edition.workspace = true version.workspace = true @@ -37,4 +37,4 @@ serde = { workspace = true } eyre = { workspace = true } [dev-dependencies] -test_samples = { workspace = true } +iroha_test_samples = { workspace = true } diff --git a/tools/parity_scale_cli/README.md b/crates/iroha_codec/README.md similarity index 82% rename from tools/parity_scale_cli/README.md rename to crates/iroha_codec/README.md index dc1345fe24f..80cb2dbd6bb 100644 --- a/tools/parity_scale_cli/README.md +++ b/crates/iroha_codec/README.md @@ -7,7 +7,7 @@ This tool helps you decode **Iroha 2** data types from binaries using [Parity Sc To build the tool, run: ```bash -cargo build --bin parity_scale_cli +cargo build --bin iroha_codec ``` ## Usage @@ -15,7 +15,7 @@ cargo build --bin parity_scale_cli Run Parity Scale Decoder Tool: ```bash -parity_scale_cli +iroha_codec ``` ### Subcommands @@ -33,7 +33,7 @@ parity_scale_cli To list all supported data types, run from the project main directory: ```bash -./target/debug/parity_scale_cli list-types +./target/debug/iroha_codec list-types ```
Expand to see expected output @@ -66,7 +66,7 @@ These commands require `--type` argument. If data type is not known, [`scale-to- * Decode the specified data type from a binary: ```bash - ./target/debug/parity_scale_cli scale-to-json --input --type + ./target/debug/iroha_codec scale-to-json --input --type ``` ### `scale-to-json` and `json-to-scale` usage examples @@ -74,13 +74,13 @@ These commands require `--type` argument. If data type is not known, [`scale-to- * Decode the `NewAccount` data type from the `samples/account.bin` binary: ```bash - ./target/debug/parity_scale_cli scale-to-json --input tools/parity_scale_cli/samples/account.bin --type NewAccount + ./target/debug/iroha_codec scale-to-json --input iroha_codec/samples/account.bin --type NewAccount ``` * Encode the `NewAccount` data type from the `samples/account.json`: ```bash - ./target/debug/parity_scale_cli json-to-scale --input tools/parity_scale_cli/samples/account.json --output result.bin --type NewAccount + ./target/debug/iroha_codec json-to-scale --input iroha_codec/samples/account.json --output result.bin --type NewAccount ``` ## `scale-to-rust` @@ -95,13 +95,13 @@ Decode the data type from a given binary. * Decode the specified data type from a binary: ```bash - ./target/debug/parity_scale_cli scale-to-rust --type + ./target/debug/iroha_codec scale-to-rust --type ``` * If you are not sure which data type is encoded in the binary, run the tool without the `--type` option: ```bash - ./target/debug/parity_scale_cli scale-to-rust + ./target/debug/iroha_codec scale-to-rust ``` ### `scale-to-rust` usage examples @@ -109,11 +109,11 @@ Decode the data type from a given binary. * Decode the `NewAccount` data type from the `samples/account.bin` binary: ```bash - ./target/debug/parity_scale_cli scale-to-rust tools/parity_scale_cli/samples/account.bin --type NewAccount + ./target/debug/iroha_codec scale-to-rust iroha_codec/samples/account.bin --type NewAccount ``` * Decode the `NewDomain` data type from the `samples/domain.bin` binary: ```bash - ./target/debug/parity_scale_cli scale-to-rust tools/parity_scale_cli/samples/domain.bin --type NewDomain + ./target/debug/iroha_codec scale-to-rust iroha_codec/samples/domain.bin --type NewDomain ``` diff --git a/tools/parity_scale_cli/build.rs b/crates/iroha_codec/build.rs similarity index 100% rename from tools/parity_scale_cli/build.rs rename to crates/iroha_codec/build.rs diff --git a/tools/parity_scale_cli/samples/account.bin b/crates/iroha_codec/samples/account.bin similarity index 100% rename from tools/parity_scale_cli/samples/account.bin rename to crates/iroha_codec/samples/account.bin diff --git a/tools/parity_scale_cli/samples/account.json b/crates/iroha_codec/samples/account.json similarity index 100% rename from tools/parity_scale_cli/samples/account.json rename to crates/iroha_codec/samples/account.json diff --git a/tools/parity_scale_cli/samples/domain.bin b/crates/iroha_codec/samples/domain.bin similarity index 100% rename from tools/parity_scale_cli/samples/domain.bin rename to crates/iroha_codec/samples/domain.bin diff --git a/tools/parity_scale_cli/samples/domain.json b/crates/iroha_codec/samples/domain.json similarity index 100% rename from tools/parity_scale_cli/samples/domain.json rename to crates/iroha_codec/samples/domain.json diff --git a/tools/parity_scale_cli/samples/trigger.bin b/crates/iroha_codec/samples/trigger.bin similarity index 100% rename from tools/parity_scale_cli/samples/trigger.bin rename to crates/iroha_codec/samples/trigger.bin diff --git a/tools/parity_scale_cli/samples/trigger.json b/crates/iroha_codec/samples/trigger.json similarity index 100% rename from tools/parity_scale_cli/samples/trigger.json rename to crates/iroha_codec/samples/trigger.json diff --git a/tools/parity_scale_cli/src/main.rs b/crates/iroha_codec/src/main.rs similarity index 99% rename from tools/parity_scale_cli/src/main.rs rename to crates/iroha_codec/src/main.rs index 376e3b63280..2e7367e50ed 100644 --- a/tools/parity_scale_cli/src/main.rs +++ b/crates/iroha_codec/src/main.rs @@ -304,7 +304,7 @@ fn list_types(map: &ConverterMap, writer: &mut W) -> Result<()> { #[cfg(test)] mod tests { use iroha_data_model::prelude::*; - use test_samples::ALICE_ID; + use iroha_test_samples::ALICE_ID; use super::*; diff --git a/config/Cargo.toml b/crates/iroha_config/Cargo.toml similarity index 100% rename from config/Cargo.toml rename to crates/iroha_config/Cargo.toml diff --git a/config/iroha_test_config.toml b/crates/iroha_config/iroha_test_config.toml similarity index 100% rename from config/iroha_test_config.toml rename to crates/iroha_config/iroha_test_config.toml diff --git a/config/src/client_api.rs b/crates/iroha_config/src/client_api.rs similarity index 100% rename from config/src/client_api.rs rename to crates/iroha_config/src/client_api.rs diff --git a/config/src/kura.rs b/crates/iroha_config/src/kura.rs similarity index 100% rename from config/src/kura.rs rename to crates/iroha_config/src/kura.rs diff --git a/config/src/lib.rs b/crates/iroha_config/src/lib.rs similarity index 100% rename from config/src/lib.rs rename to crates/iroha_config/src/lib.rs diff --git a/config/src/logger.rs b/crates/iroha_config/src/logger.rs similarity index 100% rename from config/src/logger.rs rename to crates/iroha_config/src/logger.rs diff --git a/config/src/parameters/actual.rs b/crates/iroha_config/src/parameters/actual.rs similarity index 100% rename from config/src/parameters/actual.rs rename to crates/iroha_config/src/parameters/actual.rs diff --git a/config/src/parameters/defaults.rs b/crates/iroha_config/src/parameters/defaults.rs similarity index 100% rename from config/src/parameters/defaults.rs rename to crates/iroha_config/src/parameters/defaults.rs diff --git a/config/src/parameters/mod.rs b/crates/iroha_config/src/parameters/mod.rs similarity index 100% rename from config/src/parameters/mod.rs rename to crates/iroha_config/src/parameters/mod.rs diff --git a/config/src/parameters/user.rs b/crates/iroha_config/src/parameters/user.rs similarity index 100% rename from config/src/parameters/user.rs rename to crates/iroha_config/src/parameters/user.rs diff --git a/config/src/snapshot.rs b/crates/iroha_config/src/snapshot.rs similarity index 100% rename from config/src/snapshot.rs rename to crates/iroha_config/src/snapshot.rs diff --git a/config/src/wasm.rs b/crates/iroha_config/src/wasm.rs similarity index 100% rename from config/src/wasm.rs rename to crates/iroha_config/src/wasm.rs diff --git a/config/tests/fixtures.rs b/crates/iroha_config/tests/fixtures.rs similarity index 100% rename from config/tests/fixtures.rs rename to crates/iroha_config/tests/fixtures.rs diff --git a/config/tests/fixtures/absolute_paths.toml b/crates/iroha_config/tests/fixtures/absolute_paths.toml similarity index 100% rename from config/tests/fixtures/absolute_paths.toml rename to crates/iroha_config/tests/fixtures/absolute_paths.toml diff --git a/config/tests/fixtures/bad.extra_fields.toml b/crates/iroha_config/tests/fixtures/bad.extra_fields.toml similarity index 100% rename from config/tests/fixtures/bad.extra_fields.toml rename to crates/iroha_config/tests/fixtures/bad.extra_fields.toml diff --git a/config/tests/fixtures/bad.missing_fields.toml b/crates/iroha_config/tests/fixtures/bad.missing_fields.toml similarity index 100% rename from config/tests/fixtures/bad.missing_fields.toml rename to crates/iroha_config/tests/fixtures/bad.missing_fields.toml diff --git a/config/tests/fixtures/bad.multiple_bad_envs.env b/crates/iroha_config/tests/fixtures/bad.multiple_bad_envs.env similarity index 100% rename from config/tests/fixtures/bad.multiple_bad_envs.env rename to crates/iroha_config/tests/fixtures/bad.multiple_bad_envs.env diff --git a/config/tests/fixtures/bad.torii_addr_eq_p2p_addr.toml b/crates/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 crates/iroha_config/tests/fixtures/bad.torii_addr_eq_p2p_addr.toml diff --git a/config/tests/fixtures/base.toml b/crates/iroha_config/tests/fixtures/base.toml similarity index 100% rename from config/tests/fixtures/base.toml rename to crates/iroha_config/tests/fixtures/base.toml diff --git a/config/tests/fixtures/base_trusted_peers.toml b/crates/iroha_config/tests/fixtures/base_trusted_peers.toml similarity index 100% rename from config/tests/fixtures/base_trusted_peers.toml rename to crates/iroha_config/tests/fixtures/base_trusted_peers.toml diff --git a/config/tests/fixtures/full.env b/crates/iroha_config/tests/fixtures/full.env similarity index 100% rename from config/tests/fixtures/full.env rename to crates/iroha_config/tests/fixtures/full.env diff --git a/config/tests/fixtures/full.toml b/crates/iroha_config/tests/fixtures/full.toml similarity index 100% rename from config/tests/fixtures/full.toml rename to crates/iroha_config/tests/fixtures/full.toml diff --git a/config/tests/fixtures/minimal_alone_with_genesis.toml b/crates/iroha_config/tests/fixtures/minimal_alone_with_genesis.toml similarity index 100% rename from config/tests/fixtures/minimal_alone_with_genesis.toml rename to crates/iroha_config/tests/fixtures/minimal_alone_with_genesis.toml diff --git a/config/tests/fixtures/minimal_file_and_env.env b/crates/iroha_config/tests/fixtures/minimal_file_and_env.env similarity index 100% rename from config/tests/fixtures/minimal_file_and_env.env rename to crates/iroha_config/tests/fixtures/minimal_file_and_env.env diff --git a/config/tests/fixtures/minimal_file_and_env.toml b/crates/iroha_config/tests/fixtures/minimal_file_and_env.toml similarity index 100% rename from config/tests/fixtures/minimal_file_and_env.toml rename to crates/iroha_config/tests/fixtures/minimal_file_and_env.toml diff --git a/config/tests/fixtures/minimal_with_trusted_peers.toml b/crates/iroha_config/tests/fixtures/minimal_with_trusted_peers.toml similarity index 100% rename from config/tests/fixtures/minimal_with_trusted_peers.toml rename to crates/iroha_config/tests/fixtures/minimal_with_trusted_peers.toml diff --git a/config/base/Cargo.toml b/crates/iroha_config_base/Cargo.toml similarity index 91% rename from config/base/Cargo.toml rename to crates/iroha_config_base/Cargo.toml index aa41d9b9162..ce42c694476 100644 --- a/config/base/Cargo.toml +++ b/crates/iroha_config_base/Cargo.toml @@ -11,7 +11,7 @@ license.workspace = true workspace = true [dependencies] -iroha_config_base_derive = { path = "derive" } +iroha_config_base_derive = { path = "../iroha_config_base_derive" } drop_bomb = { workspace = true } serde = { workspace = true, features = ["derive"] } diff --git a/config/base/src/attach.rs b/crates/iroha_config_base/src/attach.rs similarity index 100% rename from config/base/src/attach.rs rename to crates/iroha_config_base/src/attach.rs diff --git a/config/base/src/env.rs b/crates/iroha_config_base/src/env.rs similarity index 100% rename from config/base/src/env.rs rename to crates/iroha_config_base/src/env.rs diff --git a/config/base/src/lib.rs b/crates/iroha_config_base/src/lib.rs similarity index 100% rename from config/base/src/lib.rs rename to crates/iroha_config_base/src/lib.rs diff --git a/config/base/src/read.rs b/crates/iroha_config_base/src/read.rs similarity index 100% rename from config/base/src/read.rs rename to crates/iroha_config_base/src/read.rs diff --git a/config/base/src/toml.rs b/crates/iroha_config_base/src/toml.rs similarity index 100% rename from config/base/src/toml.rs rename to crates/iroha_config_base/src/toml.rs diff --git a/config/base/src/util.rs b/crates/iroha_config_base/src/util.rs similarity index 100% rename from config/base/src/util.rs rename to crates/iroha_config_base/src/util.rs diff --git a/config/base/tests/bad.invalid-extends.toml b/crates/iroha_config_base/tests/bad.invalid-extends.toml similarity index 100% rename from config/base/tests/bad.invalid-extends.toml rename to crates/iroha_config_base/tests/bad.invalid-extends.toml diff --git a/config/base/tests/bad.invalid-nested-extends.base.toml b/crates/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 crates/iroha_config_base/tests/bad.invalid-nested-extends.base.toml diff --git a/config/base/tests/bad.invalid-nested-extends.toml b/crates/iroha_config_base/tests/bad.invalid-nested-extends.toml similarity index 100% rename from config/base/tests/bad.invalid-nested-extends.toml rename to crates/iroha_config_base/tests/bad.invalid-nested-extends.toml diff --git a/config/base/tests/misc.rs b/crates/iroha_config_base/tests/misc.rs similarity index 100% rename from config/base/tests/misc.rs rename to crates/iroha_config_base/tests/misc.rs diff --git a/config/base/derive/Cargo.toml b/crates/iroha_config_base_derive/Cargo.toml similarity index 100% rename from config/base/derive/Cargo.toml rename to crates/iroha_config_base_derive/Cargo.toml diff --git a/config/base/derive/src/lib.rs b/crates/iroha_config_base_derive/src/lib.rs similarity index 100% rename from config/base/derive/src/lib.rs rename to crates/iroha_config_base_derive/src/lib.rs diff --git a/config/base/derive/tests/ui.rs b/crates/iroha_config_base_derive/tests/ui.rs similarity index 100% rename from config/base/derive/tests/ui.rs rename to crates/iroha_config_base_derive/tests/ui.rs diff --git a/config/base/derive/tests/ui_fail/generics.rs b/crates/iroha_config_base_derive/tests/ui_fail/generics.rs similarity index 100% rename from config/base/derive/tests/ui_fail/generics.rs rename to crates/iroha_config_base_derive/tests/ui_fail/generics.rs diff --git a/config/base/derive/tests/ui_fail/generics.stderr b/crates/iroha_config_base_derive/tests/ui_fail/generics.stderr similarity index 100% rename from config/base/derive/tests/ui_fail/generics.stderr rename to crates/iroha_config_base_derive/tests/ui_fail/generics.stderr diff --git a/config/base/derive/tests/ui_fail/invalid_attrs_commas.rs b/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/iroha_config_base_derive/tests/ui_fail/invalid_attrs_struct.stderr diff --git a/config/base/derive/tests/ui_fail/unsupported_shapes.rs b/crates/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 crates/iroha_config_base_derive/tests/ui_fail/unsupported_shapes.rs diff --git a/config/base/derive/tests/ui_fail/unsupported_shapes.stderr b/crates/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 crates/iroha_config_base_derive/tests/ui_fail/unsupported_shapes.stderr diff --git a/config/base/derive/tests/ui_pass/happy_path.rs b/crates/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 crates/iroha_config_base_derive/tests/ui_pass/happy_path.rs diff --git a/core/Cargo.toml b/crates/iroha_core/Cargo.toml similarity index 98% rename from core/Cargo.toml rename to crates/iroha_core/Cargo.toml index 65094e73169..ed9ab45731c 100644 --- a/core/Cargo.toml +++ b/crates/iroha_core/Cargo.toml @@ -69,7 +69,7 @@ indexmap = "2.2.6" [dev-dependencies] iroha_executor_data_model = { workspace = true } -test_samples = { workspace = true } +iroha_test_samples = { workspace = true } criterion = { workspace = true } hex = { workspace = true } diff --git a/core/benches/blocks/apply_blocks.rs b/crates/iroha_core/benches/blocks/apply_blocks.rs similarity index 98% rename from core/benches/blocks/apply_blocks.rs rename to crates/iroha_core/benches/blocks/apply_blocks.rs index d945a82dab5..fbbec3afbad 100644 --- a/core/benches/blocks/apply_blocks.rs +++ b/crates/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/crates/iroha_core/benches/blocks/apply_blocks_benchmark.rs similarity index 100% rename from core/benches/blocks/apply_blocks_benchmark.rs rename to crates/iroha_core/benches/blocks/apply_blocks_benchmark.rs diff --git a/core/benches/blocks/apply_blocks_oneshot.rs b/crates/iroha_core/benches/blocks/apply_blocks_oneshot.rs similarity index 100% rename from core/benches/blocks/apply_blocks_oneshot.rs rename to crates/iroha_core/benches/blocks/apply_blocks_oneshot.rs diff --git a/core/benches/blocks/common.rs b/crates/iroha_core/benches/blocks/common.rs similarity index 98% rename from core/benches/blocks/common.rs rename to crates/iroha_core/benches/blocks/common.rs index a6a79b2b7f0..d7d3959e7e1 100644 --- a/core/benches/blocks/common.rs +++ b/crates/iroha_core/benches/blocks/common.rs @@ -207,8 +207,8 @@ pub fn build_state(rt: &tokio::runtime::Handle, account_id: &AccountId) -> State state_block.world.parameters.executor.memory = NonZeroU64::MAX; let mut state_transaction = state_block.transaction(); - let path_to_executor = - std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../defaults/executor.wasm"); + let path_to_executor = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("../../defaults/executor.wasm"); let wasm = std::fs::read(&path_to_executor) .unwrap_or_else(|_| panic!("Failed to read file: {}", path_to_executor.display())); let executor = Executor::new(WasmSmartContract::from_compiled(wasm)); diff --git a/core/benches/blocks/validate_blocks.rs b/crates/iroha_core/benches/blocks/validate_blocks.rs similarity index 98% rename from core/benches/blocks/validate_blocks.rs rename to crates/iroha_core/benches/blocks/validate_blocks.rs index 94fdd71e61d..4782876c609 100644 --- a/core/benches/blocks/validate_blocks.rs +++ b/crates/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/crates/iroha_core/benches/blocks/validate_blocks_benchmark.rs similarity index 100% rename from core/benches/blocks/validate_blocks_benchmark.rs rename to crates/iroha_core/benches/blocks/validate_blocks_benchmark.rs diff --git a/core/benches/blocks/validate_blocks_oneshot.rs b/crates/iroha_core/benches/blocks/validate_blocks_oneshot.rs similarity index 100% rename from core/benches/blocks/validate_blocks_oneshot.rs rename to crates/iroha_core/benches/blocks/validate_blocks_oneshot.rs diff --git a/core/benches/kura.rs b/crates/iroha_core/benches/kura.rs similarity index 98% rename from core/benches/kura.rs rename to crates/iroha_core/benches/kura.rs index 85ccd6547dd..63c40cdffcd 100644 --- a/core/benches/kura.rs +++ b/crates/iroha_core/benches/kura.rs @@ -14,7 +14,7 @@ use iroha_core::{ use iroha_crypto::KeyPair; use iroha_data_model::prelude::*; use iroha_futures::supervisor::ShutdownSignal; -use test_samples::gen_account_in; +use iroha_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/crates/iroha_core/benches/validation.rs similarity index 97% rename from core/benches/validation.rs rename to crates/iroha_core/benches/validation.rs index 61d2ddf5717..56999a2c20f 100644 --- a/core/benches/validation.rs +++ b/crates/iroha_core/benches/validation.rs @@ -12,7 +12,7 @@ use iroha_core::{ use iroha_data_model::{ account::AccountId, isi::InstructionBox, prelude::*, transaction::TransactionBuilder, }; -use test_samples::gen_account_in; +use iroha_test_samples::gen_account_in; static STARTER_DOMAIN: LazyLock = LazyLock::new(|| "start".parse().unwrap()); static STARTER_KEYPAIR: LazyLock = LazyLock::new(KeyPair::random); @@ -51,8 +51,8 @@ fn build_test_and_transient_state() -> State { { let mut state_block = state.block(); let mut state_transaction = state_block.transaction(); - let path_to_executor = - std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../defaults/executor.wasm"); + let path_to_executor = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("../../defaults/executor.wasm"); let wasm = std::fs::read(&path_to_executor) .unwrap_or_else(|_| panic!("Failed to read file: {}", path_to_executor.display())); let executor = Executor::new(WasmSmartContract::from_compiled(wasm)); diff --git a/core/clippy.toml b/crates/iroha_core/clippy.toml similarity index 100% rename from core/clippy.toml rename to crates/iroha_core/clippy.toml diff --git a/core/src/block.rs b/crates/iroha_core/src/block.rs similarity index 99% rename from core/src/block.rs rename to crates/iroha_core/src/block.rs index 808d8afeb44..f7241e71ceb 100644 --- a/core/src/block.rs +++ b/crates/iroha_core/src/block.rs @@ -1109,7 +1109,7 @@ mod event { mod tests { use iroha_data_model::prelude::*; use iroha_genesis::GENESIS_DOMAIN_ID; - 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/crates/iroha_core/src/block_sync.rs similarity index 100% rename from core/src/block_sync.rs rename to crates/iroha_core/src/block_sync.rs diff --git a/core/src/executor.rs b/crates/iroha_core/src/executor.rs similarity index 100% rename from core/src/executor.rs rename to crates/iroha_core/src/executor.rs diff --git a/core/src/gossiper.rs b/crates/iroha_core/src/gossiper.rs similarity index 100% rename from core/src/gossiper.rs rename to crates/iroha_core/src/gossiper.rs diff --git a/core/src/kiso.rs b/crates/iroha_core/src/kiso.rs similarity index 98% rename from core/src/kiso.rs rename to crates/iroha_core/src/kiso.rs index 50fd939e3d1..0807b527121 100644 --- a/core/src/kiso.rs +++ b/crates/iroha_core/src/kiso.rs @@ -167,7 +167,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/crates/iroha_core/src/kura.rs similarity index 99% rename from core/src/kura.rs rename to crates/iroha_core/src/kura.rs index db33b6aa126..052df481102 100644 --- a/core/src/kura.rs +++ b/crates/iroha_core/src/kura.rs @@ -791,9 +791,9 @@ mod tests { ChainId, Level, }; use iroha_genesis::GenesisBuilder; + use iroha_test_samples::gen_account_in; use nonzero_ext::nonzero; use tempfile::TempDir; - use test_samples::gen_account_in; use super::*; use crate::{ @@ -1072,7 +1072,7 @@ mod tests { ); let executor = { - let executor_blob = std::fs::read("../defaults/executor.wasm").unwrap(); + let executor_blob = std::fs::read("../../defaults/executor.wasm").unwrap(); Executor::new(WasmSmartContract::from_compiled(executor_blob)) }; let genesis = GenesisBuilder::default().build_and_sign( diff --git a/core/src/lib.rs b/crates/iroha_core/src/lib.rs similarity index 99% rename from core/src/lib.rs rename to crates/iroha_core/src/lib.rs index 4cb040dcd9a..63456ff5c2f 100644 --- a/core/src/lib.rs +++ b/crates/iroha_core/src/lib.rs @@ -131,7 +131,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/crates/iroha_core/src/metrics.rs similarity index 100% rename from core/src/metrics.rs rename to crates/iroha_core/src/metrics.rs diff --git a/core/src/query/cursor.rs b/crates/iroha_core/src/query/cursor.rs similarity index 100% rename from core/src/query/cursor.rs rename to crates/iroha_core/src/query/cursor.rs diff --git a/core/src/query/mod.rs b/crates/iroha_core/src/query/mod.rs similarity index 100% rename from core/src/query/mod.rs rename to crates/iroha_core/src/query/mod.rs diff --git a/core/src/query/pagination.rs b/crates/iroha_core/src/query/pagination.rs similarity index 100% rename from core/src/query/pagination.rs rename to crates/iroha_core/src/query/pagination.rs diff --git a/core/src/query/store.rs b/crates/iroha_core/src/query/store.rs similarity index 99% rename from core/src/query/store.rs rename to crates/iroha_core/src/query/store.rs index 4b64fa28c9d..d6dbfd9f582 100644 --- a/core/src/query/store.rs +++ b/crates/iroha_core/src/query/store.rs @@ -323,8 +323,8 @@ mod tests { query::parameters::{FetchSize, Pagination, QueryParams, Sorting}, }; use iroha_primitives::json::JsonString; + use iroha_test_samples::ALICE_ID; use nonzero_ext::nonzero; - use test_samples::ALICE_ID; use super::*; diff --git a/core/src/queue.rs b/crates/iroha_core/src/queue.rs similarity index 99% rename from core/src/queue.rs rename to crates/iroha_core/src/queue.rs index d1d8f273350..f9a9bf3c330 100644 --- a/core/src/queue.rs +++ b/crates/iroha_core/src/queue.rs @@ -403,9 +403,9 @@ pub mod tests { use std::{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/crates/iroha_core/src/smartcontracts/isi/account.rs similarity index 99% rename from core/src/smartcontracts/isi/account.rs rename to crates/iroha_core/src/smartcontracts/isi/account.rs index 70f5e56a760..c63f33b1758 100644 --- a/core/src/smartcontracts/isi/account.rs +++ b/crates/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/crates/iroha_core/src/smartcontracts/isi/asset.rs similarity index 100% rename from core/src/smartcontracts/isi/asset.rs rename to crates/iroha_core/src/smartcontracts/isi/asset.rs diff --git a/core/src/smartcontracts/isi/block.rs b/crates/iroha_core/src/smartcontracts/isi/block.rs similarity index 100% rename from core/src/smartcontracts/isi/block.rs rename to crates/iroha_core/src/smartcontracts/isi/block.rs diff --git a/core/src/smartcontracts/isi/domain.rs b/crates/iroha_core/src/smartcontracts/isi/domain.rs similarity index 100% rename from core/src/smartcontracts/isi/domain.rs rename to crates/iroha_core/src/smartcontracts/isi/domain.rs diff --git a/core/src/smartcontracts/isi/mod.rs b/crates/iroha_core/src/smartcontracts/isi/mod.rs similarity index 99% rename from core/src/smartcontracts/isi/mod.rs rename to crates/iroha_core/src/smartcontracts/isi/mod.rs index c886a7ce737..46140458ba6 100644 --- a/core/src/smartcontracts/isi/mod.rs +++ b/crates/iroha_core/src/smartcontracts/isi/mod.rs @@ -228,7 +228,7 @@ pub mod prelude { mod tests { 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/crates/iroha_core/src/smartcontracts/isi/query.rs similarity index 99% rename from core/src/smartcontracts/isi/query.rs rename to crates/iroha_core/src/smartcontracts/isi/query.rs index 9906ce3f725..87404e97ff0 100644 --- a/core/src/smartcontracts/isi/query.rs +++ b/crates/iroha_core/src/smartcontracts/isi/query.rs @@ -341,8 +341,8 @@ mod tests { use iroha_crypto::{Hash, KeyPair}; use iroha_data_model::query::predicate::CompoundPredicate; 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/crates/iroha_core/src/smartcontracts/isi/triggers/mod.rs similarity index 100% rename from core/src/smartcontracts/isi/triggers/mod.rs rename to crates/iroha_core/src/smartcontracts/isi/triggers/mod.rs diff --git a/core/src/smartcontracts/isi/triggers/set.rs b/crates/iroha_core/src/smartcontracts/isi/triggers/set.rs similarity index 100% rename from core/src/smartcontracts/isi/triggers/set.rs rename to crates/iroha_core/src/smartcontracts/isi/triggers/set.rs diff --git a/core/src/smartcontracts/isi/triggers/specialized.rs b/crates/iroha_core/src/smartcontracts/isi/triggers/specialized.rs similarity index 100% rename from core/src/smartcontracts/isi/triggers/specialized.rs rename to crates/iroha_core/src/smartcontracts/isi/triggers/specialized.rs diff --git a/core/src/smartcontracts/isi/tx.rs b/crates/iroha_core/src/smartcontracts/isi/tx.rs similarity index 100% rename from core/src/smartcontracts/isi/tx.rs rename to crates/iroha_core/src/smartcontracts/isi/tx.rs diff --git a/core/src/smartcontracts/isi/world.rs b/crates/iroha_core/src/smartcontracts/isi/world.rs similarity index 100% rename from core/src/smartcontracts/isi/world.rs rename to crates/iroha_core/src/smartcontracts/isi/world.rs diff --git a/core/src/smartcontracts/mod.rs b/crates/iroha_core/src/smartcontracts/mod.rs similarity index 100% rename from core/src/smartcontracts/mod.rs rename to crates/iroha_core/src/smartcontracts/mod.rs diff --git a/core/src/smartcontracts/wasm.rs b/crates/iroha_core/src/smartcontracts/wasm.rs similarity index 99% rename from core/src/smartcontracts/wasm.rs rename to crates/iroha_core/src/smartcontracts/wasm.rs index eaecf238c9f..b121ae0f966 100644 --- a/core/src/smartcontracts/wasm.rs +++ b/crates/iroha_core/src/smartcontracts/wasm.rs @@ -1698,9 +1698,9 @@ impl GetExport for (&wasmtime::Instance, C) { #[cfg(test)] mod tests { + 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/crates/iroha_core/src/snapshot.rs similarity index 100% rename from core/src/snapshot.rs rename to crates/iroha_core/src/snapshot.rs diff --git a/core/src/state.rs b/crates/iroha_core/src/state.rs similarity index 99% rename from core/src/state.rs rename to crates/iroha_core/src/state.rs index bd83fd8bd86..c3ab092e804 100644 --- a/core/src/state.rs +++ b/crates/iroha_core/src/state.rs @@ -2144,7 +2144,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/crates/iroha_core/src/sumeragi/main_loop.rs similarity index 99% rename from core/src/sumeragi/main_loop.rs rename to crates/iroha_core/src/sumeragi/main_loop.rs index 85214cb589e..5183728ef81 100644 --- a/core/src/sumeragi/main_loop.rs +++ b/crates/iroha_core/src/sumeragi/main_loop.rs @@ -1360,8 +1360,8 @@ fn categorize_block_sync( mod tests { use iroha_data_model::{isi::InstructionBox, transaction::TransactionBuilder}; 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/crates/iroha_core/src/sumeragi/message.rs similarity index 100% rename from core/src/sumeragi/message.rs rename to crates/iroha_core/src/sumeragi/message.rs diff --git a/core/src/sumeragi/mod.rs b/crates/iroha_core/src/sumeragi/mod.rs similarity index 100% rename from core/src/sumeragi/mod.rs rename to crates/iroha_core/src/sumeragi/mod.rs diff --git a/core/src/sumeragi/network_topology.rs b/crates/iroha_core/src/sumeragi/network_topology.rs similarity index 100% rename from core/src/sumeragi/network_topology.rs rename to crates/iroha_core/src/sumeragi/network_topology.rs diff --git a/core/src/sumeragi/view_change.rs b/crates/iroha_core/src/sumeragi/view_change.rs similarity index 100% rename from core/src/sumeragi/view_change.rs rename to crates/iroha_core/src/sumeragi/view_change.rs diff --git a/core/src/tx.rs b/crates/iroha_core/src/tx.rs similarity index 100% rename from core/src/tx.rs rename to crates/iroha_core/src/tx.rs diff --git a/crypto/Cargo.toml b/crates/iroha_crypto/Cargo.toml similarity index 100% rename from crypto/Cargo.toml rename to crates/iroha_crypto/Cargo.toml diff --git a/crypto/build.rs b/crates/iroha_crypto/build.rs similarity index 100% rename from crypto/build.rs rename to crates/iroha_crypto/build.rs diff --git a/crypto/src/encryption/chacha20poly1305.rs b/crates/iroha_crypto/src/encryption/chacha20poly1305.rs similarity index 100% rename from crypto/src/encryption/chacha20poly1305.rs rename to crates/iroha_crypto/src/encryption/chacha20poly1305.rs diff --git a/crypto/src/encryption/mod.rs b/crates/iroha_crypto/src/encryption/mod.rs similarity index 100% rename from crypto/src/encryption/mod.rs rename to crates/iroha_crypto/src/encryption/mod.rs diff --git a/crypto/src/hash.rs b/crates/iroha_crypto/src/hash.rs similarity index 100% rename from crypto/src/hash.rs rename to crates/iroha_crypto/src/hash.rs diff --git a/crypto/src/kex/mod.rs b/crates/iroha_crypto/src/kex/mod.rs similarity index 100% rename from crypto/src/kex/mod.rs rename to crates/iroha_crypto/src/kex/mod.rs diff --git a/crypto/src/kex/x25519.rs b/crates/iroha_crypto/src/kex/x25519.rs similarity index 100% rename from crypto/src/kex/x25519.rs rename to crates/iroha_crypto/src/kex/x25519.rs diff --git a/crypto/src/lib.rs b/crates/iroha_crypto/src/lib.rs similarity index 100% rename from crypto/src/lib.rs rename to crates/iroha_crypto/src/lib.rs diff --git a/crypto/src/merkle.rs b/crates/iroha_crypto/src/merkle.rs similarity index 100% rename from crypto/src/merkle.rs rename to crates/iroha_crypto/src/merkle.rs diff --git a/crypto/src/multihash.rs b/crates/iroha_crypto/src/multihash.rs similarity index 100% rename from crypto/src/multihash.rs rename to crates/iroha_crypto/src/multihash.rs diff --git a/crypto/src/secrecy.rs b/crates/iroha_crypto/src/secrecy.rs similarity index 100% rename from crypto/src/secrecy.rs rename to crates/iroha_crypto/src/secrecy.rs diff --git a/crypto/src/signature/bls/implementation.rs b/crates/iroha_crypto/src/signature/bls/implementation.rs similarity index 100% rename from crypto/src/signature/bls/implementation.rs rename to crates/iroha_crypto/src/signature/bls/implementation.rs diff --git a/crypto/src/signature/bls/mod.rs b/crates/iroha_crypto/src/signature/bls/mod.rs similarity index 100% rename from crypto/src/signature/bls/mod.rs rename to crates/iroha_crypto/src/signature/bls/mod.rs diff --git a/crypto/src/signature/bls/tests.rs b/crates/iroha_crypto/src/signature/bls/tests.rs similarity index 100% rename from crypto/src/signature/bls/tests.rs rename to crates/iroha_crypto/src/signature/bls/tests.rs diff --git a/crypto/src/signature/ed25519.rs b/crates/iroha_crypto/src/signature/ed25519.rs similarity index 100% rename from crypto/src/signature/ed25519.rs rename to crates/iroha_crypto/src/signature/ed25519.rs diff --git a/crypto/src/signature/mod.rs b/crates/iroha_crypto/src/signature/mod.rs similarity index 100% rename from crypto/src/signature/mod.rs rename to crates/iroha_crypto/src/signature/mod.rs diff --git a/crypto/src/signature/secp256k1.rs b/crates/iroha_crypto/src/signature/secp256k1.rs similarity index 100% rename from crypto/src/signature/secp256k1.rs rename to crates/iroha_crypto/src/signature/secp256k1.rs diff --git a/crypto/src/varint.rs b/crates/iroha_crypto/src/varint.rs similarity index 100% rename from crypto/src/varint.rs rename to crates/iroha_crypto/src/varint.rs diff --git a/data_model/Cargo.toml b/crates/iroha_data_model/Cargo.toml similarity index 96% rename from data_model/Cargo.toml rename to crates/iroha_data_model/Cargo.toml index 1dc267101db..c10264d929f 100644 --- a/data_model/Cargo.toml +++ b/crates/iroha_data_model/Cargo.toml @@ -27,7 +27,7 @@ ffi_export = ["std", "iroha_ffi", "iroha_primitives/ffi_export", "iroha_crypto/f transparent_api = [] [dependencies] -iroha_data_model_derive = { path = "derive" } +iroha_data_model_derive = { path = "../iroha_data_model_derive" } iroha_primitives = { workspace = true } iroha_crypto = { workspace = true } diff --git a/data_model/benches/time_event_filter.rs b/crates/iroha_data_model/benches/time_event_filter.rs similarity index 100% rename from data_model/benches/time_event_filter.rs rename to crates/iroha_data_model/benches/time_event_filter.rs diff --git a/data_model/build.rs b/crates/iroha_data_model/build.rs similarity index 100% rename from data_model/build.rs rename to crates/iroha_data_model/build.rs diff --git a/data_model/clippy.toml b/crates/iroha_data_model/clippy.toml similarity index 100% rename from data_model/clippy.toml rename to crates/iroha_data_model/clippy.toml diff --git a/data_model/src/account.rs b/crates/iroha_data_model/src/account.rs similarity index 100% rename from data_model/src/account.rs rename to crates/iroha_data_model/src/account.rs diff --git a/data_model/src/asset.rs b/crates/iroha_data_model/src/asset.rs similarity index 100% rename from data_model/src/asset.rs rename to crates/iroha_data_model/src/asset.rs diff --git a/data_model/src/block.rs b/crates/iroha_data_model/src/block.rs similarity index 100% rename from data_model/src/block.rs rename to crates/iroha_data_model/src/block.rs diff --git a/data_model/src/domain.rs b/crates/iroha_data_model/src/domain.rs similarity index 100% rename from data_model/src/domain.rs rename to crates/iroha_data_model/src/domain.rs diff --git a/data_model/src/events/data/events.rs b/crates/iroha_data_model/src/events/data/events.rs similarity index 100% rename from data_model/src/events/data/events.rs rename to crates/iroha_data_model/src/events/data/events.rs diff --git a/data_model/src/events/data/filters.rs b/crates/iroha_data_model/src/events/data/filters.rs similarity index 100% rename from data_model/src/events/data/filters.rs rename to crates/iroha_data_model/src/events/data/filters.rs diff --git a/data_model/src/events/data/mod.rs b/crates/iroha_data_model/src/events/data/mod.rs similarity index 100% rename from data_model/src/events/data/mod.rs rename to crates/iroha_data_model/src/events/data/mod.rs diff --git a/data_model/src/events/execute_trigger.rs b/crates/iroha_data_model/src/events/execute_trigger.rs similarity index 100% rename from data_model/src/events/execute_trigger.rs rename to crates/iroha_data_model/src/events/execute_trigger.rs diff --git a/data_model/src/events/mod.rs b/crates/iroha_data_model/src/events/mod.rs similarity index 100% rename from data_model/src/events/mod.rs rename to crates/iroha_data_model/src/events/mod.rs diff --git a/data_model/src/events/pipeline.rs b/crates/iroha_data_model/src/events/pipeline.rs similarity index 100% rename from data_model/src/events/pipeline.rs rename to crates/iroha_data_model/src/events/pipeline.rs diff --git a/data_model/src/events/time.rs b/crates/iroha_data_model/src/events/time.rs similarity index 100% rename from data_model/src/events/time.rs rename to crates/iroha_data_model/src/events/time.rs diff --git a/data_model/src/events/trigger_completed.rs b/crates/iroha_data_model/src/events/trigger_completed.rs similarity index 99% rename from data_model/src/events/trigger_completed.rs rename to crates/iroha_data_model/src/events/trigger_completed.rs index 05c34842392..03086ddfd54 100644 --- a/data_model/src/events/trigger_completed.rs +++ b/crates/iroha_data_model/src/events/trigger_completed.rs @@ -75,7 +75,7 @@ mod model { } /// Filter [`TriggerCompletedEvent`] by - /// 1. if `triger_id` is some filter based on trigger id + /// 1. if `trigger_id` is some filter based on trigger id /// 2. if `outcome_type` is some filter based on execution outcome (success/failure) /// 3. if both fields are none accept every event of this type #[derive( diff --git a/data_model/src/executor.rs b/crates/iroha_data_model/src/executor.rs similarity index 100% rename from data_model/src/executor.rs rename to crates/iroha_data_model/src/executor.rs diff --git a/data_model/src/ipfs.rs b/crates/iroha_data_model/src/ipfs.rs similarity index 100% rename from data_model/src/ipfs.rs rename to crates/iroha_data_model/src/ipfs.rs diff --git a/data_model/src/isi.rs b/crates/iroha_data_model/src/isi.rs similarity index 100% rename from data_model/src/isi.rs rename to crates/iroha_data_model/src/isi.rs diff --git a/data_model/src/lib.rs b/crates/iroha_data_model/src/lib.rs similarity index 99% rename from data_model/src/lib.rs rename to crates/iroha_data_model/src/lib.rs index 09d360f6f6a..b0f296f2845 100644 --- a/data_model/src/lib.rs +++ b/crates/iroha_data_model/src/lib.rs @@ -281,7 +281,7 @@ mod model { /// (because *Runtime Executor* actually does execution too) and other names /// (like *Verification* or *Execution*) are being discussed. /// - /// TODO: Move to `executor` module + /// TODO: Move to `iroha_executor` module #[derive( Debug, displaydoc::Display, diff --git a/data_model/src/metadata.rs b/crates/iroha_data_model/src/metadata.rs similarity index 100% rename from data_model/src/metadata.rs rename to crates/iroha_data_model/src/metadata.rs diff --git a/data_model/src/name.rs b/crates/iroha_data_model/src/name.rs similarity index 100% rename from data_model/src/name.rs rename to crates/iroha_data_model/src/name.rs diff --git a/data_model/src/parameter.rs b/crates/iroha_data_model/src/parameter.rs similarity index 100% rename from data_model/src/parameter.rs rename to crates/iroha_data_model/src/parameter.rs diff --git a/data_model/src/peer.rs b/crates/iroha_data_model/src/peer.rs similarity index 100% rename from data_model/src/peer.rs rename to crates/iroha_data_model/src/peer.rs diff --git a/data_model/src/permission.rs b/crates/iroha_data_model/src/permission.rs similarity index 100% rename from data_model/src/permission.rs rename to crates/iroha_data_model/src/permission.rs diff --git a/data_model/src/query/builder.rs b/crates/iroha_data_model/src/query/builder.rs similarity index 100% rename from data_model/src/query/builder.rs rename to crates/iroha_data_model/src/query/builder.rs diff --git a/data_model/src/query/mod.rs b/crates/iroha_data_model/src/query/mod.rs similarity index 100% rename from data_model/src/query/mod.rs rename to crates/iroha_data_model/src/query/mod.rs diff --git a/data_model/src/query/parameters.rs b/crates/iroha_data_model/src/query/parameters.rs similarity index 100% rename from data_model/src/query/parameters.rs rename to crates/iroha_data_model/src/query/parameters.rs diff --git a/data_model/src/query/predicate/mod.rs b/crates/iroha_data_model/src/query/predicate/mod.rs similarity index 100% rename from data_model/src/query/predicate/mod.rs rename to crates/iroha_data_model/src/query/predicate/mod.rs diff --git a/data_model/src/query/predicate/predicate_ast_extensions.rs b/crates/iroha_data_model/src/query/predicate/predicate_ast_extensions.rs similarity index 100% rename from data_model/src/query/predicate/predicate_ast_extensions.rs rename to crates/iroha_data_model/src/query/predicate/predicate_ast_extensions.rs diff --git a/data_model/src/query/predicate/predicate_atoms/account.rs b/crates/iroha_data_model/src/query/predicate/predicate_atoms/account.rs similarity index 100% rename from data_model/src/query/predicate/predicate_atoms/account.rs rename to crates/iroha_data_model/src/query/predicate/predicate_atoms/account.rs diff --git a/data_model/src/query/predicate/predicate_atoms/asset.rs b/crates/iroha_data_model/src/query/predicate/predicate_atoms/asset.rs similarity index 100% rename from data_model/src/query/predicate/predicate_atoms/asset.rs rename to crates/iroha_data_model/src/query/predicate/predicate_atoms/asset.rs diff --git a/data_model/src/query/predicate/predicate_atoms/block.rs b/crates/iroha_data_model/src/query/predicate/predicate_atoms/block.rs similarity index 100% rename from data_model/src/query/predicate/predicate_atoms/block.rs rename to crates/iroha_data_model/src/query/predicate/predicate_atoms/block.rs diff --git a/data_model/src/query/predicate/predicate_atoms/domain.rs b/crates/iroha_data_model/src/query/predicate/predicate_atoms/domain.rs similarity index 100% rename from data_model/src/query/predicate/predicate_atoms/domain.rs rename to crates/iroha_data_model/src/query/predicate/predicate_atoms/domain.rs diff --git a/data_model/src/query/predicate/predicate_atoms/mod.rs b/crates/iroha_data_model/src/query/predicate/predicate_atoms/mod.rs similarity index 100% rename from data_model/src/query/predicate/predicate_atoms/mod.rs rename to crates/iroha_data_model/src/query/predicate/predicate_atoms/mod.rs diff --git a/data_model/src/query/predicate/predicate_atoms/parameter.rs b/crates/iroha_data_model/src/query/predicate/predicate_atoms/parameter.rs similarity index 100% rename from data_model/src/query/predicate/predicate_atoms/parameter.rs rename to crates/iroha_data_model/src/query/predicate/predicate_atoms/parameter.rs diff --git a/data_model/src/query/predicate/predicate_atoms/peer.rs b/crates/iroha_data_model/src/query/predicate/predicate_atoms/peer.rs similarity index 100% rename from data_model/src/query/predicate/predicate_atoms/peer.rs rename to crates/iroha_data_model/src/query/predicate/predicate_atoms/peer.rs diff --git a/data_model/src/query/predicate/predicate_atoms/permission.rs b/crates/iroha_data_model/src/query/predicate/predicate_atoms/permission.rs similarity index 100% rename from data_model/src/query/predicate/predicate_atoms/permission.rs rename to crates/iroha_data_model/src/query/predicate/predicate_atoms/permission.rs diff --git a/data_model/src/query/predicate/predicate_atoms/role.rs b/crates/iroha_data_model/src/query/predicate/predicate_atoms/role.rs similarity index 100% rename from data_model/src/query/predicate/predicate_atoms/role.rs rename to crates/iroha_data_model/src/query/predicate/predicate_atoms/role.rs diff --git a/data_model/src/query/predicate/predicate_atoms/trigger.rs b/crates/iroha_data_model/src/query/predicate/predicate_atoms/trigger.rs similarity index 100% rename from data_model/src/query/predicate/predicate_atoms/trigger.rs rename to crates/iroha_data_model/src/query/predicate/predicate_atoms/trigger.rs diff --git a/data_model/src/query/predicate/predicate_combinators.rs b/crates/iroha_data_model/src/query/predicate/predicate_combinators.rs similarity index 100% rename from data_model/src/query/predicate/predicate_combinators.rs rename to crates/iroha_data_model/src/query/predicate/predicate_combinators.rs diff --git a/data_model/src/query/predicate/projectors.rs b/crates/iroha_data_model/src/query/predicate/projectors.rs similarity index 100% rename from data_model/src/query/predicate/projectors.rs rename to crates/iroha_data_model/src/query/predicate/projectors.rs diff --git a/data_model/src/query/predicate/prototypes/account.rs b/crates/iroha_data_model/src/query/predicate/prototypes/account.rs similarity index 100% rename from data_model/src/query/predicate/prototypes/account.rs rename to crates/iroha_data_model/src/query/predicate/prototypes/account.rs diff --git a/data_model/src/query/predicate/prototypes/asset.rs b/crates/iroha_data_model/src/query/predicate/prototypes/asset.rs similarity index 100% rename from data_model/src/query/predicate/prototypes/asset.rs rename to crates/iroha_data_model/src/query/predicate/prototypes/asset.rs diff --git a/data_model/src/query/predicate/prototypes/block.rs b/crates/iroha_data_model/src/query/predicate/prototypes/block.rs similarity index 100% rename from data_model/src/query/predicate/prototypes/block.rs rename to crates/iroha_data_model/src/query/predicate/prototypes/block.rs diff --git a/data_model/src/query/predicate/prototypes/domain.rs b/crates/iroha_data_model/src/query/predicate/prototypes/domain.rs similarity index 100% rename from data_model/src/query/predicate/prototypes/domain.rs rename to crates/iroha_data_model/src/query/predicate/prototypes/domain.rs diff --git a/data_model/src/query/predicate/prototypes/mod.rs b/crates/iroha_data_model/src/query/predicate/prototypes/mod.rs similarity index 100% rename from data_model/src/query/predicate/prototypes/mod.rs rename to crates/iroha_data_model/src/query/predicate/prototypes/mod.rs diff --git a/data_model/src/query/predicate/prototypes/parameter.rs b/crates/iroha_data_model/src/query/predicate/prototypes/parameter.rs similarity index 100% rename from data_model/src/query/predicate/prototypes/parameter.rs rename to crates/iroha_data_model/src/query/predicate/prototypes/parameter.rs diff --git a/data_model/src/query/predicate/prototypes/peer.rs b/crates/iroha_data_model/src/query/predicate/prototypes/peer.rs similarity index 100% rename from data_model/src/query/predicate/prototypes/peer.rs rename to crates/iroha_data_model/src/query/predicate/prototypes/peer.rs diff --git a/data_model/src/query/predicate/prototypes/permission.rs b/crates/iroha_data_model/src/query/predicate/prototypes/permission.rs similarity index 100% rename from data_model/src/query/predicate/prototypes/permission.rs rename to crates/iroha_data_model/src/query/predicate/prototypes/permission.rs diff --git a/data_model/src/query/predicate/prototypes/role.rs b/crates/iroha_data_model/src/query/predicate/prototypes/role.rs similarity index 100% rename from data_model/src/query/predicate/prototypes/role.rs rename to crates/iroha_data_model/src/query/predicate/prototypes/role.rs diff --git a/data_model/src/query/predicate/prototypes/trigger.rs b/crates/iroha_data_model/src/query/predicate/prototypes/trigger.rs similarity index 100% rename from data_model/src/query/predicate/prototypes/trigger.rs rename to crates/iroha_data_model/src/query/predicate/prototypes/trigger.rs diff --git a/data_model/src/role.rs b/crates/iroha_data_model/src/role.rs similarity index 100% rename from data_model/src/role.rs rename to crates/iroha_data_model/src/role.rs diff --git a/data_model/src/smart_contract.rs b/crates/iroha_data_model/src/smart_contract.rs similarity index 100% rename from data_model/src/smart_contract.rs rename to crates/iroha_data_model/src/smart_contract.rs diff --git a/data_model/src/transaction.rs b/crates/iroha_data_model/src/transaction.rs similarity index 100% rename from data_model/src/transaction.rs rename to crates/iroha_data_model/src/transaction.rs diff --git a/data_model/src/trigger.rs b/crates/iroha_data_model/src/trigger.rs similarity index 98% rename from data_model/src/trigger.rs rename to crates/iroha_data_model/src/trigger.rs index 316755f5d95..34b6825fc01 100644 --- a/data_model/src/trigger.rs +++ b/crates/iroha_data_model/src/trigger.rs @@ -1,6 +1,6 @@ //! Structures traits and impls related to `Trigger`s. -// If editing this file, consider updating `core/src/smartcontracts/isi/triggers/specialized.rs` +// If editing this file, consider updating `iroha_core/src/smartcontracts/isi/triggers/specialized.rs` // It mirrors structures from this file. #[cfg(not(feature = "std"))] diff --git a/data_model/src/visit.rs b/crates/iroha_data_model/src/visit.rs similarity index 100% rename from data_model/src/visit.rs rename to crates/iroha_data_model/src/visit.rs diff --git a/data_model/tests/data_model.rs b/crates/iroha_data_model/tests/data_model.rs similarity index 100% rename from data_model/tests/data_model.rs rename to crates/iroha_data_model/tests/data_model.rs diff --git a/data_model/derive/Cargo.toml b/crates/iroha_data_model_derive/Cargo.toml similarity index 100% rename from data_model/derive/Cargo.toml rename to crates/iroha_data_model_derive/Cargo.toml diff --git a/data_model/derive/src/enum_ref.rs b/crates/iroha_data_model_derive/src/enum_ref.rs similarity index 100% rename from data_model/derive/src/enum_ref.rs rename to crates/iroha_data_model_derive/src/enum_ref.rs diff --git a/data_model/derive/src/event_set.rs b/crates/iroha_data_model_derive/src/event_set.rs similarity index 100% rename from data_model/derive/src/event_set.rs rename to crates/iroha_data_model_derive/src/event_set.rs diff --git a/data_model/derive/src/has_origin.rs b/crates/iroha_data_model_derive/src/has_origin.rs similarity index 100% rename from data_model/derive/src/has_origin.rs rename to crates/iroha_data_model_derive/src/has_origin.rs diff --git a/data_model/derive/src/id.rs b/crates/iroha_data_model_derive/src/id.rs similarity index 100% rename from data_model/derive/src/id.rs rename to crates/iroha_data_model_derive/src/id.rs diff --git a/data_model/derive/src/lib.rs b/crates/iroha_data_model_derive/src/lib.rs similarity index 99% rename from data_model/derive/src/lib.rs rename to crates/iroha_data_model_derive/src/lib.rs index 2ecf9314397..f125baa2a0f 100644 --- a/data_model/derive/src/lib.rs +++ b/crates/iroha_data_model_derive/src/lib.rs @@ -1,4 +1,4 @@ -//! A crate containing various derive macros for `data_model` +//! A crate containing various derive macros for `iroha_data_model` mod enum_ref; mod event_set; mod has_origin; diff --git a/data_model/derive/src/model.rs b/crates/iroha_data_model_derive/src/model.rs similarity index 100% rename from data_model/derive/src/model.rs rename to crates/iroha_data_model_derive/src/model.rs diff --git a/data_model/derive/src/partially_tagged/mod.rs b/crates/iroha_data_model_derive/src/partially_tagged/mod.rs similarity index 100% rename from data_model/derive/src/partially_tagged/mod.rs rename to crates/iroha_data_model_derive/src/partially_tagged/mod.rs diff --git a/data_model/derive/src/partially_tagged/resolve_self.rs b/crates/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 crates/iroha_data_model_derive/src/partially_tagged/resolve_self.rs diff --git a/data_model/derive/tests/event_set.rs b/crates/iroha_data_model_derive/tests/event_set.rs similarity index 100% rename from data_model/derive/tests/event_set.rs rename to crates/iroha_data_model_derive/tests/event_set.rs diff --git a/data_model/derive/tests/has_origin.rs b/crates/iroha_data_model_derive/tests/has_origin.rs similarity index 100% rename from data_model/derive/tests/has_origin.rs rename to crates/iroha_data_model_derive/tests/has_origin.rs diff --git a/data_model/derive/tests/has_origin_generics.rs b/crates/iroha_data_model_derive/tests/has_origin_generics.rs similarity index 100% rename from data_model/derive/tests/has_origin_generics.rs rename to crates/iroha_data_model_derive/tests/has_origin_generics.rs diff --git a/data_model/derive/tests/id_eq_ord_hash.rs b/crates/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 crates/iroha_data_model_derive/tests/id_eq_ord_hash.rs diff --git a/data_model/derive/tests/partial_tagged_serde.rs b/crates/iroha_data_model_derive/tests/partial_tagged_serde.rs similarity index 97% rename from data_model/derive/tests/partial_tagged_serde.rs rename to crates/iroha_data_model_derive/tests/partial_tagged_serde.rs index 7793367e790..ba10e5e4fc4 100644 --- a/data_model/derive/tests/partial_tagged_serde.rs +++ b/crates/iroha_data_model_derive/tests/partial_tagged_serde.rs @@ -13,7 +13,7 @@ enum Value { Numeric(NumericValue), } -// a simpler version of NumericValue than used in data_model +// a simpler version of NumericValue than used in iroha_data_model // this one is always i32, but is still serialized as a string literal // NOTE: debug is actually required for `PartiallyTaggedDeserialize`! #[derive(Debug, PartialEq, Eq)] diff --git a/data_model/derive/tests/partial_tagged_serde_self.rs b/crates/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 crates/iroha_data_model_derive/tests/partial_tagged_serde_self.rs diff --git a/data_model/derive/tests/ui.rs b/crates/iroha_data_model_derive/tests/ui.rs similarity index 100% rename from data_model/derive/tests/ui.rs rename to crates/iroha_data_model_derive/tests/ui.rs diff --git a/data_model/derive/tests/ui_fail/has_origin_multiple_attributes.rs b/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/iroha_data_model_derive/tests/ui_fail/transparent_api_private_item.stderr similarity index 85% rename from data_model/derive/tests/ui_fail/transparent_api_private_item.stderr rename to crates/iroha_data_model_derive/tests/ui_fail/transparent_api_private_item.stderr index 7c82cc76a78..001be1c7e34 100644 --- a/data_model/derive/tests/ui_fail/transparent_api_private_item.stderr +++ b/crates/iroha_data_model_derive/tests/ui_fail/transparent_api_private_item.stderr @@ -5,7 +5,7 @@ error[E0603]: struct `BlockPayload` is private | ^^^^^^^^^^^^ private struct | note: the struct `BlockPayload` is defined here - --> $WORKSPACE/data_model/src/block.rs + --> $WORKSPACE/crates/iroha_data_model/src/block.rs | | pub use self::model::*; | ^^^^^^^^^^^ diff --git a/macro/derive/Cargo.toml b/crates/iroha_derive/Cargo.toml similarity index 100% rename from macro/derive/Cargo.toml rename to crates/iroha_derive/Cargo.toml diff --git a/macro/derive/src/lib.rs b/crates/iroha_derive/src/lib.rs similarity index 100% rename from macro/derive/src/lib.rs rename to crates/iroha_derive/src/lib.rs diff --git a/macro/derive/tests/container_enum_from_variant.rs b/crates/iroha_derive/tests/container_enum_from_variant.rs similarity index 100% rename from macro/derive/tests/container_enum_from_variant.rs rename to crates/iroha_derive/tests/container_enum_from_variant.rs diff --git a/macro/derive/tests/enum_from_variant_attrs.rs b/crates/iroha_derive/tests/enum_from_variant_attrs.rs similarity index 100% rename from macro/derive/tests/enum_from_variant_attrs.rs rename to crates/iroha_derive/tests/enum_from_variant_attrs.rs diff --git a/ffi/derive/tests/ui.rs b/crates/iroha_derive/tests/ui.rs similarity index 100% rename from ffi/derive/tests/ui.rs rename to crates/iroha_derive/tests/ui.rs diff --git a/macro/derive/tests/ui_fail/from_variant_conflicting_implementation.rs b/crates/iroha_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 crates/iroha_derive/tests/ui_fail/from_variant_conflicting_implementation.rs diff --git a/macro/derive/tests/ui_fail/from_variant_conflicting_implementation.stderr b/crates/iroha_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 crates/iroha_derive/tests/ui_fail/from_variant_conflicting_implementation.stderr diff --git a/macro/derive/tests/ui_fail/from_variant_incorrect_attr_placement.rs b/crates/iroha_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 crates/iroha_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/crates/iroha_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 crates/iroha_derive/tests/ui_fail/from_variant_incorrect_attr_placement.stderr diff --git a/macro/derive/tests/ui_fail/from_variant_same_type.rs b/crates/iroha_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 crates/iroha_derive/tests/ui_fail/from_variant_same_type.rs diff --git a/macro/derive/tests/ui_fail/from_variant_same_type.stderr b/crates/iroha_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 crates/iroha_derive/tests/ui_fail/from_variant_same_type.stderr diff --git a/macro/derive/tests/ui_fail/struct_from_variant.rs b/crates/iroha_derive/tests/ui_fail/struct_from_variant.rs similarity index 100% rename from macro/derive/tests/ui_fail/struct_from_variant.rs rename to crates/iroha_derive/tests/ui_fail/struct_from_variant.rs diff --git a/macro/derive/tests/ui_fail/struct_from_variant.stderr b/crates/iroha_derive/tests/ui_fail/struct_from_variant.stderr similarity index 100% rename from macro/derive/tests/ui_fail/struct_from_variant.stderr rename to crates/iroha_derive/tests/ui_fail/struct_from_variant.stderr diff --git a/macro/derive/tests/ui_pass/enum_from_variant.rs b/crates/iroha_derive/tests/ui_pass/enum_from_variant.rs similarity index 100% rename from macro/derive/tests/ui_pass/enum_from_variant.rs rename to crates/iroha_derive/tests/ui_pass/enum_from_variant.rs diff --git a/smart_contract/executor/Cargo.toml b/crates/iroha_executor/Cargo.toml similarity index 88% rename from smart_contract/executor/Cargo.toml rename to crates/iroha_executor/Cargo.toml index f10251c5425..40f012a1dad 100644 --- a/smart_contract/executor/Cargo.toml +++ b/crates/iroha_executor/Cargo.toml @@ -14,7 +14,7 @@ workspace = true debug = ["iroha_smart_contract/debug"] [dependencies] -iroha_executor_derive = { path = "derive" } +iroha_executor_derive = { path = "../iroha_executor_derive" } iroha_executor_data_model.workspace = true iroha_smart_contract_utils.workspace = true diff --git a/smart_contract/executor/src/default.rs b/crates/iroha_executor/src/default.rs similarity index 100% rename from smart_contract/executor/src/default.rs rename to crates/iroha_executor/src/default.rs diff --git a/smart_contract/executor/src/lib.rs b/crates/iroha_executor/src/lib.rs similarity index 100% rename from smart_contract/executor/src/lib.rs rename to crates/iroha_executor/src/lib.rs diff --git a/smart_contract/executor/src/permission.rs b/crates/iroha_executor/src/permission.rs similarity index 100% rename from smart_contract/executor/src/permission.rs rename to crates/iroha_executor/src/permission.rs diff --git a/smart_contract/executor/data_model/Cargo.toml b/crates/iroha_executor_data_model/Cargo.toml similarity index 78% rename from smart_contract/executor/data_model/Cargo.toml rename to crates/iroha_executor_data_model/Cargo.toml index 94624d2c295..4627792101d 100644 --- a/smart_contract/executor/data_model/Cargo.toml +++ b/crates/iroha_executor_data_model/Cargo.toml @@ -11,7 +11,7 @@ license.workspace = true workspace = true [dependencies] -iroha_executor_data_model_derive = { path = "derive" } +iroha_executor_data_model_derive = { path = "../iroha_executor_data_model_derive" } iroha_data_model.workspace = true iroha_schema.workspace = true diff --git a/smart_contract/executor/data_model/src/lib.rs b/crates/iroha_executor_data_model/src/lib.rs similarity index 100% rename from smart_contract/executor/data_model/src/lib.rs rename to crates/iroha_executor_data_model/src/lib.rs diff --git a/smart_contract/executor/data_model/src/parameter.rs b/crates/iroha_executor_data_model/src/parameter.rs similarity index 100% rename from smart_contract/executor/data_model/src/parameter.rs rename to crates/iroha_executor_data_model/src/parameter.rs diff --git a/smart_contract/executor/data_model/src/permission.rs b/crates/iroha_executor_data_model/src/permission.rs similarity index 100% rename from smart_contract/executor/data_model/src/permission.rs rename to crates/iroha_executor_data_model/src/permission.rs diff --git a/smart_contract/executor/data_model/derive/Cargo.toml b/crates/iroha_executor_data_model_derive/Cargo.toml similarity index 100% rename from smart_contract/executor/data_model/derive/Cargo.toml rename to crates/iroha_executor_data_model_derive/Cargo.toml diff --git a/smart_contract/executor/data_model/derive/src/lib.rs b/crates/iroha_executor_data_model_derive/src/lib.rs similarity index 100% rename from smart_contract/executor/data_model/derive/src/lib.rs rename to crates/iroha_executor_data_model_derive/src/lib.rs diff --git a/smart_contract/executor/data_model/derive/src/parameter.rs b/crates/iroha_executor_data_model_derive/src/parameter.rs similarity index 100% rename from smart_contract/executor/data_model/derive/src/parameter.rs rename to crates/iroha_executor_data_model_derive/src/parameter.rs diff --git a/smart_contract/executor/data_model/derive/src/permission.rs b/crates/iroha_executor_data_model_derive/src/permission.rs similarity index 100% rename from smart_contract/executor/data_model/derive/src/permission.rs rename to crates/iroha_executor_data_model_derive/src/permission.rs diff --git a/smart_contract/executor/derive/Cargo.toml b/crates/iroha_executor_derive/Cargo.toml similarity index 100% rename from smart_contract/executor/derive/Cargo.toml rename to crates/iroha_executor_derive/Cargo.toml diff --git a/smart_contract/executor/derive/src/default.rs b/crates/iroha_executor_derive/src/default.rs similarity index 100% rename from smart_contract/executor/derive/src/default.rs rename to crates/iroha_executor_derive/src/default.rs diff --git a/smart_contract/executor/derive/src/entrypoint.rs b/crates/iroha_executor_derive/src/entrypoint.rs similarity index 100% rename from smart_contract/executor/derive/src/entrypoint.rs rename to crates/iroha_executor_derive/src/entrypoint.rs diff --git a/smart_contract/executor/derive/src/lib.rs b/crates/iroha_executor_derive/src/lib.rs similarity index 100% rename from smart_contract/executor/derive/src/lib.rs rename to crates/iroha_executor_derive/src/lib.rs diff --git a/ffi/.cargo/config.toml b/crates/iroha_ffi/.cargo/config.toml similarity index 100% rename from ffi/.cargo/config.toml rename to crates/iroha_ffi/.cargo/config.toml diff --git a/ffi/Cargo.toml b/crates/iroha_ffi/Cargo.toml similarity index 92% rename from ffi/Cargo.toml rename to crates/iroha_ffi/Cargo.toml index bbf05e88a9a..40ad9212f29 100644 --- a/ffi/Cargo.toml +++ b/crates/iroha_ffi/Cargo.toml @@ -18,7 +18,7 @@ workspace = true non_robust_ref_mut = [] [dependencies] -iroha_ffi_derive = { path = "derive" } +iroha_ffi_derive = { path = "../iroha_ffi_derive" } derive_more = { workspace = true, features = ["display", "constructor"] } diff --git a/ffi/src/handle.rs b/crates/iroha_ffi/src/handle.rs similarity index 100% rename from ffi/src/handle.rs rename to crates/iroha_ffi/src/handle.rs diff --git a/ffi/src/ir.rs b/crates/iroha_ffi/src/ir.rs similarity index 100% rename from ffi/src/ir.rs rename to crates/iroha_ffi/src/ir.rs diff --git a/ffi/src/lib.rs b/crates/iroha_ffi/src/lib.rs similarity index 100% rename from ffi/src/lib.rs rename to crates/iroha_ffi/src/lib.rs diff --git a/ffi/src/option.rs b/crates/iroha_ffi/src/option.rs similarity index 100% rename from ffi/src/option.rs rename to crates/iroha_ffi/src/option.rs diff --git a/ffi/src/primitives.rs b/crates/iroha_ffi/src/primitives.rs similarity index 100% rename from ffi/src/primitives.rs rename to crates/iroha_ffi/src/primitives.rs diff --git a/ffi/src/repr_c.rs b/crates/iroha_ffi/src/repr_c.rs similarity index 100% rename from ffi/src/repr_c.rs rename to crates/iroha_ffi/src/repr_c.rs diff --git a/ffi/src/slice.rs b/crates/iroha_ffi/src/slice.rs similarity index 100% rename from ffi/src/slice.rs rename to crates/iroha_ffi/src/slice.rs diff --git a/ffi/src/std_impls.rs b/crates/iroha_ffi/src/std_impls.rs similarity index 100% rename from ffi/src/std_impls.rs rename to crates/iroha_ffi/src/std_impls.rs diff --git a/ffi/tests/export_getset.rs b/crates/iroha_ffi/tests/export_getset.rs similarity index 100% rename from ffi/tests/export_getset.rs rename to crates/iroha_ffi/tests/export_getset.rs diff --git a/ffi/tests/export_shared_fns.rs b/crates/iroha_ffi/tests/export_shared_fns.rs similarity index 100% rename from ffi/tests/export_shared_fns.rs rename to crates/iroha_ffi/tests/export_shared_fns.rs diff --git a/ffi/tests/ffi_export.rs b/crates/iroha_ffi/tests/ffi_export.rs similarity index 100% rename from ffi/tests/ffi_export.rs rename to crates/iroha_ffi/tests/ffi_export.rs diff --git a/ffi/tests/ffi_export_import_u128_i128.rs b/crates/iroha_ffi/tests/ffi_export_import_u128_i128.rs similarity index 100% rename from ffi/tests/ffi_export_import_u128_i128.rs rename to crates/iroha_ffi/tests/ffi_export_import_u128_i128.rs diff --git a/ffi/tests/ffi_import.rs b/crates/iroha_ffi/tests/ffi_import.rs similarity index 100% rename from ffi/tests/ffi_import.rs rename to crates/iroha_ffi/tests/ffi_import.rs diff --git a/ffi/tests/ffi_import_opaque.rs b/crates/iroha_ffi/tests/ffi_import_opaque.rs similarity index 100% rename from ffi/tests/ffi_import_opaque.rs rename to crates/iroha_ffi/tests/ffi_import_opaque.rs diff --git a/ffi/tests/generics.rs b/crates/iroha_ffi/tests/generics.rs similarity index 100% rename from ffi/tests/generics.rs rename to crates/iroha_ffi/tests/generics.rs diff --git a/ffi/tests/import_getset.rs b/crates/iroha_ffi/tests/import_getset.rs similarity index 100% rename from ffi/tests/import_getset.rs rename to crates/iroha_ffi/tests/import_getset.rs diff --git a/ffi/tests/import_shared_fns.rs b/crates/iroha_ffi/tests/import_shared_fns.rs similarity index 100% rename from ffi/tests/import_shared_fns.rs rename to crates/iroha_ffi/tests/import_shared_fns.rs diff --git a/ffi/tests/transparent.rs b/crates/iroha_ffi/tests/transparent.rs similarity index 100% rename from ffi/tests/transparent.rs rename to crates/iroha_ffi/tests/transparent.rs diff --git a/ffi/tests/unambiguous.rs b/crates/iroha_ffi/tests/unambiguous.rs similarity index 100% rename from ffi/tests/unambiguous.rs rename to crates/iroha_ffi/tests/unambiguous.rs diff --git a/ffi/derive/Cargo.toml b/crates/iroha_ffi_derive/Cargo.toml similarity index 100% rename from ffi/derive/Cargo.toml rename to crates/iroha_ffi_derive/Cargo.toml diff --git a/ffi/derive/src/attr_parse/derive.rs b/crates/iroha_ffi_derive/src/attr_parse/derive.rs similarity index 100% rename from ffi/derive/src/attr_parse/derive.rs rename to crates/iroha_ffi_derive/src/attr_parse/derive.rs diff --git a/ffi/derive/src/attr_parse/doc.rs b/crates/iroha_ffi_derive/src/attr_parse/doc.rs similarity index 100% rename from ffi/derive/src/attr_parse/doc.rs rename to crates/iroha_ffi_derive/src/attr_parse/doc.rs diff --git a/ffi/derive/src/attr_parse/getset.rs b/crates/iroha_ffi_derive/src/attr_parse/getset.rs similarity index 100% rename from ffi/derive/src/attr_parse/getset.rs rename to crates/iroha_ffi_derive/src/attr_parse/getset.rs diff --git a/ffi/derive/src/attr_parse/mod.rs b/crates/iroha_ffi_derive/src/attr_parse/mod.rs similarity index 100% rename from ffi/derive/src/attr_parse/mod.rs rename to crates/iroha_ffi_derive/src/attr_parse/mod.rs diff --git a/ffi/derive/src/attr_parse/repr.rs b/crates/iroha_ffi_derive/src/attr_parse/repr.rs similarity index 100% rename from ffi/derive/src/attr_parse/repr.rs rename to crates/iroha_ffi_derive/src/attr_parse/repr.rs diff --git a/ffi/derive/src/convert.rs b/crates/iroha_ffi_derive/src/convert.rs similarity index 100% rename from ffi/derive/src/convert.rs rename to crates/iroha_ffi_derive/src/convert.rs diff --git a/ffi/derive/src/ffi_fn.rs b/crates/iroha_ffi_derive/src/ffi_fn.rs similarity index 100% rename from ffi/derive/src/ffi_fn.rs rename to crates/iroha_ffi_derive/src/ffi_fn.rs diff --git a/ffi/derive/src/getset_gen.rs b/crates/iroha_ffi_derive/src/getset_gen.rs similarity index 100% rename from ffi/derive/src/getset_gen.rs rename to crates/iroha_ffi_derive/src/getset_gen.rs diff --git a/ffi/derive/src/impl_visitor.rs b/crates/iroha_ffi_derive/src/impl_visitor.rs similarity index 100% rename from ffi/derive/src/impl_visitor.rs rename to crates/iroha_ffi_derive/src/impl_visitor.rs diff --git a/ffi/derive/src/lib.rs b/crates/iroha_ffi_derive/src/lib.rs similarity index 100% rename from ffi/derive/src/lib.rs rename to crates/iroha_ffi_derive/src/lib.rs diff --git a/ffi/derive/src/wrapper.rs b/crates/iroha_ffi_derive/src/wrapper.rs similarity index 100% rename from ffi/derive/src/wrapper.rs rename to crates/iroha_ffi_derive/src/wrapper.rs diff --git a/macro/derive/tests/ui.rs b/crates/iroha_ffi_derive/tests/ui.rs similarity index 100% rename from macro/derive/tests/ui.rs rename to crates/iroha_ffi_derive/tests/ui.rs diff --git a/ffi/derive/tests/ui_fail/array_as_ptr.rs b/crates/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 crates/iroha_ffi_derive/tests/ui_fail/array_as_ptr.rs diff --git a/ffi/derive/tests/ui_fail/array_as_ptr.stderr b/crates/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 crates/iroha_ffi_derive/tests/ui_fail/array_as_ptr.stderr diff --git a/ffi/derive/tests/ui_fail/derive_skip_field.rs b/crates/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 crates/iroha_ffi_derive/tests/ui_fail/derive_skip_field.rs diff --git a/ffi/derive/tests/ui_fail/derive_skip_field.stderr b/crates/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 crates/iroha_ffi_derive/tests/ui_fail/derive_skip_field.stderr diff --git a/ffi/derive/tests/ui_fail/derive_skip_struct.rs b/crates/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 crates/iroha_ffi_derive/tests/ui_fail/derive_skip_struct.rs diff --git a/ffi/derive/tests/ui_fail/derive_skip_struct.stderr b/crates/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 crates/iroha_ffi_derive/tests/ui_fail/derive_skip_struct.stderr diff --git a/ffi/derive/tests/ui_fail/fallible_transmute_mut_ref.rs b/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/iroha_ffi_derive/tests/ui_fail/nested_owned_structure.rs diff --git a/ffi/derive/tests/ui_fail/nested_owned_structure.stderr b/crates/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 crates/iroha_ffi_derive/tests/ui_fail/nested_owned_structure.stderr diff --git a/ffi/derive/tests/ui_fail/non_robust_repr_c.rs b/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/iroha_ffi_derive/tests/ui_fail/raw_pointer_type.rs diff --git a/ffi/derive/tests/ui_fail/raw_pointer_type.stderr b/crates/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 crates/iroha_ffi_derive/tests/ui_fail/raw_pointer_type.stderr diff --git a/ffi/derive/tests/ui_fail/uninhabited_enum.rs b/crates/iroha_ffi_derive/tests/ui_fail/uninhabited_enum.rs similarity index 100% rename from ffi/derive/tests/ui_fail/uninhabited_enum.rs rename to crates/iroha_ffi_derive/tests/ui_fail/uninhabited_enum.rs diff --git a/ffi/derive/tests/ui_fail/uninhabited_enum.stderr b/crates/iroha_ffi_derive/tests/ui_fail/uninhabited_enum.stderr similarity index 100% rename from ffi/derive/tests/ui_fail/uninhabited_enum.stderr rename to crates/iroha_ffi_derive/tests/ui_fail/uninhabited_enum.stderr diff --git a/ffi/derive/tests/ui_pass/ffi_export_arg_pattern.rs b/crates/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 crates/iroha_ffi_derive/tests/ui_pass/ffi_export_arg_pattern.rs diff --git a/futures/Cargo.toml b/crates/iroha_futures/Cargo.toml similarity index 92% rename from futures/Cargo.toml rename to crates/iroha_futures/Cargo.toml index 7b295c6c75c..4e4bc86d882 100644 --- a/futures/Cargo.toml +++ b/crates/iroha_futures/Cargo.toml @@ -16,7 +16,7 @@ default = [] telemetry = ["iroha_futures_derive/telemetry"] [dependencies] -iroha_futures_derive = { path = "derive" } +iroha_futures_derive = { path = "../iroha_futures_derive" } iroha_config = { workspace = true } iroha_logger = { workspace = true } diff --git a/futures/src/lib.rs b/crates/iroha_futures/src/lib.rs similarity index 100% rename from futures/src/lib.rs rename to crates/iroha_futures/src/lib.rs diff --git a/futures/src/supervisor.rs b/crates/iroha_futures/src/supervisor.rs similarity index 100% rename from futures/src/supervisor.rs rename to crates/iroha_futures/src/supervisor.rs diff --git a/futures/tests/basic.rs b/crates/iroha_futures/tests/basic.rs similarity index 100% rename from futures/tests/basic.rs rename to crates/iroha_futures/tests/basic.rs diff --git a/futures/derive/Cargo.toml b/crates/iroha_futures_derive/Cargo.toml similarity index 100% rename from futures/derive/Cargo.toml rename to crates/iroha_futures_derive/Cargo.toml diff --git a/futures/derive/src/lib.rs b/crates/iroha_futures_derive/src/lib.rs similarity index 97% rename from futures/derive/src/lib.rs rename to crates/iroha_futures_derive/src/lib.rs index 924f0ce1787..4e4f3e1e087 100644 --- a/futures/derive/src/lib.rs +++ b/crates/iroha_futures_derive/src/lib.rs @@ -1,4 +1,5 @@ -//! Crate with derive macros for futures +//! Crate with derive macros for `iroha_futures` + use iroha_macro_utils::Emitter; use manyhow::{emit, manyhow}; use proc_macro2::TokenStream; diff --git a/genesis/Cargo.toml b/crates/iroha_genesis/Cargo.toml similarity index 93% rename from genesis/Cargo.toml rename to crates/iroha_genesis/Cargo.toml index 8c44afb5501..b7085ee7ec4 100644 --- a/genesis/Cargo.toml +++ b/crates/iroha_genesis/Cargo.toml @@ -24,4 +24,4 @@ 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/crates/iroha_genesis/src/lib.rs similarity index 99% rename from genesis/src/lib.rs rename to crates/iroha_genesis/src/lib.rs index 99586d650c9..db891b3dee3 100644 --- a/genesis/src/lib.rs +++ b/crates/iroha_genesis/src/lib.rs @@ -392,7 +392,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/tools/kagami/Cargo.toml b/crates/iroha_kagami/Cargo.toml similarity index 81% rename from tools/kagami/Cargo.toml rename to crates/iroha_kagami/Cargo.toml index 5af39ba2572..760f8146041 100644 --- a/tools/kagami/Cargo.toml +++ b/crates/iroha_kagami/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "kagami" # Translates to teacher, the exemplar, the looking glass. +name = "iroha_kagami" # Translates to teacher, the exemplar, the looking glass. edition.workspace = true version.workspace = true @@ -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"] } @@ -28,3 +28,7 @@ color-eyre.workspace = true serde_json.workspace = true derive_more.workspace = true parity-scale-codec.workspace = true + +[[bin]] +name = "kagami" +path = "src/main.rs" diff --git a/tools/kagami/README.md b/crates/iroha_kagami/README.md similarity index 100% rename from tools/kagami/README.md rename to crates/iroha_kagami/README.md diff --git a/tools/kagami/src/crypto.rs b/crates/iroha_kagami/src/crypto.rs similarity index 100% rename from tools/kagami/src/crypto.rs rename to crates/iroha_kagami/src/crypto.rs diff --git a/tools/kagami/src/genesis.rs b/crates/iroha_kagami/src/genesis.rs similarity index 100% rename from tools/kagami/src/genesis.rs rename to crates/iroha_kagami/src/genesis.rs diff --git a/tools/kagami/src/genesis/generate.rs b/crates/iroha_kagami/src/genesis/generate.rs similarity index 99% rename from tools/kagami/src/genesis/generate.rs rename to crates/iroha_kagami/src/genesis/generate.rs index d4fd4129222..3bc572f78b7 100644 --- a/tools/kagami/src/genesis/generate.rs +++ b/crates/iroha_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/crates/iroha_kagami/src/genesis/sign.rs similarity index 100% rename from tools/kagami/src/genesis/sign.rs rename to crates/iroha_kagami/src/genesis/sign.rs diff --git a/tools/kagami/src/main.rs b/crates/iroha_kagami/src/main.rs similarity index 100% rename from tools/kagami/src/main.rs rename to crates/iroha_kagami/src/main.rs diff --git a/tools/kagami/src/schema.rs b/crates/iroha_kagami/src/schema.rs similarity index 100% rename from tools/kagami/src/schema.rs rename to crates/iroha_kagami/src/schema.rs diff --git a/logger/Cargo.toml b/crates/iroha_logger/Cargo.toml similarity index 100% rename from logger/Cargo.toml rename to crates/iroha_logger/Cargo.toml diff --git a/logger/src/actor.rs b/crates/iroha_logger/src/actor.rs similarity index 100% rename from logger/src/actor.rs rename to crates/iroha_logger/src/actor.rs diff --git a/logger/src/layer.rs b/crates/iroha_logger/src/layer.rs similarity index 100% rename from logger/src/layer.rs rename to crates/iroha_logger/src/layer.rs diff --git a/logger/src/lib.rs b/crates/iroha_logger/src/lib.rs similarity index 100% rename from logger/src/lib.rs rename to crates/iroha_logger/src/lib.rs diff --git a/logger/src/telemetry.rs b/crates/iroha_logger/src/telemetry.rs similarity index 100% rename from logger/src/telemetry.rs rename to crates/iroha_logger/src/telemetry.rs diff --git a/logger/tests/configuration.rs b/crates/iroha_logger/tests/configuration.rs similarity index 100% rename from logger/tests/configuration.rs rename to crates/iroha_logger/tests/configuration.rs diff --git a/logger/tests/log_level.rs b/crates/iroha_logger/tests/log_level.rs similarity index 100% rename from logger/tests/log_level.rs rename to crates/iroha_logger/tests/log_level.rs diff --git a/logger/tests/setting_logger.rs b/crates/iroha_logger/tests/setting_logger.rs similarity index 100% rename from logger/tests/setting_logger.rs rename to crates/iroha_logger/tests/setting_logger.rs diff --git a/logger/tests/telemetry.rs b/crates/iroha_logger/tests/telemetry.rs similarity index 100% rename from logger/tests/telemetry.rs rename to crates/iroha_logger/tests/telemetry.rs diff --git a/macro/Cargo.toml b/crates/iroha_macro/Cargo.toml similarity index 92% rename from macro/Cargo.toml rename to crates/iroha_macro/Cargo.toml index 2c184b9f378..a53f0bc8672 100644 --- a/macro/Cargo.toml +++ b/crates/iroha_macro/Cargo.toml @@ -22,4 +22,4 @@ default = ["std"] std = [] [dependencies] -iroha_derive = { path = "derive" } +iroha_derive = { path = "../iroha_derive" } diff --git a/macro/README.md b/crates/iroha_macro/README.md similarity index 100% rename from macro/README.md rename to crates/iroha_macro/README.md diff --git a/macro/src/lib.rs b/crates/iroha_macro/src/lib.rs similarity index 99% rename from macro/src/lib.rs rename to crates/iroha_macro/src/lib.rs index edfab03f680..b4d4f621b46 100644 --- a/macro/src/lib.rs +++ b/crates/iroha_macro/src/lib.rs @@ -1,4 +1,5 @@ //! Crate containing Iroha macros + #![cfg_attr(not(feature = "std"), no_std)] pub use iroha_derive::*; diff --git a/macro/utils/Cargo.toml b/crates/iroha_macro_utils/Cargo.toml similarity index 100% rename from macro/utils/Cargo.toml rename to crates/iroha_macro_utils/Cargo.toml diff --git a/macro/utils/src/emitter.rs b/crates/iroha_macro_utils/src/emitter.rs similarity index 100% rename from macro/utils/src/emitter.rs rename to crates/iroha_macro_utils/src/emitter.rs diff --git a/macro/utils/src/lib.rs b/crates/iroha_macro_utils/src/lib.rs similarity index 100% rename from macro/utils/src/lib.rs rename to crates/iroha_macro_utils/src/lib.rs diff --git a/primitives/numeric/Cargo.toml b/crates/iroha_numeric/Cargo.toml similarity index 100% rename from primitives/numeric/Cargo.toml rename to crates/iroha_numeric/Cargo.toml diff --git a/primitives/numeric/src/lib.rs b/crates/iroha_numeric/src/lib.rs similarity index 100% rename from primitives/numeric/src/lib.rs rename to crates/iroha_numeric/src/lib.rs diff --git a/p2p/Cargo.toml b/crates/iroha_p2p/Cargo.toml similarity index 96% rename from p2p/Cargo.toml rename to crates/iroha_p2p/Cargo.toml index acd3b6c0b1c..6b80621f569 100644 --- a/p2p/Cargo.toml +++ b/crates/iroha_p2p/Cargo.toml @@ -39,4 +39,4 @@ bytes = { workspace = true } [dev-dependencies] iroha_config_base = { workspace = true } -test_network = { workspace = true } +iroha_test_network = { workspace = true } diff --git a/p2p/src/lib.rs b/crates/iroha_p2p/src/lib.rs similarity index 100% rename from p2p/src/lib.rs rename to crates/iroha_p2p/src/lib.rs diff --git a/p2p/src/network.rs b/crates/iroha_p2p/src/network.rs similarity index 100% rename from p2p/src/network.rs rename to crates/iroha_p2p/src/network.rs diff --git a/p2p/src/peer.rs b/crates/iroha_p2p/src/peer.rs similarity index 100% rename from p2p/src/peer.rs rename to crates/iroha_p2p/src/peer.rs diff --git a/p2p/tests/integration/mod.rs b/crates/iroha_p2p/tests/integration/mod.rs similarity index 100% rename from p2p/tests/integration/mod.rs rename to crates/iroha_p2p/tests/integration/mod.rs diff --git a/p2p/tests/integration/p2p.rs b/crates/iroha_p2p/tests/integration/p2p.rs similarity index 100% rename from p2p/tests/integration/p2p.rs rename to crates/iroha_p2p/tests/integration/p2p.rs diff --git a/p2p/tests/mod.rs b/crates/iroha_p2p/tests/mod.rs similarity index 100% rename from p2p/tests/mod.rs rename to crates/iroha_p2p/tests/mod.rs diff --git a/primitives/Cargo.toml b/crates/iroha_primitives/Cargo.toml similarity index 93% rename from primitives/Cargo.toml rename to crates/iroha_primitives/Cargo.toml index 9576da88f09..cea4f0efd2c 100644 --- a/primitives/Cargo.toml +++ b/crates/iroha_primitives/Cargo.toml @@ -27,12 +27,12 @@ std = ["iroha_macro/std", "thiserror", "displaydoc/std", "iroha_numeric/std", "p ffi_export = ["std", "iroha_ffi", "iroha_numeric/ffi_export"] [dependencies] -iroha_primitives_derive = { path = "derive" } +iroha_primitives_derive = { path = "../iroha_primitives_derive" } iroha_macro = { workspace = true } iroha_schema = { workspace = true } iroha_ffi = { workspace = true, optional = true } -iroha_numeric = { path = "./numeric", default-features = false } +iroha_numeric = { path = "../iroha_numeric", default-features = false } parity-scale-codec = { workspace = true, features = ["derive"] } derive_more = { workspace = true, features = ["display", "from", "as_ref", "as_mut", "deref", "constructor", "into_iterator"] } diff --git a/primitives/src/addr.rs b/crates/iroha_primitives/src/addr.rs similarity index 100% rename from primitives/src/addr.rs rename to crates/iroha_primitives/src/addr.rs diff --git a/primitives/src/cmpext.rs b/crates/iroha_primitives/src/cmpext.rs similarity index 100% rename from primitives/src/cmpext.rs rename to crates/iroha_primitives/src/cmpext.rs diff --git a/primitives/src/const_vec.rs b/crates/iroha_primitives/src/const_vec.rs similarity index 100% rename from primitives/src/const_vec.rs rename to crates/iroha_primitives/src/const_vec.rs diff --git a/primitives/src/conststr.rs b/crates/iroha_primitives/src/conststr.rs similarity index 100% rename from primitives/src/conststr.rs rename to crates/iroha_primitives/src/conststr.rs diff --git a/primitives/src/json.rs b/crates/iroha_primitives/src/json.rs similarity index 100% rename from primitives/src/json.rs rename to crates/iroha_primitives/src/json.rs diff --git a/primitives/src/lib.rs b/crates/iroha_primitives/src/lib.rs similarity index 100% rename from primitives/src/lib.rs rename to crates/iroha_primitives/src/lib.rs diff --git a/primitives/src/must_use.rs b/crates/iroha_primitives/src/must_use.rs similarity index 100% rename from primitives/src/must_use.rs rename to crates/iroha_primitives/src/must_use.rs diff --git a/primitives/src/numeric.rs b/crates/iroha_primitives/src/numeric.rs similarity index 100% rename from primitives/src/numeric.rs rename to crates/iroha_primitives/src/numeric.rs diff --git a/primitives/src/riffle_iter.rs b/crates/iroha_primitives/src/riffle_iter.rs similarity index 100% rename from primitives/src/riffle_iter.rs rename to crates/iroha_primitives/src/riffle_iter.rs diff --git a/primitives/src/small.rs b/crates/iroha_primitives/src/small.rs similarity index 100% rename from primitives/src/small.rs rename to crates/iroha_primitives/src/small.rs diff --git a/primitives/src/time.rs b/crates/iroha_primitives/src/time.rs similarity index 100% rename from primitives/src/time.rs rename to crates/iroha_primitives/src/time.rs diff --git a/primitives/src/unique_vec.rs b/crates/iroha_primitives/src/unique_vec.rs similarity index 100% rename from primitives/src/unique_vec.rs rename to crates/iroha_primitives/src/unique_vec.rs diff --git a/primitives/tests/ui.rs b/crates/iroha_primitives/tests/ui.rs similarity index 100% rename from primitives/tests/ui.rs rename to crates/iroha_primitives/tests/ui.rs diff --git a/primitives/tests/ui_fail/must_use_not_used.rs b/crates/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 crates/iroha_primitives/tests/ui_fail/must_use_not_used.rs diff --git a/primitives/tests/ui_fail/must_use_not_used.stderr b/crates/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 crates/iroha_primitives/tests/ui_fail/must_use_not_used.stderr diff --git a/primitives/derive/Cargo.toml b/crates/iroha_primitives_derive/Cargo.toml similarity index 74% rename from primitives/derive/Cargo.toml rename to crates/iroha_primitives_derive/Cargo.toml index d6e018172a7..b94e1675168 100644 --- a/primitives/derive/Cargo.toml +++ b/crates/iroha_primitives_derive/Cargo.toml @@ -15,8 +15,8 @@ quote = { workspace = true } syn = { workspace = true } manyhow = { workspace = true } proc-macro2 = { workspace = true } -iroha_numeric = { path = "../numeric", default-features = false } +iroha_numeric = { path = "../iroha_numeric", default-features = false } [dev-dependencies] # needed for doc-tests to pass -iroha_primitives = { path = ".." } +iroha_primitives = { path = "../iroha_primitives" } diff --git a/primitives/derive/src/lib.rs b/crates/iroha_primitives_derive/src/lib.rs similarity index 100% rename from primitives/derive/src/lib.rs rename to crates/iroha_primitives_derive/src/lib.rs diff --git a/primitives/derive/src/numeric.rs b/crates/iroha_primitives_derive/src/numeric.rs similarity index 100% rename from primitives/derive/src/numeric.rs rename to crates/iroha_primitives_derive/src/numeric.rs diff --git a/primitives/derive/src/socket_addr.rs b/crates/iroha_primitives_derive/src/socket_addr.rs similarity index 100% rename from primitives/derive/src/socket_addr.rs rename to crates/iroha_primitives_derive/src/socket_addr.rs diff --git a/schema/Cargo.toml b/crates/iroha_schema/Cargo.toml similarity index 88% rename from schema/Cargo.toml rename to crates/iroha_schema/Cargo.toml index 311d2ed4dc7..ebe7518703a 100644 --- a/schema/Cargo.toml +++ b/crates/iroha_schema/Cargo.toml @@ -11,7 +11,7 @@ license.workspace = true workspace = true [dependencies] -iroha_schema_derive = { path = "derive" } +iroha_schema_derive = { path = "../iroha_schema_derive" } serde = { workspace = true, features = ["derive", "alloc"] } diff --git a/schema/src/lib.rs b/crates/iroha_schema/src/lib.rs similarity index 100% rename from schema/src/lib.rs rename to crates/iroha_schema/src/lib.rs diff --git a/schema/src/serialize.rs b/crates/iroha_schema/src/serialize.rs similarity index 100% rename from schema/src/serialize.rs rename to crates/iroha_schema/src/serialize.rs diff --git a/schema/tests/architecture-dependent.rs b/crates/iroha_schema/tests/architecture-dependent.rs similarity index 100% rename from schema/tests/architecture-dependent.rs rename to crates/iroha_schema/tests/architecture-dependent.rs diff --git a/schema/tests/enum_with_default_discriminants.rs b/crates/iroha_schema/tests/enum_with_default_discriminants.rs similarity index 100% rename from schema/tests/enum_with_default_discriminants.rs rename to crates/iroha_schema/tests/enum_with_default_discriminants.rs diff --git a/schema/tests/enum_with_various_discriminants.rs b/crates/iroha_schema/tests/enum_with_various_discriminants.rs similarity index 100% rename from schema/tests/enum_with_various_discriminants.rs rename to crates/iroha_schema/tests/enum_with_various_discriminants.rs diff --git a/schema/tests/fieldless_enum.rs b/crates/iroha_schema/tests/fieldless_enum.rs similarity index 100% rename from schema/tests/fieldless_enum.rs rename to crates/iroha_schema/tests/fieldless_enum.rs diff --git a/schema/tests/numbers_compact_and_fixed.rs b/crates/iroha_schema/tests/numbers_compact_and_fixed.rs similarity index 100% rename from schema/tests/numbers_compact_and_fixed.rs rename to crates/iroha_schema/tests/numbers_compact_and_fixed.rs diff --git a/schema/tests/schema_json.rs b/crates/iroha_schema/tests/schema_json.rs similarity index 100% rename from schema/tests/schema_json.rs rename to crates/iroha_schema/tests/schema_json.rs diff --git a/schema/tests/struct_with_generic_bounds.rs b/crates/iroha_schema/tests/struct_with_generic_bounds.rs similarity index 100% rename from schema/tests/struct_with_generic_bounds.rs rename to crates/iroha_schema/tests/struct_with_generic_bounds.rs diff --git a/schema/tests/struct_with_named_fields.rs b/crates/iroha_schema/tests/struct_with_named_fields.rs similarity index 100% rename from schema/tests/struct_with_named_fields.rs rename to crates/iroha_schema/tests/struct_with_named_fields.rs diff --git a/schema/tests/struct_with_unnamed_fields.rs b/crates/iroha_schema/tests/struct_with_unnamed_fields.rs similarity index 100% rename from schema/tests/struct_with_unnamed_fields.rs rename to crates/iroha_schema/tests/struct_with_unnamed_fields.rs diff --git a/schema/tests/transparent_types.rs b/crates/iroha_schema/tests/transparent_types.rs similarity index 100% rename from schema/tests/transparent_types.rs rename to crates/iroha_schema/tests/transparent_types.rs diff --git a/schema/derive/Cargo.toml b/crates/iroha_schema_derive/Cargo.toml similarity index 100% rename from schema/derive/Cargo.toml rename to crates/iroha_schema_derive/Cargo.toml diff --git a/schema/derive/src/lib.rs b/crates/iroha_schema_derive/src/lib.rs similarity index 100% rename from schema/derive/src/lib.rs rename to crates/iroha_schema_derive/src/lib.rs diff --git a/schema/derive/tests/ui.rs b/crates/iroha_schema_derive/tests/ui.rs similarity index 100% rename from schema/derive/tests/ui.rs rename to crates/iroha_schema_derive/tests/ui.rs diff --git a/schema/derive/tests/ui_fail/fieldless_enum_with_explicit_discriminant.rs b/crates/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 crates/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/crates/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 crates/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/crates/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 crates/iroha_schema_derive/tests/ui_pass/derive_into_schema.rs diff --git a/schema/gen/Cargo.toml b/crates/iroha_schema_gen/Cargo.toml similarity index 100% rename from schema/gen/Cargo.toml rename to crates/iroha_schema_gen/Cargo.toml diff --git a/schema/gen/src/lib.rs b/crates/iroha_schema_gen/src/lib.rs similarity index 100% rename from schema/gen/src/lib.rs rename to crates/iroha_schema_gen/src/lib.rs diff --git a/smart_contract/.cargo/config.toml b/crates/iroha_smart_contract/.cargo/config.toml similarity index 100% rename from smart_contract/.cargo/config.toml rename to crates/iroha_smart_contract/.cargo/config.toml diff --git a/smart_contract/Cargo.toml b/crates/iroha_smart_contract/Cargo.toml similarity index 85% rename from smart_contract/Cargo.toml rename to crates/iroha_smart_contract/Cargo.toml index b523479c2c5..4b2220c2e75 100644 --- a/smart_contract/Cargo.toml +++ b/crates/iroha_smart_contract/Cargo.toml @@ -15,7 +15,7 @@ workspace = true debug = ["iroha_smart_contract_utils/debug"] [dependencies] -iroha_smart_contract_derive = { path = "derive" } +iroha_smart_contract_derive = { path = "../iroha_smart_contract_derive" } iroha_macro.workspace = true iroha_data_model.workspace = true @@ -29,7 +29,7 @@ displaydoc.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 diff --git a/smart_contract/LICENSE b/crates/iroha_smart_contract/LICENSE similarity index 100% rename from smart_contract/LICENSE rename to crates/iroha_smart_contract/LICENSE diff --git a/smart_contract/README.md b/crates/iroha_smart_contract/README.md similarity index 98% rename from smart_contract/README.md rename to crates/iroha_smart_contract/README.md index 5231e044444..827c53fe526 100644 --- a/smart_contract/README.md +++ b/crates/iroha_smart_contract/README.md @@ -11,7 +11,7 @@ Check the [WASM section of our tutorial](https://hyperledger.github.io/iroha-2-d To be able to run tests compiled for `wasm32-unknown-unknown` target install `iroha_wasm_test_runner` from the root of the Iroha repository: ```bash -cargo install --path tools/wasm_test_runner +cargo install --path crates/iroha_wasm_test_runner ``` Then run tests: diff --git a/smart_contract/src/lib.rs b/crates/iroha_smart_contract/src/lib.rs similarity index 100% rename from smart_contract/src/lib.rs rename to crates/iroha_smart_contract/src/lib.rs diff --git a/smart_contract/derive/Cargo.toml b/crates/iroha_smart_contract_derive/Cargo.toml similarity index 100% rename from smart_contract/derive/Cargo.toml rename to crates/iroha_smart_contract_derive/Cargo.toml diff --git a/smart_contract/derive/src/entrypoint.rs b/crates/iroha_smart_contract_derive/src/entrypoint.rs similarity index 100% rename from smart_contract/derive/src/entrypoint.rs rename to crates/iroha_smart_contract_derive/src/entrypoint.rs diff --git a/smart_contract/derive/src/lib.rs b/crates/iroha_smart_contract_derive/src/lib.rs similarity index 100% rename from smart_contract/derive/src/lib.rs rename to crates/iroha_smart_contract_derive/src/lib.rs diff --git a/smart_contract/utils/Cargo.toml b/crates/iroha_smart_contract_utils/Cargo.toml similarity index 100% rename from smart_contract/utils/Cargo.toml rename to crates/iroha_smart_contract_utils/Cargo.toml diff --git a/smart_contract/utils/src/debug.rs b/crates/iroha_smart_contract_utils/src/debug.rs similarity index 100% rename from smart_contract/utils/src/debug.rs rename to crates/iroha_smart_contract_utils/src/debug.rs diff --git a/smart_contract/utils/src/lib.rs b/crates/iroha_smart_contract_utils/src/lib.rs similarity index 100% rename from smart_contract/utils/src/lib.rs rename to crates/iroha_smart_contract_utils/src/lib.rs diff --git a/smart_contract/utils/src/log.rs b/crates/iroha_smart_contract_utils/src/log.rs similarity index 100% rename from smart_contract/utils/src/log.rs rename to crates/iroha_smart_contract_utils/src/log.rs diff --git a/tools/swarm/Cargo.toml b/crates/iroha_swarm/Cargo.toml similarity index 94% rename from tools/swarm/Cargo.toml rename to crates/iroha_swarm/Cargo.toml index 6a961933a71..92f47d97e0b 100644 --- a/tools/swarm/Cargo.toml +++ b/crates/iroha_swarm/Cargo.toml @@ -29,7 +29,3 @@ serde_json.workspace = true iroha_config.workspace = true expect-test.workspace = true nonzero_ext.workspace = true - -[[bin]] -name = "iroha_swarm" -path = "src/bin/cli.rs" \ No newline at end of file diff --git a/tools/swarm/README.md b/crates/iroha_swarm/README.md similarity index 100% rename from tools/swarm/README.md rename to crates/iroha_swarm/README.md diff --git a/tools/swarm/src/lib.rs b/crates/iroha_swarm/src/lib.rs similarity index 100% rename from tools/swarm/src/lib.rs rename to crates/iroha_swarm/src/lib.rs diff --git a/tools/swarm/src/bin/cli.rs b/crates/iroha_swarm/src/main.rs similarity index 100% rename from tools/swarm/src/bin/cli.rs rename to crates/iroha_swarm/src/main.rs diff --git a/tools/swarm/src/path.rs b/crates/iroha_swarm/src/path.rs similarity index 100% rename from tools/swarm/src/path.rs rename to crates/iroha_swarm/src/path.rs diff --git a/tools/swarm/src/peer.rs b/crates/iroha_swarm/src/peer.rs similarity index 100% rename from tools/swarm/src/peer.rs rename to crates/iroha_swarm/src/peer.rs diff --git a/tools/swarm/src/schema.rs b/crates/iroha_swarm/src/schema.rs similarity index 100% rename from tools/swarm/src/schema.rs rename to crates/iroha_swarm/src/schema.rs diff --git a/tools/swarm/src/schema/serde_impls.rs b/crates/iroha_swarm/src/schema/serde_impls.rs similarity index 100% rename from tools/swarm/src/schema/serde_impls.rs rename to crates/iroha_swarm/src/schema/serde_impls.rs diff --git a/telemetry/Cargo.toml b/crates/iroha_telemetry/Cargo.toml similarity index 95% rename from telemetry/Cargo.toml rename to crates/iroha_telemetry/Cargo.toml index f5b99948193..0688b839cf7 100644 --- a/telemetry/Cargo.toml +++ b/crates/iroha_telemetry/Cargo.toml @@ -18,7 +18,7 @@ dev-telemetry = [] metric-instrumentation = [] [dependencies] -iroha_telemetry_derive = { path = "derive" } +iroha_telemetry_derive = { path = "../iroha_telemetry_derive" } iroha_config = { workspace = true } iroha_logger = { workspace = true } diff --git a/telemetry/build.rs b/crates/iroha_telemetry/build.rs similarity index 100% rename from telemetry/build.rs rename to crates/iroha_telemetry/build.rs diff --git a/telemetry/src/dev.rs b/crates/iroha_telemetry/src/dev.rs similarity index 100% rename from telemetry/src/dev.rs rename to crates/iroha_telemetry/src/dev.rs diff --git a/telemetry/src/futures.rs b/crates/iroha_telemetry/src/futures.rs similarity index 100% rename from telemetry/src/futures.rs rename to crates/iroha_telemetry/src/futures.rs diff --git a/telemetry/src/lib.rs b/crates/iroha_telemetry/src/lib.rs similarity index 100% rename from telemetry/src/lib.rs rename to crates/iroha_telemetry/src/lib.rs diff --git a/telemetry/src/metrics.rs b/crates/iroha_telemetry/src/metrics.rs similarity index 100% rename from telemetry/src/metrics.rs rename to crates/iroha_telemetry/src/metrics.rs diff --git a/telemetry/src/retry_period.rs b/crates/iroha_telemetry/src/retry_period.rs similarity index 100% rename from telemetry/src/retry_period.rs rename to crates/iroha_telemetry/src/retry_period.rs diff --git a/telemetry/src/ws.rs b/crates/iroha_telemetry/src/ws.rs similarity index 100% rename from telemetry/src/ws.rs rename to crates/iroha_telemetry/src/ws.rs diff --git a/telemetry/derive/Cargo.toml b/crates/iroha_telemetry_derive/Cargo.toml similarity index 100% rename from telemetry/derive/Cargo.toml rename to crates/iroha_telemetry_derive/Cargo.toml diff --git a/telemetry/derive/src/lib.rs b/crates/iroha_telemetry_derive/src/lib.rs similarity index 100% rename from telemetry/derive/src/lib.rs rename to crates/iroha_telemetry_derive/src/lib.rs diff --git a/telemetry/derive/tests/ui.rs b/crates/iroha_telemetry_derive/tests/ui.rs similarity index 100% rename from telemetry/derive/tests/ui.rs rename to crates/iroha_telemetry_derive/tests/ui.rs diff --git a/telemetry/derive/tests/ui_fail/args_no_wsv.rs b/crates/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 crates/iroha_telemetry_derive/tests/ui_fail/args_no_wsv.rs diff --git a/telemetry/derive/tests/ui_fail/args_no_wsv.stderr b/crates/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 crates/iroha_telemetry_derive/tests/ui_fail/args_no_wsv.stderr diff --git a/telemetry/derive/tests/ui_fail/bare_spec.rs b/crates/iroha_telemetry_derive/tests/ui_fail/bare_spec.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/bare_spec.rs rename to crates/iroha_telemetry_derive/tests/ui_fail/bare_spec.rs diff --git a/telemetry/derive/tests/ui_fail/bare_spec.stderr b/crates/iroha_telemetry_derive/tests/ui_fail/bare_spec.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/bare_spec.stderr rename to crates/iroha_telemetry_derive/tests/ui_fail/bare_spec.stderr diff --git a/telemetry/derive/tests/ui_fail/doubled_plus.rs b/crates/iroha_telemetry_derive/tests/ui_fail/doubled_plus.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/doubled_plus.rs rename to crates/iroha_telemetry_derive/tests/ui_fail/doubled_plus.rs diff --git a/telemetry/derive/tests/ui_fail/doubled_plus.stderr b/crates/iroha_telemetry_derive/tests/ui_fail/doubled_plus.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/doubled_plus.stderr rename to crates/iroha_telemetry_derive/tests/ui_fail/doubled_plus.stderr diff --git a/telemetry/derive/tests/ui_fail/no_args.rs b/crates/iroha_telemetry_derive/tests/ui_fail/no_args.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/no_args.rs rename to crates/iroha_telemetry_derive/tests/ui_fail/no_args.rs diff --git a/telemetry/derive/tests/ui_fail/no_args.stderr b/crates/iroha_telemetry_derive/tests/ui_fail/no_args.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/no_args.stderr rename to crates/iroha_telemetry_derive/tests/ui_fail/no_args.stderr diff --git a/telemetry/derive/tests/ui_fail/non_snake_case_name.rs b/crates/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 crates/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/crates/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 crates/iroha_telemetry_derive/tests/ui_fail/non_snake_case_name.stderr diff --git a/telemetry/derive/tests/ui_fail/not_execute.rs b/crates/iroha_telemetry_derive/tests/ui_fail/not_execute.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/not_execute.rs rename to crates/iroha_telemetry_derive/tests/ui_fail/not_execute.rs diff --git a/telemetry/derive/tests/ui_fail/not_execute.stderr b/crates/iroha_telemetry_derive/tests/ui_fail/not_execute.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/not_execute.stderr rename to crates/iroha_telemetry_derive/tests/ui_fail/not_execute.stderr diff --git a/telemetry/derive/tests/ui_fail/not_return_result.rs b/crates/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 crates/iroha_telemetry_derive/tests/ui_fail/not_return_result.rs diff --git a/telemetry/derive/tests/ui_fail/not_return_result.stderr b/crates/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 crates/iroha_telemetry_derive/tests/ui_fail/not_return_result.stderr diff --git a/telemetry/derive/tests/ui_fail/return_nothing.rs b/crates/iroha_telemetry_derive/tests/ui_fail/return_nothing.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/return_nothing.rs rename to crates/iroha_telemetry_derive/tests/ui_fail/return_nothing.rs diff --git a/telemetry/derive/tests/ui_fail/return_nothing.stderr b/crates/iroha_telemetry_derive/tests/ui_fail/return_nothing.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/return_nothing.stderr rename to crates/iroha_telemetry_derive/tests/ui_fail/return_nothing.stderr diff --git a/telemetry/derive/tests/ui_fail/trailing_plus.rs b/crates/iroha_telemetry_derive/tests/ui_fail/trailing_plus.rs similarity index 100% rename from telemetry/derive/tests/ui_fail/trailing_plus.rs rename to crates/iroha_telemetry_derive/tests/ui_fail/trailing_plus.rs diff --git a/telemetry/derive/tests/ui_fail/trailing_plus.stderr b/crates/iroha_telemetry_derive/tests/ui_fail/trailing_plus.stderr similarity index 100% rename from telemetry/derive/tests/ui_fail/trailing_plus.stderr rename to crates/iroha_telemetry_derive/tests/ui_fail/trailing_plus.stderr diff --git a/core/test_network/Cargo.toml b/crates/iroha_test_network/Cargo.toml similarity index 92% rename from core/test_network/Cargo.toml rename to crates/iroha_test_network/Cargo.toml index 1d80086abfe..b321d1df94a 100644 --- a/core/test_network/Cargo.toml +++ b/crates/iroha_test_network/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "test_network" +name = "iroha_test_network" edition.workspace = true version.workspace = true @@ -21,7 +21,7 @@ iroha_logger.workspace = true iroha_genesis.workspace = true iroha_futures.workspace = true iroha_wasm_builder.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/crates/iroha_test_network/src/lib.rs similarity index 99% rename from core/test_network/src/lib.rs rename to crates/iroha_test_network/src/lib.rs index 7bf8ccf6b45..3720fbc621b 100644 --- a/core/test_network/src/lib.rs +++ b/crates/iroha_test_network/src/lib.rs @@ -27,10 +27,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, thread_rng}; use tempfile::TempDir; -use test_samples::{ALICE_ID, ALICE_KEYPAIR, PEER_KEYPAIR, SAMPLE_GENESIS_ACCOUNT_KEYPAIR}; use tokio::{ runtime::{self, Runtime}, time, diff --git a/test_samples/Cargo.toml b/crates/iroha_test_samples/Cargo.toml similarity index 95% rename from test_samples/Cargo.toml rename to crates/iroha_test_samples/Cargo.toml index b24c95e4ebb..90e1d4c9506 100644 --- a/test_samples/Cargo.toml +++ b/crates/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 diff --git a/test_samples/src/lib.rs b/crates/iroha_test_samples/src/lib.rs similarity index 100% rename from test_samples/src/lib.rs rename to crates/iroha_test_samples/src/lib.rs diff --git a/torii/Cargo.toml b/crates/iroha_torii/Cargo.toml similarity index 100% rename from torii/Cargo.toml rename to crates/iroha_torii/Cargo.toml diff --git a/torii/src/event.rs b/crates/iroha_torii/src/event.rs similarity index 100% rename from torii/src/event.rs rename to crates/iroha_torii/src/event.rs diff --git a/torii/src/lib.rs b/crates/iroha_torii/src/lib.rs similarity index 100% rename from torii/src/lib.rs rename to crates/iroha_torii/src/lib.rs diff --git a/torii/src/routing.rs b/crates/iroha_torii/src/routing.rs similarity index 100% rename from torii/src/routing.rs rename to crates/iroha_torii/src/routing.rs diff --git a/torii/src/stream.rs b/crates/iroha_torii/src/stream.rs similarity index 100% rename from torii/src/stream.rs rename to crates/iroha_torii/src/stream.rs diff --git a/torii/src/utils.rs b/crates/iroha_torii/src/utils.rs similarity index 100% rename from torii/src/utils.rs rename to crates/iroha_torii/src/utils.rs diff --git a/torii/const/Cargo.toml b/crates/iroha_torii_const/Cargo.toml similarity index 100% rename from torii/const/Cargo.toml rename to crates/iroha_torii_const/Cargo.toml diff --git a/torii/const/src/lib.rs b/crates/iroha_torii_const/src/lib.rs similarity index 100% rename from torii/const/src/lib.rs rename to crates/iroha_torii_const/src/lib.rs diff --git a/smart_contract/trigger/Cargo.toml b/crates/iroha_trigger/Cargo.toml similarity index 86% rename from smart_contract/trigger/Cargo.toml rename to crates/iroha_trigger/Cargo.toml index 090468d1855..4eefb12e7ab 100644 --- a/smart_contract/trigger/Cargo.toml +++ b/crates/iroha_trigger/Cargo.toml @@ -14,7 +14,7 @@ workspace = true debug = ["iroha_smart_contract/debug"] [dependencies] -iroha_trigger_derive = { path = "derive" } +iroha_trigger_derive = { path = "../iroha_trigger_derive" } iroha_smart_contract_utils.workspace = true iroha_smart_contract.workspace = true diff --git a/smart_contract/trigger/src/lib.rs b/crates/iroha_trigger/src/lib.rs similarity index 100% rename from smart_contract/trigger/src/lib.rs rename to crates/iroha_trigger/src/lib.rs diff --git a/smart_contract/trigger/derive/Cargo.toml b/crates/iroha_trigger_derive/Cargo.toml similarity index 100% rename from smart_contract/trigger/derive/Cargo.toml rename to crates/iroha_trigger_derive/Cargo.toml diff --git a/smart_contract/trigger/derive/src/entrypoint.rs b/crates/iroha_trigger_derive/src/entrypoint.rs similarity index 100% rename from smart_contract/trigger/derive/src/entrypoint.rs rename to crates/iroha_trigger_derive/src/entrypoint.rs diff --git a/smart_contract/trigger/derive/src/lib.rs b/crates/iroha_trigger_derive/src/lib.rs similarity index 100% rename from smart_contract/trigger/derive/src/lib.rs rename to crates/iroha_trigger_derive/src/lib.rs diff --git a/version/Cargo.toml b/crates/iroha_version/Cargo.toml similarity index 91% rename from version/Cargo.toml rename to crates/iroha_version/Cargo.toml index 7dbb74aef92..dd7d322b94e 100644 --- a/version/Cargo.toml +++ b/crates/iroha_version/Cargo.toml @@ -23,7 +23,7 @@ scale = ["parity-scale-codec/full"] json = ["serde", "serde_json"] [dependencies] -iroha_version_derive = { path = "derive", default-features = false, optional = true } +iroha_version_derive = { path = "../iroha_version_derive", default-features = false, optional = true } iroha_macro = { workspace = true } diff --git a/version/src/lib.rs b/crates/iroha_version/src/lib.rs similarity index 100% rename from version/src/lib.rs rename to crates/iroha_version/src/lib.rs diff --git a/version/derive/Cargo.toml b/crates/iroha_version_derive/Cargo.toml similarity index 100% rename from version/derive/Cargo.toml rename to crates/iroha_version_derive/Cargo.toml diff --git a/version/derive/src/lib.rs b/crates/iroha_version_derive/src/lib.rs similarity index 100% rename from version/derive/src/lib.rs rename to crates/iroha_version_derive/src/lib.rs diff --git a/version/derive/tests/json.rs b/crates/iroha_version_derive/tests/json.rs similarity index 100% rename from version/derive/tests/json.rs rename to crates/iroha_version_derive/tests/json.rs diff --git a/version/derive/tests/scale.rs b/crates/iroha_version_derive/tests/scale.rs similarity index 100% rename from version/derive/tests/scale.rs rename to crates/iroha_version_derive/tests/scale.rs diff --git a/version/derive/tests/ui.rs b/crates/iroha_version_derive/tests/ui.rs similarity index 100% rename from version/derive/tests/ui.rs rename to crates/iroha_version_derive/tests/ui.rs diff --git a/version/derive/tests/ui_fail/field_missing_in_version_attribute.rs b/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/iroha_version_derive/tests/ui_fail/invalid_range_equal.rs diff --git a/version/derive/tests/ui_fail/invalid_range_equal.stderr b/crates/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 crates/iroha_version_derive/tests/ui_fail/invalid_range_equal.stderr diff --git a/version/derive/tests/ui_fail/invalid_range_less.rs b/crates/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 crates/iroha_version_derive/tests/ui_fail/invalid_range_less.rs diff --git a/version/derive/tests/ui_fail/invalid_range_less.stderr b/crates/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 crates/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/crates/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 crates/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/crates/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 crates/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/crates/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 crates/iroha_version_derive/tests/ui_pass/declare_several_versioned.rs diff --git a/version/derive/tests/ui_pass/declare_versioned.rs b/crates/iroha_version_derive/tests/ui_pass/declare_versioned.rs similarity index 100% rename from version/derive/tests/ui_pass/declare_versioned.rs rename to crates/iroha_version_derive/tests/ui_pass/declare_versioned.rs diff --git a/version/derive/tests/ui_pass/declare_versioned_json.rs b/crates/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 crates/iroha_version_derive/tests/ui_pass/declare_versioned_json.rs diff --git a/version/derive/tests/ui_pass/declare_versioned_scale.rs b/crates/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 crates/iroha_version_derive/tests/ui_pass/declare_versioned_scale.rs diff --git a/wasm_builder/Cargo.toml b/crates/iroha_wasm_builder/Cargo.toml similarity index 66% rename from wasm_builder/Cargo.toml rename to crates/iroha_wasm_builder/Cargo.toml index 90d70c615a5..990a2ff8a95 100644 --- a/wasm_builder/Cargo.toml +++ b/crates/iroha_wasm_builder/Cargo.toml @@ -17,3 +17,8 @@ serde_json = { workspace = true, features = ["std"] } sha256 = "1.5.0" path-absolutize = { workspace = true } wasm-opt = "0.116.1" + +clap = { workspace = true, features = ["derive"] } +color-eyre.workspace = true +spinoff = { workspace = true, features = ["binary"] } +owo-colors = { workspace = true, features = ["supports-colors"] } diff --git a/tools/wasm_builder_cli/README.md b/crates/iroha_wasm_builder/README.md similarity index 100% rename from tools/wasm_builder_cli/README.md rename to crates/iroha_wasm_builder/README.md diff --git a/wasm_builder/src/lib.rs b/crates/iroha_wasm_builder/src/lib.rs similarity index 100% rename from wasm_builder/src/lib.rs rename to crates/iroha_wasm_builder/src/lib.rs diff --git a/tools/wasm_builder_cli/src/main.rs b/crates/iroha_wasm_builder/src/main.rs similarity index 100% rename from tools/wasm_builder_cli/src/main.rs rename to crates/iroha_wasm_builder/src/main.rs diff --git a/wasm_codec/Cargo.toml b/crates/iroha_wasm_codec/Cargo.toml similarity index 82% rename from wasm_codec/Cargo.toml rename to crates/iroha_wasm_codec/Cargo.toml index 3757265e021..b7bd7054e82 100644 --- a/wasm_codec/Cargo.toml +++ b/crates/iroha_wasm_codec/Cargo.toml @@ -10,7 +10,7 @@ license.workspace = true workspace = true [dependencies] -iroha_core_wasm_codec_derive = { path = "derive" } +iroha_wasm_codec_derive = { path = "../iroha_wasm_codec_derive" } thiserror = { workspace = true } wasmtime = { workspace = true } diff --git a/wasm_codec/src/lib.rs b/crates/iroha_wasm_codec/src/lib.rs similarity index 98% rename from wasm_codec/src/lib.rs rename to crates/iroha_wasm_codec/src/lib.rs index 3e80ad3e64c..613b049a5d8 100644 --- a/wasm_codec/src/lib.rs +++ b/crates/iroha_wasm_codec/src/lib.rs @@ -1,6 +1,6 @@ //! This crate provides utils for encoding/decoding objects between Iroha host and Wasm smart contracts. -pub use iroha_core_wasm_codec_derive::{wrap, wrap_trait_fn}; +pub use iroha_wasm_codec_derive::{wrap, wrap_trait_fn}; use parity_scale_codec::{DecodeAll, Encode, Error as ParityError}; use wasmtime::Result; diff --git a/wasm_codec/derive/Cargo.toml b/crates/iroha_wasm_codec_derive/Cargo.toml similarity index 89% rename from wasm_codec/derive/Cargo.toml rename to crates/iroha_wasm_codec_derive/Cargo.toml index 700448e0124..efa245bc6d3 100644 --- a/wasm_codec/derive/Cargo.toml +++ b/crates/iroha_wasm_codec_derive/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "iroha_core_wasm_codec_derive" +name = "iroha_wasm_codec_derive" edition.workspace = true version.workspace = true authors.workspace = true diff --git a/wasm_codec/derive/src/lib.rs b/crates/iroha_wasm_codec_derive/src/lib.rs similarity index 100% rename from wasm_codec/derive/src/lib.rs rename to crates/iroha_wasm_codec_derive/src/lib.rs diff --git a/tools/wasm_test_runner/Cargo.toml b/crates/iroha_wasm_test_runner/Cargo.toml similarity index 100% rename from tools/wasm_test_runner/Cargo.toml rename to crates/iroha_wasm_test_runner/Cargo.toml diff --git a/tools/wasm_test_runner/src/main.rs b/crates/iroha_wasm_test_runner/src/main.rs similarity index 100% rename from tools/wasm_test_runner/src/main.rs rename to crates/iroha_wasm_test_runner/src/main.rs diff --git a/cli/Cargo.toml b/crates/irohad/Cargo.toml similarity index 100% rename from cli/Cargo.toml rename to crates/irohad/Cargo.toml diff --git a/cli/README.md b/crates/irohad/README.md similarity index 93% rename from cli/README.md rename to crates/irohad/README.md index 25e4d44793e..7a6c37aa96c 100644 --- a/cli/README.md +++ b/crates/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`](../iroha_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`](../iroha_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`](../defaults/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`](../../defaults/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/crates/irohad/build.rs similarity index 100% rename from cli/build.rs rename to crates/irohad/build.rs diff --git a/cli/src/lib.rs b/crates/irohad/src/lib.rs similarity index 100% rename from cli/src/lib.rs rename to crates/irohad/src/lib.rs diff --git a/cli/src/main.rs b/crates/irohad/src/main.rs similarity index 100% rename from cli/src/main.rs rename to crates/irohad/src/main.rs diff --git a/cli/src/samples.rs b/crates/irohad/src/samples.rs similarity index 100% rename from cli/src/samples.rs rename to crates/irohad/src/samples.rs diff --git a/tools/kura_inspector/Cargo.toml b/crates/kura_inspector/Cargo.toml similarity index 100% rename from tools/kura_inspector/Cargo.toml rename to crates/kura_inspector/Cargo.toml diff --git a/tools/kura_inspector/README.md b/crates/kura_inspector/README.md similarity index 100% rename from tools/kura_inspector/README.md rename to crates/kura_inspector/README.md diff --git a/tools/kura_inspector/src/main.rs b/crates/kura_inspector/src/main.rs similarity index 100% rename from tools/kura_inspector/src/main.rs rename to crates/kura_inspector/src/main.rs diff --git a/docs/README.md b/docs/README.md index bf1c924a7ec..df5a39ae82f 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](../crates/iroha_kagami/README.md) +- [Kura Inspector](../crates/kura_inspector/README.md) +- [Parity Scale Decoder Tool](../crates/iroha_codec/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](../crates/iroha/benches/tps/README.md) diff --git a/flake.nix b/flake.nix index 7136e93ffcc..74d15a02cd7 100755 --- a/flake.nix +++ b/flake.nix @@ -49,7 +49,7 @@ "iroha" "kagami" "kura_inspector" - "parity_scale_cli" + "iroha_codec" ]; # HACK: A hook to filter out darwin-specific flags when cross-compiling. diff --git a/hooks/pre-commit.sample b/hooks/pre-commit.sample index 8b658a5cd91..040fa2c3f79 100755 --- a/hooks/pre-commit.sample +++ b/hooks/pre-commit.sample @@ -11,7 +11,7 @@ cargo fmt --all -- --check cd - # update the default executor cargo run --release --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ./defaults/executor.wasm -# update the default genesis, assuming the transaction authority is `test_samples::SAMPLE_GENESIS_ACCOUNT_ID` +# 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 > ./defaults/genesis.json # update schema cargo run --release --bin kagami -- schema > ./docs/source/references/schema.json diff --git a/client_cli/pytests/.gitignore b/pytests/iroha_cli_tests/.gitignore similarity index 100% rename from client_cli/pytests/.gitignore rename to pytests/iroha_cli_tests/.gitignore diff --git a/client_cli/pytests/README.md b/pytests/iroha_cli_tests/README.md similarity index 92% rename from client_cli/pytests/README.md rename to pytests/iroha_cli_tests/README.md index 86586c3fcb7..15630ad02ea 100644 --- a/client_cli/pytests/README.md +++ b/pytests/iroha_cli_tests/README.md @@ -20,7 +20,7 @@ The framework is organized into the following directories: - `common`: Contains common constants and helpers used throughout the framework. - `models`: Contains the data model classes for accounts, assets, and domains. -- `src`: Contains the source code for the Iroha 2 Client CLI tests, including the `client_cli.py` and related utilities. +- `src`: Contains the source code for the Iroha 2 Client CLI tests, including the `iroha_cli.py` and related utilities. - `test`: Contains the test suite for the framework, organized into subdirectories for different test categories (`accounts`, `assets`, `atomicity`, `domains`, and `roles`). The framework also includes the following configuration files in its root directory: @@ -63,11 +63,11 @@ The test model has the following structure: 2. Install and configure [Poetry](https://python-poetry.org/).\ For details, see [Poetry Configuration](#poetry-configuration) below. -3. Configure the tests by creating the following `.env` file in _this_ (`/client_cli/pytests/`) directory: +3. Configure the tests by creating the following `.env` file in _this_ (`/pytests/iroha_cli_tests/`) directory: ```shell - CLIENT_CLI_BINARY=/path/to/iroha_client_cli - CLIENT_CLI_CONFIG=/path/to/client.toml + IROHA_CLI_BINARY=/path/to/iroha_cli + IROHA_CLI_CONFIG=/path/to/client.toml TORII_API_PORT_MIN=8080 TORII_API_PORT_MAX=8083 ``` @@ -119,7 +119,7 @@ To do so, perform the following steps: 4. Proceed with _Step 2_ of the [Using Test Suites](#using-test-suites) instructions. > [!NOTE] -> Don't forget to specify the path to the directory created for the `iroha` binary and its `client.toml` configuration file (see Step 3) in the `CLIENT_CLI_DIR` variable of the `.env` file. +> Don't forget to specify the path to the directory created for the `iroha` binary and its `client.toml` configuration file (see Step 3) in the `IROHA_CLI_DIR` variable of the `.env` file. > For details, see [Tests Configuration](#tests-configuration) below. ### Poetry Configuration @@ -129,7 +129,7 @@ This test framework uses [Poetry](https://python-poetry.org/) for dependency man To get started with Poetry, follow these steps: 1. Install Poetry by following the [official installation guide](https://python-poetry.org/docs/#installation). -2. Navigate to the `client_cli/pytests` directory in your terminal. +2. Navigate to the `pytests/iroha_cli_tests` directory in your terminal. 3. Install the dependencies and set up a virtual environment using Poetry: ```bash @@ -152,20 +152,20 @@ exit ### Tests Configuration -Tests are configured via environment variables. These variables can be optionally defined in a `.env` file that must be created in _this_ (`/client_cli/pytests/`) directory. +Tests are configured via environment variables. These variables can be optionally defined in a `.env` file that must be created in _this_ (`/pytests/iroha_cli_tests/`) directory. The variables: -- `CLIENT_CLI_DIR` — Specifies a path to a directory containing the `iroha` binary and its `client.toml` configuration file.\ - Set to `/client_cli`, by default. +- `IROHA_CLI_DIR` — Specifies a path to a directory containing the `iroha` binary and its `client.toml` configuration file.\ + Set to `/iroha_cli`, by default. - `TORII_API_PORT_MIN`/`TORII_API_PORT_MAX` — This pair specifies the range of local ports through which the Iroha 2 peers are deployed. A randomly selected port from the specified range is used for each test.\ Set to `8080` and `8083` respectively, by default. **Example**: ```shell -CLIENT_CLI_BINARY=/path/to/iroha_client_cli -CLIENT_CLI_CONFIG=/path/to/client.toml +IROHA_CLI_BINARY=/path/to/iroha +IROHA_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/pytests/iroha_cli_tests/__init__.py similarity index 100% rename from client_cli/pytests/common/__init__.py rename to pytests/iroha_cli_tests/__init__.py diff --git a/client_cli/pytests/src/__init__.py b/pytests/iroha_cli_tests/common/__init__.py similarity index 100% rename from client_cli/pytests/src/__init__.py rename to pytests/iroha_cli_tests/common/__init__.py diff --git a/client_cli/pytests/common/consts.py b/pytests/iroha_cli_tests/common/consts.py similarity index 100% rename from client_cli/pytests/common/consts.py rename to pytests/iroha_cli_tests/common/consts.py diff --git a/client_cli/pytests/common/helpers.py b/pytests/iroha_cli_tests/common/helpers.py similarity index 98% rename from client_cli/pytests/common/helpers.py rename to pytests/iroha_cli_tests/common/helpers.py index aa55466ec9c..3e7dd128367 100644 --- a/client_cli/pytests/common/helpers.py +++ b/pytests/iroha_cli_tests/common/helpers.py @@ -12,7 +12,7 @@ from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey -from common.consts import ReservedChars, fake +from .consts import ReservedChars, fake def extract_hash(stdout): diff --git a/client_cli/pytests/common/json_isi_examples/unregister_asset.json b/pytests/iroha_cli_tests/common/json_isi_examples/unregister_asset.json similarity index 100% rename from client_cli/pytests/common/json_isi_examples/unregister_asset.json rename to pytests/iroha_cli_tests/common/json_isi_examples/unregister_asset.json diff --git a/client_cli/pytests/common/settings.py b/pytests/iroha_cli_tests/common/settings.py similarity index 54% rename from client_cli/pytests/common/settings.py rename to pytests/iroha_cli_tests/common/settings.py index 3593f91d0b7..d9fd63c2663 100644 --- a/client_cli/pytests/common/settings.py +++ b/pytests/iroha_cli_tests/common/settings.py @@ -9,12 +9,13 @@ load_dotenv() -BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +BASE_DIR = os.path.dirname( + os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +) +ROOT_DIR = os.environ.get("IROHA_CLI_DIR", BASE_DIR) -ROOT_DIR = os.environ.get("CLIENT_CLI_DIR", BASE_DIR) - -PATH_CONFIG_CLIENT_CLI = os.environ["CLIENT_CLI_CONFIG"] -CLIENT_CLI_PATH = os.environ["CLIENT_CLI_BINARY"] +PATH_CONFIG_IROHA_CLI = os.environ["IROHA_CLI_CONFIG"] +IROHA_CLI_PATH = os.environ["IROHA_CLI_BINARY"] PEERS_CONFIGS_PATH = os.path.join(ROOT_DIR, "peers_configs") PORT_MIN = int(os.getenv("TORII_API_PORT_MIN", "8080")) diff --git a/client_cli/pytests/models/__init__.py b/pytests/iroha_cli_tests/models/__init__.py similarity index 100% rename from client_cli/pytests/models/__init__.py rename to pytests/iroha_cli_tests/models/__init__.py diff --git a/client_cli/pytests/models/account.py b/pytests/iroha_cli_tests/models/account.py similarity index 100% rename from client_cli/pytests/models/account.py rename to pytests/iroha_cli_tests/models/account.py diff --git a/client_cli/pytests/models/asset.py b/pytests/iroha_cli_tests/models/asset.py similarity index 100% rename from client_cli/pytests/models/asset.py rename to pytests/iroha_cli_tests/models/asset.py diff --git a/client_cli/pytests/models/domain.py b/pytests/iroha_cli_tests/models/domain.py similarity index 100% rename from client_cli/pytests/models/domain.py rename to pytests/iroha_cli_tests/models/domain.py diff --git a/client_cli/pytests/poetry.lock b/pytests/iroha_cli_tests/poetry.lock similarity index 100% rename from client_cli/pytests/poetry.lock rename to pytests/iroha_cli_tests/poetry.lock diff --git a/client_cli/pytests/pyproject.toml b/pytests/iroha_cli_tests/pyproject.toml similarity index 95% rename from client_cli/pytests/pyproject.toml rename to pytests/iroha_cli_tests/pyproject.toml index 67bef271f73..97003f31cd2 100644 --- a/client_cli/pytests/pyproject.toml +++ b/pytests/iroha_cli_tests/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "pytestclientcli" +name = "iroha_cli_tests" version = "0.1.0" description = "" authors = ["alexstroke "] diff --git a/pytests/iroha_cli_tests/src/__init__.py b/pytests/iroha_cli_tests/src/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/pytests/iroha_cli_tests/src/iroha_cli/__init__.py b/pytests/iroha_cli_tests/src/iroha_cli/__init__.py new file mode 100644 index 00000000000..4442645214b --- /dev/null +++ b/pytests/iroha_cli_tests/src/iroha_cli/__init__.py @@ -0,0 +1,13 @@ +""" +This module initializes the Iroha client and configuration using environment variables. +""" + +from ...common.settings import PATH_CONFIG_IROHA_CLI, PORT_MAX, PORT_MIN +from .iroha_cli import IrohaCli +from .configuration import Config +from .iroha import Iroha + +config = Config(PORT_MIN, PORT_MAX) +config.load(PATH_CONFIG_IROHA_CLI) +iroha_cli = IrohaCli(config) +iroha = Iroha(config) diff --git a/client_cli/pytests/src/client_cli/configuration.py b/pytests/iroha_cli_tests/src/iroha_cli/configuration.py similarity index 90% rename from client_cli/pytests/src/client_cli/configuration.py rename to pytests/iroha_cli_tests/src/iroha_cli/configuration.py index 09ff381c0df..d55bc79963d 100644 --- a/client_cli/pytests/src/client_cli/configuration.py +++ b/pytests/iroha_cli_tests/src/iroha_cli/configuration.py @@ -29,23 +29,23 @@ def __init__(self, port_min, port_max): self.port_max = port_max self._envs = dict() - def load(self, path_config_client_cli): + def load(self, path_config_iroha_cli): """ Load the configuration from the given config file. - :param path_config_client_cli: The path to the configuration file. - :type path_config_client_cli: str + :param path_config_iroha_cli: The path to the configuration file. + :type path_config_iroha_cli: str :raises IOError: If the file does not exist. """ - if not os.path.exists(path_config_client_cli): - raise IOError(f"No config file found at {path_config_client_cli}") + if not os.path.exists(path_config_iroha_cli): + raise IOError(f"No config file found at {path_config_iroha_cli}") - if not os.path.isfile(path_config_client_cli): - raise IOError(f"The path is not a file: {path_config_client_cli}") + if not os.path.isfile(path_config_iroha_cli): + raise IOError(f"The path is not a file: {path_config_iroha_cli}") - with open(path_config_client_cli, "r", encoding="utf-8") as config_file: + with open(path_config_iroha_cli, "r", encoding="utf-8") as config_file: self._config = tomlkit.load(config_file) - self.file = path_config_client_cli + self.file = path_config_iroha_cli def generate_by_peers(self, peers_configs_dir): """ diff --git a/client_cli/pytests/src/client_cli/have.py b/pytests/iroha_cli_tests/src/iroha_cli/have.py similarity index 89% rename from client_cli/pytests/src/client_cli/have.py rename to pytests/iroha_cli_tests/src/iroha_cli/have.py index 54c076a03e9..b27a25419b8 100644 --- a/client_cli/pytests/src/client_cli/have.py +++ b/pytests/iroha_cli_tests/src/iroha_cli/have.py @@ -6,7 +6,7 @@ import allure # type: ignore -from src.client_cli import client_cli, iroha, match +from . import iroha_cli, iroha, match def expected_in_actual(expected, actual) -> bool: @@ -50,7 +50,7 @@ def domain_in_domains() -> bool: return True - return client_cli.wait_for(domain_in_domains) + return iroha_cli.wait_for(domain_in_domains) def account(expected): @@ -65,7 +65,7 @@ def account_in_accounts() -> bool: accounts = iroha.list_filter({"Atom": {"Id": {"Equals": expected}}}).accounts() return expected_in_actual(expected, accounts) - return client_cli.wait_for(account_in_accounts) + return iroha_cli.wait_for(account_in_accounts) def asset_definition(expected): @@ -82,7 +82,7 @@ def asset_definition_in_asset_definitions() -> bool: ).asset_definitions() return expected_in_actual(expected, asset_definitions) - return client_cli.wait_for(asset_definition_in_asset_definitions) + return iroha_cli.wait_for(asset_definition_in_asset_definitions) def asset(expected): @@ -97,7 +97,7 @@ def asset_in_assets() -> bool: assets = iroha.list_filter({"Atom": {"Id": {"Equals": expected}}}).assets() return expected_in_actual(expected, assets) - return client_cli.wait_for(asset_in_assets) + return iroha_cli.wait_for(asset_in_assets) def asset_has_quantity(expected_asset_id, expected_quantity): @@ -134,14 +134,14 @@ def check_quantity() -> bool: return expected_quantity == str(actual_quantity) - return client_cli.wait_for(check_quantity) + return iroha_cli.wait_for(check_quantity) def error(expected): """ - Check if the expected error is present in the client_cli stderr. + Check if the expected error is present in the iroha_cli stderr. :param expected: The expected error message. :return: True if the error is present, False otherwise. """ - return match.client_cli_have_error(expected=expected, actual=client_cli.stderr) + return match.iroha_cli_have_error(expected=expected, actual=iroha_cli.stderr) diff --git a/client_cli/pytests/src/client_cli/iroha.py b/pytests/iroha_cli_tests/src/iroha_cli/iroha.py similarity index 94% rename from client_cli/pytests/src/client_cli/iroha.py rename to pytests/iroha_cli_tests/src/iroha_cli/iroha.py index 9305c692138..f91414e7d9a 100644 --- a/client_cli/pytests/src/client_cli/iroha.py +++ b/pytests/iroha_cli_tests/src/iroha_cli/iroha.py @@ -1,16 +1,16 @@ """ -This module contains the Iroha class, which is a subclass of ClientCli. +This module contains the Iroha class, which is a subclass of IrohaCli. """ import json from typing import Dict, List -from src.client_cli.client_cli import ClientCli +from .iroha_cli import IrohaCli -class Iroha(ClientCli): +class Iroha(IrohaCli): """ - Iroha is a subclass of ClientCli that provides additional methods + Iroha is a subclass of IrohaCli that provides additional methods for interacting with the Iroha network. """ diff --git a/client_cli/pytests/src/client_cli/client_cli.py b/pytests/iroha_cli_tests/src/iroha_cli/iroha_cli.py similarity index 90% rename from client_cli/pytests/src/client_cli/client_cli.py rename to pytests/iroha_cli_tests/src/iroha_cli/iroha_cli.py index 57d77b53e40..05490376866 100644 --- a/client_cli/pytests/src/client_cli/client_cli.py +++ b/pytests/iroha_cli_tests/src/iroha_cli/iroha_cli.py @@ -1,5 +1,5 @@ """ -This module contains the ClientCli class, which is responsible for building and executing +This module contains the IrohaCli class, which is responsible for building and executing commands for interacting with Iroha blockchain using the Iroha command-line client. """ @@ -11,18 +11,18 @@ import allure # type: ignore -from common.helpers import extract_hash, read_isi_from_json, write_isi_to_json -from common.settings import BASE_DIR, CLIENT_CLI_PATH, PATH_CONFIG_CLIENT_CLI, ROOT_DIR -from src.client_cli.configuration import Config +from ...common.helpers import extract_hash, read_isi_from_json, write_isi_to_json +from ...common.settings import BASE_DIR, IROHA_CLI_PATH, PATH_CONFIG_IROHA_CLI, ROOT_DIR +from .configuration import Config -class ClientCli: +class IrohaCli: """ A class to represent the Iroha client command line interface. """ - BASE_PATH = CLIENT_CLI_PATH - BASE_FLAGS = ["--config=" + PATH_CONFIG_CLIENT_CLI] + BASE_PATH = IROHA_CLI_PATH + BASE_FLAGS = ["--config=" + PATH_CONFIG_IROHA_CLI] def __init__(self, config: Config): """ @@ -38,13 +38,13 @@ def __init__(self, config: Config): def __enter__(self): """ - Called when entering a context managed by the ClientCli object. + Called when entering a context managed by the IrohaCli object. """ return self def __exit__(self, exc_type, exc_val, exc_tb): """ - Called when exiting a context managed by the ClientCli object. + Called when exiting a context managed by the IrohaCli object. :param exc_type: The type of exception raised within the context (if any). :param exc_val: The instance of the exception raised within the context (if any). @@ -73,7 +73,7 @@ def wait_for(self, condition: Callable[[], bool], timeout=None): def reset(self): """ - Resets the stdout and stderr attributes of the ClientCli object. + Resets the stdout and stderr attributes of the IrohaCli object. """ self.stdout = None self.stderr = None @@ -83,8 +83,8 @@ def register(self): """ Appends the 'register' command to the command list. - :return: The current ClientCli object. - :rtype: ClientCli + :return: The current IrohaCli object. + :rtype: IrohaCli """ self.command.append("register") return self @@ -93,8 +93,8 @@ def mint(self): """ Appends the 'mint' command to the command list. - :return: The current ClientCli object. - :rtype: ClientCli + :return: The current IrohaCli object. + :rtype: IrohaCli """ self.command.append("mint") return self @@ -103,8 +103,8 @@ def list_all(self): """ Appends the 'list all' command to the command list. - :return: The current ClientCli object. - :rtype: ClientCli + :return: The current IrohaCli object. + :rtype: IrohaCli """ self.command.append("list") self.command.append("all") @@ -126,8 +126,8 @@ def domain(self, domain: str): :param domain: The domain to be queried. :type domain: str - :return: The current ClientCli object. - :rtype: ClientCli + :return: The current IrohaCli object. + :rtype: IrohaCli """ self.command.insert(2, "domain") self.command.append("--id=" + domain) @@ -142,8 +142,8 @@ def account(self, signatory: str, domain: str): :type signatory: str :param domain: The domain of the account. :type domain: str - :return: The current ClientCli object. - :rtype: ClientCli + :return: The current IrohaCli object. + :rtype: IrohaCli """ self.command.insert(2, "account") self.command.append("--id=" + signatory + "@" + domain) @@ -160,8 +160,8 @@ def asset(self, asset_definition=None, account=None, value_of_type=None): :type account: Account :param value_of_type: The value of the asset type, defaults to None. :type value_of_type: str, optional - :return: The current ClientCli object. - :rtype: ClientCli + :return: The current IrohaCli object. + :rtype: IrohaCli """ self.command.insert(2, "asset") if asset_definition and account and value_of_type: @@ -191,8 +191,8 @@ def transfer(self, asset, source_account, target_account, quantity: str): :type target_account: str :param quantity: The quantity of the asset to be transferred. :type quantity: str - :return: The current ClientCli object. - :rtype: ClientCli + :return: The current IrohaCli object. + :rtype: IrohaCli """ self.command.append("asset") self.command.append("transfer") @@ -220,8 +220,8 @@ def burn(self, account, asset, quantity: str): :param quantity: The quantity of the asset to be burned. :type quantity: str - :return: The current ClientCli object. - :rtype: ClientCli + :return: The current IrohaCli object. + :rtype: IrohaCli """ self.command.append("asset") self.command.append("burn") @@ -249,8 +249,8 @@ def asset_definition(self, asset: str, domain: str, type_: str): :type domain: str :param type_: The value type of the asset. :type type_: str - :return: The current ClientCli object. - :rtype: ClientCli + :return: The current IrohaCli object. + :rtype: IrohaCli """ self.command.insert(2, "definition") self.command.insert(2, "asset") @@ -348,8 +348,8 @@ def should(self, _expected): :param expected: The expected value. :type expected: str - :return: The current ClientCli object. - :rtype: ClientCli + :return: The current IrohaCli object. + :rtype: IrohaCli """ return self @@ -357,8 +357,8 @@ def execute(self, command=None): """ Executes the command and captures stdout and stderr. - :return: The current ClientCli object. - :rtype: ClientCli + :return: The current IrohaCli object. + :rtype: IrohaCli """ self.config.randomise_torii_url() if command is None: diff --git a/client_cli/pytests/src/client_cli/match.py b/pytests/iroha_cli_tests/src/iroha_cli/match.py similarity index 91% rename from client_cli/pytests/src/client_cli/match.py rename to pytests/iroha_cli_tests/src/iroha_cli/match.py index 9f597495c5d..72f47d3ec4d 100644 --- a/client_cli/pytests/src/client_cli/match.py +++ b/pytests/iroha_cli_tests/src/iroha_cli/match.py @@ -5,7 +5,7 @@ import allure # type: ignore -def client_cli_have_error(expected: str, actual: str): +def iroha_cli_have_error(expected: str, actual: str): """ Checks if the command-line client has the expected error. diff --git a/client_cli/pytests/test/__init__.py b/pytests/iroha_cli_tests/test/__init__.py similarity index 100% rename from client_cli/pytests/test/__init__.py rename to pytests/iroha_cli_tests/test/__init__.py diff --git a/pytests/iroha_cli_tests/test/accounts/__init__.py b/pytests/iroha_cli_tests/test/accounts/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/client_cli/pytests/test/accounts/conftest.py b/pytests/iroha_cli_tests/test/accounts/conftest.py similarity index 96% rename from client_cli/pytests/test/accounts/conftest.py rename to pytests/iroha_cli_tests/test/accounts/conftest.py index f92932bfcb9..c724df8213c 100644 --- a/client_cli/pytests/test/accounts/conftest.py +++ b/pytests/iroha_cli_tests/test/accounts/conftest.py @@ -1,4 +1,4 @@ -from test import ( +from .. import ( GIVEN_129_length_name, GIVEN_fake_name, GIVEN_key_with_invalid_character_in_key, diff --git a/client_cli/pytests/test/accounts/test_accounts_query_filters.py b/pytests/iroha_cli_tests/test/accounts/test_accounts_query_filters.py similarity index 82% rename from client_cli/pytests/test/accounts/test_accounts_query_filters.py rename to pytests/iroha_cli_tests/test/accounts/test_accounts_query_filters.py index 93d23d4b06c..fa14dff4918 100644 --- a/client_cli/pytests/test/accounts/test_accounts_query_filters.py +++ b/pytests/iroha_cli_tests/test/accounts/test_accounts_query_filters.py @@ -2,16 +2,14 @@ import allure # type: ignore -from src.client_cli import client_cli, iroha +from ...src.iroha_cli import iroha_cli, iroha # using existing account to have at least one account in response def test_filter_by_domain(GIVEN_registered_account): def condition(): domain = GIVEN_registered_account.domain - with allure.step( - f"WHEN client_cli query accounts " f'in the "{domain}" domain' - ): + with allure.step(f"WHEN iroha_cli query accounts " f'in the "{domain}" domain'): accounts = iroha.list_filter( {"Atom": {"Id": {"DomainId": {"Equals": domain}}}} ).accounts() @@ -23,7 +21,7 @@ def condition(): ) return accounts and all(account.endswith(domain) for account in accounts) - client_cli.wait_for(condition) + iroha_cli.wait_for(condition) def test_filter_by_account_id(GIVEN_registered_account): @@ -32,7 +30,7 @@ def condition(): GIVEN_registered_account.signatory + "@" + GIVEN_registered_account.domain ) with allure.step( - f'WHEN client_cli query accounts with account id "{account_id}"' + f'WHEN iroha_cli query accounts with account id "{account_id}"' ): accounts = iroha.list_filter( {"Atom": {"Id": {"Equals": account_id}}} @@ -45,4 +43,4 @@ def condition(): ) return accounts and all(account == account_id for account in accounts) - client_cli.wait_for(condition) + iroha_cli.wait_for(condition) diff --git a/client_cli/pytests/test/accounts/test_register_accounts.py b/pytests/iroha_cli_tests/test/accounts/test_register_accounts.py similarity index 66% rename from client_cli/pytests/test/accounts/test_register_accounts.py rename to pytests/iroha_cli_tests/test/accounts/test_register_accounts.py index 75aad017276..9ca3f7e72f2 100644 --- a/client_cli/pytests/test/accounts/test_register_accounts.py +++ b/pytests/iroha_cli_tests/test/accounts/test_register_accounts.py @@ -1,8 +1,8 @@ import allure # type: ignore import pytest -from common.consts import Stderr -from src.client_cli import client_cli, have, iroha +from ...common.consts import Stderr +from ...src.iroha_cli import iroha_cli, have, iroha @pytest.fixture(scope="function", autouse=True) @@ -14,10 +14,10 @@ def story_account_register_account(): @allure.label("sdk_test_id", "register_account") def test_register_account(GIVEN_public_key, GIVEN_registered_domain): with allure.step( - f'WHEN client_cli registers the account "{GIVEN_public_key}" ' + f'WHEN iroha_cli registers the account "{GIVEN_public_key}" ' f'in the "{GIVEN_registered_domain.name}" domain' ): - client_cli.register().account( + iroha_cli.register().account( signatory=GIVEN_public_key, domain=GIVEN_registered_domain.name, ) @@ -31,16 +31,16 @@ def test_register_account_with_existing_signatory( GIVEN_registered_domain, GIVEN_registered_account ): with allure.step( - f"WHEN client_cli tries to register an account " + f"WHEN iroha_cli tries to register an account " f'with the same signatory "{GIVEN_registered_account.signatory}" ' f'in the "{GIVEN_registered_domain.name}" domain' ): - client_cli.register().account( + iroha_cli.register().account( signatory=GIVEN_registered_account.signatory, domain=GIVEN_registered_account.domain, ) - with allure.step("THEN client_cli should have the account error"): - client_cli.should(have.error(Stderr.REPETITION.value)) + with allure.step("THEN iroha_cli should have the account error"): + iroha_cli.should(have.error(Stderr.REPETITION.value)) @allure.label("sdk_test_id", "register_account_with_invalid_domain") @@ -49,14 +49,14 @@ def test_register_account_with_invalid_domain( GIVEN_public_key, ): with allure.step( - "WHEN client_cli tries to register an account with an invalid domain" + "WHEN iroha_cli tries to register an account with an invalid domain" ): - client_cli.register().account( + iroha_cli.register().account( signatory=GIVEN_public_key, domain=GIVEN_not_existing_name, ) - with allure.step("THEN client_cli should have the error"): - client_cli.should(have.error(Stderr.FAILED_TO_FIND_DOMAIN.value)) + with allure.step("THEN iroha_cli should have the error"): + iroha_cli.should(have.error(Stderr.FAILED_TO_FIND_DOMAIN.value)) @allure.label("sdk_test_id", "register_account_with_invalid_character_in_key") @@ -64,11 +64,11 @@ def test_register_account_with_invalid_character_in_key( GIVEN_registered_domain, GIVEN_key_with_invalid_character_in_key ): with allure.step( - "WHEN client_cli tries to register an account with invalid character in the key" + "WHEN iroha_cli tries to register an account with invalid character in the key" ): - client_cli.register().account( + iroha_cli.register().account( signatory=GIVEN_key_with_invalid_character_in_key, domain=GIVEN_registered_domain.name, ) - with allure.step("THEN client_cli should have the error"): - client_cli.should(have.error(Stderr.INVALID_CHARACTER.value)) + with allure.step("THEN iroha_cli should have the error"): + iroha_cli.should(have.error(Stderr.INVALID_CHARACTER.value)) diff --git a/pytests/iroha_cli_tests/test/assets/__init__.py b/pytests/iroha_cli_tests/test/assets/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/client_cli/pytests/test/assets/conftest.py b/pytests/iroha_cli_tests/test/assets/conftest.py similarity index 97% rename from client_cli/pytests/test/assets/conftest.py rename to pytests/iroha_cli_tests/test/assets/conftest.py index 5bc69f5b2fc..d600d4b608f 100644 --- a/client_cli/pytests/test/assets/conftest.py +++ b/pytests/iroha_cli_tests/test/assets/conftest.py @@ -1,4 +1,4 @@ -from test import ( +from .. import ( GIVEN_129_length_name, GIVEN_currently_account_quantity_with_two_quantity_of_asset, GIVEN_currently_authorized_account, diff --git a/client_cli/pytests/test/assets/test_assets_query_filters.py b/pytests/iroha_cli_tests/test/assets/test_assets_query_filters.py similarity index 85% rename from client_cli/pytests/test/assets/test_assets_query_filters.py rename to pytests/iroha_cli_tests/test/assets/test_assets_query_filters.py index ae3749b5e86..8f6dc5ecd0d 100644 --- a/client_cli/pytests/test/assets/test_assets_query_filters.py +++ b/pytests/iroha_cli_tests/test/assets/test_assets_query_filters.py @@ -2,7 +2,7 @@ import allure # type: ignore -from src.client_cli import client_cli, iroha +from ...src.iroha_cli import iroha_cli, iroha # using existing account with asset to have at least one in response @@ -11,7 +11,7 @@ def condition(): domain = ( GIVEN_currently_account_quantity_with_two_quantity_of_asset.definition.domain ) - with allure.step(f"WHEN client_cli query assets" f'in the "{domain}" domain'): + with allure.step(f"WHEN iroha_cli query assets" f'in the "{domain}" domain'): assets = iroha.list_filter( {"Atom": {"Id": {"DefinitionId": {"DomainId": {"Equals": domain}}}}} ).assets() @@ -26,7 +26,7 @@ def condition(): for asset in assets ) - client_cli.wait_for(condition) + iroha_cli.wait_for(condition) def test_filter_by_asset_name( @@ -36,7 +36,7 @@ def condition(): name = ( GIVEN_currently_account_quantity_with_two_quantity_of_asset.definition.name ) - with allure.step(f'WHEN client_cli query assets with name "{name}"'): + with allure.step(f'WHEN iroha_cli query assets with name "{name}"'): assets = iroha.list_filter( {"Atom": {"Id": {"DefinitionId": {"Name": {"Equals": name}}}}} ).assets() @@ -48,7 +48,7 @@ def condition(): ) return assets and all(asset.startswith(name) for asset in assets) - client_cli.wait_for(condition) + iroha_cli.wait_for(condition) def test_filter_by_asset_id( @@ -63,7 +63,7 @@ def condition(): + "@" + GIVEN_currently_authorized_account.domain ) - with allure.step(f'WHEN client_cli query assets with asset id "{asset_id}"'): + with allure.step(f'WHEN iroha_cli query assets with asset id "{asset_id}"'): assets = iroha.list_filter({"Atom": {"Id": {"Equals": asset_id}}}).assets() with allure.step("THEN Iroha should return only assets with this id"): allure.attach( @@ -73,4 +73,4 @@ def condition(): ) return assets and all(asset == asset_id for asset in assets) - client_cli.wait_for(condition) + iroha_cli.wait_for(condition) diff --git a/client_cli/pytests/test/assets/test_burn_assets.py b/pytests/iroha_cli_tests/test/assets/test_burn_assets.py similarity index 94% rename from client_cli/pytests/test/assets/test_burn_assets.py rename to pytests/iroha_cli_tests/test/assets/test_burn_assets.py index e721dd43a48..d94b77fad0f 100644 --- a/client_cli/pytests/test/assets/test_burn_assets.py +++ b/pytests/iroha_cli_tests/test/assets/test_burn_assets.py @@ -1,7 +1,7 @@ import allure # type: ignore import pytest -from src.client_cli import client_cli, have, iroha +from ...src.iroha_cli import iroha_cli, have, iroha @pytest.fixture(scope="function", autouse=True) @@ -19,7 +19,7 @@ def test_burn_asset_for_account_in_same_domain( f"WHEN {GIVEN_currently_authorized_account.signatory} burns 1" f"of {GIVEN_currently_account_quantity_with_two_quantity_of_asset.definition.name}" ): - client_cli.burn( + iroha_cli.burn( asset=GIVEN_currently_account_quantity_with_two_quantity_of_asset.definition, account=GIVEN_currently_authorized_account, quantity="1", diff --git a/client_cli/pytests/test/assets/test_mint_assets.py b/pytests/iroha_cli_tests/test/assets/test_mint_assets.py similarity index 89% rename from client_cli/pytests/test/assets/test_mint_assets.py rename to pytests/iroha_cli_tests/test/assets/test_mint_assets.py index e76e94f413c..a7baf443beb 100644 --- a/client_cli/pytests/test/assets/test_mint_assets.py +++ b/pytests/iroha_cli_tests/test/assets/test_mint_assets.py @@ -1,7 +1,7 @@ import allure # type: ignore import pytest -from src.client_cli import client_cli, have, iroha +from ...src.iroha_cli import iroha_cli, have, iroha @pytest.fixture(scope="function", autouse=True) @@ -16,11 +16,11 @@ def test_mint_asset_for_account_in_same_domain( GIVEN_numeric_value, ): with allure.step( - f'WHEN client_cli mint "{GIVEN_numeric_value}" of ' + f'WHEN iroha_cli mint "{GIVEN_numeric_value}" of ' f'"{GIVEN_registered_asset_definition_with_numeric_type}" ' f'for the "{GIVEN_registered_account}"' ): - client_cli.mint().asset( + iroha_cli.mint().asset( account=GIVEN_registered_account, asset_definition=GIVEN_registered_asset_definition_with_numeric_type, value_of_type=GIVEN_numeric_value, @@ -48,11 +48,11 @@ def test_mint_asset_for_account_in_same_domain( @allure.label("sdk_test_id", "mint_asset_quantity_after_minting") def test_mint_asset_quantity_after_minting(GIVEN_minted_asset_quantity): with allure.step( - f'WHEN client_cli mint additional asset "{GIVEN_minted_asset_quantity.definition}" ' + f'WHEN iroha_cli mint additional asset "{GIVEN_minted_asset_quantity.definition}" ' f'for the "{GIVEN_minted_asset_quantity.account}" ' f'with "{GIVEN_minted_asset_quantity.value}" quantity' ): - client_cli.mint().asset( + iroha_cli.mint().asset( account=GIVEN_minted_asset_quantity.account, asset_definition=GIVEN_minted_asset_quantity.definition, value_of_type="1", diff --git a/client_cli/pytests/test/assets/test_register_asset_definitions.py b/pytests/iroha_cli_tests/test/assets/test_register_asset_definitions.py similarity index 73% rename from client_cli/pytests/test/assets/test_register_asset_definitions.py rename to pytests/iroha_cli_tests/test/assets/test_register_asset_definitions.py index c368a15632f..4b30c3093ae 100644 --- a/client_cli/pytests/test/assets/test_register_asset_definitions.py +++ b/pytests/iroha_cli_tests/test/assets/test_register_asset_definitions.py @@ -1,8 +1,8 @@ import allure # type: ignore import pytest -from common.consts import Stderr -from src.client_cli import client_cli, have, iroha +from ...common.consts import Stderr +from ...src.iroha_cli import iroha_cli, have, iroha @pytest.fixture(scope="function", autouse=True) @@ -16,11 +16,11 @@ def test_register_asset_definition_with_numeric_type( GIVEN_fake_asset_name, GIVEN_registered_domain, GIVEN_numeric_type ): with allure.step( - f'WHEN client_cli registers the asset_definition "{GIVEN_fake_asset_name}" ' + f'WHEN iroha_cli registers the asset_definition "{GIVEN_fake_asset_name}" ' f'with "{GIVEN_numeric_type}" value type' f'in the "{GIVEN_registered_domain.name}" domain' ): - client_cli.register().asset_definition( + iroha_cli.register().asset_definition( asset=GIVEN_fake_asset_name, domain=GIVEN_registered_domain.name, type_=GIVEN_numeric_type, @@ -38,11 +38,11 @@ def test_register_asset_definition_with_store_type( GIVEN_fake_asset_name, GIVEN_registered_domain, GIVEN_store_type ): with allure.step( - f'WHEN client_cli registers the asset_definition "{GIVEN_fake_asset_name}" ' + f'WHEN iroha_cli registers the asset_definition "{GIVEN_fake_asset_name}" ' f'with "{GIVEN_store_type}" value type' f'in the "{GIVEN_registered_domain.name}" domain' ): - client_cli.register().asset_definition( + iroha_cli.register().asset_definition( asset=GIVEN_fake_asset_name, domain=GIVEN_registered_domain.name, type_=GIVEN_store_type, @@ -64,29 +64,29 @@ def test_register_asset_with_existing_name( f'with the same name "{GIVEN_registered_asset_definition_with_numeric_type.name}"' f'in the "{GIVEN_registered_asset_definition_with_numeric_type.domain}" domain' ): - client_cli.register().asset_definition( + iroha_cli.register().asset_definition( asset=GIVEN_registered_asset_definition_with_numeric_type.name, domain=GIVEN_registered_asset_definition_with_numeric_type.domain, type_=GIVEN_registered_asset_definition_with_numeric_type.type_, ) with allure.step( - f'THEN client_cli should have the asset definition error: "' + f'THEN iroha_cli should have the asset definition error: "' f'{GIVEN_registered_asset_definition_with_numeric_type.__repr__()}"' ): - client_cli.should(have.error(Stderr.REPETITION.value)) + iroha_cli.should(have.error(Stderr.REPETITION.value)) @allure.label("sdk_test_id", "register_asset_with_empty_name") def test_register_asset_with_empty_name(GIVEN_registered_domain): with allure.step( - "WHEN client_cli tries to register an asset definition with an empty name" + "WHEN iroha_cli tries to register an asset definition with an empty name" f'in the "{GIVEN_registered_domain.name}" domain' ): - client_cli.register().asset_definition( + iroha_cli.register().asset_definition( asset="", domain=GIVEN_registered_domain.name, type_="Numeric" ) with allure.step(f'THEN сlient_cli should have the asset error: "{Stderr.EMPTY}"'): - client_cli.should(have.error(Stderr.EMPTY.value)) + iroha_cli.should(have.error(Stderr.EMPTY.value)) @allure.label("sdk_test_id", "register_asset_with_not_existing_domain") @@ -94,15 +94,15 @@ def test_register_asset_with_not_existing_domain( GIVEN_not_existing_name, GIVEN_numeric_type, GIVEN_fake_asset_name ): with allure.step( - "WHEN client_cli tries to register an asset definition with not existing domain" + "WHEN iroha_cli tries to register an asset definition with not existing domain" ): - client_cli.register().asset_definition( + iroha_cli.register().asset_definition( asset=GIVEN_fake_asset_name, domain=GIVEN_not_existing_name, type_=GIVEN_numeric_type, ) - with allure.step("THEN client_cli should have the error"): - client_cli.should(have.error(Stderr.FAILED_TO_FIND_DOMAIN.value)) + with allure.step("THEN iroha_cli should have the error"): + iroha_cli.should(have.error(Stderr.FAILED_TO_FIND_DOMAIN.value)) @allure.label("sdk_test_id", "register_asset_with_too_long_type") @@ -110,12 +110,12 @@ def test_register_asset_with_too_long_type( GIVEN_fake_asset_name, GIVEN_registered_domain ): with allure.step( - "WHEN client_cli tries to register an asset definition with too long value type" + "WHEN iroha_cli tries to register an asset definition with too long value type" ): - client_cli.register().asset_definition( + iroha_cli.register().asset_definition( asset=GIVEN_fake_asset_name, domain=GIVEN_registered_domain.name, type_="coin", ) - with allure.step("THEN client_cli should have the error"): - client_cli.should(have.error(Stderr.INVALID_TYPE.value)) + with allure.step("THEN iroha_cli should have the error"): + iroha_cli.should(have.error(Stderr.INVALID_TYPE.value)) diff --git a/client_cli/pytests/test/assets/test_transfer_assets.py b/pytests/iroha_cli_tests/test/assets/test_transfer_assets.py similarity index 92% rename from client_cli/pytests/test/assets/test_transfer_assets.py rename to pytests/iroha_cli_tests/test/assets/test_transfer_assets.py index f95acbebc9a..f6b1b4ac597 100644 --- a/client_cli/pytests/test/assets/test_transfer_assets.py +++ b/pytests/iroha_cli_tests/test/assets/test_transfer_assets.py @@ -1,8 +1,8 @@ import allure # type: ignore import pytest -from common.consts import Stderr -from src.client_cli import client_cli, have, iroha +from ...common.consts import Stderr +from ...src.iroha_cli import iroha_cli, have, iroha @pytest.fixture(scope="function", autouse=True) @@ -22,7 +22,7 @@ def test_transfer_asset( f"of {GIVEN_currently_account_quantity_with_two_quantity_of_asset.definition.name}" f"to {GIVEN_registered_account.signatory}" ): - client_cli.transfer( + iroha_cli.transfer( asset=GIVEN_currently_account_quantity_with_two_quantity_of_asset.definition, source_account=GIVEN_currently_authorized_account, target_account=GIVEN_registered_account, @@ -55,7 +55,7 @@ def test_transfer_with_insufficient_funds( f"Quantity of {GIVEN_currently_account_quantity_with_two_quantity_of_asset.definition.name}" f"to {GIVEN_registered_account.signatory}" ): - client_cli.transfer( + iroha_cli.transfer( asset=GIVEN_currently_account_quantity_with_two_quantity_of_asset.definition, source_account=GIVEN_currently_authorized_account, target_account=GIVEN_registered_account, @@ -69,4 +69,4 @@ def test_transfer_with_insufficient_funds( f"of {GIVEN_currently_account_quantity_with_two_quantity_of_asset.definition.name}" f"AND {GIVEN_registered_account.signatory} does not receive any additional Quantity" ): - client_cli.should(have.error(Stderr.INSUFFICIENT_FUNDS.value)) + iroha_cli.should(have.error(Stderr.INSUFFICIENT_FUNDS.value)) diff --git a/client_cli/pytests/test/assets/test_unregister_asset.py b/pytests/iroha_cli_tests/test/assets/test_unregister_asset.py similarity index 86% rename from client_cli/pytests/test/assets/test_unregister_asset.py rename to pytests/iroha_cli_tests/test/assets/test_unregister_asset.py index facaf4c04ae..7b376d7f4f9 100644 --- a/client_cli/pytests/test/assets/test_unregister_asset.py +++ b/pytests/iroha_cli_tests/test/assets/test_unregister_asset.py @@ -1,7 +1,7 @@ import allure # type: ignore import pytest -from src.client_cli import client_cli, have, iroha +from ...src.iroha_cli import iroha_cli, have, iroha @pytest.fixture(scope="function", autouse=True) @@ -23,9 +23,9 @@ def test_unregister_asset( GIVEN_numeric_asset_for_account, ): with allure.step( - f'WHEN client_cli unregisters the asset "{GIVEN_numeric_asset_for_account.definition.name}"' + f'WHEN iroha_cli unregisters the asset "{GIVEN_numeric_asset_for_account.definition.name}"' ): - client_cli.unregister_asset( + iroha_cli.unregister_asset( asset=f"{GIVEN_numeric_asset_for_account.definition.name}#" f"{GIVEN_numeric_asset_for_account.account}@" f"{GIVEN_numeric_asset_for_account.definition.domain}" diff --git a/pytests/iroha_cli_tests/test/atomicity/__init__.py b/pytests/iroha_cli_tests/test/atomicity/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/client_cli/pytests/test/atomicity/conftest.py b/pytests/iroha_cli_tests/test/atomicity/conftest.py similarity index 84% rename from client_cli/pytests/test/atomicity/conftest.py rename to pytests/iroha_cli_tests/test/atomicity/conftest.py index dfd54995483..bc9844064f6 100644 --- a/client_cli/pytests/test/atomicity/conftest.py +++ b/pytests/iroha_cli_tests/test/atomicity/conftest.py @@ -1,4 +1,4 @@ -from test import before_all, before_each +from .. import before_all, before_each import allure # type: ignore import pytest diff --git a/client_cli/pytests/test/atomicity/test_multiple_instructions_within_transaction.py b/pytests/iroha_cli_tests/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 pytests/iroha_cli_tests/test/atomicity/test_multiple_instructions_within_transaction.py diff --git a/client_cli/pytests/test/atomicity/test_pair_instructions_within_transaction.py b/pytests/iroha_cli_tests/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 pytests/iroha_cli_tests/test/atomicity/test_pair_instructions_within_transaction.py diff --git a/client_cli/pytests/test/atomicity/test_wrong_instructions_within_transaction.py b/pytests/iroha_cli_tests/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 pytests/iroha_cli_tests/test/atomicity/test_wrong_instructions_within_transaction.py diff --git a/client_cli/pytests/test/conftest.py b/pytests/iroha_cli_tests/test/conftest.py similarity index 92% rename from client_cli/pytests/test/conftest.py rename to pytests/iroha_cli_tests/test/conftest.py index d261ec5f227..95267fd106a 100644 --- a/client_cli/pytests/test/conftest.py +++ b/pytests/iroha_cli_tests/test/conftest.py @@ -6,8 +6,8 @@ import allure # type: ignore import pytest -from common.consts import ValueTypes -from common.helpers import ( +from ..common.consts import ValueTypes +from ..common.helpers import ( fake_asset_name, fake_name, generate_public_key, @@ -20,9 +20,9 @@ random, string, ) -from common.settings import PEERS_CONFIGS_PATH -from models import Account, Asset, AssetDefinition, Domain -from src.client_cli import client_cli, config +from ..common.settings import PEERS_CONFIGS_PATH +from ..models import Account, Asset, AssetDefinition, Domain +from ..src.iroha_cli import iroha_cli, config # General fixtures @@ -37,11 +37,11 @@ def before_all(): @pytest.fixture(scope="function", autouse=True) def before_each(): - """Fixture to set up and reset the client_cli state.""" + """Fixture to set up and reset the iroha_cli state.""" allure.dynamic.label("sdk", "Client CLI") allure.dynamic.label("owner", "astrokov") yield - client_cli.reset() + iroha_cli.reset() # Fixtures for creating objects (domains, accounts, asset definitions, assets) @@ -50,7 +50,7 @@ def GIVEN_registered_domain(): """Fixture to create and register a domain.""" domain = Domain(fake_name()) with allure.step(f"GIVEN a registered domain {domain.name}"): - client_cli.register().domain(domain.name) + iroha_cli.register().domain(domain.name) return domain @@ -60,7 +60,7 @@ def GIVEN_registered_domain_with_uppercase_letter(GIVEN_registered_domain): domain = GIVEN_registered_domain domain.name = name_with_uppercase_letter(domain.name) with allure.step(f"GIVEN a registered domain {domain.name}"): - client_cli.register().domain(domain.name) + iroha_cli.register().domain(domain.name) return domain @@ -71,9 +71,7 @@ def GIVEN_registered_account(GIVEN_registered_domain, GIVEN_public_key): with allure.step( f'GIVEN the account "{GIVEN_public_key}" in the "{GIVEN_registered_domain.name}" domain' ): - client_cli.register().account( - signatory=account.signatory, domain=account.domain - ) + iroha_cli.register().account(signatory=account.signatory, domain=account.domain) return account @@ -109,12 +107,12 @@ def GIVEN_currently_account_quantity_with_two_quantity_of_asset( f'GIVEN the asset_definition "{name}" ' f'in the "{GIVEN_currently_authorized_account.domain}" domain' ): - client_cli.register().asset_definition( + iroha_cli.register().asset_definition( asset=asset.definition.name, domain=asset.definition.domain, type_=asset.definition.type_, ) - client_cli.mint().asset( + iroha_cli.mint().asset( account=GIVEN_currently_authorized_account, asset_definition=asset.definition, value_of_type=asset.value, @@ -140,12 +138,12 @@ def GIVEN_numeric_asset_for_account( with allure.step( f'GIVEN the asset_definition "{asset_def.name}" ' f'in the "{domain}" domain' ): - client_cli.register().asset_definition( + iroha_cli.register().asset_definition( asset=asset.definition.name, domain=asset.definition.domain, type_=asset.definition.type_, ) - client_cli.mint().asset( + iroha_cli.mint().asset( account=account, asset_definition=asset.definition, value_of_type=asset.value, @@ -168,7 +166,7 @@ def GIVEN_registered_asset_definition_with_numeric_type( f'GIVEN the asset_definition "{GIVEN_fake_asset_name}" ' f'in the "{GIVEN_registered_domain.name}" domain' ): - client_cli.register().asset_definition( + iroha_cli.register().asset_definition( asset=asset_def.name, domain=asset_def.domain, type_=asset_def.type_, @@ -190,7 +188,7 @@ def GIVEN_minted_asset_quantity( definition=GIVEN_registered_asset_definition_with_numeric_type, value=GIVEN_numeric_value, ) - client_cli.mint().asset( + iroha_cli.mint().asset( account=asset.account, asset_definition=asset.definition, value_of_type=asset.value, @@ -212,7 +210,7 @@ def GIVEN_registered_asset_definition_with_store_type( f'GIVEN the asset_definition "{GIVEN_fake_asset_name}" ' f'in the "{GIVEN_registered_domain.name}" domain' ): - client_cli.register().asset_definition( + iroha_cli.register().asset_definition( asset=asset_def.name, domain=asset_def.domain, type=asset_def.type, diff --git a/pytests/iroha_cli_tests/test/domains/__init__.py b/pytests/iroha_cli_tests/test/domains/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/client_cli/pytests/test/domains/conftest.py b/pytests/iroha_cli_tests/test/domains/conftest.py similarity index 96% rename from client_cli/pytests/test/domains/conftest.py rename to pytests/iroha_cli_tests/test/domains/conftest.py index 0e887961c09..0edc4ac3e6f 100644 --- a/client_cli/pytests/test/domains/conftest.py +++ b/pytests/iroha_cli_tests/test/domains/conftest.py @@ -1,4 +1,4 @@ -from test import ( +from .. import ( GIVEN_128_length_name, GIVEN_129_length_name, GIVEN_currently_authorized_account, diff --git a/client_cli/pytests/test/domains/test_domains_query_filters.py b/pytests/iroha_cli_tests/test/domains/test_domains_query_filters.py similarity index 81% rename from client_cli/pytests/test/domains/test_domains_query_filters.py rename to pytests/iroha_cli_tests/test/domains/test_domains_query_filters.py index ac9d518cd3f..4c365012825 100644 --- a/client_cli/pytests/test/domains/test_domains_query_filters.py +++ b/pytests/iroha_cli_tests/test/domains/test_domains_query_filters.py @@ -2,14 +2,14 @@ import allure # type: ignore -from src.client_cli import client_cli, iroha +from ...src.iroha_cli import iroha_cli, iroha def test_filter_by_domain(GIVEN_registered_domain): def condition(): domain_name = GIVEN_registered_domain.name with allure.step( - f'WHEN client_cli query domains filtered by name "{domain_name}"' + f'WHEN iroha_cli query domains filtered by name "{domain_name}"' ): domains = iroha.list_filter( {"Atom": {"Id": {"Equals": domain_name}}} @@ -24,4 +24,4 @@ def condition(): ) return domains and all(domain == domain_name for domain in domains) - client_cli.wait_for(condition) + iroha_cli.wait_for(condition) diff --git a/client_cli/pytests/test/domains/test_register_domains.py b/pytests/iroha_cli_tests/test/domains/test_register_domains.py similarity index 56% rename from client_cli/pytests/test/domains/test_register_domains.py rename to pytests/iroha_cli_tests/test/domains/test_register_domains.py index 4b9752c9b5d..b589188de8b 100644 --- a/client_cli/pytests/test/domains/test_register_domains.py +++ b/pytests/iroha_cli_tests/test/domains/test_register_domains.py @@ -1,8 +1,8 @@ import allure # type: ignore import pytest -from common.consts import Stderr -from src.client_cli import client_cli, have, iroha +from ...common.consts import Stderr +from ...src.iroha_cli import iroha_cli, have, iroha @pytest.fixture(scope="function", autouse=True) @@ -13,8 +13,8 @@ def story_account_registers_domain(): @allure.label("sdk_test_id", "register_domain") def test_register_domain(GIVEN_fake_name): - with allure.step(f'WHEN client_cli registers the domain name "{GIVEN_fake_name}"'): - client_cli.execute(f"domain register --id={GIVEN_fake_name}") + with allure.step(f'WHEN iroha_cli registers the domain name "{GIVEN_fake_name}"'): + iroha_cli.execute(f"domain register --id={GIVEN_fake_name}") with allure.step(f'THEN Iroha should have the domain name "{GIVEN_fake_name}"'): iroha.should(have.domain(GIVEN_fake_name)) @@ -23,22 +23,22 @@ def test_register_domain(GIVEN_fake_name): def test_register_empty_domain( # GIVEN_empty_string ): - with allure.step("WHEN client_cli registers an empty domain"): - client_cli.register().domain("") - with allure.step(f'THEN client_cli should have the domain error: "{Stderr.EMPTY}"'): - client_cli.should(have.error(Stderr.EMPTY.value)) + with allure.step("WHEN iroha_cli registers an empty domain"): + iroha_cli.register().domain("") + with allure.step(f'THEN iroha_cli should have the domain error: "{Stderr.EMPTY}"'): + iroha_cli.should(have.error(Stderr.EMPTY.value)) @allure.label("sdk_test_id", "register_existing_domain") def test_register_existing_domain(GIVEN_registered_domain): with allure.step( - f'WHEN client_cli registers an existing domain "{GIVEN_registered_domain.name}"' + f'WHEN iroha_cli registers an existing domain "{GIVEN_registered_domain.name}"' ): - client_cli.register().domain(GIVEN_registered_domain.name) + iroha_cli.register().domain(GIVEN_registered_domain.name) with allure.step( - f'THEN client_cli should have the domain error: "{GIVEN_registered_domain.name}"' + f'THEN iroha_cli should have the domain error: "{GIVEN_registered_domain.name}"' ): - client_cli.should(have.error(Stderr.REPETITION.value)) + iroha_cli.should(have.error(Stderr.REPETITION.value)) @allure.label("sdk_test_id", "register_existing_domain_with_uppercase_letter") @@ -46,10 +46,10 @@ def test_register_existing_domain_uppercase_with_uppercase_letter( GIVEN_registered_domain_with_uppercase_letter, ): with allure.step( - f"WHEN client_cli registers an existing domain, " + f"WHEN iroha_cli registers an existing domain, " f'but with uppercase letter "{GIVEN_registered_domain_with_uppercase_letter.name}"' ): - client_cli.register().domain(GIVEN_registered_domain_with_uppercase_letter.name) + iroha_cli.register().domain(GIVEN_registered_domain_with_uppercase_letter.name) with allure.step( f'THEN Iroha should have the domain name "{GIVEN_registered_domain_with_uppercase_letter.name}"' ): @@ -59,9 +59,9 @@ def test_register_existing_domain_uppercase_with_uppercase_letter( @allure.label("sdk_test_id", "register_one_letter_domain") def test_register_one_letter_domain(GIVEN_random_character): with allure.step( - f'WHEN client_cli registers the one letter domain "{GIVEN_random_character}"' + f'WHEN iroha_cli registers the one letter domain "{GIVEN_random_character}"' ): - client_cli.register().domain(GIVEN_random_character) + iroha_cli.register().domain(GIVEN_random_character) with allure.step(f'THEN Iroha should have the domain "{GIVEN_random_character}"'): iroha.should(have.domain(GIVEN_random_character)) @@ -69,23 +69,23 @@ def test_register_one_letter_domain(GIVEN_random_character): @allure.label("sdk_test_id", "register_domain_with_reserved_character") def test_register_domain_with_reserved_character(GIVEN_string_with_reserved_character): with allure.step( - f'WHEN client_cli registers a domain "' + f'WHEN iroha_cli registers a domain "' f'{GIVEN_string_with_reserved_character}" with reserved characters' ): - client_cli.register().domain(GIVEN_string_with_reserved_character) + iroha_cli.register().domain(GIVEN_string_with_reserved_character) with allure.step( - f'THEN client_cli should has the domain error: "{Stderr.RESERVED_CHARACTER.value}"' + f'THEN iroha_cli should has the domain error: "{Stderr.RESERVED_CHARACTER.value}"' ): - client_cli.should(have.error(Stderr.RESERVED_CHARACTER.value)) + iroha_cli.should(have.error(Stderr.RESERVED_CHARACTER.value)) @allure.label("sdk_test_id", "register_domain_with_whitespaces") def test_register_domain_with_whitespaces(GIVEN_string_with_whitespaces): with allure.step( - f'WHEN client_cli registers a domain "{GIVEN_string_with_whitespaces}" with whitespaces' + f'WHEN iroha_cli registers a domain "{GIVEN_string_with_whitespaces}" with whitespaces' ): - client_cli.register().domain(GIVEN_string_with_whitespaces) + iroha_cli.register().domain(GIVEN_string_with_whitespaces) with allure.step( - f'THEN client_cli should has the domain error: "{Stderr.WHITESPACES.value}"' + f'THEN iroha_cli should has the domain error: "{Stderr.WHITESPACES.value}"' ): - client_cli.should(have.error(Stderr.WHITESPACES.value)) + iroha_cli.should(have.error(Stderr.WHITESPACES.value)) diff --git a/client_cli/pytests/test/domains/test_transfer_domains.py b/pytests/iroha_cli_tests/test/domains/test_transfer_domains.py similarity index 92% rename from client_cli/pytests/test/domains/test_transfer_domains.py rename to pytests/iroha_cli_tests/test/domains/test_transfer_domains.py index 430f95e692c..9e4a6791b83 100644 --- a/client_cli/pytests/test/domains/test_transfer_domains.py +++ b/pytests/iroha_cli_tests/test/domains/test_transfer_domains.py @@ -1,7 +1,7 @@ import allure # type: ignore import pytest -from src.client_cli import client_cli, have, iroha +from ...src.iroha_cli import iroha_cli, have, iroha @pytest.fixture(scope="function", autouse=True) @@ -20,7 +20,7 @@ def test_transfer_domain( f"WHEN {GIVEN_currently_authorized_account} transfers domains " f"to {GIVEN_registered_account}" ): - client_cli.execute( + iroha_cli.execute( f"domain transfer " f"--from={GIVEN_currently_authorized_account} " f"--to={GIVEN_registered_account} " diff --git a/pytests/iroha_cli_tests/test/triggers/__init__.py b/pytests/iroha_cli_tests/test/triggers/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/client_cli/pytests/test/triggers/conftest.py b/pytests/iroha_cli_tests/test/triggers/conftest.py similarity index 75% rename from client_cli/pytests/test/triggers/conftest.py rename to pytests/iroha_cli_tests/test/triggers/conftest.py index be5e82bd37e..912ce49bce2 100644 --- a/client_cli/pytests/test/triggers/conftest.py +++ b/pytests/iroha_cli_tests/test/triggers/conftest.py @@ -1,4 +1,4 @@ -from test import GIVEN_currently_authorized_account +from .. import GIVEN_currently_authorized_account import allure # type: ignore import pytest diff --git a/client_cli/pytests/test/triggers/test_register_trigger.py b/pytests/iroha_cli_tests/test/triggers/test_register_trigger.py similarity index 81% rename from client_cli/pytests/test/triggers/test_register_trigger.py rename to pytests/iroha_cli_tests/test/triggers/test_register_trigger.py index b9164bbabe5..05a88c6e9f1 100644 --- a/client_cli/pytests/test/triggers/test_register_trigger.py +++ b/pytests/iroha_cli_tests/test/triggers/test_register_trigger.py @@ -1,7 +1,7 @@ import allure # type: ignore import pytest -from src.client_cli import client_cli, have, iroha +from ...src.iroha_cli import iroha_cli, have, iroha @pytest.fixture(scope="function", autouse=True) @@ -14,9 +14,9 @@ def story_account_registers_trigger(): @pytest.mark.xfail(reason="wait for #4151") def test_register_trigger(GIVEN_currently_authorized_account): with allure.step( - f'WHEN client_cli registers a register_trigger for "{GIVEN_currently_authorized_account}"' + f'WHEN iroha_cli registers a register_trigger for "{GIVEN_currently_authorized_account}"' ): - client_cli.register_trigger(GIVEN_currently_authorized_account) + iroha_cli.register_trigger(GIVEN_currently_authorized_account) with allure.step( "THEN Iroha should have the asset with nft_number_1_for_genesis##\ ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4@genesis" diff --git a/torii/pytests/README.md b/pytests/iroha_torii_tests/README.md similarity index 100% rename from torii/pytests/README.md rename to pytests/iroha_torii_tests/README.md diff --git a/pytests/iroha_torii_tests/__init__.py b/pytests/iroha_torii_tests/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/pytests/iroha_torii_tests/common/__init__.py b/pytests/iroha_torii_tests/common/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/torii/pytests/common/schemas/get_configuration_response_schema.json b/pytests/iroha_torii_tests/common/schemas/get_configuration_response_schema.json similarity index 100% rename from torii/pytests/common/schemas/get_configuration_response_schema.json rename to pytests/iroha_torii_tests/common/schemas/get_configuration_response_schema.json diff --git a/torii/pytests/common/schemas/get_schema_response.json b/pytests/iroha_torii_tests/common/schemas/get_schema_response.json similarity index 100% rename from torii/pytests/common/schemas/get_schema_response.json rename to pytests/iroha_torii_tests/common/schemas/get_schema_response.json diff --git a/torii/pytests/common/schemas/get_status_response.json b/pytests/iroha_torii_tests/common/schemas/get_status_response.json similarity index 100% rename from torii/pytests/common/schemas/get_status_response.json rename to pytests/iroha_torii_tests/common/schemas/get_status_response.json diff --git a/torii/pytests/common/settings.py b/pytests/iroha_torii_tests/common/settings.py similarity index 100% rename from torii/pytests/common/settings.py rename to pytests/iroha_torii_tests/common/settings.py diff --git a/torii/pytests/poetry.lock b/pytests/iroha_torii_tests/poetry.lock similarity index 100% rename from torii/pytests/poetry.lock rename to pytests/iroha_torii_tests/poetry.lock diff --git a/torii/pytests/pyproject.toml b/pytests/iroha_torii_tests/pyproject.toml similarity index 94% rename from torii/pytests/pyproject.toml rename to pytests/iroha_torii_tests/pyproject.toml index dae400337db..d030201a66e 100644 --- a/torii/pytests/pyproject.toml +++ b/pytests/iroha_torii_tests/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "iroha2-torii-api-tests" +name = "iroha_torii_tests" version = "0.1.0" description = "" authors = ["alexstroke <111361420+astrokov7@users.noreply.github.com>"] diff --git a/torii/pytests/test/__init__.py b/pytests/iroha_torii_tests/test/__init__.py similarity index 100% rename from torii/pytests/test/__init__.py rename to pytests/iroha_torii_tests/test/__init__.py diff --git a/pytests/iroha_torii_tests/test/api_version/__init__.py b/pytests/iroha_torii_tests/test/api_version/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/torii/pytests/test/api_version/conftest.py b/pytests/iroha_torii_tests/test/api_version/conftest.py similarity index 87% rename from torii/pytests/test/api_version/conftest.py rename to pytests/iroha_torii_tests/test/api_version/conftest.py index 26895d3c099..c67d080f3e5 100644 --- a/torii/pytests/test/api_version/conftest.py +++ b/pytests/iroha_torii_tests/test/api_version/conftest.py @@ -1,11 +1,11 @@ -from test import GIVEN_api_up_and_running +from .. import GIVEN_api_up_and_running import allure import pytest import requests -from common.settings import BASE_URL +from ...common.settings import BASE_URL @pytest.fixture(scope="module") diff --git a/torii/pytests/test/api_version/test_api_version.py b/pytests/iroha_torii_tests/test/api_version/test_api_version.py similarity index 98% rename from torii/pytests/test/api_version/test_api_version.py rename to pytests/iroha_torii_tests/test/api_version/test_api_version.py index c21c6b2e957..fc9c3d66ce8 100644 --- a/torii/pytests/test/api_version/test_api_version.py +++ b/pytests/iroha_torii_tests/test/api_version/test_api_version.py @@ -5,7 +5,7 @@ import pytest import allure -from common.settings import BASE_URL +from ...common.settings import BASE_URL @pytest.fixture(scope="function", autouse=True) diff --git a/pytests/iroha_torii_tests/test/configuration/__init__.py b/pytests/iroha_torii_tests/test/configuration/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/torii/pytests/test/configuration/conftest.py b/pytests/iroha_torii_tests/test/configuration/conftest.py similarity index 95% rename from torii/pytests/test/configuration/conftest.py rename to pytests/iroha_torii_tests/test/configuration/conftest.py index ac976c6b325..a1f5d820579 100644 --- a/torii/pytests/test/configuration/conftest.py +++ b/pytests/iroha_torii_tests/test/configuration/conftest.py @@ -3,7 +3,7 @@ import requests -from common.settings import BASE_URL +from ...common.settings import BASE_URL @pytest.fixture(scope="module") diff --git a/torii/pytests/test/configuration/test_get_configuration.py b/pytests/iroha_torii_tests/test/configuration/test_get_configuration.py similarity index 99% rename from torii/pytests/test/configuration/test_get_configuration.py rename to pytests/iroha_torii_tests/test/configuration/test_get_configuration.py index 9e4eaef2fca..422f6800452 100644 --- a/torii/pytests/test/configuration/test_get_configuration.py +++ b/pytests/iroha_torii_tests/test/configuration/test_get_configuration.py @@ -8,7 +8,7 @@ from jsonschema import validate from jsonschema.exceptions import ValidationError -from common.settings import BASE_URL +from ...common.settings import BASE_URL valid_log_levels = ["trace", "debug", "info", "warn", "error"] diff --git a/torii/pytests/test/configuration/test_post_configuration.py b/pytests/iroha_torii_tests/test/configuration/test_post_configuration.py similarity index 98% rename from torii/pytests/test/configuration/test_post_configuration.py rename to pytests/iroha_torii_tests/test/configuration/test_post_configuration.py index 06f917d05df..1b235bbd4fc 100644 --- a/torii/pytests/test/configuration/test_post_configuration.py +++ b/pytests/iroha_torii_tests/test/configuration/test_post_configuration.py @@ -5,7 +5,7 @@ from jsonschema import validate from jsonschema.exceptions import ValidationError -from common.settings import BASE_URL +from ...common.settings import BASE_URL valid_log_levels = ["trace", "debug", "info", "warn", "error"] diff --git a/torii/pytests/test/conftest.py b/pytests/iroha_torii_tests/test/conftest.py similarity index 100% rename from torii/pytests/test/conftest.py rename to pytests/iroha_torii_tests/test/conftest.py diff --git a/pytests/iroha_torii_tests/test/general/__init__.py b/pytests/iroha_torii_tests/test/general/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/pytests/iroha_torii_tests/test/general/conftest.py b/pytests/iroha_torii_tests/test/general/conftest.py new file mode 100644 index 00000000000..2b7de243d04 --- /dev/null +++ b/pytests/iroha_torii_tests/test/general/conftest.py @@ -0,0 +1 @@ +from .. import GIVEN_api_up_and_running diff --git a/torii/pytests/test/general/test_200_status_codes.py b/pytests/iroha_torii_tests/test/general/test_200_status_codes.py similarity index 99% rename from torii/pytests/test/general/test_200_status_codes.py rename to pytests/iroha_torii_tests/test/general/test_200_status_codes.py index 2b5db7c0d2a..0b8d294f157 100644 --- a/torii/pytests/test/general/test_200_status_codes.py +++ b/pytests/iroha_torii_tests/test/general/test_200_status_codes.py @@ -3,7 +3,7 @@ import requests import json -from common.settings import BASE_URL +from ...common.settings import BASE_URL @pytest.fixture(scope="function", autouse=True) diff --git a/torii/pytests/test/general/test_400_status_codes.py b/pytests/iroha_torii_tests/test/general/test_400_status_codes.py similarity index 96% rename from torii/pytests/test/general/test_400_status_codes.py rename to pytests/iroha_torii_tests/test/general/test_400_status_codes.py index 7fa72b4cbe1..5e2e4ef6f80 100644 --- a/torii/pytests/test/general/test_400_status_codes.py +++ b/pytests/iroha_torii_tests/test/general/test_400_status_codes.py @@ -2,7 +2,7 @@ import pytest import requests -from common.settings import BASE_URL +from ...common.settings import BASE_URL @pytest.fixture(scope="function", autouse=True) diff --git a/pytests/iroha_torii_tests/test/health/__init__.py b/pytests/iroha_torii_tests/test/health/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/torii/pytests/test/health/conftest.py b/pytests/iroha_torii_tests/test/health/conftest.py similarity index 86% rename from torii/pytests/test/health/conftest.py rename to pytests/iroha_torii_tests/test/health/conftest.py index ea4fe940154..44df4f13e4a 100644 --- a/torii/pytests/test/health/conftest.py +++ b/pytests/iroha_torii_tests/test/health/conftest.py @@ -1,11 +1,11 @@ -from test import GIVEN_api_up_and_running +from .. import GIVEN_api_up_and_running import allure import pytest import requests -from common.settings import BASE_URL +from ...common.settings import BASE_URL @pytest.fixture(scope="module") diff --git a/torii/pytests/test/health/test_health.py b/pytests/iroha_torii_tests/test/health/test_health.py similarity index 98% rename from torii/pytests/test/health/test_health.py rename to pytests/iroha_torii_tests/test/health/test_health.py index 587de8452e3..2e6b0d625b9 100644 --- a/torii/pytests/test/health/test_health.py +++ b/pytests/iroha_torii_tests/test/health/test_health.py @@ -4,7 +4,7 @@ import pytest import allure -from common.settings import BASE_URL +from ...common.settings import BASE_URL @pytest.fixture(scope="function", autouse=True) diff --git a/pytests/iroha_torii_tests/test/schema/__init__.py b/pytests/iroha_torii_tests/test/schema/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/torii/pytests/test/schema/conftest.py b/pytests/iroha_torii_tests/test/schema/conftest.py similarity index 92% rename from torii/pytests/test/schema/conftest.py rename to pytests/iroha_torii_tests/test/schema/conftest.py index 27a82e6b434..1b474f7fb47 100644 --- a/torii/pytests/test/schema/conftest.py +++ b/pytests/iroha_torii_tests/test/schema/conftest.py @@ -3,7 +3,7 @@ import requests -from common.settings import BASE_URL +from ...common.settings import BASE_URL @pytest.fixture(scope="module") diff --git a/torii/pytests/test/schema/test_schema.py b/pytests/iroha_torii_tests/test/schema/test_schema.py similarity index 98% rename from torii/pytests/test/schema/test_schema.py rename to pytests/iroha_torii_tests/test/schema/test_schema.py index e737a47060c..8fe587dcdbd 100644 --- a/torii/pytests/test/schema/test_schema.py +++ b/pytests/iroha_torii_tests/test/schema/test_schema.py @@ -8,7 +8,7 @@ from jsonschema import validate from jsonschema.exceptions import ValidationError -from common.settings import BASE_URL +from ...common.settings import BASE_URL @pytest.fixture(scope="function", autouse=True) diff --git a/pytests/iroha_torii_tests/test/status/__init__.py b/pytests/iroha_torii_tests/test/status/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/torii/pytests/test/status/conftest.py b/pytests/iroha_torii_tests/test/status/conftest.py similarity index 92% rename from torii/pytests/test/status/conftest.py rename to pytests/iroha_torii_tests/test/status/conftest.py index b477261e064..b76378bec06 100644 --- a/torii/pytests/test/status/conftest.py +++ b/pytests/iroha_torii_tests/test/status/conftest.py @@ -3,7 +3,7 @@ import requests -from common.settings import BASE_URL +from ...common.settings import BASE_URL @pytest.fixture(scope="module") diff --git a/torii/pytests/test/status/test_status.py b/pytests/iroha_torii_tests/test/status/test_status.py similarity index 98% rename from torii/pytests/test/status/test_status.py rename to pytests/iroha_torii_tests/test/status/test_status.py index b6ec8182a99..05021070f23 100644 --- a/torii/pytests/test/status/test_status.py +++ b/pytests/iroha_torii_tests/test/status/test_status.py @@ -8,7 +8,7 @@ from jsonschema import validate from jsonschema.exceptions import ValidationError -from common.settings import BASE_URL +from ...common.settings import BASE_URL @pytest.fixture(scope="function", autouse=True) diff --git a/scripts/tests/consistency.sh b/scripts/tests/consistency.sh index 133a6d1ddae..918ccef1a3a 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 - defaults/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 > ./defaults/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/tools/wasm_builder_cli/Cargo.toml b/tools/wasm_builder_cli/Cargo.toml deleted file mode 100644 index 91deae67674..00000000000 --- a/tools/wasm_builder_cli/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "iroha_wasm_builder_cli" - -edition.workspace = true -version.workspace = true -authors.workspace = true -license.workspace = true - -[lints] -workspace = true - -[[bin]] -name = "iroha_wasm_builder" -path = "src/main.rs" - -[dependencies] -iroha_wasm_builder.workspace = true - -clap = { workspace = true, features = ["derive"] } -color-eyre.workspace = true -spinoff = { workspace = true, features = ["binary"] } -owo-colors = { workspace = true, features = ["supports-colors"] } diff --git a/torii/pytests/test/general/conftest.py b/torii/pytests/test/general/conftest.py deleted file mode 100644 index b20dcc25f4f..00000000000 --- a/torii/pytests/test/general/conftest.py +++ /dev/null @@ -1 +0,0 @@ -from test import GIVEN_api_up_and_running diff --git a/wasm_samples/Cargo.toml b/wasm_samples/Cargo.toml index a28a1c0892e..6ebcb8fb9e5 100644 --- a/wasm_samples/Cargo.toml +++ b/wasm_samples/Cargo.toml @@ -40,12 +40,12 @@ 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-rc.1.0", path = "../smart_contract", features = ["debug"] } -iroha_trigger = { version = "=2.0.0-rc.1.0", path = "../smart_contract/trigger", features = ["debug"] } -iroha_executor = { version = "=2.0.0-rc.1.0", path = "../smart_contract/executor", features = ["debug"] } -iroha_schema = { version = "=2.0.0-rc.1.0", path = "../schema" } -iroha_data_model = { version = "=2.0.0-rc.1.0", path = "../data_model", default-features = false } -iroha_executor_data_model = { version = "=2.0.0-rc.1.0", path = "../smart_contract/executor/data_model" } +iroha_smart_contract = { version = "=2.0.0-rc.1.0", path = "../crates/iroha_smart_contract", features = ["debug"] } +iroha_trigger = { version = "=2.0.0-rc.1.0", path = "../crates/iroha_trigger", features = ["debug"] } +iroha_executor = { version = "=2.0.0-rc.1.0", path = "../crates/iroha_executor", features = ["debug"] } +iroha_schema = { version = "=2.0.0-rc.1.0", path = "../crates/iroha_schema" } +iroha_data_model = { version = "=2.0.0-rc.1.0", path = "../crates/iroha_data_model", default-features = false } +iroha_executor_data_model = { version = "=2.0.0-rc.1.0", path = "../crates/iroha_executor_data_model" } parity-scale-codec = { version = "3.2.1", default-features = false } anyhow = { version = "1.0.71", default-features = false } diff --git a/wasm_samples/default_executor/README.md b/wasm_samples/default_executor/README.md index d5571035d9e..f273a8dac61 100644 --- a/wasm_samples/default_executor/README.md +++ b/wasm_samples/default_executor/README.md @@ -1,6 +1,6 @@ # `iroha_default_executor` -Use the [Wasm Builder CLI](../../tools/wasm_builder_cli) in order to build it: +Use the [Wasm Builder CLI](../../crates/iroha_wasm_builder) in order to build it: ```bash cargo run --bin iroha_wasm_builder -- \ diff --git a/wasm_samples/multisig/Cargo.toml b/wasm_samples/multisig/Cargo.toml index b2c708c206f..c84fa2d037f 100644 --- a/wasm_samples/multisig/Cargo.toml +++ b/wasm_samples/multisig/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, default-features = false } [build-dependencies] -iroha_wasm_builder = { version = "=2.0.0-rc.1.0", path = "../../wasm_builder" } +iroha_wasm_builder = { version = "=2.0.0-rc.1.0", path = "../../crates/iroha_wasm_builder" } diff --git a/wasm_samples/multisig_register/Cargo.toml b/wasm_samples/multisig_register/Cargo.toml index 84265713e66..042a19d6e53 100644 --- a/wasm_samples/multisig_register/Cargo.toml +++ b/wasm_samples/multisig_register/Cargo.toml @@ -23,4 +23,4 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, default-features = false } [build-dependencies] -iroha_wasm_builder = { version = "=2.0.0-rc.1.0", path = "../../wasm_builder" } +iroha_wasm_builder = { version = "=2.0.0-rc.1.0", path = "../../crates/iroha_wasm_builder" }