From 35d057ff92a89f431d6b2ab0aaf3116c5b129890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Ver=C5=A1i=C4=87?= Date: Tue, 28 May 2024 18:42:24 +0300 Subject: [PATCH] fix(docker): update docker compose files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marin Veršić --- .github/workflows/iroha2-dev-code-quality.yml | 4 +-- .github/workflows/iroha2-dev-pr.yml | 8 ++--- .github/workflows/iroha2-dev.yml | 8 ++--- config/base/src/util.rs | 12 +++---- configs/swarm/docker-compose.local.yml | 34 +++++++++---------- configs/swarm/docker-compose.single.yml | 8 ++--- configs/swarm/docker-compose.yml | 34 +++++++++---------- core/benches/validation.rs | 2 +- core/src/block.rs | 2 +- core/src/queue.rs | 2 +- core/src/smartcontracts/isi/triggers/set.rs | 4 +-- core/src/sumeragi/main_loop.rs | 2 +- data_model/src/query/predicate.rs | 20 +++++------ smart_contract/src/lib.rs | 6 ++-- 14 files changed, 73 insertions(+), 73 deletions(-) diff --git a/.github/workflows/iroha2-dev-code-quality.yml b/.github/workflows/iroha2-dev-code-quality.yml index b5731cd3257..8c83fad2bf9 100644 --- a/.github/workflows/iroha2-dev-code-quality.yml +++ b/.github/workflows/iroha2-dev-code-quality.yml @@ -44,8 +44,8 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Run tests, with coverage run: | - mold --run cargo test --all-features --no-fail-fast --workspace --exclude iroha_client - mold --run cargo test --all-features --no-fail-fast -p iroha_client -- --skip integration + mold --run cargo test --all-features --no-fail-fast --workspace --exclude iroha + mold --run cargo test --all-features --no-fail-fast -p iroha -- --skip integration env: RUSTFLAGS: "-C instrument-coverage" LLVM_PROFILE_FILE: "iroha-%p-%m.profraw" diff --git a/.github/workflows/iroha2-dev-pr.yml b/.github/workflows/iroha2-dev-pr.yml index ad69a5e1601..38862c91740 100644 --- a/.github/workflows/iroha2-dev-pr.yml +++ b/.github/workflows/iroha2-dev-pr.yml @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - name: Run tests, with no-default-features - run: mold --run cargo test --no-default-features --no-fail-fast -p iroha_client integration -- --skip extra_functional + run: mold --run cargo test --no-default-features --no-fail-fast -p iroha integration -- --skip extra_functional # include: client/tests/integration/extra_functional extra_functional: @@ -60,7 +60,7 @@ jobs: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - name: Run tests - run: mold --run cargo test --no-default-features --no-fail-fast -p iroha_client extra_functional + run: mold --run cargo test --no-default-features --no-fail-fast -p iroha extra_functional # Run the job to check that the docker containers are properly buildable pr-generator-build: @@ -105,7 +105,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Build binaries run: | - cargo build -p iroha_client_cli -p kagami -p iroha + cargo build -p iroha_client_cli -p kagami -p irohad - name: Setup test Iroha 2 environment on the bare metal run: | pip3 install -r scripts/requirements.txt --no-input --break-system-packages @@ -129,7 +129,7 @@ jobs: working-directory: client_cli/pytests env: # prepared by `test_env.py` - CLIENT_CLI_BINARY: ../../test/iroha_client_cli + CLIENT_CLI_BINARY: ../../test/iroha CLIENT_CLI_CONFIG: ../../test/client.toml run: | poetry run pytest diff --git a/.github/workflows/iroha2-dev.yml b/.github/workflows/iroha2-dev.yml index 7a20a73af5a..fb2cf76e9b7 100644 --- a/.github/workflows/iroha2-dev.yml +++ b/.github/workflows/iroha2-dev.yml @@ -78,11 +78,11 @@ jobs: with: name: cargo-build-release path: target/release/iroha - - name: Archive iroha_client_cli + - name: Archive Iroha client CLI uses: actions/upload-artifact@v3 with: name: cargo-client-cli-build-release - path: target/release/iroha_client_cli + path: target/release/iroha - name: Archive kagami uses: actions/upload-artifact@v3 with: @@ -112,11 +112,11 @@ jobs: TELEMETRY_FILE: ../target/telemetry/debug.json.lz4 run: | mkdir -p target/telemetry - mold --run cargo test -p iroha_client --all-features -- unstable_network || true + mold --run cargo test -p iroha --all-features -- unstable_network || true - name: Run release tests and save telemetry env: TELEMETRY_FILE: ../target/telemetry/release.json.lz4 - run: mold --run cargo test -p iroha_client --all-features --release -- unstable_network || true + run: mold --run cargo test -p iroha --all-features --release -- unstable_network || true - name: Install script dependencies run: | apt-get update diff --git a/config/base/src/util.rs b/config/base/src/util.rs index 99fa86131fa..33d82985c55 100644 --- a/config/base/src/util.rs +++ b/config/base/src/util.rs @@ -186,6 +186,12 @@ mod tests { extends: Option, } + impl ExtendsPaths { + fn as_str_vec(&self) -> Vec<&str> { + self.iter().map(|p| p.to_str().unwrap()).collect() + } + } + #[test] fn parse_empty_extends() { let value: TestExtends = toml::from_str("").expect("should be fine with empty input"); @@ -224,12 +230,6 @@ mod tests { #[test] fn iterating_over_extends() { - impl ExtendsPaths { - fn as_str_vec(&self) -> Vec<&str> { - self.iter().map(|p| p.to_str().unwrap()).collect() - } - } - let single = ExtendsPaths::Single("single".into()); assert_eq!(single.as_str_vec(), vec!["single"]); diff --git a/configs/swarm/docker-compose.local.yml b/configs/swarm/docker-compose.local.yml index 30714875c45..21bf2da9970 100644 --- a/configs/swarm/docker-compose.local.yml +++ b/configs/swarm/docker-compose.local.yml @@ -3,43 +3,43 @@ version: '3.8' services: - iroha0: + irohad0: build: ../.. platform: linux/amd64 environment: CHAIN_ID: 00000000-0000-0000-0000-000000000000 - PUBLIC_KEY: ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB - PRIVATE_KEY: 8026408F4C15E5D664DA3F13778801D23D4E89B76E94C1B94B389544168B6CB894F84F8BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB + PUBLIC_KEY: ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731 + PRIVATE_KEY: 802640418A3712F4841FFE7A90B14E90BF76A6EF2A2546AC8DBBB1F442FFB8250426B082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731 P2P_ADDRESS: 0.0.0.0:1337 API_ADDRESS: 0.0.0.0:8080 GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 GENESIS_PRIVATE_KEY: 80264082B3BDE54AEBECA4146257DA0DE8D59D8E46D5FE34887DCD8072866792FCB3AD4164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 GENESIS_FILE: /config/genesis.json - SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha1:1338","public_key":"ed0120815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F"},{"address":"iroha3:1340","public_key":"ed0120A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61"},{"address":"iroha2:1339","public_key":"ed0120F417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736"}]' + SUMERAGI_TRUSTED_PEERS: '[{"address":"irohad1:1338","public_key":"ed012083C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D"},{"address":"irohad2:1339","public_key":"ed0120A37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E"},{"address":"irohad3:1340","public_key":"ed0120B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E"}]' ports: - 1337:1337 - 8080:8080 volumes: - ./:/config init: true - command: iroha --submit-genesis + command: irohad --submit-genesis healthcheck: test: test $(curl -s http://127.0.0.1:8080/status/blocks) -gt 0 interval: 2s timeout: 1s retries: 30 start_period: 4s - iroha1: + irohad1: build: ../.. platform: linux/amd64 environment: CHAIN_ID: 00000000-0000-0000-0000-000000000000 - PUBLIC_KEY: ed0120815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F - PRIVATE_KEY: 802640C02FFAD5E455E7EC620D74DE5769681E4D8385906BCE5A437EB67452A9EFBBC2815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F + PUBLIC_KEY: ed012083C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D + PRIVATE_KEY: 8026403895C6FA512EF0C2D73DE2F2F2953C3F385ED636D9579BCC5022531228B8DBAF83C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D P2P_ADDRESS: 0.0.0.0:1338 API_ADDRESS: 0.0.0.0:8081 GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 - SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha0:1337","public_key":"ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB"},{"address":"iroha3:1340","public_key":"ed0120A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61"},{"address":"iroha2:1339","public_key":"ed0120F417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736"}]' + SUMERAGI_TRUSTED_PEERS: '[{"address":"irohad0:1337","public_key":"ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731"},{"address":"irohad2:1339","public_key":"ed0120A37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E"},{"address":"irohad3:1340","public_key":"ed0120B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E"}]' ports: - 1338:1338 - 8081:8081 @@ -52,17 +52,17 @@ services: timeout: 1s retries: 30 start_period: 4s - iroha2: + irohad2: build: ../.. platform: linux/amd64 environment: CHAIN_ID: 00000000-0000-0000-0000-000000000000 - PUBLIC_KEY: ed0120F417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736 - PRIVATE_KEY: 80264029C5ED1409CB10FD791BC4FF8A6CB5E22A5FAE7E36F448EF3EA2988B1319A88BF417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736 + PUBLIC_KEY: ed0120A37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E + PRIVATE_KEY: 802640DB566C53DFF72340CA72E690F882D67B75E47C6B1A5D7A1723B3B2082279BB9AA37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E P2P_ADDRESS: 0.0.0.0:1339 API_ADDRESS: 0.0.0.0:8082 GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 - SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha1:1338","public_key":"ed0120815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F"},{"address":"iroha0:1337","public_key":"ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB"},{"address":"iroha3:1340","public_key":"ed0120A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61"}]' + SUMERAGI_TRUSTED_PEERS: '[{"address":"irohad0:1337","public_key":"ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731"},{"address":"irohad1:1338","public_key":"ed012083C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D"},{"address":"irohad3:1340","public_key":"ed0120B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E"}]' ports: - 1339:1339 - 8082:8082 @@ -75,17 +75,17 @@ services: timeout: 1s retries: 30 start_period: 4s - iroha3: + irohad3: build: ../.. platform: linux/amd64 environment: CHAIN_ID: 00000000-0000-0000-0000-000000000000 - PUBLIC_KEY: ed0120A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61 - PRIVATE_KEY: 8026405EED4855FAD183C451AAC39DFC50831607E4CF408C98E2B977F3CE4A2DF42CE2A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61 + PUBLIC_KEY: ed0120B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E + PRIVATE_KEY: 802640E28031CC65994ADE240E32FCFD0405DF30A47BDD6ABAF76C8C3C5A4F3DE96F75B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E P2P_ADDRESS: 0.0.0.0:1340 API_ADDRESS: 0.0.0.0:8083 GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 - SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha1:1338","public_key":"ed0120815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F"},{"address":"iroha0:1337","public_key":"ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB"},{"address":"iroha2:1339","public_key":"ed0120F417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736"}]' + SUMERAGI_TRUSTED_PEERS: '[{"address":"irohad0:1337","public_key":"ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731"},{"address":"irohad1:1338","public_key":"ed012083C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D"},{"address":"irohad2:1339","public_key":"ed0120A37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E"}]' ports: - 1340:1340 - 8083:8083 diff --git a/configs/swarm/docker-compose.single.yml b/configs/swarm/docker-compose.single.yml index 8d307182477..59a454237af 100644 --- a/configs/swarm/docker-compose.single.yml +++ b/configs/swarm/docker-compose.single.yml @@ -3,13 +3,13 @@ version: '3.8' services: - iroha0: + irohad0: build: ../.. platform: linux/amd64 environment: CHAIN_ID: 00000000-0000-0000-0000-000000000000 - PUBLIC_KEY: ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB - PRIVATE_KEY: 8026408F4C15E5D664DA3F13778801D23D4E89B76E94C1B94B389544168B6CB894F84F8BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB + PUBLIC_KEY: ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731 + PRIVATE_KEY: 802640418A3712F4841FFE7A90B14E90BF76A6EF2A2546AC8DBBB1F442FFB8250426B082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731 P2P_ADDRESS: 0.0.0.0:1337 API_ADDRESS: 0.0.0.0:8080 GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 @@ -21,7 +21,7 @@ services: volumes: - ./:/config init: true - command: iroha --submit-genesis + command: irohad --submit-genesis healthcheck: test: test $(curl -s http://127.0.0.1:8080/status/blocks) -gt 0 interval: 2s diff --git a/configs/swarm/docker-compose.yml b/configs/swarm/docker-compose.yml index 5a9da79e2e9..9388026179e 100644 --- a/configs/swarm/docker-compose.yml +++ b/configs/swarm/docker-compose.yml @@ -3,43 +3,43 @@ version: '3.8' services: - iroha0: + irohad0: image: hyperledger/iroha:dev platform: linux/amd64 environment: CHAIN_ID: 00000000-0000-0000-0000-000000000000 - PUBLIC_KEY: ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB - PRIVATE_KEY: 8026408F4C15E5D664DA3F13778801D23D4E89B76E94C1B94B389544168B6CB894F84F8BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB + PUBLIC_KEY: ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731 + PRIVATE_KEY: 802640418A3712F4841FFE7A90B14E90BF76A6EF2A2546AC8DBBB1F442FFB8250426B082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731 P2P_ADDRESS: 0.0.0.0:1337 API_ADDRESS: 0.0.0.0:8080 GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 GENESIS_PRIVATE_KEY: 80264082B3BDE54AEBECA4146257DA0DE8D59D8E46D5FE34887DCD8072866792FCB3AD4164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 GENESIS_FILE: /config/genesis.json - SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha1:1338","public_key":"ed0120815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F"},{"address":"iroha3:1340","public_key":"ed0120A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61"},{"address":"iroha2:1339","public_key":"ed0120F417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736"}]' + SUMERAGI_TRUSTED_PEERS: '[{"address":"irohad1:1338","public_key":"ed012083C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D"},{"address":"irohad2:1339","public_key":"ed0120A37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E"},{"address":"irohad3:1340","public_key":"ed0120B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E"}]' ports: - 1337:1337 - 8080:8080 volumes: - ./:/config init: true - command: iroha --submit-genesis + command: irohad --submit-genesis healthcheck: test: test $(curl -s http://127.0.0.1:8080/status/blocks) -gt 0 interval: 2s timeout: 1s retries: 30 start_period: 4s - iroha1: + irohad1: image: hyperledger/iroha:dev platform: linux/amd64 environment: CHAIN_ID: 00000000-0000-0000-0000-000000000000 - PUBLIC_KEY: ed0120815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F - PRIVATE_KEY: 802640C02FFAD5E455E7EC620D74DE5769681E4D8385906BCE5A437EB67452A9EFBBC2815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F + PUBLIC_KEY: ed012083C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D + PRIVATE_KEY: 8026403895C6FA512EF0C2D73DE2F2F2953C3F385ED636D9579BCC5022531228B8DBAF83C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D P2P_ADDRESS: 0.0.0.0:1338 API_ADDRESS: 0.0.0.0:8081 GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 - SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha0:1337","public_key":"ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB"},{"address":"iroha3:1340","public_key":"ed0120A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61"},{"address":"iroha2:1339","public_key":"ed0120F417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736"}]' + SUMERAGI_TRUSTED_PEERS: '[{"address":"irohad0:1337","public_key":"ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731"},{"address":"irohad2:1339","public_key":"ed0120A37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E"},{"address":"irohad3:1340","public_key":"ed0120B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E"}]' ports: - 1338:1338 - 8081:8081 @@ -52,17 +52,17 @@ services: timeout: 1s retries: 30 start_period: 4s - iroha2: + irohad2: image: hyperledger/iroha:dev platform: linux/amd64 environment: CHAIN_ID: 00000000-0000-0000-0000-000000000000 - PUBLIC_KEY: ed0120F417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736 - PRIVATE_KEY: 80264029C5ED1409CB10FD791BC4FF8A6CB5E22A5FAE7E36F448EF3EA2988B1319A88BF417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736 + PUBLIC_KEY: ed0120A37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E + PRIVATE_KEY: 802640DB566C53DFF72340CA72E690F882D67B75E47C6B1A5D7A1723B3B2082279BB9AA37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E P2P_ADDRESS: 0.0.0.0:1339 API_ADDRESS: 0.0.0.0:8082 GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 - SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha1:1338","public_key":"ed0120815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F"},{"address":"iroha0:1337","public_key":"ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB"},{"address":"iroha3:1340","public_key":"ed0120A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61"}]' + SUMERAGI_TRUSTED_PEERS: '[{"address":"irohad0:1337","public_key":"ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731"},{"address":"irohad1:1338","public_key":"ed012083C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D"},{"address":"irohad3:1340","public_key":"ed0120B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E"}]' ports: - 1339:1339 - 8082:8082 @@ -75,17 +75,17 @@ services: timeout: 1s retries: 30 start_period: 4s - iroha3: + irohad3: image: hyperledger/iroha:dev platform: linux/amd64 environment: CHAIN_ID: 00000000-0000-0000-0000-000000000000 - PUBLIC_KEY: ed0120A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61 - PRIVATE_KEY: 8026405EED4855FAD183C451AAC39DFC50831607E4CF408C98E2B977F3CE4A2DF42CE2A66522370D60B9C09E79ADE2E9BB1EF2E78733A944B999B3A6AEE687CE476D61 + PUBLIC_KEY: ed0120B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E + PRIVATE_KEY: 802640E28031CC65994ADE240E32FCFD0405DF30A47BDD6ABAF76C8C3C5A4F3DE96F75B23E14F659B91736AAB980B6ADDCE4B1DB8A138AB0267E049C082A744471714E P2P_ADDRESS: 0.0.0.0:1340 API_ADDRESS: 0.0.0.0:8083 GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 - SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha1:1338","public_key":"ed0120815BBDC9775D28C3633269B25F22D048E2AA2E36017CBE5AD85F15220BEB6F6F"},{"address":"iroha0:1337","public_key":"ed01208BA62848CF767D72E7F7F4B9D2D7BA07FEE33760F79ABE5597A51520E292A0CB"},{"address":"iroha2:1339","public_key":"ed0120F417E0371E6ADB32FD66749477402B1AB67F84A8E9B082E997980CC91F327736"}]' + SUMERAGI_TRUSTED_PEERS: '[{"address":"irohad0:1337","public_key":"ed012082528CCC8727333530C8F6F19F70C23882DEB1BF2BA3BE4A6654C7E8A91A7731"},{"address":"irohad1:1338","public_key":"ed012083C85E315776FD2DDC187ECB23E608F800B313A1D614B108078EC048D5013D2D"},{"address":"irohad2:1339","public_key":"ed0120A37B7B758C952FE9429E9E35D1D71E2D8BB9364EDD077B5027ABAAC798D3230E"}]' ports: - 1340:1340 - 8083:8083 diff --git a/core/benches/validation.rs b/core/benches/validation.rs index da0917a18ef..54d7baab0dc 100644 --- a/core/benches/validation.rs +++ b/core/benches/validation.rs @@ -18,7 +18,7 @@ use once_cell::sync::Lazy; use test_samples::gen_account_in; static STARTER_DOMAIN: Lazy = Lazy::new(|| "start".parse().unwrap()); -static STARTER_KEYPAIR: Lazy = Lazy::new(|| KeyPair::random()); +static STARTER_KEYPAIR: Lazy = Lazy::new(KeyPair::random); static STARTER_ID: Lazy = Lazy::new(|| AccountId::new(STARTER_DOMAIN.clone(), STARTER_KEYPAIR.public_key().clone())); diff --git a/core/src/block.rs b/core/src/block.rs index dd2e717fc25..e4c1d30802d 100644 --- a/core/src/block.rs +++ b/core/src/block.rs @@ -569,7 +569,7 @@ mod valid { fn payload(block: &ValidBlock) -> &BlockPayload { let SignedBlock::V1(signed) = &block.0; - &signed.payload() + signed.payload() } #[test] diff --git a/core/src/queue.rs b/core/src/queue.rs index 645a5363a04..b60a880f13f 100644 --- a/core/src/queue.rs +++ b/core/src/queue.rs @@ -436,7 +436,7 @@ pub mod tests { let tx = TransactionBuilder::new_with_time_source(chain_id.clone(), account_id, time_source) .with_instructions(instructions) - .sign(&key_pair); + .sign(key_pair); let limits = TransactionLimits { max_instruction_number: 4096, max_wasm_size_bytes: 0, diff --git a/core/src/smartcontracts/isi/triggers/set.rs b/core/src/smartcontracts/isi/triggers/set.rs index 955d4229b96..f5baa02534b 100644 --- a/core/src/smartcontracts/isi/triggers/set.rs +++ b/core/src/smartcontracts/isi/triggers/set.rs @@ -412,13 +412,13 @@ pub trait SetReadOnly { /// Apply `f` to triggers that belong to the given [`DomainId`] /// /// Return an empty list if [`Set`] doesn't contain any triggers belonging to [`DomainId`]. - fn inspect_by_domain_id<'a, F: 'a, R>( + fn inspect_by_domain_id<'a, F, R>( &'a self, domain_id: &DomainId, f: F, ) -> impl Iterator + '_ where - F: Fn(&TriggerId, &dyn LoadedActionTrait) -> R, + F: Fn(&TriggerId, &dyn LoadedActionTrait) -> R + 'a, { let domain_id = domain_id.clone(); diff --git a/core/src/sumeragi/main_loop.rs b/core/src/sumeragi/main_loop.rs index 9c0c051b047..74a433c00dc 100644 --- a/core/src/sumeragi/main_loop.rs +++ b/core/src/sumeragi/main_loop.rs @@ -1217,7 +1217,7 @@ mod tests { let mut payload = signed.payload().clone(); f(&mut payload); - SignedBlock::V1(SignedBlockV1::new(payload, &key_pair)) + SignedBlock::V1(SignedBlockV1::new(payload, key_pair)) } fn create_data_for_test( diff --git a/data_model/src/query/predicate.rs b/data_model/src/query/predicate.rs index 57dfab02558..87b4e80917e 100644 --- a/data_model/src/query/predicate.rs +++ b/data_model/src/query/predicate.rs @@ -693,19 +693,19 @@ pub mod string { fn account_id() { let alice: PublicKey = KeyPair::random().into_parts().0; let id = IdBox::AccountId(format!("{alice}@wonderland").parse().expect("Valid")); - assert!(StringPredicate::starts_with(&*format!("{alice}@")).applies(&id)); + assert!(StringPredicate::starts_with(&format!("{alice}@")).applies(&id)); assert!(StringPredicate::ends_with("@wonderland").applies(&id)); - assert!(StringPredicate::is(&*format!("{alice}@wonderland")).applies(&id)); + assert!(StringPredicate::is(&format!("{alice}@wonderland")).applies(&id)); // Should we also include a check into string // predicates? If the internal predicate starts with // whitespace, it can't possibly match any Id, but // there's no way to enforce this at both type level // and run-time. - assert!(!StringPredicate::starts_with(&*format!(" {alice}@")).applies(&id)); + assert!(!StringPredicate::starts_with(&format!(" {alice}@")).applies(&id)); assert!(!StringPredicate::ends_with("@wonderland ").applies(&id)); - assert!(!StringPredicate::is(&*format!("{alice}@@wonderland ")).applies(&id)); + assert!(!StringPredicate::is(&format!("{alice}@@wonderland ")).applies(&id)); assert!(!StringPredicate::contains("#").applies(&id)); - assert!(!StringPredicate::is(&*format!("{alice}#wonderland")).applies(&id)); + assert!(!StringPredicate::is(&format!("{alice}#wonderland")).applies(&id)); } #[test] @@ -714,9 +714,9 @@ pub mod string { let id = IdBox::AssetId(format!("rose##{alice}@wonderland").parse().expect("Valid")); assert!(StringPredicate::starts_with("rose##").applies(&id)); - assert!(StringPredicate::ends_with(&*format!("#{alice}@wonderland")).applies(&id)); - assert!(StringPredicate::is(&*format!("rose##{alice}@wonderland")).applies(&id)); - assert!(StringPredicate::contains(&*format!("#{alice}@")).applies(&id)); + assert!(StringPredicate::ends_with(&format!("#{alice}@wonderland")).applies(&id)); + assert!(StringPredicate::is(&format!("rose##{alice}@wonderland")).applies(&id)); + assert!(StringPredicate::contains(&format!("#{alice}@")).applies(&id)); } #[test] @@ -1241,7 +1241,7 @@ pub mod value { let alice_id: AccountId = format!("{alice}@wonderland").parse().expect("Valid"); { let pred = QueryOutputPredicate::Identifiable(string::StringPredicate::is( - &*alice_id.to_string(), + &alice_id.to_string(), )); println!("{pred:?}"); assert!(pred.applies(&QueryOutputBox::Id(IdBox::AccountId(alice_id.clone())))); @@ -1265,7 +1265,7 @@ pub mod value { } { let pred = QueryOutputPredicate::Display(string::StringPredicate::is( - &*alice_id.to_string(), + &alice_id.to_string(), )); println!("{pred:?}"); diff --git a/smart_contract/src/lib.rs b/smart_contract/src/lib.rs index 2378b0f1bd7..327ac4744d3 100644 --- a/smart_contract/src/lib.rs +++ b/smart_contract/src/lib.rs @@ -645,11 +645,11 @@ mod tests { filter: smart_contract_filter.clone(), sorting: Sorting::by_metadata_key(Name::from_str("metadata_key").unwrap()), pagination: Pagination { - limit: Some(NonZeroU32::new(12341234).unwrap()), - start: Some(NonZeroU64::new(43214321).unwrap()), + limit: Some(NonZeroU32::new(12_341_234).unwrap()), + start: Some(NonZeroU64::new(43_214_321).unwrap()), }, fetch_size: FetchSize { - fetch_size: Some(NonZeroU32::new(56785678).unwrap()), + fetch_size: Some(NonZeroU32::new(56_785_678).unwrap()), }, }; let smart_contract_query_rq = super::QueryRequest::Query(smart_contract_query.clone());