From 193f6b9294b48808cb88fa6c82570bed03de0527 Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Tue, 16 Dec 2025 11:28:32 +0300 Subject: [PATCH] chore: regenerate umbrella crate, fix feature propagation --- Cargo.lock | 10 +- Cargo.toml | 1776 +++++------ bizinikiwi/bin/node/bench/src/trie.rs | 2 +- .../bin/node/cli/benches/block_production.rs | 2 +- bizinikiwi/bin/node/cli/benches/executor.rs | 2 +- .../bin/node/cli/benches/transaction_pool.rs | 2 +- bizinikiwi/bin/node/cli/src/chain_spec.rs | 32 +- bizinikiwi/bin/node/cli/src/command.rs | 9 +- bizinikiwi/bin/node/cli/src/service.rs | 60 +- bizinikiwi/bin/node/cli/tests/basic.rs | 36 +- .../node/cli/tests/benchmark_pallet_works.rs | 14 +- .../cli/tests/benchmark_pezpallet_works.rs | 14 +- bizinikiwi/bin/node/cli/tests/fees.rs | 14 +- .../bin/node/cli/tests/submit_transaction.rs | 4 +- bizinikiwi/bin/node/cli/tests/version.rs | 5 +- bizinikiwi/bin/node/rpc/src/lib.rs | 10 +- bizinikiwi/bin/node/runtime/src/impls.rs | 13 +- bizinikiwi/bin/node/runtime/src/lib.rs | 39 +- bizinikiwi/bin/node/testing/src/bench.rs | 4 +- bizinikiwi/bin/node/testing/src/client.rs | 2 +- .../utils/chain-spec-builder/tests/test.rs | 4 +- bizinikiwi/bin/utils/pez-subkey/src/lib.rs | 24 +- bizinikiwi/client/api/src/backend.rs | 6 +- bizinikiwi/client/api/src/client.rs | 16 +- bizinikiwi/client/api/src/in_mem.rs | 12 +- bizinikiwi/client/api/src/lib.rs | 2 +- .../client/authority-discovery/src/worker.rs | 2 +- .../src/worker/addr_cache.rs | 4 +- .../src/worker/schema/tests.rs | 2 +- .../authority-discovery/src/worker/tests.rs | 9 +- .../basic-authorship/src/basic_authorship.rs | 20 +- bizinikiwi/client/block-builder/src/lib.rs | 14 +- .../client/chain-spec/src/chain_spec.rs | 19 +- .../client/chain-spec/src/genesis_block.rs | 5 +- .../chain-spec/src/genesis_config_builder.rs | 8 +- bizinikiwi/client/chain-spec/src/lib.rs | 6 +- .../client/cli/src/commands/insert_key.rs | 2 +- bizinikiwi/client/cli/src/commands/key.rs | 2 +- bizinikiwi/client/cli/src/commands/run_cmd.rs | 2 +- bizinikiwi/client/cli/src/commands/utils.rs | 2 +- bizinikiwi/client/cli/src/commands/vanity.rs | 2 +- bizinikiwi/client/cli/src/config.rs | 6 +- bizinikiwi/client/cli/src/lib.rs | 4 +- .../cli/src/params/transaction_pool_params.rs | 3 +- bizinikiwi/client/cli/src/runner.rs | 2 +- .../consensus/aura/src/authorities_tracker.rs | 5 +- .../client/consensus/aura/src/import_queue.rs | 2 +- bizinikiwi/client/consensus/aura/src/lib.rs | 8 +- .../client/consensus/babe/rpc/src/lib.rs | 12 +- .../client/consensus/babe/src/aux_schema.rs | 2 +- bizinikiwi/client/consensus/babe/src/tests.rs | 2 +- .../client/consensus/beefy/rpc/src/lib.rs | 11 +- .../beefy/src/communication/gossip.rs | 7 +- .../consensus/beefy/src/justification.rs | 2 +- bizinikiwi/client/consensus/beefy/src/lib.rs | 7 +- .../client/consensus/beefy/src/tests.rs | 11 +- .../client/consensus/beefy/src/worker.rs | 8 +- .../consensus/common/src/block_import.rs | 2 +- .../common/src/import_queue/basic_queue.rs | 2 +- .../client/consensus/grandpa/rpc/src/lib.rs | 10 +- .../consensus/grandpa/rpc/src/notification.rs | 2 +- .../consensus/grandpa/src/authorities.rs | 2 +- .../consensus/grandpa/src/aux_schema.rs | 2 +- .../grandpa/src/communication/gossip.rs | 6 +- .../grandpa/src/communication/tests.rs | 6 +- .../consensus/grandpa/src/environment.rs | 5 +- .../consensus/grandpa/src/finality_proof.rs | 10 +- .../client/consensus/grandpa/src/import.rs | 4 +- .../client/consensus/grandpa/src/lib.rs | 10 +- .../client/consensus/grandpa/src/observer.rs | 2 +- .../client/consensus/grandpa/src/tests.rs | 2 +- .../consensus/grandpa/src/until_imported.rs | 4 +- .../consensus/grandpa/src/warp_proof.rs | 13 +- .../manual-seal/src/consensus/timestamp.rs | 5 +- .../client/consensus/manual-seal/src/lib.rs | 16 +- .../client/consensus/manual-seal/src/rpc.rs | 2 +- .../consensus/manual-seal/src/seal_block.rs | 4 +- bizinikiwi/client/consensus/pow/src/lib.rs | 2 +- .../client/consensus/slots/src/aux_schema.rs | 2 +- bizinikiwi/client/consensus/slots/src/lib.rs | 9 +- bizinikiwi/client/db/benches/state_access.rs | 2 +- bizinikiwi/client/db/src/lib.rs | 34 +- .../client/db/src/pinned_blocks_cache.rs | 2 +- bizinikiwi/client/db/src/utils.rs | 11 +- bizinikiwi/client/executor/benches/bench.rs | 4 +- bizinikiwi/client/executor/polkavm/src/lib.rs | 8 +- bizinikiwi/client/executor/src/executor.rs | 9 +- .../client/executor/src/wasm_runtime.rs | 7 +- .../client/executor/wasmtime/src/host.rs | 6 +- .../client/executor/wasmtime/src/lib.rs | 8 +- .../merkle-mountain-range/src/aux_schema.rs | 6 +- .../merkle-mountain-range/src/test_utils.rs | 10 +- bizinikiwi/client/mixnet/src/lib.rs | 2 +- bizinikiwi/client/mixnet/src/run.rs | 2 +- .../client/network-gossip/src/bridge.rs | 6 +- .../network-gossip/src/state_machine.rs | 2 +- .../network/benches/notifications_protocol.rs | 2 +- .../benches/request_response_protocol.rs | 2 +- .../src/light_client_requests/handler.rs | 2 +- bizinikiwi/client/network/src/bitswap/mod.rs | 16 +- bizinikiwi/client/network/src/discovery.rs | 3 +- bizinikiwi/client/network/src/lib.rs | 4 +- bizinikiwi/client/network/src/litep2p/mod.rs | 2 +- .../client/network/src/litep2p/peerstore.rs | 10 +- bizinikiwi/client/network/src/peer_store.rs | 12 +- .../src/protocol/notifications/behaviour.rs | 2 +- .../src/protocol/notifications/service/mod.rs | 6 +- .../client/network/src/protocol_controller.rs | 6 +- bizinikiwi/client/network/src/service.rs | 2 +- .../client/network/statement/src/lib.rs | 13 +- .../sync/src/block_announce_validator.rs | 2 +- .../sync/src/justification_requests.rs | 10 +- .../network/sync/src/state_request_handler.rs | 2 +- .../network/sync/src/strategy/chain_sync.rs | 10 +- .../sync/src/strategy/chain_sync/test.rs | 10 +- .../network/sync/src/strategy/pezkuwi.rs | 2 +- .../client/network/sync/src/strategy/state.rs | 10 +- .../network/sync/src/strategy/state_sync.rs | 2 +- .../client/network/sync/src/strategy/warp.rs | 8 +- .../client/network/test/src/block_import.rs | 10 +- .../network/test/src/conformance/setup.rs | 2 +- bizinikiwi/client/network/test/src/fuzz.rs | 8 +- bizinikiwi/client/network/test/src/lib.rs | 10 +- bizinikiwi/client/network/test/src/service.rs | 8 +- bizinikiwi/client/network/test/src/sync.rs | 4 +- .../client/network/transactions/src/lib.rs | 2 +- bizinikiwi/client/offchain/src/api/http.rs | 4 +- bizinikiwi/client/offchain/src/lib.rs | 12 +- bizinikiwi/client/rpc-api/src/author/hash.rs | 2 +- bizinikiwi/client/rpc-api/src/mixnet/error.rs | 5 +- bizinikiwi/client/rpc-api/src/policy.rs | 3 +- .../client/rpc-api/src/state/helpers.rs | 2 +- .../client/rpc-spec-v2/src/archive/tests.rs | 8 +- .../src/chain_head/chain_head_follow.rs | 9 +- .../rpc-spec-v2/src/chain_head/event.rs | 2 +- .../src/chain_head/subscription/inner.rs | 10 +- .../rpc-spec-v2/src/chain_head/test_utils.rs | 22 +- .../rpc-spec-v2/src/chain_head/tests.rs | 10 +- .../src/transaction/tests/middleware_pool.rs | 2 +- .../src/transaction/tests/setup.rs | 4 +- .../tests/transaction_broadcast_tests.rs | 4 +- .../transaction/tests/transaction_tests.rs | 4 +- .../src/transaction/transaction_broadcast.rs | 2 +- bizinikiwi/client/rpc/src/author/tests.rs | 10 +- bizinikiwi/client/rpc/src/chain/tests.rs | 8 +- bizinikiwi/client/rpc/src/dev/tests.rs | 2 +- bizinikiwi/client/rpc/src/state/tests.rs | 8 +- bizinikiwi/client/rpc/src/system/tests.rs | 2 +- bizinikiwi/client/service/src/builder.rs | 22 +- .../service/src/chain_ops/export_raw_state.rs | 4 +- .../service/src/chain_ops/import_blocks.rs | 2 +- .../service/src/client/call_executor.rs | 23 +- .../client/service/src/client/client.rs | 36 +- .../service/src/client/code_provider.rs | 12 +- .../src/client/notification_pinning.rs | 6 +- bizinikiwi/client/service/src/config.rs | 2 +- bizinikiwi/client/service/src/lib.rs | 14 +- bizinikiwi/client/service/src/metrics.rs | 2 +- .../client/service/src/task_manager/mod.rs | 2 +- .../client/service/test/src/client/mod.rs | 31 +- bizinikiwi/client/statement-store/src/lib.rs | 10 +- bizinikiwi/client/sync-state-rpc/src/lib.rs | 3 +- .../client/sysinfo/src/sysinfo_linux.rs | 2 +- bizinikiwi/client/tracing/src/block/mod.rs | 10 +- bizinikiwi/client/tracing/src/lib.rs | 2 +- .../client/transaction-pool/api/src/lib.rs | 2 +- .../client/transaction-pool/benches/basics.rs | 2 +- .../client/transaction-pool/src/builder.rs | 2 +- .../client/transaction-pool/src/common/api.rs | 2 +- .../src/common/enactment_state.rs | 2 +- .../transaction-pool/src/common/tests.rs | 8 +- .../fork_aware_txpool/fork_aware_txpool.rs | 2 +- .../src/fork_aware_txpool/metrics.rs | 8 +- .../fork_aware_txpool/multi_view_listener.rs | 6 +- .../fork_aware_txpool/revalidation_worker.rs | 2 +- .../src/fork_aware_txpool/tx_mem_pool.rs | 2 +- .../transaction-pool/src/graph/base_pool.rs | 2 +- .../client/transaction-pool/src/graph/pool.rs | 4 +- .../transaction-pool/src/graph/ready.rs | 2 +- .../src/single_state_txpool/revalidation.rs | 2 +- .../single_state_txpool.rs | 2 +- .../client/transaction-pool/tests/fatp.rs | 4 +- .../transaction-pool/tests/fatp_common/mod.rs | 8 +- .../tests/fatp_finality_timeout.rs | 4 +- .../transaction-pool/tests/fatp_invalid.rs | 4 +- .../transaction-pool/tests/fatp_limits.rs | 4 +- .../transaction-pool/tests/fatp_prios.rs | 4 +- .../client/transaction-pool/tests/pool.rs | 12 +- .../pezframe/alliance/src/benchmarking.rs | 4 +- bizinikiwi/pezframe/alliance/src/lib.rs | 8 +- bizinikiwi/pezframe/alliance/src/migration.rs | 2 +- bizinikiwi/pezframe/alliance/src/types.rs | 2 +- .../pezframe/asset-conversion/ops/src/lib.rs | 3 +- .../pezframe/asset-conversion/src/lib.rs | 16 +- .../pezframe/asset-conversion/src/types.rs | 2 +- bizinikiwi/pezframe/asset-rate/src/lib.rs | 3 +- bizinikiwi/pezframe/asset-rate/src/mock.rs | 5 +- bizinikiwi/pezframe/asset-rate/src/tests.rs | 2 +- bizinikiwi/pezframe/asset-rewards/src/lib.rs | 13 +- bizinikiwi/pezframe/asset-rewards/src/mock.rs | 4 +- bizinikiwi/pezframe/assets-freezer/src/lib.rs | 8 +- bizinikiwi/pezframe/assets-holder/src/lib.rs | 12 +- bizinikiwi/pezframe/assets-holder/src/mock.rs | 2 +- .../pezframe/assets/precompiles/src/lib.rs | 10 +- .../pezframe/assets/precompiles/src/tests.rs | 3 +- .../pezframe/assets/src/extra_mutator.rs | 6 +- bizinikiwi/pezframe/assets/src/functions.rs | 4 +- .../pezframe/assets/src/impl_fungibles.rs | 8 +- bizinikiwi/pezframe/assets/src/lib.rs | 10 +- bizinikiwi/pezframe/assets/src/migration.rs | 2 +- bizinikiwi/pezframe/atomic-swap/src/lib.rs | 3 +- bizinikiwi/pezframe/aura/src/lib.rs | 10 +- .../pezframe/authority-discovery/src/lib.rs | 4 +- bizinikiwi/pezframe/babe/src/equivocation.rs | 2 +- bizinikiwi/pezframe/babe/src/mock.rs | 18 +- bizinikiwi/pezframe/babe/src/tests.rs | 2 +- .../pezframe/bags-list/fuzzer/src/main.rs | 2 +- .../bags-list/remote-tests/src/lib.rs | 3 +- .../bags-list/remote-tests/src/migration.rs | 5 +- .../bags-list/remote-tests/src/snapshot.rs | 12 +- .../bags-list/remote-tests/src/try_state.rs | 15 +- bizinikiwi/pezframe/bags-list/src/lib.rs | 27 +- bizinikiwi/pezframe/bags-list/src/list/mod.rs | 7 +- .../pezframe/bags-list/src/list/tests.rs | 7 +- bizinikiwi/pezframe/bags-list/src/tests.rs | 4 +- .../pezframe/balances/src/impl_currency.rs | 2 +- .../pezframe/balances/src/impl_fungible.rs | 4 +- bizinikiwi/pezframe/balances/src/lib.rs | 27 +- .../balances/src/tests/dispatchable_tests.rs | 2 +- .../src/tests/fungible_conformance_tests.rs | 2 +- .../balances/src/tests/fungible_tests.rs | 8 +- bizinikiwi/pezframe/balances/src/tests/mod.rs | 10 +- .../balances/src/tests/reentrancy_tests.rs | 2 +- bizinikiwi/pezframe/balances/src/types.rs | 2 +- bizinikiwi/pezframe/beefy-mmr/src/lib.rs | 14 +- bizinikiwi/pezframe/beefy/src/equivocation.rs | 2 +- bizinikiwi/pezframe/beefy/src/mock.rs | 10 +- .../benchmarking/pov/src/benchmarking.rs | 5 +- .../pezframe/benchmarking/pov/src/lib.rs | 6 +- bizinikiwi/pezframe/benchmarking/src/lib.rs | 2 +- bizinikiwi/pezframe/benchmarking/src/tests.rs | 10 +- bizinikiwi/pezframe/benchmarking/src/utils.rs | 10 +- bizinikiwi/pezframe/benchmarking/src/v1.rs | 9 +- bizinikiwi/pezframe/bounties/src/lib.rs | 10 +- .../pezframe/bounties/src/migrations/v4.rs | 15 +- bizinikiwi/pezframe/broker/src/core_mask.rs | 2 +- .../pezframe/broker/src/coretime_interface.rs | 2 +- bizinikiwi/pezframe/broker/src/lib.rs | 3 +- .../pezframe/broker/src/test_fungibles.rs | 2 +- bizinikiwi/pezframe/broker/src/tests.rs | 2 +- bizinikiwi/pezframe/broker/src/types.rs | 2 +- .../child-bounties/src/benchmarking.rs | 18 +- bizinikiwi/pezframe/child-bounties/src/lib.rs | 3 +- .../pezframe/collective/src/benchmarking.rs | 3 +- bizinikiwi/pezframe/collective/src/lib.rs | 11 +- .../pezframe/collective/src/migrations/v4.rs | 6 +- .../mock-network/src/mocks/msg_queue.rs | 3 +- .../pezframe/contracts/proc-macro/src/lib.rs | 6 +- .../contracts/src/benchmarking/mod.rs | 18 +- bizinikiwi/pezframe/contracts/src/exec.rs | 4 +- bizinikiwi/pezframe/contracts/src/lib.rs | 24 +- .../pezframe/contracts/src/migration.rs | 9 +- .../pezframe/contracts/src/migration/v11.rs | 3 +- .../pezframe/contracts/src/migration/v12.rs | 2 +- .../pezframe/contracts/src/migration/v13.rs | 8 +- .../pezframe/contracts/src/migration/v15.rs | 8 +- .../pezframe/contracts/src/migration/v16.rs | 8 +- .../pezframe/contracts/src/primitives.rs | 2 +- bizinikiwi/pezframe/contracts/src/storage.rs | 5 +- .../contracts/src/test_utils/builder.rs | 2 +- bizinikiwi/pezframe/contracts/src/tests.rs | 7 +- bizinikiwi/pezframe/contracts/src/wasm/mod.rs | 2 +- .../pezframe/contracts/src/wasm/runtime.rs | 6 +- .../conviction-voting/src/conviction.rs | 2 +- .../pezframe/conviction-voting/src/lib.rs | 4 +- .../pezframe/conviction-voting/src/traits.rs | 2 +- .../pezframe/conviction-voting/src/types.rs | 2 +- .../pezframe/conviction-voting/src/vote.rs | 2 +- .../pezframe/core-fellowship/src/lib.rs | 24 +- .../core-fellowship/src/tests/integration.rs | 2 +- .../core-fellowship/src/tests/unit.rs | 7 +- .../pezframe/delegated-staking/src/impls.rs | 5 +- .../pezframe/delegated-staking/src/lib.rs | 32 +- .../delegated-staking/src/migration.rs | 3 +- .../pezframe/delegated-staking/src/mock.rs | 3 +- .../pezframe/delegated-staking/src/tests.rs | 4 +- .../pezframe/democracy/src/conviction.rs | 2 +- bizinikiwi/pezframe/democracy/src/lib.rs | 7 +- .../unlock_and_unreserve_all_funds.rs | 7 +- .../pezframe/democracy/src/migrations/v1.rs | 6 +- bizinikiwi/pezframe/democracy/src/types.rs | 2 +- bizinikiwi/pezframe/democracy/src/vote.rs | 2 +- .../pezframe/democracy/src/vote_threshold.rs | 2 +- bizinikiwi/pezframe/derivatives/src/lib.rs | 11 +- .../pezframe/derivatives/src/mock/mod.rs | 40 +- bizinikiwi/pezframe/derivatives/src/tests.rs | 2 +- bizinikiwi/pezframe/dummy-dim/src/lib.rs | 7 +- bizinikiwi/pezframe/dummy-dim/src/mock.rs | 4 +- bizinikiwi/pezframe/dummy-dim/src/tests.rs | 4 +- .../src/benchmarking.rs | 3 +- .../election-provider-multi-block/src/lib.rs | 66 +- .../src/mock/mod.rs | 4 +- .../src/signed/benchmarking.rs | 6 +- .../src/signed/mod.rs | 6 +- .../src/types.rs | 16 +- .../src/unsigned/miner.rs | 2 +- .../src/unsigned/mod.rs | 4 +- .../src/verifier/benchmarking.rs | 4 +- .../src/verifier/impls.rs | 17 +- .../src/verifier/mod.rs | 11 +- .../src/verifier/tests.rs | 4 +- .../src/benchmarking.rs | 21 +- .../election-provider-multi-phase/src/lib.rs | 63 +- .../election-provider-multi-phase/src/mock.rs | 8 +- .../src/remote_mining.rs | 2 +- .../src/unsigned.rs | 19 +- .../test-staking-e2e/src/lib.rs | 19 +- .../test-staking-e2e/src/mock.rs | 2 +- .../solution-type/fuzzer/src/compact.rs | 2 +- .../election-provider-support/src/lib.rs | 19 +- .../election-provider-support/src/onchain.rs | 3 +- .../election-provider-support/src/tests.rs | 6 +- .../election-provider-support/src/traits.rs | 2 +- .../pezframe/elections-phragmen/src/lib.rs | 14 +- .../unlock_and_unreserve_all_funds.rs | 3 +- .../elections-phragmen/src/migrations/v4.rs | 4 +- .../src/extensions.rs | 2 +- .../authorization-tx-extension/src/lib.rs | 24 +- .../authorization-tx-extension/src/mock.rs | 4 +- .../authorization-tx-extension/src/tests.rs | 10 +- bizinikiwi/pezframe/examples/basic/src/lib.rs | 28 +- .../examples/default-config/src/lib.rs | 14 +- .../examples/kitchensink/src/benchmarking.rs | 8 +- .../pezframe/examples/kitchensink/src/lib.rs | 41 +- .../multi-block-migrations/src/lib.rs | 4 +- .../examples/offchain-worker/src/lib.rs | 5 +- .../single-block-migrations/src/lib.rs | 13 +- .../pezframe/examples/split/src/mock.rs | 5 +- bizinikiwi/pezframe/examples/src/lib.rs | 41 +- .../pezframe/examples/tasks/src/tests.rs | 26 +- .../examples/view-functions/src/tests.rs | 6 +- bizinikiwi/pezframe/executive/src/lib.rs | 32 +- bizinikiwi/pezframe/executive/src/tests.rs | 24 +- .../pezframe/fast-unstake/src/benchmarking.rs | 13 +- bizinikiwi/pezframe/fast-unstake/src/lib.rs | 24 +- bizinikiwi/pezframe/fast-unstake/src/mock.rs | 3 +- bizinikiwi/pezframe/fast-unstake/src/types.rs | 2 +- .../pezframe/grandpa/src/equivocation.rs | 2 +- bizinikiwi/pezframe/grandpa/src/lib.rs | 2 +- bizinikiwi/pezframe/honzon/oracle/src/lib.rs | 2 +- .../pezframe/honzon/oracle/src/tests.rs | 2 +- .../pezframe/identity/src/benchmarking.rs | 8 +- bizinikiwi/pezframe/identity/src/legacy.rs | 6 +- bizinikiwi/pezframe/identity/src/lib.rs | 11 +- bizinikiwi/pezframe/identity/src/types.rs | 8 +- bizinikiwi/pezframe/im-online/src/lib.rs | 5 +- bizinikiwi/pezframe/im-online/src/mock.rs | 4 +- bizinikiwi/pezframe/indices/src/lib.rs | 3 +- .../src/lib.rs | 14 +- bizinikiwi/pezframe/lottery/src/lib.rs | 3 +- .../pezframe/membership/src/migrations/v4.rs | 6 +- bizinikiwi/pezframe/membership/src/mock.rs | 5 +- .../pezframe/merkle-mountain-range/src/lib.rs | 15 +- .../merkle-mountain-range/src/tests.rs | 28 +- bizinikiwi/pezframe/message-queue/src/lib.rs | 89 +- .../pezframe/message-queue/src/tests.rs | 14 +- bizinikiwi/pezframe/meta-tx/src/lib.rs | 14 +- bizinikiwi/pezframe/meta-tx/src/mock.rs | 3 +- bizinikiwi/pezframe/meta-tx/src/tests.rs | 6 +- .../metadata-hash-extension/src/lib.rs | 2 +- .../metadata-hash-extension/src/tests.rs | 20 +- bizinikiwi/pezframe/migrations/src/lib.rs | 47 +- bizinikiwi/pezframe/migrations/src/mock.rs | 8 +- bizinikiwi/pezframe/mixnet/src/lib.rs | 2 +- .../multi-asset-bounties/src/benchmarking.rs | 13 +- .../pezframe/multi-asset-bounties/src/lib.rs | 6 +- .../pezframe/multi-asset-bounties/src/mock.rs | 8 +- .../multi-asset-bounties/src/tests.rs | 70 +- bizinikiwi/pezframe/multisig/src/lib.rs | 7 +- .../pezframe/nft-fractionalization/src/lib.rs | 10 +- .../pezframe/nfts/src/impl_nonfungibles.rs | 4 +- bizinikiwi/pezframe/nfts/src/lib.rs | 21 +- bizinikiwi/pezframe/nfts/src/migration.rs | 2 +- bizinikiwi/pezframe/nis/src/benchmarking.rs | 32 +- bizinikiwi/pezframe/nis/src/lib.rs | 12 +- bizinikiwi/pezframe/nis/src/mock.rs | 8 +- .../pezframe/node-authorization/src/lib.rs | 3 +- .../benchmarking/src/inner.rs | 13 +- .../nomination-pools/benchmarking/src/mock.rs | 3 +- .../nomination-pools/fuzzer/src/call.rs | 4 +- .../pezframe/nomination-pools/src/lib.rs | 29 +- .../nomination-pools/src/migration.rs | 12 +- .../pezframe/nomination-pools/src/mock.rs | 4 +- .../pezframe/nomination-pools/src/tests.rs | 4 +- .../test-delegate-stake/src/lib.rs | 2 +- .../test-delegate-stake/src/mock.rs | 3 +- bizinikiwi/pezframe/offences/src/migration.rs | 9 +- .../pezframe/origin-restriction/src/lib.rs | 5 +- bizinikiwi/pezframe/paged-list/src/lib.rs | 4 +- bizinikiwi/pezframe/paged-list/src/mock.rs | 5 +- .../pezframe/paged-list/src/paged_list.rs | 9 +- bizinikiwi/pezframe/parameters/src/lib.rs | 49 +- .../pezframe/parameters/src/tests/mock.rs | 3 +- .../parameters/src/tests/test_renamed.rs | 3 +- .../pezframe/people/src/benchmarking.rs | 10 +- bizinikiwi/pezframe/people/src/extension.rs | 2 +- bizinikiwi/pezframe/people/src/lib.rs | 29 +- bizinikiwi/pezframe/people/src/mock.rs | 3 +- bizinikiwi/pezframe/people/src/tests.rs | 3 +- .../pezframe/preimage/src/benchmarking.rs | 10 +- bizinikiwi/pezframe/preimage/src/lib.rs | 3 +- bizinikiwi/pezframe/proxy/src/benchmarking.rs | 3 +- bizinikiwi/pezframe/proxy/src/lib.rs | 14 +- .../pezframe/ranked-collective/src/lib.rs | 2 +- bizinikiwi/pezframe/recovery/src/lib.rs | 10 +- bizinikiwi/pezframe/referenda/src/lib.rs | 9 +- .../pezframe/referenda/src/migration.rs | 2 +- bizinikiwi/pezframe/referenda/src/types.rs | 2 +- bizinikiwi/pezframe/remark/src/lib.rs | 3 +- .../revive/dev-node/node/src/chain_spec.rs | 2 +- .../revive/dev-node/node/src/command.rs | 13 +- .../pezframe/revive/dev-node/node/src/rpc.rs | 2 +- .../revive/dev-node/node/src/service.rs | 5 +- .../revive/dev-node/runtime/src/lib.rs | 21 +- bizinikiwi/pezframe/revive/fixtures/build.rs | 9 +- .../revive/rpc/src/block_info_provider.rs | 16 +- bizinikiwi/pezframe/revive/rpc/src/cli.rs | 10 +- bizinikiwi/pezframe/revive/rpc/src/client.rs | 11 +- .../revive/rpc/src/receipt_provider.rs | 2 +- bizinikiwi/pezframe/revive/src/address.rs | 2 +- .../pezframe/revive/src/benchmarking.rs | 31 +- bizinikiwi/pezframe/revive/src/debug.rs | 4 +- .../revive/src/evm/api/debug_rpc_types.rs | 2 +- .../pezframe/revive/src/evm/api/rpc_types.rs | 2 +- .../pezframe/revive/src/evm/block_hash.rs | 2 +- .../src/evm/block_hash/block_builder.rs | 6 +- bizinikiwi/pezframe/revive/src/evm/call.rs | 4 +- bizinikiwi/pezframe/revive/src/evm/fees.rs | 2 +- bizinikiwi/pezframe/revive/src/evm/runtime.rs | 2 +- .../pezframe/revive/src/evm/tx_extension.rs | 2 +- bizinikiwi/pezframe/revive/src/exec.rs | 5 +- bizinikiwi/pezframe/revive/src/exec/tests.rs | 2 +- .../pezframe/revive/src/impl_fungibles.rs | 4 +- bizinikiwi/pezframe/revive/src/lib.rs | 19 +- .../pezframe/revive/src/migrations/v2.rs | 6 +- bizinikiwi/pezframe/revive/src/primitives.rs | 2 +- bizinikiwi/pezframe/revive/src/storage.rs | 5 +- bizinikiwi/pezframe/revive/src/test_utils.rs | 2 +- .../pezframe/revive/src/test_utils/builder.rs | 6 +- bizinikiwi/pezframe/revive/src/tests.rs | 3 +- .../pezframe/revive/src/tests/block_hash.rs | 10 +- bizinikiwi/pezframe/revive/src/tests/pvm.rs | 18 +- bizinikiwi/pezframe/revive/src/tests/sol.rs | 3 +- .../revive/src/tests/sol/block_info.rs | 2 +- .../pezframe/revive/src/tests/sol/contract.rs | 2 +- .../pezframe/revive/src/tests/sol/system.rs | 4 +- .../pezframe/revive/src/tests/sol/tx_info.rs | 2 +- .../src/vm/evm/instructions/block_info.rs | 2 +- .../evm/instructions/contract/call_helpers.rs | 2 +- .../revive/src/vm/evm/instructions/system.rs | 2 +- bizinikiwi/pezframe/revive/src/vm/mod.rs | 2 +- bizinikiwi/pezframe/root-offences/src/lib.rs | 7 +- bizinikiwi/pezframe/root-offences/src/mock.rs | 3 +- .../pezframe/root-offences/src/tests.rs | 2 +- bizinikiwi/pezframe/root-testing/src/lib.rs | 7 +- .../pezframe/safe-mode/src/benchmarking.rs | 11 +- bizinikiwi/pezframe/safe-mode/src/lib.rs | 16 +- bizinikiwi/pezframe/safe-mode/src/mock.rs | 3 +- bizinikiwi/pezframe/salary/src/lib.rs | 8 +- bizinikiwi/pezframe/salary/src/tests/unit.rs | 4 +- .../pezframe/scheduler/src/benchmarking.rs | 4 +- bizinikiwi/pezframe/scheduler/src/lib.rs | 27 +- .../pezframe/scheduler/src/migration.rs | 2 +- bizinikiwi/pezframe/scheduler/src/mock.rs | 5 +- bizinikiwi/pezframe/scheduler/src/tests.rs | 2 +- .../session/benchmarking/src/inner.rs | 6 +- .../pezframe/session/src/historical/mod.rs | 3 +- bizinikiwi/pezframe/session/src/lib.rs | 15 +- .../session/src/migrations/historical.rs | 9 +- bizinikiwi/pezframe/society/src/lib.rs | 10 +- bizinikiwi/pezframe/society/src/migrations.rs | 5 +- bizinikiwi/pezframe/src/lib.rs | 29 +- .../staking-async/ah-client/src/lib.rs | 44 +- .../staking-async/ah-client/src/mock.rs | 5 +- .../staking-async/ahm-test/src/ah/mock.rs | 7 +- .../staking-async/ahm-test/src/lib.rs | 127 +- .../staking-async/ahm-test/src/rc/mock.rs | 21 +- .../staking-async/ahm-test/src/rc/test.rs | 34 +- .../staking-async/ahm-test/src/shared.rs | 3 +- .../staking-async/rc-client/src/lib.rs | 20 +- .../runtimes/preset-store/src/lib.rs | 3 +- .../runtimes/rc/constants/src/lib.rs | 2 +- .../runtimes/rc/src/genesis_config_presets.rs | 2 +- .../staking-async/runtimes/rc/src/impls.rs | 2 +- .../staking-async/runtimes/rc/src/lib.rs | 44 +- .../runtimes/rc/src/weights/mod.rs | 32 +- .../runtimes/rc/src/xcm_config.rs | 8 +- .../runtimes/teyrchain/src/governance/mod.rs | 2 +- .../runtimes/teyrchain/src/lib.rs | 15 +- .../runtimes/teyrchain/src/staking.rs | 9 +- .../runtimes/teyrchain/src/weights/mod.rs | 4 +- .../runtimes/teyrchain/src/xcm_config.rs | 30 +- .../pezframe/staking-async/src/ledger.rs | 4 +- bizinikiwi/pezframe/staking-async/src/lib.rs | 15 +- bizinikiwi/pezframe/staking-async/src/mock.rs | 3 +- .../staking-async/src/pezpallet/impls.rs | 4 +- .../staking-async/src/pezpallet/mod.rs | 40 +- .../staking-async/src/session_rotation.rs | 13 +- .../pezframe/staking-async/src/slashing.rs | 13 +- .../staking-async/src/testing_utils.rs | 2 +- .../src/tests/election_provider.rs | 2 +- .../pezframe/staking-async/src/tests/mod.rs | 4 +- bizinikiwi/pezframe/staking/src/ledger.rs | 5 +- bizinikiwi/pezframe/staking/src/lib.rs | 44 +- bizinikiwi/pezframe/staking/src/migrations.rs | 3 +- bizinikiwi/pezframe/staking/src/mock.rs | 8 +- .../pezframe/staking/src/pezpallet/impls.rs | 8 +- .../pezframe/staking/src/pezpallet/mod.rs | 26 +- bizinikiwi/pezframe/staking/src/slashing.rs | 15 +- .../pezframe/staking/src/testing_utils.rs | 2 +- bizinikiwi/pezframe/staking/src/tests.rs | 18 +- .../pezframe/state-trie-migration/src/lib.rs | 23 +- bizinikiwi/pezframe/statement/src/lib.rs | 13 +- bizinikiwi/pezframe/statement/src/mock.rs | 10 +- bizinikiwi/pezframe/statement/src/tests.rs | 9 +- bizinikiwi/pezframe/sudo/src/extension.rs | 2 +- bizinikiwi/pezframe/sudo/src/lib.rs | 20 +- bizinikiwi/pezframe/sudo/src/mock.rs | 8 +- bizinikiwi/pezframe/sudo/src/tests.rs | 2 +- .../procedural/examples/proc_main/tasks.rs | 7 +- .../construct_runtime/expand/freeze_reason.rs | 5 +- .../construct_runtime/expand/hold_reason.rs | 5 +- .../construct_runtime/expand/slash_reason.rs | 5 +- .../procedural/src/construct_runtime/mod.rs | 49 +- .../procedural/src/construct_runtime/parse.rs | 17 +- .../support/procedural/src/dynamic_params.rs | 2 +- .../pezframe/support/procedural/src/lib.rs | 110 +- .../procedural/src/pezpallet/expand/call.rs | 5 +- .../src/pezpallet/expand/pezpallet_struct.rs | 19 +- .../src/pezpallet/expand/storage.rs | 7 +- .../procedural/src/pezpallet/parse/call.rs | 6 +- .../src/pezpallet/parse/composite.rs | 3 +- .../procedural/src/pezpallet/parse/config.rs | 60 +- .../procedural/src/pezpallet/parse/error.rs | 60 +- .../procedural/src/pezpallet/parse/event.rs | 5 +- .../procedural/src/pezpallet/parse/helper.rs | 11 +- .../src/pezpallet/parse/inherent.rs | 6 +- .../procedural/src/pezpallet/parse/mod.rs | 15 +- .../src/pezpallet/parse/pezpallet_struct.rs | 3 +- .../procedural/src/pezpallet/parse/storage.rs | 11 +- .../procedural/src/pezpallet/parse/tasks.rs | 5 +- .../src/pezpallet/parse/type_value.rs | 3 +- .../src/pezpallet/parse/validate_unsigned.rs | 6 +- .../src/pezpallet/parse/view_functions.rs | 2 +- .../procedural/src/runtime/expand/mod.rs | 14 +- .../support/procedural/src/runtime/mod.rs | 20 +- .../procedural/src/runtime/parse/mod.rs | 3 +- .../procedural/src/runtime/parse/pezpallet.rs | 2 +- .../src/runtime/parse/pezpallet_decl.rs | 3 +- .../support/procedural/src/storage_alias.rs | 4 +- bizinikiwi/pezframe/support/src/dispatch.rs | 13 +- .../pezframe/support/src/dispatch_context.rs | 8 +- bizinikiwi/pezframe/support/src/instances.rs | 12 +- bizinikiwi/pezframe/support/src/lib.rs | 256 +- bizinikiwi/pezframe/support/src/migrations.rs | 32 +- .../pezframe/support/src/storage/child.rs | 3 +- .../pezframe/support/src/storage/migration.rs | 4 +- .../pezframe/support/src/storage/mod.rs | 12 +- .../support/src/storage/storage_noop_guard.rs | 5 +- .../support/src/storage/types/counted_map.rs | 5 +- .../support/src/storage/types/counted_nmap.rs | 10 +- .../support/src/storage/types/double_map.rs | 10 +- .../pezframe/support/src/storage/types/map.rs | 9 +- .../support/src/storage/types/nmap.rs | 14 +- .../pezframe/support/src/storage/unhashed.rs | 4 +- .../support/src/tests/storage_alias.rs | 4 +- .../support/src/traits/dynamic_params.rs | 4 +- .../pezframe/support/src/traits/error.rs | 10 +- .../pezframe/support/src/traits/hooks.rs | 14 +- .../pezframe/support/src/traits/messages.rs | 2 +- .../pezframe/support/src/traits/metadata.rs | 22 +- .../pezframe/support/src/traits/misc.rs | 2 +- .../pezframe/support/src/traits/preimages.rs | 2 +- .../pezframe/support/src/traits/reality.rs | 2 +- .../pezframe/support/src/traits/schedule.rs | 2 +- .../pezframe/support/src/traits/storage.rs | 8 +- .../pezframe/support/src/traits/tasks.rs | 4 +- .../support/src/traits/tokens/asset_ops.rs | 7 +- .../tokens/asset_ops/common_strategies.rs | 2 +- .../src/traits/tokens/currency/reservable.rs | 2 +- .../src/traits/tokens/fungible/freeze.rs | 2 +- .../src/traits/tokens/fungible/hold.rs | 2 +- .../src/traits/tokens/fungible/imbalance.rs | 3 +- .../src/traits/tokens/fungible/item_of.rs | 4 +- .../support/src/traits/tokens/fungible/mod.rs | 12 +- .../src/traits/tokens/fungible/union_of.rs | 2 +- .../src/traits/tokens/fungibles/freeze.rs | 2 +- .../src/traits/tokens/fungibles/hold.rs | 2 +- .../src/traits/tokens/fungibles/imbalance.rs | 6 +- .../pezframe/support/src/traits/tokens/pay.rs | 2 +- .../support/src/traits/tokens/transfer.rs | 2 +- .../pezframe/support/src/traits/voting.rs | 4 +- .../pezframe/support/src/view_functions.rs | 9 +- .../support/test/compile_pass/src/lib.rs | 8 +- bizinikiwi/pezframe/support/test/src/lib.rs | 4 +- .../pezframe/support/test/tests/authorize.rs | 10 +- .../support/test/tests/enum_deprecation.rs | 3 +- .../pezframe/support/test/tests/origin.rs | 3 +- .../pezframe/support/test/tests/pallet.rs | 65 +- .../pezpallet_associated_types_metadata.rs | 23 +- .../support/test/tests/pezpallet_instance.rs | 39 +- .../tests/pezpallet_outer_enums_explicit.rs | 2 +- .../tests/pezpallet_outer_enums_implicit.rs | 2 +- .../pezframe/support/test/tests/runtime.rs | 15 +- .../test/tests/runtime_legacy_ordering.rs | 15 +- .../support/test/tests/runtime_metadata.rs | 2 +- .../system/benchmarking/src/extensions.rs | 7 +- .../system/src/extensions/authorize_call.rs | 18 +- .../system/src/extensions/check_genesis.rs | 2 +- .../system/src/extensions/check_mortality.rs | 2 +- .../src/extensions/check_non_zero_sender.rs | 2 +- .../system/src/extensions/check_nonce.rs | 2 +- .../src/extensions/check_spec_version.rs | 2 +- .../system/src/extensions/check_tx_version.rs | 2 +- .../system/src/extensions/check_weight.rs | 2 +- .../system/src/extensions/weight_reclaim.rs | 2 +- bizinikiwi/pezframe/system/src/lib.rs | 22 +- bizinikiwi/pezframe/system/src/limits.rs | 2 +- bizinikiwi/pezframe/system/src/mocking.rs | 3 +- bizinikiwi/pezframe/system/src/offchain.rs | 12 +- bizinikiwi/pezframe/system/src/tests.rs | 11 +- bizinikiwi/pezframe/timestamp/src/lib.rs | 22 +- bizinikiwi/pezframe/tips/src/lib.rs | 12 +- .../tips/src/migrations/unreserve_deposits.rs | 11 +- bizinikiwi/pezframe/tips/src/migrations/v4.rs | 6 +- .../asset-conversion-tx-payment/src/lib.rs | 10 +- .../asset-conversion-tx-payment/src/mock.rs | 8 +- .../asset-conversion-tx-payment/src/tests.rs | 2 +- .../asset-tx-payment/src/lib.rs | 16 +- .../asset-tx-payment/src/mock.rs | 2 +- .../asset-tx-payment/src/payment.rs | 6 +- .../asset-tx-payment/src/tests.rs | 2 +- .../transaction-payment/rpc/src/lib.rs | 4 +- .../skip-feeless-payment/src/lib.rs | 15 +- .../pezframe/transaction-payment/src/lib.rs | 11 +- .../transaction-payment/src/payment.rs | 8 +- .../pezframe/transaction-payment/src/tests.rs | 2 +- .../transaction-storage/src/benchmarking.rs | 12 +- .../pezframe/transaction-storage/src/lib.rs | 10 +- bizinikiwi/pezframe/treasury/src/lib.rs | 12 +- bizinikiwi/pezframe/treasury/src/tests.rs | 3 +- bizinikiwi/pezframe/tx-pause/src/lib.rs | 3 +- bizinikiwi/pezframe/tx-pause/src/tests.rs | 15 +- .../uniques/src/asset_ops/collection.rs | 7 +- bizinikiwi/pezframe/utility/src/lib.rs | 4 +- .../verify-signature/src/extension.rs | 6 +- .../pezframe/vesting/src/benchmarking.rs | 12 +- bizinikiwi/pezframe/vesting/src/lib.rs | 22 +- bizinikiwi/pezframe/whitelist/src/lib.rs | 3 +- bizinikiwi/pezframe/whitelist/src/tests.rs | 6 +- bizinikiwi/primitives/api/src/lib.rs | 20 +- .../primitives/api/test/benches/bench.rs | 4 +- .../api/test/tests/runtime_calls.rs | 2 +- .../application-crypto/src/ed25519.rs | 6 +- .../application-crypto/src/sr25519.rs | 6 +- .../application-crypto/src/traits.rs | 4 +- .../application-crypto/test/src/bls381.rs | 8 +- .../application-crypto/test/src/ecdsa.rs | 8 +- .../test/src/ecdsa_bls381.rs | 8 +- .../application-crypto/test/src/ed25519.rs | 8 +- .../application-crypto/test/src/sr25519.rs | 8 +- .../primitives/arithmetic/benches/bench.rs | 2 +- .../primitives/arithmetic/src/per_things.rs | 4 +- .../blockchain/src/header_metadata.rs | 2 +- .../primitives/consensus/babe/src/lib.rs | 2 +- .../consensus/beefy/src/commitment.rs | 2 +- .../primitives/consensus/beefy/src/lib.rs | 2 +- .../primitives/consensus/beefy/src/mmr.rs | 5 +- .../primitives/consensus/beefy/src/payload.rs | 2 +- .../primitives/consensus/common/src/lib.rs | 2 +- .../primitives/consensus/grandpa/src/lib.rs | 2 +- .../primitives/consensus/sassafras/src/lib.rs | 2 +- .../primitives/consensus/slots/src/lib.rs | 2 +- .../fuzz/fuzz_targets/fuzz_address_uri.rs | 4 +- bizinikiwi/primitives/io/src/lib.rs | 11 +- .../merkle-mountain-range/src/lib.rs | 2 +- .../primitives/metadata-ir/src/types.rs | 9 +- .../npos-elections/fuzzer/src/common.rs | 2 +- .../fuzzer/src/phragmen_balancing.rs | 2 +- .../npos-elections/fuzzer/src/phragmen_pjr.rs | 2 +- .../fuzzer/src/phragmms_balancing.rs | 2 +- .../npos-elections/fuzzer/src/reduce.rs | 2 +- .../primitives/npos-elections/src/lib.rs | 8 +- .../primitives/npos-elections/src/tests.rs | 2 +- bizinikiwi/primitives/rpc/src/number.rs | 2 +- .../primitives/runtime/src/generic/header.rs | 2 +- .../src/generic/unchecked_extrinsic.rs | 2 +- bizinikiwi/primitives/runtime/src/lib.rs | 4 +- .../primitives/runtime/src/offchain/http.rs | 10 +- .../primitives/runtime/src/runtime_logger.rs | 4 +- bizinikiwi/primitives/runtime/src/testing.rs | 2 +- .../primitives/runtime/src/traits/mod.rs | 13 +- .../as_transaction_extension.rs | 2 +- .../runtime/src/transaction_validity.rs | 2 +- .../runtime/src/type_with_default.rs | 4 +- bizinikiwi/primitives/staking/src/lib.rs | 6 +- bizinikiwi/primitives/staking/src/offence.rs | 4 +- .../primitives/state-machine/src/lib.rs | 2 +- .../primitives/state-machine/src/testing.rs | 15 +- .../primitives/statement-store/src/ecies.rs | 14 +- .../primitives/statement-store/src/lib.rs | 6 +- .../statement-store/src/runtime_api.rs | 2 +- bizinikiwi/primitives/storage/src/lib.rs | 2 +- .../trie/src/accessed_nodes_tracker.rs | 2 +- bizinikiwi/primitives/trie/src/cache/mod.rs | 2 +- bizinikiwi/primitives/trie/src/trie_codec.rs | 6 +- .../proc-macro/src/decl_runtime_version.rs | 7 +- bizinikiwi/primitives/version/src/lib.rs | 22 +- .../primitives/wasm-interface/Cargo.toml | 7 +- bizinikiwi/primitives/weights/src/lib.rs | 8 +- bizinikiwi/test-utils/cli/src/lib.rs | 2 +- bizinikiwi/test-utils/client/src/lib.rs | 8 +- .../runtime/client/src/block_builder_ext.rs | 8 +- .../test-utils/runtime/client/src/lib.rs | 11 +- .../runtime/client/src/trait_tests.rs | 2 +- .../runtime/src/bizinikiwi_test_pallet.rs | 4 +- .../test-utils/runtime/src/genesismap.rs | 2 +- bizinikiwi/test-utils/runtime/src/lib.rs | 21 +- .../runtime/transaction-pool/src/lib.rs | 14 +- .../benchmarking-cli/src/extrinsic/bench.rs | 2 +- .../pezframe/benchmarking-cli/src/lib.rs | 6 +- .../benchmarking-cli/src/overhead/command.rs | 11 +- .../benchmarking-cli/src/pezpallet/command.rs | 57 +- .../benchmarking-cli/src/pezpallet/logging.rs | 3 +- .../benchmarking-cli/src/pezpallet/mod.rs | 4 +- .../benchmarking-cli/src/pezpallet/writer.rs | 11 +- .../src/shared/genesis_state.rs | 2 +- .../benchmarking-cli/src/shared/mod.rs | 2 +- .../benchmarking-cli/src/storage/cmd.rs | 2 +- .../benchmarking-cli/src/storage/mod.rs | 3 +- .../benchmarking-cli/src/storage/read.rs | 2 +- .../benchmarking-cli/src/storage/write.rs | 2 +- .../pezframe/omni-bencher/src/command.rs | 12 +- .../omni-bencher/tests/benchmark_works.rs | 6 +- .../pezframe/remote-externalities/src/lib.rs | 8 +- .../utils/pezframe/rpc/client/src/lib.rs | 2 +- .../rpc/state-trie-migration-rpc/src/lib.rs | 5 +- .../utils/pezframe/rpc/support/src/lib.rs | 8 +- .../utils/pezframe/rpc/system/src/lib.rs | 2 +- bizinikiwi/utils/txtesttool/bin/main.rs | 6 +- .../utils/txtesttool/src/subxt_transaction.rs | 9 +- bizinikiwi/utils/wasm-builder/src/lib.rs | 6 +- .../guides/first-pezpallet/src/lib.rs | 6 +- .../packages/guides/first-runtime/src/lib.rs | 4 +- .../chain_spec_runtime/src/presets.rs | 2 +- .../bin/runtime-common/src/extensions.rs | 13 +- .../bin/runtime-common/src/integrity.rs | 36 +- .../bin/runtime-common/src/messages_api.rs | 10 +- .../src/messages_benchmarking.rs | 2 +- pezbridges/bin/runtime-common/src/mock.rs | 15 +- .../src/teyrchains_benchmarking.rs | 4 +- pezbridges/chains/chain-pezcumulus/src/lib.rs | 6 +- .../chains/chain-pezkuwi-bulletin/src/lib.rs | 4 +- pezbridges/modules/beefy/src/lib.rs | 8 +- pezbridges/modules/beefy/src/mock.rs | 2 +- pezbridges/modules/beefy/src/mock_chain.rs | 2 +- .../modules/grandpa/src/benchmarking.rs | 2 +- pezbridges/modules/grandpa/src/call_ext.rs | 20 +- pezbridges/modules/grandpa/src/lib.rs | 21 +- .../modules/grandpa/src/storage_types.rs | 2 +- .../modules/messages/src/benchmarking.rs | 2 +- .../modules/messages/src/inbound_lane.rs | 4 +- .../modules/messages/src/lanes_manager.rs | 10 +- pezbridges/modules/messages/src/lib.rs | 5 +- pezbridges/modules/messages/src/migration.rs | 6 +- .../modules/messages/src/outbound_lane.rs | 2 +- pezbridges/modules/messages/src/proofs.rs | 4 +- .../messages/src/tests/messages_generation.rs | 2 +- pezbridges/modules/messages/src/tests/mock.rs | 11 +- .../messages/src/tests/pezpallet_tests.rs | 9 +- .../modules/messages/src/weights_ext.rs | 4 +- .../relayers/src/extension/grandpa_adapter.rs | 2 +- .../src/extension/messages_adapter.rs | 2 +- .../modules/relayers/src/extension/mod.rs | 10 +- .../relayers/src/extension/priority.rs | 8 +- .../src/extension/teyrchain_adapter.rs | 2 +- pezbridges/modules/relayers/src/lib.rs | 8 +- pezbridges/modules/relayers/src/migration.rs | 9 +- pezbridges/modules/relayers/src/mock.rs | 19 +- .../modules/relayers/src/payment_adapter.rs | 8 +- pezbridges/modules/teyrchains/src/call_ext.rs | 4 +- pezbridges/modules/teyrchains/src/lib.rs | 54 +- pezbridges/modules/teyrchains/src/proofs.rs | 2 +- .../modules/xcm-bridge-hub-router/src/lib.rs | 2 +- .../modules/xcm-bridge-hub-router/src/mock.rs | 8 +- .../xcm-bridge-hub-router/src/weights.rs | 3 +- .../modules/xcm-bridge-hub/src/dispatcher.rs | 4 +- .../modules/xcm-bridge-hub/src/exporter.rs | 8 +- pezbridges/modules/xcm-bridge-hub/src/lib.rs | 39 +- pezbridges/modules/xcm-bridge-hub/src/mock.rs | 10 +- pezbridges/primitives/beefy/src/lib.rs | 6 +- .../primitives/header-chain/src/call_info.rs | 4 +- .../header-chain/src/justification/mod.rs | 4 +- .../src/justification/verification/mod.rs | 2 +- pezbridges/primitives/header-chain/src/lib.rs | 12 +- .../primitives/messages/src/call_info.rs | 2 +- pezbridges/primitives/messages/src/lane.rs | 4 +- pezbridges/primitives/messages/src/lib.rs | 6 +- .../primitives/messages/src/source_chain.rs | 4 +- .../primitives/messages/src/target_chain.rs | 6 +- .../primitives/pezkuwi-core/src/teyrchains.rs | 4 +- .../primitives/relayers/src/extension.rs | 2 +- pezbridges/primitives/relayers/src/lib.rs | 2 +- .../primitives/relayers/src/registration.rs | 2 +- pezbridges/primitives/runtime/src/chain.rs | 2 +- .../primitives/runtime/src/extensions.rs | 2 +- pezbridges/primitives/runtime/src/lib.rs | 20 +- pezbridges/primitives/runtime/src/messages.rs | 2 +- .../primitives/runtime/src/storage_proof.rs | 5 +- .../primitives/runtime/src/storage_types.rs | 2 +- pezbridges/primitives/test-utils/src/lib.rs | 7 +- .../primitives/teyrchains/src/call_info.rs | 4 +- pezbridges/primitives/teyrchains/src/lib.rs | 16 +- .../xcm-bridge-hub-router/src/lib.rs | 5 +- .../xcm-bridge-hub/src/call_info.rs | 2 +- .../primitives/xcm-bridge-hub/src/lib.rs | 6 +- .../relays/client-bizinikiwi/src/calls.rs | 2 +- .../relays/client-bizinikiwi/src/chain.rs | 12 +- .../client-bizinikiwi/src/client/caching.rs | 4 +- .../client-bizinikiwi/src/client/mod.rs | 2 +- .../client-bizinikiwi/src/client/rpc.rs | 10 +- .../client-bizinikiwi/src/client/traits.rs | 2 +- .../relays/client-bizinikiwi/src/error.rs | 2 +- .../src/metrics/float_storage_value.rs | 4 +- .../client-bizinikiwi/src/test_chain.rs | 2 +- .../src/transaction_tracker.rs | 2 +- .../relays/equivocation/src/block_checker.rs | 2 +- .../equivocation/src/equivocation_loop.rs | 2 +- pezbridges/relays/equivocation/src/mock.rs | 2 +- .../lib-bizinikiwi-relay/src/cli/bridge.rs | 2 +- .../src/cli/init_bridge.rs | 4 +- .../lib-bizinikiwi-relay/src/cli/mod.rs | 2 +- .../src/cli/relay_headers_and_messages/mod.rs | 4 +- .../relay_to_relay.rs | 2 +- .../relay_to_teyrchain.rs | 2 +- .../teyrchain_to_teyrchain.rs | 2 +- .../src/cli/relay_messages.rs | 2 +- .../src/cli/relay_teyrchains.rs | 2 +- .../src/equivocation/mod.rs | 6 +- .../src/equivocation/source.rs | 6 +- .../src/equivocation/target.rs | 8 +- .../relays/lib-bizinikiwi-relay/src/error.rs | 2 +- .../src/finality/initialize.rs | 2 +- .../lib-bizinikiwi-relay/src/finality/mod.rs | 2 +- .../src/finality/source.rs | 4 +- .../src/finality/target.rs | 8 +- .../src/finality_base/engine.rs | 26 +- .../src/finality_base/mod.rs | 9 +- .../relays/lib-bizinikiwi-relay/src/lib.rs | 2 +- .../src/messages/metrics.rs | 6 +- .../lib-bizinikiwi-relay/src/messages/mod.rs | 20 +- .../src/messages/source.rs | 12 +- .../src/messages/target.rs | 6 +- .../src/on_demand/headers.rs | 14 +- .../src/on_demand/teyrchains.rs | 9 +- .../src/teyrchains/source.rs | 2 +- .../src/teyrchains/target.rs | 12 +- pezbridges/relays/messages/src/lib.rs | 4 +- .../relays/messages/src/message_lane.rs | 2 +- .../relays/teyrchains/src/teyrchains_loop.rs | 2 +- pezbridges/relays/utils/src/lib.rs | 4 +- .../ethereum-client/src/benchmarking/mod.rs | 2 +- .../ethereum-client/src/benchmarking/util.rs | 4 +- .../pezpallets/ethereum-client/src/lib.rs | 3 +- .../pezpallets/ethereum-client/src/mock.rs | 2 +- .../pezpallets/ethereum-client/src/tests.rs | 2 +- .../pezpallets/ethereum-client/src/types.rs | 3 +- .../pezpallets/inbound-queue-v2/src/lib.rs | 6 +- .../pezpallets/inbound-queue-v2/src/mock.rs | 2 +- .../pezpallets/inbound-queue/src/lib.rs | 10 +- .../pezpallets/inbound-queue/src/mock.rs | 2 +- .../pezpallets/inbound-queue/src/test.rs | 2 +- .../pezpallets/outbound-queue-v2/src/lib.rs | 6 +- .../pezpallets/outbound-queue-v2/src/mock.rs | 2 +- .../pezpallets/outbound-queue-v2/src/test.rs | 2 +- .../pezpallets/outbound-queue-v2/src/types.rs | 2 +- .../pezpallets/outbound-queue/src/lib.rs | 7 +- .../pezpallets/outbound-queue/src/types.rs | 2 +- .../pezpallets/system-frontend/src/lib.rs | 6 +- .../pezpallets/system-v2/src/lib.rs | 3 +- .../snowbridge/pezpallets/system/src/lib.rs | 11 +- .../pezpallets/system/src/migration.rs | 4 +- .../snowbridge/pezpallets/system/src/tests.rs | 2 +- .../snowbridge/primitives/beacon/src/bls.rs | 4 +- .../snowbridge/primitives/beacon/src/types.rs | 6 +- .../primitives/beacon/src/updates.rs | 2 +- .../snowbridge/primitives/core/src/lib.rs | 6 +- .../primitives/core/src/operating_mode.rs | 2 +- .../snowbridge/primitives/core/src/pricing.rs | 2 +- .../snowbridge/primitives/core/src/reward.rs | 2 +- .../primitives/inbound-queue/src/v1.rs | 4 +- .../inbound-queue/src/v2/converter.rs | 2 +- .../inbound-queue/src/v2/message.rs | 4 +- .../primitives/merkle-tree/src/lib.rs | 2 +- .../primitives/outbound-queue/src/lib.rs | 2 +- .../outbound-queue/src/v1/converter/tests.rs | 2 +- .../outbound-queue/src/v1/message.rs | 2 +- .../outbound-queue/src/v2/converter/tests.rs | 2 +- .../outbound-queue/src/v2/message.rs | 2 +- .../primitives/outbound-queue/src/v2/mod.rs | 2 +- .../primitives/verification/src/lib.rs | 2 +- .../runtime-common/src/v2/register_token.rs | 6 +- .../snowbridge/runtime/test-common/src/lib.rs | 58 +- .../test-utils/src/mock_outbound_queue.rs | 8 +- .../snowbridge/test-utils/src/mock_rewards.rs | 2 +- .../client/bootnodes/src/advertisement.rs | 8 +- pezcumulus/client/bootnodes/src/discovery.rs | 6 +- pezcumulus/client/bootnodes/src/task.rs | 8 +- pezcumulus/client/cli/src/lib.rs | 15 +- pezcumulus/client/collator/src/lib.rs | 4 +- .../consensus/aura/src/collators/basic.rs | 2 +- .../consensus/aura/src/collators/lookahead.rs | 2 +- .../consensus/aura/src/collators/mod.rs | 2 +- .../slot_based/block_builder_task.rs | 2 +- .../src/collators/slot_based/block_import.rs | 6 +- .../collators/slot_based/collation_task.rs | 4 +- .../aura/src/collators/slot_based/mod.rs | 6 +- .../src/collators/slot_based/slot_timer.rs | 2 +- .../aura/src/collators/slot_based/tests.rs | 4 +- .../aura/src/equivocation_import_queue.rs | 6 +- .../client/consensus/aura/src/import_queue.rs | 26 +- .../consensus/common/src/level_monitor.rs | 4 +- .../consensus/common/src/parent_search.rs | 5 +- .../client/consensus/common/src/tests.rs | 4 +- .../common/src/teyrchain_consensus.rs | 2 +- .../client/consensus/proposer/src/lib.rs | 3 +- pezcumulus/client/network/src/lib.rs | 2 +- pezcumulus/client/network/src/tests.rs | 6 +- .../src/active_candidate_recovery.rs | 2 +- pezcumulus/client/pov-recovery/src/lib.rs | 2 +- pezcumulus/client/pov-recovery/src/tests.rs | 14 +- .../src/lib.rs | 4 +- .../src/blockchain_rpc_client.rs | 15 +- .../relay-chain-minimal-node/src/lib.rs | 34 +- .../relay-chain-rpc-interface/src/lib.rs | 2 +- .../src/reconnecting_ws_client.rs | 8 +- .../client/relay-chain-streams/src/lib.rs | 2 +- pezcumulus/client/service/src/lib.rs | 12 +- .../client/teyrchain-inherent/src/lib.rs | 2 +- pezcumulus/pezkuwi-omni-node/lib/src/cli.rs | 4 +- .../pezkuwi-omni-node/lib/src/command.rs | 11 +- .../pezkuwi-omni-node/lib/src/common/mod.rs | 2 +- .../pezkuwi-omni-node/lib/src/common/rpc.rs | 9 +- .../pezkuwi-omni-node/lib/src/common/spec.rs | 6 +- .../pezkuwi-omni-node/lib/src/nodes/aura.rs | 32 +- .../src/chain_spec/pezkuwichain_teyrchain.rs | 2 +- pezcumulus/pezpallets/ah-ops/src/lib.rs | 5 +- pezcumulus/pezpallets/aura-ext/src/test.rs | 5 +- .../collator-selection/src/benchmarking.rs | 14 +- .../pezpallets/collator-selection/src/lib.rs | 7 +- .../collator-selection/src/migration.rs | 33 +- pezcumulus/pezpallets/dmp-queue/src/lib.rs | 3 +- .../session-benchmarking/src/inner.rs | 6 +- pezcumulus/pezpallets/solo-to-para/src/lib.rs | 2 +- .../src/descendant_validation.rs | 2 +- .../pezpallets/teyrchain-system/src/lib.rs | 12 +- .../pezpallets/teyrchain-system/src/mock.rs | 5 +- .../src/relay_state_snapshot.rs | 8 +- .../pezpallets/teyrchain-system/src/tests.rs | 15 +- .../src/teyrchain_inherent.rs | 2 +- .../src/unincluded_segment.rs | 2 +- .../src/validate_block/trie_recorder.rs | 38 +- .../weight-reclaim/src/benchmarks.rs | 6 +- .../pezpallets/weight-reclaim/src/lib.rs | 67 +- .../pezpallets/weight-reclaim/src/tests.rs | 14 +- pezcumulus/pezpallets/xcm/src/lib.rs | 5 +- pezcumulus/pezpallets/xcmp-queue/src/lib.rs | 11 +- .../pezpallets/xcmp-queue/src/migration.rs | 6 +- pezcumulus/pezpallets/xcmp-queue/src/mock.rs | 8 +- pezcumulus/pezpallets/xcmp-queue/src/tests.rs | 2 +- pezcumulus/primitives/core/src/lib.rs | 2 +- .../storage-weight-reclaim/src/lib.rs | 2 +- .../storage-weight-reclaim/src/tests.rs | 4 +- .../primitives/teyrchain-inherent/src/lib.rs | 2 +- pezcumulus/primitives/utility/src/lib.rs | 2 +- .../utility/src/tests/swap_first.rs | 2 +- pezcumulus/test/client/src/lib.rs | 14 +- pezcumulus/test/runtime/src/test_pallet.rs | 5 +- .../service/benches/transaction_throughput.rs | 6 +- .../service/benches/validate_block_glutton.rs | 8 +- pezcumulus/test/service/src/bench_utils.rs | 3 +- pezcumulus/test/service/src/cli.rs | 30 +- pezcumulus/test/service/src/lib.rs | 43 +- pezcumulus/test/service/src/main.rs | 2 +- pezcumulus/teyrchains/common/src/impls.rs | 17 +- .../teyrchains/common/src/xcm_config.rs | 2 +- .../people/people-pezkuwichain/src/genesis.rs | 2 +- .../people/people-zagros/src/genesis.rs | 2 +- .../bridge-hub-pezkuwichain/src/genesis.rs | 27 +- .../bridge-hub-zagros/src/genesis.rs | 22 +- .../teyrchains/testing/penpal/src/genesis.rs | 8 +- .../emulated/common/src/impls.rs | 11 +- .../networks/pezkuwichain-system/src/lib.rs | 8 +- .../pezkuwichain-zagros-system/src/lib.rs | 4 +- .../networks/zagros-system/src/lib.rs | 8 +- .../assets/asset-hub-pezkuwichain/src/lib.rs | 6 +- .../src/tests/treasury.rs | 19 +- .../tests/assets/asset-hub-zagros/src/lib.rs | 18 +- .../asset-hub-zagros/src/tests/reward_pool.rs | 4 +- .../collectives/collectives-zagros/src/lib.rs | 4 +- .../src/tests/fellowship_treasury.rs | 26 +- .../src/tests/coretime_interface.rs | 2 +- .../tests/coretime/coretime-zagros/src/lib.rs | 4 +- .../tests/governance/zagros/src/common.rs | 4 +- .../tests/governance/zagros/src/lib.rs | 2 +- .../tests/people/people-zagros/src/lib.rs | 4 +- .../people-zagros/src/tests/governance.rs | 72 +- .../people-zagros/src/tests/identity.rs | 2 +- .../bridge-hub-pezkuwichain/src/lib.rs | 10 +- .../pezbridges/bridge-hub-zagros/src/lib.rs | 12 +- .../bridge-hub-zagros/src/tests/aliases.rs | 2 +- .../bridge-hub-zagros/src/tests/snowbridge.rs | 8 +- .../src/tests/snowbridge_common.rs | 2 +- .../src/tests/snowbridge_edge_case.rs | 2 +- .../src/tests/snowbridge_v2_inbound.rs | 12 +- .../snowbridge_v2_inbound_to_pezkuwichain.rs | 4 +- .../src/tests/snowbridge_v2_rewards.rs | 2 +- .../pezpallets/collective-content/src/lib.rs | 12 +- .../pezpallets/identity-kyc/src/lib.rs | 3 +- .../pezpallets/identity-kyc/src/types.rs | 2 +- .../teyrchains/pezpallets/perwerde/src/lib.rs | 3 +- .../pezpallets/perwerde/src/mock.rs | 4 +- .../pezpallets/pez-rewards/src/lib.rs | 2 +- .../pezpallets/pez-treasury/src/lib.rs | 5 +- .../pezpallets/pez-treasury/src/migrations.rs | 8 +- .../pezpallets/pez-treasury/src/mock.rs | 5 +- .../teyrchains/pezpallets/ping/src/lib.rs | 3 +- .../teyrchains/pezpallets/referral/src/lib.rs | 6 +- .../pezpallets/staking-score/src/lib.rs | 3 +- .../pezpallets/staking-score/src/mock.rs | 7 +- .../teyrchains/pezpallets/tiki/src/lib.rs | 9 +- .../pezpallets/tiki/src/migrations.rs | 9 +- .../token-wrapper/src/benchmarking.rs | 16 +- .../teyrchains/pezpallets/trust/src/lib.rs | 3 +- .../pezpallets/welati/src/benchmarking.rs | 9 +- .../teyrchains/pezpallets/welati/src/lib.rs | 3 +- .../pezpallets/welati/src/migrations.rs | 8 +- .../teyrchains/pezpallets/welati/src/types.rs | 2 +- .../bridge-primitives/src/lib.rs | 2 +- .../src/genesis_config_presets.rs | 2 +- .../assets/asset-hub-pezkuwichain/src/lib.rs | 14 +- .../asset-hub-pezkuwichain/src/staking.rs | 11 +- .../asset-hub-pezkuwichain/src/tests/mod.rs | 6 +- .../asset-hub-pezkuwichain/src/weights/mod.rs | 4 +- .../asset-hub-pezkuwichain/src/xcm_config.rs | 6 +- .../asset-hub-pezkuwichain/tests/tests.rs | 2 +- .../bridge-primitives/src/lib.rs | 4 +- .../src/genesis_config_presets.rs | 2 +- .../asset-hub-zagros/src/governance/mod.rs | 2 +- .../assets/asset-hub-zagros/src/lib.rs | 19 +- .../assets/asset-hub-zagros/src/staking.rs | 11 +- .../asset-hub-zagros/src/weights/mod.rs | 8 +- .../assets/asset-hub-zagros/src/xcm_config.rs | 6 +- .../assets/asset-hub-zagros/tests/tests.rs | 7 +- .../runtimes/assets/common/src/benchmarks.rs | 3 +- .../assets/common/src/fungible_conversion.rs | 5 +- .../runtimes/assets/common/src/lib.rs | 28 +- .../assets/test-utils/src/test_cases.rs | 39 +- .../bridge-primitives/src/lib.rs | 2 +- .../src/bridge_to_bulletin_config.rs | 6 +- .../src/bridge_to_ethereum_config.rs | 5 +- .../src/bridge_to_zagros_config.rs | 24 +- .../bridge-hub-pezkuwichain/src/lib.rs | 5 +- .../src/weights/mod.rs | 6 +- .../bridge-hub-pezkuwichain/src/xcm_config.rs | 4 +- .../tests/snowbridge.rs | 11 +- .../bridge-hub-pezkuwichain/tests/tests.rs | 44 +- .../bridge-primitives/src/lib.rs | 2 +- .../src/bridge_to_ethereum_config.rs | 26 +- .../src/bridge_to_pezkuwichain_config.rs | 21 +- .../bridge-hubs/bridge-hub-zagros/src/lib.rs | 3 +- .../bridge-hub-zagros/src/weights/mod.rs | 4 +- .../bridge-hub-zagros/src/xcm_config.rs | 8 +- .../bridge-hub-zagros/tests/snowbridge.rs | 11 +- .../bridge-hub-zagros/tests/tests.rs | 14 +- .../bridge-hubs/common/src/message_queue.rs | 2 +- .../src/test_cases/from_teyrchain.rs | 21 +- .../test-utils/src/test_cases/helpers.rs | 53 +- .../test-utils/src/test_cases/mod.rs | 26 +- .../src/test_data/from_grandpa_chain.rs | 2 +- .../src/test_data/from_teyrchain.rs | 56 +- .../test-utils/src/test_data/mod.rs | 2 +- .../collectives-zagros/src/ambassador/mod.rs | 11 +- .../collectives-zagros/src/fellowship/mod.rs | 18 +- .../src/fellowship/tracks.rs | 44 +- .../collectives-zagros/src/impls.rs | 5 +- .../collectives/collectives-zagros/src/lib.rs | 7 +- .../collectives-zagros/src/weights/mod.rs | 4 +- .../collectives-zagros/src/xcm_config.rs | 4 +- .../runtimes/constants/src/pezkuwichain.rs | 2 +- .../runtimes/constants/src/zagros.rs | 6 +- .../coretime-pezkuwichain/src/coretime.rs | 2 +- .../coretime/coretime-pezkuwichain/src/lib.rs | 5 +- .../coretime-pezkuwichain/src/weights/mod.rs | 4 +- .../coretime-pezkuwichain/src/xcm_config.rs | 6 +- .../coretime/coretime-zagros/src/lib.rs | 5 +- .../coretime-zagros/src/weights/mod.rs | 4 +- .../coretime-zagros/src/xcm_config.rs | 6 +- .../src/genesis_config_presets.rs | 2 +- .../people/people-pezkuwichain/src/lib.rs | 11 +- .../people/people-pezkuwichain/src/people.rs | 2 +- .../people-pezkuwichain/src/weights/mod.rs | 6 +- .../people-pezkuwichain/src/xcm_config.rs | 2 +- .../runtimes/people/people-zagros/src/lib.rs | 5 +- .../people/people-zagros/src/people.rs | 2 +- .../people/people-zagros/src/weights/mod.rs | 6 +- .../people/people-zagros/src/xcm_config.rs | 2 +- .../people/people-zagros/tests/tests.rs | 2 +- .../teyrchains/runtimes/test-utils/src/lib.rs | 34 +- .../runtimes/testing/penpal/src/lib.rs | 7 +- .../runtimes/testing/penpal/src/xcm_config.rs | 9 +- .../testing/pezkuwichain-teyrchain/src/lib.rs | 5 +- .../testing/yet-another-teyrchain/src/lib.rs | 5 +- .../yet-another-teyrchain/src/xcm_config.rs | 5 +- pezcumulus/xcm/xcm-pez-emulator/src/lib.rs | 4 +- .../zombienet-sdk-helpers/src/lib.rs | 4 +- pezkuwi/cli/src/command.rs | 20 +- pezkuwi/core-primitives/src/lib.rs | 2 +- pezkuwi/node/collation-generation/src/lib.rs | 8 +- .../node/collation-generation/src/tests.rs | 8 +- .../core/approval-voting-parallel/src/lib.rs | 8 +- .../approval-voting-parallel/src/tests.rs | 12 +- .../src/approval_db/v2/migration_helpers.rs | 2 +- .../approval-voting/src/approval_db/v2/mod.rs | 2 +- .../src/approval_db/v3/migration_helpers.rs | 2 +- .../approval-voting/src/approval_db/v3/mod.rs | 2 +- .../node/core/approval-voting/src/criteria.rs | 7 +- .../node/core/approval-voting/src/import.rs | 30 +- pezkuwi/node/core/approval-voting/src/lib.rs | 20 +- .../node/core/approval-voting/src/tests.rs | 21 +- pezkuwi/node/core/av-store/src/lib.rs | 2 +- pezkuwi/node/core/av-store/src/tests.rs | 2 +- pezkuwi/node/core/backing/src/lib.rs | 8 +- pezkuwi/node/core/backing/src/tests/mod.rs | 2 +- .../node/core/candidate-validation/src/lib.rs | 2 +- .../core/candidate-validation/src/tests.rs | 14 +- pezkuwi/node/core/chain-api/src/tests.rs | 2 +- pezkuwi/node/core/chain-selection/src/lib.rs | 2 +- pezkuwi/node/core/chain-selection/src/tree.rs | 2 +- .../core/dispute-coordinator/src/db/v1.rs | 2 +- .../core/dispute-coordinator/src/import.rs | 4 +- .../dispute-coordinator/src/initialized.rs | 8 +- .../node/core/dispute-coordinator/src/lib.rs | 8 +- .../src/participation/mod.rs | 2 +- .../src/participation/tests.rs | 2 +- .../dispute-coordinator/src/scraping/mod.rs | 4 +- .../dispute-coordinator/src/scraping/tests.rs | 2 +- .../core/dispute-coordinator/src/tests.rs | 10 +- .../node/core/provisioner/src/disputes/mod.rs | 2 +- .../src/disputes/prioritized_selection/mod.rs | 2 +- .../disputes/prioritized_selection/tests.rs | 2 +- .../core/pvf/common/src/executor_interface.rs | 6 +- .../node/core/pvf/execute-worker/src/lib.rs | 34 +- pezkuwi/node/core/pvf/src/execute/queue.rs | 4 +- pezkuwi/node/core/pvf/src/host.rs | 2 +- pezkuwi/node/core/pvf/tests/it/main.rs | 2 +- pezkuwi/node/core/pvf/tests/it/process.rs | 2 +- pezkuwi/node/core/runtime-api/src/cache.rs | 2 +- pezkuwi/node/core/runtime-api/src/tests.rs | 2 +- .../src/variants/suggest_garbage_candidate.rs | 2 +- pezkuwi/node/metrics/src/runtime/mod.rs | 3 +- .../network/approval-distribution/src/lib.rs | 24 +- .../approval-distribution/src/tests.rs | 19 +- .../src/pov_requester/mod.rs | 4 +- .../src/requester/fetch_task/mod.rs | 2 +- .../src/requester/fetch_task/tests.rs | 2 +- .../src/requester/tests.rs | 2 +- .../src/responder.rs | 2 +- .../src/tests/state.rs | 2 +- .../network/availability-recovery/src/lib.rs | 2 +- .../availability-recovery/src/task/mod.rs | 2 +- .../src/task/strategy/chunks.rs | 2 +- .../src/task/strategy/full.rs | 2 +- .../src/task/strategy/mod.rs | 4 +- .../src/task/strategy/systematic.rs | 2 +- .../availability-recovery/src/tests.rs | 2 +- .../bitfield-distribution/src/tests.rs | 2 +- .../src/collator_side/error.rs | 2 +- .../src/collator_side/mod.rs | 4 +- .../src/collator_side/tests/mod.rs | 2 +- .../src/validator_side/collation.rs | 2 +- .../src/validator_side/mod.rs | 4 +- .../src/validator_side/tests/mod.rs | 2 +- .../network/dispute-distribution/src/lib.rs | 2 +- .../dispute-distribution/src/receiver/mod.rs | 2 +- .../dispute-distribution/src/sender/error.rs | 2 +- .../dispute-distribution/src/sender/mod.rs | 2 +- .../dispute-distribution/src/tests/mod.rs | 9 +- .../statement-distribution/src/v2/mod.rs | 6 +- .../src/v2/tests/mod.rs | 2 +- .../node/overseer/examples/minimal-example.rs | 2 +- pezkuwi/node/overseer/src/tests.rs | 8 +- pezkuwi/node/service/src/benchmarking.rs | 14 +- pezkuwi/node/service/src/builder/mod.rs | 7 +- pezkuwi/node/service/src/builder/partial.rs | 4 +- pezkuwi/node/service/src/fake_runtime_api.rs | 2 +- pezkuwi/node/service/src/lib.rs | 20 +- .../node/service/src/relay_chain_selection.rs | 2 +- pezkuwi/node/service/src/tests.rs | 2 +- .../src/lib/approval/helpers.rs | 6 +- .../src/lib/approval/message_generator.rs | 8 +- .../src/lib/approval/mock_chain_selection.rs | 4 +- .../subsystem-bench/src/lib/approval/mod.rs | 6 +- .../src/lib/availability/test_state.rs | 2 +- .../subsystem-bench/src/lib/configuration.rs | 6 +- .../subsystem-bench/src/lib/disputes/mod.rs | 2 +- .../src/lib/disputes/test_state.rs | 4 +- .../subsystem-bench/src/lib/mock/av_store.rs | 2 +- .../src/lib/mock/availability_recovery.rs | 2 +- .../src/lib/mock/candidate_backing.rs | 2 +- .../src/lib/mock/candidate_validation.rs | 2 +- .../node/subsystem-bench/src/lib/network.rs | 4 +- .../src/lib/statement/test_state.rs | 2 +- .../node/subsystem-test-helpers/src/lib.rs | 2 +- .../src/controlled_validator_indices.rs | 2 +- pezkuwi/node/subsystem-util/src/lib.rs | 2 +- pezkuwi/node/test/client/src/lib.rs | 7 +- pezkuwi/node/test/service/src/chain_spec.rs | 2 +- pezkuwi/node/test/service/src/lib.rs | 15 +- .../node/test/service/tests/call-function.rs | 7 +- .../pezpallets/validator-pool/src/types.rs | 2 +- pezkuwi/primitives/src/v9/async_backing.rs | 2 +- pezkuwi/primitives/src/v9/mod.rs | 2 +- pezkuwi/primitives/test-helpers/src/lib.rs | 4 +- pezkuwi/rpc/src/lib.rs | 10 +- .../common/src/assigned_slots/benchmarking.rs | 18 +- .../runtime/common/src/assigned_slots/mod.rs | 9 +- pezkuwi/runtime/common/src/auctions/mock.rs | 2 +- pezkuwi/runtime/common/src/auctions/mod.rs | 5 +- pezkuwi/runtime/common/src/auctions/tests.rs | 2 +- .../runtime/common/src/claims/benchmarking.rs | 2 +- pezkuwi/runtime/common/src/claims/mock.rs | 4 +- pezkuwi/runtime/common/src/claims/mod.rs | 9 +- pezkuwi/runtime/common/src/claims/tests.rs | 2 +- .../runtime/common/src/crowdloan/migration.rs | 5 +- pezkuwi/runtime/common/src/crowdloan/mod.rs | 12 +- pezkuwi/runtime/common/src/elections.rs | 7 +- .../runtime/common/src/identity_migrator.rs | 13 +- pezkuwi/runtime/common/src/impls.rs | 6 +- .../runtime/common/src/integration_tests.rs | 2 +- pezkuwi/runtime/common/src/lib.rs | 2 +- .../runtime/common/src/paras_registrar/mod.rs | 11 +- .../common/src/paras_registrar/tests.rs | 2 +- .../runtime/common/src/paras_sudo_wrapper.rs | 13 +- pezkuwi/runtime/common/src/purchase/mod.rs | 5 +- pezkuwi/runtime/common/src/slots/mod.rs | 11 +- pezkuwi/runtime/common/src/try_runtime.rs | 4 +- .../runtime/pezkuwichain/constants/src/lib.rs | 2 +- pezkuwi/runtime/pezkuwichain/src/lib.rs | 4 +- .../pezkuwichain/src/validator_manager.rs | 3 +- .../runtime/pezkuwichain/src/weights/mod.rs | 30 +- .../runtime/test-runtime/constants/src/lib.rs | 2 +- pezkuwi/runtime/test-runtime/src/lib.rs | 13 +- .../teyrchains/src/assigner_coretime/mod.rs | 8 +- .../teyrchains/src/assigner_coretime/tests.rs | 2 +- pezkuwi/runtime/teyrchains/src/builder.rs | 10 +- .../runtime/teyrchains/src/configuration.rs | 2 +- .../teyrchains/src/coretime/migration.rs | 5 +- .../runtime/teyrchains/src/coretime/mod.rs | 33 +- pezkuwi/runtime/teyrchains/src/disputes.rs | 9 +- .../teyrchains/src/disputes/slashing.rs | 2 +- .../src/disputes/slashing/benchmarking.rs | 10 +- pezkuwi/runtime/teyrchains/src/dmp.rs | 10 +- pezkuwi/runtime/teyrchains/src/dmp/tests.rs | 2 +- pezkuwi/runtime/teyrchains/src/hrmp.rs | 9 +- .../teyrchains/src/hrmp/benchmarking.rs | 2 +- .../teyrchains/src/inclusion/benchmarking.rs | 2 +- .../teyrchains/src/inclusion/migration.rs | 4 +- .../runtime/teyrchains/src/inclusion/mod.rs | 7 +- pezkuwi/runtime/teyrchains/src/initializer.rs | 4 +- pezkuwi/runtime/teyrchains/src/mock.rs | 4 +- .../teyrchains/src/on_demand/benchmarking.rs | 2 +- .../runtime/teyrchains/src/on_demand/mod.rs | 16 +- .../runtime/teyrchains/src/on_demand/tests.rs | 2 +- .../teyrchains/src/paras/benchmarking.rs | 45 +- pezkuwi/runtime/teyrchains/src/paras/mod.rs | 16 +- .../teyrchains/src/paras_inherent/mod.rs | 10 +- .../teyrchains/src/paras_inherent/tests.rs | 42 +- .../teyrchains/src/runtime_api_impl/v13.rs | 18 +- .../teyrchains/src/scheduler/common.rs | 2 +- .../teyrchains/src/scheduler/migration.rs | 3 +- .../teyrchains/src/shared/migration.rs | 5 +- pezkuwi/runtime/teyrchains/src/ump_tests.rs | 5 +- pezkuwi/runtime/zagros/constants/src/lib.rs | 2 +- .../zagros/src/genesis_config_presets.rs | 2 +- pezkuwi/runtime/zagros/src/lib.rs | 36 +- pezkuwi/runtime/zagros/src/weights/mod.rs | 32 +- pezkuwi/runtime/zagros/src/xcm_config.rs | 2 +- pezkuwi/tests/common.rs | 2 +- pezkuwi/teyrchain/src/primitives.rs | 4 +- .../test-teyrchains/adder/collator/src/cli.rs | 5 +- .../adder/collator/src/main.rs | 4 +- .../undying/collator/src/cli.rs | 5 +- .../undying/collator/src/lib.rs | 2 +- .../undying/collator/src/main.rs | 4 +- pezkuwi/xcm/docs/src/fundamentals.rs | 4 +- .../xcm/pezpallet-xcm/precompiles/src/lib.rs | 3 +- .../xcm/pezpallet-xcm/precompiles/src/mock.rs | 10 +- .../pezpallet-xcm/precompiles/src/tests.rs | 2 +- pezkuwi/xcm/pezpallet-xcm/src/lib.rs | 32 +- pezkuwi/xcm/pezpallet-xcm/src/migration.rs | 6 +- pezkuwi/xcm/pezpallet-xcm/src/mock.rs | 13 +- pezkuwi/xcm/src/v3/mod.rs | 14 +- pezkuwi/xcm/src/v3/multilocation.rs | 4 +- pezkuwi/xcm/src/v4/location.rs | 4 +- pezkuwi/xcm/src/v4/mod.rs | 4 +- pezkuwi/xcm/src/v5/location.rs | 4 +- pezkuwi/xcm/src/v5/mod.rs | 4 +- .../single_asset_adapter/mock.rs | 4 +- .../xcm-builder/src/location_conversion.rs | 3 +- .../xcm/xcm-builder/src/origin_conversion.rs | 4 +- .../xcm-builder/src/process_xcm_message.rs | 2 +- pezkuwi/xcm/xcm-builder/src/tests/pay/mock.rs | 4 +- pezkuwi/xcm/xcm-builder/tests/mock/mod.rs | 6 +- .../xcm-executor/integration-tests/src/lib.rs | 7 +- .../xcm-executor/src/traits/asset_transfer.rs | 2 +- pezkuwi/xcm/xcm-executor/src/traits/mod.rs | 2 +- .../xcm-executor/src/traits/on_response.rs | 2 +- .../xcm/xcm-pez-simulator/example/src/lib.rs | 10 +- .../xcm-pez-simulator/example/src/tests.rs | 11 +- .../xcm-pez-simulator/fuzzer/src/teyrchain.rs | 5 +- .../src/mock_message_queue.rs | 3 +- .../xcm-runtime-pezapis/tests/conversions.rs | 2 +- .../tests/fee_estimation.rs | 5 +- pezkuwi/xcm/xcm-runtime-pezapis/tests/mock.rs | 14 +- .../tests/trusted_query.rs | 2 +- .../tests/teyrchains/weights.rs | 5 +- templates/minimal/node/src/command.rs | 13 +- templates/minimal/runtime/src/lib.rs | 14 +- templates/solochain/node/src/benchmarking.rs | 4 +- templates/solochain/node/src/chain_spec.rs | 2 +- templates/solochain/node/src/command.rs | 2 +- templates/solochain/node/src/rpc.rs | 4 +- templates/solochain/node/src/service.rs | 12 +- .../solochain/pezpallets/template/src/lib.rs | 41 +- .../solochain/pezpallets/template/src/mock.rs | 5 +- .../runtime/src/genesis_config_presets.rs | 2 +- templates/teyrchain/node/src/command.rs | 25 +- templates/teyrchain/node/src/rpc.rs | 2 +- templates/teyrchain/node/src/service.rs | 9 +- .../teyrchain/pezpallets/template/src/lib.rs | 16 +- .../teyrchain/runtime/src/configs/mod.rs | 2 +- .../runtime/src/configs/xcm_config.rs | 5 +- .../runtime/src/genesis_config_presets.rs | 2 +- templates/teyrchain/runtime/src/lib.rs | 2 +- umbrella/Cargo.toml | 2607 ++++++++--------- umbrella/src/lib.rs | 1447 +++++---- vendor/ss58-registry/Cargo.toml | 6 +- 1358 files changed, 9464 insertions(+), 7656 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f7cd5efe..76866725 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13784,7 +13784,7 @@ dependencies = [ [[package]] name = "pezkuwi-sdk" -version = "1.11.0" +version = "0.0.0" dependencies = [ "asset-test-pezutils", "assets-common", @@ -13796,6 +13796,7 @@ dependencies = [ "bizinikiwi-prometheus-endpoint", "bizinikiwi-rpc-client", "bizinikiwi-state-trie-migration-rpc", + "bizinikiwi-txtesttool", "bizinikiwi-wasm-builder", "bp-header-pez-chain", "bp-messages", @@ -13806,7 +13807,6 @@ dependencies = [ "bp-xcm-bridge-hub", "bp-xcm-bridge-hub-router", "bridge-hub-common", - "emulated-integration-tests-common", "frame-remote-externalities", "pez-ethereum-standards", "pez-fork-tree", @@ -13851,7 +13851,6 @@ dependencies = [ "pezcumulus-relay-chain-minimal-node", "pezcumulus-relay-chain-rpc-interface", "pezcumulus-relay-chain-streams", - "pezcumulus-test-relay-sproof-builder", "pezframe-benchmarking", "pezframe-benchmarking-cli", "pezframe-benchmarking-pezpallet-pov", @@ -13866,7 +13865,6 @@ dependencies = [ "pezframe-system", "pezframe-system-benchmarking", "pezframe-system-rpc-runtime-api", - "pezframe-try-runtime", "pezkuwi-approval-distribution", "pezkuwi-availability-bitfield-distribution", "pezkuwi-availability-distribution", @@ -13957,7 +13955,6 @@ dependencies = [ "pezpallet-delegated-staking", "pezpallet-democracy", "pezpallet-derivatives", - "pezpallet-dev-mode", "pezpallet-dummy-dim", "pezpallet-election-provider-multi-block", "pezpallet-election-provider-multi-phase", @@ -14005,7 +14002,6 @@ dependencies = [ "pezpallet-revive-proc-macro", "pezpallet-revive-uapi", "pezpallet-root-offences", - "pezpallet-root-testing", "pezpallet-safe-mode", "pezpallet-salary", "pezpallet-scheduler", @@ -14040,7 +14036,6 @@ dependencies = [ "pezpallet-vesting", "pezpallet-whitelist", "pezpallet-xcm", - "pezpallet-xcm-benchmarks", "pezpallet-xcm-bridge-hub", "pezpallet-xcm-bridge-hub-router", "pezpallet-xcm-precompiles", @@ -14135,7 +14130,6 @@ dependencies = [ "pezsp-offchain", "pezsp-panic-handler", "pezsp-rpc", - "pezsp-runtime", "pezsp-runtime-interface", "pezsp-runtime-interface-proc-macro", "pezsp-session", diff --git a/Cargo.toml b/Cargo.toml index ffa8506d..85578f86 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace.package] authors = [ - "Kurdistan Tech Institute ", - "Parity Technologies ", + "Kurdistan Tech Institute ", + "Parity Technologies ", ] edition = "2021" homepage = "https://docs.pezkuwichain.io/sdk/" @@ -12,613 +12,613 @@ repository = "https://github.com/pezkuwichain/pezkuwi-sdk.git" resolver = "2" members = [ - "pezbridges/bin/runtime-common", - "pezbridges/chains/chain-pezcumulus", - "pezbridges/chains/chain-pezkuwi-bulletin", - "pezbridges/modules/beefy", - "pezbridges/modules/grandpa", - "pezbridges/modules/messages", - "pezbridges/modules/relayers", - "pezbridges/modules/teyrchains", - "pezbridges/modules/xcm-bridge-hub", - "pezbridges/modules/xcm-bridge-hub-router", - "pezbridges/primitives/beefy", - "pezbridges/primitives/header-chain", - "pezbridges/primitives/messages", - "pezbridges/primitives/pezkuwi-core", - "pezbridges/primitives/relayers", - "pezbridges/primitives/runtime", - "pezbridges/primitives/test-utils", - "pezbridges/primitives/teyrchains", - "pezbridges/primitives/xcm-bridge-hub", - "pezbridges/primitives/xcm-bridge-hub-router", - "pezbridges/relays/client-bizinikiwi", - "pezbridges/relays/equivocation", - "pezbridges/relays/finality", - "pezbridges/relays/lib-bizinikiwi-relay", - "pezbridges/relays/messages", - "pezbridges/relays/teyrchains", - "pezbridges/relays/utils", - "pezbridges/snowbridge/pezpallets/ethereum-client", - "pezbridges/snowbridge/pezpallets/ethereum-client/fixtures", - "pezbridges/snowbridge/pezpallets/inbound-queue", - "pezbridges/snowbridge/pezpallets/inbound-queue-v2", - "pezbridges/snowbridge/pezpallets/inbound-queue-v2/fixtures", - "pezbridges/snowbridge/pezpallets/inbound-queue/fixtures", - "pezbridges/snowbridge/pezpallets/outbound-queue", - "pezbridges/snowbridge/pezpallets/outbound-queue-v2", - "pezbridges/snowbridge/pezpallets/outbound-queue-v2/runtime-api", - "pezbridges/snowbridge/pezpallets/outbound-queue/runtime-api", - "pezbridges/snowbridge/pezpallets/system", - "pezbridges/snowbridge/pezpallets/system-frontend", - "pezbridges/snowbridge/pezpallets/system-v2", - "pezbridges/snowbridge/pezpallets/system-v2/runtime-api", - "pezbridges/snowbridge/pezpallets/system/runtime-api", - "pezbridges/snowbridge/primitives/beacon", - "pezbridges/snowbridge/primitives/core", - "pezbridges/snowbridge/primitives/ethereum", - "pezbridges/snowbridge/primitives/inbound-queue", - "pezbridges/snowbridge/primitives/merkle-tree", - "pezbridges/snowbridge/primitives/outbound-queue", - "pezbridges/snowbridge/primitives/verification", - "pezbridges/snowbridge/runtime/runtime-common", - "pezbridges/snowbridge/runtime/test-common", - "pezbridges/snowbridge/test-utils", - "pezcumulus/bin/pov-validator", - "pezcumulus/client/bootnodes", - "pezcumulus/client/cli", - "pezcumulus/client/collator", - "pezcumulus/client/consensus/aura", - "pezcumulus/client/consensus/common", - "pezcumulus/client/consensus/proposer", - "pezcumulus/client/consensus/relay-chain", - "pezcumulus/client/network", - "pezcumulus/client/pov-recovery", - "pezcumulus/client/relay-chain-inprocess-interface", - "pezcumulus/client/relay-chain-interface", - "pezcumulus/client/relay-chain-minimal-node", - "pezcumulus/client/relay-chain-rpc-interface", - "pezcumulus/client/relay-chain-streams", - "pezcumulus/client/service", - "pezcumulus/client/teyrchain-inherent", - "pezcumulus/pezpallets/ah-ops", - "pezcumulus/pezpallets/aura-ext", - "pezcumulus/pezpallets/collator-selection", - "pezcumulus/pezpallets/dmp-queue", - "pezcumulus/pezpallets/session-benchmarking", - "pezcumulus/pezpallets/solo-to-para", - "pezcumulus/pezpallets/teyrchain-system", - "pezcumulus/pezpallets/teyrchain-system/proc-macro", - "pezcumulus/pezpallets/weight-reclaim", - "pezcumulus/pezpallets/xcm", - "pezcumulus/pezpallets/xcmp-queue", - "pezcumulus/pezkuwi-omni-node", - "pezcumulus/pezkuwi-omni-node/lib", - "pezcumulus/pezkuwi-teyrchain", - "pezcumulus/primitives/aura", - "pezcumulus/primitives/core", - "pezcumulus/primitives/proof-size-hostfunction", - "pezcumulus/primitives/storage-weight-reclaim", - "pezcumulus/primitives/teyrchain-inherent", - "pezcumulus/primitives/timestamp", - "pezcumulus/primitives/utility", - "pezcumulus/test/client", - "pezcumulus/test/relay-sproof-builder", - "pezcumulus/test/runtime", - "pezcumulus/test/service", - "pezcumulus/teyrchains/common", - "pezcumulus/teyrchains/integration-tests/emulated/chains/relays/pezkuwichain", - "pezcumulus/teyrchains/integration-tests/emulated/chains/relays/zagros", - "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/assets/asset-hub-pezkuwichain", - "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/assets/asset-hub-zagros", - "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-pezkuwichain", - "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-zagros", - "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/collectives/collectives-zagros", - "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/coretime/coretime-pezkuwichain", - "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/coretime/coretime-zagros", - "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-pezkuwichain", - "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-zagros", - "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/testing/penpal", - "pezcumulus/teyrchains/integration-tests/emulated/common", - "pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-system", - "pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-zagros-system", - "pezcumulus/teyrchains/integration-tests/emulated/networks/zagros-system", - "pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-pezkuwichain", - "pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-zagros", - "pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-pezkuwichain", - "pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros", - "pezcumulus/teyrchains/integration-tests/emulated/tests/collectives/collectives-zagros", - "pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-pezkuwichain", - "pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-zagros", - "pezcumulus/teyrchains/integration-tests/emulated/tests/governance/zagros", - "pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-pezkuwichain", - "pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros", - "pezcumulus/teyrchains/pezpallets/collective-content", - "pezcumulus/teyrchains/pezpallets/identity-kyc", - "pezcumulus/teyrchains/pezpallets/perwerde", - "pezcumulus/teyrchains/pezpallets/pez-rewards", - "pezcumulus/teyrchains/pezpallets/pez-treasury", - "pezcumulus/teyrchains/pezpallets/ping", - "pezcumulus/teyrchains/pezpallets/presale", - "pezcumulus/teyrchains/pezpallets/referral", - "pezcumulus/teyrchains/pezpallets/staking-score", - "pezcumulus/teyrchains/pezpallets/teyrchain-info", - "pezcumulus/teyrchains/pezpallets/tiki", - "pezcumulus/teyrchains/pezpallets/token-wrapper", - "pezcumulus/teyrchains/pezpallets/trust", - "pezcumulus/teyrchains/pezpallets/welati", - "pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain", - "pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/bridge-primitives", - "pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros", - "pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/bridge-primitives", - "pezcumulus/teyrchains/runtimes/assets/common", - "pezcumulus/teyrchains/runtimes/assets/test-utils", - "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain", - "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/bridge-primitives", - "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros", - "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/bridge-primitives", - "pezcumulus/teyrchains/runtimes/bridge-hubs/common", - "pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils", - "pezcumulus/teyrchains/runtimes/collectives/collectives-zagros", - "pezcumulus/teyrchains/runtimes/constants", - "pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain", - "pezcumulus/teyrchains/runtimes/coretime/coretime-zagros", - "pezcumulus/teyrchains/runtimes/glutton/glutton-zagros", - "pezcumulus/teyrchains/runtimes/people/people-pezkuwichain", - "pezcumulus/teyrchains/runtimes/people/people-zagros", - "pezcumulus/teyrchains/runtimes/test-utils", - "pezcumulus/teyrchains/runtimes/testing/penpal", - "pezcumulus/teyrchains/runtimes/testing/pezkuwichain-teyrchain", - "pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain", - "pezcumulus/xcm/xcm-pez-emulator", - "pezcumulus/zombienet/zombienet-sdk", - "pezcumulus/zombienet/zombienet-sdk-helpers", - "docs/sdk", - "docs/sdk/packages/guides/first-pezpallet", - "docs/sdk/packages/guides/first-runtime", - "docs/sdk/src/reference_docs/chain_spec_runtime", - "pezkuwi", - "pezkuwi/cli", - "pezkuwi/core-primitives", - "pezkuwi/erasure-coding", - "pezkuwi/erasure-coding/fuzzer", - "pezkuwi/node/collation-generation", - "pezkuwi/node/core/approval-voting", - "pezkuwi/node/core/approval-voting-parallel", - "pezkuwi/node/core/av-store", - "pezkuwi/node/core/backing", - "pezkuwi/node/core/bitfield-signing", - "pezkuwi/node/core/candidate-validation", - "pezkuwi/node/core/chain-api", - "pezkuwi/node/core/chain-selection", - "pezkuwi/node/core/dispute-coordinator", - "pezkuwi/node/core/prospective-teyrchains", - "pezkuwi/node/core/provisioner", - "pezkuwi/node/core/pvf", - "pezkuwi/node/core/pvf-checker", - "pezkuwi/node/core/pvf/common", - "pezkuwi/node/core/pvf/execute-worker", - "pezkuwi/node/core/pvf/prepare-worker", - "pezkuwi/node/core/runtime-api", - "pezkuwi/node/core/teyrchains-inherent", - "pezkuwi/node/gum", - "pezkuwi/node/gum/proc-macro", - "pezkuwi/node/malus", - "pezkuwi/node/metrics", - "pezkuwi/node/network/approval-distribution", - "pezkuwi/node/network/availability-distribution", - "pezkuwi/node/network/availability-recovery", - "pezkuwi/node/network/bitfield-distribution", - "pezkuwi/node/network/bridge", - "pezkuwi/node/network/collator-protocol", - "pezkuwi/node/network/dispute-distribution", - "pezkuwi/node/network/gossip-support", - "pezkuwi/node/network/protocol", - "pezkuwi/node/network/statement-distribution", - "pezkuwi/node/overseer", - "pezkuwi/node/primitives", - "pezkuwi/node/service", - "pezkuwi/node/subsystem", - "pezkuwi/node/subsystem-bench", - "pezkuwi/node/subsystem-test-helpers", - "pezkuwi/node/subsystem-types", - "pezkuwi/node/subsystem-util", - "pezkuwi/node/test/client", - "pezkuwi/node/test/service", - "pezkuwi/node/tracking-allocator", - "pezkuwi/node/zombienet-backchannel", - "pezkuwi/pezpallets/validator-pool", - "pezkuwi/primitives", - "pezkuwi/primitives/test-helpers", - "pezkuwi/rpc", - "pezkuwi/runtime/common", - "pezkuwi/runtime/common/pez-slot-range-helper", - "pezkuwi/runtime/metrics", - "pezkuwi/runtime/pezkuwichain", - "pezkuwi/runtime/pezkuwichain/bridge-primitives", - "pezkuwi/runtime/pezkuwichain/constants", - "pezkuwi/runtime/test-runtime", - "pezkuwi/runtime/test-runtime/constants", - "pezkuwi/runtime/teyrchains", - "pezkuwi/runtime/zagros", - "pezkuwi/runtime/zagros/bridge-primitives", - "pezkuwi/runtime/zagros/constants", - "pezkuwi/statement-table", - "pezkuwi/teyrchain", - "pezkuwi/teyrchain/test-teyrchains/adder", - "pezkuwi/teyrchain/test-teyrchains/adder/collator", - "pezkuwi/teyrchain/test-teyrchains/halt", - "pezkuwi/teyrchain/test-teyrchains/undying", - "pezkuwi/teyrchain/test-teyrchains/undying/collator", # People Parachain Custom pezpallets (Phase 2) # Asset Hub Custom pezpallets (Phase 3) - "pezkuwi/utils/pez-generate-bags", - "pezkuwi/utils/remote-ext-tests/bags-list", - "pezkuwi/xcm", - "pezkuwi/xcm/docs", - "pezkuwi/xcm/pezpallet-xcm", - "pezkuwi/xcm/pezpallet-xcm-benchmarks", - "pezkuwi/xcm/pezpallet-xcm/precompiles", - "pezkuwi/xcm/procedural", - "pezkuwi/xcm/xcm-builder", - "pezkuwi/xcm/xcm-executor", - "pezkuwi/xcm/xcm-executor/integration-tests", - "pezkuwi/xcm/xcm-runtime-pezapis", - "pezkuwi/xcm/xcm-pez-simulator", - "pezkuwi/xcm/xcm-pez-simulator/example", - "pezkuwi/xcm/xcm-pez-simulator/fuzzer", - "pezkuwi/zombienet-sdk-tests", - "bizinikiwi/bin/node/bench", - "bizinikiwi/bin/node/cli", - "bizinikiwi/bin/node/inspect", - "bizinikiwi/bin/node/primitives", - "bizinikiwi/bin/node/rpc", - "bizinikiwi/bin/node/runtime", - "bizinikiwi/bin/node/testing", - "bizinikiwi/bin/utils/chain-spec-builder", - "bizinikiwi/bin/utils/pez-subkey", - "bizinikiwi/utils/txtesttool", - "bizinikiwi/client/allocator", - "bizinikiwi/client/api", - "bizinikiwi/client/authority-discovery", - "bizinikiwi/client/basic-authorship", - "bizinikiwi/client/block-builder", - "bizinikiwi/client/chain-spec", - "bizinikiwi/client/chain-spec/derive", - "bizinikiwi/client/cli", - "bizinikiwi/client/consensus/aura", - "bizinikiwi/client/consensus/babe", - "bizinikiwi/client/consensus/babe/rpc", - "bizinikiwi/client/consensus/beefy", - "bizinikiwi/client/consensus/beefy/rpc", - "bizinikiwi/client/consensus/common", - "bizinikiwi/client/consensus/epochs", - "bizinikiwi/client/consensus/grandpa", - "bizinikiwi/client/consensus/grandpa/rpc", - "bizinikiwi/client/consensus/manual-seal", - "bizinikiwi/client/consensus/pow", - "bizinikiwi/client/consensus/slots", - "bizinikiwi/client/db", - "bizinikiwi/client/executor", - "bizinikiwi/client/executor/common", - "bizinikiwi/client/executor/polkavm", - "bizinikiwi/client/executor/runtime-test", - "bizinikiwi/client/executor/wasmtime", - "bizinikiwi/client/informant", - "bizinikiwi/client/keystore", - "bizinikiwi/client/merkle-mountain-range", - "bizinikiwi/client/merkle-mountain-range/rpc", - "bizinikiwi/client/mixnet", - "bizinikiwi/client/network", - "bizinikiwi/client/network-gossip", - "bizinikiwi/client/network/common", - "bizinikiwi/client/network/light", - "bizinikiwi/client/network/statement", - "bizinikiwi/client/network/sync", - "bizinikiwi/client/network/test", - "bizinikiwi/client/network/transactions", - "bizinikiwi/client/network/types", - "bizinikiwi/client/offchain", - "bizinikiwi/client/proposer-metrics", - "bizinikiwi/client/rpc", - "bizinikiwi/client/rpc-api", - "bizinikiwi/client/rpc-servers", - "bizinikiwi/client/rpc-spec-v2", - "bizinikiwi/client/runtime-utilities", - "bizinikiwi/client/service", - "bizinikiwi/client/service/test", - "bizinikiwi/client/state-db", - "bizinikiwi/client/statement-store", - "bizinikiwi/client/storage-monitor", - "bizinikiwi/client/sync-state-rpc", - "bizinikiwi/client/sysinfo", - "bizinikiwi/client/telemetry", - "bizinikiwi/client/tracing", - "bizinikiwi/client/tracing/proc-macro", - "bizinikiwi/client/transaction-pool", - "bizinikiwi/client/transaction-pool/api", - "bizinikiwi/client/utils", - "bizinikiwi/deprecated/hashing", - "bizinikiwi/deprecated/hashing/proc-macro", - "bizinikiwi/pezframe", - "bizinikiwi/pezframe/alliance", - "bizinikiwi/pezframe/asset-conversion", - "bizinikiwi/pezframe/asset-conversion/ops", - "bizinikiwi/pezframe/asset-rate", - "bizinikiwi/pezframe/asset-rewards", - "bizinikiwi/pezframe/assets", - "bizinikiwi/pezframe/assets-freezer", - "bizinikiwi/pezframe/assets-holder", - "bizinikiwi/pezframe/assets/precompiles", - "bizinikiwi/pezframe/atomic-swap", - "bizinikiwi/pezframe/aura", - "bizinikiwi/pezframe/authority-discovery", - "bizinikiwi/pezframe/authorship", - "bizinikiwi/pezframe/babe", - "bizinikiwi/pezframe/bags-list", - "bizinikiwi/pezframe/bags-list/fuzzer", - "bizinikiwi/pezframe/bags-list/remote-tests", - "bizinikiwi/pezframe/balances", - "bizinikiwi/pezframe/beefy", - "bizinikiwi/pezframe/beefy-mmr", - "bizinikiwi/pezframe/benchmarking", - "bizinikiwi/pezframe/benchmarking/pov", - "bizinikiwi/pezframe/bounties", - "bizinikiwi/pezframe/broker", - "bizinikiwi/pezframe/child-bounties", - "bizinikiwi/pezframe/collective", - "bizinikiwi/pezframe/contracts", - "bizinikiwi/pezframe/contracts/fixtures", - "bizinikiwi/pezframe/contracts/mock-network", - "bizinikiwi/pezframe/contracts/proc-macro", - "bizinikiwi/pezframe/contracts/uapi", - "bizinikiwi/pezframe/conviction-voting", - "bizinikiwi/pezframe/core-fellowship", - "bizinikiwi/pezframe/delegated-staking", - "bizinikiwi/pezframe/democracy", - "bizinikiwi/pezframe/derivatives", - "bizinikiwi/pezframe/dummy-dim", - "bizinikiwi/pezframe/election-provider-multi-block", - "bizinikiwi/pezframe/election-provider-multi-phase", - "bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e", - "bizinikiwi/pezframe/election-provider-support", - "bizinikiwi/pezframe/election-provider-support/benchmarking", - "bizinikiwi/pezframe/election-provider-support/solution-type", - "bizinikiwi/pezframe/election-provider-support/solution-type/fuzzer", - "bizinikiwi/pezframe/elections-phragmen", - "bizinikiwi/pezframe/examples", - "bizinikiwi/pezframe/examples/authorization-tx-extension", - "bizinikiwi/pezframe/examples/basic", - "bizinikiwi/pezframe/examples/default-config", - "bizinikiwi/pezframe/examples/dev-mode", - "bizinikiwi/pezframe/examples/pezframe-crate", - "bizinikiwi/pezframe/examples/kitchensink", - "bizinikiwi/pezframe/examples/multi-block-migrations", - "bizinikiwi/pezframe/examples/offchain-worker", - "bizinikiwi/pezframe/examples/single-block-migrations", - "bizinikiwi/pezframe/examples/split", - "bizinikiwi/pezframe/examples/tasks", - "bizinikiwi/pezframe/examples/view-functions", - "bizinikiwi/pezframe/executive", - "bizinikiwi/pezframe/fast-unstake", - "bizinikiwi/pezframe/glutton", - "bizinikiwi/pezframe/grandpa", - "bizinikiwi/pezframe/honzon/oracle", - "bizinikiwi/pezframe/honzon/oracle/runtime-api", - "bizinikiwi/pezframe/identity", - "bizinikiwi/pezframe/im-online", - "bizinikiwi/pezframe/indices", - "bizinikiwi/pezframe/insecure-randomness-collective-flip", - "bizinikiwi/pezframe/lottery", - "bizinikiwi/pezframe/membership", - "bizinikiwi/pezframe/merkle-mountain-range", - "bizinikiwi/pezframe/message-queue", - "bizinikiwi/pezframe/meta-tx", - "bizinikiwi/pezframe/metadata-hash-extension", - "bizinikiwi/pezframe/migrations", - "bizinikiwi/pezframe/mixnet", - "bizinikiwi/pezframe/multi-asset-bounties", - "bizinikiwi/pezframe/multisig", - "bizinikiwi/pezframe/nft-fractionalization", - "bizinikiwi/pezframe/nfts", - "bizinikiwi/pezframe/nfts/runtime-api", - "bizinikiwi/pezframe/nis", - "bizinikiwi/pezframe/node-authorization", - "bizinikiwi/pezframe/nomination-pools", - "bizinikiwi/pezframe/nomination-pools/benchmarking", - "bizinikiwi/pezframe/nomination-pools/fuzzer", - "bizinikiwi/pezframe/nomination-pools/runtime-api", - "bizinikiwi/pezframe/nomination-pools/test-delegate-stake", - "bizinikiwi/pezframe/offences", - "bizinikiwi/pezframe/offences/benchmarking", - "bizinikiwi/pezframe/origin-restriction", - "bizinikiwi/pezframe/paged-list", - "bizinikiwi/pezframe/paged-list/fuzzer", - "bizinikiwi/pezframe/parameters", - "bizinikiwi/pezframe/people", - "bizinikiwi/pezframe/preimage", - "bizinikiwi/pezframe/proxy", - "bizinikiwi/pezframe/ranked-collective", - "bizinikiwi/pezframe/recovery", - "bizinikiwi/pezframe/referenda", - "bizinikiwi/pezframe/remark", - "bizinikiwi/pezframe/revive", - "bizinikiwi/pezframe/revive/dev-node/node", - "bizinikiwi/pezframe/revive/dev-node/runtime", - "bizinikiwi/pezframe/revive/fixtures", - "bizinikiwi/pezframe/revive/proc-macro", - "bizinikiwi/pezframe/revive/rpc", - "bizinikiwi/pezframe/revive/uapi", - "bizinikiwi/pezframe/root-offences", - "bizinikiwi/pezframe/root-testing", - "bizinikiwi/pezframe/safe-mode", - "bizinikiwi/pezframe/salary", - "bizinikiwi/pezframe/sassafras", - "bizinikiwi/pezframe/scheduler", - "bizinikiwi/pezframe/scored-pool", - "bizinikiwi/pezframe/session", - "bizinikiwi/pezframe/session/benchmarking", - "bizinikiwi/pezframe/society", - "bizinikiwi/pezframe/staking", - "bizinikiwi/pezframe/staking-async", - "bizinikiwi/pezframe/staking-async/ah-client", - "bizinikiwi/pezframe/staking-async/ahm-test", - "bizinikiwi/pezframe/staking-async/rc-client", - "bizinikiwi/pezframe/staking-async/reward-fn", - "bizinikiwi/pezframe/staking-async/runtime-api", - "bizinikiwi/pezframe/staking-async/runtimes/preset-store", - "bizinikiwi/pezframe/staking-async/runtimes/rc", - "bizinikiwi/pezframe/staking-async/runtimes/rc/constants", - "bizinikiwi/pezframe/staking-async/runtimes/teyrchain", - "bizinikiwi/pezframe/staking/reward-curve", - "bizinikiwi/pezframe/staking/reward-fn", - "bizinikiwi/pezframe/staking/runtime-api", - "bizinikiwi/pezframe/state-trie-migration", - "bizinikiwi/pezframe/statement", - "bizinikiwi/pezframe/sudo", - "bizinikiwi/pezframe/support", - "bizinikiwi/pezframe/support/procedural", - "bizinikiwi/pezframe/support/procedural/tools", - "bizinikiwi/pezframe/support/procedural/tools/derive", - "bizinikiwi/pezframe/support/test", - "bizinikiwi/pezframe/support/test/compile_pass", - "bizinikiwi/pezframe/support/test/pezpallet", - "bizinikiwi/pezframe/support/test/stg_pezframe_crate", - "bizinikiwi/pezframe/system", - "bizinikiwi/pezframe/system/benchmarking", - "bizinikiwi/pezframe/system/rpc/runtime-api", - "bizinikiwi/pezframe/timestamp", - "bizinikiwi/pezframe/tips", - "bizinikiwi/pezframe/transaction-payment", - "bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment", - "bizinikiwi/pezframe/transaction-payment/asset-tx-payment", - "bizinikiwi/pezframe/transaction-payment/rpc", - "bizinikiwi/pezframe/transaction-payment/rpc/runtime-api", - "bizinikiwi/pezframe/transaction-payment/skip-feeless-payment", - "bizinikiwi/pezframe/transaction-storage", - "bizinikiwi/pezframe/treasury", - "bizinikiwi/pezframe/try-runtime", - "bizinikiwi/pezframe/tx-pause", - "bizinikiwi/pezframe/uniques", - "bizinikiwi/pezframe/utility", - "bizinikiwi/pezframe/verify-signature", - "bizinikiwi/pezframe/vesting", - "bizinikiwi/pezframe/whitelist", - "bizinikiwi/primitives/api", - "bizinikiwi/primitives/api/proc-macro", - "bizinikiwi/primitives/api/test", - "bizinikiwi/primitives/application-crypto", - "bizinikiwi/primitives/application-crypto/test", - "bizinikiwi/primitives/arithmetic", - "bizinikiwi/primitives/arithmetic/fuzzer", - "bizinikiwi/primitives/authority-discovery", - "bizinikiwi/primitives/block-builder", - "bizinikiwi/primitives/blockchain", - "bizinikiwi/primitives/consensus/aura", - "bizinikiwi/primitives/consensus/babe", - "bizinikiwi/primitives/consensus/beefy", - "bizinikiwi/primitives/consensus/common", - "bizinikiwi/primitives/consensus/grandpa", - "bizinikiwi/primitives/consensus/pow", - "bizinikiwi/primitives/consensus/sassafras", - "bizinikiwi/primitives/consensus/slots", - "bizinikiwi/primitives/core", - "bizinikiwi/primitives/core/fuzz", - "bizinikiwi/primitives/crypto/ec-utils", - "bizinikiwi/primitives/crypto/hashing", - "bizinikiwi/primitives/crypto/hashing/proc-macro", - "bizinikiwi/primitives/database", - "bizinikiwi/primitives/debug-derive", - "bizinikiwi/primitives/pez-ethereum-standards", - "bizinikiwi/primitives/externalities", - "bizinikiwi/primitives/genesis-builder", - "bizinikiwi/primitives/inherents", - "bizinikiwi/primitives/io", - "bizinikiwi/primitives/keyring", - "bizinikiwi/primitives/keystore", - "bizinikiwi/primitives/maybe-compressed-blob", - "bizinikiwi/primitives/merkle-mountain-range", - "bizinikiwi/primitives/metadata-ir", - "bizinikiwi/primitives/mixnet", - "bizinikiwi/primitives/npos-elections", - "bizinikiwi/primitives/npos-elections/fuzzer", - "bizinikiwi/primitives/offchain", - "bizinikiwi/primitives/panic-handler", - "bizinikiwi/primitives/rpc", - "bizinikiwi/primitives/runtime", - "bizinikiwi/primitives/runtime-interface", - "bizinikiwi/primitives/runtime-interface/proc-macro", - "bizinikiwi/primitives/runtime-interface/test", - "bizinikiwi/primitives/runtime-interface/test-wasm", - "bizinikiwi/primitives/runtime-interface/test-wasm-deprecated", - "bizinikiwi/primitives/session", - "bizinikiwi/primitives/staking", - "bizinikiwi/primitives/state-machine", - "bizinikiwi/primitives/statement-store", - "bizinikiwi/primitives/std", - "bizinikiwi/primitives/storage", - "bizinikiwi/primitives/test-primitives", - "bizinikiwi/primitives/timestamp", - "bizinikiwi/primitives/tracing", - "bizinikiwi/primitives/transaction-pool", - "bizinikiwi/primitives/transaction-storage-proof", - "bizinikiwi/primitives/trie", - "bizinikiwi/primitives/version", - "bizinikiwi/primitives/version/proc-macro", - "bizinikiwi/primitives/wasm-interface", - "bizinikiwi/primitives/weights", - "bizinikiwi/scripts/ci/pez-node-template-release", - "bizinikiwi/test-utils", - "bizinikiwi/test-utils/cli", - "bizinikiwi/test-utils/client", - "bizinikiwi/test-utils/runtime", - "bizinikiwi/test-utils/runtime/client", - "bizinikiwi/test-utils/runtime/transaction-pool", - "bizinikiwi/utils/binary-merkle-tree", - "bizinikiwi/utils/build-script-utils", - "bizinikiwi/utils/pez-fork-tree", - "bizinikiwi/utils/pezframe/benchmarking-cli", - "bizinikiwi/utils/pezframe/pez-generate-bags", - "bizinikiwi/utils/pezframe/pez-generate-bags/node-runtime", - "bizinikiwi/utils/pezframe/omni-bencher", - "bizinikiwi/utils/pezframe/remote-externalities", - "bizinikiwi/utils/pezframe/rpc/client", - "bizinikiwi/utils/pezframe/rpc/state-trie-migration-rpc", - "bizinikiwi/utils/pezframe/rpc/support", - "bizinikiwi/utils/pezframe/rpc/system", - "bizinikiwi/utils/pezframe/storage-access-test-runtime", - "bizinikiwi/utils/prometheus", - "bizinikiwi/utils/bizinikiwi-bip39", - "bizinikiwi/utils/wasm-builder", - "templates/minimal/node", - "templates/minimal/pezpallets/template", - "templates/minimal/runtime", - "templates/solochain/node", - "templates/solochain/pezpallets/template", - "templates/solochain/runtime", - "templates/teyrchain", - "templates/teyrchain/node", - "templates/teyrchain/pezpallets/template", - "templates/teyrchain/runtime", - "templates/zombienet", - "umbrella", + "bizinikiwi/bin/node/bench", + "bizinikiwi/bin/node/cli", + "bizinikiwi/bin/node/inspect", + "bizinikiwi/bin/node/primitives", + "bizinikiwi/bin/node/rpc", + "bizinikiwi/bin/node/runtime", + "bizinikiwi/bin/node/testing", + "bizinikiwi/bin/utils/chain-spec-builder", + "bizinikiwi/bin/utils/pez-subkey", + "bizinikiwi/client/allocator", + "bizinikiwi/client/api", + "bizinikiwi/client/authority-discovery", + "bizinikiwi/client/basic-authorship", + "bizinikiwi/client/block-builder", + "bizinikiwi/client/chain-spec", + "bizinikiwi/client/chain-spec/derive", + "bizinikiwi/client/cli", + "bizinikiwi/client/consensus/aura", + "bizinikiwi/client/consensus/babe", + "bizinikiwi/client/consensus/babe/rpc", + "bizinikiwi/client/consensus/beefy", + "bizinikiwi/client/consensus/beefy/rpc", + "bizinikiwi/client/consensus/common", + "bizinikiwi/client/consensus/epochs", + "bizinikiwi/client/consensus/grandpa", + "bizinikiwi/client/consensus/grandpa/rpc", + "bizinikiwi/client/consensus/manual-seal", + "bizinikiwi/client/consensus/pow", + "bizinikiwi/client/consensus/slots", + "bizinikiwi/client/db", + "bizinikiwi/client/executor", + "bizinikiwi/client/executor/common", + "bizinikiwi/client/executor/polkavm", + "bizinikiwi/client/executor/runtime-test", + "bizinikiwi/client/executor/wasmtime", + "bizinikiwi/client/informant", + "bizinikiwi/client/keystore", + "bizinikiwi/client/merkle-mountain-range", + "bizinikiwi/client/merkle-mountain-range/rpc", + "bizinikiwi/client/mixnet", + "bizinikiwi/client/network", + "bizinikiwi/client/network-gossip", + "bizinikiwi/client/network/common", + "bizinikiwi/client/network/light", + "bizinikiwi/client/network/statement", + "bizinikiwi/client/network/sync", + "bizinikiwi/client/network/test", + "bizinikiwi/client/network/transactions", + "bizinikiwi/client/network/types", + "bizinikiwi/client/offchain", + "bizinikiwi/client/proposer-metrics", + "bizinikiwi/client/rpc", + "bizinikiwi/client/rpc-api", + "bizinikiwi/client/rpc-servers", + "bizinikiwi/client/rpc-spec-v2", + "bizinikiwi/client/runtime-utilities", + "bizinikiwi/client/service", + "bizinikiwi/client/service/test", + "bizinikiwi/client/state-db", + "bizinikiwi/client/statement-store", + "bizinikiwi/client/storage-monitor", + "bizinikiwi/client/sync-state-rpc", + "bizinikiwi/client/sysinfo", + "bizinikiwi/client/telemetry", + "bizinikiwi/client/tracing", + "bizinikiwi/client/tracing/proc-macro", + "bizinikiwi/client/transaction-pool", + "bizinikiwi/client/transaction-pool/api", + "bizinikiwi/client/utils", + "bizinikiwi/deprecated/hashing", + "bizinikiwi/deprecated/hashing/proc-macro", + "bizinikiwi/pezframe", + "bizinikiwi/pezframe/alliance", + "bizinikiwi/pezframe/asset-conversion", + "bizinikiwi/pezframe/asset-conversion/ops", + "bizinikiwi/pezframe/asset-rate", + "bizinikiwi/pezframe/asset-rewards", + "bizinikiwi/pezframe/assets", + "bizinikiwi/pezframe/assets-freezer", + "bizinikiwi/pezframe/assets-holder", + "bizinikiwi/pezframe/assets/precompiles", + "bizinikiwi/pezframe/atomic-swap", + "bizinikiwi/pezframe/aura", + "bizinikiwi/pezframe/authority-discovery", + "bizinikiwi/pezframe/authorship", + "bizinikiwi/pezframe/babe", + "bizinikiwi/pezframe/bags-list", + "bizinikiwi/pezframe/bags-list/fuzzer", + "bizinikiwi/pezframe/bags-list/remote-tests", + "bizinikiwi/pezframe/balances", + "bizinikiwi/pezframe/beefy", + "bizinikiwi/pezframe/beefy-mmr", + "bizinikiwi/pezframe/benchmarking", + "bizinikiwi/pezframe/benchmarking/pov", + "bizinikiwi/pezframe/bounties", + "bizinikiwi/pezframe/broker", + "bizinikiwi/pezframe/child-bounties", + "bizinikiwi/pezframe/collective", + "bizinikiwi/pezframe/contracts", + "bizinikiwi/pezframe/contracts/fixtures", + "bizinikiwi/pezframe/contracts/mock-network", + "bizinikiwi/pezframe/contracts/proc-macro", + "bizinikiwi/pezframe/contracts/uapi", + "bizinikiwi/pezframe/conviction-voting", + "bizinikiwi/pezframe/core-fellowship", + "bizinikiwi/pezframe/delegated-staking", + "bizinikiwi/pezframe/democracy", + "bizinikiwi/pezframe/derivatives", + "bizinikiwi/pezframe/dummy-dim", + "bizinikiwi/pezframe/election-provider-multi-block", + "bizinikiwi/pezframe/election-provider-multi-phase", + "bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e", + "bizinikiwi/pezframe/election-provider-support", + "bizinikiwi/pezframe/election-provider-support/benchmarking", + "bizinikiwi/pezframe/election-provider-support/solution-type", + "bizinikiwi/pezframe/election-provider-support/solution-type/fuzzer", + "bizinikiwi/pezframe/elections-phragmen", + "bizinikiwi/pezframe/examples", + "bizinikiwi/pezframe/examples/authorization-tx-extension", + "bizinikiwi/pezframe/examples/basic", + "bizinikiwi/pezframe/examples/default-config", + "bizinikiwi/pezframe/examples/dev-mode", + "bizinikiwi/pezframe/examples/kitchensink", + "bizinikiwi/pezframe/examples/multi-block-migrations", + "bizinikiwi/pezframe/examples/offchain-worker", + "bizinikiwi/pezframe/examples/pezframe-crate", + "bizinikiwi/pezframe/examples/single-block-migrations", + "bizinikiwi/pezframe/examples/split", + "bizinikiwi/pezframe/examples/tasks", + "bizinikiwi/pezframe/examples/view-functions", + "bizinikiwi/pezframe/executive", + "bizinikiwi/pezframe/fast-unstake", + "bizinikiwi/pezframe/glutton", + "bizinikiwi/pezframe/grandpa", + "bizinikiwi/pezframe/honzon/oracle", + "bizinikiwi/pezframe/honzon/oracle/runtime-api", + "bizinikiwi/pezframe/identity", + "bizinikiwi/pezframe/im-online", + "bizinikiwi/pezframe/indices", + "bizinikiwi/pezframe/insecure-randomness-collective-flip", + "bizinikiwi/pezframe/lottery", + "bizinikiwi/pezframe/membership", + "bizinikiwi/pezframe/merkle-mountain-range", + "bizinikiwi/pezframe/message-queue", + "bizinikiwi/pezframe/meta-tx", + "bizinikiwi/pezframe/metadata-hash-extension", + "bizinikiwi/pezframe/migrations", + "bizinikiwi/pezframe/mixnet", + "bizinikiwi/pezframe/multi-asset-bounties", + "bizinikiwi/pezframe/multisig", + "bizinikiwi/pezframe/nft-fractionalization", + "bizinikiwi/pezframe/nfts", + "bizinikiwi/pezframe/nfts/runtime-api", + "bizinikiwi/pezframe/nis", + "bizinikiwi/pezframe/node-authorization", + "bizinikiwi/pezframe/nomination-pools", + "bizinikiwi/pezframe/nomination-pools/benchmarking", + "bizinikiwi/pezframe/nomination-pools/fuzzer", + "bizinikiwi/pezframe/nomination-pools/runtime-api", + "bizinikiwi/pezframe/nomination-pools/test-delegate-stake", + "bizinikiwi/pezframe/offences", + "bizinikiwi/pezframe/offences/benchmarking", + "bizinikiwi/pezframe/origin-restriction", + "bizinikiwi/pezframe/paged-list", + "bizinikiwi/pezframe/paged-list/fuzzer", + "bizinikiwi/pezframe/parameters", + "bizinikiwi/pezframe/people", + "bizinikiwi/pezframe/preimage", + "bizinikiwi/pezframe/proxy", + "bizinikiwi/pezframe/ranked-collective", + "bizinikiwi/pezframe/recovery", + "bizinikiwi/pezframe/referenda", + "bizinikiwi/pezframe/remark", + "bizinikiwi/pezframe/revive", + "bizinikiwi/pezframe/revive/dev-node/node", + "bizinikiwi/pezframe/revive/dev-node/runtime", + "bizinikiwi/pezframe/revive/fixtures", + "bizinikiwi/pezframe/revive/proc-macro", + "bizinikiwi/pezframe/revive/rpc", + "bizinikiwi/pezframe/revive/uapi", + "bizinikiwi/pezframe/root-offences", + "bizinikiwi/pezframe/root-testing", + "bizinikiwi/pezframe/safe-mode", + "bizinikiwi/pezframe/salary", + "bizinikiwi/pezframe/sassafras", + "bizinikiwi/pezframe/scheduler", + "bizinikiwi/pezframe/scored-pool", + "bizinikiwi/pezframe/session", + "bizinikiwi/pezframe/session/benchmarking", + "bizinikiwi/pezframe/society", + "bizinikiwi/pezframe/staking", + "bizinikiwi/pezframe/staking-async", + "bizinikiwi/pezframe/staking-async/ah-client", + "bizinikiwi/pezframe/staking-async/ahm-test", + "bizinikiwi/pezframe/staking-async/rc-client", + "bizinikiwi/pezframe/staking-async/reward-fn", + "bizinikiwi/pezframe/staking-async/runtime-api", + "bizinikiwi/pezframe/staking-async/runtimes/preset-store", + "bizinikiwi/pezframe/staking-async/runtimes/rc", + "bizinikiwi/pezframe/staking-async/runtimes/rc/constants", + "bizinikiwi/pezframe/staking-async/runtimes/teyrchain", + "bizinikiwi/pezframe/staking/reward-curve", + "bizinikiwi/pezframe/staking/reward-fn", + "bizinikiwi/pezframe/staking/runtime-api", + "bizinikiwi/pezframe/state-trie-migration", + "bizinikiwi/pezframe/statement", + "bizinikiwi/pezframe/sudo", + "bizinikiwi/pezframe/support", + "bizinikiwi/pezframe/support/procedural", + "bizinikiwi/pezframe/support/procedural/tools", + "bizinikiwi/pezframe/support/procedural/tools/derive", + "bizinikiwi/pezframe/support/test", + "bizinikiwi/pezframe/support/test/compile_pass", + "bizinikiwi/pezframe/support/test/pezpallet", + "bizinikiwi/pezframe/support/test/stg_pezframe_crate", + "bizinikiwi/pezframe/system", + "bizinikiwi/pezframe/system/benchmarking", + "bizinikiwi/pezframe/system/rpc/runtime-api", + "bizinikiwi/pezframe/timestamp", + "bizinikiwi/pezframe/tips", + "bizinikiwi/pezframe/transaction-payment", + "bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment", + "bizinikiwi/pezframe/transaction-payment/asset-tx-payment", + "bizinikiwi/pezframe/transaction-payment/rpc", + "bizinikiwi/pezframe/transaction-payment/rpc/runtime-api", + "bizinikiwi/pezframe/transaction-payment/skip-feeless-payment", + "bizinikiwi/pezframe/transaction-storage", + "bizinikiwi/pezframe/treasury", + "bizinikiwi/pezframe/try-runtime", + "bizinikiwi/pezframe/tx-pause", + "bizinikiwi/pezframe/uniques", + "bizinikiwi/pezframe/utility", + "bizinikiwi/pezframe/verify-signature", + "bizinikiwi/pezframe/vesting", + "bizinikiwi/pezframe/whitelist", + "bizinikiwi/primitives/api", + "bizinikiwi/primitives/api/proc-macro", + "bizinikiwi/primitives/api/test", + "bizinikiwi/primitives/application-crypto", + "bizinikiwi/primitives/application-crypto/test", + "bizinikiwi/primitives/arithmetic", + "bizinikiwi/primitives/arithmetic/fuzzer", + "bizinikiwi/primitives/authority-discovery", + "bizinikiwi/primitives/block-builder", + "bizinikiwi/primitives/blockchain", + "bizinikiwi/primitives/consensus/aura", + "bizinikiwi/primitives/consensus/babe", + "bizinikiwi/primitives/consensus/beefy", + "bizinikiwi/primitives/consensus/common", + "bizinikiwi/primitives/consensus/grandpa", + "bizinikiwi/primitives/consensus/pow", + "bizinikiwi/primitives/consensus/sassafras", + "bizinikiwi/primitives/consensus/slots", + "bizinikiwi/primitives/core", + "bizinikiwi/primitives/core/fuzz", + "bizinikiwi/primitives/crypto/ec-utils", + "bizinikiwi/primitives/crypto/hashing", + "bizinikiwi/primitives/crypto/hashing/proc-macro", + "bizinikiwi/primitives/database", + "bizinikiwi/primitives/debug-derive", + "bizinikiwi/primitives/externalities", + "bizinikiwi/primitives/genesis-builder", + "bizinikiwi/primitives/inherents", + "bizinikiwi/primitives/io", + "bizinikiwi/primitives/keyring", + "bizinikiwi/primitives/keystore", + "bizinikiwi/primitives/maybe-compressed-blob", + "bizinikiwi/primitives/merkle-mountain-range", + "bizinikiwi/primitives/metadata-ir", + "bizinikiwi/primitives/mixnet", + "bizinikiwi/primitives/npos-elections", + "bizinikiwi/primitives/npos-elections/fuzzer", + "bizinikiwi/primitives/offchain", + "bizinikiwi/primitives/panic-handler", + "bizinikiwi/primitives/pez-ethereum-standards", + "bizinikiwi/primitives/rpc", + "bizinikiwi/primitives/runtime", + "bizinikiwi/primitives/runtime-interface", + "bizinikiwi/primitives/runtime-interface/proc-macro", + "bizinikiwi/primitives/runtime-interface/test", + "bizinikiwi/primitives/runtime-interface/test-wasm", + "bizinikiwi/primitives/runtime-interface/test-wasm-deprecated", + "bizinikiwi/primitives/session", + "bizinikiwi/primitives/staking", + "bizinikiwi/primitives/state-machine", + "bizinikiwi/primitives/statement-store", + "bizinikiwi/primitives/std", + "bizinikiwi/primitives/storage", + "bizinikiwi/primitives/test-primitives", + "bizinikiwi/primitives/timestamp", + "bizinikiwi/primitives/tracing", + "bizinikiwi/primitives/transaction-pool", + "bizinikiwi/primitives/transaction-storage-proof", + "bizinikiwi/primitives/trie", + "bizinikiwi/primitives/version", + "bizinikiwi/primitives/version/proc-macro", + "bizinikiwi/primitives/wasm-interface", + "bizinikiwi/primitives/weights", + "bizinikiwi/scripts/ci/pez-node-template-release", + "bizinikiwi/test-utils", + "bizinikiwi/test-utils/cli", + "bizinikiwi/test-utils/client", + "bizinikiwi/test-utils/runtime", + "bizinikiwi/test-utils/runtime/client", + "bizinikiwi/test-utils/runtime/transaction-pool", + "bizinikiwi/utils/binary-merkle-tree", + "bizinikiwi/utils/bizinikiwi-bip39", + "bizinikiwi/utils/build-script-utils", + "bizinikiwi/utils/pez-fork-tree", + "bizinikiwi/utils/pezframe/benchmarking-cli", + "bizinikiwi/utils/pezframe/omni-bencher", + "bizinikiwi/utils/pezframe/pez-generate-bags", + "bizinikiwi/utils/pezframe/pez-generate-bags/node-runtime", + "bizinikiwi/utils/pezframe/remote-externalities", + "bizinikiwi/utils/pezframe/rpc/client", + "bizinikiwi/utils/pezframe/rpc/state-trie-migration-rpc", + "bizinikiwi/utils/pezframe/rpc/support", + "bizinikiwi/utils/pezframe/rpc/system", + "bizinikiwi/utils/pezframe/storage-access-test-runtime", + "bizinikiwi/utils/prometheus", + "bizinikiwi/utils/txtesttool", + "bizinikiwi/utils/wasm-builder", + "docs/sdk", + "docs/sdk/packages/guides/first-pezpallet", + "docs/sdk/packages/guides/first-runtime", + "docs/sdk/src/reference_docs/chain_spec_runtime", + "pezbridges/bin/runtime-common", + "pezbridges/chains/chain-pezcumulus", + "pezbridges/chains/chain-pezkuwi-bulletin", + "pezbridges/modules/beefy", + "pezbridges/modules/grandpa", + "pezbridges/modules/messages", + "pezbridges/modules/relayers", + "pezbridges/modules/teyrchains", + "pezbridges/modules/xcm-bridge-hub", + "pezbridges/modules/xcm-bridge-hub-router", + "pezbridges/primitives/beefy", + "pezbridges/primitives/header-chain", + "pezbridges/primitives/messages", + "pezbridges/primitives/pezkuwi-core", + "pezbridges/primitives/relayers", + "pezbridges/primitives/runtime", + "pezbridges/primitives/test-utils", + "pezbridges/primitives/teyrchains", + "pezbridges/primitives/xcm-bridge-hub", + "pezbridges/primitives/xcm-bridge-hub-router", + "pezbridges/relays/client-bizinikiwi", + "pezbridges/relays/equivocation", + "pezbridges/relays/finality", + "pezbridges/relays/lib-bizinikiwi-relay", + "pezbridges/relays/messages", + "pezbridges/relays/teyrchains", + "pezbridges/relays/utils", + "pezbridges/snowbridge/pezpallets/ethereum-client", + "pezbridges/snowbridge/pezpallets/ethereum-client/fixtures", + "pezbridges/snowbridge/pezpallets/inbound-queue", + "pezbridges/snowbridge/pezpallets/inbound-queue-v2", + "pezbridges/snowbridge/pezpallets/inbound-queue-v2/fixtures", + "pezbridges/snowbridge/pezpallets/inbound-queue/fixtures", + "pezbridges/snowbridge/pezpallets/outbound-queue", + "pezbridges/snowbridge/pezpallets/outbound-queue-v2", + "pezbridges/snowbridge/pezpallets/outbound-queue-v2/runtime-api", + "pezbridges/snowbridge/pezpallets/outbound-queue/runtime-api", + "pezbridges/snowbridge/pezpallets/system", + "pezbridges/snowbridge/pezpallets/system-frontend", + "pezbridges/snowbridge/pezpallets/system-v2", + "pezbridges/snowbridge/pezpallets/system-v2/runtime-api", + "pezbridges/snowbridge/pezpallets/system/runtime-api", + "pezbridges/snowbridge/primitives/beacon", + "pezbridges/snowbridge/primitives/core", + "pezbridges/snowbridge/primitives/ethereum", + "pezbridges/snowbridge/primitives/inbound-queue", + "pezbridges/snowbridge/primitives/merkle-tree", + "pezbridges/snowbridge/primitives/outbound-queue", + "pezbridges/snowbridge/primitives/verification", + "pezbridges/snowbridge/runtime/runtime-common", + "pezbridges/snowbridge/runtime/test-common", + "pezbridges/snowbridge/test-utils", + "pezcumulus/bin/pov-validator", + "pezcumulus/client/bootnodes", + "pezcumulus/client/cli", + "pezcumulus/client/collator", + "pezcumulus/client/consensus/aura", + "pezcumulus/client/consensus/common", + "pezcumulus/client/consensus/proposer", + "pezcumulus/client/consensus/relay-chain", + "pezcumulus/client/network", + "pezcumulus/client/pov-recovery", + "pezcumulus/client/relay-chain-inprocess-interface", + "pezcumulus/client/relay-chain-interface", + "pezcumulus/client/relay-chain-minimal-node", + "pezcumulus/client/relay-chain-rpc-interface", + "pezcumulus/client/relay-chain-streams", + "pezcumulus/client/service", + "pezcumulus/client/teyrchain-inherent", + "pezcumulus/pezkuwi-omni-node", + "pezcumulus/pezkuwi-omni-node/lib", + "pezcumulus/pezkuwi-teyrchain", + "pezcumulus/pezpallets/ah-ops", + "pezcumulus/pezpallets/aura-ext", + "pezcumulus/pezpallets/collator-selection", + "pezcumulus/pezpallets/dmp-queue", + "pezcumulus/pezpallets/session-benchmarking", + "pezcumulus/pezpallets/solo-to-para", + "pezcumulus/pezpallets/teyrchain-system", + "pezcumulus/pezpallets/teyrchain-system/proc-macro", + "pezcumulus/pezpallets/weight-reclaim", + "pezcumulus/pezpallets/xcm", + "pezcumulus/pezpallets/xcmp-queue", + "pezcumulus/primitives/aura", + "pezcumulus/primitives/core", + "pezcumulus/primitives/proof-size-hostfunction", + "pezcumulus/primitives/storage-weight-reclaim", + "pezcumulus/primitives/teyrchain-inherent", + "pezcumulus/primitives/timestamp", + "pezcumulus/primitives/utility", + "pezcumulus/test/client", + "pezcumulus/test/relay-sproof-builder", + "pezcumulus/test/runtime", + "pezcumulus/test/service", + "pezcumulus/teyrchains/common", + "pezcumulus/teyrchains/integration-tests/emulated/chains/relays/pezkuwichain", + "pezcumulus/teyrchains/integration-tests/emulated/chains/relays/zagros", + "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/assets/asset-hub-pezkuwichain", + "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/assets/asset-hub-zagros", + "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/collectives/collectives-zagros", + "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/coretime/coretime-pezkuwichain", + "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/coretime/coretime-zagros", + "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-pezkuwichain", + "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-zagros", + "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-pezkuwichain", + "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-zagros", + "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/testing/penpal", + "pezcumulus/teyrchains/integration-tests/emulated/common", + "pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-system", + "pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-zagros-system", + "pezcumulus/teyrchains/integration-tests/emulated/networks/zagros-system", + "pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-pezkuwichain", + "pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-zagros", + "pezcumulus/teyrchains/integration-tests/emulated/tests/collectives/collectives-zagros", + "pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-pezkuwichain", + "pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-zagros", + "pezcumulus/teyrchains/integration-tests/emulated/tests/governance/zagros", + "pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-pezkuwichain", + "pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros", + "pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-pezkuwichain", + "pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros", + "pezcumulus/teyrchains/pezpallets/collective-content", + "pezcumulus/teyrchains/pezpallets/identity-kyc", + "pezcumulus/teyrchains/pezpallets/perwerde", + "pezcumulus/teyrchains/pezpallets/pez-rewards", + "pezcumulus/teyrchains/pezpallets/pez-treasury", + "pezcumulus/teyrchains/pezpallets/ping", + "pezcumulus/teyrchains/pezpallets/presale", + "pezcumulus/teyrchains/pezpallets/referral", + "pezcumulus/teyrchains/pezpallets/staking-score", + "pezcumulus/teyrchains/pezpallets/teyrchain-info", + "pezcumulus/teyrchains/pezpallets/tiki", + "pezcumulus/teyrchains/pezpallets/token-wrapper", + "pezcumulus/teyrchains/pezpallets/trust", + "pezcumulus/teyrchains/pezpallets/welati", + "pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain", + "pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/bridge-primitives", + "pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros", + "pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/bridge-primitives", + "pezcumulus/teyrchains/runtimes/assets/common", + "pezcumulus/teyrchains/runtimes/assets/test-utils", + "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain", + "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/bridge-primitives", + "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros", + "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/bridge-primitives", + "pezcumulus/teyrchains/runtimes/bridge-hubs/common", + "pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils", + "pezcumulus/teyrchains/runtimes/collectives/collectives-zagros", + "pezcumulus/teyrchains/runtimes/constants", + "pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain", + "pezcumulus/teyrchains/runtimes/coretime/coretime-zagros", + "pezcumulus/teyrchains/runtimes/glutton/glutton-zagros", + "pezcumulus/teyrchains/runtimes/people/people-pezkuwichain", + "pezcumulus/teyrchains/runtimes/people/people-zagros", + "pezcumulus/teyrchains/runtimes/test-utils", + "pezcumulus/teyrchains/runtimes/testing/penpal", + "pezcumulus/teyrchains/runtimes/testing/pezkuwichain-teyrchain", + "pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain", + "pezcumulus/xcm/xcm-pez-emulator", + "pezcumulus/zombienet/zombienet-sdk", + "pezcumulus/zombienet/zombienet-sdk-helpers", + "pezkuwi", + "pezkuwi/cli", + "pezkuwi/core-primitives", + "pezkuwi/erasure-coding", + "pezkuwi/erasure-coding/fuzzer", + "pezkuwi/node/collation-generation", + "pezkuwi/node/core/approval-voting", + "pezkuwi/node/core/approval-voting-parallel", + "pezkuwi/node/core/av-store", + "pezkuwi/node/core/backing", + "pezkuwi/node/core/bitfield-signing", + "pezkuwi/node/core/candidate-validation", + "pezkuwi/node/core/chain-api", + "pezkuwi/node/core/chain-selection", + "pezkuwi/node/core/dispute-coordinator", + "pezkuwi/node/core/prospective-teyrchains", + "pezkuwi/node/core/provisioner", + "pezkuwi/node/core/pvf", + "pezkuwi/node/core/pvf-checker", + "pezkuwi/node/core/pvf/common", + "pezkuwi/node/core/pvf/execute-worker", + "pezkuwi/node/core/pvf/prepare-worker", + "pezkuwi/node/core/runtime-api", + "pezkuwi/node/core/teyrchains-inherent", + "pezkuwi/node/gum", + "pezkuwi/node/gum/proc-macro", + "pezkuwi/node/malus", + "pezkuwi/node/metrics", + "pezkuwi/node/network/approval-distribution", + "pezkuwi/node/network/availability-distribution", + "pezkuwi/node/network/availability-recovery", + "pezkuwi/node/network/bitfield-distribution", + "pezkuwi/node/network/bridge", + "pezkuwi/node/network/collator-protocol", + "pezkuwi/node/network/dispute-distribution", + "pezkuwi/node/network/gossip-support", + "pezkuwi/node/network/protocol", + "pezkuwi/node/network/statement-distribution", + "pezkuwi/node/overseer", + "pezkuwi/node/primitives", + "pezkuwi/node/service", + "pezkuwi/node/subsystem", + "pezkuwi/node/subsystem-bench", + "pezkuwi/node/subsystem-test-helpers", + "pezkuwi/node/subsystem-types", + "pezkuwi/node/subsystem-util", + "pezkuwi/node/test/client", + "pezkuwi/node/test/service", + "pezkuwi/node/tracking-allocator", + "pezkuwi/node/zombienet-backchannel", + "pezkuwi/pezpallets/validator-pool", + "pezkuwi/primitives", + "pezkuwi/primitives/test-helpers", + "pezkuwi/rpc", + "pezkuwi/runtime/common", + "pezkuwi/runtime/common/pez-slot-range-helper", + "pezkuwi/runtime/metrics", + "pezkuwi/runtime/pezkuwichain", + "pezkuwi/runtime/pezkuwichain/bridge-primitives", + "pezkuwi/runtime/pezkuwichain/constants", + "pezkuwi/runtime/test-runtime", + "pezkuwi/runtime/test-runtime/constants", + "pezkuwi/runtime/teyrchains", + "pezkuwi/runtime/zagros", + "pezkuwi/runtime/zagros/bridge-primitives", + "pezkuwi/runtime/zagros/constants", + "pezkuwi/statement-table", + "pezkuwi/teyrchain", + "pezkuwi/teyrchain/test-teyrchains/adder", + "pezkuwi/teyrchain/test-teyrchains/adder/collator", + "pezkuwi/teyrchain/test-teyrchains/halt", + "pezkuwi/teyrchain/test-teyrchains/undying", + "pezkuwi/teyrchain/test-teyrchains/undying/collator", # People Parachain Custom pezpallets (Phase 2) # Asset Hub Custom pezpallets (Phase 3) + "pezkuwi/utils/pez-generate-bags", + "pezkuwi/utils/remote-ext-tests/bags-list", + "pezkuwi/xcm", + "pezkuwi/xcm/docs", + "pezkuwi/xcm/pezpallet-xcm", + "pezkuwi/xcm/pezpallet-xcm-benchmarks", + "pezkuwi/xcm/pezpallet-xcm/precompiles", + "pezkuwi/xcm/procedural", + "pezkuwi/xcm/xcm-builder", + "pezkuwi/xcm/xcm-executor", + "pezkuwi/xcm/xcm-executor/integration-tests", + "pezkuwi/xcm/xcm-pez-simulator", + "pezkuwi/xcm/xcm-pez-simulator/example", + "pezkuwi/xcm/xcm-pez-simulator/fuzzer", + "pezkuwi/xcm/xcm-runtime-pezapis", + "pezkuwi/zombienet-sdk-tests", + "templates/minimal/node", + "templates/minimal/pezpallets/template", + "templates/minimal/runtime", + "templates/solochain/node", + "templates/solochain/pezpallets/template", + "templates/solochain/runtime", + "templates/teyrchain", + "templates/teyrchain/node", + "templates/teyrchain/pezpallets/template", + "templates/teyrchain/runtime", + "templates/zombienet", + "umbrella", ] default-members = [ - "pezcumulus/pezkuwi-omni-node", - "pezcumulus/pezkuwi-teyrchain", - "pezkuwi", - "bizinikiwi/bin/node/cli", + "bizinikiwi/bin/node/cli", + "pezcumulus/pezkuwi-omni-node", + "pezcumulus/pezkuwi-teyrchain", + "pezkuwi", ] [workspace.lints.rust] suspicious_double_ref_op = { level = "allow", priority = 2 } # `bizinikiwi_runtime` is a common `cfg` condition name used in the repo. unexpected_cfgs = { level = "warn", check-cfg = [ - 'cfg(build_opt_level, values("3"))', - 'cfg(build_profile, values("debug", "release"))', - 'cfg(enable_alloc_error_handler)', - 'cfg(fuzzing)', - 'cfg(ignore_flaky_test)', - 'cfg(bizinikiwi_runtime)', + 'cfg(bizinikiwi_runtime)', + 'cfg(build_opt_level, values("3"))', + 'cfg(build_profile, values("debug", "release"))', + 'cfg(enable_alloc_error_handler)', + 'cfg(fuzzing)', + 'cfg(ignore_flaky_test)', ] } [workspace.lints.clippy] @@ -716,19 +716,12 @@ bp-pezkuwi-bulletin = { path = "pezbridges/chains/chain-pezkuwi-bulletin", defau bp-pezkuwi-core = { path = "pezbridges/primitives/pezkuwi-core", default-features = false, package = "bp-pezkuwi-core" } bp-pezkuwichain = { path = "pezkuwi/runtime/pezkuwichain/bridge-primitives", default-features = false, package = "bp-pezkuwichain" } bp-relayers = { path = "pezbridges/primitives/relayers", default-features = false, package = "bp-relayers" } -pezbp-runtime = { path = "pezbridges/primitives/runtime", default-features = false } bp-test-utils = { path = "pezbridges/primitives/test-utils", default-features = false } bp-teyrchains = { path = "pezbridges/primitives/teyrchains", default-features = false } bp-xcm-bridge-hub = { path = "pezbridges/primitives/xcm-bridge-hub", default-features = false } bp-xcm-bridge-hub-router = { path = "pezbridges/primitives/xcm-bridge-hub-router", default-features = false } bp-zagros = { path = "pezkuwi/runtime/zagros/bridge-primitives", default-features = false } bridge-hub-common = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/common", default-features = false } -pezbridge-hub-pezkuwichain-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-pezkuwichain" } -pezbridge-hub-pezkuwichain-runtime = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain", default-features = false } -pezbridge-hub-test-utils = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils", default-features = false } -pezbridge-hub-zagros-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-zagros" } -pezbridge-hub-zagros-runtime = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros" } -pezbridge-runtime-common = { path = "pezbridges/bin/runtime-common", default-features = false } bs58 = { version = "0.5.1", default-features = false } build-helper = { version = "0.1.1" } byte-slice-cast = { version = "1.2.1", default-features = false } @@ -738,7 +731,6 @@ cargo_metadata = { version = "0.15.4" } cfg-expr = { version = "0.15.5" } cfg-if = { version = "1.0" } chain-spec-builder = { path = "bizinikiwi/bin/utils/chain-spec-builder", default-features = false, package = "pezstaging-chain-spec-builder" } -pez-chain-spec-guide-runtime = { path = "docs/sdk/src/reference_docs/chain_spec_runtime" } chrono = { version = "0.4.31" } cid = { version = "0.9.0" } clap = { version = "4.5.13" } @@ -760,6 +752,160 @@ coretime-zagros-emulated-chain = { path = "pezcumulus/teyrchains/integration-tes coretime-zagros-runtime = { path = "pezcumulus/teyrchains/runtimes/coretime/coretime-zagros" } cpu-time = { version = "1.0.0" } criterion = { version = "0.5.1", default-features = false } +curve25519-dalek = { version = "4.1.3" } +derive-syn-parse = { version = "0.2.0" } +derive-where = { version = "1.2.7" } +derive_more = { version = "0.99.17", default-features = false } +digest = { version = "0.10.3", default-features = false } +directories = { version = "5.0.1" } +dlmalloc = { version = "0.2.4" } +docify = { version = "0.2.9" } +dyn-clonable = { version = "0.9.0" } +dyn-clone = { version = "1.0.16" } +ed25519-dalek = { version = "2.1", default-features = false } +ed25519-zebra = { version = "4.0.3", default-features = false } +either = { version = "1.8.1", default-features = false } +emulated-integration-tests-common = { path = "pezcumulus/teyrchains/integration-tests/emulated/common", default-features = false } +enumflags2 = { version = "0.7.11" } +enumn = { version = "0.1.13" } +env_filter = { version = "0.1.3" } +env_logger = { version = "0.11.2" } +environmental = { version = "1.1.4", default-features = false } +ethabi = { version = "2.0.0", default-features = false, package = "ethabi-decode" } +ethbloom = { version = "0.14.1", default-features = false } +ethereum-types = { version = "0.15.1", default-features = false } +exit-future = { version = "0.2.0" } +expander = { version = "2.0.0" } +fatality = { version = "0.1.1" } +fdlimit = { version = "0.3.0" } +femme = { version = "2.2.1" } +filetime = { version = "0.2.16" } +finality-grandpa = { version = "0.16.3", default-features = false } +first-pezpallet = { package = "pezkuwi-sdk-docs-first-pezpallet", path = "docs/sdk/packages/guides/first-pezpallet", default-features = false } +first-runtime = { package = "pezkuwi-sdk-docs-first-runtime", path = "docs/sdk/packages/guides/first-runtime", default-features = false } +flate2 = { version = "1.0" } +fnv = { version = "1.0.6" } +foldhash = { version = "0.1.5", default-features = false } +forwarded-header-value = { version = "0.1.1" } +fraction = { version = "0.13.1" } +frame = { path = "bizinikiwi/pezframe", default-features = false, package = "pezkuwi-sdk-frame" } +frame-metadata = { version = "23.0.0", default-features = false } +frame-storage-access-test-runtime = { path = "bizinikiwi/utils/pezframe/storage-access-test-runtime", default-features = false } +fs4 = { version = "0.7.0" } +fs_extra = { version = "1.3.0" } +futures = { version = "0.3.31" } +futures-timer = { version = "3.0.2" } +futures-util = { version = "0.3.30", default-features = false } +gethostname = { version = "0.2.3" } +git2 = { version = "0.20.0", default-features = false } +glob = { version = "0.3" } +glutton-zagros-runtime = { path = "pezcumulus/teyrchains/runtimes/glutton/glutton-zagros" } +governor = { version = "0.6.0" } +gum = { path = "pezkuwi/node/gum", default-features = false, package = "pez-tracing-gum" } +gum-proc-macro = { path = "pezkuwi/node/gum/proc-macro", default-features = false, package = "pez-tracing-gum-proc-macro" } +handlebars = { version = "5.1.0" } +hash-db = { version = "0.16.0", default-features = false } +hash256-std-hasher = { version = "0.15.2", default-features = false } +hashbrown = "0.15.3" +hex = { version = "0.4.3", default-features = false } +hex-literal = { version = "0.4.1", default-features = false } +hkdf = { version = "0.12.0" } +hmac = { version = "0.12.1" } +honggfuzz = { version = "0.5.55" } +http = { version = "1.1" } +http-body = { version = "1", default-features = false } +http-body-util = { version = "0.1.2", default-features = false } +humantime-serde = { version = "1.1" } +hyper = { version = "1.3.1", default-features = false } +hyper-rustls = { version = "0.27.3", default-features = false, features = [ + "http1", + "http2", + "logging", + "ring", + "rustls-native-certs", + "tls12", +] } +hyper-util = { version = "0.1.5", default-features = false } +impl-serde = { version = "0.5.0", default-features = false } +impl-trait-for-tuples = { version = "0.2.2" } +indexmap = { version = "2.7.1" } +indicatif = { version = "0.17.7" } +integer-sqrt = { version = "0.1.2" } +ip_network = { version = "0.4.1" } +is-terminal = { version = "0.4.9" } +is_executable = { version = "1.0.1" } +isahc = { version = "1.2" } +itertools = { version = "0.11" } +jobserver = { version = "0.1.26" } +jsonpath_lib = { version = "0.3" } +jsonrpsee = { version = "0.24.10" } +jsonrpsee-core = { version = "0.24.10" } +k256 = { version = "0.13.4", default-features = false } +kvdb = { version = "0.13.0" } +kvdb-memorydb = { version = "0.13.0" } +kvdb-rocksdb = { version = "0.21.0" } +kvdb-shared-tests = { version = "0.11.0" } +landlock = { version = "0.3.0" } +libc = { version = "0.2.155" } +libfuzzer-sys = { version = "0.4" } +libp2p = { version = "0.54.1" } +libp2p-identity = { version = "0.2.9" } +libp2p-kad = { version = "0.46.2", default-features = false } +libsecp256k1 = { version = "0.7.0", default-features = false } +linked-hash-map = { version = "0.5.4" } +linked_hash_set = { version = "0.1.4" } +linregress = { version = "0.5.1" } +lite-json = { version = "0.2.0", default-features = false } +litep2p = { version = "0.12.0", features = ["rsa", "websocket"] } +log = { version = "0.4.22", default-features = false } +macro_magic = { version = "0.5.1" } +maplit = { version = "1.0.2" } +memmap2 = { version = "0.9.3" } +memory-db = { version = "0.34.0", default-features = false } +merkleized-metadata = { version = "0.5.0" } +merlin = { version = "3.0", default-features = false } +metered = { version = "0.6.1", default-features = false, package = "prioritized-metered-channel" } +milagro-bls = { version = "1.5.4", default-features = false, package = "snowbridge-milagro-bls" } +mixnet = { version = "0.7.0" } +mmr-lib = { version = "0.8.2", package = "pezkuwi-ckb-merkle-mountain-range", default-features = false } +mockall = { version = "0.13.1" } +multiaddr = { version = "0.18.1" } +multihash = { version = "0.19.1", default-features = false } +multistream-select = { version = "0.13.0" } +names = { version = "0.14.0", default-features = false } +nix = { version = "0.29.0" } +node-cli = { path = "bizinikiwi/bin/node/cli", package = "pezstaging-node-cli" } +node-inspect = { path = "bizinikiwi/bin/node/inspect", default-features = false, package = "pezstaging-node-inspect" } +nohash-hasher = { version = "0.2.0" } +novelpoly = { version = "2.0.0", package = "reed-solomon-novelpoly" } +num-bigint = { version = "0.4.6", default-features = false } +num-format = { version = "0.4.3" } +num-integer = { version = "0.1.46", default-features = false } +num-rational = { version = "0.4.1" } +num-traits = { version = "0.2.17", default-features = false } +num_cpus = { version = "1.13.1" } +once_cell = { version = "1.21.3" } +orchestra = { version = "0.4.0", default-features = false } +pez-chain-spec-guide-runtime = { path = "docs/sdk/src/reference_docs/chain_spec_runtime" } +pez-equivocation-detector = { path = "pezbridges/relays/equivocation" } +pez-ethereum-standards = { path = "bizinikiwi/primitives/pez-ethereum-standards" } +pez-finality-relay = { path = "pezbridges/relays/finality" } +pez-fork-tree = { path = "bizinikiwi/utils/pez-fork-tree", default-features = false } +pez-generate-bags = { path = "bizinikiwi/utils/pezframe/pez-generate-bags", default-features = false } +pez-kitchensink-runtime = { path = "bizinikiwi/bin/node/runtime" } +pez-messages-relay = { path = "pezbridges/relays/messages" } +pez-minimal-template-node = { path = "templates/minimal/node" } +pez-minimal-template-runtime = { path = "templates/minimal/runtime" } +pez-node-primitives = { path = "bizinikiwi/bin/node/primitives", default-features = false } +pez-node-rpc = { path = "bizinikiwi/bin/node/rpc" } +pez-node-testing = { path = "bizinikiwi/bin/node/testing" } +pezbp-runtime = { path = "pezbridges/primitives/runtime", default-features = false } +pezbridge-hub-pezkuwichain-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-pezkuwichain" } +pezbridge-hub-pezkuwichain-runtime = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain", default-features = false } +pezbridge-hub-test-utils = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils", default-features = false } +pezbridge-hub-zagros-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-zagros" } +pezbridge-hub-zagros-runtime = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros" } +pezbridge-runtime-common = { path = "pezbridges/bin/runtime-common", default-features = false } pezcumulus-client-bootnodes = { path = "pezcumulus/client/bootnodes", default-features = false } pezcumulus-client-cli = { path = "pezcumulus/client/cli", default-features = false } pezcumulus-client-collator = { path = "pezcumulus/client/collator", default-features = false } @@ -798,56 +944,13 @@ pezcumulus-test-relay-sproof-builder = { path = "pezcumulus/test/relay-sproof-bu pezcumulus-test-runtime = { path = "pezcumulus/test/runtime" } pezcumulus-test-service = { path = "pezcumulus/test/service" } pezcumulus-zombienet-sdk-helpers = { path = "pezcumulus/zombienet/zombienet-sdk-helpers", default-features = false } -curve25519-dalek = { version = "4.1.3" } -derive-syn-parse = { version = "0.2.0" } -derive-where = { version = "1.2.7" } -derive_more = { version = "0.99.17", default-features = false } -digest = { version = "0.10.3", default-features = false } -directories = { version = "5.0.1" } -dlmalloc = { version = "0.2.4" } -docify = { version = "0.2.9" } -dyn-clonable = { version = "0.9.0" } -dyn-clone = { version = "1.0.16" } -ed25519-dalek = { version = "2.1", default-features = false } -ed25519-zebra = { version = "4.0.3", default-features = false } -either = { version = "1.8.1", default-features = false } -emulated-integration-tests-common = { path = "pezcumulus/teyrchains/integration-tests/emulated/common", default-features = false } -enumflags2 = { version = "0.7.11" } -enumn = { version = "0.1.13" } -env_filter = { version = "0.1.3" } -env_logger = { version = "0.11.2" } -environmental = { version = "1.1.4", default-features = false } -pez-equivocation-detector = { path = "pezbridges/relays/equivocation" } -ethabi = { version = "2.0.0", default-features = false, package = "ethabi-decode" } -ethbloom = { version = "0.14.1", default-features = false } -pez-ethereum-standards = { path = "bizinikiwi/primitives/pez-ethereum-standards" } -ethereum-types = { version = "0.15.1", default-features = false } -exit-future = { version = "0.2.0" } -expander = { version = "2.0.0" } -fatality = { version = "0.1.1" } -fdlimit = { version = "0.3.0" } -femme = { version = "2.2.1" } -filetime = { version = "0.2.16" } -finality-grandpa = { version = "0.16.3", default-features = false } -pez-finality-relay = { path = "pezbridges/relays/finality" } -first-pezpallet = { package = "pezkuwi-sdk-docs-first-pezpallet", path = "docs/sdk/packages/guides/first-pezpallet", default-features = false } -first-runtime = { package = "pezkuwi-sdk-docs-first-runtime", path = "docs/sdk/packages/guides/first-runtime", default-features = false } -flate2 = { version = "1.0" } -fnv = { version = "1.0.6" } -foldhash = { version = "0.1.5", default-features = false } -pez-fork-tree = { path = "bizinikiwi/utils/pez-fork-tree", default-features = false } -forwarded-header-value = { version = "0.1.1" } -fraction = { version = "0.13.1" } -frame = { path = "bizinikiwi/pezframe", default-features = false, package = "pezkuwi-sdk-frame" } pezframe-benchmarking = { path = "bizinikiwi/pezframe/benchmarking", default-features = false } pezframe-benchmarking-cli = { path = "bizinikiwi/utils/pezframe/benchmarking-cli", default-features = false } pezframe-benchmarking-pezpallet-pov = { default-features = false, path = "bizinikiwi/pezframe/benchmarking/pov" } pezframe-election-provider-solution-type = { path = "bizinikiwi/pezframe/election-provider-support/solution-type", default-features = false } pezframe-election-provider-support = { path = "bizinikiwi/pezframe/election-provider-support", default-features = false } pezframe-executive = { path = "bizinikiwi/pezframe/executive", default-features = false } -frame-metadata = { version = "23.0.0", default-features = false } pezframe-metadata-hash-extension = { path = "bizinikiwi/pezframe/metadata-hash-extension", default-features = false } -frame-storage-access-test-runtime = { path = "bizinikiwi/utils/pezframe/storage-access-test-runtime", default-features = false } pezframe-support = { path = "bizinikiwi/pezframe/support", default-features = false } pezframe-support-procedural = { path = "bizinikiwi/pezframe/support/procedural", default-features = false } pezframe-support-procedural-tools = { path = "bizinikiwi/pezframe/support/procedural/tools", default-features = false } @@ -857,111 +960,8 @@ pezframe-system = { path = "bizinikiwi/pezframe/system", default-features = fals pezframe-system-benchmarking = { path = "bizinikiwi/pezframe/system/benchmarking", default-features = false } pezframe-system-rpc-runtime-api = { path = "bizinikiwi/pezframe/system/rpc/runtime-api", default-features = false } pezframe-try-runtime = { path = "bizinikiwi/pezframe/try-runtime", default-features = false } -fs4 = { version = "0.7.0" } -fs_extra = { version = "1.3.0" } -futures = { version = "0.3.31" } -futures-timer = { version = "3.0.2" } -futures-util = { version = "0.3.30", default-features = false } -pez-generate-bags = { path = "bizinikiwi/utils/pezframe/pez-generate-bags", default-features = false } -gethostname = { version = "0.2.3" } -git2 = { version = "0.20.0", default-features = false } -glob = { version = "0.3" } -glutton-zagros-runtime = { path = "pezcumulus/teyrchains/runtimes/glutton/glutton-zagros" } -governor = { version = "0.6.0" } -gum = { path = "pezkuwi/node/gum", default-features = false, package = "pez-tracing-gum" } -gum-proc-macro = { path = "pezkuwi/node/gum/proc-macro", default-features = false, package = "pez-tracing-gum-proc-macro" } -handlebars = { version = "5.1.0" } -hash-db = { version = "0.16.0", default-features = false } -hash256-std-hasher = { version = "0.15.2", default-features = false } -hashbrown = "0.15.3" -hex = { version = "0.4.3", default-features = false } -hex-literal = { version = "0.4.1", default-features = false } -hkdf = { version = "0.12.0" } -hmac = { version = "0.12.1" } -honggfuzz = { version = "0.5.55" } -http = { version = "1.1" } -http-body = { version = "1", default-features = false } -http-body-util = { version = "0.1.2", default-features = false } -humantime-serde = { version = "1.1" } -hyper = { version = "1.3.1", default-features = false } -hyper-rustls = { version = "0.27.3", default-features = false, features = [ - "http1", - "http2", - "logging", - "ring", - "rustls-native-certs", - "tls12", -] } -hyper-util = { version = "0.1.5", default-features = false } -impl-serde = { version = "0.5.0", default-features = false } -impl-trait-for-tuples = { version = "0.2.2" } -indexmap = { version = "2.7.1" } -indicatif = { version = "0.17.7" } -integer-sqrt = { version = "0.1.2" } -ip_network = { version = "0.4.1" } -is-terminal = { version = "0.4.9" } -is_executable = { version = "1.0.1" } -isahc = { version = "1.2" } -itertools = { version = "0.11" } -jobserver = { version = "0.1.26" } -jsonpath_lib = { version = "0.3" } -jsonrpsee = { version = "0.24.10" } -jsonrpsee-core = { version = "0.24.10" } -k256 = { version = "0.13.4", default-features = false } -pez-kitchensink-runtime = { path = "bizinikiwi/bin/node/runtime" } -kvdb = { version = "0.13.0" } -kvdb-memorydb = { version = "0.13.0" } -kvdb-rocksdb = { version = "0.21.0" } -kvdb-shared-tests = { version = "0.11.0" } -landlock = { version = "0.3.0" } -libc = { version = "0.2.155" } -libfuzzer-sys = { version = "0.4" } -libp2p = { version = "0.54.1" } -libp2p-identity = { version = "0.2.9" } -libp2p-kad = { version = "0.46.2", default-features = false } -libsecp256k1 = { version = "0.7.0", default-features = false } -linked-hash-map = { version = "0.5.4" } -linked_hash_set = { version = "0.1.4" } -linregress = { version = "0.5.1" } -lite-json = { version = "0.2.0", default-features = false } -litep2p = { version = "0.12.0", features = ["rsa", "websocket"] } -log = { version = "0.4.22", default-features = false } -macro_magic = { version = "0.5.1" } -maplit = { version = "1.0.2" } -memmap2 = { version = "0.9.3" } -memory-db = { version = "0.34.0", default-features = false } -merkleized-metadata = { version = "0.5.0" } -merlin = { version = "3.0", default-features = false } -pez-messages-relay = { path = "pezbridges/relays/messages" } -metered = { version = "0.6.1", default-features = false, package = "prioritized-metered-channel" } -milagro-bls = { version = "1.5.4", default-features = false, package = "snowbridge-milagro-bls" } -pez-minimal-template-node = { path = "templates/minimal/node" } -pez-minimal-template-runtime = { path = "templates/minimal/runtime" } -mixnet = { version = "0.7.0" } pezmmr-gadget = { path = "bizinikiwi/client/merkle-mountain-range", default-features = false } -mmr-lib = { version = "0.8.2", package = "pezkuwi-ckb-merkle-mountain-range", default-features = false } pezmmr-rpc = { path = "bizinikiwi/client/merkle-mountain-range/rpc", default-features = false } -mockall = { version = "0.13.1" } -multiaddr = { version = "0.18.1" } -multihash = { version = "0.19.1", default-features = false } -multistream-select = { version = "0.13.0" } -names = { version = "0.14.0", default-features = false } -nix = { version = "0.29.0" } -node-cli = { path = "bizinikiwi/bin/node/cli", package = "pezstaging-node-cli" } -node-inspect = { path = "bizinikiwi/bin/node/inspect", default-features = false, package = "pezstaging-node-inspect" } -pez-node-primitives = { path = "bizinikiwi/bin/node/primitives", default-features = false } -pez-node-rpc = { path = "bizinikiwi/bin/node/rpc" } -pez-node-testing = { path = "bizinikiwi/bin/node/testing" } -nohash-hasher = { version = "0.2.0" } -novelpoly = { version = "2.0.0", package = "reed-solomon-novelpoly" } -num-bigint = { version = "0.4.6", default-features = false } -num-format = { version = "0.4.3" } -num-integer = { version = "0.1.46", default-features = false } -num-rational = { version = "0.4.1" } -num-traits = { version = "0.2.17", default-features = false } -num_cpus = { version = "1.13.1" } -once_cell = { version = "1.21.3" } -orchestra = { version = "0.4.0", default-features = false } pezpallet-ah-ops = { path = "pezcumulus/pezpallets/ah-ops", default-features = false } pezpallet-alliance = { path = "bizinikiwi/pezframe/alliance", default-features = false } pezpallet-asset-conversion = { path = "bizinikiwi/pezframe/asset-conversion", default-features = false } @@ -1012,10 +1012,10 @@ pezpallet-election-provider-support-benchmarking = { path = "bizinikiwi/pezframe pezpallet-elections-phragmen = { path = "bizinikiwi/pezframe/elections-phragmen", default-features = false } pezpallet-example-authorization-tx-extension = { path = "bizinikiwi/pezframe/examples/authorization-tx-extension", default-features = false } pezpallet-example-basic = { path = "bizinikiwi/pezframe/examples/basic", default-features = false } -pezpallet-example-pezframe-crate = { path = "bizinikiwi/pezframe/examples/pezframe-crate", default-features = false } pezpallet-example-kitchensink = { path = "bizinikiwi/pezframe/examples/kitchensink", default-features = false } pezpallet-example-mbm = { path = "bizinikiwi/pezframe/examples/multi-block-migrations", default-features = false } pezpallet-example-offchain-worker = { path = "bizinikiwi/pezframe/examples/offchain-worker", default-features = false } +pezpallet-example-pezframe-crate = { path = "bizinikiwi/pezframe/examples/pezframe-crate", default-features = false } pezpallet-example-single-block-migrations = { path = "bizinikiwi/pezframe/examples/single-block-migrations", default-features = false } pezpallet-example-split = { path = "bizinikiwi/pezframe/examples/split", default-features = false } pezpallet-example-tasks = { path = "bizinikiwi/pezframe/examples/tasks", default-features = false } @@ -1096,38 +1096,19 @@ pezpallet-presale = { path = "pezcumulus/teyrchains/pezpallets/presale", default pezpallet-staking-score = { path = "pezcumulus/teyrchains/pezpallets/staking-score", default-features = false } pezpallet-token-wrapper = { path = "pezcumulus/teyrchains/pezpallets/token-wrapper", default-features = false } -pezpallet-staking-async = { path = "bizinikiwi/pezframe/staking-async", default-features = false } -pezpallet-staking-async-ah-client = { path = "bizinikiwi/pezframe/staking-async/ah-client", default-features = false } -pezpallet-staking-async-preset-store = { path = "bizinikiwi/pezframe/staking-async/runtimes/preset-store", default-features = false } -pezpallet-staking-async-rc-client = { path = "bizinikiwi/pezframe/staking-async/rc-client", default-features = false } -pezpallet-staking-async-rc-runtime = { path = "bizinikiwi/pezframe/staking-async/runtimes/rc" } -pezpallet-staking-async-rc-runtime-constants = { path = "bizinikiwi/pezframe/staking-async/runtimes/rc/constants", default-features = false } -pezpallet-staking-async-reward-fn = { path = "bizinikiwi/pezframe/staking-async/reward-fn", default-features = false } -pezpallet-staking-async-runtime-api = { path = "bizinikiwi/pezframe/staking-async/runtime-api", default-features = false } -pezpallet-staking-async-teyrchain-runtime = { path = "bizinikiwi/pezframe/staking-async/runtimes/teyrchain" } -pezpallet-staking-runtime-api = { path = "bizinikiwi/pezframe/staking/runtime-api", default-features = false } -pezpallet-state-trie-migration = { path = "bizinikiwi/pezframe/state-trie-migration", default-features = false } -pezpallet-statement = { default-features = false, path = "bizinikiwi/pezframe/statement" } -pezpallet-sudo = { path = "bizinikiwi/pezframe/sudo", default-features = false } -pezpallet-template = { path = "templates/solochain/pezpallets/template", default-features = false } -pezpallet-timestamp = { path = "bizinikiwi/pezframe/timestamp", default-features = false } -pezpallet-tips = { path = "bizinikiwi/pezframe/tips", default-features = false } -pezpallet-transaction-payment = { path = "bizinikiwi/pezframe/transaction-payment", default-features = false } -pezpallet-transaction-payment-rpc = { path = "bizinikiwi/pezframe/transaction-payment/rpc", default-features = false } -pezpallet-transaction-payment-rpc-runtime-api = { path = "bizinikiwi/pezframe/transaction-payment/rpc/runtime-api", default-features = false } -pezpallet-transaction-storage = { default-features = false, path = "bizinikiwi/pezframe/transaction-storage" } -pezpallet-treasury = { path = "bizinikiwi/pezframe/treasury", default-features = false } -pezpallet-tx-pause = { default-features = false, path = "bizinikiwi/pezframe/tx-pause" } -pezpallet-uniques = { path = "bizinikiwi/pezframe/uniques", default-features = false } -pezpallet-utility = { path = "bizinikiwi/pezframe/utility", default-features = false } -pezpallet-verify-signature = { path = "bizinikiwi/pezframe/verify-signature", default-features = false } -pezpallet-vesting = { path = "bizinikiwi/pezframe/vesting", default-features = false } -pezpallet-whitelist = { path = "bizinikiwi/pezframe/whitelist", default-features = false } -pezpallet-xcm = { path = "pezkuwi/xcm/pezpallet-xcm", default-features = false } -pezpallet-xcm-benchmarks = { path = "pezkuwi/xcm/pezpallet-xcm-benchmarks", default-features = false } -pezpallet-xcm-bridge-hub = { path = "pezbridges/modules/xcm-bridge-hub", default-features = false } -pezpallet-xcm-bridge-hub-router = { path = "pezbridges/modules/xcm-bridge-hub-router", default-features = false } -pezpallet-xcm-precompiles = { path = "pezkuwi/xcm/pezpallet-xcm/precompiles", default-features = false } +bizinikiwi-bip39 = { path = "bizinikiwi/utils/bizinikiwi-bip39", default-features = false } +bizinikiwi-build-script-utils = { path = "bizinikiwi/utils/build-script-utils", default-features = false } +bizinikiwi-cli-test-utils = { path = "bizinikiwi/test-utils/cli" } +bizinikiwi-frame-rpc-support = { default-features = false, path = "bizinikiwi/utils/pezframe/rpc/support" } +bizinikiwi-frame-rpc-system = { path = "bizinikiwi/utils/pezframe/rpc/system", default-features = false } +bizinikiwi-rpc-client = { path = "bizinikiwi/utils/pezframe/rpc/client", default-features = false } +bizinikiwi-state-trie-migration-rpc = { path = "bizinikiwi/utils/pezframe/rpc/state-trie-migration-rpc", default-features = false } +bizinikiwi-test-client = { path = "bizinikiwi/test-utils/client" } +bizinikiwi-test-runtime = { path = "bizinikiwi/test-utils/runtime" } +bizinikiwi-test-runtime-client = { path = "bizinikiwi/test-utils/runtime/client" } +bizinikiwi-test-runtime-transaction-pool = { path = "bizinikiwi/test-utils/runtime/transaction-pool" } +bizinikiwi-test-utils = { path = "bizinikiwi/test-utils" } +bizinikiwi-wasm-builder = { path = "bizinikiwi/utils/wasm-builder", default-features = false } parity-bytes = { version = "0.1.2", default-features = false } parity-db = { version = "0.4.12" } parity-wasm = { version = "0.45.0" } @@ -1135,12 +1116,17 @@ parking_lot = { version = "0.12.1", default-features = false } partial_sort = { version = "0.2.0" } paste = { version = "1.0.15", default-features = false } pbkdf2 = { version = "0.12.2", default-features = false } -pez-penpal-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/testing/penpal" } -pez-penpal-runtime = { path = "pezcumulus/teyrchains/runtimes/testing/penpal" } people-pezkuwichain-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-pezkuwichain" } people-pezkuwichain-runtime = { path = "pezcumulus/teyrchains/runtimes/people/people-pezkuwichain" } people-zagros-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-zagros" } people-zagros-runtime = { path = "pezcumulus/teyrchains/runtimes/people/people-zagros" } +pez-penpal-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/testing/penpal" } +pez-penpal-runtime = { path = "pezcumulus/teyrchains/runtimes/testing/penpal" } +pez-revive-dev-node = { path = "bizinikiwi/pezframe/revive/dev-node/node" } +pez-revive-dev-runtime = { path = "bizinikiwi/pezframe/revive/dev-node/runtime" } +pez-slot-range-helper = { path = "pezkuwi/runtime/common/pez-slot-range-helper", default-features = false } +pez-solochain-template-runtime = { path = "templates/solochain/runtime" } +pez-subkey = { path = "bizinikiwi/bin/utils/pez-subkey", default-features = false } pezkuwi-approval-distribution = { path = "pezkuwi/node/network/approval-distribution", default-features = false } pezkuwi-availability-bitfield-distribution = { path = "pezkuwi/node/network/bitfield-distribution", default-features = false } pezkuwi-availability-distribution = { path = "pezkuwi/node/network/availability-distribution", default-features = false } @@ -1173,7 +1159,6 @@ pezkuwi-node-core-runtime-api = { path = "pezkuwi/node/core/runtime-api", defaul pezkuwi-node-core-teyrchains-inherent = { path = "pezkuwi/node/core/teyrchains-inherent", default-features = false } pezkuwi-node-metrics = { path = "pezkuwi/node/metrics", default-features = false } pezkuwi-node-network-protocol = { path = "pezkuwi/node/network/protocol", default-features = false } -pezkuwi-pez-node-primitives = { path = "pezkuwi/node/primitives", default-features = false } pezkuwi-node-subsystem = { path = "pezkuwi/node/subsystem", default-features = false } pezkuwi-node-subsystem-test-helpers = { path = "pezkuwi/node/subsystem-test-helpers" } pezkuwi-node-subsystem-types = { path = "pezkuwi/node/subsystem-types", default-features = false } @@ -1181,6 +1166,7 @@ pezkuwi-node-subsystem-util = { path = "pezkuwi/node/subsystem-util", default-fe pezkuwi-omni-node = { path = "pezcumulus/pezkuwi-omni-node", default-features = false } pezkuwi-omni-node-lib = { path = "pezcumulus/pezkuwi-omni-node/lib", default-features = false } pezkuwi-overseer = { path = "pezkuwi/node/overseer", default-features = false } +pezkuwi-pez-node-primitives = { path = "pezkuwi/node/primitives", default-features = false } pezkuwi-primitives = { path = "pezkuwi/primitives", default-features = false } pezkuwi-primitives-test-helpers = { path = "pezkuwi/primitives/test-helpers" } pezkuwi-rpc = { path = "pezkuwi/rpc", default-features = false } @@ -1203,60 +1189,38 @@ pezkuwichain-runtime-constants = { path = "pezkuwi/runtime/pezkuwichain/constant pezkuwichain-system-emulated-network = { path = "pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-system" } pezkuwichain-teyrchain-runtime = { path = "pezcumulus/teyrchains/runtimes/testing/pezkuwichain-teyrchain" } pezkuwichain-zagros-system-emulated-network = { path = "pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-zagros-system" } -pin-project = { version = "1.1.3" } -polkavm = { version = "0.26.0", default-features = false } -polkavm-derive = "0.26.0" -polkavm-linker = "0.26.0" -portpicker = { version = "0.1.1" } -pretty_assertions = { version = "1.3.0" } -primitive-types = { version = "0.13.1", default-features = false, features = [ - "num-traits", -] } -proc-macro-crate = { version = "3.0.0" } -proc-macro-warning = { version = "1.0.0", default-features = false } -proc-macro2 = { version = "1.0.86" } -procfs = { version = "0.16.0" } -prometheus = { version = "0.13.0", default-features = false } -prometheus-endpoint = { path = "bizinikiwi/utils/prometheus", default-features = false, package = "bizinikiwi-prometheus-endpoint" } -prometheus-parse = { version = "0.2.2" } -proptest = { version = "1" } -prost = { version = "0.12.4" } -prost-build = { version = "0.13.2" } -pyroscope = { version = "0.5.8" } -pyroscope_pprofrs = { version = "0.2.8" } -quick_cache = { version = "0.3" } -quickcheck = { version = "1.0.3", default-features = false } -quote = { version = "1.0.37" } -rand = { version = "0.8.5", default-features = false } -rand_chacha = { version = "0.3.1", default-features = false } -rand_core = { version = "0.6.2" } -rand_distr = { version = "0.4.3" } -rand_pcg = { version = "0.3.1" } -rbtag = { version = "0.3" } -ref-cast = { version = "1.0.23" } -regex = { version = "1.10.2" } -relay-bizinikiwi-client = { path = "pezbridges/relays/client-bizinikiwi" } -relay-utils = { path = "pezbridges/relays/utils" } -remote-externalities = { path = "bizinikiwi/utils/pezframe/remote-externalities", default-features = false, package = "frame-remote-externalities" } -pez-revive-dev-node = { path = "bizinikiwi/pezframe/revive/dev-node/node" } -pez-revive-dev-runtime = { path = "bizinikiwi/pezframe/revive/dev-node/runtime" } -revm = { version = "27.0.2", default-features = false } -ripemd = { version = "0.1.3", default-features = false } -rlp = { version = "0.6.1", default-features = false } -rpassword = { version = "7.0.0" } -rstest = { version = "0.18.2" } -rustc-hash = { version = "1.1.0" } -rustc-hex = { version = "2.1.0", default-features = false } -rustix = { version = "1.0.3", default-features = false } -rustls = { version = "0.23.18", default-features = false, features = [ - "logging", - "ring", - "std", - "tls12", -] } -rustversion = { version = "1.0.17" } -rusty-fork = { version = "0.3.0", default-features = false } -safe-mix = { version = "1.0", default-features = false } +pezpallet-staking-async = { path = "bizinikiwi/pezframe/staking-async", default-features = false } +pezpallet-staking-async-ah-client = { path = "bizinikiwi/pezframe/staking-async/ah-client", default-features = false } +pezpallet-staking-async-preset-store = { path = "bizinikiwi/pezframe/staking-async/runtimes/preset-store", default-features = false } +pezpallet-staking-async-rc-client = { path = "bizinikiwi/pezframe/staking-async/rc-client", default-features = false } +pezpallet-staking-async-rc-runtime = { path = "bizinikiwi/pezframe/staking-async/runtimes/rc" } +pezpallet-staking-async-rc-runtime-constants = { path = "bizinikiwi/pezframe/staking-async/runtimes/rc/constants", default-features = false } +pezpallet-staking-async-reward-fn = { path = "bizinikiwi/pezframe/staking-async/reward-fn", default-features = false } +pezpallet-staking-async-runtime-api = { path = "bizinikiwi/pezframe/staking-async/runtime-api", default-features = false } +pezpallet-staking-async-teyrchain-runtime = { path = "bizinikiwi/pezframe/staking-async/runtimes/teyrchain" } +pezpallet-staking-runtime-api = { path = "bizinikiwi/pezframe/staking/runtime-api", default-features = false } +pezpallet-state-trie-migration = { path = "bizinikiwi/pezframe/state-trie-migration", default-features = false } +pezpallet-statement = { default-features = false, path = "bizinikiwi/pezframe/statement" } +pezpallet-sudo = { path = "bizinikiwi/pezframe/sudo", default-features = false } +pezpallet-template = { path = "templates/solochain/pezpallets/template", default-features = false } +pezpallet-timestamp = { path = "bizinikiwi/pezframe/timestamp", default-features = false } +pezpallet-tips = { path = "bizinikiwi/pezframe/tips", default-features = false } +pezpallet-transaction-payment = { path = "bizinikiwi/pezframe/transaction-payment", default-features = false } +pezpallet-transaction-payment-rpc = { path = "bizinikiwi/pezframe/transaction-payment/rpc", default-features = false } +pezpallet-transaction-payment-rpc-runtime-api = { path = "bizinikiwi/pezframe/transaction-payment/rpc/runtime-api", default-features = false } +pezpallet-transaction-storage = { default-features = false, path = "bizinikiwi/pezframe/transaction-storage" } +pezpallet-treasury = { path = "bizinikiwi/pezframe/treasury", default-features = false } +pezpallet-tx-pause = { default-features = false, path = "bizinikiwi/pezframe/tx-pause" } +pezpallet-uniques = { path = "bizinikiwi/pezframe/uniques", default-features = false } +pezpallet-utility = { path = "bizinikiwi/pezframe/utility", default-features = false } +pezpallet-verify-signature = { path = "bizinikiwi/pezframe/verify-signature", default-features = false } +pezpallet-vesting = { path = "bizinikiwi/pezframe/vesting", default-features = false } +pezpallet-whitelist = { path = "bizinikiwi/pezframe/whitelist", default-features = false } +pezpallet-xcm = { path = "pezkuwi/xcm/pezpallet-xcm", default-features = false } +pezpallet-xcm-benchmarks = { path = "pezkuwi/xcm/pezpallet-xcm-benchmarks", default-features = false } +pezpallet-xcm-bridge-hub = { path = "pezbridges/modules/xcm-bridge-hub", default-features = false } +pezpallet-xcm-bridge-hub-router = { path = "pezbridges/modules/xcm-bridge-hub-router", default-features = false } +pezpallet-xcm-precompiles = { path = "pezkuwi/xcm/pezpallet-xcm/precompiles", default-features = false } pezsc-allocator = { path = "bizinikiwi/client/allocator", default-features = false } pezsc-authority-discovery = { path = "bizinikiwi/client/authority-discovery", default-features = false } pezsc-basic-authorship = { path = "bizinikiwi/client/basic-authorship", default-features = false } @@ -1315,30 +1279,6 @@ pezsc-tracing-proc-macro = { path = "bizinikiwi/client/tracing/proc-macro", defa pezsc-transaction-pool = { path = "bizinikiwi/client/transaction-pool", default-features = false } pezsc-transaction-pool-api = { path = "bizinikiwi/client/transaction-pool/api", default-features = false } pezsc-utils = { path = "bizinikiwi/client/utils", default-features = false } -scale-info = { version = "2.11.6", default-features = false } -schemars = { version = "0.8.13", default-features = false } -schnellru = { version = "0.2.3" } -schnorrkel = { version = "0.11.4", default-features = false } -seccompiler = { version = "0.4.0" } -secp256k1 = { version = "0.28.0", default-features = false } -secrecy = { version = "0.8.0", default-features = false } -serde = { version = "1.0.214", default-features = false } -serde-big-array = { version = "0.3.2" } -serde_derive = { version = "1.0.117" } -serde_json = { version = "1.0.132", default-features = false } -serde_with = { version = "3.12.0", default-features = false, features = [ - "hex", - "macros", -] } -serde_yaml = { version = "0.9" } -sha1 = { version = "0.10.6" } -sha2 = { version = "0.10.7", default-features = false } -sha3 = { version = "0.10.0", default-features = false } -shlex = { version = "1.3.0" } -simple-mermaid = { version = "0.1.1" } -pez-slot-range-helper = { path = "pezkuwi/runtime/common/pez-slot-range-helper", default-features = false } -slotmap = { version = "1.0" } -smallvec = { version = "1.11.0", default-features = false } pezsnowbridge-beacon-primitives = { path = "pezbridges/snowbridge/primitives/beacon", default-features = false } pezsnowbridge-core = { path = "pezbridges/snowbridge/primitives/core", default-features = false } pezsnowbridge-ethereum = { path = "pezbridges/snowbridge/primitives/ethereum", default-features = false } @@ -1358,14 +1298,11 @@ pezsnowbridge-pezpallet-outbound-queue-v2 = { path = "pezbridges/snowbridge/pezp pezsnowbridge-pezpallet-system = { path = "pezbridges/snowbridge/pezpallets/system", default-features = false } pezsnowbridge-pezpallet-system-frontend = { path = "pezbridges/snowbridge/pezpallets/system-frontend", default-features = false } pezsnowbridge-pezpallet-system-v2 = { path = "pezbridges/snowbridge/pezpallets/system-v2", default-features = false } -snowpezbridge-runtime-common = { path = "pezbridges/snowbridge/runtime/runtime-common", default-features = false } pezsnowbridge-runtime-test-common = { path = "pezbridges/snowbridge/runtime/test-common", default-features = false } pezsnowbridge-system-runtime-api = { path = "pezbridges/snowbridge/pezpallets/system/runtime-api", default-features = false } pezsnowbridge-system-v2-runtime-api = { path = "pezbridges/snowbridge/pezpallets/system-v2/runtime-api", default-features = false } pezsnowbridge-test-utils = { path = "pezbridges/snowbridge/test-utils" } pezsnowbridge-verification-primitives = { path = "pezbridges/snowbridge/primitives/verification", default-features = false } -soketto = { version = "0.8.0" } -pez-solochain-template-runtime = { path = "templates/solochain/runtime" } pezsp-api = { path = "bizinikiwi/primitives/api", default-features = false } pezsp-api-proc-macro = { path = "bizinikiwi/primitives/api/proc-macro", default-features = false } pezsp-application-crypto = { path = "bizinikiwi/primitives/application-crypto", default-features = false } @@ -1424,6 +1361,83 @@ pezsp-version = { path = "bizinikiwi/primitives/version", default-features = fal pezsp-version-proc-macro = { path = "bizinikiwi/primitives/version/proc-macro", default-features = false } pezsp-wasm-interface = { path = "bizinikiwi/primitives/wasm-interface", default-features = false } pezsp-weights = { path = "bizinikiwi/primitives/weights", default-features = false } +pin-project = { version = "1.1.3" } +polkavm = { version = "0.26.0", default-features = false } +polkavm-derive = "0.26.0" +polkavm-linker = "0.26.0" +portpicker = { version = "0.1.1" } +pretty_assertions = { version = "1.3.0" } +primitive-types = { version = "0.13.1", default-features = false, features = [ + "num-traits", +] } +proc-macro-crate = { version = "3.0.0" } +proc-macro-warning = { version = "1.0.0", default-features = false } +proc-macro2 = { version = "1.0.86" } +procfs = { version = "0.16.0" } +prometheus = { version = "0.13.0", default-features = false } +prometheus-endpoint = { path = "bizinikiwi/utils/prometheus", default-features = false, package = "bizinikiwi-prometheus-endpoint" } +prometheus-parse = { version = "0.2.2" } +proptest = { version = "1" } +prost = { version = "0.12.4" } +prost-build = { version = "0.13.2" } +pyroscope = { version = "0.5.8" } +pyroscope_pprofrs = { version = "0.2.8" } +quick_cache = { version = "0.3" } +quickcheck = { version = "1.0.3", default-features = false } +quote = { version = "1.0.37" } +rand = { version = "0.8.5", default-features = false } +rand_chacha = { version = "0.3.1", default-features = false } +rand_core = { version = "0.6.2" } +rand_distr = { version = "0.4.3" } +rand_pcg = { version = "0.3.1" } +rbtag = { version = "0.3" } +ref-cast = { version = "1.0.23" } +regex = { version = "1.10.2" } +relay-bizinikiwi-client = { path = "pezbridges/relays/client-bizinikiwi" } +relay-utils = { path = "pezbridges/relays/utils" } +remote-externalities = { path = "bizinikiwi/utils/pezframe/remote-externalities", default-features = false, package = "frame-remote-externalities" } +revm = { version = "27.0.2", default-features = false } +ripemd = { version = "0.1.3", default-features = false } +rlp = { version = "0.6.1", default-features = false } +rpassword = { version = "7.0.0" } +rstest = { version = "0.18.2" } +rustc-hash = { version = "1.1.0" } +rustc-hex = { version = "2.1.0", default-features = false } +rustix = { version = "1.0.3", default-features = false } +rustls = { version = "0.23.18", default-features = false, features = [ + "logging", + "ring", + "std", + "tls12", +] } +rustversion = { version = "1.0.17" } +rusty-fork = { version = "0.3.0", default-features = false } +safe-mix = { version = "1.0", default-features = false } +scale-info = { version = "2.11.6", default-features = false } +schemars = { version = "0.8.13", default-features = false } +schnellru = { version = "0.2.3" } +schnorrkel = { version = "0.11.4", default-features = false } +seccompiler = { version = "0.4.0" } +secp256k1 = { version = "0.28.0", default-features = false } +secrecy = { version = "0.8.0", default-features = false } +serde = { version = "1.0.214", default-features = false } +serde-big-array = { version = "0.3.2" } +serde_derive = { version = "1.0.117" } +serde_json = { version = "1.0.132", default-features = false } +serde_with = { version = "3.12.0", default-features = false, features = [ + "hex", + "macros", +] } +serde_yaml = { version = "0.9" } +sha1 = { version = "0.10.6" } +sha2 = { version = "0.10.7", default-features = false } +sha3 = { version = "0.10.0", default-features = false } +shlex = { version = "1.3.0" } +simple-mermaid = { version = "0.1.1" } +slotmap = { version = "1.0" } +smallvec = { version = "1.11.0", default-features = false } +snowpezbridge-runtime-common = { path = "pezbridges/snowbridge/runtime/runtime-common", default-features = false } +soketto = { version = "0.8.0" } spinners = { version = "4.1.1" } sqlx = { version = "0.8.2" } ss58-registry = { path = "vendor/ss58-registry", package = "pezkuwi-ss58-registry", default-features = false } @@ -1432,20 +1446,6 @@ ssz_rs_derive = { version = "0.9.0", default-features = false } static_assertions = { version = "1.1.0", default-features = false } static_init = { version = "1.0.3" } strum = { version = "0.26.3", default-features = false } -pez-subkey = { path = "bizinikiwi/bin/utils/pez-subkey", default-features = false } -bizinikiwi-bip39 = { path = "bizinikiwi/utils/bizinikiwi-bip39", default-features = false } -bizinikiwi-build-script-utils = { path = "bizinikiwi/utils/build-script-utils", default-features = false } -bizinikiwi-cli-test-utils = { path = "bizinikiwi/test-utils/cli" } -bizinikiwi-frame-rpc-support = { default-features = false, path = "bizinikiwi/utils/pezframe/rpc/support" } -bizinikiwi-frame-rpc-system = { path = "bizinikiwi/utils/pezframe/rpc/system", default-features = false } -bizinikiwi-rpc-client = { path = "bizinikiwi/utils/pezframe/rpc/client", default-features = false } -bizinikiwi-state-trie-migration-rpc = { path = "bizinikiwi/utils/pezframe/rpc/state-trie-migration-rpc", default-features = false } -bizinikiwi-test-client = { path = "bizinikiwi/test-utils/client" } -bizinikiwi-test-runtime = { path = "bizinikiwi/test-utils/runtime" } -bizinikiwi-test-runtime-client = { path = "bizinikiwi/test-utils/runtime/client" } -bizinikiwi-test-runtime-transaction-pool = { path = "bizinikiwi/test-utils/runtime/transaction-pool" } -bizinikiwi-test-utils = { path = "bizinikiwi/test-utils" } -bizinikiwi-wasm-builder = { path = "bizinikiwi/utils/wasm-builder", default-features = false } subxt = { version = "0.43", default-features = false } subxt-core = { version = "0.43", default-features = false } subxt-metadata = { version = "0.43", default-features = false } @@ -1461,10 +1461,10 @@ teyrchains-common = { path = "pezcumulus/teyrchains/common", default-features = teyrchains-relay = { path = "pezbridges/relays/teyrchains" } teyrchains-runtimes-test-utils = { path = "pezcumulus/teyrchains/runtimes/test-utils", default-features = false } # pinned test-case to 3.3.1 because they support only the latest stable version of rust +peztest-runtime-constants = { path = "pezkuwi/runtime/test-runtime/constants", default-features = false } test-case = { version = "=3.3.1" } test-log = { version = "0.2.14" } test-pezpallet = { path = "bizinikiwi/pezframe/support/test/pezpallet", default-features = false, package = "pezframe-support-test-pezpallet" } -peztest-runtime-constants = { path = "pezkuwi/runtime/test-runtime/constants", default-features = false } test-teyrchain-adder = { path = "pezkuwi/teyrchain/test-teyrchains/adder" } test-teyrchain-halt = { path = "pezkuwi/teyrchain/test-teyrchains/halt" } test-teyrchain-undying = { path = "pezkuwi/teyrchain/test-teyrchains/undying" } @@ -1517,12 +1517,12 @@ wat = { version = "1.0.0" } x25519-dalek = { version = "2.0" } xcm = { path = "pezkuwi/xcm", default-features = false, package = "pezstaging-xcm" } xcm-builder = { path = "pezkuwi/xcm/xcm-builder", default-features = false, package = "pezstaging-xcm-builder" } +xcm-executor = { path = "pezkuwi/xcm/xcm-executor", default-features = false, package = "pezstaging-xcm-executor" } xcm-pez-docs = { path = "pezkuwi/xcm/docs" } xcm-pez-emulator = { path = "pezcumulus/xcm/xcm-pez-emulator", default-features = false } -xcm-executor = { path = "pezkuwi/xcm/xcm-executor", default-features = false, package = "pezstaging-xcm-executor" } xcm-pez-procedural = { path = "pezkuwi/xcm/procedural", default-features = false } -xcm-runtime-pezapis = { path = "pezkuwi/xcm/xcm-runtime-pezapis", default-features = false } xcm-pez-simulator = { path = "pezkuwi/xcm/xcm-pez-simulator", default-features = false } +xcm-runtime-pezapis = { path = "pezkuwi/xcm/xcm-runtime-pezapis", default-features = false } yet-another-teyrchain-runtime = { path = "pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain" } zagros-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/relays/zagros", default-features = false } zagros-runtime = { path = "pezkuwi/runtime/zagros", default-features = false } diff --git a/bizinikiwi/bin/node/bench/src/trie.rs b/bizinikiwi/bin/node/bench/src/trie.rs index f51fd610..cd0f5e4f 100644 --- a/bizinikiwi/bin/node/bench/src/trie.rs +++ b/bizinikiwi/bin/node/bench/src/trie.rs @@ -20,9 +20,9 @@ use hash_db::Prefix; use kvdb::KeyValueDB; -use rand::Rng; use pezsp_state_machine::Backend as _; use pezsp_trie::{trie_types::TrieDBMutBuilderV1, TrieMut as _}; +use rand::Rng; use std::{ borrow::Cow, collections::HashMap, diff --git a/bizinikiwi/bin/node/cli/benches/block_production.rs b/bizinikiwi/bin/node/cli/benches/block_production.rs index 75127343..c06cd42c 100644 --- a/bizinikiwi/bin/node/cli/benches/block_production.rs +++ b/bizinikiwi/bin/node/cli/benches/block_production.rs @@ -20,8 +20,8 @@ use pezkuwi_sdk::*; use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput}; -use pez_kitchensink_runtime::{constants::currency::*, BalancesCall}; use node_cli::service::{create_extrinsic, FullClient}; +use pez_kitchensink_runtime::{constants::currency::*, BalancesCall}; use pezkuwi_sdk::pezsc_service::config::{ExecutorConfiguration, RpcConfiguration}; use pezsc_block_builder::{BlockBuilderBuilder, BuiltBlock}; use pezsc_consensus::{ diff --git a/bizinikiwi/bin/node/cli/benches/executor.rs b/bizinikiwi/bin/node/cli/benches/executor.rs index 57bfda80..97270746 100644 --- a/bizinikiwi/bin/node/cli/benches/executor.rs +++ b/bizinikiwi/bin/node/cli/benches/executor.rs @@ -20,13 +20,13 @@ use pezkuwi_sdk::*; use codec::{Decode, Encode}; use criterion::{criterion_group, criterion_main, BatchSize, Criterion}; -use pezframe_support::Hashable; use pez_kitchensink_runtime::{ constants::currency::*, Block, BuildStorage, CheckedExtrinsic, Header, RuntimeCall, RuntimeGenesisConfig, UncheckedExtrinsic, }; use pez_node_primitives::{BlockNumber, Hash}; use pez_node_testing::keyring::*; +use pezframe_support::Hashable; use pezsc_executor::{Externalities, RuntimeVersionOf}; use pezsp_core::{ storage::well_known_keys, diff --git a/bizinikiwi/bin/node/cli/benches/transaction_pool.rs b/bizinikiwi/bin/node/cli/benches/transaction_pool.rs index 1eddbeb8..60f487a6 100644 --- a/bizinikiwi/bin/node/cli/benches/transaction_pool.rs +++ b/bizinikiwi/bin/node/cli/benches/transaction_pool.rs @@ -18,8 +18,8 @@ use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput}; use futures::{future, StreamExt}; -use pez_kitchensink_runtime::{constants::currency::*, BalancesCall, SudoCall}; use node_cli::service::{create_extrinsic, fetch_nonce, FullClient, TransactionPool}; +use pez_kitchensink_runtime::{constants::currency::*, BalancesCall, SudoCall}; use pez_node_primitives::AccountId; use pezkuwi_sdk::{ pezsc_service::config::{ExecutorConfiguration, RpcConfiguration}, diff --git a/bizinikiwi/bin/node/cli/src/chain_spec.rs b/bizinikiwi/bin/node/cli/src/chain_spec.rs index 4fa4299b..b882d165 100644 --- a/bizinikiwi/bin/node/cli/src/chain_spec.rs +++ b/bizinikiwi/bin/node/cli/src/chain_spec.rs @@ -30,13 +30,13 @@ use pezpallet_revive::is_eth_derived; use pezsc_chain_spec::ChainSpecExtension; use pezsc_service::ChainType; use pezsc_telemetry::TelemetryEndpoints; -use serde::{Deserialize, Serialize}; use pezsp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use pezsp_consensus_babe::AuthorityId as BabeId; use pezsp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId; use pezsp_consensus_grandpa::AuthorityId as GrandpaId; use pezsp_core::crypto::UncheckedInto; use pezsp_mixnet::types::AuthorityId as MixnetId; +use serde::{Deserialize, Serialize}; pub use pez_kitchensink_runtime::RuntimeGenesisConfig; pub use pez_node_primitives::{AccountId, Balance, Signature}; @@ -466,17 +466,25 @@ pub(crate) mod tests { fn test_connectivity() { pezsp_tracing::try_init_simple(); - pezsc_service_test::connectivity(integration_test_config_with_two_authorities(), |config| { - let NewFullBase { task_manager, client, network, sync, transaction_pool, .. } = - new_full_base::>(config, None, false, |_, _| ())?; - Ok(pezsc_service_test::TestNetComponents::new( - task_manager, - client, - network, - sync, - transaction_pool, - )) - }); + pezsc_service_test::connectivity( + integration_test_config_with_two_authorities(), + |config| { + let NewFullBase { task_manager, client, network, sync, transaction_pool, .. } = + new_full_base::>( + config, + None, + false, + |_, _| (), + )?; + Ok(pezsc_service_test::TestNetComponents::new( + task_manager, + client, + network, + sync, + transaction_pool, + )) + }, + ); } #[test] diff --git a/bizinikiwi/bin/node/cli/src/command.rs b/bizinikiwi/bin/node/cli/src/command.rs index d2edd724..cfe796df 100644 --- a/bizinikiwi/bin/node/cli/src/command.rs +++ b/bizinikiwi/bin/node/cli/src/command.rs @@ -24,10 +24,10 @@ use crate::{ service::{new_partial, FullClient}, Cli, Subcommand, }; -use pezframe_benchmarking_cli::*; use pez_kitchensink_runtime::{ExistentialDeposit, RuntimeApi}; use pez_node_primitives::Block; -use pezsc_cli::{Result, BizinikiwiCli}; +use pezframe_benchmarking_cli::*; +use pezsc_cli::{BizinikiwiCli, Result}; use pezsc_service::PartialComponents; use pezsp_keyring::Sr25519Keyring; use pezsp_runtime::traits::HashingFor; @@ -59,7 +59,10 @@ impl BizinikiwiCli for Cli { 2017 } - fn load_spec(&self, id: &str) -> std::result::Result, String> { + fn load_spec( + &self, + id: &str, + ) -> std::result::Result, String> { let spec = match id { "" => return Err( diff --git a/bizinikiwi/bin/node/cli/src/service.rs b/bizinikiwi/bin/node/cli/src/service.rs index 6d59cb64..d1455e5a 100644 --- a/bizinikiwi/bin/node/cli/src/service.rs +++ b/bizinikiwi/bin/node/cli/src/service.rs @@ -28,18 +28,20 @@ use pezkuwi_sdk::{ use crate::Cli; use codec::Encode; -use pezframe_benchmarking_cli::BIZINIKIWI_REFERENCE_HARDWARE; -use pezframe_system_rpc_runtime_api::AccountNonceApi; use futures::prelude::*; use pez_kitchensink_runtime::RuntimeApi; use pez_node_primitives::Block; +use pezframe_benchmarking_cli::BIZINIKIWI_REFERENCE_HARDWARE; +use pezframe_system_rpc_runtime_api::AccountNonceApi; use pezsc_client_api::{Backend, BlockBackend}; use pezsc_consensus_babe::{self, SlotProportion}; use pezsc_network::{ event::Event, service::traits::NetworkService, NetworkBackend, NetworkEventStream, }; use pezsc_network_sync::{strategy::warp::WarpSyncConfig, SyncingService}; -use pezsc_service::{config::Configuration, error::Error as ServiceError, RpcHandlers, TaskManager}; +use pezsc_service::{ + config::Configuration, error::Error as ServiceError, RpcHandlers, TaskManager, +}; use pezsc_statement_store::Store as StatementStore; use pezsc_telemetry::{Telemetry, TelemetryWorker}; use pezsc_transaction_pool::TransactionPoolHandle; @@ -121,28 +123,28 @@ pub fn create_extrinsic( .map(|c| c / 2) .unwrap_or(2) as u64; let tip = 0; - let tx_ext: pez_kitchensink_runtime::TxExtension = - ( - pezframe_system::AuthorizeCall::::new(), - pezframe_system::CheckNonZeroSender::::new(), - pezframe_system::CheckSpecVersion::::new(), - pezframe_system::CheckTxVersion::::new(), - pezframe_system::CheckGenesis::::new(), - pezframe_system::CheckEra::::from(generic::Era::mortal( - period, - best_block.saturated_into(), - )), - pezframe_system::CheckNonce::::from(nonce), - pezframe_system::CheckWeight::::new(), - pezpallet_skip_feeless_payment::SkipCheckIfFeeless::from( - pezpallet_asset_conversion_tx_payment::ChargeAssetTxPayment::< - pez_kitchensink_runtime::Runtime, - >::from(tip, None), - ), - pezframe_metadata_hash_extension::CheckMetadataHash::new(false), - pezpallet_revive::evm::tx_extension::SetOrigin::::default(), - pezframe_system::WeightReclaim::::new(), - ); + let tx_ext: pez_kitchensink_runtime::TxExtension = ( + pezframe_system::AuthorizeCall::::new(), + pezframe_system::CheckNonZeroSender::::new(), + pezframe_system::CheckSpecVersion::::new(), + pezframe_system::CheckTxVersion::::new(), + pezframe_system::CheckGenesis::::new(), + pezframe_system::CheckEra::::from(generic::Era::mortal( + period, + best_block.saturated_into(), + )), + pezframe_system::CheckNonce::::from(nonce), + pezframe_system::CheckWeight::::new(), + pezpallet_skip_feeless_payment::SkipCheckIfFeeless::from( + pezpallet_asset_conversion_tx_payment::ChargeAssetTxPayment::< + pez_kitchensink_runtime::Runtime, + >::from(tip, None), + ), + pezframe_metadata_hash_extension::CheckMetadataHash::new(false), + pezpallet_revive::evm::tx_extension::SetOrigin::::default( + ), + pezframe_system::WeightReclaim::::new(), + ); let raw_payload = pez_kitchensink_runtime::SignedPayload::from_raw( function.clone(), @@ -934,7 +936,13 @@ mod tests { config, None, false, - |block_import: &pezsc_consensus_babe::BabeBlockImport, + |block_import: &pezsc_consensus_babe::BabeBlockImport< + Block, + _, + _, + _, + _, + >, babe_link: &pezsc_consensus_babe::BabeLink| { setup_handles = Some((block_import.clone(), babe_link.clone())); }, diff --git a/bizinikiwi/bin/node/cli/tests/basic.rs b/bizinikiwi/bin/node/cli/tests/basic.rs index 06af5110..e47186b4 100644 --- a/bizinikiwi/bin/node/cli/tests/basic.rs +++ b/bizinikiwi/bin/node/cli/tests/basic.rs @@ -176,11 +176,15 @@ fn block_with_size(time: u64, nonce: u32, size: usize) -> (Vec, Hash) { vec![ CheckedExtrinsic { format: pezsp_runtime::generic::ExtrinsicFormat::Bare, - function: RuntimeCall::Timestamp(pezpallet_timestamp::Call::set { now: time * 1000 }), + function: RuntimeCall::Timestamp(pezpallet_timestamp::Call::set { + now: time * 1000, + }), }, CheckedExtrinsic { format: pezsp_runtime::generic::ExtrinsicFormat::Signed(alice(), tx_ext(nonce, 0)), - function: RuntimeCall::System(pezframe_system::Call::remark { remark: vec![0; size] }), + function: RuntimeCall::System(pezframe_system::Call::remark { + remark: vec![0; size], + }), }, ], (time * 1000 / SLOT_DURATION).into(), @@ -700,8 +704,12 @@ fn deploying_wasm_contract_should_work() { let transfer_code = wat::parse_str(CODE_TRANSFER).unwrap(); let transfer_ch = ::Hashing::hash(&transfer_code); - let addr = - pezpallet_contracts::Pezpallet::::contract_address(&charlie(), &transfer_ch, &[], &[]); + let addr = pezpallet_contracts::Pezpallet::::contract_address( + &charlie(), + &transfer_ch, + &[], + &[], + ); let time = 42 * 1000; let b = construct_block( @@ -715,16 +723,16 @@ fn deploying_wasm_contract_should_work() { }, CheckedExtrinsic { format: pezsp_runtime::generic::ExtrinsicFormat::Signed(charlie(), tx_ext(0, 0)), - function: RuntimeCall::Contracts(pezpallet_contracts::Call::instantiate_with_code::< - Runtime, - > { - value: 0, - gas_limit: Weight::from_parts(500_000_000, 0), - storage_deposit_limit: None, - code: transfer_code, - data: Vec::new(), - salt: Vec::new(), - }), + function: RuntimeCall::Contracts( + pezpallet_contracts::Call::instantiate_with_code:: { + value: 0, + gas_limit: Weight::from_parts(500_000_000, 0), + storage_deposit_limit: None, + code: transfer_code, + data: Vec::new(), + salt: Vec::new(), + }, + ), }, CheckedExtrinsic { format: pezsp_runtime::generic::ExtrinsicFormat::Signed(charlie(), tx_ext(1, 0)), diff --git a/bizinikiwi/bin/node/cli/tests/benchmark_pallet_works.rs b/bizinikiwi/bin/node/cli/tests/benchmark_pallet_works.rs index e4fc11bc..4522be3b 100644 --- a/bizinikiwi/bin/node/cli/tests/benchmark_pallet_works.rs +++ b/bizinikiwi/bin/node/cli/tests/benchmark_pallet_works.rs @@ -42,11 +42,21 @@ fn benchmark_pallet_args_work() { true, ); benchmark_pallet_args( - &["--list", "--pezpallet=pezpallet_balances", "--chain=dev", "--genesis-builder=spec-genesis"], + &[ + "--list", + "--pezpallet=pezpallet_balances", + "--chain=dev", + "--genesis-builder=spec-genesis", + ], true, ); benchmark_pallet_args( - &["--list", "--pezpallet=pezpallet_balances", "--chain=dev", "--genesis-builder=spec-runtime"], + &[ + "--list", + "--pezpallet=pezpallet_balances", + "--chain=dev", + "--genesis-builder=spec-runtime", + ], true, ); // Error because no runtime is provided: diff --git a/bizinikiwi/bin/node/cli/tests/benchmark_pezpallet_works.rs b/bizinikiwi/bin/node/cli/tests/benchmark_pezpallet_works.rs index d5990f34..8d942799 100644 --- a/bizinikiwi/bin/node/cli/tests/benchmark_pezpallet_works.rs +++ b/bizinikiwi/bin/node/cli/tests/benchmark_pezpallet_works.rs @@ -42,11 +42,21 @@ fn benchmark_pezpallet_args_work() { true, ); benchmark_pezpallet_args( - &["--list", "--pezpallet=pezpallet_balances", "--chain=dev", "--genesis-builder=spec-genesis"], + &[ + "--list", + "--pezpallet=pezpallet_balances", + "--chain=dev", + "--genesis-builder=spec-genesis", + ], true, ); benchmark_pezpallet_args( - &["--list", "--pezpallet=pezpallet_balances", "--chain=dev", "--genesis-builder=spec-runtime"], + &[ + "--list", + "--pezpallet=pezpallet_balances", + "--chain=dev", + "--genesis-builder=spec-runtime", + ], true, ); // Error because no runtime is provided: diff --git a/bizinikiwi/bin/node/cli/tests/fees.rs b/bizinikiwi/bin/node/cli/tests/fees.rs index b4416ceb..c9071423 100644 --- a/bizinikiwi/bin/node/cli/tests/fees.rs +++ b/bizinikiwi/bin/node/cli/tests/fees.rs @@ -17,11 +17,6 @@ // along with this program. If not, see . use codec::{Encode, Joiner}; -use pezframe_support::{ - dispatch::GetDispatchInfo, - traits::Currency, - weights::{constants::ExtrinsicBaseWeight, IdentityFee, WeightToFee}, -}; use pez_kitchensink_runtime::{ constants::{currency::*, time::SLOT_DURATION}, Balances, CheckedExtrinsic, Multiplier, Runtime, RuntimeCall, TransactionByteFee, @@ -29,6 +24,11 @@ use pez_kitchensink_runtime::{ }; use pez_node_primitives::Balance; use pez_node_testing::keyring::*; +use pezframe_support::{ + dispatch::GetDispatchInfo, + traits::Currency, + weights::{constants::ExtrinsicBaseWeight, IdentityFee, WeightToFee}, +}; use pezkuwi_sdk::*; use pezsp_runtime::{traits::One, Perbill}; @@ -63,7 +63,9 @@ fn fee_multiplier_increases_and_decreases_on_big_weight() { format: pezsp_runtime::generic::ExtrinsicFormat::Signed(charlie(), tx_ext(0, 0)), function: RuntimeCall::Sudo(pezpallet_sudo::Call::sudo { call: Box::new(RuntimeCall::RootTesting( - pezpallet_root_testing::Call::fill_block { ratio: Perbill::from_percent(60) }, + pezpallet_root_testing::Call::fill_block { + ratio: Perbill::from_percent(60), + }, )), }), }, diff --git a/bizinikiwi/bin/node/cli/tests/submit_transaction.rs b/bizinikiwi/bin/node/cli/tests/submit_transaction.rs index 5c679545..6f821ea8 100644 --- a/bizinikiwi/bin/node/cli/tests/submit_transaction.rs +++ b/bizinikiwi/bin/node/cli/tests/submit_transaction.rs @@ -17,8 +17,10 @@ // along with this program. If not, see . use codec::Decode; +use pez_kitchensink_runtime::{ + Executive, ExistentialDeposit, Indices, Runtime, UncheckedExtrinsic, +}; use pezframe_system::offchain::{SendSignedTransaction, Signer, SubmitTransaction}; -use pez_kitchensink_runtime::{Executive, ExistentialDeposit, Indices, Runtime, UncheckedExtrinsic}; use pezkuwi_sdk::*; use pezsp_application_crypto::AppCrypto; use pezsp_core::offchain::{testing::TestTransactionPoolExt, TransactionPoolExt}; diff --git a/bizinikiwi/bin/node/cli/tests/version.rs b/bizinikiwi/bin/node/cli/tests/version.rs index 8c369879..6e4ecff1 100644 --- a/bizinikiwi/bin/node/cli/tests/version.rs +++ b/bizinikiwi/bin/node/cli/tests/version.rs @@ -27,7 +27,10 @@ fn expected_regex() -> Regex { #[test] fn version_is_full() { let expected = expected_regex(); - let output = Command::new(cargo_bin("bizinikiwi-node")).args(&["--version"]).output().unwrap(); + let output = Command::new(cargo_bin("bizinikiwi-node")) + .args(&["--version"]) + .output() + .unwrap(); assert!(output.status.success(), "command returned with non-success exit code"); diff --git a/bizinikiwi/bin/node/rpc/src/lib.rs b/bizinikiwi/bin/node/rpc/src/lib.rs index 12fc4693..d36bbd72 100644 --- a/bizinikiwi/bin/node/rpc/src/lib.rs +++ b/bizinikiwi/bin/node/rpc/src/lib.rs @@ -135,7 +135,11 @@ where + Send + 'static, C::Api: bizinikiwi_frame_rpc_system::AccountNonceApi, - C::Api: pezmmr_rpc::MmrRuntimeApi::Hash, BlockNumber>, + C::Api: pezmmr_rpc::MmrRuntimeApi< + Block, + ::Hash, + BlockNumber, + >, C::Api: pezpallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: BabeApi, C::Api: BlockBuilder, @@ -146,6 +150,8 @@ where AuthorityId: AuthorityIdBound, ::Signature: Send + Sync, { + use bizinikiwi_frame_rpc_system::{System, SystemApiServer}; + use bizinikiwi_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer}; use pezmmr_rpc::{Mmr, MmrApiServer}; use pezpallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use pezsc_consensus_babe_rpc::{Babe, BabeApiServer}; @@ -157,8 +163,6 @@ where statement::StatementApiServer, }; use pezsc_sync_state_rpc::{SyncState, SyncStateApiServer}; - use bizinikiwi_frame_rpc_system::{System, SystemApiServer}; - use bizinikiwi_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer}; let mut io = RpcModule::new(()); diff --git a/bizinikiwi/bin/node/runtime/src/impls.rs b/bizinikiwi/bin/node/runtime/src/impls.rs index 9ddc003b..04bf7a64 100644 --- a/bizinikiwi/bin/node/runtime/src/impls.rs +++ b/bizinikiwi/bin/node/runtime/src/impls.rs @@ -25,10 +25,10 @@ use pezframe_support::{ Currency, OnUnbalanced, }, }; +use pezkuwi_sdk::*; use pezpallet_alliance::{IdentityVerifier, ProposalIndex, ProposalProvider}; use pezpallet_asset_tx_payment::HandleCredit; use pezpallet_identity::legacy::IdentityField; -use pezkuwi_sdk::*; use crate::{ AccountId, AllianceCollective, AllianceMotion, Assets, Authorship, Balances, Hash, @@ -119,8 +119,8 @@ mod multiplier_tests { dispatch::DispatchClass, weights::{Weight, WeightToFee}, }; - use pezpallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; use pezkuwi_sdk::*; + use pezpallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; use pezsp_runtime::{ assert_eq_error_rate, traits::{Convert, One, Zero}, @@ -201,10 +201,11 @@ mod multiplier_tests { where F: Fn() -> (), { - let mut t: pezsp_io::TestExternalities = pezframe_system::GenesisConfig::::default() - .build_storage() - .unwrap() - .into(); + let mut t: pezsp_io::TestExternalities = + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into(); t.execute_with(|| { System::set_block_consumed_resources(w, 0); assertions() diff --git a/bizinikiwi/bin/node/runtime/src/lib.rs b/bizinikiwi/bin/node/runtime/src/lib.rs index dd5149c3..2c503646 100644 --- a/bizinikiwi/bin/node/runtime/src/lib.rs +++ b/bizinikiwi/bin/node/runtime/src/lib.rs @@ -23,19 +23,21 @@ extern crate alloc; +#[cfg(feature = "runtime-benchmarks")] +use pezkuwi_sdk::pezsp_core::crypto::FromEntropy; #[cfg(feature = "runtime-benchmarks")] use pezpallet_asset_rate::AssetKindFactory; #[cfg(feature = "runtime-benchmarks")] use pezpallet_multi_asset_bounties::ArgumentsFactory as PalletMultiAssetBountiesArgumentsFactory; #[cfg(feature = "runtime-benchmarks")] use pezpallet_treasury::ArgumentsFactory as PalletTreasuryArgumentsFactory; -#[cfg(feature = "runtime-benchmarks")] -use pezkuwi_sdk::pezsp_core::crypto::FromEntropy; use pezkuwi_sdk::*; use alloc::{vec, vec::Vec}; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; +pub use pez_node_primitives::{AccountId, Signature}; +use pez_node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Moment, Nonce}; use pezframe_election_provider_support::{ bounds::{ElectionBounds, ElectionBoundsBuilder}, onchain, BalancingConfig, ElectionDataProvider, SequentialPhragmen, VoteWeight, @@ -46,9 +48,8 @@ use pezframe_support::{ dynamic_params::{dynamic_pallet_params, dynamic_params}, genesis_builder_helper::{build_state, get_preset}, instances::{Instance1, Instance2}, - ord_parameter_types, + ord_parameter_types, parameter_types, pezpallet_prelude::Get, - parameter_types, traits::{ fungible::{ Balanced, Credit, HoldConsideration, ItemOf, NativeFromLeft, NativeOrWithId, UnionOf, @@ -76,8 +77,6 @@ use pezframe_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, EnsureRootWithSuccess, EnsureSigned, EnsureSignedBy, EnsureWithSuccess, }; -pub use pez_node_primitives::{AccountId, Signature}; -use pez_node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Moment, Nonce}; use pezpallet_asset_conversion::{AccountIdConverter, Ascending, Chain, WithFirstAsset}; use pezpallet_asset_conversion_tx_payment::SwapAssetAdapter; use pezpallet_assets_precompiles::{InlineIdConfig, ERC20}; @@ -826,11 +825,14 @@ parameter_types! { pub MaxActiveValidators: u32 = 1000; } -/// The numbers configured here could always be more than the the maximum limits of staking pezpallet -/// to ensure election snapshot will not run out of memory. For now, we set them to smaller values -/// since the staking is bounded and the weight pipeline takes hours for this single pezpallet. +/// The numbers configured here could always be more than the the maximum limits of staking +/// pezpallet to ensure election snapshot will not run out of memory. For now, we set them to +/// smaller values since the staking is bounded and the weight pipeline takes hours for this single +/// pezpallet. pub struct ElectionProviderBenchmarkConfig; -impl pezpallet_election_provider_multi_phase::BenchmarkingConfig for ElectionProviderBenchmarkConfig { +impl pezpallet_election_provider_multi_phase::BenchmarkingConfig + for ElectionProviderBenchmarkConfig +{ const VOTERS: [u32; 2] = [1000, 2000]; const TARGETS: [u32; 2] = [500, 1000]; const ACTIVE_VOTERS: [u32; 2] = [500, 800]; @@ -1424,7 +1426,8 @@ impl pezpallet_multi_asset_bounties::Config for Runtime { type WeightInfo = pezpallet_multi_asset_bounties::weights::BizinikiwiWeight; type FundingSource = pezpallet_multi_asset_bounties::PalletIdAsFundingSource; - type BountySource = pezpallet_multi_asset_bounties::BountySourceAccount; + type BountySource = + pezpallet_multi_asset_bounties::BountySourceAccount; type ChildBountySource = pezpallet_multi_asset_bounties::ChildBountySourceAccount; type Paymaster = PayWithFungibles; @@ -1659,7 +1662,9 @@ where pezframe_system::CheckNonce::::from(0), pezframe_system::CheckWeight::::new(), pezpallet_skip_feeless_payment::SkipCheckIfFeeless::from( - pezpallet_asset_conversion_tx_payment::ChargeAssetTxPayment::::from(0, None), + pezpallet_asset_conversion_tx_payment::ChargeAssetTxPayment::::from( + 0, None, + ), ), pezframe_metadata_hash_extension::CheckMetadataHash::new(false), pezpallet_revive::evm::tx_extension::SetOrigin::::default(), @@ -2623,7 +2628,8 @@ mod runtime { pub type AssetConversionTxPayment = pezpallet_asset_conversion_tx_payment::Pezpallet; #[runtime::pezpallet_index(10)] - pub type ElectionProviderMultiPhase = pezpallet_election_provider_multi_phase::Pezpallet; + pub type ElectionProviderMultiPhase = + pezpallet_election_provider_multi_phase::Pezpallet; #[runtime::pezpallet_index(11)] pub type Staking = pezpallet_staking::Pezpallet; @@ -2674,7 +2680,8 @@ mod runtime { pub type Historical = pezpallet_session_historical::Pezpallet; #[runtime::pezpallet_index(27)] - pub type RandomnessCollectiveFlip = pezpallet_insecure_randomness_collective_flip::Pezpallet; + pub type RandomnessCollectiveFlip = + pezpallet_insecure_randomness_collective_flip::Pezpallet; #[runtime::pezpallet_index(28)] pub type Identity = pezpallet_identity::Pezpallet; @@ -2983,7 +2990,9 @@ parameter_types! { pub struct OracleBenchmarkingHelper; #[cfg(feature = "runtime-benchmarks")] -impl pezpallet_oracle::BenchmarkHelper for OracleBenchmarkingHelper { +impl pezpallet_oracle::BenchmarkHelper + for OracleBenchmarkingHelper +{ fn get_currency_id_value_pairs() -> BoundedVec<(u32, u128), OracleMaxFeedValues> { use rand::{distributions::Uniform, prelude::*}; diff --git a/bizinikiwi/bin/node/testing/src/bench.rs b/bizinikiwi/bin/node/testing/src/bench.rs index a6eb16cd..5446bf9b 100644 --- a/bizinikiwi/bin/node/testing/src/bench.rs +++ b/bizinikiwi/bin/node/testing/src/bench.rs @@ -42,7 +42,9 @@ use pez_node_primitives::Block; use pezsc_block_builder::BlockBuilderBuilder; use pezsc_client_api::{execution_extensions::ExecutionExtensions, UsageProvider}; use pezsc_client_db::PruningMode; -use pezsc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy, ImportResult, ImportedAux}; +use pezsc_consensus::{ + BlockImport, BlockImportParams, ForkChoiceStrategy, ImportResult, ImportedAux, +}; use pezsc_executor::{WasmExecutionMethod, WasmtimeInstantiationStrategy}; use pezsp_api::ProvideRuntimeApi; use pezsp_block_builder::BlockBuilder; diff --git a/bizinikiwi/bin/node/testing/src/client.rs b/bizinikiwi/bin/node/testing/src/client.rs index 24549d31..0fd648e4 100644 --- a/bizinikiwi/bin/node/testing/src/client.rs +++ b/bizinikiwi/bin/node/testing/src/client.rs @@ -18,9 +18,9 @@ //! Utilities to build a `TestClient` for `pez-kitchensink-runtime`. -use pezsp_runtime::BuildStorage; /// Re-export test-client utilities. pub use bizinikiwi_test_client::*; +use pezsp_runtime::BuildStorage; /// Call executor for `pez-kitchensink-runtime` `TestClient`. use node_cli::service::RuntimeExecutor; diff --git a/bizinikiwi/bin/utils/chain-spec-builder/tests/test.rs b/bizinikiwi/bin/utils/chain-spec-builder/tests/test.rs index 2f7656dd..c7caf782 100644 --- a/bizinikiwi/bin/utils/chain-spec-builder/tests/test.rs +++ b/bizinikiwi/bin/utils/chain-spec-builder/tests/test.rs @@ -21,10 +21,10 @@ use std::fs::File; use clap::Parser; use cmd_lib::spawn_with_output; -use pretty_assertions::assert_eq; use pezsc_chain_spec::update_code_in_json_chain_spec; -use serde_json::{from_reader, from_str, Value}; use pezstaging_chain_spec_builder::ChainSpecBuilder; +use pretty_assertions::assert_eq; +use serde_json::{from_reader, from_str, Value}; // note: the runtime path will not be read, runtime code will be set directly, to avoid hassle with // creating the wasm file or providing a valid existing path during test execution. diff --git a/bizinikiwi/bin/utils/pez-subkey/src/lib.rs b/bizinikiwi/bin/utils/pez-subkey/src/lib.rs index f6c4fe9f..98684499 100644 --- a/bizinikiwi/bin/utils/pez-subkey/src/lib.rs +++ b/bizinikiwi/bin/utils/pez-subkey/src/lib.rs @@ -18,20 +18,20 @@ //! # Subkey //! -//! Subkey is a commandline utility included with Bizinikiwi. It allows generating and restoring keys -//! for Bizinikiwi based chains such as Pezkuwi, Kusama and a growing number of teyrchains and +//! Subkey is a commandline utility included with Bizinikiwi. It allows generating and restoring +//! keys for Bizinikiwi based chains such as Pezkuwi, Kusama and a growing number of teyrchains and //! Bizinikiwi based projects. //! `pez_subkey` provides a few sub-commands to generate keys, check keys, sign messages, verify //! messages, etc... //! -//! You can see the full list of commands with `pez_subkey --help`. Most commands have additional help -//! available with for instance `pez_subkey generate --help` for the `generate` command. +//! You can see the full list of commands with `pez_subkey --help`. Most commands have additional +//! help available with for instance `pez_subkey generate --help` for the `generate` command. //! //! ## Safety first //! -//! `pez_subkey` does not need an internet connection to work. Indeed, for the best security, you should -//! be using `pez_subkey` on a machine that is **not connected** to the internet. +//! `pez_subkey` does not need an internet connection to work. Indeed, for the best security, you +//! should be using `pez_subkey` on a machine that is **not connected** to the internet. //! //! `pez_subkey` deals with **seeds** and **private keys**. Make sure to use `pez_subkey` in a safe //! environment (ie. no one looking over your shoulder) and on a safe computer (ie. no one able to @@ -42,8 +42,8 @@ //! //! ## Usage //! -//! The following guide explains *some* of the `pez_subkey` commands. For the full list and the most up -//! to date documentation, make sure to check the integrated help with `pez_subkey --help`. +//! The following guide explains *some* of the `pez_subkey` commands. For the full list and the most +//! up to date documentation, make sure to check the integrated help with `pez_subkey --help`. //! //! ### Install with Cargo //! @@ -146,8 +146,8 @@ //! //! ### Additional user-defined password //! -//! `pez_subkey` supports an additional user-defined secret that will be appended to the seed. Let's see -//! the following example: +//! `pez_subkey` supports an additional user-defined secret that will be appended to the seed. Let's +//! see the following example: //! //! ```bash //! pez_subkey generate --password extra_secret @@ -184,8 +184,8 @@ //! //! ### Inspecting a key //! -//! If you have *some data* about a key, `pez_subkey inspect` will help you discover more information -//! about it. +//! If you have *some data* about a key, `pez_subkey inspect` will help you discover more +//! information about it. //! //! If you have **secrets** that you would like to verify for instance, you can use: //! diff --git a/bizinikiwi/client/api/src/backend.rs b/bizinikiwi/client/api/src/backend.rs index 5589d1c8..0c4a0b3d 100644 --- a/bizinikiwi/client/api/src/backend.rs +++ b/bizinikiwi/client/api/src/backend.rs @@ -241,8 +241,10 @@ pub trait BlockImportOperation { fn mark_head(&mut self, hash: Block::Hash) -> pezsp_blockchain::Result<()>; /// Add a transaction index operation. - fn update_transaction_index(&mut self, index: Vec) - -> pezsp_blockchain::Result<()>; + fn update_transaction_index( + &mut self, + index: Vec, + ) -> pezsp_blockchain::Result<()>; /// Configure whether to create a block gap if newly imported block is missing parent fn set_create_gap(&mut self, create_gap: bool); diff --git a/bizinikiwi/client/api/src/client.rs b/bizinikiwi/client/api/src/client.rs index a5c95ea1..b7ce050c 100644 --- a/bizinikiwi/client/api/src/client.rs +++ b/bizinikiwi/client/api/src/client.rs @@ -137,19 +137,27 @@ pub trait BlockBackend { /// /// Note that this will only fetch transactions /// that are indexed by the runtime with `storage_index_transaction`. - fn block_indexed_body(&self, hash: Block::Hash) -> pezsp_blockchain::Result>>>; + fn block_indexed_body( + &self, + hash: Block::Hash, + ) -> pezsp_blockchain::Result>>>; /// Get full block by hash. fn block(&self, hash: Block::Hash) -> pezsp_blockchain::Result>>; /// Get block status by block hash. - fn block_status(&self, hash: Block::Hash) -> pezsp_blockchain::Result; + fn block_status( + &self, + hash: Block::Hash, + ) -> pezsp_blockchain::Result; /// Get block justifications for the block with the given hash. - fn justifications(&self, hash: Block::Hash) -> pezsp_blockchain::Result>; + fn justifications(&self, hash: Block::Hash) + -> pezsp_blockchain::Result>; /// Get block hash by number. - fn block_hash(&self, number: NumberFor) -> pezsp_blockchain::Result>; + fn block_hash(&self, number: NumberFor) + -> pezsp_blockchain::Result>; /// Get single indexed transaction by content hash. /// diff --git a/bizinikiwi/client/api/src/in_mem.rs b/bizinikiwi/client/api/src/in_mem.rs index 956425be..a3d29e0c 100644 --- a/bizinikiwi/client/api/src/in_mem.rs +++ b/bizinikiwi/client/api/src/in_mem.rs @@ -407,7 +407,10 @@ impl blockchain::Backend for Blockchain { .and_then(|b| b.extrinsics().map(|x| x.to_vec()))) } - fn justifications(&self, hash: Block::Hash) -> pezsp_blockchain::Result> { + fn justifications( + &self, + hash: Block::Hash, + ) -> pezsp_blockchain::Result> { Ok(self.storage.read().blocks.get(&hash).and_then(|b| b.justifications().cloned())) } @@ -672,7 +675,10 @@ impl backend::Backend for Backend { Ok(()) } - fn commit_operation(&self, operation: Self::BlockImportOperation) -> pezsp_blockchain::Result<()> { + fn commit_operation( + &self, + operation: Self::BlockImportOperation, + ) -> pezsp_blockchain::Result<()> { if !operation.finalized_blocks.is_empty() { for (block, justification) in operation.finalized_blocks { self.blockchain.finalize_header(block, justification)?; @@ -804,9 +810,9 @@ pub fn check_genesis_storage(storage: &Storage) -> pezsp_blockchain::Result<()> #[cfg(test)] mod tests { use crate::{in_mem::Blockchain, NewBlockState}; + use bizinikiwi_test_runtime::{Block, Header, H256}; use pezsp_blockchain::Backend; use pezsp_runtime::{traits::Header as HeaderT, ConsensusEngineId, Justifications}; - use bizinikiwi_test_runtime::{Block, Header, H256}; pub const ID1: ConsensusEngineId = *b"TST1"; pub const ID2: ConsensusEngineId = *b"TST2"; diff --git a/bizinikiwi/client/api/src/lib.rs b/bizinikiwi/client/api/src/lib.rs index 12c52af2..daa53e0a 100644 --- a/bizinikiwi/client/api/src/lib.rs +++ b/bizinikiwi/client/api/src/lib.rs @@ -32,9 +32,9 @@ pub use backend::*; pub use call_executor::*; pub use client::*; pub use notifications::*; -pub use proof_provider::*; pub use pezsp_blockchain as blockchain; pub use pezsp_blockchain::HeaderBackend; +pub use proof_provider::*; pub use pezsp_state_machine::{CompactProof, StorageProof}; pub use pezsp_storage::{ChildInfo, PrefixedStorageKey, StorageData, StorageKey}; diff --git a/bizinikiwi/client/authority-discovery/src/worker.rs b/bizinikiwi/client/authority-discovery/src/worker.rs index ffbfd54f..5cda331d 100644 --- a/bizinikiwi/client/authority-discovery/src/worker.rs +++ b/bizinikiwi/client/authority-discovery/src/worker.rs @@ -48,7 +48,6 @@ use pezsc_network::{ Multiaddr, NetworkDHTProvider, NetworkSigner, NetworkStateInfo, }; use pezsc_network_types::{multihash::Code, PeerId}; -use schema::PeerSignature; use pezsp_api::{ApiError, ProvideRuntimeApi}; use pezsp_authority_discovery::{ AuthorityDiscoveryApi, AuthorityId, AuthorityPair, AuthoritySignature, @@ -60,6 +59,7 @@ use pezsp_core::{ }; use pezsp_keystore::{Keystore, KeystorePtr}; use pezsp_runtime::traits::Block as BlockT; +use schema::PeerSignature; mod addr_cache; /// Dht payload schemas generated from Protobuf definitions via Prost crate in build.rs. diff --git a/bizinikiwi/client/authority-discovery/src/worker/addr_cache.rs b/bizinikiwi/client/authority-discovery/src/worker/addr_cache.rs index 0db1e6e5..8fdb9a9d 100644 --- a/bizinikiwi/client/authority-discovery/src/worker/addr_cache.rs +++ b/bizinikiwi/client/authority-discovery/src/worker/addr_cache.rs @@ -20,9 +20,9 @@ use crate::error::Error; use log::{info, warn}; use pezsc_network::{multiaddr::Protocol, Multiaddr}; use pezsc_network_types::PeerId; -use serde::{Deserialize, Serialize}; use pezsp_authority_discovery::AuthorityId; use pezsp_runtime::DeserializeOwned; +use serde::{Deserialize, Serialize}; use std::{ collections::{hash_map::Entry, HashMap, HashSet}, fs::File, @@ -300,8 +300,8 @@ mod tests { use super::*; - use quickcheck::{Arbitrary, Gen, QuickCheck, TestResult}; use pezsc_network_types::multihash::{Code, Multihash}; + use quickcheck::{Arbitrary, Gen, QuickCheck, TestResult}; use pezsp_authority_discovery::{AuthorityId, AuthorityPair}; use pezsp_core::crypto::Pair; diff --git a/bizinikiwi/client/authority-discovery/src/worker/schema/tests.rs b/bizinikiwi/client/authority-discovery/src/worker/schema/tests.rs index 0bdc93fe..1db1be97 100644 --- a/bizinikiwi/client/authority-discovery/src/worker/schema/tests.rs +++ b/bizinikiwi/client/authority-discovery/src/worker/schema/tests.rs @@ -26,9 +26,9 @@ mod schema_v2 { use super::*; use codec::Encode; -use prost::Message; use pezsc_network::{Multiaddr, PeerId}; use pezsc_network_types::ed25519::Keypair; +use prost::Message; #[test] fn v2_decodes_v1() { diff --git a/bizinikiwi/client/authority-discovery/src/worker/tests.rs b/bizinikiwi/client/authority-discovery/src/worker/tests.rs index b0ee14d5..24123964 100644 --- a/bizinikiwi/client/authority-discovery/src/worker/tests.rs +++ b/bizinikiwi/client/authority-discovery/src/worker/tests.rs @@ -26,6 +26,7 @@ use std::{ use crate::tests::{create_spawner, test_config}; use super::*; +use bizinikiwi_test_runtime_client::runtime::Block; use futures::{ channel::mpsc::{self, channel}, executor::{block_on, LocalPool}, @@ -33,7 +34,6 @@ use futures::{ sink::SinkExt, task::LocalSpawn, }; -use prometheus_endpoint::prometheus::default_registry; use pezsc_client_api::HeaderBackend; use pezsc_network::{ service::signature::{Keypair, SigningError}, @@ -47,7 +47,7 @@ use pezsc_network_types::{ use pezsp_api::{ApiRef, ProvideRuntimeApi}; use pezsp_keystore::{testing::MemoryKeystore, Keystore}; use pezsp_runtime::traits::{Block as BlockT, NumberFor, Zero}; -use bizinikiwi_test_runtime_client::runtime::Block; +use prometheus_endpoint::prometheus::default_registry; #[derive(Clone)] pub(crate) struct TestApi { @@ -135,8 +135,9 @@ pub struct TestNetwork { pub put_value_call: Arc)>>>, pub put_value_to_call: Arc, bool)>>>, pub get_value_call: Arc>>, - pub store_value_call: - Arc, Option, Option)>>>, + pub store_value_call: Arc< + Mutex, Option, Option)>>, + >, event_sender: mpsc::UnboundedSender, event_receiver: Option>, diff --git a/bizinikiwi/client/basic-authorship/src/basic_authorship.rs b/bizinikiwi/client/basic-authorship/src/basic_authorship.rs index b3179790..ecad5b95 100644 --- a/bizinikiwi/client/basic-authorship/src/basic_authorship.rs +++ b/bizinikiwi/client/basic-authorship/src/basic_authorship.rs @@ -27,13 +27,14 @@ use futures::{ future::{Future, FutureExt}, }; use log::{debug, error, info, log_enabled, trace, warn, Level}; -use prometheus_endpoint::Registry as PrometheusRegistry; use pezsc_block_builder::{BlockBuilderApi, BlockBuilderBuilder}; use pezsc_proposer_metrics::{EndProposingReason, MetricsLink as PrometheusMetrics}; use pezsc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_INFO}; use pezsc_transaction_pool_api::{InPoolTransaction, TransactionPool, TxInvalidityReportMap}; use pezsp_api::{ApiExt, CallApiAt, ProofRecorder, ProvideRuntimeApi}; -use pezsp_blockchain::{ApplyExtrinsicFailed::Validity, Error::ApplyExtrinsicFailed, HeaderBackend}; +use pezsp_blockchain::{ + ApplyExtrinsicFailed::Validity, Error::ApplyExtrinsicFailed, HeaderBackend, +}; use pezsp_consensus::{DisableProofRecording, EnableProofRecording, ProofRecording, Proposal}; use pezsp_core::traits::SpawnNamed; use pezsp_inherents::InherentData; @@ -42,6 +43,7 @@ use pezsp_runtime::{ Digest, ExtrinsicInclusionMode, Percent, SaturatedConversion, }; use pezsp_trie::recorder::IgnoredNodes; +use prometheus_endpoint::Registry as PrometheusRegistry; use std::{marker::PhantomData, pin::Pin, sync::Arc, time}; /// Default block size limit in bytes used by [`Proposer`]. @@ -68,8 +70,8 @@ pub struct ProposerFactory { metrics: PrometheusMetrics, /// The default block size limit. /// - /// If no `block_size_limit` is passed to [`pezsp_consensus::Proposer::propose`], this block size - /// limit will be used. + /// If no `block_size_limit` is passed to [`pezsp_consensus::Proposer::propose`], this block + /// size limit will be used. default_block_size_limit: usize, /// Soft deadline percentage of hard deadline. /// @@ -672,6 +674,11 @@ where #[cfg(test)] mod tests { use super::*; + use bizinikiwi_test_runtime_client::{ + prelude::*, + runtime::{Block as TestBlock, Extrinsic, ExtrinsicBuilder, Transfer}, + TestClientBuilder, TestClientBuilderExt, + }; use futures::executor::block_on; use parking_lot::Mutex; use pezsc_client_api::{Backend, TrieCacheContext}; @@ -681,11 +688,6 @@ mod tests { use pezsp_blockchain::HeaderBackend; use pezsp_consensus::{BlockOrigin, Environment}; use pezsp_runtime::{generic::BlockId, traits::NumberFor, Perbill}; - use bizinikiwi_test_runtime_client::{ - prelude::*, - runtime::{Block as TestBlock, Extrinsic, ExtrinsicBuilder, Transfer}, - TestClientBuilder, TestClientBuilderExt, - }; const SOURCE: TransactionSource = TransactionSource::External; diff --git a/bizinikiwi/client/block-builder/src/lib.rs b/bizinikiwi/client/block-builder/src/lib.rs index 3b741615..dbff04aa 100644 --- a/bizinikiwi/client/block-builder/src/lib.rs +++ b/bizinikiwi/client/block-builder/src/lib.rs @@ -378,12 +378,12 @@ where #[cfg(test)] mod tests { use super::*; - use pezsp_blockchain::HeaderBackend; - use pezsp_core::Blake2Hasher; - use pezsp_state_machine::Backend; use bizinikiwi_test_runtime_client::{ runtime::ExtrinsicBuilder, DefaultTestClientBuilderExt, TestClientBuilderExt, }; + use pezsp_blockchain::HeaderBackend; + use pezsp_core::Blake2Hasher; + use pezsp_state_machine::Backend; #[test] fn block_building_storage_proof_does_not_include_runtime_by_default() { @@ -404,9 +404,11 @@ mod tests { let proof = block.proof.expect("Proof is build on request"); let genesis_state_root = client.header(genesis_hash).unwrap().unwrap().state_root; - let backend = - pezsp_state_machine::create_proof_check_backend::(genesis_state_root, proof) - .unwrap(); + let backend = pezsp_state_machine::create_proof_check_backend::( + genesis_state_root, + proof, + ) + .unwrap(); assert!(backend .storage(&pezsp_core::storage::well_known_keys::CODE) diff --git a/bizinikiwi/client/chain-spec/src/chain_spec.rs b/bizinikiwi/client/chain-spec/src/chain_spec.rs index 01f8b590..926032e8 100644 --- a/bizinikiwi/client/chain-spec/src/chain_spec.rs +++ b/bizinikiwi/client/chain-spec/src/chain_spec.rs @@ -24,13 +24,13 @@ use crate::{ }; use pezsc_network::config::MultiaddrWithPeerId; use pezsc_telemetry::TelemetryEndpoints; -use serde::{Deserialize, Serialize}; -use serde_json as json; use pezsp_core::{ storage::{ChildInfo, Storage, StorageChild, StorageData, StorageKey}, Bytes, }; use pezsp_runtime::BuildStorage; +use serde::{Deserialize, Serialize}; +use serde_json as json; use std::{ borrow::Cow, collections::{BTreeMap, VecDeque}, @@ -166,8 +166,8 @@ where }); }, // The `StateRootHash` variant exists as a way to keep note that other clients support - // it, but Bizinikiwi itself isn't capable of loading chain specs with just a hash at the - // moment. + // it, but Bizinikiwi itself isn't capable of loading chain specs with just a hash at + // the moment. Genesis::StateRootHash(_) => return Err("Genesis storage in hash format not supported".into()), Genesis::RuntimeGenesis(RuntimeGenesisInner { @@ -795,11 +795,11 @@ pub fn set_code_substitute_in_json_chain_spec( #[cfg(test)] mod tests { use super::*; - use pretty_assertions::assert_eq; - use serde_json::{from_str, json, Value}; use pezsp_application_crypto::Ss58Codec; use pezsp_core::storage::well_known_keys; use pezsp_keyring::Sr25519Keyring; + use pretty_assertions::assert_eq; + use serde_json::{from_str, json, Value}; type TestSpec = ChainSpec; @@ -966,9 +966,10 @@ mod tests { .build(); let actual = output.as_json(false).unwrap(); - let expected = - from_str::(include_str!("../res/bizinikiwi_test_runtime_from_named_preset.json")) - .unwrap(); + let expected = from_str::(include_str!( + "../res/bizinikiwi_test_runtime_from_named_preset.json" + )) + .unwrap(); //wasm blob may change overtime so let's zero it. Also ensure it is there: let actual = zeroize_code_key_in_json(false, actual.as_str()); diff --git a/bizinikiwi/client/chain-spec/src/genesis_block.rs b/bizinikiwi/client/chain-spec/src/genesis_block.rs index 318181aa..5da345ca 100644 --- a/bizinikiwi/client/chain-spec/src/genesis_block.rs +++ b/bizinikiwi/client/chain-spec/src/genesis_block.rs @@ -106,8 +106,9 @@ impl, E: RuntimeVersionOf> GenesisBlockBuilder< backend: Arc, executor: E, ) -> pezsp_blockchain::Result { - let genesis_storage = - build_genesis_storage.build_storage().map_err(pezsp_blockchain::Error::Storage)?; + let genesis_storage = build_genesis_storage + .build_storage() + .map_err(pezsp_blockchain::Error::Storage)?; Self::new_with_storage(genesis_storage, commit_genesis_state, backend, executor) } diff --git a/bizinikiwi/client/chain-spec/src/genesis_config_builder.rs b/bizinikiwi/client/chain-spec/src/genesis_config_builder.rs index 777d9fdc..5947cbb3 100644 --- a/bizinikiwi/client/chain-spec/src/genesis_config_builder.rs +++ b/bizinikiwi/client/chain-spec/src/genesis_config_builder.rs @@ -21,7 +21,6 @@ use codec::{Decode, Encode}; pub use pezsc_executor::pezsp_wasm_interface::HostFunctions; use pezsc_executor::{error::Result, WasmExecutor}; -use serde_json::{from_slice, Value}; use pezsp_core::{ storage::Storage, traits::{CallContext, CodeExecutor, Externalities, FetchRuntimeCode, RuntimeCode}, @@ -29,6 +28,7 @@ use pezsp_core::{ use pezsp_genesis_builder::{PresetId, Result as BuildResult}; pub use pezsp_genesis_builder::{DEV_RUNTIME_PRESET, LOCAL_TESTNET_RUNTIME_PRESET}; use pezsp_state_machine::BasicExternalities; +use serde_json::{from_slice, Value}; use std::borrow::Cow; /// A utility that facilitates calling the GenesisBuilder API from the runtime wasm code blob. @@ -85,8 +85,8 @@ where /// Returns a json representation of the default `RuntimeGenesisConfig` provided by the /// `runtime`. /// - /// Calls [`GenesisBuilder::get_preset`](pezsp_genesis_builder::GenesisBuilder::get_preset) in the - /// `runtime` with `None` argument. + /// Calls [`GenesisBuilder::get_preset`](pezsp_genesis_builder::GenesisBuilder::get_preset) in + /// the `runtime` with `None` argument. pub fn get_default_config(&self) -> core::result::Result { self.get_named_preset(None) } @@ -176,9 +176,9 @@ where #[cfg(test)] mod tests { use super::*; - use serde_json::{from_str, json}; pub use pezsp_consensus_babe::{AllowedSlots, BabeEpochConfiguration}; pub use pezsp_genesis_builder::PresetId; + use serde_json::{from_str, json}; #[test] fn list_presets_works() { diff --git a/bizinikiwi/client/chain-spec/src/lib.rs b/bizinikiwi/client/chain-spec/src/lib.rs index a8c8438c..f4433f91 100644 --- a/bizinikiwi/client/chain-spec/src/lib.rs +++ b/bizinikiwi/client/chain-spec/src/lib.rs @@ -192,9 +192,9 @@ //! //! This interaction involves passing the runtime genesis config JSON blob to the runtime using the //! [`pezsp_genesis_builder::GenesisBuilder::build_state`] function. During this operation, the -//! runtime converts the JSON representation of the genesis config into [`pezsp_io::storage`] items. It -//! is a crucial step for computing the storage root hash, which is a key component in determining -//! the genesis hash. +//! runtime converts the JSON representation of the genesis config into [`pezsp_io::storage`] items. +//! It is a crucial step for computing the storage root hash, which is a key component in +//! determining the genesis hash. //! //! Consequently, the runtime must support the [`pezsp_genesis_builder::GenesisBuilder`] API to //! utilize either `patch` or `full` formats. diff --git a/bizinikiwi/client/cli/src/commands/insert_key.rs b/bizinikiwi/client/cli/src/commands/insert_key.rs index 5a7b3e13..33a3f8bd 100644 --- a/bizinikiwi/client/cli/src/commands/insert_key.rs +++ b/bizinikiwi/client/cli/src/commands/insert_key.rs @@ -19,7 +19,7 @@ //! Implementation of the `insert` subcommand use crate::{ - utils, with_crypto_scheme, CryptoScheme, Error, KeystoreParams, SharedParams, BizinikiwiCli, + utils, with_crypto_scheme, BizinikiwiCli, CryptoScheme, Error, KeystoreParams, SharedParams, }; use clap::Parser; use pezsc_keystore::LocalKeystore; diff --git a/bizinikiwi/client/cli/src/commands/key.rs b/bizinikiwi/client/cli/src/commands/key.rs index 28c326b6..c7ac3cd0 100644 --- a/bizinikiwi/client/cli/src/commands/key.rs +++ b/bizinikiwi/client/cli/src/commands/key.rs @@ -22,7 +22,7 @@ use super::{ generate::GenerateCmd, generate_node_key::GenerateNodeKeyCmd, insert_key::InsertKeyCmd, inspect_key::InspectKeyCmd, inspect_node_key::InspectNodeKeyCmd, }; -use crate::{Error, BizinikiwiCli}; +use crate::{BizinikiwiCli, Error}; /// Key utilities for the cli. #[derive(Debug, clap::Subcommand)] diff --git a/bizinikiwi/client/cli/src/commands/run_cmd.rs b/bizinikiwi/client/cli/src/commands/run_cmd.rs index b981f2cd..7001bb79 100644 --- a/bizinikiwi/client/cli/src/commands/run_cmd.rs +++ b/bizinikiwi/client/cli/src/commands/run_cmd.rs @@ -25,7 +25,6 @@ use crate::{ CliConfiguration, PrometheusParams, RpcParams, RuntimeParams, TelemetryParams, }; use clap::Parser; -use regex::Regex; use pezsc_service::{ config::{ BasePath, IpNetwork, PrometheusConfig, RpcBatchRequestConfig, TransactionPoolOptions, @@ -33,6 +32,7 @@ use pezsc_service::{ ChainSpec, Role, }; use pezsc_telemetry::TelemetryEndpoints; +use regex::Regex; use std::num::NonZeroU32; /// The `run` command used to run a node. diff --git a/bizinikiwi/client/cli/src/commands/utils.rs b/bizinikiwi/client/cli/src/commands/utils.rs index 4c86f654..2d5e8713 100644 --- a/bizinikiwi/client/cli/src/commands/utils.rs +++ b/bizinikiwi/client/cli/src/commands/utils.rs @@ -21,7 +21,6 @@ use crate::{ error::{self, Error}, OutputType, }; -use serde_json::json; use pezsp_core::{ crypto::{ unwrap_or_default_ss58_version, ExposeSecret, SecretString, Ss58AddressFormat, Ss58Codec, @@ -31,6 +30,7 @@ use pezsp_core::{ Pair, }; use pezsp_runtime::{traits::IdentifyAccount, MultiSigner}; +use serde_json::json; use std::path::PathBuf; /// Public key type for Runtime diff --git a/bizinikiwi/client/cli/src/commands/vanity.rs b/bizinikiwi/client/cli/src/commands/vanity.rs index f39e28d5..c94c878b 100644 --- a/bizinikiwi/client/cli/src/commands/vanity.rs +++ b/bizinikiwi/client/cli/src/commands/vanity.rs @@ -22,9 +22,9 @@ use crate::{ error, utils, with_crypto_scheme, CryptoSchemeFlag, NetworkSchemeFlag, OutputTypeFlag, }; use clap::Parser; -use rand::{rngs::OsRng, RngCore}; use pezsp_core::crypto::{unwrap_or_default_ss58_version, Ss58AddressFormat, Ss58Codec}; use pezsp_runtime::traits::IdentifyAccount; +use rand::{rngs::OsRng, RngCore}; use utils::print_from_uri; /// The `vanity` command diff --git a/bizinikiwi/client/cli/src/config.rs b/bizinikiwi/client/cli/src/config.rs index b8f275ba..f7322c1c 100644 --- a/bizinikiwi/client/cli/src/config.rs +++ b/bizinikiwi/client/cli/src/config.rs @@ -19,9 +19,9 @@ //! Configuration trait for a CLI based on bizinikiwi use crate::{ - arg_enums::Database, error::Result, DatabaseParams, ImportParams, KeystoreParams, - NetworkParams, NodeKeyParams, OffchainWorkerParams, PruningParams, RpcEndpoint, SharedParams, - BizinikiwiCli, + arg_enums::Database, error::Result, BizinikiwiCli, DatabaseParams, ImportParams, + KeystoreParams, NetworkParams, NodeKeyParams, OffchainWorkerParams, PruningParams, RpcEndpoint, + SharedParams, }; use log::warn; use names::{Generator, Name}; diff --git a/bizinikiwi/client/cli/src/lib.rs b/bizinikiwi/client/cli/src/lib.rs index 46370ae2..1a968b34 100644 --- a/bizinikiwi/client/cli/src/lib.rs +++ b/bizinikiwi/client/cli/src/lib.rs @@ -42,11 +42,11 @@ pub use commands::*; pub use config::*; pub use error::*; pub use params::*; -pub use runner::*; pub use pezsc_service::{ChainSpec, Role}; pub use pezsc_tracing::logging::LoggerBuilder; -pub use signals::Signals; pub use pezsp_version::RuntimeVersion; +pub use runner::*; +pub use signals::Signals; /// Bizinikiwi client CLI /// diff --git a/bizinikiwi/client/cli/src/params/transaction_pool_params.rs b/bizinikiwi/client/cli/src/params/transaction_pool_params.rs index aced39f5..ccd6b99e 100644 --- a/bizinikiwi/client/cli/src/params/transaction_pool_params.rs +++ b/bizinikiwi/client/cli/src/params/transaction_pool_params.rs @@ -34,7 +34,8 @@ impl Into for TransactionPoolType { match self { TransactionPoolType::SingleState => pezsc_transaction_pool::TransactionPoolType::SingleState, - TransactionPoolType::ForkAware => pezsc_transaction_pool::TransactionPoolType::ForkAware, + TransactionPoolType::ForkAware => + pezsc_transaction_pool::TransactionPoolType::ForkAware, } } } diff --git a/bizinikiwi/client/cli/src/runner.rs b/bizinikiwi/client/cli/src/runner.rs index bb438492..39bed175 100644 --- a/bizinikiwi/client/cli/src/runner.rs +++ b/bizinikiwi/client/cli/src/runner.rs @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::{error::Error as CliError, Result, Signals, BizinikiwiCli}; +use crate::{error::Error as CliError, BizinikiwiCli, Result, Signals}; use chrono::prelude::*; use futures::{future::FutureExt, Future}; use log::info; diff --git a/bizinikiwi/client/consensus/aura/src/authorities_tracker.rs b/bizinikiwi/client/consensus/aura/src/authorities_tracker.rs index fc6c1731..fddfb324 100644 --- a/bizinikiwi/client/consensus/aura/src/authorities_tracker.rs +++ b/bizinikiwi/client/consensus/aura/src/authorities_tracker.rs @@ -21,8 +21,8 @@ use std::{fmt::Debug, sync::Arc}; use codec::Codec; -use pez_fork_tree::ForkTree; use parking_lot::RwLock; +use pez_fork_tree::ForkTree; use pezsp_api::ProvideRuntimeApi; use pezsp_blockchain::{HeaderBackend, HeaderMetadata}; use pezsp_consensus_aura::{AuraApi, ConsensusLog, AURA_ENGINE_ID}; @@ -108,7 +108,8 @@ where compatibility_mode, ) .map_err(|e| format!("Could not fetch authorities at {:?}: {}", parent_hash, e))?; - let is_descendent_of = pezsc_client_api::utils::is_descendent_of(&*self.client, None); + let is_descendent_of = + pezsc_client_api::utils::is_descendent_of(&*self.client, None); let mut authorities_cache = self.authorities.write(); authorities_cache .import( diff --git a/bizinikiwi/client/consensus/aura/src/import_queue.rs b/bizinikiwi/client/consensus/aura/src/import_queue.rs index d4852fb5..7fbb0706 100644 --- a/bizinikiwi/client/consensus/aura/src/import_queue.rs +++ b/bizinikiwi/client/consensus/aura/src/import_queue.rs @@ -24,7 +24,6 @@ use crate::{ }; use codec::Codec; use log::{debug, info, trace}; -use prometheus_endpoint::Registry; use pezsc_client_api::{backend::AuxStore, BlockOf, UsageProvider}; use pezsc_consensus::{ block_import::{BlockImport, BlockImportParams, ForkChoiceStrategy}, @@ -44,6 +43,7 @@ use pezsp_runtime::{ traits::{Block as BlockT, Header, NumberFor}, DigestItem, }; +use prometheus_endpoint::Registry; use std::{fmt::Debug, sync::Arc}; /// check a header has been signed by the right key. If the slot is too far in the future, an error diff --git a/bizinikiwi/client/consensus/aura/src/lib.rs b/bizinikiwi/client/consensus/aura/src/lib.rs index 3fd7d3d5..0f8a8f65 100644 --- a/bizinikiwi/client/consensus/aura/src/lib.rs +++ b/bizinikiwi/client/consensus/aura/src/lib.rs @@ -546,6 +546,10 @@ where #[cfg(test)] mod tests { use super::*; + use bizinikiwi_test_runtime_client::{ + runtime::{Header, H256}, + TestClient, + }; use parking_lot::Mutex; use pezsc_block_builder::BlockBuilderBuilder; use pezsc_client_api::BlockchainEvents; @@ -568,10 +572,6 @@ mod tests { task::Poll, time::{Duration, Instant}, }; - use bizinikiwi_test_runtime_client::{ - runtime::{Header, H256}, - TestClient, - }; const SLOT_DURATION_MS: u64 = 1000; diff --git a/bizinikiwi/client/consensus/babe/rpc/src/lib.rs b/bizinikiwi/client/consensus/babe/rpc/src/lib.rs index e5534ebc..b2ef43d9 100644 --- a/bizinikiwi/client/consensus/babe/rpc/src/lib.rs +++ b/bizinikiwi/client/consensus/babe/rpc/src/lib.rs @@ -193,6 +193,10 @@ impl From for ErrorObjectOwned { #[cfg(test)] mod tests { use super::*; + use bizinikiwi_test_runtime_client::{ + runtime::Block, Backend, DefaultTestClientBuilderExt, TestClient, TestClientBuilder, + TestClientBuilderExt, + }; use pezsc_consensus_babe::ImportQueueParams; use pezsc_rpc_api::DenyUnsafe; use pezsc_transaction_pool_api::{OffchainTransactionPoolFactory, RejectAllTxPool}; @@ -200,10 +204,6 @@ mod tests { use pezsp_core::{crypto::key_types::BABE, testing::TaskExecutor}; use pezsp_keyring::Sr25519Keyring; use pezsp_keystore::{testing::MemoryKeystore, Keystore}; - use bizinikiwi_test_runtime_client::{ - runtime::Block, Backend, DefaultTestClientBuilderExt, TestClient, TestClientBuilder, - TestClientBuilderExt, - }; fn create_keystore(authority: Sr25519Keyring) -> KeystorePtr { let keystore = MemoryKeystore::new(); @@ -213,8 +213,8 @@ mod tests { keystore.into() } - fn test_babe_rpc_module() -> Babe> - { + fn test_babe_rpc_module( + ) -> Babe> { let builder = TestClientBuilder::new(); let (client, longest_chain) = builder.build_with_longest_chain(); let client = Arc::new(client); diff --git a/bizinikiwi/client/consensus/babe/src/aux_schema.rs b/bizinikiwi/client/consensus/babe/src/aux_schema.rs index e91b4af8..8a4183d1 100644 --- a/bizinikiwi/client/consensus/babe/src/aux_schema.rs +++ b/bizinikiwi/client/consensus/babe/src/aux_schema.rs @@ -139,6 +139,7 @@ pub fn load_block_weight( mod test { use super::*; use crate::migration::EpochV0; + use bizinikiwi_test_runtime_client; use pez_fork_tree::ForkTree; use pezsc_consensus_epochs::{EpochHeader, PersistedEpoch, PersistedEpochHeader}; use pezsc_network_test::Block as TestBlock; @@ -146,7 +147,6 @@ mod test { use pezsp_consensus_babe::AllowedSlots; use pezsp_core::H256; use pezsp_runtime::traits::NumberFor; - use bizinikiwi_test_runtime_client; #[test] fn load_decode_from_v0_epoch_changes() { diff --git a/bizinikiwi/client/consensus/babe/src/tests.rs b/bizinikiwi/client/consensus/babe/src/tests.rs index 9f9b2049..b563d535 100644 --- a/bizinikiwi/client/consensus/babe/src/tests.rs +++ b/bizinikiwi/client/consensus/babe/src/tests.rs @@ -20,6 +20,7 @@ use super::*; use authorship::claim_slot; +use bizinikiwi_test_runtime_client::DefaultTestClientBuilderExt; use pezsc_block_builder::{BlockBuilder, BlockBuilderBuilder}; use pezsc_client_api::{BlockchainEvents, Finalizer}; use pezsc_consensus::{BoxBlockImport, BoxJustificationImport}; @@ -43,7 +44,6 @@ use pezsp_runtime::{ traits::Block as BlockT, }; use std::{cell::RefCell, task::Poll, time::Duration}; -use bizinikiwi_test_runtime_client::DefaultTestClientBuilderExt; type Item = DigestItem; diff --git a/bizinikiwi/client/consensus/beefy/rpc/src/lib.rs b/bizinikiwi/client/consensus/beefy/rpc/src/lib.rs index 8759ee4a..d08f5e4f 100644 --- a/bizinikiwi/client/consensus/beefy/rpc/src/lib.rs +++ b/bizinikiwi/client/consensus/beefy/rpc/src/lib.rs @@ -163,6 +163,7 @@ where mod tests { use super::*; + use bizinikiwi_test_runtime_client::runtime::Block; use codec::{Decode, Encode}; use jsonrpsee::{core::EmptyServerParams as EmptyParams, RpcModule}; use pezsc_consensus_beefy::{ @@ -171,7 +172,6 @@ mod tests { }; use pezsp_consensus_beefy::{ecdsa_crypto, known_payloads, Payload, SignedCommitment}; use pezsp_runtime::traits::{BlakeTwo256, Hash}; - use bizinikiwi_test_runtime_client::runtime::Block; fn setup_io_handler() -> ( RpcModule>, @@ -190,9 +190,12 @@ mod tests { let (finality_proof_sender, finality_proof_stream) = BeefyVersionedFinalityProofStream::::channel(); - let handler = - Beefy::new(finality_proof_stream, best_block_stream, pezsc_rpc::testing::test_executor()) - .expect("Setting up the BEEFY RPC handler works"); + let handler = Beefy::new( + finality_proof_stream, + best_block_stream, + pezsc_rpc::testing::test_executor(), + ) + .expect("Setting up the BEEFY RPC handler works"); (handler.into_rpc(), finality_proof_sender) } diff --git a/bizinikiwi/client/consensus/beefy/src/communication/gossip.rs b/bizinikiwi/client/consensus/beefy/src/communication/gossip.rs index e0f40e7b..c36f07a5 100644 --- a/bizinikiwi/client/consensus/beefy/src/communication/gossip.rs +++ b/bizinikiwi/client/consensus/beefy/src/communication/gossip.rs @@ -607,7 +607,12 @@ pub(crate) mod tests { unimplemented!() } - fn send_topic(&mut self, _who: &pezsc_network_types::PeerId, _topic: B::Hash, _force: bool) { + fn send_topic( + &mut self, + _who: &pezsc_network_types::PeerId, + _topic: B::Hash, + _force: bool, + ) { unimplemented!() } } diff --git a/bizinikiwi/client/consensus/beefy/src/justification.rs b/bizinikiwi/client/consensus/beefy/src/justification.rs index a91273fe..e5aa8937 100644 --- a/bizinikiwi/client/consensus/beefy/src/justification.rs +++ b/bizinikiwi/client/consensus/beefy/src/justification.rs @@ -81,12 +81,12 @@ pub(crate) fn verify_with_validator_set<'a, Block: BlockT, AuthorityId: Authorit #[cfg(test)] pub(crate) mod tests { + use bizinikiwi_test_runtime_client::runtime::Block; use codec::Encode; use pezsp_consensus_beefy::{ ecdsa_crypto, known_payloads, test_utils::Keyring, Commitment, Payload, SignedCommitment, VersionedFinalityProof, }; - use bizinikiwi_test_runtime_client::runtime::Block; use super::*; use crate::tests::make_beefy_ids; diff --git a/bizinikiwi/client/consensus/beefy/src/lib.rs b/bizinikiwi/client/consensus/beefy/src/lib.rs index 41db550b..b178435b 100644 --- a/bizinikiwi/client/consensus/beefy/src/lib.rs +++ b/bizinikiwi/client/consensus/beefy/src/lib.rs @@ -34,7 +34,6 @@ use crate::{ use futures::{stream::Fuse, FutureExt, StreamExt}; use log::{debug, error, info, trace, warn}; use parking_lot::Mutex; -use prometheus_endpoint::Registry; use pezsc_client_api::{Backend, BlockBackend, BlockchainEvents, FinalityNotification, Finalizer}; use pezsc_consensus::BlockImport; use pezsc_network::{NetworkRequest, NotificationService, ProtocolName}; @@ -48,6 +47,7 @@ use pezsp_consensus_beefy::{ }; use pezsp_keystore::KeystorePtr; use pezsp_runtime::traits::{Block, Header as HeaderT, NumberFor, Zero}; +use prometheus_endpoint::Registry; use std::{ collections::{BTreeMap, VecDeque}, future::Future, @@ -557,8 +557,9 @@ pub async fn start_beefy_gadget( let mut block_import_justif = links.from_block_import_justif_stream.subscribe(100_000).fuse(); - // Subscribe to finality notifications and justifications before waiting for runtime pezpallet and - // reuse the streams, so we don't miss notifications while waiting for pezpallet to be available. + // Subscribe to finality notifications and justifications before waiting for runtime pezpallet + // and reuse the streams, so we don't miss notifications while waiting for pezpallet to be + // available. let finality_notifications = client.finality_notification_stream(); let (mut transformer, mut finality_notifications) = finality_notification_transformer_future(finality_notifications); diff --git a/bizinikiwi/client/consensus/beefy/src/tests.rs b/bizinikiwi/client/consensus/beefy/src/tests.rs index e2cefccb..017169f5 100644 --- a/bizinikiwi/client/consensus/beefy/src/tests.rs +++ b/bizinikiwi/client/consensus/beefy/src/tests.rs @@ -36,6 +36,7 @@ use crate::{ worker::PersistedState, BeefyRPCLinks, BeefyVoterLinks, BeefyWorkerBuilder, KnownPeers, UnpinnedFinalityNotification, }; +use bizinikiwi_test_runtime_client::{BlockBuilderExt, ClientExt}; use futures::{ future, stream::{Fuse, FuturesUnordered}, @@ -43,7 +44,9 @@ use futures::{ }; use parking_lot::Mutex; use pezsc_block_builder::BlockBuilderBuilder; -use pezsc_client_api::{Backend as BackendT, BlockchainEvents, FinalityNotifications, HeaderBackend}; +use pezsc_client_api::{ + Backend as BackendT, BlockchainEvents, FinalityNotifications, HeaderBackend, +}; use pezsc_consensus::{ BlockImport, BlockImportParams, BoxJustificationImport, ForkChoiceStrategy, ImportResult, ImportedAux, @@ -54,7 +57,6 @@ use pezsc_network_test::{ PeersFullClient, TestNetFactory, }; use pezsc_utils::{mpsc::TracingUnboundedReceiver, notification::NotificationReceiver}; -use serde::{Deserialize, Serialize}; use pezsp_api::{ApiRef, ProvideRuntimeApi}; use pezsp_application_crypto::key_types::BEEFY as BEEFY_KEY_TYPE; use pezsp_consensus::BlockOrigin; @@ -76,8 +78,8 @@ use pezsp_runtime::{ traits::{Header as HeaderT, NumberFor}, BuildStorage, DigestItem, EncodedJustification, Justifications, Storage, }; +use serde::{Deserialize, Serialize}; use std::{marker::PhantomData, sync::Arc, task::Poll}; -use bizinikiwi_test_runtime_client::{BlockBuilderExt, ClientExt}; use tokio::time::Duration; const GENESIS_HASH: H256 = H256::zero(); @@ -1395,7 +1397,8 @@ async fn beefy_finalizing_after_pallet_genesis() { // Minimum BEEFY block delta is 1. - // GRANDPA finalize blocks leading up to BEEFY pezpallet genesis -> BEEFY should finalize nothing. + // GRANDPA finalize blocks leading up to BEEFY pezpallet genesis -> BEEFY should finalize + // nothing. finalize_block_and_wait_for_beefy(&net, peers.clone(), &hashes[14], &[]).await; // GRANDPA finalize block #16 -> BEEFY should finalize #15 (genesis mandatory) and #16. diff --git a/bizinikiwi/client/consensus/beefy/src/worker.rs b/bizinikiwi/client/consensus/beefy/src/worker.rs index 24809252..05e27bf1 100644 --- a/bizinikiwi/client/consensus/beefy/src/worker.rs +++ b/bizinikiwi/client/consensus/beefy/src/worker.rs @@ -1035,6 +1035,10 @@ pub(crate) mod tests { }, BeefyRPCLinks, KnownPeers, }; + use bizinikiwi_test_runtime_client::{ + runtime::{Block, Digest, DigestItem, Header}, + Backend, + }; use futures::{future::poll_fn, task::Poll}; use parking_lot::Mutex; use pezsc_client_api::{Backend as BackendT, HeaderBackend}; @@ -1050,10 +1054,6 @@ pub(crate) mod tests { ConsensusLog, Payload, SignedCommitment, }; use pezsp_runtime::traits::{Header as HeaderT, One}; - use bizinikiwi_test_runtime_client::{ - runtime::{Block, Digest, DigestItem, Header}, - Backend, - }; impl PersistedState { pub fn active_round(&self) -> Result<&Rounds, Error> { diff --git a/bizinikiwi/client/consensus/common/src/block_import.rs b/bizinikiwi/client/consensus/common/src/block_import.rs index ed1a0519..3db39984 100644 --- a/bizinikiwi/client/consensus/common/src/block_import.rs +++ b/bizinikiwi/client/consensus/common/src/block_import.rs @@ -18,11 +18,11 @@ //! Block import helpers. -use serde::{Deserialize, Serialize}; use pezsp_runtime::{ traits::{Block as BlockT, HashingFor, Header as HeaderT, NumberFor}, DigestItem, Justification, Justifications, }; +use serde::{Deserialize, Serialize}; use std::{any::Any, borrow::Cow, collections::HashMap, sync::Arc}; use pezsp_consensus::{BlockOrigin, Error}; diff --git a/bizinikiwi/client/consensus/common/src/import_queue/basic_queue.rs b/bizinikiwi/client/consensus/common/src/import_queue/basic_queue.rs index 8cf3ffaf..78a4c435 100644 --- a/bizinikiwi/client/consensus/common/src/import_queue/basic_queue.rs +++ b/bizinikiwi/client/consensus/common/src/import_queue/basic_queue.rs @@ -20,13 +20,13 @@ use futures::{ task::{Context, Poll}, }; use log::{debug, trace}; -use prometheus_endpoint::Registry; use pezsc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use pezsp_consensus::BlockOrigin; use pezsp_runtime::{ traits::{Block as BlockT, Header as HeaderT, NumberFor}, Justification, Justifications, }; +use prometheus_endpoint::Registry; use std::pin::Pin; use crate::{ diff --git a/bizinikiwi/client/consensus/grandpa/rpc/src/lib.rs b/bizinikiwi/client/consensus/grandpa/rpc/src/lib.rs index 59076d41..852e5f30 100644 --- a/bizinikiwi/client/consensus/grandpa/rpc/src/lib.rs +++ b/bizinikiwi/client/consensus/grandpa/rpc/src/lib.rs @@ -36,13 +36,13 @@ mod report; use error::Error; use finality::{EncodedFinalityProof, RpcFinalityProofProvider}; use notification::JustificationNotification; -use report::{ReportAuthoritySet, ReportVoterState, ReportedRoundStates}; use pezsc_consensus_grandpa::GrandpaJustificationStream; use pezsc_rpc::{ utils::{BoundedVecDeque, PendingSubscription}, SubscriptionTaskExecutor, }; use pezsp_runtime::traits::{Block as BlockT, NumberFor}; +use report::{ReportAuthoritySet, ReportVoterState, ReportedRoundStates}; /// Provides RPC methods for interacting with GRANDPA. #[rpc(client, server)] @@ -133,6 +133,10 @@ mod tests { use super::*; use std::{collections::HashSet, sync::Arc}; + use bizinikiwi_test_runtime_client::{ + runtime::{Block, Header, H256}, + DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, + }; use codec::{Decode, Encode}; use jsonrpsee::{core::EmptyServerParams as EmptyParams, types::SubscriptionId, RpcModule}; use pezsc_block_builder::BlockBuilderBuilder; @@ -144,10 +148,6 @@ mod tests { use pezsp_core::crypto::ByteArray; use pezsp_keyring::Ed25519Keyring; use pezsp_runtime::traits::{Block as BlockT, Header as HeaderT}; - use bizinikiwi_test_runtime_client::{ - runtime::{Block, Header, H256}, - DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, - }; struct TestAuthoritySet; struct TestVoterState; diff --git a/bizinikiwi/client/consensus/grandpa/rpc/src/notification.rs b/bizinikiwi/client/consensus/grandpa/rpc/src/notification.rs index 05b92a92..e06cd46c 100644 --- a/bizinikiwi/client/consensus/grandpa/rpc/src/notification.rs +++ b/bizinikiwi/client/consensus/grandpa/rpc/src/notification.rs @@ -18,8 +18,8 @@ use codec::Encode; use pezsc_consensus_grandpa::GrandpaJustification; -use serde::{Deserialize, Serialize}; use pezsp_runtime::traits::Block as BlockT; +use serde::{Deserialize, Serialize}; /// An encoded justification proving that the given header has been finalized #[derive(Clone, Serialize, Deserialize)] diff --git a/bizinikiwi/client/consensus/grandpa/src/authorities.rs b/bizinikiwi/client/consensus/grandpa/src/authorities.rs index 488ba3b9..f66864f9 100644 --- a/bizinikiwi/client/consensus/grandpa/src/authorities.rs +++ b/bizinikiwi/client/consensus/grandpa/src/authorities.rs @@ -22,9 +22,9 @@ use std::{cmp::Ord, fmt::Debug, ops::Add}; use codec::{Decode, Encode}; use finality_grandpa::voter_set::VoterSet; -use pez_fork_tree::{FilterAction, ForkTree}; use log::debug; use parking_lot::MappedMutexGuard; +use pez_fork_tree::{FilterAction, ForkTree}; use pezsc_consensus::shared_data::{SharedData, SharedDataLocked}; use pezsc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_INFO}; use pezsp_consensus_grandpa::{AuthorityId, AuthorityList}; diff --git a/bizinikiwi/client/consensus/grandpa/src/aux_schema.rs b/bizinikiwi/client/consensus/grandpa/src/aux_schema.rs index 9f08b853..7af64f54 100644 --- a/bizinikiwi/client/consensus/grandpa/src/aux_schema.rs +++ b/bizinikiwi/client/consensus/grandpa/src/aux_schema.rs @@ -504,9 +504,9 @@ pub(crate) fn load_authorities( #[cfg(test)] mod test { use super::*; + use bizinikiwi_test_runtime_client::{self, runtime::Block}; use pezsp_consensus_grandpa::AuthorityId; use pezsp_core::{crypto::UncheckedFrom, H256}; - use bizinikiwi_test_runtime_client::{self, runtime::Block}; fn dummy_id() -> AuthorityId { AuthorityId::unchecked_from([1; 32]) diff --git a/bizinikiwi/client/consensus/grandpa/src/communication/gossip.rs b/bizinikiwi/client/consensus/grandpa/src/communication/gossip.rs index eeb1f818..955e9d5d 100644 --- a/bizinikiwi/client/consensus/grandpa/src/communication/gossip.rs +++ b/bizinikiwi/client/consensus/grandpa/src/communication/gossip.rs @@ -88,8 +88,6 @@ use ahash::{AHashMap, AHashSet}; use codec::{Decode, DecodeAll, Encode}; use log::{debug, trace}; -use prometheus_endpoint::{register, CounterVec, Opts, PrometheusError, Registry, U64}; -use rand::seq::SliceRandom; use pezsc_network::ReputationChange; use pezsc_network_common::role::ObservedRole; use pezsc_network_gossip::{MessageIntent, ValidatorContext}; @@ -98,6 +96,8 @@ use pezsc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG}; use pezsc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use pezsp_consensus_grandpa::AuthorityId; use pezsp_runtime::traits::{Block as BlockT, NumberFor, Zero}; +use prometheus_endpoint::{register, CounterVec, Opts, PrometheusError, Registry, U64}; +use rand::seq::SliceRandom; use super::{benefit, cost, Round, SetId, NEIGHBOR_REBROADCAST_PERIOD}; use crate::{environment, CatchUp, CompactCommit, SignedMessage, LOG_TARGET}; @@ -1666,11 +1666,11 @@ pub(super) struct PeerReport { mod tests { use super::{super::NEIGHBOR_REBROADCAST_PERIOD, environment::SharedVoterSetState, *}; use crate::communication; + use bizinikiwi_test_runtime_client::runtime::{Block, Header}; use pezsc_network::config::Role; use pezsc_network_gossip::Validator as GossipValidatorT; use pezsp_core::{crypto::UncheckedFrom, H256}; use std::time::Instant; - use bizinikiwi_test_runtime_client::runtime::{Block, Header}; // some random config (not really needed) fn config() -> crate::Config { diff --git a/bizinikiwi/client/consensus/grandpa/src/communication/tests.rs b/bizinikiwi/client/consensus/grandpa/src/communication/tests.rs index 9e243ed1..ccd6f80f 100644 --- a/bizinikiwi/client/consensus/grandpa/src/communication/tests.rs +++ b/bizinikiwi/client/consensus/grandpa/src/communication/tests.rs @@ -389,7 +389,8 @@ fn good_commit_leads_to_relay() { for (i, key) in private.iter().enumerate() { precommits.push(precommit.clone()); - let signature = pezsp_consensus_grandpa::AuthoritySignature::from(key.sign(&payload[..])); + let signature = + pezsp_consensus_grandpa::AuthoritySignature::from(key.sign(&payload[..])); auth_data.push((signature, public[i].0.clone())) } @@ -540,7 +541,8 @@ fn bad_commit_leads_to_report() { for (i, key) in private.iter().enumerate() { precommits.push(precommit.clone()); - let signature = pezsp_consensus_grandpa::AuthoritySignature::from(key.sign(&payload[..])); + let signature = + pezsp_consensus_grandpa::AuthoritySignature::from(key.sign(&payload[..])); auth_data.push((signature, public[i].0.clone())) } diff --git a/bizinikiwi/client/consensus/grandpa/src/environment.rs b/bizinikiwi/client/consensus/grandpa/src/environment.rs index 82a3d0e0..27172a28 100644 --- a/bizinikiwi/client/consensus/grandpa/src/environment.rs +++ b/bizinikiwi/client/consensus/grandpa/src/environment.rs @@ -400,7 +400,10 @@ impl Metrics { ) -> Result { Ok(Self { finality_grandpa_round: register( - Gauge::new("bizinikiwi_finality_grandpa_round", "Highest completed GRANDPA round.")?, + Gauge::new( + "bizinikiwi_finality_grandpa_round", + "Highest completed GRANDPA round.", + )?, registry, )?, finality_grandpa_prevotes: register( diff --git a/bizinikiwi/client/consensus/grandpa/src/finality_proof.rs b/bizinikiwi/client/consensus/grandpa/src/finality_proof.rs index 91c3977e..6b7c26ce 100644 --- a/bizinikiwi/client/consensus/grandpa/src/finality_proof.rs +++ b/bizinikiwi/client/consensus/grandpa/src/finality_proof.rs @@ -260,6 +260,11 @@ where mod tests { use super::*; use crate::{authorities::AuthoritySetChanges, BlockNumberOps, ClientError, SetId}; + use bizinikiwi_test_runtime_client::{ + runtime::{Block, Header, H256}, + Backend as TestBackend, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, + TestClient, TestClientBuilder, TestClientBuilderExt, + }; use futures::executor::block_on; use pezsc_block_builder::BlockBuilderBuilder; use pezsc_client_api::{apply_aux, LockImportRun}; @@ -267,11 +272,6 @@ mod tests { use pezsp_consensus_grandpa::GRANDPA_ENGINE_ID as ID; use pezsp_core::crypto::UncheckedFrom; use pezsp_keyring::Ed25519Keyring; - use bizinikiwi_test_runtime_client::{ - runtime::{Block, Header, H256}, - Backend as TestBackend, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, - TestClient, TestClientBuilder, TestClientBuilderExt, - }; /// Check GRANDPA proof-of-finality for the given block. /// diff --git a/bizinikiwi/client/consensus/grandpa/src/import.rs b/bizinikiwi/client/consensus/grandpa/src/import.rs index addb606e..dcb5d07b 100644 --- a/bizinikiwi/client/consensus/grandpa/src/import.rs +++ b/bizinikiwi/client/consensus/grandpa/src/import.rs @@ -32,7 +32,9 @@ use pezsc_utils::mpsc::TracingUnboundedSender; use pezsp_api::{Core, RuntimeApiInfo}; use pezsp_blockchain::BlockStatus; use pezsp_consensus::{BlockOrigin, Error as ConsensusError, SelectChain}; -use pezsp_consensus_grandpa::{ConsensusLog, GrandpaApi, ScheduledChange, SetId, GRANDPA_ENGINE_ID}; +use pezsp_consensus_grandpa::{ + ConsensusLog, GrandpaApi, ScheduledChange, SetId, GRANDPA_ENGINE_ID, +}; use pezsp_runtime::{ generic::OpaqueDigestItemId, traits::{Block as BlockT, Header as HeaderT, NumberFor, Zero}, diff --git a/bizinikiwi/client/consensus/grandpa/src/lib.rs b/bizinikiwi/client/consensus/grandpa/src/lib.rs index 7a7d0f6d..17df35a9 100644 --- a/bizinikiwi/client/consensus/grandpa/src/lib.rs +++ b/bizinikiwi/client/consensus/grandpa/src/lib.rs @@ -60,7 +60,6 @@ use codec::Decode; use futures::{prelude::*, StreamExt}; use log::{debug, error, info}; use parking_lot::RwLock; -use prometheus_endpoint::{PrometheusError, Registry}; use pezsc_client_api::{ backend::{AuxStore, Backend}, utils::is_descendent_of, @@ -73,7 +72,9 @@ use pezsc_transaction_pool_api::OffchainTransactionPoolFactory; use pezsc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver}; use pezsp_api::ProvideRuntimeApi; use pezsp_application_crypto::AppCrypto; -use pezsp_blockchain::{Error as ClientError, HeaderBackend, HeaderMetadata, Result as ClientResult}; +use pezsp_blockchain::{ + Error as ClientError, HeaderBackend, HeaderMetadata, Result as ClientResult, +}; use pezsp_consensus::SelectChain; use pezsp_consensus_grandpa::{ AuthorityList, AuthoritySignature, SetId, CLIENT_LOG_TARGET as LOG_TARGET, @@ -84,6 +85,7 @@ use pezsp_runtime::{ generic::BlockId, traits::{Block as BlockT, NumberFor, Zero}, }; +use prometheus_endpoint::{PrometheusError, Registry}; pub use finality_grandpa::BlockNumberOps; use finality_grandpa::{voter, voter_set::VoterSet, Error as GrandpaError}; @@ -682,8 +684,8 @@ pub struct GrandpaParams { /// The Network instance. /// /// It is assumed that this network will feed us Grandpa notifications. When using the - /// `pezsc_network` crate, it is assumed that the Grandpa notifications protocol has been passed - /// to the configuration of the networking. See [`grandpa_peers_set_config`]. + /// `pezsc_network` crate, it is assumed that the Grandpa notifications protocol has been + /// passed to the configuration of the networking. See [`grandpa_peers_set_config`]. pub network: N, /// Event stream for syncing-related events. pub sync: S, diff --git a/bizinikiwi/client/consensus/grandpa/src/observer.rs b/bizinikiwi/client/consensus/grandpa/src/observer.rs index 32aa511c..a50477a6 100644 --- a/bizinikiwi/client/consensus/grandpa/src/observer.rs +++ b/bizinikiwi/client/consensus/grandpa/src/observer.rs @@ -410,10 +410,10 @@ mod tests { communication::tests::{make_test_network, Event}, }; use assert_matches::assert_matches; + use bizinikiwi_test_runtime_client::{TestClientBuilder, TestClientBuilderExt}; use pezsc_network_types::PeerId; use pezsc_utils::mpsc::tracing_unbounded; use pezsp_blockchain::HeaderBackend as _; - use bizinikiwi_test_runtime_client::{TestClientBuilder, TestClientBuilderExt}; use futures::executor; diff --git a/bizinikiwi/client/consensus/grandpa/src/tests.rs b/bizinikiwi/client/consensus/grandpa/src/tests.rs index acc81e0d..d401921a 100644 --- a/bizinikiwi/client/consensus/grandpa/src/tests.rs +++ b/bizinikiwi/client/consensus/grandpa/src/tests.rs @@ -21,6 +21,7 @@ use super::*; use assert_matches::assert_matches; use async_trait::async_trait; +use bizinikiwi_test_runtime_client::{runtime::BlockNumber, BlockBuilderExt}; use environment::HasVoted; use futures_timer::Delay; use parking_lot::{Mutex, RwLock}; @@ -49,7 +50,6 @@ use pezsp_runtime::{ Justifications, }; use std::{collections::HashSet, pin::Pin}; -use bizinikiwi_test_runtime_client::{runtime::BlockNumber, BlockBuilderExt}; use tokio::runtime::Handle; use authorities::AuthoritySet; diff --git a/bizinikiwi/client/consensus/grandpa/src/until_imported.rs b/bizinikiwi/client/consensus/grandpa/src/until_imported.rs index 451fb83b..af9d33d8 100644 --- a/bizinikiwi/client/consensus/grandpa/src/until_imported.rs +++ b/bizinikiwi/client/consensus/grandpa/src/until_imported.rs @@ -35,11 +35,11 @@ use futures::{ use futures_timer::Delay; use log::{debug, warn}; use parking_lot::Mutex; -use prometheus_endpoint::{register, Gauge, PrometheusError, Registry, U64}; use pezsc_client_api::{BlockImportNotification, ImportNotifications}; use pezsc_utils::mpsc::TracingUnboundedReceiver; use pezsp_consensus_grandpa::AuthorityId; use pezsp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor}; +use prometheus_endpoint::{register, Gauge, PrometheusError, Registry, U64}; use std::{ collections::{HashMap, VecDeque}, @@ -562,6 +562,7 @@ pub(crate) type UntilGlobalMessageBlocksImported(&header) - .map_err(|err| format!("{}", err))?; + let slot_number = + *pezsc_consensus_aura::find_pre_digest::(&header) + .map_err(|err| format!("{}", err))?; Ok(slot_number) })?; diff --git a/bizinikiwi/client/consensus/manual-seal/src/lib.rs b/bizinikiwi/client/consensus/manual-seal/src/lib.rs index fb808401..e310ca87 100644 --- a/bizinikiwi/client/consensus/manual-seal/src/lib.rs +++ b/bizinikiwi/client/consensus/manual-seal/src/lib.rs @@ -21,7 +21,6 @@ use futures::prelude::*; use futures_timer::Delay; -use prometheus_endpoint::Registry; use pezsc_client_api::{ backend::{Backend as ClientBackend, Finalizer}, client::BlockchainEvents, @@ -35,6 +34,7 @@ use pezsp_consensus::{Environment, Proposer, SelectChain}; use pezsp_core::traits::SpawnNamed; use pezsp_inherents::CreateInherentDataProviders; use pezsp_runtime::{traits::Block as BlockT, ConsensusEngineId}; +use prometheus_endpoint::Registry; use std::{marker::PhantomData, sync::Arc, time::Duration}; mod error; @@ -346,16 +346,18 @@ pub async fn run_delayed_finalize( #[cfg(test)] mod tests { use super::*; - use pezsc_basic_authorship::ProposerFactory; - use pezsc_consensus::ImportedAux; - use pezsc_transaction_pool::{BasicPool, FullChainApi, Options, RevalidationType}; - use pezsc_transaction_pool_api::{MaintainedTransactionPool, TransactionPool, TransactionSource}; - use pezsp_inherents::InherentData; - use pezsp_runtime::generic::{Digest, DigestItem}; use bizinikiwi_test_runtime_client::{ DefaultTestClientBuilderExt, Sr25519Keyring::*, TestClientBuilder, TestClientBuilderExt, }; use bizinikiwi_test_runtime_transaction_pool::{uxt, TestApi}; + use pezsc_basic_authorship::ProposerFactory; + use pezsc_consensus::ImportedAux; + use pezsc_transaction_pool::{BasicPool, FullChainApi, Options, RevalidationType}; + use pezsc_transaction_pool_api::{ + MaintainedTransactionPool, TransactionPool, TransactionSource, + }; + use pezsp_inherents::InherentData; + use pezsp_runtime::generic::{Digest, DigestItem}; fn api() -> Arc { Arc::new(TestApi::empty()) diff --git a/bizinikiwi/client/consensus/manual-seal/src/rpc.rs b/bizinikiwi/client/consensus/manual-seal/src/rpc.rs index ec51a58d..5b4e93e9 100644 --- a/bizinikiwi/client/consensus/manual-seal/src/rpc.rs +++ b/bizinikiwi/client/consensus/manual-seal/src/rpc.rs @@ -25,8 +25,8 @@ use futures::{ }; use jsonrpsee::{core::async_trait, proc_macros::rpc}; use pezsc_consensus::ImportedAux; -use serde::{Deserialize, Serialize}; use pezsp_runtime::EncodedJustification; +use serde::{Deserialize, Serialize}; /// Sender passed to the authorship task to report errors or successes. pub type Sender = Option>>; diff --git a/bizinikiwi/client/consensus/manual-seal/src/seal_block.rs b/bizinikiwi/client/consensus/manual-seal/src/seal_block.rs index b2ad3c40..bf0717fb 100644 --- a/bizinikiwi/client/consensus/manual-seal/src/seal_block.rs +++ b/bizinikiwi/client/consensus/manual-seal/src/seal_block.rs @@ -20,7 +20,9 @@ use crate::{rpc, ConsensusDataProvider, CreatedBlock, Error}; use futures::prelude::*; -use pezsc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy, ImportResult, StateAction}; +use pezsc_consensus::{ + BlockImport, BlockImportParams, ForkChoiceStrategy, ImportResult, StateAction, +}; use pezsc_transaction_pool_api::TransactionPool; use pezsp_api::ProvideRuntimeApi; use pezsp_blockchain::HeaderBackend; diff --git a/bizinikiwi/client/consensus/pow/src/lib.rs b/bizinikiwi/client/consensus/pow/src/lib.rs index 5df227dc..30d81464 100644 --- a/bizinikiwi/client/consensus/pow/src/lib.rs +++ b/bizinikiwi/client/consensus/pow/src/lib.rs @@ -47,7 +47,6 @@ use crate::worker::UntilImportedOrTimeout; use codec::{Decode, Encode}; use futures::{Future, StreamExt}; use log::*; -use prometheus_endpoint::Registry; use pezsc_client_api::{self, backend::AuxStore, BlockOf, BlockchainEvents}; use pezsc_consensus::{ BasicQueue, BlockCheckParams, BlockImport, BlockImportParams, BoxBlockImport, @@ -63,6 +62,7 @@ use pezsp_runtime::{ generic::{BlockId, Digest, DigestItem}, traits::{Block as BlockT, Header as HeaderT}, }; +use prometheus_endpoint::Registry; use std::{cmp::Ordering, marker::PhantomData, sync::Arc, time::Duration}; const LOG_TARGET: &str = "pow"; diff --git a/bizinikiwi/client/consensus/slots/src/aux_schema.rs b/bizinikiwi/client/consensus/slots/src/aux_schema.rs index 69444e2b..89b534bb 100644 --- a/bizinikiwi/client/consensus/slots/src/aux_schema.rs +++ b/bizinikiwi/client/consensus/slots/src/aux_schema.rs @@ -134,9 +134,9 @@ where #[cfg(test)] mod test { + use bizinikiwi_test_runtime_client; use pezsp_core::{hash::H256, sr25519, Pair}; use pezsp_runtime::testing::{Digest as DigestTest, Header as HeaderTest}; - use bizinikiwi_test_runtime_client; use super::{check_equivocation, MAX_SLOT_CAPACITY, PRUNING_BOUND}; diff --git a/bizinikiwi/client/consensus/slots/src/lib.rs b/bizinikiwi/client/consensus/slots/src/lib.rs index 047292cd..9e5b2449 100644 --- a/bizinikiwi/client/consensus/slots/src/lib.rs +++ b/bizinikiwi/client/consensus/slots/src/lib.rs @@ -36,7 +36,9 @@ use futures::{future::Either, Future, TryFutureExt}; use futures_timer::Delay; use log::{debug, info, warn}; use pezsc_consensus::{BlockImport, JustificationSyncLink}; -use pezsc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_INFO, CONSENSUS_WARN}; +use pezsc_telemetry::{ + telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_INFO, CONSENSUS_WARN, +}; use pezsp_arithmetic::traits::BaseArithmetic; use pezsp_consensus::{Proposal, Proposer, SelectChain, SyncOracle}; use pezsp_consensus_slots::{Slot, SlotDuration}; @@ -469,7 +471,8 @@ impl + Send + Sync, B: BlockT> /// Slot specific extension that the inherent data provider needs to implement. pub trait InherentDataProviderExt { - /// The current slot that will be found in the [`InherentData`](`pezsp_inherents::InherentData`). + /// The current slot that will be found in the + /// [`InherentData`](`pezsp_inherents::InherentData`). fn slot(&self) -> Slot; } @@ -809,9 +812,9 @@ impl BackoffAuthoringBlocksStrategy for () { #[cfg(test)] mod test { use super::*; + use bizinikiwi_test_runtime_client::runtime::{Block, Header}; use pezsp_runtime::traits::NumberFor; use std::time::{Duration, Instant}; - use bizinikiwi_test_runtime_client::runtime::{Block, Header}; const SLOT_DURATION: Duration = Duration::from_millis(6000); diff --git a/bizinikiwi/client/db/benches/state_access.rs b/bizinikiwi/client/db/benches/state_access.rs index bea5d13f..c7e00f76 100644 --- a/bizinikiwi/client/db/benches/state_access.rs +++ b/bizinikiwi/client/db/benches/state_access.rs @@ -17,7 +17,6 @@ // along with this program. If not, see . use criterion::{criterion_group, criterion_main, BatchSize, Criterion}; -use rand::{distributions::Uniform, rngs::StdRng, Rng, SeedableRng}; use pezsc_client_api::{ Backend as _, BlockImportOperation, NewBlockState, StateBackend, TrieCacheContext, }; @@ -27,6 +26,7 @@ use pezsp_runtime::{ testing::{Block as RawBlock, Header, MockCallU64, TestXt}, StateVersion, Storage, }; +use rand::{distributions::Uniform, rngs::StdRng, Rng, SeedableRng}; use tempfile::TempDir; pub(crate) type Block = RawBlock>; diff --git a/bizinikiwi/client/db/src/lib.rs b/bizinikiwi/client/db/src/lib.rs index 4e7b5b5c..26e04813 100644 --- a/bizinikiwi/client/db/src/lib.rs +++ b/bizinikiwi/client/db/src/lib.rs @@ -615,7 +615,9 @@ impl BlockchainDb { match Decode::decode(&mut &body[..]) { Ok(body) => return Ok(Some(body)), Err(err) => - return Err(pezsp_blockchain::Error::Backend(format!("Error decoding body: {err}"))), + return Err(pezsp_blockchain::Error::Backend(format!( + "Error decoding body: {err}" + ))), } } @@ -1186,7 +1188,9 @@ impl Backend { /// /// Should only be needed for benchmarking. #[cfg(feature = "runtime-benchmarks")] - pub fn expose_db(&self) -> (Arc>, pezsp_database::ColumnId) { + pub fn expose_db( + &self, + ) -> (Arc>, pezsp_database::ColumnId) { (self.storage.db.clone(), columns::STATE) } @@ -1323,7 +1327,8 @@ impl Backend { // Cannot find tree route with empty DB or when imported a detached block. if meta.best_hash != Default::default() && parent_exists { - let tree_route = pezsp_blockchain::tree_route(&self.blockchain, meta.best_hash, route_to)?; + let tree_route = + pezsp_blockchain::tree_route(&self.blockchain, meta.best_hash, route_to)?; // uncanonicalize: check safety violations and ensure the numbers no longer // point to these block hashes in the key mapping. @@ -1888,7 +1893,9 @@ impl Backend { LastCanonicalized::NotCanonicalizing => false, }; - if requires_canonicalization && pezsc_client_api::Backend::have_state_at(self, f_hash, f_num) { + if requires_canonicalization && + pezsc_client_api::Backend::have_state_at(self, f_hash, f_num) + { let commit = self.storage.state_db.canonicalize_block(&f_hash).map_err( pezsp_blockchain::Error::from_state_db::< pezsc_state_db::Error, @@ -2460,7 +2467,9 @@ impl pezsc_client_api::backend::Backend for Backend let best_hash = self.blockchain.info().best_hash; if best_hash == hash { - return Err(pezsp_blockchain::Error::Backend(format!("Can't remove best block {hash:?}"))); + return Err(pezsp_blockchain::Error::Backend(format!( + "Can't remove best block {hash:?}" + ))); } let hdr = self.blockchain.header_metadata(hash)?; @@ -2974,7 +2983,10 @@ pub(crate) mod tests { backend .storage .db - .get(columns::STATE, &pezsp_trie::prefixed_key::(&key, EMPTY_PREFIX)) + .get( + columns::STATE, + &pezsp_trie::prefixed_key::(&key, EMPTY_PREFIX) + ) .unwrap(), &b"hello"[..] ); @@ -3011,7 +3023,10 @@ pub(crate) mod tests { backend .storage .db - .get(columns::STATE, &pezsp_trie::prefixed_key::(&key, EMPTY_PREFIX)) + .get( + columns::STATE, + &pezsp_trie::prefixed_key::(&key, EMPTY_PREFIX) + ) .unwrap(), &b"hello"[..] ); @@ -4261,7 +4276,10 @@ pub(crate) mod tests { }; let mut op = backend.begin_operation().unwrap(); op.set_block_data(header, None, None, None, NewBlockState::Best).unwrap(); - assert!(matches!(backend.commit_operation(op), Err(pezsp_blockchain::Error::SetHeadTooOld))); + assert!(matches!( + backend.commit_operation(op), + Err(pezsp_blockchain::Error::SetHeadTooOld) + )); // Insert 2 as best again. let header = backend.blockchain().header(block2).unwrap().unwrap(); diff --git a/bizinikiwi/client/db/src/pinned_blocks_cache.rs b/bizinikiwi/client/db/src/pinned_blocks_cache.rs index e045d36a..6397b1ea 100644 --- a/bizinikiwi/client/db/src/pinned_blocks_cache.rs +++ b/bizinikiwi/client/db/src/pinned_blocks_cache.rs @@ -16,8 +16,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use schnellru::{Limiter, LruMap}; use pezsp_runtime::{traits::Block as BlockT, Justifications}; +use schnellru::{Limiter, LruMap}; const LOG_TARGET: &str = "db::pin"; const PINNING_CACHE_SIZE: usize = 2048; diff --git a/bizinikiwi/client/db/src/utils.rs b/bizinikiwi/client/db/src/utils.rs index 47bc8686..35df49dd 100644 --- a/bizinikiwi/client/db/src/utils.rs +++ b/bizinikiwi/client/db/src/utils.rs @@ -478,7 +478,10 @@ pub fn read_header( pub fn read_meta( db: &dyn Database, col_header: u32, -) -> Result::Header as HeaderT>::Number, Block::Hash>, pezsp_blockchain::Error> +) -> Result< + Meta<<::Header as HeaderT>::Number, Block::Hash>, + pezsp_blockchain::Error, +> where Block: BlockT, { @@ -569,8 +572,10 @@ pub fn read_genesis_hash( match db.get(COLUMN_META, meta_keys::GENESIS_HASH) { Some(h) => match Decode::decode(&mut &h[..]) { Ok(h) => Ok(Some(h)), - Err(err) => - Err(pezsp_blockchain::Error::Backend(format!("Error decoding genesis hash: {}", err))), + Err(err) => Err(pezsp_blockchain::Error::Backend(format!( + "Error decoding genesis hash: {}", + err + ))), }, None => Ok(None), } diff --git a/bizinikiwi/client/executor/benches/bench.rs b/bizinikiwi/client/executor/benches/bench.rs index e28cc891..2a95fd96 100644 --- a/bizinikiwi/client/executor/benches/bench.rs +++ b/bizinikiwi/client/executor/benches/bench.rs @@ -88,7 +88,9 @@ fn initialize( >(&path, config) } } else { - pezsc_executor_wasmtime::create_runtime::(blob, config) + pezsc_executor_wasmtime::create_runtime::( + blob, config, + ) } .map(|runtime| -> Box { Box::new(runtime) }) }, diff --git a/bizinikiwi/client/executor/polkavm/src/lib.rs b/bizinikiwi/client/executor/polkavm/src/lib.rs index f3858f01..50a65f1d 100644 --- a/bizinikiwi/client/executor/polkavm/src/lib.rs +++ b/bizinikiwi/client/executor/polkavm/src/lib.rs @@ -16,7 +16,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use polkavm::{CallError, Caller, Reg}; use pezsc_executor_common::{ error::{Error, WasmError}, wasm_runtime::{AllocationStats, WasmInstance, WasmModule}, @@ -24,6 +23,7 @@ use pezsc_executor_common::{ use pezsp_wasm_interface::{ Function, FunctionContext, HostFunctions, Pointer, Value, ValueType, WordSize, }; +use polkavm::{CallError, Caller, Reg}; #[repr(transparent)] pub struct InstancePre(polkavm::InstancePre<(), String>); @@ -140,7 +140,11 @@ impl<'r, 'a> FunctionContext for Context<'r, 'a> { .map(|_| ()) } - fn write_memory(&mut self, address: Pointer, data: &[u8]) -> pezsp_wasm_interface::Result<()> { + fn write_memory( + &mut self, + address: Pointer, + data: &[u8], + ) -> pezsp_wasm_interface::Result<()> { self.0 .instance .write_memory(u32::from(address), data) diff --git a/bizinikiwi/client/executor/src/executor.rs b/bizinikiwi/client/executor/src/executor.rs index 2e3cd335..a6509851 100644 --- a/bizinikiwi/client/executor/src/executor.rs +++ b/bizinikiwi/client/executor/src/executor.rs @@ -573,8 +573,9 @@ pub struct NativeElseWasmExecutor { /// Native runtime version info. native_version: NativeVersion, /// Fallback wasm executor. - wasm: - WasmExecutor>, + wasm: WasmExecutor< + ExtendedHostFunctions, + >, use_native: bool, } @@ -745,7 +746,9 @@ impl Clone for NativeElseWasmExecutor { } #[allow(deprecated)] -impl pezsp_core::traits::ReadRuntimeVersion for NativeElseWasmExecutor { +impl pezsp_core::traits::ReadRuntimeVersion + for NativeElseWasmExecutor +{ fn read_runtime_version( &self, wasm_code: &[u8], diff --git a/bizinikiwi/client/executor/src/wasm_runtime.rs b/bizinikiwi/client/executor/src/wasm_runtime.rs index 39e99852..de5df3d0 100644 --- a/bizinikiwi/client/executor/src/wasm_runtime.rs +++ b/bizinikiwi/client/executor/src/wasm_runtime.rs @@ -29,10 +29,10 @@ use pezsc_executor_common::{ runtime_blob::RuntimeBlob, wasm_runtime::{HeapAllocStrategy, WasmInstance, WasmModule}, }; -use schnellru::{ByLength, LruMap}; use pezsp_core::traits::{Externalities, FetchRuntimeCode, RuntimeCode}; use pezsp_version::RuntimeVersion; use pezsp_wasm_interface::HostFunctions; +use schnellru::{ByLength, LruMap}; use std::{ panic::AssertUnwindSafe, @@ -53,7 +53,8 @@ pub enum WasmExecutionMethod { impl Default for WasmExecutionMethod { fn default() -> Self { Self::Compiled { - instantiation_strategy: pezsc_executor_wasmtime::InstantiationStrategy::PoolingCopyOnWrite, + instantiation_strategy: + pezsc_executor_wasmtime::InstantiationStrategy::PoolingCopyOnWrite, } } } @@ -445,11 +446,11 @@ mod tests { use super::*; use alloc::borrow::Cow; + use bizinikiwi_test_runtime::Block; use codec::Encode; use pezsp_api::{Core, RuntimeApiInfo}; use pezsp_version::{create_apis_vec, RuntimeVersion}; use pezsp_wasm_interface::HostFunctions; - use bizinikiwi_test_runtime::Block; #[derive(Encode)] pub struct OldRuntimeVersion { diff --git a/bizinikiwi/client/executor/wasmtime/src/host.rs b/bizinikiwi/client/executor/wasmtime/src/host.rs index 2fb92590..0d42cb6c 100644 --- a/bizinikiwi/client/executor/wasmtime/src/host.rs +++ b/bizinikiwi/client/executor/wasmtime/src/host.rs @@ -82,7 +82,11 @@ impl<'a> pezsp_wasm_interface::FunctionContext for HostContext<'a> { util::read_memory_into(&self.caller, address, dest).map_err(|e| e.to_string()) } - fn write_memory(&mut self, address: Pointer, data: &[u8]) -> pezsp_wasm_interface::Result<()> { + fn write_memory( + &mut self, + address: Pointer, + data: &[u8], + ) -> pezsp_wasm_interface::Result<()> { util::write_memory_from(&mut self.caller, address, data).map_err(|e| e.to_string()) } diff --git a/bizinikiwi/client/executor/wasmtime/src/lib.rs b/bizinikiwi/client/executor/wasmtime/src/lib.rs index 2eb65419..4c75ec97 100644 --- a/bizinikiwi/client/executor/wasmtime/src/lib.rs +++ b/bizinikiwi/client/executor/wasmtime/src/lib.rs @@ -37,12 +37,12 @@ mod util; #[cfg(test)] mod tests; +pub use pezsc_executor_common::{ + runtime_blob::RuntimeBlob, + wasm_runtime::{HeapAllocStrategy, WasmModule}, +}; pub use runtime::{ create_runtime, create_runtime_from_artifact, create_runtime_from_artifact_bytes, prepare_runtime_artifact, Config, DeterministicStackLimit, InstantiationStrategy, Semantics, WasmtimeRuntime, }; -pub use pezsc_executor_common::{ - runtime_blob::RuntimeBlob, - wasm_runtime::{HeapAllocStrategy, WasmModule}, -}; diff --git a/bizinikiwi/client/merkle-mountain-range/src/aux_schema.rs b/bizinikiwi/client/merkle-mountain-range/src/aux_schema.rs index 65c897ad..6e7e60bb 100644 --- a/bizinikiwi/client/merkle-mountain-range/src/aux_schema.rs +++ b/bizinikiwi/client/merkle-mountain-range/src/aux_schema.rs @@ -101,11 +101,13 @@ where #[cfg(test)] pub(crate) mod tests { use super::*; - use crate::test_utils::{run_test_with_pezmmr_gadget_pre_post_using_client, MmrBlock, MockClient}; + use crate::test_utils::{ + run_test_with_pezmmr_gadget_pre_post_using_client, MmrBlock, MockClient, + }; + use bizinikiwi_test_runtime_client::{runtime::Block, Backend}; use parking_lot::Mutex; use pezsp_runtime::generic::BlockId; use std::{sync::Arc, time::Duration}; - use bizinikiwi_test_runtime_client::{runtime::Block, Backend}; #[test] fn should_load_persistent_sanity_checks() { diff --git a/bizinikiwi/client/merkle-mountain-range/src/test_utils.rs b/bizinikiwi/client/merkle-mountain-range/src/test_utils.rs index 924ed33e..5f792226 100644 --- a/bizinikiwi/client/merkle-mountain-range/src/test_utils.rs +++ b/bizinikiwi/client/merkle-mountain-range/src/test_utils.rs @@ -19,6 +19,11 @@ //! Test utilities. use crate::MmrGadget; +use bizinikiwi_test_runtime_client::{ + runtime::{Block, BlockNumber, Hash, Header}, + Backend, BlockBuilderExt, Client, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, + TestClientBuilder, TestClientBuilderExt, +}; use parking_lot::Mutex; use pezsc_block_builder::BlockBuilderBuilder; use pezsc_client_api::{ @@ -40,11 +45,6 @@ use pezsp_runtime::{ traits::{Block as BlockT, Header as HeaderT}, }; use std::{future::Future, sync::Arc, time::Duration}; -use bizinikiwi_test_runtime_client::{ - runtime::{Block, BlockNumber, Hash, Header}, - Backend, BlockBuilderExt, Client, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, - TestClientBuilder, TestClientBuilderExt, -}; use tokio::runtime::Runtime; type MmrHash = H256; diff --git a/bizinikiwi/client/mixnet/src/lib.rs b/bizinikiwi/client/mixnet/src/lib.rs index 5fc78606..49fc9dd6 100644 --- a/bizinikiwi/client/mixnet/src/lib.rs +++ b/bizinikiwi/client/mixnet/src/lib.rs @@ -36,7 +36,7 @@ mod sync_with_runtime; pub use self::{ api::{Api, ApiBackend}, - config::{Config, CoreConfig, BizinikiwiConfig}, + config::{BizinikiwiConfig, Config, CoreConfig}, error::{Error, RemoteErr}, protocol::{peers_set_config, protocol_name}, run::run, diff --git a/bizinikiwi/client/mixnet/src/run.rs b/bizinikiwi/client/mixnet/src/run.rs index 2fb29eee..9a5654e3 100644 --- a/bizinikiwi/client/mixnet/src/run.rs +++ b/bizinikiwi/client/mixnet/src/run.rs @@ -20,7 +20,7 @@ use super::{ api::ApiBackend, - config::{Config, BizinikiwiConfig}, + config::{BizinikiwiConfig, Config}, error::RemoteErr, extrinsic_queue::ExtrinsicQueue, maybe_inf_delay::MaybeInfDelay, diff --git a/bizinikiwi/client/network-gossip/src/bridge.rs b/bizinikiwi/client/network-gossip/src/bridge.rs index a1d26725..8ad8f0b1 100644 --- a/bizinikiwi/client/network-gossip/src/bridge.rs +++ b/bizinikiwi/client/network-gossip/src/bridge.rs @@ -33,9 +33,9 @@ use futures::{ prelude::*, }; use log::trace; -use prometheus_endpoint::Registry; use pezsc_network_types::PeerId; use pezsp_runtime::traits::Block as BlockT; +use prometheus_endpoint::Registry; use std::{ collections::{HashMap, VecDeque}, pin::Pin, @@ -347,13 +347,13 @@ impl futures::future::FusedFuture for GossipEngine { mod tests { use super::*; use crate::{ValidationResult, ValidatorContext}; + use bizinikiwi_test_runtime_client::runtime::Block; use codec::{DecodeAll, Encode}; use futures::{ channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender}, executor::{block_on, block_on_stream}, future::poll_fn, }; - use quickcheck::{Arbitrary, Gen, QuickCheck}; use pezsc_network::{ config::MultiaddrWithPeerId, service::traits::{Direction, MessageSink, NotificationEvent}, @@ -366,11 +366,11 @@ mod tests { testing::H256, traits::{Block as BlockT, NumberFor}, }; + use quickcheck::{Arbitrary, Gen, QuickCheck}; use std::{ collections::HashSet, sync::{Arc, Mutex}, }; - use bizinikiwi_test_runtime_client::runtime::Block; #[derive(Clone, Default)] struct TestNetwork {} diff --git a/bizinikiwi/client/network-gossip/src/state_machine.rs b/bizinikiwi/client/network-gossip/src/state_machine.rs index 72c1c045..4ed53073 100644 --- a/bizinikiwi/client/network-gossip/src/state_machine.rs +++ b/bizinikiwi/client/network-gossip/src/state_machine.rs @@ -22,10 +22,10 @@ use ahash::AHashSet; use pezsc_network_types::PeerId; use schnellru::{ByLength, LruMap}; -use prometheus_endpoint::{register, Counter, PrometheusError, Registry, U64}; use pezsc_network::{types::ProtocolName, NotificationService}; use pezsc_network_common::role::ObservedRole; use pezsp_runtime::traits::{Block as BlockT, Hash, HashingFor}; +use prometheus_endpoint::{register, Counter, PrometheusError, Registry, U64}; use std::{collections::HashMap, iter, sync::Arc, time, time::Instant}; // FIXME: Add additional spam/DoS attack protection: https://github.com/pezkuwichain/kurdistan-sdk/issues/7 diff --git a/bizinikiwi/client/network/benches/notifications_protocol.rs b/bizinikiwi/client/network/benches/notifications_protocol.rs index bc797c48..b1420672 100644 --- a/bizinikiwi/client/network/benches/notifications_protocol.rs +++ b/bizinikiwi/client/network/benches/notifications_protocol.rs @@ -16,6 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +use bizinikiwi_test_runtime_client::runtime; use criterion::{ criterion_group, criterion_main, AxisScale, BenchmarkId, Criterion, PlotConfiguration, Throughput, @@ -33,7 +34,6 @@ use pezsc_network_common::{sync::message::BlockAnnouncesHandshake, ExHashT}; use pezsp_core::H256; use pezsp_runtime::traits::{Block as BlockT, Zero}; use std::{sync::Arc, time::Duration}; -use bizinikiwi_test_runtime_client::runtime; use tokio::{sync::Mutex, task::JoinHandle}; const NUMBER_OF_NOTIFICATIONS: usize = 100; diff --git a/bizinikiwi/client/network/benches/request_response_protocol.rs b/bizinikiwi/client/network/benches/request_response_protocol.rs index 6c9b47ac..42ac62db 100644 --- a/bizinikiwi/client/network/benches/request_response_protocol.rs +++ b/bizinikiwi/client/network/benches/request_response_protocol.rs @@ -16,6 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +use bizinikiwi_test_runtime_client::runtime; use criterion::{ criterion_group, criterion_main, AxisScale, BenchmarkId, Criterion, PlotConfiguration, Throughput, @@ -33,7 +34,6 @@ use pezsc_network_common::{sync::message::BlockAnnouncesHandshake, ExHashT}; use pezsp_core::H256; use pezsp_runtime::traits::{Block as BlockT, Zero}; use std::{sync::Arc, time::Duration}; -use bizinikiwi_test_runtime_client::runtime; use tokio::{sync::Mutex, task::JoinHandle}; const MAX_SIZE: u64 = 2u64.pow(30); diff --git a/bizinikiwi/client/network/light/src/light_client_requests/handler.rs b/bizinikiwi/client/network/light/src/light_client_requests/handler.rs index 2c74fb8d..83f29c31 100644 --- a/bizinikiwi/client/network/light/src/light_client_requests/handler.rs +++ b/bizinikiwi/client/network/light/src/light_client_requests/handler.rs @@ -26,7 +26,6 @@ use crate::schema; use codec::{self, Decode, Encode}; use futures::prelude::*; use log::{debug, trace}; -use prost::Message; use pezsc_client_api::{BlockBackend, ProofProvider}; use pezsc_network::{ config::ProtocolId, @@ -39,6 +38,7 @@ use pezsp_core::{ storage::{ChildInfo, ChildType, PrefixedStorageKey}, }; use pezsp_runtime::traits::Block; +use prost::Message; use std::{marker::PhantomData, sync::Arc}; const LOG_TARGET: &str = "light-client-request-handler"; diff --git a/bizinikiwi/client/network/src/bitswap/mod.rs b/bizinikiwi/client/network/src/bitswap/mod.rs index c3c75e62..0b65811c 100644 --- a/bizinikiwi/client/network/src/bitswap/mod.rs +++ b/bizinikiwi/client/network/src/bitswap/mod.rs @@ -30,14 +30,14 @@ use crate::{ use cid::{self, Version}; use futures::StreamExt; use log::{debug, error, trace}; -use prost::Message; use pezsc_client_api::BlockBackend; use pezsc_network_types::PeerId; +use pezsp_runtime::traits::Block as BlockT; +use prost::Message; use schema::bitswap::{ message::{wantlist::WantType, Block as MessageBlock, BlockPresence, BlockPresenceType}, Message as BitswapMessage, }; -use pezsp_runtime::traits::Block as BlockT; use std::{io, sync::Arc, time::Duration}; use unsigned_varint::encode as varint_encode; @@ -292,16 +292,16 @@ pub enum BitswapError { #[cfg(test)] mod tests { use super::*; + use bizinikiwi_test_runtime::ExtrinsicBuilder; + use bizinikiwi_test_runtime_client::{self, prelude::*, TestClientBuilder}; use futures::channel::oneshot; use pezsc_block_builder::BlockBuilderBuilder; + use pezsp_consensus::BlockOrigin; + use pezsp_runtime::codec::Encode; use schema::bitswap::{ message::{wantlist::Entry, Wantlist}, Message as BitswapMessage, }; - use pezsp_consensus::BlockOrigin; - use pezsp_runtime::codec::Encode; - use bizinikiwi_test_runtime::ExtrinsicBuilder; - use bizinikiwi_test_runtime_client::{self, prelude::*, TestClientBuilder}; #[tokio::test] async fn undecodable_message() { @@ -503,7 +503,9 @@ mod tests { 0x70, cid::multihash::Multihash::wrap( u64::from(cid::multihash::Code::Blake2b256), - &pezsp_crypto_hashing::blake2_256(&ext.encode()[pattern_index..]), + &pezsp_crypto_hashing::blake2_256( + &ext.encode()[pattern_index..], + ), ) .unwrap(), ) diff --git a/bizinikiwi/client/network/src/discovery.rs b/bizinikiwi/client/network/src/discovery.rs index 12eead53..6511dbec 100644 --- a/bizinikiwi/client/network/src/discovery.rs +++ b/bizinikiwi/client/network/src/discovery.rs @@ -21,7 +21,8 @@ //! The `DiscoveryBehaviour` struct implements the `NetworkBehaviour` trait of libp2p and is //! responsible for discovering other nodes that are part of the network. //! -//! Bizinikiwi uses the following mechanisms in order to discover nodes that are part of the network: +//! Bizinikiwi uses the following mechanisms in order to discover nodes that are part of the +//! network: //! //! - Bootstrap nodes. These are hard-coded node identities and addresses passed in the constructor //! of the `DiscoveryBehaviour`. You can also call `add_known_address` later to add an entry. diff --git a/bizinikiwi/client/network/src/lib.rs b/bizinikiwi/client/network/src/lib.rs index 704c5120..fe6ef8d6 100644 --- a/bizinikiwi/client/network/src/lib.rs +++ b/bizinikiwi/client/network/src/lib.rs @@ -265,8 +265,6 @@ pub mod utils; pub use crate::litep2p::Litep2pNetworkBackend; pub use event::{DhtEvent, Event}; -#[doc(inline)] -pub use request_responses::{Config, IfDisconnected, RequestFailure}; pub use pezsc_network_common::{ role::{ObservedRole, Roles}, types::ReputationChange, @@ -275,6 +273,8 @@ pub use pezsc_network_types::{ multiaddr::{self, Multiaddr}, PeerId, }; +#[doc(inline)] +pub use request_responses::{Config, IfDisconnected, RequestFailure}; pub use service::{ metrics::NotificationMetrics, signature::Signature, diff --git a/bizinikiwi/client/network/src/litep2p/mod.rs b/bizinikiwi/client/network/src/litep2p/mod.rs index 1af3249e..529741a7 100644 --- a/bizinikiwi/client/network/src/litep2p/mod.rs +++ b/bizinikiwi/client/network/src/litep2p/mod.rs @@ -71,8 +71,8 @@ use litep2p::{ }, Litep2p, Litep2pEvent, ProtocolName as Litep2pProtocolName, }; -use prometheus_endpoint::Registry; use pezsc_network_types::kad::{Key as RecordKey, PeerRecord, Record as P2PRecord}; +use prometheus_endpoint::Registry; use pezsc_client_api::BlockBackend; use pezsc_network_common::{role::Roles, ExHashT}; diff --git a/bizinikiwi/client/network/src/litep2p/peerstore.rs b/bizinikiwi/client/network/src/litep2p/peerstore.rs index 0179f906..16e128cf 100644 --- a/bizinikiwi/client/network/src/litep2p/peerstore.rs +++ b/bizinikiwi/client/network/src/litep2p/peerstore.rs @@ -466,11 +466,17 @@ mod tests { // Report 2 peers with a negative reputation. handle.report_peer( peer_a, - pezsc_network_common::types::ReputationChange { value: i32::MIN, reason: "test".into() }, + pezsc_network_common::types::ReputationChange { + value: i32::MIN, + reason: "test".into(), + }, ); handle.report_peer( peer_b, - pezsc_network_common::types::ReputationChange { value: i32::MIN, reason: "test".into() }, + pezsc_network_common::types::ReputationChange { + value: i32::MIN, + reason: "test".into(), + }, ); // Advance time to propagate peers. diff --git a/bizinikiwi/client/network/src/peer_store.rs b/bizinikiwi/client/network/src/peer_store.rs index cd6f2a1d..8b077fb6 100644 --- a/bizinikiwi/client/network/src/peer_store.rs +++ b/bizinikiwi/client/network/src/peer_store.rs @@ -25,8 +25,8 @@ use libp2p::PeerId; use log::trace; use parking_lot::Mutex; use partial_sort::PartialSort; -use prometheus_endpoint::Registry; use pezsc_network_common::{role::ObservedRole, types::ReputationChange}; +use prometheus_endpoint::Registry; use std::{ cmp::{Ord, Ordering, PartialOrd}, collections::{hash_map::Entry, HashMap, HashSet}, @@ -558,11 +558,17 @@ mod tests { // Report 2 peers with a negative reputation. handle.report_peer( peer_a, - pezsc_network_common::types::ReputationChange { value: i32::MIN, reason: "test".into() }, + pezsc_network_common::types::ReputationChange { + value: i32::MIN, + reason: "test".into(), + }, ); handle.report_peer( peer_b, - pezsc_network_common::types::ReputationChange { value: i32::MIN, reason: "test".into() }, + pezsc_network_common::types::ReputationChange { + value: i32::MIN, + reason: "test".into(), + }, ); // Advance time to propagate banned peers. diff --git a/bizinikiwi/client/network/src/protocol/notifications/behaviour.rs b/bizinikiwi/client/network/src/protocol/notifications/behaviour.rs index a06b6d90..7057f8c7 100644 --- a/bizinikiwi/client/network/src/protocol/notifications/behaviour.rs +++ b/bizinikiwi/client/network/src/protocol/notifications/behaviour.rs @@ -45,8 +45,8 @@ use libp2p::{ }; use log::{debug, error, trace, warn}; use parking_lot::RwLock; -use rand::distributions::{Distribution as _, Uniform}; use pezsc_utils::mpsc::TracingUnboundedReceiver; +use rand::distributions::{Distribution as _, Uniform}; use smallvec::SmallVec; use tokio::sync::oneshot::error::RecvError; use tokio_stream::StreamMap; diff --git a/bizinikiwi/client/network/src/protocol/notifications/service/mod.rs b/bizinikiwi/client/network/src/protocol/notifications/service/mod.rs index c7424720..e8a4748f 100644 --- a/bizinikiwi/client/network/src/protocol/notifications/service/mod.rs +++ b/bizinikiwi/client/network/src/protocol/notifications/service/mod.rs @@ -232,7 +232,11 @@ impl NotificationService for NotificationHandle { } /// Send synchronous `notification` to `peer`. - fn send_sync_notification(&mut self, peer: &pezsc_network_types::PeerId, notification: Vec) { + fn send_sync_notification( + &mut self, + peer: &pezsc_network_types::PeerId, + notification: Vec, + ) { if let Some(info) = self.peers.get(&((*peer).into())) { metrics::register_notification_sent( info.sink.metrics(), diff --git a/bizinikiwi/client/network/src/protocol_controller.rs b/bizinikiwi/client/network/src/protocol_controller.rs index b99eace7..1df7c34c 100644 --- a/bizinikiwi/client/network/src/protocol_controller.rs +++ b/bizinikiwi/client/network/src/protocol_controller.rs @@ -813,7 +813,11 @@ impl ProtocolController { .map(From::from) .collect::>() .union( - &self.nodes.keys().map(From::from).collect::>(), + &self + .nodes + .keys() + .map(From::from) + .collect::>(), ) .cloned() .collect(); diff --git a/bizinikiwi/client/network/src/service.rs b/bizinikiwi/client/network/src/service.rs index 707dbcfb..170f307b 100644 --- a/bizinikiwi/client/network/src/service.rs +++ b/bizinikiwi/client/network/src/service.rs @@ -75,8 +75,8 @@ use libp2p::{ use log::{debug, error, info, trace, warn}; use metrics::{Histogram, MetricSources, Metrics}; use parking_lot::Mutex; -use prometheus_endpoint::Registry; use pezsc_network_types::kad::{Key as KademliaKey, Record}; +use prometheus_endpoint::Registry; use pezsc_client_api::BlockBackend; use pezsc_network_common::{ diff --git a/bizinikiwi/client/network/statement/src/lib.rs b/bizinikiwi/client/network/statement/src/lib.rs index 84838ac1..6dd41b05 100644 --- a/bizinikiwi/client/network/statement/src/lib.rs +++ b/bizinikiwi/client/network/statement/src/lib.rs @@ -30,9 +30,6 @@ use crate::config::*; use codec::{Decode, Encode}; use futures::{channel::oneshot, prelude::*, stream::FuturesUnordered, FutureExt}; -use prometheus_endpoint::{ - prometheus, register, Counter, Gauge, Histogram, HistogramOpts, PrometheusError, Registry, U64, -}; use pezsc_network::{ config::{NonReservedPeerMode, SetConfig}, error, multiaddr, @@ -52,6 +49,9 @@ use pezsp_runtime::traits::Block as BlockT; use pezsp_statement_store::{ Hash, NetworkPriority, Statement, StatementSource, StatementStore, SubmitResult, }; +use prometheus_endpoint::{ + prometheus, register, Counter, Gauge, Histogram, HistogramOpts, PrometheusError, Registry, U64, +}; use std::{ collections::{hash_map::Entry, HashMap, HashSet}, iter, @@ -797,7 +797,9 @@ mod tests { unimplemented!() } - async fn next_event(&mut self) -> Option { + async fn next_event( + &mut self, + ) -> Option { None } @@ -819,7 +821,8 @@ mod tests { #[derive(Clone)] struct TestStatementStore { - statements: Arc>>, + statements: + Arc>>, recent_statements: Arc>>, } diff --git a/bizinikiwi/client/network/sync/src/block_announce_validator.rs b/bizinikiwi/client/network/sync/src/block_announce_validator.rs index 50da0ddc..f2f0da8e 100644 --- a/bizinikiwi/client/network/sync/src/block_announce_validator.rs +++ b/bizinikiwi/client/network/sync/src/block_announce_validator.rs @@ -309,9 +309,9 @@ impl FusedStream for BlockAnnounceValidator { mod tests { use super::*; use crate::block_announce_validator::AllocateSlotForBlockAnnounceValidation; + use bizinikiwi_test_runtime_client::runtime::Block; use pezsc_network_types::PeerId; use pezsp_consensus::block_validation::DefaultBlockAnnounceValidator; - use bizinikiwi_test_runtime_client::runtime::Block; #[test] fn allocate_one_validation_slot() { diff --git a/bizinikiwi/client/network/sync/src/justification_requests.rs b/bizinikiwi/client/network/sync/src/justification_requests.rs index ce93df4e..31efe881 100644 --- a/bizinikiwi/client/network/sync/src/justification_requests.rs +++ b/bizinikiwi/client/network/sync/src/justification_requests.rs @@ -24,14 +24,14 @@ use crate::{ strategy::chain_sync::{PeerSync, PeerSyncState}, LOG_TARGET, }; -use pez_fork_tree::ForkTree; use log::{debug, trace, warn}; -use prometheus_endpoint::{ - prometheus::core::GenericGauge, register, GaugeVec, Opts, PrometheusError, Registry, U64, -}; +use pez_fork_tree::ForkTree; use pezsc_network_types::PeerId; use pezsp_blockchain::Error as ClientError; use pezsp_runtime::traits::{Block as BlockT, NumberFor, Zero}; +use prometheus_endpoint::{ + prometheus::core::GenericGauge, register, GaugeVec, Opts, PrometheusError, Registry, U64, +}; use std::{ collections::{HashMap, HashSet, VecDeque}, time::{Duration, Instant}, @@ -441,9 +441,9 @@ impl<'a, B: BlockT> Matcher<'a, B> { mod tests { use super::*; use crate::strategy::chain_sync::PeerSync; - use quickcheck::{Arbitrary, Gen, QuickCheck}; use pezsp_blockchain::Error as ClientError; use pezsp_test_primitives::{Block, BlockNumber, Hash}; + use quickcheck::{Arbitrary, Gen, QuickCheck}; use std::collections::{HashMap, HashSet}; #[test] diff --git a/bizinikiwi/client/network/sync/src/state_request_handler.rs b/bizinikiwi/client/network/sync/src/state_request_handler.rs index 274f17e3..3ea41dcf 100644 --- a/bizinikiwi/client/network/sync/src/state_request_handler.rs +++ b/bizinikiwi/client/network/sync/src/state_request_handler.rs @@ -26,8 +26,8 @@ use crate::{ use codec::{Decode, Encode}; use futures::{channel::oneshot, stream::StreamExt}; use log::{debug, trace}; -use prost::Message; use pezsc_network_types::PeerId; +use prost::Message; use schnellru::{ByLength, LruMap}; use pezsc_client_api::{BlockBackend, ProofProvider}; diff --git a/bizinikiwi/client/network/sync/src/strategy/chain_sync.rs b/bizinikiwi/client/network/sync/src/strategy/chain_sync.rs index 9529f924..c3f30105 100644 --- a/bizinikiwi/client/network/sync/src/strategy/chain_sync.rs +++ b/bizinikiwi/client/network/sync/src/strategy/chain_sync.rs @@ -46,8 +46,6 @@ use crate::{ use futures::{channel::oneshot, FutureExt}; use log::{debug, error, info, trace, warn}; -use prometheus_endpoint::{register, Gauge, PrometheusError, Registry, U64}; -use prost::Message; use pezsc_client_api::{blockchain::BlockGap, BlockBackend, ProofProvider}; use pezsc_consensus::{BlockImportError, BlockImportStatus, IncomingBlock}; use pezsc_network::{IfDisconnected, ProtocolName}; @@ -64,6 +62,8 @@ use pezsp_runtime::{ }, EncodedJustification, Justifications, }; +use prometheus_endpoint::{register, Gauge, PrometheusError, Registry, U64}; +use prost::Message; use std::{ any::Any, @@ -142,8 +142,10 @@ impl Metrics { fn register(r: &Registry) -> Result { Ok(Self { queued_blocks: { - let g = - Gauge::new("bizinikiwi_sync_queued_blocks", "Number of blocks in import queue")?; + let g = Gauge::new( + "bizinikiwi_sync_queued_blocks", + "Number of blocks in import queue", + )?; register(g, r)? }, fork_targets: { diff --git a/bizinikiwi/client/network/sync/src/strategy/chain_sync/test.rs b/bizinikiwi/client/network/sync/src/strategy/chain_sync/test.rs index fa2681e4..667beb8f 100644 --- a/bizinikiwi/client/network/sync/src/strategy/chain_sync/test.rs +++ b/bizinikiwi/client/network/sync/src/strategy/chain_sync/test.rs @@ -23,17 +23,17 @@ use crate::{ block_relay_protocol::BlockResponseError, mock::MockBlockDownloader, service::network::NetworkServiceProvider, }; +use bizinikiwi_test_runtime_client::{ + runtime::{Block, Hash, Header}, + BlockBuilderExt, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, TestClient, + TestClientBuilder, TestClientBuilderExt, +}; use futures::{channel::oneshot::Canceled, executor::block_on}; use pezsc_block_builder::BlockBuilderBuilder; use pezsc_network::RequestFailure; use pezsc_network_common::sync::message::{BlockAnnounce, BlockData, BlockState, FromBlock}; use pezsp_blockchain::HeaderBackend; use std::sync::Mutex; -use bizinikiwi_test_runtime_client::{ - runtime::{Block, Hash, Header}, - BlockBuilderExt, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, TestClient, - TestClientBuilder, TestClientBuilderExt, -}; #[derive(Debug)] struct ProxyBlockDownloader { diff --git a/bizinikiwi/client/network/sync/src/strategy/pezkuwi.rs b/bizinikiwi/client/network/sync/src/strategy/pezkuwi.rs index f7ee9f72..0ea5bb2a 100644 --- a/bizinikiwi/client/network/sync/src/strategy/pezkuwi.rs +++ b/bizinikiwi/client/network/sync/src/strategy/pezkuwi.rs @@ -33,7 +33,6 @@ use crate::{ LOG_TARGET, }; use log::{debug, error, info, warn}; -use prometheus_endpoint::Registry; use pezsc_client_api::{BlockBackend, ProofProvider}; use pezsc_consensus::{BlockImportError, BlockImportStatus}; use pezsc_network::ProtocolName; @@ -41,6 +40,7 @@ use pezsc_network_common::sync::{message::BlockAnnounce, SyncMode}; use pezsc_network_types::PeerId; use pezsp_blockchain::{Error as ClientError, HeaderBackend, HeaderMetadata}; use pezsp_runtime::traits::{Block as BlockT, Header, NumberFor}; +use prometheus_endpoint::Registry; use std::{any::Any, collections::HashMap, sync::Arc}; /// Corresponding `ChainSync` mode. diff --git a/bizinikiwi/client/network/sync/src/strategy/state.rs b/bizinikiwi/client/network/sync/src/strategy/state.rs index 2dd830f4..398beb67 100644 --- a/bizinikiwi/client/network/sync/src/strategy/state.rs +++ b/bizinikiwi/client/network/sync/src/strategy/state.rs @@ -31,7 +31,6 @@ use crate::{ }; use futures::{channel::oneshot, FutureExt}; use log::{debug, error, trace}; -use prost::Message; use pezsc_client_api::ProofProvider; use pezsc_consensus::{BlockImportError, BlockImportStatus, IncomingBlock}; use pezsc_network::{IfDisconnected, ProtocolName}; @@ -42,6 +41,7 @@ use pezsp_runtime::{ traits::{Block as BlockT, Header, NumberFor}, Justifications, SaturatedConversion, }; +use prost::Message; use std::{any::Any, collections::HashMap, sync::Arc}; mod rep { @@ -398,16 +398,16 @@ mod test { service::network::NetworkServiceProvider, strategy::state_sync::{ImportResult, StateSyncProgress, StateSyncProvider}, }; + use bizinikiwi_test_runtime_client::{ + runtime::{Block, Hash}, + BlockBuilderExt, DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, + }; use codec::Decode; use pezsc_block_builder::BlockBuilderBuilder; use pezsc_client_api::KeyValueStates; use pezsc_consensus::{ImportedAux, ImportedState}; use pezsp_core::H256; use pezsp_runtime::traits::Zero; - use bizinikiwi_test_runtime_client::{ - runtime::{Block, Hash}, - BlockBuilderExt, DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, - }; mockall::mock! { pub StateSync {} diff --git a/bizinikiwi/client/network/sync/src/strategy/state_sync.rs b/bizinikiwi/client/network/sync/src/strategy/state_sync.rs index 53788637..2d52cc11 100644 --- a/bizinikiwi/client/network/sync/src/strategy/state_sync.rs +++ b/bizinikiwi/client/network/sync/src/strategy/state_sync.rs @@ -26,12 +26,12 @@ use codec::{Decode, Encode}; use log::debug; use pezsc_client_api::{CompactProof, KeyValueStates, ProofProvider}; use pezsc_consensus::ImportedState; -use smallvec::SmallVec; use pezsp_core::storage::well_known_keys; use pezsp_runtime::{ traits::{Block as BlockT, Header, NumberFor}, Justifications, }; +use smallvec::SmallVec; use std::{collections::HashMap, fmt, sync::Arc}; /// Generic state sync provider. Used for mocking in tests. diff --git a/bizinikiwi/client/network/sync/src/strategy/warp.rs b/bizinikiwi/client/network/sync/src/strategy/warp.rs index 78f492fc..35449c2b 100644 --- a/bizinikiwi/client/network/sync/src/strategy/warp.rs +++ b/bizinikiwi/client/network/sync/src/strategy/warp.rs @@ -772,16 +772,16 @@ where mod test { use super::*; use crate::{mock::MockBlockDownloader, service::network::NetworkServiceProvider}; + use bizinikiwi_test_runtime_client::{ + runtime::{Block, Hash}, + BlockBuilderExt, DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, + }; use pezsc_block_builder::BlockBuilderBuilder; use pezsp_blockchain::{BlockStatus, Error as BlockchainError, HeaderBackend, Info}; use pezsp_consensus_grandpa::{AuthorityList, SetId, GRANDPA_ENGINE_ID}; use pezsp_core::H256; use pezsp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor}; use std::{io::ErrorKind, sync::Arc}; - use bizinikiwi_test_runtime_client::{ - runtime::{Block, Hash}, - BlockBuilderExt, DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, - }; mockall::mock! { pub Client {} diff --git a/bizinikiwi/client/network/test/src/block_import.rs b/bizinikiwi/client/network/test/src/block_import.rs index 9a43fd87..c457b82f 100644 --- a/bizinikiwi/client/network/test/src/block_import.rs +++ b/bizinikiwi/client/network/test/src/block_import.rs @@ -19,17 +19,17 @@ //! Testing block import logic. use super::*; +use bizinikiwi_test_runtime_client::{ + self, + prelude::*, + runtime::{Block, Hash}, +}; use futures::executor::block_on; use pezsc_consensus::{ import_single_block, BasicQueue, BlockImportError, BlockImportStatus, ImportedAux, IncomingBlock, }; use pezsp_consensus::BlockOrigin; -use bizinikiwi_test_runtime_client::{ - self, - prelude::*, - runtime::{Block, Hash}, -}; fn prepare_good_block() -> (TestClient, Hash, u64, PeerId, IncomingBlock) { let client = bizinikiwi_test_runtime_client::new(); diff --git a/bizinikiwi/client/network/test/src/conformance/setup.rs b/bizinikiwi/client/network/test/src/conformance/setup.rs index ed899186..057cfaee 100644 --- a/bizinikiwi/client/network/test/src/conformance/setup.rs +++ b/bizinikiwi/client/network/test/src/conformance/setup.rs @@ -27,10 +27,10 @@ use pezsc_network::{ Roles, }; +use bizinikiwi_test_runtime_client::runtime; use pezsc_network_common::sync::message::BlockAnnouncesHandshake; use pezsp_runtime::traits::Zero; use std::{sync::Arc, time::Duration}; -use bizinikiwi_test_runtime_client::runtime; use tokio::sync::Mutex; /// High level network backend (litep2p or libp2p) test client. diff --git a/bizinikiwi/client/network/test/src/fuzz.rs b/bizinikiwi/client/network/test/src/fuzz.rs index 135dc251..2530ea1f 100644 --- a/bizinikiwi/client/network/test/src/fuzz.rs +++ b/bizinikiwi/client/network/test/src/fuzz.rs @@ -21,16 +21,16 @@ use futures::prelude::*; use libp2p::PeerId; -use rand::{ - distributions::{Distribution, Uniform, WeightedIndex}, - seq::IteratorRandom, -}; use pezsc_network::{ peer_store::{PeerStore, PeerStoreProvider}, protocol_controller::{IncomingIndex, Message, ProtoSetConfig, ProtocolController, SetId}, ReputationChange, }; use pezsc_utils::mpsc::tracing_unbounded; +use rand::{ + distributions::{Distribution, Uniform, WeightedIndex}, + seq::IteratorRandom, +}; use std::{ collections::{HashMap, HashSet}, sync::Arc, diff --git a/bizinikiwi/client/network/test/src/lib.rs b/bizinikiwi/client/network/test/src/lib.rs index f8d4052d..493c44df 100644 --- a/bizinikiwi/client/network/test/src/lib.rs +++ b/bizinikiwi/client/network/test/src/lib.rs @@ -36,6 +36,11 @@ use std::{ time::Duration, }; +use bizinikiwi_test_runtime_client::Sr25519Keyring; +pub use bizinikiwi_test_runtime_client::{ + runtime::{Block, ExtrinsicBuilder, Hash, Header, Transfer}, + TestClient, TestClientBuilder, TestClientBuilderExt, +}; use futures::{future::BoxFuture, pin_mut, prelude::*}; use libp2p::PeerId; use log::trace; @@ -93,11 +98,6 @@ use pezsp_runtime::{ traits::{Block as BlockT, Header as HeaderT, NumberFor, Zero}, Justification, Justifications, }; -use bizinikiwi_test_runtime_client::Sr25519Keyring; -pub use bizinikiwi_test_runtime_client::{ - runtime::{Block, ExtrinsicBuilder, Hash, Header, Transfer}, - TestClient, TestClientBuilder, TestClientBuilderExt, -}; use tokio::time::timeout; /// A Verifier that accepts all blocks and passes them on with the configured diff --git a/bizinikiwi/client/network/test/src/service.rs b/bizinikiwi/client/network/test/src/service.rs index 67d18413..0b2c5ee8 100644 --- a/bizinikiwi/client/network/test/src/service.rs +++ b/bizinikiwi/client/network/test/src/service.rs @@ -18,6 +18,10 @@ use futures::prelude::*; +use bizinikiwi_test_runtime_client::{ + runtime::{Block as TestBlock, Hash as TestHash}, + TestClientBuilder, TestClientBuilderExt as _, +}; use pezsc_consensus::{ImportQueue, Link}; use pezsc_network::{ config::{self, FullNetworkConfiguration, MultiaddrWithPeerId, ProtocolId, TransportConfig}, @@ -38,10 +42,6 @@ use pezsc_network_sync::{ }; use pezsp_blockchain::HeaderBackend; use pezsp_runtime::traits::{Block as BlockT, Zero}; -use bizinikiwi_test_runtime_client::{ - runtime::{Block as TestBlock, Hash as TestHash}, - TestClientBuilder, TestClientBuilderExt as _, -}; use std::{sync::Arc, time::Duration}; diff --git a/bizinikiwi/client/network/test/src/sync.rs b/bizinikiwi/client/network/test/src/sync.rs index 37a746a6..b8fdc851 100644 --- a/bizinikiwi/client/network/test/src/sync.rs +++ b/bizinikiwi/client/network/test/src/sync.rs @@ -17,10 +17,10 @@ // along with this program. If not, see . use super::*; +use bizinikiwi_test_runtime::Header; use futures::Future; use pezsp_consensus::{block_validation::Validation, BlockOrigin}; use pezsp_runtime::Justifications; -use bizinikiwi_test_runtime::Header; async fn test_ancestor_search_when_common_is(n: usize) { pezsp_tracing::try_init_simple(); @@ -1303,9 +1303,9 @@ async fn warp_sync_to_target_block() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn syncs_huge_blocks() { + use bizinikiwi_test_runtime_client::BlockBuilderExt; use pezsp_core::storage::well_known_keys::HEAP_PAGES; use pezsp_runtime::codec::Encode; - use bizinikiwi_test_runtime_client::BlockBuilderExt; pezsp_tracing::try_init_simple(); let mut net = TestNet::new(2); diff --git a/bizinikiwi/client/network/transactions/src/lib.rs b/bizinikiwi/client/network/transactions/src/lib.rs index a0cf7f9a..678ecfaf 100644 --- a/bizinikiwi/client/network/transactions/src/lib.rs +++ b/bizinikiwi/client/network/transactions/src/lib.rs @@ -32,7 +32,6 @@ use codec::{Decode, Encode}; use futures::{prelude::*, stream::FuturesUnordered}; use log::{debug, trace, warn}; -use prometheus_endpoint::{register, Counter, PrometheusError, Registry, U64}; use pezsc_network::{ config::{NonReservedPeerMode, ProtocolId, SetConfig}, error, multiaddr, @@ -50,6 +49,7 @@ use pezsc_network_sync::{SyncEvent, SyncEventStream}; use pezsc_network_types::PeerId; use pezsc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use pezsp_runtime::traits::Block as BlockT; +use prometheus_endpoint::{register, Counter, PrometheusError, Registry, U64}; use std::{ collections::{hash_map::Entry, HashMap}, diff --git a/bizinikiwi/client/offchain/src/api/http.rs b/bizinikiwi/client/offchain/src/api/http.rs index 8b139c17..166e8c77 100644 --- a/bizinikiwi/client/offchain/src/api/http.rs +++ b/bizinikiwi/client/offchain/src/api/http.rs @@ -779,7 +779,9 @@ mod tests { use core::convert::Infallible; use futures::future; use http_body_util::BodyExt; - use pezsp_core::offchain::{Duration, Externalities, HttpError, HttpRequestId, HttpRequestStatus}; + use pezsp_core::offchain::{ + Duration, Externalities, HttpError, HttpRequestId, HttpRequestStatus, + }; use std::sync::LazyLock; // Using LazyLock to avoid spawning lots of different SharedClients, diff --git a/bizinikiwi/client/offchain/src/lib.rs b/bizinikiwi/client/offchain/src/lib.rs index 429153ea..39cbe5f9 100644 --- a/bizinikiwi/client/offchain/src/lib.rs +++ b/bizinikiwi/client/offchain/src/lib.rs @@ -326,6 +326,12 @@ where #[cfg(test)] mod tests { use super::*; + use bizinikiwi_test_runtime_client::{ + runtime::{ + bizinikiwi_test_pallet::pezpallet::Call as PalletCall, ExtrinsicBuilder, RuntimeCall, + }, + ClientBlockImportExt, DefaultTestClientBuilderExt, TestClientBuilderExt, + }; use futures::executor::block_on; use pezsc_block_builder::BlockBuilderBuilder; use pezsc_client_api::Backend as _; @@ -338,12 +344,6 @@ mod tests { use pezsp_consensus::BlockOrigin; use pezsp_runtime::traits::Block as BlockT; use std::{collections::HashSet, sync::Arc}; - use bizinikiwi_test_runtime_client::{ - runtime::{ - bizinikiwi_test_pallet::pezpallet::Call as PalletCall, ExtrinsicBuilder, RuntimeCall, - }, - ClientBlockImportExt, DefaultTestClientBuilderExt, TestClientBuilderExt, - }; struct TestNetwork(); diff --git a/bizinikiwi/client/rpc-api/src/author/hash.rs b/bizinikiwi/client/rpc-api/src/author/hash.rs index e4935df7..293769c6 100644 --- a/bizinikiwi/client/rpc-api/src/author/hash.rs +++ b/bizinikiwi/client/rpc-api/src/author/hash.rs @@ -18,8 +18,8 @@ //! Extrinsic helpers for author RPC module. -use serde::{Deserialize, Serialize}; use pezsp_core::Bytes; +use serde::{Deserialize, Serialize}; /// RPC Extrinsic or hash /// diff --git a/bizinikiwi/client/rpc-api/src/mixnet/error.rs b/bizinikiwi/client/rpc-api/src/mixnet/error.rs index f64baeef..ad64506b 100644 --- a/bizinikiwi/client/rpc-api/src/mixnet/error.rs +++ b/bizinikiwi/client/rpc-api/src/mixnet/error.rs @@ -36,8 +36,9 @@ impl From for ErrorObjectOwned { pezsc_mixnet::Error::Post(PostErr::TooManyFragments) => BASE_ERROR + 101, pezsc_mixnet::Error::Post(PostErr::SessionMixnodesNotKnown(_)) => BASE_ERROR + 102, pezsc_mixnet::Error::Post(PostErr::SessionDisabled(_)) => BASE_ERROR + 103, - pezsc_mixnet::Error::Post(PostErr::Topology(TopologyErr::NoConnectedGatewayMixnodes)) => - BASE_ERROR + 151, + pezsc_mixnet::Error::Post(PostErr::Topology( + TopologyErr::NoConnectedGatewayMixnodes, + )) => BASE_ERROR + 151, pezsc_mixnet::Error::Post(PostErr::Topology(_)) => BASE_ERROR + 150, pezsc_mixnet::Error::Post(_) => BASE_ERROR + 100, pezsc_mixnet::Error::Remote(RemoteErr::Other(_)) => BASE_ERROR + 200, diff --git a/bizinikiwi/client/rpc-api/src/policy.rs b/bizinikiwi/client/rpc-api/src/policy.rs index d04a0998..89979330 100644 --- a/bizinikiwi/client/rpc-api/src/policy.rs +++ b/bizinikiwi/client/rpc-api/src/policy.rs @@ -28,7 +28,8 @@ pub fn check_if_safe(ext: &jsonrpsee::Extensions) -> Result<(), UnsafeRpcError> match ext.get::().map(|deny_unsafe| deny_unsafe.check_if_safe()) { Some(Ok(())) => Ok(()), Some(Err(e)) => Err(e), - None => unreachable!("DenyUnsafe extension is always set by the bizinikiwi rpc server; qed"), + None => + unreachable!("DenyUnsafe extension is always set by the bizinikiwi rpc server; qed"), } } diff --git a/bizinikiwi/client/rpc-api/src/state/helpers.rs b/bizinikiwi/client/rpc-api/src/state/helpers.rs index 4f988b9a..cf9f10fb 100644 --- a/bizinikiwi/client/rpc-api/src/state/helpers.rs +++ b/bizinikiwi/client/rpc-api/src/state/helpers.rs @@ -18,8 +18,8 @@ //! Bizinikiwi state API helpers. -use serde::{Deserialize, Serialize}; use pezsp_core::Bytes; +use serde::{Deserialize, Serialize}; /// ReadProof struct returned by the RPC #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/bizinikiwi/client/rpc-spec-v2/src/archive/tests.rs b/bizinikiwi/client/rpc-spec-v2/src/archive/tests.rs index e836be5a..c4758dc4 100644 --- a/bizinikiwi/client/rpc-spec-v2/src/archive/tests.rs +++ b/bizinikiwi/client/rpc-spec-v2/src/archive/tests.rs @@ -35,6 +35,10 @@ use jsonrpsee::{ rpc_params, MethodsError as Error, RpcModule, }; +use bizinikiwi_test_runtime::Transfer; +use bizinikiwi_test_runtime_client::{ + prelude::*, runtime, Backend, BlockBuilderExt, Client, ClientBlockImportExt, +}; use pezsc_block_builder::BlockBuilderBuilder; use pezsc_client_api::ChildInfo; use pezsc_rpc::testing::TokioTestExecutor; @@ -46,10 +50,6 @@ use pezsp_runtime::{ SaturatedConversion, }; use std::{collections::HashMap, sync::Arc}; -use bizinikiwi_test_runtime::Transfer; -use bizinikiwi_test_runtime_client::{ - prelude::*, runtime, Backend, BlockBuilderExt, Client, ClientBlockImportExt, -}; const CHAIN_GENESIS: [u8; 32] = [0; 32]; const INVALID_HASH: [u8; 32] = [1; 32]; diff --git a/bizinikiwi/client/rpc-spec-v2/src/chain_head/chain_head_follow.rs b/bizinikiwi/client/rpc-spec-v2/src/chain_head/chain_head_follow.rs index e26831e9..74dea3cf 100644 --- a/bizinikiwi/client/rpc-spec-v2/src/chain_head/chain_head_follow.rs +++ b/bizinikiwi/client/rpc-spec-v2/src/chain_head/chain_head_follow.rs @@ -36,7 +36,6 @@ use pezsc_client_api::{ StaleBlock, }; use pezsc_rpc::utils::Subscription; -use schnellru::{ByLength, LruMap}; use pezsp_api::CallApiAt; use pezsp_blockchain::{ Backend as BlockChainBackend, Error as BlockChainError, HeaderBackend, HeaderMetadata, Info, @@ -45,6 +44,7 @@ use pezsp_runtime::{ traits::{Block as BlockT, Header as HeaderT, NumberFor}, SaturatedConversion, Saturating, }; +use schnellru::{ByLength, LruMap}; use std::{ collections::{HashSet, VecDeque}, sync::Arc, @@ -579,8 +579,11 @@ where } if let Some(best_block_hash) = self.current_best_block { - let ancestor = - pezsp_blockchain::lowest_common_ancestor(&*self.client, *hash, best_block_hash)?; + let ancestor = pezsp_blockchain::lowest_common_ancestor( + &*self.client, + *hash, + best_block_hash, + )?; // If we end up here and the `best_block` is a descendent of the finalized block // (last block in the list), it means that there were skipped notifications. diff --git a/bizinikiwi/client/rpc-spec-v2/src/chain_head/event.rs b/bizinikiwi/client/rpc-spec-v2/src/chain_head/event.rs index b7932d4b..fae4e695 100644 --- a/bizinikiwi/client/rpc-spec-v2/src/chain_head/event.rs +++ b/bizinikiwi/client/rpc-spec-v2/src/chain_head/event.rs @@ -18,9 +18,9 @@ //! The chain head's event returned as json compatible object. -use serde::{ser::SerializeStruct, Deserialize, Serialize, Serializer}; use pezsp_api::ApiError; use pezsp_version::RuntimeVersion; +use serde::{ser::SerializeStruct, Deserialize, Serialize, Serializer}; use std::collections::BTreeMap; use crate::common::events::StorageResult; diff --git a/bizinikiwi/client/rpc-spec-v2/src/chain_head/subscription/inner.rs b/bizinikiwi/client/rpc-spec-v2/src/chain_head/subscription/inner.rs index 969e4b51..3e907be2 100644 --- a/bizinikiwi/client/rpc-spec-v2/src/chain_head/subscription/inner.rs +++ b/bizinikiwi/client/rpc-spec-v2/src/chain_head/subscription/inner.rs @@ -782,16 +782,16 @@ impl> SubscriptionsInner { #[cfg(test)] mod tests { use super::*; - use jsonrpsee::ConnectionId; - use pezsc_block_builder::BlockBuilderBuilder; - use pezsc_service::client::new_with_backend; - use pezsp_consensus::BlockOrigin; - use pezsp_core::{testing::TaskExecutor, H256}; use bizinikiwi_test_runtime_client::{ prelude::*, runtime::{Block, RuntimeApi}, Client, ClientBlockImportExt, GenesisInit, }; + use jsonrpsee::ConnectionId; + use pezsc_block_builder::BlockBuilderBuilder; + use pezsc_service::client::new_with_backend; + use pezsp_consensus::BlockOrigin; + use pezsp_core::{testing::TaskExecutor, H256}; /// Maximum number of ongoing operations per subscription ID. const MAX_OPERATIONS_PER_SUB: usize = 16; diff --git a/bizinikiwi/client/rpc-spec-v2/src/chain_head/test_utils.rs b/bizinikiwi/client/rpc-spec-v2/src/chain_head/test_utils.rs index 784c838a..d342ad8f 100644 --- a/bizinikiwi/client/rpc-spec-v2/src/chain_head/test_utils.rs +++ b/bizinikiwi/client/rpc-spec-v2/src/chain_head/test_utils.rs @@ -18,6 +18,7 @@ //! Test utilities. +use bizinikiwi_test_runtime::{Block, Hash, Header, H256}; use parking_lot::Mutex; use pezsc_client_api::{ execution_extensions::ExecutionExtensions, BlockBackend, BlockImportNotification, @@ -36,7 +37,6 @@ use pezsp_runtime::{ }; use pezsp_version::RuntimeVersion; use std::sync::Arc; -use bizinikiwi_test_runtime::{Block, Hash, Header, H256}; /// A mock client used for testing. pub struct ChainHeadMockClient { @@ -272,15 +272,24 @@ impl> BlockBackend self.client.block(hash) } - fn block_status(&self, hash: Block::Hash) -> pezsp_blockchain::Result { + fn block_status( + &self, + hash: Block::Hash, + ) -> pezsp_blockchain::Result { self.client.block_status(hash) } - fn justifications(&self, hash: Block::Hash) -> pezsp_blockchain::Result> { + fn justifications( + &self, + hash: Block::Hash, + ) -> pezsp_blockchain::Result> { self.client.justifications(hash) } - fn block_hash(&self, number: NumberFor) -> pezsp_blockchain::Result> { + fn block_hash( + &self, + number: NumberFor, + ) -> pezsp_blockchain::Result> { self.client.block_hash(number) } @@ -292,7 +301,10 @@ impl> BlockBackend self.client.has_indexed_transaction(hash) } - fn block_indexed_body(&self, hash: Block::Hash) -> pezsp_blockchain::Result>>> { + fn block_indexed_body( + &self, + hash: Block::Hash, + ) -> pezsp_blockchain::Result>>> { self.client.block_indexed_body(hash) } diff --git a/bizinikiwi/client/rpc-spec-v2/src/chain_head/tests.rs b/bizinikiwi/client/rpc-spec-v2/src/chain_head/tests.rs index ab45f405..536f3097 100644 --- a/bizinikiwi/client/rpc-spec-v2/src/chain_head/tests.rs +++ b/bizinikiwi/client/rpc-spec-v2/src/chain_head/tests.rs @@ -23,6 +23,11 @@ use crate::{ hex_string, }; use assert_matches::assert_matches; +use bizinikiwi_test_runtime::Transfer; +use bizinikiwi_test_runtime_client::{ + prelude::*, runtime, runtime::RuntimeApi, Backend, BlockBuilderExt, Client, + ClientBlockImportExt, GenesisInit, +}; use codec::{Decode, Encode}; use futures::Future; use jsonrpsee::{ @@ -49,11 +54,6 @@ use std::{ sync::Arc, time::Duration, }; -use bizinikiwi_test_runtime::Transfer; -use bizinikiwi_test_runtime_client::{ - prelude::*, runtime, runtime::RuntimeApi, Backend, BlockBuilderExt, Client, - ClientBlockImportExt, GenesisInit, -}; type Header = bizinikiwi_test_runtime_client::runtime::Header; type Block = bizinikiwi_test_runtime_client::runtime::Block; diff --git a/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/middleware_pool.rs b/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/middleware_pool.rs index 656101ce..3a9c0dca 100644 --- a/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/middleware_pool.rs +++ b/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/middleware_pool.rs @@ -27,9 +27,9 @@ use pezsc_transaction_pool_api::{ use crate::hex_string; use futures::StreamExt; +use bizinikiwi_test_runtime_transaction_pool::TestApi; use pezsp_runtime::traits::Block as BlockT; use std::{collections::HashMap, pin::Pin, sync::Arc}; -use bizinikiwi_test_runtime_transaction_pool::TestApi; use tokio::sync::mpsc; pub type Block = bizinikiwi_test_runtime_client::runtime::Block; diff --git a/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/setup.rs b/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/setup.rs index 139b0cb5..1aa59984 100644 --- a/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/setup.rs +++ b/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/setup.rs @@ -24,12 +24,12 @@ use crate::{ Transaction as RpcTransaction, TransactionBroadcast as RpcTransactionBroadcast, }, }; +use bizinikiwi_test_runtime_client::{prelude::*, Client}; +use bizinikiwi_test_runtime_transaction_pool::TestApi; use futures::Future; use jsonrpsee::RpcModule; use pezsc_transaction_pool::*; use std::{pin::Pin, sync::Arc}; -use bizinikiwi_test_runtime_client::{prelude::*, Client}; -use bizinikiwi_test_runtime_transaction_pool::TestApi; use crate::transaction::tests::middleware_pool::{MiddlewarePool, MiddlewarePoolRecv}; diff --git a/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/transaction_broadcast_tests.rs b/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/transaction_broadcast_tests.rs index 06f6f24d..a2112ad1 100644 --- a/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/transaction_broadcast_tests.rs +++ b/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/transaction_broadcast_tests.rs @@ -18,13 +18,13 @@ use crate::{hex_string, transaction::error::json_rpc_spec}; use assert_matches::assert_matches; +use bizinikiwi_test_runtime_client::Sr25519Keyring::*; +use bizinikiwi_test_runtime_transaction_pool::uxt; use codec::Encode; use jsonrpsee::{rpc_params, MethodsError as Error}; use pezsc_transaction_pool::{Options, PoolLimit}; use pezsc_transaction_pool_api::{ChainEvent, MaintainedTransactionPool, TransactionPool}; use std::sync::Arc; -use bizinikiwi_test_runtime_client::Sr25519Keyring::*; -use bizinikiwi_test_runtime_transaction_pool::uxt; const MAX_TX_PER_CONNECTION: usize = 4; diff --git a/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/transaction_tests.rs b/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/transaction_tests.rs index 13eae3aa..4dd99056 100644 --- a/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/transaction_tests.rs +++ b/bizinikiwi/client/rpc-spec-v2/src/transaction/tests/transaction_tests.rs @@ -21,13 +21,13 @@ use crate::{ transaction::{TransactionBlock, TransactionEvent}, }; use assert_matches::assert_matches; +use bizinikiwi_test_runtime_client::Sr25519Keyring::*; +use bizinikiwi_test_runtime_transaction_pool::uxt; use codec::Encode; use jsonrpsee::rpc_params; use pezsc_transaction_pool_api::{ChainEvent, MaintainedTransactionPool}; use pezsp_core::H256; use std::{sync::Arc, vec}; -use bizinikiwi_test_runtime_client::Sr25519Keyring::*; -use bizinikiwi_test_runtime_transaction_pool::uxt; // Test helpers. use crate::transaction::tests::setup::{setup_api_tx, ALICE_NONCE}; diff --git a/bizinikiwi/client/rpc-spec-v2/src/transaction/transaction_broadcast.rs b/bizinikiwi/client/rpc-spec-v2/src/transaction/transaction_broadcast.rs index 2f84c347..4fef2312 100644 --- a/bizinikiwi/client/rpc-spec-v2/src/transaction/transaction_broadcast.rs +++ b/bizinikiwi/client/rpc-spec-v2/src/transaction/transaction_broadcast.rs @@ -30,7 +30,6 @@ use jsonrpsee::{ ConnectionId, Extensions, }; use parking_lot::RwLock; -use rand::{distributions::Alphanumeric, Rng}; use pezsc_client_api::BlockchainEvents; use pezsc_transaction_pool_api::{ error::IntoPoolError, TransactionFor, TransactionPool, TransactionSource, @@ -38,6 +37,7 @@ use pezsc_transaction_pool_api::{ use pezsp_blockchain::HeaderBackend; use pezsp_core::Bytes; use pezsp_runtime::traits::Block as BlockT; +use rand::{distributions::Alphanumeric, Rng}; use std::{collections::HashMap, sync::Arc}; use super::error::ErrorBroadcast; diff --git a/bizinikiwi/client/rpc/src/author/tests.rs b/bizinikiwi/client/rpc/src/author/tests.rs index 47bffeb3..4fca7a57 100644 --- a/bizinikiwi/client/rpc/src/author/tests.rs +++ b/bizinikiwi/client/rpc/src/author/tests.rs @@ -20,6 +20,11 @@ use super::*; use crate::testing::{test_executor, timeout_secs}; use assert_matches::assert_matches; +use bizinikiwi_test_runtime_client::{ + self, + runtime::{Block, Extrinsic, ExtrinsicBuilder, SessionKeys, Transfer}, + Backend, Client, DefaultTestClientBuilderExt, Sr25519Keyring, TestClientBuilderExt, +}; use codec::Encode; use jsonrpsee::{core::EmptyServerParams as EmptyParams, MethodsError as RpcError, RpcModule}; use pezsc_rpc_api::DenyUnsafe; @@ -36,11 +41,6 @@ use pezsp_crypto_hashing::blake2_256; use pezsp_keystore::{testing::MemoryKeystore, Keystore}; use pezsp_runtime::Perbill; use std::sync::Arc; -use bizinikiwi_test_runtime_client::{ - self, - runtime::{Block, Extrinsic, ExtrinsicBuilder, SessionKeys, Transfer}, - Backend, Client, DefaultTestClientBuilderExt, Sr25519Keyring, TestClientBuilderExt, -}; fn uxt(sender: Sr25519Keyring, nonce: u64) -> Extrinsic { let tx = Transfer { diff --git a/bizinikiwi/client/rpc/src/chain/tests.rs b/bizinikiwi/client/rpc/src/chain/tests.rs index 7fc33cd1..acb7dc88 100644 --- a/bizinikiwi/client/rpc/src/chain/tests.rs +++ b/bizinikiwi/client/rpc/src/chain/tests.rs @@ -19,14 +19,14 @@ use super::*; use crate::testing::{test_executor, timeout_secs}; use assert_matches::assert_matches; -use jsonrpsee::core::EmptyServerParams as EmptyParams; -use pezsc_block_builder::BlockBuilderBuilder; -use pezsp_consensus::BlockOrigin; -use pezsp_rpc::list::ListOrValue; use bizinikiwi_test_runtime_client::{ prelude::*, runtime::{Block, Header, H256}, }; +use jsonrpsee::core::EmptyServerParams as EmptyParams; +use pezsc_block_builder::BlockBuilderBuilder; +use pezsp_consensus::BlockOrigin; +use pezsp_rpc::list::ListOrValue; #[tokio::test] async fn should_return_header() { diff --git a/bizinikiwi/client/rpc/src/dev/tests.rs b/bizinikiwi/client/rpc/src/dev/tests.rs index c724ab3e..e55f4fd6 100644 --- a/bizinikiwi/client/rpc/src/dev/tests.rs +++ b/bizinikiwi/client/rpc/src/dev/tests.rs @@ -18,10 +18,10 @@ use super::*; use crate::DenyUnsafe; +use bizinikiwi_test_runtime_client::{prelude::*, runtime::Block}; use pezsc_block_builder::BlockBuilderBuilder; use pezsp_blockchain::HeaderBackend; use pezsp_consensus::BlockOrigin; -use bizinikiwi_test_runtime_client::{prelude::*, runtime::Block}; #[tokio::test] async fn block_stats_work() { diff --git a/bizinikiwi/client/rpc/src/state/tests.rs b/bizinikiwi/client/rpc/src/state/tests.rs index 7fbbde91..c7cefba6 100644 --- a/bizinikiwi/client/rpc/src/state/tests.rs +++ b/bizinikiwi/client/rpc/src/state/tests.rs @@ -20,16 +20,16 @@ use self::error::Error; use super::*; use crate::testing::{allow_unsafe, test_executor, timeout_secs}; use assert_matches::assert_matches; +use bizinikiwi_test_runtime_client::{ + prelude::*, + runtime::{ExtrinsicBuilder, Transfer}, +}; use futures::executor; use jsonrpsee::{core::EmptyServerParams as EmptyParams, MethodsError as RpcError}; use pezsc_block_builder::BlockBuilderBuilder; use pezsp_consensus::BlockOrigin; use pezsp_core::{hash::H256, storage::ChildInfo}; use std::sync::Arc; -use bizinikiwi_test_runtime_client::{ - prelude::*, - runtime::{ExtrinsicBuilder, Transfer}, -}; const STORAGE_KEY: &[u8] = b"child"; diff --git a/bizinikiwi/client/rpc/src/system/tests.rs b/bizinikiwi/client/rpc/src/system/tests.rs index dbd8be73..18b1b5f5 100644 --- a/bizinikiwi/client/rpc/src/system/tests.rs +++ b/bizinikiwi/client/rpc/src/system/tests.rs @@ -19,6 +19,7 @@ use super::{helpers::SyncState, *}; use crate::DenyUnsafe; use assert_matches::assert_matches; +use bizinikiwi_test_runtime_client::runtime::Block; use futures::prelude::*; use jsonrpsee::{core::EmptyServerParams as EmptyParams, MethodsError as RpcError, RpcModule}; use pezsc_network::{self, config::Role, PeerId}; @@ -31,7 +32,6 @@ use std::{ process::{Command, Stdio}, thread, }; -use bizinikiwi_test_runtime_client::runtime::Block; struct Status { pub peers: usize, diff --git a/bizinikiwi/client/service/src/builder.rs b/bizinikiwi/client/service/src/builder.rs index 9af5c527..1bb5a6a6 100644 --- a/bizinikiwi/client/service/src/builder.rs +++ b/bizinikiwi/client/service/src/builder.rs @@ -28,7 +28,6 @@ use crate::{ use futures::{select, FutureExt, StreamExt}; use jsonrpsee::RpcModule; use log::{debug, error, info}; -use prometheus_endpoint::Registry; use pezsc_chain_spec::{get_extension, ChainSpec}; use pezsc_client_api::{ execution_extensions::ExecutionExtensions, proof_provider::ProofProvider, BadBlocks, @@ -38,8 +37,8 @@ use pezsc_client_api::{ use pezsc_client_db::{Backend, BlocksPruning, DatabaseSettings, PruningMode}; use pezsc_consensus::import_queue::{ImportQueue, ImportQueueService}; use pezsc_executor::{ - pezsp_wasm_interface::HostFunctions, HeapAllocStrategy, NativeExecutionDispatch, RuntimeVersionOf, - WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY, + pezsp_wasm_interface::HostFunctions, HeapAllocStrategy, NativeExecutionDispatch, + RuntimeVersionOf, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY, }; use pezsc_keystore::LocalKeystore; use pezsc_network::{ @@ -93,6 +92,7 @@ use pezsp_core::traits::{CodeExecutor, SpawnNamed}; use pezsp_keystore::KeystorePtr; use pezsp_runtime::traits::{Block as BlockT, BlockIdTo, NumberFor, Zero}; use pezsp_storage::{ChildInfo, ChildType, PrefixedStorageKey}; +use prometheus_endpoint::Registry; use std::{ str::FromStr, sync::Arc, @@ -357,7 +357,9 @@ pub fn new_native_or_wasm_executor( config: &Configuration, ) -> pezsc_executor::NativeElseWasmExecutor { #[allow(deprecated)] - pezsc_executor::NativeElseWasmExecutor::new_with_wasm_executor(new_wasm_executor(&config.executor)) + pezsc_executor::NativeElseWasmExecutor::new_with_wasm_executor(new_wasm_executor( + &config.executor, + )) } /// Creates a [`WasmExecutor`] according to [`ExecutorConfiguration`]. @@ -501,10 +503,11 @@ where + CallApiAt + Send + 'static, - >::Api: pezsp_api::Metadata - + pezsp_transaction_pool::runtime_api::TaggedTransactionQueue - + pezsp_session::SessionKeys - + pezsp_api::ApiExt, + >::Api: + pezsp_api::Metadata + + pezsp_transaction_pool::runtime_api::TaggedTransactionQueue + + pezsp_session::SessionKeys + + pezsp_api::ApiExt, TBl: BlockT, TBl::Hash: Unpin, TBl::Header: Unpin, @@ -823,7 +826,8 @@ where + Sync + 'static, TBackend: pezsc_client_api::backend::Backend + 'static, - >::Api: pezsp_session::SessionKeys + pezsp_api::Metadata, + >::Api: + pezsp_session::SessionKeys + pezsp_api::Metadata, TExPool: MaintainedTransactionPool::Hash> + 'static, TBl::Hash: Unpin, TBl::Header: Unpin, diff --git a/bizinikiwi/client/service/src/chain_ops/export_raw_state.rs b/bizinikiwi/client/service/src/chain_ops/export_raw_state.rs index 8b47792c..594bc58e 100644 --- a/bizinikiwi/client/service/src/chain_ops/export_raw_state.rs +++ b/bizinikiwi/client/service/src/chain_ops/export_raw_state.rs @@ -18,7 +18,9 @@ use crate::error::Error; use pezsc_client_api::{StorageProvider, UsageProvider}; -use pezsp_core::storage::{well_known_keys, ChildInfo, Storage, StorageChild, StorageKey, StorageMap}; +use pezsp_core::storage::{ + well_known_keys, ChildInfo, Storage, StorageChild, StorageKey, StorageMap, +}; use pezsp_runtime::traits::Block as BlockT; use std::{ diff --git a/bizinikiwi/client/service/src/chain_ops/import_blocks.rs b/bizinikiwi/client/service/src/chain_ops/import_blocks.rs index b5dba7f8..7f1ff042 100644 --- a/bizinikiwi/client/service/src/chain_ops/import_blocks.rs +++ b/bizinikiwi/client/service/src/chain_ops/import_blocks.rs @@ -26,7 +26,6 @@ use pezsc_client_api::HeaderBackend; use pezsc_consensus::import_queue::{ BlockImportError, BlockImportStatus, ImportQueue, IncomingBlock, Link, }; -use serde_json::{de::IoRead as JsonIoRead, Deserializer, StreamDeserializer}; use pezsp_consensus::BlockOrigin; use pezsp_runtime::{ generic::SignedBlock, @@ -34,6 +33,7 @@ use pezsp_runtime::{ Block as BlockT, CheckedDiv, Header, MaybeSerializeDeserialize, NumberFor, Saturating, Zero, }, }; +use serde_json::{de::IoRead as JsonIoRead, Deserializer, StreamDeserializer}; use std::{ io::Read, pin::Pin, diff --git a/bizinikiwi/client/service/src/client/call_executor.rs b/bizinikiwi/client/service/src/client/call_executor.rs index 82385104..2a41ed6a 100644 --- a/bizinikiwi/client/service/src/client/call_executor.rs +++ b/bizinikiwi/client/service/src/client/call_executor.rs @@ -105,8 +105,9 @@ where let state = self.backend.state_at(at_hash, context.into())?; let state_runtime_code = pezsp_state_machine::backend::BackendRuntimeCode::new(&state); - let runtime_code = - state_runtime_code.runtime_code().map_err(pezsp_blockchain::Error::RuntimeCode)?; + let runtime_code = state_runtime_code + .runtime_code() + .map_err(pezsp_blockchain::Error::RuntimeCode)?; let runtime_code = self.code_provider.maybe_override_code(runtime_code, &state, at_hash)?.0; @@ -146,8 +147,9 @@ where // make sure we use the caching layers. let state_runtime_code = pezsp_state_machine::backend::BackendRuntimeCode::new(&state); - let runtime_code = - state_runtime_code.runtime_code().map_err(pezsp_blockchain::Error::RuntimeCode)?; + let runtime_code = state_runtime_code + .runtime_code() + .map_err(pezsp_blockchain::Error::RuntimeCode)?; let runtime_code = self.code_provider.maybe_override_code(runtime_code, &state, at_hash)?.0; let mut extensions = extensions.borrow_mut(); @@ -194,8 +196,9 @@ where let state = self.backend.state_at(at_hash, backend::TrieCacheContext::Untrusted)?; let state_runtime_code = pezsp_state_machine::backend::BackendRuntimeCode::new(&state); - let runtime_code = - state_runtime_code.runtime_code().map_err(pezsp_blockchain::Error::RuntimeCode)?; + let runtime_code = state_runtime_code + .runtime_code() + .map_err(pezsp_blockchain::Error::RuntimeCode)?; self.code_provider .maybe_override_code(runtime_code, &state, at_hash) .map(|(_, v)| v) @@ -213,9 +216,11 @@ where let trie_backend = state.as_trie_backend(); - let state_runtime_code = pezsp_state_machine::backend::BackendRuntimeCode::new(trie_backend); - let runtime_code = - state_runtime_code.runtime_code().map_err(pezsp_blockchain::Error::RuntimeCode)?; + let state_runtime_code = + pezsp_state_machine::backend::BackendRuntimeCode::new(trie_backend); + let runtime_code = state_runtime_code + .runtime_code() + .map_err(pezsp_blockchain::Error::RuntimeCode)?; let runtime_code = self.code_provider.maybe_override_code(runtime_code, &state, at_hash)?.0; pezsp_state_machine::prove_execution_on_trie_backend( diff --git a/bizinikiwi/client/service/src/client/client.rs b/bizinikiwi/client/service/src/client/client.rs index 1c59408b..7d13b7c8 100644 --- a/bizinikiwi/client/service/src/client/client.rs +++ b/bizinikiwi/client/service/src/client/client.rs @@ -25,8 +25,6 @@ use super::{ use crate::client::notification_pinning::NotificationPinningWorker; use log::{debug, info, trace, warn}; use parking_lot::{Mutex, RwLock}; -use prometheus_endpoint::Registry; -use rand::Rng; use pezsc_chain_spec::{resolve_state_version_from_wasm, BuildGenesisBlock}; use pezsc_client_api::{ backend::{ @@ -57,6 +55,8 @@ use pezsp_blockchain::{ HeaderBackend as ChainHeaderBackend, HeaderMetadata, Info as BlockchainInfo, }; use pezsp_consensus::{BlockOrigin, BlockStatus, Error as ConsensusError}; +use prometheus_endpoint::Registry; +use rand::Rng; use pezsc_utils::mpsc::{tracing_unbounded, TracingUnboundedSender}; use pezsp_core::{ @@ -450,7 +450,10 @@ where } /// Get the RuntimeVersion at a given block. - pub fn runtime_version_at(&self, hash: Block::Hash) -> pezsp_blockchain::Result { + pub fn runtime_version_at( + &self, + hash: Block::Hash, + ) -> pezsp_blockchain::Result { CallExecutor::runtime_version(&self.executor, hash) } @@ -694,8 +697,11 @@ where }; let tree_route = if is_new_best && info.best_hash != parent_hash && parent_exists { - let route_from_best = - pezsp_blockchain::tree_route(self.backend.blockchain(), info.best_hash, parent_hash)?; + let route_from_best = pezsp_blockchain::tree_route( + self.backend.blockchain(), + info.best_hash, + parent_hash, + )?; Some(route_from_best) } else { None @@ -1320,8 +1326,9 @@ where total_size += size; if current_child.is_none() && - pezsp_core::storage::well_known_keys::is_child_storage_key(next_key.as_slice()) && - !child_roots.contains(value.as_slice()) + pezsp_core::storage::well_known_keys::is_child_storage_key( + next_key.as_slice(), + ) && !child_roots.contains(value.as_slice()) { child_roots.insert(value.clone()); switch_child_key = Some((next_key.clone(), value.clone())); @@ -1955,11 +1962,17 @@ where Client::block_status(self, hash) } - fn justifications(&self, hash: Block::Hash) -> pezsp_blockchain::Result> { + fn justifications( + &self, + hash: Block::Hash, + ) -> pezsp_blockchain::Result> { self.backend.blockchain().justifications(hash) } - fn block_hash(&self, number: NumberFor) -> pezsp_blockchain::Result> { + fn block_hash( + &self, + number: NumberFor, + ) -> pezsp_blockchain::Result> { self.backend.blockchain().hash(number) } @@ -1971,7 +1984,10 @@ where self.backend.blockchain().has_indexed_transaction(hash) } - fn block_indexed_body(&self, hash: Block::Hash) -> pezsp_blockchain::Result>>> { + fn block_indexed_body( + &self, + hash: Block::Hash, + ) -> pezsp_blockchain::Result>>> { self.backend.blockchain().block_indexed_body(hash) } diff --git a/bizinikiwi/client/service/src/client/code_provider.rs b/bizinikiwi/client/service/src/client/code_provider.rs index 722afb10..351382be 100644 --- a/bizinikiwi/client/service/src/client/code_provider.rs +++ b/bizinikiwi/client/service/src/client/code_provider.rs @@ -78,12 +78,16 @@ where /// Returns the `:code` for the given `block`. /// /// This takes into account potential overrides/substitutes. - pub fn code_at_ignoring_overrides(&self, block: Block::Hash) -> pezsp_blockchain::Result> { + pub fn code_at_ignoring_overrides( + &self, + block: Block::Hash, + ) -> pezsp_blockchain::Result> { let state = self.backend.state_at(block, TrieCacheContext::Untrusted)?; let state_runtime_code = pezsp_state_machine::backend::BackendRuntimeCode::new(&state); - let runtime_code = - state_runtime_code.runtime_code().map_err(pezsp_blockchain::Error::RuntimeCode)?; + let runtime_code = state_runtime_code + .runtime_code() + .map_err(pezsp_blockchain::Error::RuntimeCode)?; self.maybe_override_code_internal(runtime_code, &state, block, true) .and_then(|r| { @@ -167,6 +171,7 @@ where mod tests { use super::*; use backend::Backend; + use bizinikiwi_test_runtime_client::{runtime, GenesisInit}; use pezsc_client_api::{in_mem, HeaderBackend}; use pezsc_executor::WasmExecutor; use pezsp_core::{ @@ -174,7 +179,6 @@ mod tests { traits::{FetchRuntimeCode, WrappedRuntimeCode}, }; use std::collections::HashMap; - use bizinikiwi_test_runtime_client::{runtime, GenesisInit}; #[test] fn no_override_no_substitutes_work() { diff --git a/bizinikiwi/client/service/src/client/notification_pinning.rs b/bizinikiwi/client/service/src/client/notification_pinning.rs index 2d919339..e9da6357 100644 --- a/bizinikiwi/client/service/src/client/notification_pinning.rs +++ b/bizinikiwi/client/service/src/client/notification_pinning.rs @@ -21,8 +21,8 @@ //! This file contains a worker that should be started when a new client instance is created. //! The goal is to avoid pruning of blocks that have active notifications in the node. Every //! recipient of notifications should receive the chance to act upon them. In addition, notification -//! listeners can hold onto a [`pezsc_client_api::UnpinHandle`] to keep a block pinned. Once the handle -//! is dropped, a message is sent and the worker unpins the respective block. +//! listeners can hold onto a [`pezsc_client_api::UnpinHandle`] to keep a block pinned. Once the +//! handle is dropped, a message is sent and the worker unpins the respective block. use std::{ marker::PhantomData, sync::{Arc, Weak}, @@ -32,8 +32,8 @@ use futures::StreamExt; use pezsc_client_api::{Backend, UnpinWorkerMessage}; use pezsc_utils::mpsc::TracingUnboundedReceiver; -use schnellru::Limiter; use pezsp_runtime::traits::Block as BlockT; +use schnellru::Limiter; const LOG_TARGET: &str = "db::notification_pinning"; const NOTIFICATION_PINNING_LIMIT: usize = 1024; diff --git a/bizinikiwi/client/service/src/config.rs b/bizinikiwi/client/service/src/config.rs index 082045cf..b81b4d0c 100644 --- a/bizinikiwi/client/service/src/config.rs +++ b/bizinikiwi/client/service/src/config.rs @@ -19,7 +19,6 @@ //! Service configuration. pub use jsonrpsee::server::BatchRequestConfig as RpcBatchRequestConfig; -use prometheus_endpoint::Registry; use pezsc_chain_spec::ChainSpec; pub use pezsc_client_db::{BlocksPruning, Database, DatabaseSource, PruningMode}; pub use pezsc_executor::{WasmExecutionMethod, WasmtimeInstantiationStrategy}; @@ -39,6 +38,7 @@ pub use pezsc_rpc_server::{ pub use pezsc_telemetry::TelemetryEndpoints; pub use pezsc_transaction_pool::TransactionPoolOptions; use pezsp_core::crypto::SecretString; +use prometheus_endpoint::Registry; use std::{ io, iter, net::SocketAddr, diff --git a/bizinikiwi/client/service/src/lib.rs b/bizinikiwi/client/service/src/lib.rs index 129da668..e34b7ed2 100644 --- a/bizinikiwi/client/service/src/lib.rs +++ b/bizinikiwi/client/service/src/lib.rs @@ -85,7 +85,6 @@ pub use pezsc_chain_spec::{ }; use crate::config::RpcConfiguration; -use prometheus_endpoint::Registry; pub use pezsc_consensus::ImportQueue; pub use pezsc_executor::NativeExecutionDispatch; pub use pezsc_network_sync::WarpSyncConfig; @@ -95,6 +94,7 @@ pub use pezsc_rpc::{RandomIntegerSubscriptionId, RandomStringSubscriptionId}; pub use pezsc_tracing::TracingReceiver; pub use pezsc_transaction_pool::TransactionPoolOptions; pub use pezsc_transaction_pool_api::{error::IntoPoolError, InPoolTransaction, TransactionPool}; +use prometheus_endpoint::Registry; #[doc(hidden)] pub use std::{ops::Deref, result::Result, sync::Arc}; pub use task_manager::{ @@ -335,9 +335,9 @@ pub async fn build_system_rpc_future< network_service.remove_reserved_peer(peer_id); sender.send(Ok(())) }, - Err(e) => sender.send(Err(pezsc_rpc::system::error::Error::MalformattedPeerArg( - e.to_string(), - ))), + Err(e) => sender.send(Err( + pezsc_rpc::system::error::Error::MalformattedPeerArg(e.to_string()), + )), }; }, pezsc_rpc::system::Request::NetworkReservedPeers(sender) => { @@ -571,13 +571,13 @@ where #[cfg(test)] mod tests { use super::*; - use futures::executor::block_on; - use pezsc_transaction_pool::BasicPool; - use pezsp_consensus::SelectChain; use bizinikiwi_test_runtime_client::{ prelude::*, runtime::{ExtrinsicBuilder, Transfer, TransferData}, }; + use futures::executor::block_on; + use pezsc_transaction_pool::BasicPool; + use pezsp_consensus::SelectChain; #[test] fn should_not_propagate_transactions_that_are_marked_as_such() { diff --git a/bizinikiwi/client/service/src/metrics.rs b/bizinikiwi/client/service/src/metrics.rs index 1c2eb57f..de0eb470 100644 --- a/bizinikiwi/client/service/src/metrics.rs +++ b/bizinikiwi/client/service/src/metrics.rs @@ -17,7 +17,6 @@ // along with this program. If not, see . use futures_timer::Delay; -use prometheus_endpoint::{register, Gauge, GaugeVec, Opts, PrometheusError, Registry, U64}; use pezsc_client_api::{ClientInfo, UsageProvider}; use pezsc_network::{config::Role, NetworkStatus, NetworkStatusProvider}; use pezsc_network_sync::{SyncStatus, SyncStatusProvider}; @@ -26,6 +25,7 @@ use pezsc_transaction_pool_api::{MaintainedTransactionPool, PoolStatus}; use pezsc_utils::metrics::register_globals; use pezsp_api::ProvideRuntimeApi; use pezsp_runtime::traits::{Block, NumberFor, SaturatedConversion, UniqueSaturatedInto}; +use prometheus_endpoint::{register, Gauge, GaugeVec, Opts, PrometheusError, Registry, U64}; use std::{ sync::Arc, time::{Duration, Instant, SystemTime}, diff --git a/bizinikiwi/client/service/src/task_manager/mod.rs b/bizinikiwi/client/service/src/task_manager/mod.rs index a619cba8..d63e8345 100644 --- a/bizinikiwi/client/service/src/task_manager/mod.rs +++ b/bizinikiwi/client/service/src/task_manager/mod.rs @@ -25,11 +25,11 @@ use futures::{ Future, FutureExt, StreamExt, }; use parking_lot::Mutex; +use pezsc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use prometheus_endpoint::{ exponential_buckets, register, CounterVec, HistogramOpts, HistogramVec, Opts, PrometheusError, Registry, U64, }; -use pezsc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use std::{ collections::{hash_map::Entry, HashMap}, panic, diff --git a/bizinikiwi/client/service/test/src/client/mod.rs b/bizinikiwi/client/service/test/src/client/mod.rs index 702ef432..980f9a88 100644 --- a/bizinikiwi/client/service/test/src/client/mod.rs +++ b/bizinikiwi/client/service/test/src/client/mod.rs @@ -17,6 +17,16 @@ // along with this program. If not, see . use async_channel::TryRecvError; +use bizinikiwi_test_runtime::TestAPI; +use bizinikiwi_test_runtime_client::{ + runtime::{ + currency::DOLLARS, + genesismap::{insert_genesis_block, GenesisStorageBuilder}, + Block, BlockNumber, Digest, Hash, Header, RuntimeApi, Transfer, + }, + BlockBuilderExt, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, Sr25519Keyring, + TestClientBuilder, TestClientBuilderExt, +}; use codec::{Decode, Encode, Joiner}; use futures::executor::block_on; use pezsc_block_builder::BlockBuilderBuilder; @@ -41,16 +51,6 @@ use pezsp_runtime::{ use pezsp_state_machine::{backend::Backend as _, InMemoryBackend, OverlayedChanges, StateMachine}; use pezsp_storage::{ChildInfo, StorageKey}; use std::{collections::HashSet, sync::Arc}; -use bizinikiwi_test_runtime::TestAPI; -use bizinikiwi_test_runtime_client::{ - runtime::{ - currency::DOLLARS, - genesismap::{insert_genesis_block, GenesisStorageBuilder}, - Block, BlockNumber, Digest, Hash, Header, RuntimeApi, Transfer, - }, - BlockBuilderExt, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, Sr25519Keyring, - TestClientBuilder, TestClientBuilderExt, -}; mod db; @@ -2257,11 +2257,12 @@ fn use_dalek_ext_works() { let client = TestClientBuilder::new().build(); - client.execution_extensions().set_extensions_factory( - pezsc_client_api::execution_extensions::ExtensionBeforeBlock::::new( - 1, - ), - ); + client + .execution_extensions() + .set_extensions_factory(pezsc_client_api::execution_extensions::ExtensionBeforeBlock::< + Block, + pezsp_io::UseDalekExt, + >::new(1)); let a1 = BlockBuilderBuilder::new(&client) .on_parent_block(client.chain_info().genesis_hash) diff --git a/bizinikiwi/client/statement-store/src/lib.rs b/bizinikiwi/client/statement-store/src/lib.rs index 888c7294..f6a717f6 100644 --- a/bizinikiwi/client/statement-store/src/lib.rs +++ b/bizinikiwi/client/statement-store/src/lib.rs @@ -18,8 +18,8 @@ //! Disk-backed statement store. //! -//! This module contains an implementation of `pezsp_statement_store::StatementStore` which is backed -//! by a database. +//! This module contains an implementation of `pezsp_statement_store::StatementStore` which is +//! backed by a database. //! //! Constraint management. //! @@ -53,11 +53,12 @@ pub use pezsp_statement_store::{Error, StatementStore, MAX_TOPICS}; use metrics::MetricsLink as PrometheusMetrics; use parking_lot::RwLock; -use prometheus_endpoint::Registry as PrometheusRegistry; use pezsc_keystore::LocalKeystore; use pezsp_api::ProvideRuntimeApi; use pezsp_blockchain::HeaderBackend; -use pezsp_core::{crypto::UncheckedFrom, hexdisplay::HexDisplay, traits::SpawnNamed, Decode, Encode}; +use pezsp_core::{ + crypto::UncheckedFrom, hexdisplay::HexDisplay, traits::SpawnNamed, Decode, Encode, +}; use pezsp_runtime::traits::Block as BlockT; use pezsp_statement_store::{ runtime_api::{ @@ -66,6 +67,7 @@ use pezsp_statement_store::{ AccountId, BlockHash, Channel, DecryptionKey, Hash, NetworkPriority, Proof, Result, Statement, SubmitResult, Topic, }; +use prometheus_endpoint::Registry as PrometheusRegistry; use std::{ collections::{BTreeMap, HashMap, HashSet}, sync::Arc, diff --git a/bizinikiwi/client/sync-state-rpc/src/lib.rs b/bizinikiwi/client/sync-state-rpc/src/lib.rs index 0010fbd7..b31cc4ba 100644 --- a/bizinikiwi/client/sync-state-rpc/src/lib.rs +++ b/bizinikiwi/client/sync-state-rpc/src/lib.rs @@ -114,7 +114,8 @@ pub struct LightSyncState { pub finalized_block_header: ::Header, /// The epoch changes tree for babe. #[serde(serialize_with = "serialize_encoded")] - pub babe_epoch_changes: pezsc_consensus_epochs::EpochChangesFor, + pub babe_epoch_changes: + pezsc_consensus_epochs::EpochChangesFor, /// The babe weight of the finalized block. pub babe_finalized_block_weight: pezsc_consensus_babe::BabeBlockWeight, /// The authority set for grandpa. diff --git a/bizinikiwi/client/sysinfo/src/sysinfo_linux.rs b/bizinikiwi/client/sysinfo/src/sysinfo_linux.rs index d6d4e5d9..3b042205 100644 --- a/bizinikiwi/client/sysinfo/src/sysinfo_linux.rs +++ b/bizinikiwi/client/sysinfo/src/sysinfo_linux.rs @@ -16,8 +16,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use regex::Regex; use pezsc_telemetry::SysInfo; +use regex::Regex; use std::collections::HashSet; fn read_file(path: &str) -> Option { diff --git a/bizinikiwi/client/tracing/src/block/mod.rs b/bizinikiwi/client/tracing/src/block/mod.rs index 1643472c..a4ef8ec3 100644 --- a/bizinikiwi/client/tracing/src/block/mod.rs +++ b/bizinikiwi/client/tracing/src/block/mod.rs @@ -346,11 +346,11 @@ fn event_values_filter(event: &TraceEvent, filter_kind: &str, values: &str) -> b /// Filter out spans that do not match our targets and if the span is from WASM update its `name` /// and `target` fields to the WASM values for those fields. // The `tracing` crate requires trace metadata to be static. This does not work for wasm code in -// bizinikiwi, as it is regularly updated with new code from on-chain events. The workaround for this -// is for bizinikiwi's WASM tracing wrappers to put the `name` and `target` data in the `values` map -// (normally they would be in the static metadata assembled at compile time). Here, if a special -// WASM `name` or `target` key is found in the `values` we remove it and put the key value pair in -// the span's metadata, making it consistent with spans that come from native code. +// bizinikiwi, as it is regularly updated with new code from on-chain events. The workaround for +// this is for bizinikiwi's WASM tracing wrappers to put the `name` and `target` data in the +// `values` map (normally they would be in the static metadata assembled at compile time). Here, if +// a special WASM `name` or `target` key is found in the `values` we remove it and put the key value +// pair in the span's metadata, making it consistent with spans that come from native code. fn patch_and_filter(mut span: SpanDatum, targets: &str) -> Option { if span.name == WASM_TRACE_IDENTIFIER { span.values.bool_values.insert("wasm".to_owned(), true); diff --git a/bizinikiwi/client/tracing/src/lib.rs b/bizinikiwi/client/tracing/src/lib.rs index f2e60d29..8b116a0e 100644 --- a/bizinikiwi/client/tracing/src/lib.rs +++ b/bizinikiwi/client/tracing/src/lib.rs @@ -31,9 +31,9 @@ pub mod block; pub mod logging; +use pezsp_tracing::{WASM_NAME_KEY, WASM_TARGET_KEY, WASM_TRACE_IDENTIFIER}; use rustc_hash::FxHashMap; use serde::ser::{Serialize, SerializeMap, Serializer}; -use pezsp_tracing::{WASM_NAME_KEY, WASM_TARGET_KEY, WASM_TRACE_IDENTIFIER}; use std::{ fmt, time::{Duration, Instant}, diff --git a/bizinikiwi/client/transaction-pool/api/src/lib.rs b/bizinikiwi/client/transaction-pool/api/src/lib.rs index b7d43c88..43dee0cd 100644 --- a/bizinikiwi/client/transaction-pool/api/src/lib.rs +++ b/bizinikiwi/client/transaction-pool/api/src/lib.rs @@ -24,9 +24,9 @@ pub mod error; use async_trait::async_trait; use codec::Codec; use futures::Stream; -use serde::{de::DeserializeOwned, Deserialize, Serialize}; use pezsp_core::offchain::TransactionPoolExt; use pezsp_runtime::traits::{Block as BlockT, Member}; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; use std::{collections::HashMap, hash::Hash, marker::PhantomData, pin::Pin, sync::Arc}; const LOG_TARGET: &str = "txpool::api"; diff --git a/bizinikiwi/client/transaction-pool/benches/basics.rs b/bizinikiwi/client/transaction-pool/benches/basics.rs index 6a07ffad..d0ff5051 100644 --- a/bizinikiwi/client/transaction-pool/benches/basics.rs +++ b/bizinikiwi/client/transaction-pool/benches/basics.rs @@ -17,6 +17,7 @@ // along with this program. If not, see . use async_trait::async_trait; +use bizinikiwi_test_runtime::{AccountId, Block, Extrinsic, ExtrinsicBuilder, TransferData, H256}; use codec::Encode; use criterion::{criterion_group, criterion_main, Criterion}; use futures::executor::block_on; @@ -32,7 +33,6 @@ use pezsp_runtime::{ }, }; use std::sync::Arc; -use bizinikiwi_test_runtime::{AccountId, Block, Extrinsic, ExtrinsicBuilder, TransferData, H256}; #[derive(Clone, Debug, Default)] struct TestApi { diff --git a/bizinikiwi/client/transaction-pool/src/builder.rs b/bizinikiwi/client/transaction-pool/src/builder.rs index 728e216a..ec8e273a 100644 --- a/bizinikiwi/client/transaction-pool/src/builder.rs +++ b/bizinikiwi/client/transaction-pool/src/builder.rs @@ -25,10 +25,10 @@ use crate::{ single_state_txpool::BasicPool as SingleStateFullPool, TransactionPoolWrapper, LOG_TARGET, }; -use prometheus_endpoint::Registry as PrometheusRegistry; use pezsc_transaction_pool_api::{LocalTransactionPool, MaintainedTransactionPool}; use pezsp_core::traits::SpawnEssentialNamed; use pezsp_runtime::traits::Block as BlockT; +use prometheus_endpoint::Registry as PrometheusRegistry; use std::{marker::PhantomData, sync::Arc, time::Duration}; /// The type of transaction pool. diff --git a/bizinikiwi/client/transaction-pool/src/common/api.rs b/bizinikiwi/client/transaction-pool/src/common/api.rs index 14bee959..77f52eb1 100644 --- a/bizinikiwi/client/transaction-pool/src/common/api.rs +++ b/bizinikiwi/client/transaction-pool/src/common/api.rs @@ -26,7 +26,6 @@ use crate::{ use async_trait::async_trait; use codec::Encode; use futures::future::{Future, FutureExt}; -use prometheus_endpoint::Registry as PrometheusRegistry; use pezsc_client_api::{blockchain::HeaderBackend, BlockBackend}; use pezsp_api::{ApiExt, ProvideRuntimeApi}; use pezsp_blockchain::{HeaderMetadata, TreeRoute}; @@ -37,6 +36,7 @@ use pezsp_runtime::{ transaction_validity::{TransactionSource, TransactionValidity}, }; use pezsp_transaction_pool::runtime_api::TaggedTransactionQueue; +use prometheus_endpoint::Registry as PrometheusRegistry; use std::{ marker::PhantomData, pin::Pin, diff --git a/bizinikiwi/client/transaction-pool/src/common/enactment_state.rs b/bizinikiwi/client/transaction-pool/src/common/enactment_state.rs index 34260609..18a472be 100644 --- a/bizinikiwi/client/transaction-pool/src/common/enactment_state.rs +++ b/bizinikiwi/client/transaction-pool/src/common/enactment_state.rs @@ -190,11 +190,11 @@ where #[cfg(test)] mod enactment_state_tests { use super::{EnactmentAction, EnactmentState}; + use bizinikiwi_test_runtime_client::runtime::{Block, Hash}; use pezsc_transaction_pool_api::ChainEvent; use pezsp_blockchain::{HashAndNumber, TreeRoute}; use pezsp_runtime::traits::NumberFor; use std::sync::Arc; - use bizinikiwi_test_runtime_client::runtime::{Block, Hash}; // some helpers for convenient blocks' hash naming fn a() -> HashAndNumber { diff --git a/bizinikiwi/client/transaction-pool/src/common/tests.rs b/bizinikiwi/client/transaction-pool/src/common/tests.rs index e4836a9a..aeecfe36 100644 --- a/bizinikiwi/client/transaction-pool/src/common/tests.rs +++ b/bizinikiwi/client/transaction-pool/src/common/tests.rs @@ -23,6 +23,10 @@ use crate::{ ValidateTransactionPriority, }; use async_trait::async_trait; +use bizinikiwi_test_runtime::{ + bizinikiwi_test_pallet::pezpallet::Call as PalletCall, BalancesCall, Block, BlockNumber, + Extrinsic, ExtrinsicBuilder, Hashing, RuntimeCall, Transfer, TransferData, H256, +}; use codec::Encode; use parking_lot::Mutex; use pezsc_transaction_pool_api::error; @@ -35,10 +39,6 @@ use pezsp_runtime::{ }, }; use std::{collections::HashSet, sync::Arc}; -use bizinikiwi_test_runtime::{ - bizinikiwi_test_pallet::pezpallet::Call as PalletCall, BalancesCall, Block, BlockNumber, Extrinsic, - ExtrinsicBuilder, Hashing, RuntimeCall, Transfer, TransferData, H256, -}; type Pool = crate::graph::Pool; diff --git a/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/fork_aware_txpool.rs b/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/fork_aware_txpool.rs index 419487af..c1d55068 100644 --- a/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/fork_aware_txpool.rs +++ b/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/fork_aware_txpool.rs @@ -55,7 +55,6 @@ use futures::{ FutureExt, }; use parking_lot::Mutex; -use prometheus_endpoint::Registry as PrometheusRegistry; use pezsc_transaction_pool_api::{ error::Error as TxPoolApiError, ChainEvent, ImportNotificationStream, MaintainedTransactionPool, PoolStatus, TransactionFor, TransactionPool, TransactionSource, @@ -69,6 +68,7 @@ use pezsp_runtime::{ transaction_validity::{TransactionTag as Tag, TransactionValidityError, ValidTransaction}, Saturating, }; +use prometheus_endpoint::Registry as PrometheusRegistry; use std::{ collections::{BTreeMap, HashMap, HashSet}, pin::Pin, diff --git a/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/metrics.rs b/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/metrics.rs index 5ead3c83..77c6ffd2 100644 --- a/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/metrics.rs +++ b/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/metrics.rs @@ -25,14 +25,14 @@ use crate::{ LOG_TARGET, }; use futures::{FutureExt, StreamExt}; -use prometheus_endpoint::{ - exponential_buckets, histogram_opts, linear_buckets, register, Counter, Gauge, Histogram, - PrometheusError, Registry, U64, -}; #[cfg(doc)] use pezsc_transaction_pool_api::TransactionPool; use pezsc_transaction_pool_api::TransactionStatus; use pezsc_utils::mpsc; +use prometheus_endpoint::{ + exponential_buckets, histogram_opts, linear_buckets, register, Counter, Gauge, Histogram, + PrometheusError, Registry, U64, +}; use std::{ collections::{hash_map::Entry, HashMap}, future::Future, diff --git a/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/multi_view_listener.rs b/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/multi_view_listener.rs index 47eeb3d1..cf75c847 100644 --- a/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/multi_view_listener.rs +++ b/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/multi_view_listener.rs @@ -558,9 +558,9 @@ where /// /// This method initializes an `ExternalWatcherContext` for the provided transaction hash, sets /// up the necessary communication channel with listener's task, and unfolds an external - /// (meaning that it can be exposed to [`pezsc_transaction_pool_api::TransactionPool`] API client - /// e.g. rpc) stream of transaction status events. If an external watcher is already present for - /// the given transaction, it returns `None`. + /// (meaning that it can be exposed to [`pezsc_transaction_pool_api::TransactionPool`] API + /// client e.g. rpc) stream of transaction status events. If an external watcher is already + /// present for the given transaction, it returns `None`. /// /// The `submit_timestamp` indicates the time at which a transaction is submitted. /// It is primarily used to calculate event timings for metric collection. diff --git a/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/revalidation_worker.rs b/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/revalidation_worker.rs index 076220ef..78bf443a 100644 --- a/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/revalidation_worker.rs +++ b/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/revalidation_worker.rs @@ -203,9 +203,9 @@ mod tests { fork_aware_txpool::view::FinishRevalidationLocalChannels, TimedTransactionSource, ValidateTransactionPriority, }; - use futures::executor::block_on; use bizinikiwi_test_runtime::{AccountId, Transfer, H256}; use bizinikiwi_test_runtime_client::Sr25519Keyring::Alice; + use futures::executor::block_on; #[test] fn revalidation_queue_works() { let api = Arc::new(TestApi::default()); diff --git a/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/tx_mem_pool.rs b/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/tx_mem_pool.rs index ee6cbdff..78bcad2b 100644 --- a/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/tx_mem_pool.rs +++ b/bizinikiwi/client/transaction-pool/src/fork_aware_txpool/tx_mem_pool.rs @@ -970,9 +970,9 @@ where #[cfg(test)] mod tx_mem_pool_tests { - use futures::future::join_all; use bizinikiwi_test_runtime::{AccountId, Extrinsic, ExtrinsicBuilder, Transfer, H256}; use bizinikiwi_test_runtime_client::Sr25519Keyring::*; + use futures::future::join_all; use crate::{ common::tests::TestApi, fork_aware_txpool::view_store::ViewStoreSubmitOutcome, diff --git a/bizinikiwi/client/transaction-pool/src/graph/base_pool.rs b/bizinikiwi/client/transaction-pool/src/graph/base_pool.rs index fcb96118..080ef252 100644 --- a/bizinikiwi/client/transaction-pool/src/graph/base_pool.rs +++ b/bizinikiwi/client/transaction-pool/src/graph/base_pool.rs @@ -24,7 +24,6 @@ use std::{cmp::Ordering, collections::HashSet, fmt, hash, sync::Arc, time::Insta use crate::LOG_TARGET; use pezsc_transaction_pool_api::{error, InPoolTransaction, PoolStatus}; -use serde::Serialize; use pezsp_core::hexdisplay::HexDisplay; use pezsp_runtime::{ traits::Member, @@ -33,6 +32,7 @@ use pezsp_runtime::{ TransactionTag as Tag, }, }; +use serde::Serialize; use tracing::{trace, warn}; use super::{ diff --git a/bizinikiwi/client/transaction-pool/src/graph/pool.rs b/bizinikiwi/client/transaction-pool/src/graph/pool.rs index 5ab5eeb0..31c87a7b 100644 --- a/bizinikiwi/client/transaction-pool/src/graph/pool.rs +++ b/bizinikiwi/client/transaction-pool/src/graph/pool.rs @@ -603,14 +603,14 @@ mod tests { use crate::common::tests::{pool, uxt, TestApi, INVALID_NONCE}; use assert_matches::assert_matches; use base::TimedTransactionSource; + use bizinikiwi_test_runtime::{AccountId, ExtrinsicBuilder, Transfer, H256}; + use bizinikiwi_test_runtime_client::Sr25519Keyring::{Alice, Bob}; use codec::Encode; use futures::executor::block_on; use parking_lot::Mutex; use pezsc_transaction_pool_api::TransactionStatus; use pezsp_runtime::transaction_validity::TransactionSource; use std::{collections::HashMap, time::Instant}; - use bizinikiwi_test_runtime::{AccountId, ExtrinsicBuilder, Transfer, H256}; - use bizinikiwi_test_runtime_client::Sr25519Keyring::{Alice, Bob}; const SOURCE: TimedTransactionSource = TimedTransactionSource { source: TransactionSource::External, timestamp: None }; diff --git a/bizinikiwi/client/transaction-pool/src/graph/ready.rs b/bizinikiwi/client/transaction-pool/src/graph/ready.rs index b24367c5..47cb2e20 100644 --- a/bizinikiwi/client/transaction-pool/src/graph/ready.rs +++ b/bizinikiwi/client/transaction-pool/src/graph/ready.rs @@ -25,8 +25,8 @@ use std::{ use crate::LOG_TARGET; use pezsc_transaction_pool_api::error; -use serde::Serialize; use pezsp_runtime::{traits::Member, transaction_validity::TransactionTag as Tag}; +use serde::Serialize; use tracing::trace; use super::{ diff --git a/bizinikiwi/client/transaction-pool/src/single_state_txpool/revalidation.rs b/bizinikiwi/client/transaction-pool/src/single_state_txpool/revalidation.rs index 86d737eb..036f3172 100644 --- a/bizinikiwi/client/transaction-pool/src/single_state_txpool/revalidation.rs +++ b/bizinikiwi/client/transaction-pool/src/single_state_txpool/revalidation.rs @@ -399,9 +399,9 @@ mod tests { graph::Pool, TimedTransactionSource, }; - use futures::executor::block_on; use bizinikiwi_test_runtime::{AccountId, Transfer, H256}; use bizinikiwi_test_runtime_client::Sr25519Keyring::{Alice, Bob}; + use futures::executor::block_on; #[test] fn revalidation_queue_works() { diff --git a/bizinikiwi/client/transaction-pool/src/single_state_txpool/single_state_txpool.rs b/bizinikiwi/client/transaction-pool/src/single_state_txpool/single_state_txpool.rs index 39768b61..327b6eca 100644 --- a/bizinikiwi/client/transaction-pool/src/single_state_txpool/single_state_txpool.rs +++ b/bizinikiwi/client/transaction-pool/src/single_state_txpool/single_state_txpool.rs @@ -38,7 +38,6 @@ use crate::{ use async_trait::async_trait; use futures::{channel::oneshot, future, prelude::*, Future, FutureExt}; use parking_lot::Mutex; -use prometheus_endpoint::Registry as PrometheusRegistry; use pezsc_transaction_pool_api::{ error::Error as TxPoolError, ChainEvent, ImportNotificationStream, MaintainedTransactionPool, PoolStatus, TransactionFor, TransactionPool, TransactionSource, TransactionStatusStreamFor, @@ -53,6 +52,7 @@ use pezsp_runtime::{ }, transaction_validity::{TransactionTag as Tag, TransactionValidityError}, }; +use prometheus_endpoint::Registry as PrometheusRegistry; use std::{ collections::{HashMap, HashSet}, pin::Pin, diff --git a/bizinikiwi/client/transaction-pool/tests/fatp.rs b/bizinikiwi/client/transaction-pool/tests/fatp.rs index 799f3517..afb5737f 100644 --- a/bizinikiwi/client/transaction-pool/tests/fatp.rs +++ b/bizinikiwi/client/transaction-pool/tests/fatp.rs @@ -18,6 +18,8 @@ //! Tests for fork-aware transaction pool. +use bizinikiwi_test_runtime_client::Sr25519Keyring::*; +use bizinikiwi_test_runtime_transaction_pool::uxt; use fatp_common::{ finalized_block_event, invalid_hash, new_best_block_event, pool, pool_with_api, test_chain_with_forks, LOG_TARGET, SOURCE, @@ -30,8 +32,6 @@ use pezsc_transaction_pool_api::{ }; use pezsp_runtime::transaction_validity::InvalidTransaction; use std::{sync::Arc, time::Duration}; -use bizinikiwi_test_runtime_client::Sr25519Keyring::*; -use bizinikiwi_test_runtime_transaction_pool::uxt; use tracing::debug; pub mod fatp_common; diff --git a/bizinikiwi/client/transaction-pool/tests/fatp_common/mod.rs b/bizinikiwi/client/transaction-pool/tests/fatp_common/mod.rs index aa6fbb99..33f9c789 100644 --- a/bizinikiwi/client/transaction-pool/tests/fatp_common/mod.rs +++ b/bizinikiwi/client/transaction-pool/tests/fatp_common/mod.rs @@ -18,15 +18,15 @@ //! Tests for fork-aware transaction pool. -use pezsc_transaction_pool::{ChainApi, PoolLimit}; -use pezsc_transaction_pool_api::ChainEvent; -use pezsp_runtime::transaction_validity::TransactionSource; -use std::sync::Arc; use bizinikiwi_test_runtime_client::{ runtime::{Block, Hash, Header}, Sr25519Keyring::*, }; use bizinikiwi_test_runtime_transaction_pool::{uxt, TestApi}; +use pezsc_transaction_pool::{ChainApi, PoolLimit}; +use pezsc_transaction_pool_api::ChainEvent; +use pezsp_runtime::transaction_validity::TransactionSource; +use std::sync::Arc; pub const LOG_TARGET: &str = "txpool"; use pezsc_transaction_pool::ForkAwareTxPool; diff --git a/bizinikiwi/client/transaction-pool/tests/fatp_finality_timeout.rs b/bizinikiwi/client/transaction-pool/tests/fatp_finality_timeout.rs index 86af747c..f9bafaeb 100644 --- a/bizinikiwi/client/transaction-pool/tests/fatp_finality_timeout.rs +++ b/bizinikiwi/client/transaction-pool/tests/fatp_finality_timeout.rs @@ -22,14 +22,14 @@ pub mod fatp_common; use std::cmp::min; +use bizinikiwi_test_runtime_client::Sr25519Keyring::*; +use bizinikiwi_test_runtime_transaction_pool::uxt; use fatp_common::{ finalized_block_event, invalid_hash, new_best_block_event, TestPoolBuilder, LOG_TARGET, SOURCE, }; use futures::{executor::block_on, FutureExt}; use pezsc_transaction_pool::ChainApi; use pezsc_transaction_pool_api::{MaintainedTransactionPool, TransactionPool, TransactionStatus}; -use bizinikiwi_test_runtime_client::Sr25519Keyring::*; -use bizinikiwi_test_runtime_transaction_pool::uxt; #[test] fn fatp_finality_timeout_works() { diff --git a/bizinikiwi/client/transaction-pool/tests/fatp_invalid.rs b/bizinikiwi/client/transaction-pool/tests/fatp_invalid.rs index d799aa06..71a7c0f8 100644 --- a/bizinikiwi/client/transaction-pool/tests/fatp_invalid.rs +++ b/bizinikiwi/client/transaction-pool/tests/fatp_invalid.rs @@ -20,6 +20,8 @@ pub mod fatp_common; +use bizinikiwi_test_runtime_client::Sr25519Keyring::*; +use bizinikiwi_test_runtime_transaction_pool::uxt; use fatp_common::{ finalized_block_event, invalid_hash, new_best_block_event, pool, TestPoolBuilder, LOG_TARGET, SOURCE, @@ -31,8 +33,6 @@ use pezsc_transaction_pool_api::{ MaintainedTransactionPool, TransactionPool, TransactionStatus, }; use pezsp_runtime::transaction_validity::{InvalidTransaction, TransactionValidityError}; -use bizinikiwi_test_runtime_client::Sr25519Keyring::*; -use bizinikiwi_test_runtime_transaction_pool::uxt; use tracing::debug; #[test] diff --git a/bizinikiwi/client/transaction-pool/tests/fatp_limits.rs b/bizinikiwi/client/transaction-pool/tests/fatp_limits.rs index fd3e796d..dc79f3f1 100644 --- a/bizinikiwi/client/transaction-pool/tests/fatp_limits.rs +++ b/bizinikiwi/client/transaction-pool/tests/fatp_limits.rs @@ -20,6 +20,8 @@ pub mod fatp_common; +use bizinikiwi_test_runtime_client::Sr25519Keyring::*; +use bizinikiwi_test_runtime_transaction_pool::uxt; use fatp_common::{ finalized_block_event, invalid_hash, new_best_block_event, TestPoolBuilder, LOG_TARGET, SOURCE, }; @@ -29,8 +31,6 @@ use pezsc_transaction_pool_api::{ error::Error as TxPoolError, MaintainedTransactionPool, TransactionPool, TransactionStatus, }; use std::thread::sleep; -use bizinikiwi_test_runtime_client::Sr25519Keyring::*; -use bizinikiwi_test_runtime_transaction_pool::uxt; use tracing::debug; #[test] diff --git a/bizinikiwi/client/transaction-pool/tests/fatp_prios.rs b/bizinikiwi/client/transaction-pool/tests/fatp_prios.rs index 30070d2a..58ed74f0 100644 --- a/bizinikiwi/client/transaction-pool/tests/fatp_prios.rs +++ b/bizinikiwi/client/transaction-pool/tests/fatp_prios.rs @@ -20,6 +20,8 @@ pub mod fatp_common; +use bizinikiwi_test_runtime_client::Sr25519Keyring::*; +use bizinikiwi_test_runtime_transaction_pool::uxt; use fatp_common::{invalid_hash, new_best_block_event, TestPoolBuilder, LOG_TARGET, SOURCE}; use futures::{executor::block_on, FutureExt}; use pezsc_transaction_pool::ChainApi; @@ -27,8 +29,6 @@ use pezsc_transaction_pool_api::{ error::Error as TxPoolError, LocalTransactionPool, MaintainedTransactionPool, TransactionPool, TransactionStatus, }; -use bizinikiwi_test_runtime_client::Sr25519Keyring::*; -use bizinikiwi_test_runtime_transaction_pool::uxt; use tracing::info; #[test] fn fatp_prio_ready_higher_evicts_lower() { diff --git a/bizinikiwi/client/transaction-pool/tests/pool.rs b/bizinikiwi/client/transaction-pool/tests/pool.rs index 42571b8b..6b1ea8fa 100644 --- a/bizinikiwi/client/transaction-pool/tests/pool.rs +++ b/bizinikiwi/client/transaction-pool/tests/pool.rs @@ -18,6 +18,12 @@ //! Tests for top-level transaction pool api +use bizinikiwi_test_runtime_client::{ + runtime::{Block, Extrinsic, ExtrinsicBuilder, Hash, Header, Nonce, Transfer, TransferData}, + ClientBlockImportExt, + Sr25519Keyring::*, +}; +use bizinikiwi_test_runtime_transaction_pool::{uxt, TestApi}; use codec::Encode; use futures::{ executor::{block_on, block_on_stream}, @@ -38,12 +44,6 @@ use pezsp_runtime::{ transaction_validity::{TransactionSource, ValidTransaction}, }; use std::{collections::BTreeSet, pin::Pin, sync::Arc}; -use bizinikiwi_test_runtime_client::{ - runtime::{Block, Extrinsic, ExtrinsicBuilder, Hash, Header, Nonce, Transfer, TransferData}, - ClientBlockImportExt, - Sr25519Keyring::*, -}; -use bizinikiwi_test_runtime_transaction_pool::{uxt, TestApi}; use tracing::{debug, trace}; type Pool = pezsc_transaction_pool::Pool; diff --git a/bizinikiwi/pezframe/alliance/src/benchmarking.rs b/bizinikiwi/pezframe/alliance/src/benchmarking.rs index 3f984cc3..38cf6175 100644 --- a/bizinikiwi/pezframe/alliance/src/benchmarking.rs +++ b/bizinikiwi/pezframe/alliance/src/benchmarking.rs @@ -24,7 +24,9 @@ use pezsp_runtime::traits::{Bounded, Hash, StaticLookup}; use pezframe_benchmarking::{account, v2::*, BenchmarkError}; use pezframe_support::traits::{EnsureOrigin, Get, UnfilteredDispatchable}; -use pezframe_system::{pezpallet_prelude::BlockNumberFor, Pezpallet as System, RawOrigin as SystemOrigin}; +use pezframe_system::{ + pezpallet_prelude::BlockNumberFor, Pezpallet as System, RawOrigin as SystemOrigin, +}; use super::{Call as AllianceCall, Pezpallet as Alliance, *}; diff --git a/bizinikiwi/pezframe/alliance/src/lib.rs b/bizinikiwi/pezframe/alliance/src/lib.rs index d875cce4..d3958385 100644 --- a/bizinikiwi/pezframe/alliance/src/lib.rs +++ b/bizinikiwi/pezframe/alliance/src/lib.rs @@ -163,7 +163,8 @@ impl IdentityVerifier for () { } } -/// The provider of a collective action interface, for example an instance of `pezpallet-collective`. +/// The provider of a collective action interface, for example an instance of +/// `pezpallet-collective`. pub trait ProposalProvider { /// Add a new proposal. /// Returns a proposal length and active proposals count if successful. @@ -430,7 +431,10 @@ pub mod pezpallet { impl, I: 'static> BuildGenesisConfig for GenesisConfig { fn build(&self) { for m in self.fellows.iter().chain(self.allies.iter()) { - assert!(Pezpallet::::has_identity(m).is_ok(), "Member does not set identity!"); + assert!( + Pezpallet::::has_identity(m).is_ok(), + "Member does not set identity!" + ); } if !self.fellows.is_empty() { diff --git a/bizinikiwi/pezframe/alliance/src/migration.rs b/bizinikiwi/pezframe/alliance/src/migration.rs index cc37c07d..d3278a91 100644 --- a/bizinikiwi/pezframe/alliance/src/migration.rs +++ b/bizinikiwi/pezframe/alliance/src/migration.rs @@ -16,8 +16,8 @@ // limitations under the License. use crate::{Config, Pezpallet, Weight, LOG_TARGET}; -use pezframe_support::{pezpallet_prelude::*, storage::migration, traits::OnRuntimeUpgrade}; use log; +use pezframe_support::{pezpallet_prelude::*, storage::migration, traits::OnRuntimeUpgrade}; /// The in-code storage version. pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); diff --git a/bizinikiwi/pezframe/alliance/src/types.rs b/bizinikiwi/pezframe/alliance/src/types.rs index 17a98bb2..7836b4ed 100644 --- a/bizinikiwi/pezframe/alliance/src/types.rs +++ b/bizinikiwi/pezframe/alliance/src/types.rs @@ -18,8 +18,8 @@ use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use pezframe_support::{traits::ConstU32, BoundedVec}; -use scale_info::TypeInfo; use pezsp_runtime::RuntimeDebug; +use scale_info::TypeInfo; /// A Multihash instance that only supports the basic functionality and no hashing. #[derive( diff --git a/bizinikiwi/pezframe/asset-conversion/ops/src/lib.rs b/bizinikiwi/pezframe/asset-conversion/ops/src/lib.rs index dbaffc25..1c86fa5a 100644 --- a/bizinikiwi/pezframe/asset-conversion/ops/src/lib.rs +++ b/bizinikiwi/pezframe/asset-conversion/ops/src/lib.rs @@ -74,7 +74,8 @@ pub mod pezpallet { { /// Overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Type previously used to derive the account ID for a pool. Indicates that the pool's /// liquidity assets are located at this account before the migration. diff --git a/bizinikiwi/pezframe/asset-conversion/src/lib.rs b/bizinikiwi/pezframe/asset-conversion/src/lib.rs index 56d25c3f..546e4896 100644 --- a/bizinikiwi/pezframe/asset-conversion/src/lib.rs +++ b/bizinikiwi/pezframe/asset-conversion/src/lib.rs @@ -26,8 +26,8 @@ //! - [create a liquidity pool](`Pezpallet::create_pool()`) for 2 assets //! - [provide the liquidity](`Pezpallet::add_liquidity()`) and receive back an LP token //! - [exchange the LP token back to assets](`Pezpallet::remove_liquidity()`) -//! - [swap a specific amount of assets for another](`Pezpallet::swap_exact_tokens_for_tokens()`) if -//! there is a pool created, or +//! - [swap a specific amount of assets for another](`Pezpallet::swap_exact_tokens_for_tokens()`) +//! if there is a pool created, or //! - [swap some assets for a specific amount of //! another](`Pezpallet::swap_tokens_for_exact_tokens()`). //! - [query for an exchange price](`AssetConversionApi::quote_price_exact_tokens_for_tokens`) via @@ -112,7 +112,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// Overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The type in which the assets for swapping are measured. type Balance: Balance; @@ -149,8 +150,8 @@ pub mod pezpallet { /// Asset class for the lp tokens from [`Self::PoolAssets`]. type PoolAssetId: AssetId + PartialOrd + Incrementable + From; - /// Registry for the lp tokens. Ideally only this pezpallet should have create permissions on - /// the assets. + /// Registry for the lp tokens. Ideally only this pezpallet should have create permissions + /// on the assets. type PoolAssets: Inspect + Create + Mutate @@ -387,8 +388,9 @@ pub mod pezpallet { /// /// NOTE: when encountering an incorrect exchange rate and non-withdrawable pool liquidity, /// batch an atomic call with [`Pezpallet::add_liquidity`] and - /// [`Pezpallet::swap_exact_tokens_for_tokens`] or [`Pezpallet::swap_tokens_for_exact_tokens`] - /// calls to render the liquidity withdrawable and rectify the exchange rate. + /// [`Pezpallet::swap_exact_tokens_for_tokens`] or + /// [`Pezpallet::swap_tokens_for_exact_tokens`] calls to render the liquidity withdrawable + /// and rectify the exchange rate. /// /// Once liquidity is added, someone may successfully call /// [`Pezpallet::swap_exact_tokens_for_tokens`]. diff --git a/bizinikiwi/pezframe/asset-conversion/src/types.rs b/bizinikiwi/pezframe/asset-conversion/src/types.rs index 5d527ee1..71b5d1c1 100644 --- a/bizinikiwi/pezframe/asset-conversion/src/types.rs +++ b/bizinikiwi/pezframe/asset-conversion/src/types.rs @@ -18,8 +18,8 @@ use super::*; use codec::{Decode, Encode, MaxEncodedLen}; use core::marker::PhantomData; -use scale_info::TypeInfo; use pezsp_runtime::traits::TryConvert; +use scale_info::TypeInfo; /// Represents a swap path with associated asset amounts indicating how much of the asset needs to /// be deposited to get the following asset's amount withdrawn (this is inclusive of fees). diff --git a/bizinikiwi/pezframe/asset-rate/src/lib.rs b/bizinikiwi/pezframe/asset-rate/src/lib.rs index 3d58af66..89c8924a 100644 --- a/bizinikiwi/pezframe/asset-rate/src/lib.rs +++ b/bizinikiwi/pezframe/asset-rate/src/lib.rs @@ -107,7 +107,8 @@ pub mod pezpallet { /// The runtime event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The origin permissioned to create a conversion rate for an asset. type CreateOrigin: EnsureOrigin; diff --git a/bizinikiwi/pezframe/asset-rate/src/mock.rs b/bizinikiwi/pezframe/asset-rate/src/mock.rs index b167983b..ac459fb1 100644 --- a/bizinikiwi/pezframe/asset-rate/src/mock.rs +++ b/bizinikiwi/pezframe/asset-rate/src/mock.rs @@ -57,5 +57,8 @@ impl pezpallet_asset_rate::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> pezsp_io::TestExternalities { - pezframe_system::GenesisConfig::::default().build_storage().unwrap().into() + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } diff --git a/bizinikiwi/pezframe/asset-rate/src/tests.rs b/bizinikiwi/pezframe/asset-rate/src/tests.rs index 75532ee7..c68cb162 100644 --- a/bizinikiwi/pezframe/asset-rate/src/tests.rs +++ b/bizinikiwi/pezframe/asset-rate/src/tests.rs @@ -19,8 +19,8 @@ use super::*; use crate::pezpallet as pezpallet_asset_rate; -use pezframe_support::{assert_noop, assert_ok}; use mock::{new_test_ext, AssetRate, RuntimeOrigin, Test}; +use pezframe_support::{assert_noop, assert_ok}; use pezsp_runtime::FixedU128; const ASSET_ID: u32 = 42; diff --git a/bizinikiwi/pezframe/asset-rewards/src/lib.rs b/bizinikiwi/pezframe/asset-rewards/src/lib.rs index df6af1a4..ea3afd5c 100644 --- a/bizinikiwi/pezframe/asset-rewards/src/lib.rs +++ b/bizinikiwi/pezframe/asset-rewards/src/lib.rs @@ -93,13 +93,13 @@ use pezframe_support::{ }, PalletId, }; -use scale_info::TypeInfo; use pezsp_core::Get; use pezsp_runtime::{ traits::{BadOrigin, BlockNumberProvider, EnsureAdd, MaybeDisplay, Zero}, DispatchError, DispatchResult, }; use pezsp_std::boxed::Box; +use scale_info::TypeInfo; #[cfg(feature = "runtime-benchmarks")] pub mod benchmarking; @@ -221,7 +221,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// Overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The pezpallet's unique identifier, used to derive the pool's account ID. /// @@ -271,10 +272,10 @@ pub mod pezpallet { /// This provider is used to determine the current block number for the pezpallet. /// It must return monotonically increasing values when called from consecutive blocks. /// - /// It can be configured to use the local block number (via `pezframe_system::Pezpallet`) or a - /// remote block number (e.g., from a relay chain). However, note that using a remote - /// block number might have implications for the behavior of the pezpallet, especially if the - /// remote block number advances faster than the local block number. + /// It can be configured to use the local block number (via `pezframe_system::Pezpallet`) or + /// a remote block number (e.g., from a relay chain). However, note that using a remote + /// block number might have implications for the behavior of the pezpallet, especially if + /// the remote block number advances faster than the local block number. /// /// It is recommended to use the local block number for solo chains and relay chains. type BlockNumberProvider: BlockNumberProvider; diff --git a/bizinikiwi/pezframe/asset-rewards/src/mock.rs b/bizinikiwi/pezframe/asset-rewards/src/mock.rs index adbf53d3..48730a01 100644 --- a/bizinikiwi/pezframe/asset-rewards/src/mock.rs +++ b/bizinikiwi/pezframe/asset-rewards/src/mock.rs @@ -174,7 +174,9 @@ impl Config for MockRuntime { } pub(crate) fn new_test_ext() -> pezsp_io::TestExternalities { - let mut t = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); + let mut t = pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap(); pezpallet_assets::GenesisConfig:: { // Genesis assets: id, owner, is_sufficient, min_balance diff --git a/bizinikiwi/pezframe/assets-freezer/src/lib.rs b/bizinikiwi/pezframe/assets-freezer/src/lib.rs index 9eb485e0..5f75bfbf 100644 --- a/bizinikiwi/pezframe/assets-freezer/src/lib.rs +++ b/bizinikiwi/pezframe/assets-freezer/src/lib.rs @@ -39,8 +39,8 @@ //! //! This pezpallet provides the following functionality: //! -//! - Pezpallet hooks allowing [`pezpallet-assets`] to know the frozen balance for an account on a given -//! asset (see [`pezpallet_assets::FrozenBalance`]). +//! - Pezpallet hooks allowing [`pezpallet-assets`] to know the frozen balance for an account on a +//! given asset (see [`pezpallet_assets::FrozenBalance`]). //! - An implementation of [`fungibles::freeze::Inspect`](InspectFreeze) and //! [`fungibles::freeze::Mutate`](MutateFreeze), allowing other pallets to manage freezes for the //! `pezpallet-assets` assets. @@ -74,7 +74,9 @@ pub mod pezpallet { use super::*; #[pezpallet::config(with_default)] - pub trait Config: pezframe_system::Config + pezpallet_assets::Config { + pub trait Config: + pezframe_system::Config + pezpallet_assets::Config + { /// The overarching freeze reason. #[pezpallet::no_default_bounds] type RuntimeFreezeReason: Parameter + Member + MaxEncodedLen + Copy + VariantCount; diff --git a/bizinikiwi/pezframe/assets-holder/src/lib.rs b/bizinikiwi/pezframe/assets-holder/src/lib.rs index 6b52fe3b..46b41a48 100644 --- a/bizinikiwi/pezframe/assets-holder/src/lib.rs +++ b/bizinikiwi/pezframe/assets-holder/src/lib.rs @@ -18,8 +18,8 @@ //! # Assets Holder Pezpallet //! //! A pezpallet capable of holding fungibles from `pezpallet-assets`. This is an extension of -//! `pezpallet-assets`, wrapping [`fungibles::Inspect`](`pezframe_support::traits::fungibles::Inspect`). -//! It implements both +//! `pezpallet-assets`, wrapping +//! [`fungibles::Inspect`](`pezframe_support::traits::fungibles::Inspect`). It implements both //! [`fungibles::hold::Inspect`](pezframe_support::traits::fungibles::hold::Inspect), //! [`fungibles::hold::Mutate`](pezframe_support::traits::fungibles::hold::Mutate), and especially //! [`fungibles::hold::Unbalanced`](pezframe_support::traits::fungibles::hold::Unbalanced). The @@ -34,13 +34,13 @@ //! //! This pezpallet provides the following functionality: //! -//! - Pezpallet hooks allowing [`pezpallet-assets`] to know the balance on hold for an account on a given -//! asset (see [`pezpallet_assets::BalanceOnHold`]). +//! - Pezpallet hooks allowing [`pezpallet-assets`] to know the balance on hold for an account on a +//! given asset (see [`pezpallet_assets::BalanceOnHold`]). //! - An implementation of //! [`fungibles::hold::Inspect`](pezframe_support::traits::fungibles::hold::Inspect), //! [`fungibles::hold::Mutate`](pezframe_support::traits::fungibles::hold::Mutate) and -//! [`fungibles::hold::Unbalanced`](pezframe_support::traits::fungibles::hold::Unbalanced), allowing -//! other pallets to manage holds for the `pezpallet-assets` assets. +//! [`fungibles::hold::Unbalanced`](pezframe_support::traits::fungibles::hold::Unbalanced), +//! allowing other pallets to manage holds for the `pezpallet-assets` assets. #![cfg_attr(not(feature = "std"), no_std)] diff --git a/bizinikiwi/pezframe/assets-holder/src/mock.rs b/bizinikiwi/pezframe/assets-holder/src/mock.rs index 003a2736..0b2fdeec 100644 --- a/bizinikiwi/pezframe/assets-holder/src/mock.rs +++ b/bizinikiwi/pezframe/assets-holder/src/mock.rs @@ -21,8 +21,8 @@ use crate as pezpallet_assets_holder; pub use crate::*; use codec::{Decode, Encode, MaxEncodedLen}; use pezframe_support::{derive_impl, traits::AsEnsureOriginWithArg}; -use scale_info::TypeInfo; use pezsp_runtime::BuildStorage; +use scale_info::TypeInfo; pub type AccountId = ::AccountId; pub type Balance = ::Balance; diff --git a/bizinikiwi/pezframe/assets/precompiles/src/lib.rs b/bizinikiwi/pezframe/assets/precompiles/src/lib.rs index d7b6a234..ba221bf6 100644 --- a/bizinikiwi/pezframe/assets/precompiles/src/lib.rs +++ b/bizinikiwi/pezframe/assets/precompiles/src/lib.rs @@ -218,8 +218,9 @@ where use pezframe_support::traits::fungibles::Inspect; env.charge(>::WeightInfo::total_issuance())?; - let value = - Self::to_u256(pezpallet_assets::Pezpallet::::total_issuance(asset_id))?; + let value = Self::to_u256( + pezpallet_assets::Pezpallet::::total_issuance(asset_id), + )?; return Ok(IERC20::totalSupplyCall::abi_encode_returns(&value)); } @@ -232,8 +233,9 @@ where env.charge(>::WeightInfo::balance())?; let account = call.account.into_array().into(); let account = ::AddressMapper::to_account_id(&account); - let value = - Self::to_u256(pezpallet_assets::Pezpallet::::balance(asset_id, account))?; + let value = Self::to_u256(pezpallet_assets::Pezpallet::::balance( + asset_id, account, + ))?; return Ok(IERC20::balanceOfCall::abi_encode_returns(&value)); } diff --git a/bizinikiwi/pezframe/assets/precompiles/src/tests.rs b/bizinikiwi/pezframe/assets/precompiles/src/tests.rs index a6b6f49b..9c83d2e7 100644 --- a/bizinikiwi/pezframe/assets/precompiles/src/tests.rs +++ b/bizinikiwi/pezframe/assets/precompiles/src/tests.rs @@ -141,7 +141,8 @@ fn balance_of_works() { assert_ok!(Assets::force_create(RuntimeOrigin::root(), asset_id, owner, true, 1)); assert_ok!(Assets::mint(RuntimeOrigin::signed(owner), asset_id, owner, 1000)); - let account = ::AddressMapper::to_address(&owner).0.into(); + let account = + ::AddressMapper::to_address(&owner).0.into(); let data = IERC20::balanceOfCall { account }.abi_encode(); let data = pezpallet_revive::Pezpallet::::bare_call( diff --git a/bizinikiwi/pezframe/assets/src/extra_mutator.rs b/bizinikiwi/pezframe/assets/src/extra_mutator.rs index 30e0c9b1..82e951aa 100644 --- a/bizinikiwi/pezframe/assets/src/extra_mutator.rs +++ b/bizinikiwi/pezframe/assets/src/extra_mutator.rs @@ -21,9 +21,9 @@ use super::*; /// A mutator type allowing inspection and possible modification of the extra "sidecar" data. /// -/// This may be used as a `Deref` for the pezpallet's extra data. If mutated (using `DerefMut`), then -/// any uncommitted changes (see `commit` function) will be automatically committed to storage when -/// dropped. Changes, even after committed, may be reverted to their original values with the +/// This may be used as a `Deref` for the pezpallet's extra data. If mutated (using `DerefMut`), +/// then any uncommitted changes (see `commit` function) will be automatically committed to storage +/// when dropped. Changes, even after committed, may be reverted to their original values with the /// `revert` function. pub struct ExtraMutator, I: 'static = ()> { id: T::AssetId, diff --git a/bizinikiwi/pezframe/assets/src/functions.rs b/bizinikiwi/pezframe/assets/src/functions.rs index 9df2cec5..2d379036 100644 --- a/bizinikiwi/pezframe/assets/src/functions.rs +++ b/bizinikiwi/pezframe/assets/src/functions.rs @@ -160,7 +160,9 @@ impl, I: 'static> Pezpallet { if amount < details.min_balance { return DepositConsequence::BelowMinimum; } - if !details.is_sufficient && !pezframe_system::Pezpallet::::can_accrue_consumers(who, 2) { + if !details.is_sufficient && + !pezframe_system::Pezpallet::::can_accrue_consumers(who, 2) + { return DepositConsequence::CannotCreate; } if details.is_sufficient && details.sufficients.checked_add(1).is_none() { diff --git a/bizinikiwi/pezframe/assets/src/impl_fungibles.rs b/bizinikiwi/pezframe/assets/src/impl_fungibles.rs index 4aa3d13f..29100995 100644 --- a/bizinikiwi/pezframe/assets/src/impl_fungibles.rs +++ b/bizinikiwi/pezframe/assets/src/impl_fungibles.rs @@ -30,7 +30,9 @@ use pezframe_support::{ use super::*; -impl, I: 'static> fungibles::Inspect<::AccountId> for Pezpallet { +impl, I: 'static> fungibles::Inspect<::AccountId> + for Pezpallet +{ type AssetId = T::AssetId; type Balance = T::Balance; @@ -83,7 +85,9 @@ impl, I: 'static> fungibles::Inspect<::AccountId } } -impl, I: 'static> fungibles::Mutate<::AccountId> for Pezpallet { +impl, I: 'static> fungibles::Mutate<::AccountId> + for Pezpallet +{ fn done_mint_into( asset_id: Self::AssetId, beneficiary: &::AccountId, diff --git a/bizinikiwi/pezframe/assets/src/lib.rs b/bizinikiwi/pezframe/assets/src/lib.rs index beb04cf8..51cbb106 100644 --- a/bizinikiwi/pezframe/assets/src/lib.rs +++ b/bizinikiwi/pezframe/assets/src/lib.rs @@ -21,8 +21,8 @@ //! [`fungible`](pezframe_support::traits::fungible) traits, via [`fungibles`] traits. //! //! The pezpallet makes heavy use of concepts such as Holds and Freezes from the -//! [`pezframe_support::traits::fungible`] traits, therefore you should read and understand those docs -//! as a prerequisite to understanding this pezpallet. +//! [`pezframe_support::traits::fungible`] traits, therefore you should read and understand those +//! docs as a prerequisite to understanding this pezpallet. //! //! See the [`frame_tokens`] reference docs for more information about the place of the //! Assets pezpallet in FRAME. @@ -171,11 +171,11 @@ pub use types::*; extern crate alloc; extern crate core; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{AtLeast32BitUnsigned, CheckedAdd, CheckedSub, Saturating, StaticLookup, Zero}, ArithmeticError, DispatchError, TokenError, }; +use scale_info::TypeInfo; use alloc::vec::Vec; use core::{fmt::Debug, marker::PhantomData}; @@ -1951,7 +1951,9 @@ pub mod pezpallet { /// Implements [`ProvideAssetReserves`] trait for getting the list of trusted reserves for a /// given asset. - impl, I: 'static> ProvideAssetReserves for Pezpallet { + impl, I: 'static> ProvideAssetReserves + for Pezpallet + { /// Provide the configured reserves for asset `id`. fn reserves(id: &T::AssetId) -> Vec { Reserves::::get(id).into_inner() diff --git a/bizinikiwi/pezframe/assets/src/migration.rs b/bizinikiwi/pezframe/assets/src/migration.rs index 798f2b40..44977a52 100644 --- a/bizinikiwi/pezframe/assets/src/migration.rs +++ b/bizinikiwi/pezframe/assets/src/migration.rs @@ -16,8 +16,8 @@ // limitations under the License. use super::*; -use pezframe_support::traits::OnRuntimeUpgrade; use log; +use pezframe_support::traits::OnRuntimeUpgrade; #[cfg(feature = "try-runtime")] use pezsp_runtime::TryRuntimeError; diff --git a/bizinikiwi/pezframe/atomic-swap/src/lib.rs b/bizinikiwi/pezframe/atomic-swap/src/lib.rs index 37c8069a..59a392cb 100644 --- a/bizinikiwi/pezframe/atomic-swap/src/lib.rs +++ b/bizinikiwi/pezframe/atomic-swap/src/lib.rs @@ -182,7 +182,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Swap action. type SwapAction: SwapAction + Parameter + MaxEncodedLen; /// Limit of proof size. diff --git a/bizinikiwi/pezframe/aura/src/lib.rs b/bizinikiwi/pezframe/aura/src/lib.rs index 70367b77..a2ce628e 100644 --- a/bizinikiwi/pezframe/aura/src/lib.rs +++ b/bizinikiwi/pezframe/aura/src/lib.rs @@ -42,11 +42,11 @@ extern crate alloc; use alloc::vec::Vec; use codec::{Decode, Encode, MaxEncodedLen}; +use log; use pezframe_support::{ traits::{DisabledValidators, FindAuthor, Get, OnTimestampSet, OneSessionHandler}, BoundedSlice, BoundedVec, ConsensusEngineId, Parameter, }; -use log; use pezsp_consensus_aura::{AuthorityIndex, ConsensusLog, Slot, AURA_ENGINE_ID}; use pezsp_runtime::{ generic::DigestItem, @@ -101,15 +101,15 @@ pub mod pezpallet { /// Whether to allow block authors to create multiple blocks per slot. /// /// If this is `true`, the pezpallet will allow slots to stay the same across sequential - /// blocks. If this is `false`, the pezpallet will require that subsequent blocks always have - /// higher slots than previous ones. + /// blocks. If this is `false`, the pezpallet will require that subsequent blocks always + /// have higher slots than previous ones. /// /// Regardless of the setting of this storage value, the pezpallet will always enforce the /// invariant that slots don't move backwards as the chain progresses. /// /// The typical value for this should be 'false' unless this pezpallet is being augmented by - /// another pezpallet which enforces some limitation on the number of blocks authors can create - /// using the same slot. + /// another pezpallet which enforces some limitation on the number of blocks authors can + /// create using the same slot. type AllowMultipleBlocksPerSlot: Get; /// The slot duration Aura should run with, expressed in milliseconds. diff --git a/bizinikiwi/pezframe/authority-discovery/src/lib.rs b/bizinikiwi/pezframe/authority-discovery/src/lib.rs index 0925a8d9..b27d18d2 100644 --- a/bizinikiwi/pezframe/authority-discovery/src/lib.rs +++ b/bizinikiwi/pezframe/authority-discovery/src/lib.rs @@ -256,8 +256,8 @@ mod tests { #[test] fn authorities_returns_current_and_next_authority_set() { // The whole authority discovery pezpallet ignores account ids, but we still need them for - // `pezpallet_session::OneSessionHandler::on_new_session`, thus its safe to use the same value - // everywhere. + // `pezpallet_session::OneSessionHandler::on_new_session`, thus its safe to use the same + // value everywhere. let account_id = AuthorityPair::from_seed_slice(vec![10; 32].as_ref()).unwrap().public(); let mut first_authorities: Vec = vec![0, 1] diff --git a/bizinikiwi/pezframe/babe/src/equivocation.rs b/bizinikiwi/pezframe/babe/src/equivocation.rs index d30d4cb8..65f5a36c 100644 --- a/bizinikiwi/pezframe/babe/src/equivocation.rs +++ b/bizinikiwi/pezframe/babe/src/equivocation.rs @@ -34,9 +34,9 @@ //! definition. use alloc::{boxed::Box, vec, vec::Vec}; +use log::{error, info}; use pezframe_support::traits::{Get, KeyOwnerProofSystem}; use pezframe_system::pezpallet_prelude::HeaderFor; -use log::{error, info}; use pezsp_consensus_babe::{AuthorityId, EquivocationProof, Slot, KEY_TYPE}; use pezsp_runtime::{ diff --git a/bizinikiwi/pezframe/babe/src/mock.rs b/bizinikiwi/pezframe/babe/src/mock.rs index c29bd834..b10be8b7 100644 --- a/bizinikiwi/pezframe/babe/src/mock.rs +++ b/bizinikiwi/pezframe/babe/src/mock.rs @@ -279,7 +279,11 @@ pub fn make_secondary_vrf_pre_digest( vrf_signature: VrfSignature, ) -> Digest { let digest_data = pezsp_consensus_babe::digests::PreDigest::SecondaryVRF( - pezsp_consensus_babe::digests::SecondaryVRFPreDigest { authority_index, slot, vrf_signature }, + pezsp_consensus_babe::digests::SecondaryVRFPreDigest { + authority_index, + slot, + vrf_signature, + }, ); let log = DigestItem::PreRuntime(pezsp_consensus_babe::BABE_ENGINE_ID, digest_data.encode()); Digest { logs: vec![log] } @@ -289,11 +293,15 @@ pub fn make_vrf_signature_and_randomness( slot: Slot, pair: &pezsp_consensus_babe::AuthorityPair, ) -> (VrfSignature, Randomness) { - let transcript = - pezsp_consensus_babe::make_vrf_transcript(&pezpallet_babe::Randomness::::get(), slot, 0); + let transcript = pezsp_consensus_babe::make_vrf_transcript( + &pezpallet_babe::Randomness::::get(), + slot, + 0, + ); - let randomness = - pair.as_ref().make_bytes(pezsp_consensus_babe::RANDOMNESS_VRF_CONTEXT, &transcript); + let randomness = pair + .as_ref() + .make_bytes(pezsp_consensus_babe::RANDOMNESS_VRF_CONTEXT, &transcript); let signature = pair.as_ref().vrf_sign(&transcript.into()); diff --git a/bizinikiwi/pezframe/babe/src/tests.rs b/bizinikiwi/pezframe/babe/src/tests.rs index ae86f288..6d1d8cc5 100644 --- a/bizinikiwi/pezframe/babe/src/tests.rs +++ b/bizinikiwi/pezframe/babe/src/tests.rs @@ -18,12 +18,12 @@ //! Consensus extension module tests for BABE consensus. use super::{Call, *}; +use mock::*; use pezframe_support::{ assert_err, assert_noop, assert_ok, dispatch::{GetDispatchInfo, Pays}, traits::{Currency, EstimateNextSessionRotation, KeyOwnerProofSystem, OnFinalize}, }; -use mock::*; use pezpallet_session::ShouldEndSession; use pezsp_consensus_babe::{ AllowedSlots, BabeEpochConfiguration, Slot, VrfSignature, RANDOMNESS_LENGTH, diff --git a/bizinikiwi/pezframe/bags-list/fuzzer/src/main.rs b/bizinikiwi/pezframe/bags-list/fuzzer/src/main.rs index 7c6e4ecd..0e99ee1c 100644 --- a/bizinikiwi/pezframe/bags-list/fuzzer/src/main.rs +++ b/bizinikiwi/pezframe/bags-list/fuzzer/src/main.rs @@ -27,8 +27,8 @@ //! More information about `honggfuzz` can be found //! [here](https://docs.rs/honggfuzz/). -use pezframe_election_provider_support::{SortedListProvider, VoteWeight}; use honggfuzz::fuzz; +use pezframe_election_provider_support::{SortedListProvider, VoteWeight}; use pezpallet_bags_list::mock::{AccountId, BagsList, ExtBuilder}; const ID_RANGE: AccountId = 25_000; diff --git a/bizinikiwi/pezframe/bags-list/remote-tests/src/lib.rs b/bizinikiwi/pezframe/bags-list/remote-tests/src/lib.rs index 4d2edf75..0eb153e9 100644 --- a/bizinikiwi/pezframe/bags-list/remote-tests/src/lib.rs +++ b/bizinikiwi/pezframe/bags-list/remote-tests/src/lib.rs @@ -63,7 +63,8 @@ pub fn display_and_check_bags>( let mut seen_in_bags = 0; let mut rebaggable = 0; let mut active_bags = 0; - for vote_weight_thresh in >::BagThresholds::get() + for vote_weight_thresh in + >::BagThresholds::get() { let vote_weight_thresh_u64: u64 = (*vote_weight_thresh) .try_into() diff --git a/bizinikiwi/pezframe/bags-list/remote-tests/src/migration.rs b/bizinikiwi/pezframe/bags-list/remote-tests/src/migration.rs index f20ae497..e5fb9e4b 100644 --- a/bizinikiwi/pezframe/bags-list/remote-tests/src/migration.rs +++ b/bizinikiwi/pezframe/bags-list/remote-tests/src/migration.rs @@ -19,8 +19,8 @@ use crate::{RuntimeT, LOG_TARGET}; use pezframe_support::traits::PalletInfoAccess; use pezpallet_staking::Nominators; -use remote_externalities::{Builder, Mode, OnlineConfig}; use pezsp_runtime::{traits::Block as BlockT, DeserializeOwned}; +use remote_externalities::{Builder, Mode, OnlineConfig}; /// Test voter bags migration. `currency_unit` is the number of planks per the the runtimes `UNITS` /// (i.e. number of decimal places per HEZ, KSM etc) @@ -56,7 +56,8 @@ pub async fn execute( ); log::info!(target: LOG_TARGET, "Moved {} nominators", moved); - let voter_list_len = ::VoterList::iter().count() as u32; + let voter_list_len = + ::VoterList::iter().count() as u32; let voter_list_count = ::VoterList::count(); // and confirm it is equal to the length of the `VoterList`. assert_eq!(pre_migrate_nominator_count, voter_list_len); diff --git a/bizinikiwi/pezframe/bags-list/remote-tests/src/snapshot.rs b/bizinikiwi/pezframe/bags-list/remote-tests/src/snapshot.rs index baee0d4e..09b9a9e3 100644 --- a/bizinikiwi/pezframe/bags-list/remote-tests/src/snapshot.rs +++ b/bizinikiwi/pezframe/bags-list/remote-tests/src/snapshot.rs @@ -21,11 +21,11 @@ use pezframe_election_provider_support::{ SortedListProvider, }; use pezframe_support::traits::PalletInfoAccess; -use remote_externalities::{Builder, Mode, OnlineConfig}; use pezsp_runtime::{ traits::{Block as BlockT, Zero}, DeserializeOwned, }; +use remote_externalities::{Builder, Mode, OnlineConfig}; /// Execute create a snapshot from pezpallet-staking. pub async fn execute(voter_limit: Option, currency_unit: u64, ws_url: String) @@ -39,10 +39,12 @@ where let mut ext = Builder::::new() .mode(Mode::Online(OnlineConfig { transport: ws_url.to_string().into(), - // NOTE: we don't scrape pezpallet-staking, this kinda ensures that the source of the data - // is bags-list. - pallets: vec![pezpallet_bags_list::Pezpallet::::name() - .to_string()], + // NOTE: we don't scrape pezpallet-staking, this kinda ensures that the source of the + // data is bags-list. + pallets: vec![ + pezpallet_bags_list::Pezpallet::::name() + .to_string(), + ], at: None, hashed_prefixes: vec![ >::prefix_hash().to_vec(), diff --git a/bizinikiwi/pezframe/bags-list/remote-tests/src/try_state.rs b/bizinikiwi/pezframe/bags-list/remote-tests/src/try_state.rs index fa99e7cc..236012ba 100644 --- a/bizinikiwi/pezframe/bags-list/remote-tests/src/try_state.rs +++ b/bizinikiwi/pezframe/bags-list/remote-tests/src/try_state.rs @@ -20,8 +20,8 @@ use pezframe_support::{ storage::generator::StorageMap, traits::{Get, PalletInfoAccess}, }; -use remote_externalities::{Builder, Mode, OnlineConfig}; use pezsp_runtime::{traits::Block as BlockT, DeserializeOwned}; +use remote_externalities::{Builder, Mode, OnlineConfig}; /// Execute the sanity check of the bags-list. pub async fn execute( @@ -36,8 +36,10 @@ pub async fn execute( let mut ext = Builder::::new() .mode(Mode::Online(OnlineConfig { transport: ws_url.to_string().into(), - pallets: vec![pezpallet_bags_list::Pezpallet::::name() - .to_string()], + pallets: vec![ + pezpallet_bags_list::Pezpallet::::name() + .to_string(), + ], hashed_prefixes: vec![ >::prefix_hash().to_vec(), >::prefix_hash().to_vec(), @@ -49,9 +51,12 @@ pub async fn execute( .unwrap(); ext.execute_with(|| { - pezsp_core::crypto::set_default_ss58_version(Runtime::SS58Prefix::get().try_into().unwrap()); + pezsp_core::crypto::set_default_ss58_version( + Runtime::SS58Prefix::get().try_into().unwrap(), + ); - pezpallet_bags_list::Pezpallet::::do_try_state().unwrap(); + pezpallet_bags_list::Pezpallet::::do_try_state() + .unwrap(); log::info!(target: crate::LOG_TARGET, "executed bags-list sanity check with no errors."); diff --git a/bizinikiwi/pezframe/bags-list/src/lib.rs b/bizinikiwi/pezframe/bags-list/src/lib.rs index 86447817..3125fcd9 100644 --- a/bizinikiwi/pezframe/bags-list/src/lib.rs +++ b/bizinikiwi/pezframe/bags-list/src/lib.rs @@ -36,22 +36,22 @@ //! including its configuration trait, dispatchables, storage items, events and errors. //! //! This pezpallet provides an implementation of -//! [`pezframe_election_provider_support::SortedListProvider`] and it can typically be used by another -//! pezpallet via this API. +//! [`pezframe_election_provider_support::SortedListProvider`] and it can typically be used by +//! another pezpallet via this API. //! //! ## Overview //! -//! This pezpallet splits `AccountId`s into different bags. Within a bag, these `AccountId`s are stored -//! as nodes in a linked-list manner. This pezpallet then provides iteration over all bags, which -//! basically allows an infinitely large list of items to be kept in a sorted manner. +//! This pezpallet splits `AccountId`s into different bags. Within a bag, these `AccountId`s are +//! stored as nodes in a linked-list manner. This pezpallet then provides iteration over all bags, +//! which basically allows an infinitely large list of items to be kept in a sorted manner. //! //! Each bags has a upper and lower range of scores, denoted by [`Config::BagThresholds`]. All nodes -//! within a bag must be within the range of the bag. If not, the permissionless [`Pezpallet::rebag`] -//! can be used to move any node to the right bag. +//! within a bag must be within the range of the bag. If not, the permissionless +//! [`Pezpallet::rebag`] can be used to move any node to the right bag. //! //! Once a `rebag` happens, the order within a node is still not enforced. To move a node to the -//! optimal position in a bag, the [`Pezpallet::put_in_front_of`] or [`Pezpallet::put_in_front_of_other`] -//! can be used. +//! optimal position in a bag, the [`Pezpallet::put_in_front_of`] or +//! [`Pezpallet::put_in_front_of_other`] can be used. //! //! Additional reading, about how this pezpallet is used in the context of Pezkuwi's staking system: //! @@ -217,7 +217,8 @@ pub mod pezpallet { /// there exists some constant ratio such that `threshold[k + 1] == (threshold[k] * /// constant_ratio).max(threshold[k] + 1)` for all `k`. /// - /// The helpers in the `/utils/pezframe/pez-generate-bags` module can simplify this calculation. + /// The helpers in the `/utils/pezframe/pez-generate-bags` module can simplify this + /// calculation. /// /// # Examples /// @@ -332,9 +333,9 @@ pub mod pezpallet { impl, I: 'static> Pezpallet { /// Get the current `score` of a given account. /// - /// Returns `(current, real_score)`, the former being the current score that this pezpallet is - /// aware of, which may or may not be up to date, and the latter being the real score, as - /// provided by + /// Returns `(current, real_score)`, the former being the current score that this pezpallet + /// is aware of, which may or may not be up to date, and the latter being the real score, + /// as provided by // [`Config::ScoreProvider`]. /// /// If the two differ, it means this node is eligible for [`Call::rebag`]. diff --git a/bizinikiwi/pezframe/bags-list/src/list/mod.rs b/bizinikiwi/pezframe/bags-list/src/list/mod.rs index 1afa4886..a81b341f 100644 --- a/bizinikiwi/pezframe/bags-list/src/list/mod.rs +++ b/bizinikiwi/pezframe/bags-list/src/list/mod.rs @@ -37,8 +37,8 @@ use pezframe_support::{ traits::{Defensive, DefensiveOption, Get}, CloneNoBound, DefaultNoBound, EqNoBound, PalletError, PartialEqNoBound, RuntimeDebugNoBound, }; -use scale_info::TypeInfo; use pezsp_runtime::traits::{Bounded, Zero}; +use scale_info::TypeInfo; #[cfg(any( test, @@ -595,7 +595,10 @@ impl, I: 'static> List { let expected_bag = bags_map .get(&node.bag_upper) .ok_or("bag not found for the node in active bags")?; - pezframe_support::ensure!(expected_bag.contains(node.id()), "node not found in the bag"); + pezframe_support::ensure!( + expected_bag.contains(node.id()), + "node not found in the bag" + ); // verify node state node.do_try_state()? diff --git a/bizinikiwi/pezframe/bags-list/src/list/tests.rs b/bizinikiwi/pezframe/bags-list/src/list/tests.rs index fa8e284d..a0ea1c2d 100644 --- a/bizinikiwi/pezframe/bags-list/src/list/tests.rs +++ b/bizinikiwi/pezframe/bags-list/src/list/tests.rs @@ -372,8 +372,11 @@ mod list { // we do some wacky stuff here to get access to the counter, since it is (reasonably) // not exposed as mutable in any sense. #[pezframe_support::storage_alias] - type CounterForListNodes = - StorageValue, u32, pezframe_support::pezpallet_prelude::ValueQuery>; + type CounterForListNodes = StorageValue< + crate::Pezpallet, + u32, + pezframe_support::pezpallet_prelude::ValueQuery, + >; CounterForListNodes::::mutate(|counter| *counter += 1); assert_eq!(crate::ListNodes::::count(), 5); diff --git a/bizinikiwi/pezframe/bags-list/src/tests.rs b/bizinikiwi/pezframe/bags-list/src/tests.rs index 41b16212..796acbfb 100644 --- a/bizinikiwi/pezframe/bags-list/src/tests.rs +++ b/bizinikiwi/pezframe/bags-list/src/tests.rs @@ -18,10 +18,10 @@ use pezframe_support::{assert_noop, assert_ok, assert_storage_noop, traits::IntegrityTest}; use super::*; -use pezframe_election_provider_support::{SortedListProvider, VoteWeight}; +use bizinikiwi_test_utils::assert_eq_uvec; use list::Bag; use mock::{test_utils::*, *}; -use bizinikiwi_test_utils::assert_eq_uvec; +use pezframe_election_provider_support::{SortedListProvider, VoteWeight}; #[docify::export] #[test] diff --git a/bizinikiwi/pezframe/balances/src/impl_currency.rs b/bizinikiwi/pezframe/balances/src/impl_currency.rs index acdae703..b644a177 100644 --- a/bizinikiwi/pezframe/balances/src/impl_currency.rs +++ b/bizinikiwi/pezframe/balances/src/impl_currency.rs @@ -21,6 +21,7 @@ //! are expected to be removed in the near future, once migration to `fungible::*` traits is done. use super::*; +pub use imbalances::{NegativeImbalance, PositiveImbalance}; use pezframe_support::{ ensure, pezpallet_prelude::DispatchResult, @@ -33,7 +34,6 @@ use pezframe_support::{ }, }; use pezframe_system::pezpallet_prelude::BlockNumberFor; -pub use imbalances::{NegativeImbalance, PositiveImbalance}; use pezsp_runtime::traits::Bounded; // wrapping these imbalances in a private module is necessary to ensure absolute privacy diff --git a/bizinikiwi/pezframe/balances/src/impl_fungible.rs b/bizinikiwi/pezframe/balances/src/impl_fungible.rs index f2970853..b7792f9b 100644 --- a/bizinikiwi/pezframe/balances/src/impl_fungible.rs +++ b/bizinikiwi/pezframe/balances/src/impl_fungible.rs @@ -126,8 +126,8 @@ impl, I: 'static> fungible::Inspect for Pezpallet::can_dec_provider(who) { diff --git a/bizinikiwi/pezframe/balances/src/lib.rs b/bizinikiwi/pezframe/balances/src/lib.rs index 7540096a..fc149c6d 100644 --- a/bizinikiwi/pezframe/balances/src/lib.rs +++ b/bizinikiwi/pezframe/balances/src/lib.rs @@ -21,8 +21,8 @@ //! token. //! //! It makes heavy use of concepts such as Holds and Freezes from the -//! [`pezframe_support::traits::fungible`] traits, therefore you should read and understand those docs -//! as a prerequisite to understanding this pezpallet. +//! [`pezframe_support::traits::fungible`] traits, therefore you should read and understand those +//! docs as a prerequisite to understanding this pezpallet. //! //! Also see the [`frame_tokens`] reference docs for higher level information regarding the //! place of this palet in FRAME. @@ -81,8 +81,8 @@ //! //! ### Examples from the FRAME //! -//! The Contract pezpallet uses the `Currency` trait to handle gas payment, and its types inherit from -//! `Currency`: +//! The Contract pezpallet uses the `Currency` trait to handle gas payment, and its types inherit +//! from `Currency`: //! //! ``` //! use pezframe_support::traits::Currency; @@ -159,6 +159,7 @@ use alloc::{ }; use codec::{Codec, MaxEncodedLen}; use core::{cmp, fmt::Debug, mem, result}; +pub use impl_currency::{NegativeImbalance, PositiveImbalance}; use pezframe_support::{ ensure, pezpallet_prelude::DispatchResult, @@ -175,8 +176,6 @@ use pezframe_support::{ BoundedSlice, WeakBoundedVec, }; use pezframe_system as system; -pub use impl_currency::{NegativeImbalance, PositiveImbalance}; -use scale_info::TypeInfo; use pezsp_core::{sr25519::Pair as SrPair, Pair}; use pezsp_runtime::{ traits::{ @@ -185,6 +184,7 @@ use pezsp_runtime::{ }, ArithmeticError, DispatchError, FixedPointOperand, Perbill, RuntimeDebug, TokenError, }; +use scale_info::TypeInfo; pub use types::{ AccountData, AdjustmentDirection, BalanceLock, DustCleaner, ExtraFlags, Reasons, ReserveData, @@ -288,9 +288,9 @@ pub mod pezpallet { /// The minimum amount required to keep an account open. MUST BE GREATER THAN ZERO! /// /// If you *really* need it to be zero, you can enable the feature `insecure_zero_ed` for - /// this pezpallet. However, you do so at your own risk: this will open up a major DoS vector. - /// In case you have multiple sources of provider references, you may also get unexpected - /// behaviour if you set this to zero. + /// this pezpallet. However, you do so at your own risk: this will open up a major DoS + /// vector. In case you have multiple sources of provider references, you may also get + /// unexpected behaviour if you set this to zero. /// /// Bottom line: Do yourself a favour and make it at least one! #[pezpallet::constant] @@ -497,8 +497,8 @@ pub mod pezpallet { /// ``` /// /// But this comes with tradeoffs, storing account balances in the system pezpallet stores - /// `pezframe_system` data alongside the account data contrary to storing account balances in the - /// `Balances` pezpallet, which uses a `StorageMap` to store balances data only. + /// `pezframe_system` data alongside the account data contrary to storing account balances in + /// the `Balances` pezpallet, which uses a `StorageMap` to store balances data only. /// NOTE: This is only used in the case that this pezpallet is used to store balances. #[pezpallet::storage] pub type Account, I: 'static = ()> = @@ -1151,7 +1151,10 @@ pub mod pezpallet { }); } if let Some(amount) = maybe_dust { - Pezpallet::::deposit_event(Event::DustLost { account: who.clone(), amount }); + Pezpallet::::deposit_event(Event::DustLost { + account: who.clone(), + amount, + }); } (result, maybe_dust) }) diff --git a/bizinikiwi/pezframe/balances/src/tests/dispatchable_tests.rs b/bizinikiwi/pezframe/balances/src/tests/dispatchable_tests.rs index 7006ec6e..d13fc1e2 100644 --- a/bizinikiwi/pezframe/balances/src/tests/dispatchable_tests.rs +++ b/bizinikiwi/pezframe/balances/src/tests/dispatchable_tests.rs @@ -22,8 +22,8 @@ use crate::{ AdjustmentDirection::{Decrease as Dec, Increase as Inc}, Event, }; -use pezframe_support::traits::{fungible::Unbalanced, tokens::Preservation::Expendable}; use fungible::{hold::Mutate as HoldMutate, Inspect, Mutate}; +use pezframe_support::traits::{fungible::Unbalanced, tokens::Preservation::Expendable}; /// Alice account ID for more readable tests. const ALICE: u64 = 1; diff --git a/bizinikiwi/pezframe/balances/src/tests/fungible_conformance_tests.rs b/bizinikiwi/pezframe/balances/src/tests/fungible_conformance_tests.rs index a666e48b..44a262a0 100644 --- a/bizinikiwi/pezframe/balances/src/tests/fungible_conformance_tests.rs +++ b/bizinikiwi/pezframe/balances/src/tests/fungible_conformance_tests.rs @@ -16,8 +16,8 @@ // limitations under the License. use super::*; -use pezframe_support::traits::fungible::{conformance_tests, Inspect, Mutate}; use paste::paste; +use pezframe_support::traits::fungible::{conformance_tests, Inspect, Mutate}; macro_rules! generate_tests { // Handle a conformance test that requires special testing with and without a dust trap. diff --git a/bizinikiwi/pezframe/balances/src/tests/fungible_tests.rs b/bizinikiwi/pezframe/balances/src/tests/fungible_tests.rs index 01bf8592..75ab63d5 100644 --- a/bizinikiwi/pezframe/balances/src/tests/fungible_tests.rs +++ b/bizinikiwi/pezframe/balances/src/tests/fungible_tests.rs @@ -18,6 +18,10 @@ //! Tests regarding the functionality of the `fungible` trait set implementations. use super::*; +use fungible::{ + FreezeConsideration, HoldConsideration, Inspect, InspectFreeze, InspectHold, + LoneFreezeConsideration, LoneHoldConsideration, Mutate, MutateFreeze, MutateHold, Unbalanced, +}; use pezframe_support::traits::{ tokens::{ Fortitude::{Force, Polite}, @@ -27,10 +31,6 @@ use pezframe_support::traits::{ }, Consideration, Footprint, LinearStoragePrice, MaybeConsideration, }; -use fungible::{ - FreezeConsideration, HoldConsideration, Inspect, InspectFreeze, InspectHold, - LoneFreezeConsideration, LoneHoldConsideration, Mutate, MutateFreeze, MutateHold, Unbalanced, -}; use pezsp_core::ConstU64; #[test] diff --git a/bizinikiwi/pezframe/balances/src/tests/mod.rs b/bizinikiwi/pezframe/balances/src/tests/mod.rs index 1f33be61..2f5d2054 100644 --- a/bizinikiwi/pezframe/balances/src/tests/mod.rs +++ b/bizinikiwi/pezframe/balances/src/tests/mod.rs @@ -36,7 +36,6 @@ use pezframe_support::{ }; use pezframe_system::{self as system, RawOrigin}; use pezpallet_transaction_payment::{ChargeTransactionPayment, FungibleAdapter, Multiplier}; -use scale_info::TypeInfo; use pezsp_core::{hexdisplay::HexDisplay, sr25519::Pair as SrPair, Pair}; use pezsp_io; use pezsp_runtime::{ @@ -44,6 +43,7 @@ use pezsp_runtime::{ ArithmeticError, BuildStorage, DispatchError, DispatchResult, FixedPointNumber, RuntimeDebug, TokenError, }; +use scale_info::TypeInfo; use std::collections::BTreeSet; mod consumer_limit_tests; @@ -371,8 +371,8 @@ fn check_whitelist() { assert!(whitelist.contains("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80")); } -/// This pezpallet runs tests twice, once with system as `type AccountStore` and once this pezpallet. This -/// function will return the right value based on the `UseSystem` flag. +/// This pezpallet runs tests twice, once with system as `type AccountStore` and once this +/// pezpallet. This function will return the right value based on the `UseSystem` flag. pub(crate) fn get_test_account_data(who: AccountId) -> AccountData { if UseSystem::get() { >::get(&who) @@ -381,8 +381,8 @@ pub(crate) fn get_test_account_data(who: AccountId) -> AccountData { } } -/// Same as `get_test_account_data`, but returns a `pezframe_system::AccountInfo` with the data filled -/// in. +/// Same as `get_test_account_data`, but returns a `pezframe_system::AccountInfo` with the data +/// filled in. pub(crate) fn get_test_account( who: AccountId, ) -> pezframe_system::AccountInfo> { diff --git a/bizinikiwi/pezframe/balances/src/tests/reentrancy_tests.rs b/bizinikiwi/pezframe/balances/src/tests/reentrancy_tests.rs index a16a0c7e..86120161 100644 --- a/bizinikiwi/pezframe/balances/src/tests/reentrancy_tests.rs +++ b/bizinikiwi/pezframe/balances/src/tests/reentrancy_tests.rs @@ -18,12 +18,12 @@ //! Tests regarding the reentrancy functionality. use super::*; +use fungible::Balanced; use pezframe_support::traits::tokens::{ Fortitude::Force, Precision::BestEffort, Preservation::{Expendable, Protect}, }; -use fungible::Balanced; #[test] fn transfer_dust_removal_tst1_should_work() { diff --git a/bizinikiwi/pezframe/balances/src/types.rs b/bizinikiwi/pezframe/balances/src/types.rs index 201a211e..643072e5 100644 --- a/bizinikiwi/pezframe/balances/src/types.rs +++ b/bizinikiwi/pezframe/balances/src/types.rs @@ -21,8 +21,8 @@ use crate::{Config, CreditOf, Event, Pezpallet}; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::ops::BitOr; use pezframe_support::traits::{Imbalance, LockIdentifier, OnUnbalanced, WithdrawReasons}; -use scale_info::TypeInfo; use pezsp_runtime::{RuntimeDebug, Saturating}; +use scale_info::TypeInfo; /// Simplified reasons for withdrawing balance. #[derive( diff --git a/bizinikiwi/pezframe/beefy-mmr/src/lib.rs b/bizinikiwi/pezframe/beefy-mmr/src/lib.rs index a3e0ca9d..1931d18e 100644 --- a/bizinikiwi/pezframe/beefy-mmr/src/lib.rs +++ b/bizinikiwi/pezframe/beefy-mmr/src/lib.rs @@ -67,7 +67,8 @@ mod weights; /// A BEEFY consensus digest item with MMR root hash. pub struct DepositBeefyDigest(core::marker::PhantomData); -impl pezpallet_mmr::primitives::OnNewRoot for DepositBeefyDigest +impl pezpallet_mmr::primitives::OnNewRoot + for DepositBeefyDigest where T: pezpallet_mmr::Config, T: pezpallet_beefy::Config, @@ -97,7 +98,8 @@ impl Convert> for Beef } } -type MerkleRootOf = <::Hashing as pezsp_runtime::traits::Hash>::Output; +type MerkleRootOf = + <::Hashing as pezsp_runtime::traits::Hash>::Output; #[pezframe_support::pezpallet] pub mod pezpallet { @@ -126,7 +128,10 @@ pub mod pezpallet { /// and later to Ethereum Addresses (160 bits) to simplify using them on Ethereum chain, /// but the rest of the Bizinikiwi codebase is storing them compressed (33 bytes) for /// efficiency reasons. - type BeefyAuthorityToMerkleLeaf: Convert<::BeefyId, Vec>; + type BeefyAuthorityToMerkleLeaf: Convert< + ::BeefyId, + Vec, + >; /// The type expected for the leaf extra data type LeafExtra: Member + codec::FullCodec; @@ -168,7 +173,8 @@ impl LeafDataProvider for Pezpallet { } } -impl pezsp_consensus_beefy::OnNewValidatorSet<::BeefyId> for Pezpallet +impl pezsp_consensus_beefy::OnNewValidatorSet<::BeefyId> + for Pezpallet where T: pezpallet::Config, { diff --git a/bizinikiwi/pezframe/beefy/src/equivocation.rs b/bizinikiwi/pezframe/beefy/src/equivocation.rs index 2edeed5f..084fe05c 100644 --- a/bizinikiwi/pezframe/beefy/src/equivocation.rs +++ b/bizinikiwi/pezframe/beefy/src/equivocation.rs @@ -36,9 +36,9 @@ use alloc::{vec, vec::Vec}; use codec::{self as codec, Decode, Encode}; +use log::{error, info}; use pezframe_support::traits::{Get, KeyOwnerProofSystem}; use pezframe_system::pezpallet_prelude::{BlockNumberFor, HeaderFor}; -use log::{error, info}; use pezsp_consensus_beefy::{ check_commitment_signature, AncestryHelper, DoubleVotingProof, ForkVotingProof, FutureBlockVotingProof, ValidatorSetId, KEY_TYPE as BEEFY_KEY_TYPE, diff --git a/bizinikiwi/pezframe/beefy/src/mock.rs b/bizinikiwi/pezframe/beefy/src/mock.rs index 2f28dd2e..1638202a 100644 --- a/bizinikiwi/pezframe/beefy/src/mock.rs +++ b/bizinikiwi/pezframe/beefy/src/mock.rs @@ -26,7 +26,6 @@ use pezframe_support::{ }; use pezframe_system::pezpallet_prelude::HeaderFor; use pezpallet_session::historical as pezpallet_session_historical; -use scale_info::TypeInfo; use pezsp_core::{crypto::KeyTypeId, ConstBool, ConstU128}; use pezsp_runtime::{ app_crypto::ecdsa::Public, @@ -38,10 +37,13 @@ use pezsp_runtime::{ }; use pezsp_staking::{EraIndex, SessionIndex}; use pezsp_state_machine::BasicExternalities; +use scale_info::TypeInfo; use crate as pezpallet_beefy; -pub use pezsp_consensus_beefy::{ecdsa_crypto::AuthorityId as BeefyId, ConsensusLog, BEEFY_ENGINE_ID}; +pub use pezsp_consensus_beefy::{ + ecdsa_crypto::AuthorityId as BeefyId, ConsensusLog, BEEFY_ENGINE_ID, +}; use pezsp_consensus_beefy::{AncestryHelper, AncestryHelperWeightInfo, Commitment}; impl_opaque_keys! { @@ -304,7 +306,9 @@ impl ExtBuilder { // controllers are same as stash let stakers: Vec<_> = (0..self.authorities.len()) - .map(|i| (i as u64, i as u64, 10_000, pezpallet_staking::StakerStatus::::Validator)) + .map(|i| { + (i as u64, i as u64, 10_000, pezpallet_staking::StakerStatus::::Validator) + }) .collect(); let staking_config = pezpallet_staking::GenesisConfig:: { diff --git a/bizinikiwi/pezframe/benchmarking/pov/src/benchmarking.rs b/bizinikiwi/pezframe/benchmarking/pov/src/benchmarking.rs index 7b169f8f..5b22feaa 100644 --- a/bizinikiwi/pezframe/benchmarking/pov/src/benchmarking.rs +++ b/bizinikiwi/pezframe/benchmarking/pov/src/benchmarking.rs @@ -445,6 +445,9 @@ mod mock { } pub fn new_test_ext() -> pezsp_io::TestExternalities { - pezframe_system::GenesisConfig::::default().build_storage().unwrap().into() + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } } diff --git a/bizinikiwi/pezframe/benchmarking/pov/src/lib.rs b/bizinikiwi/pezframe/benchmarking/pov/src/lib.rs index d2842ca6..214d9c5b 100644 --- a/bizinikiwi/pezframe/benchmarking/pov/src/lib.rs +++ b/bizinikiwi/pezframe/benchmarking/pov/src/lib.rs @@ -15,7 +15,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! End-to-end testing pezpallet for PoV benchmarking. Should only be deployed in a testing runtime. +//! End-to-end testing pezpallet for PoV benchmarking. Should only be deployed in a testing +//! runtime. #![cfg_attr(not(feature = "std"), no_std)] @@ -39,7 +40,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::storage] diff --git a/bizinikiwi/pezframe/benchmarking/src/lib.rs b/bizinikiwi/pezframe/benchmarking/src/lib.rs index 5bef6add..8ecf55d6 100644 --- a/bizinikiwi/pezframe/benchmarking/src/lib.rs +++ b/bizinikiwi/pezframe/benchmarking/src/lib.rs @@ -39,9 +39,9 @@ pub mod v1; pub mod __private { pub use alloc::{boxed::Box, str, vec, vec::Vec}; pub use codec; - pub use pezframe_support::{storage, traits}; pub use log; pub use paste; + pub use pezframe_support::{storage, traits}; pub use pezsp_core::defer; pub use pezsp_io::storage::root as storage_root; pub use pezsp_runtime::{traits::Zero, StateVersion}; diff --git a/bizinikiwi/pezframe/benchmarking/src/tests.rs b/bizinikiwi/pezframe/benchmarking/src/tests.rs index 54fac9ca..f18f82a4 100644 --- a/bizinikiwi/pezframe/benchmarking/src/tests.rs +++ b/bizinikiwi/pezframe/benchmarking/src/tests.rs @@ -351,7 +351,10 @@ mod benchmarks { Pezpallet::::test_benchmark_override_benchmark(), Err(BenchmarkError::Override(_)), )); - assert_eq!(Pezpallet::::test_benchmark_skip_benchmark(), Err(BenchmarkError::Skip),); + assert_eq!( + Pezpallet::::test_benchmark_skip_benchmark(), + Err(BenchmarkError::Skip), + ); }); } @@ -367,7 +370,10 @@ mod benchmarks { assert_eq!(Value::::get(), None); // It resets when the error happens in the call: - assert_err!(Pezpallet::::test_benchmark_modify_in_call_then_error(), "Should error"); + assert_err!( + Pezpallet::::test_benchmark_modify_in_call_then_error(), + "Should error" + ); assert_eq!(Value::::get(), None); // It resets when the error happens in the verify: diff --git a/bizinikiwi/pezframe/benchmarking/src/utils.rs b/bizinikiwi/pezframe/benchmarking/src/utils.rs index 0badd363..42ede37c 100644 --- a/bizinikiwi/pezframe/benchmarking/src/utils.rs +++ b/bizinikiwi/pezframe/benchmarking/src/utils.rs @@ -18,10 +18,9 @@ //! Interfaces, types and utils for benchmarking a FRAME runtime. use alloc::vec::Vec; use codec::{Decode, Encode}; -use pezframe_support::{dispatch::DispatchErrorWithPostInfo, pezpallet_prelude::*, traits::StorageInfo}; -use scale_info::TypeInfo; -#[cfg(feature = "std")] -use serde::{Deserialize, Serialize}; +use pezframe_support::{ + dispatch::DispatchErrorWithPostInfo, pezpallet_prelude::*, traits::StorageInfo, +}; use pezsp_io::hashing::blake2_256; use pezsp_runtime::{ traits::TrailingZeroInput, transaction_validity::TransactionValidityError, DispatchError, @@ -31,6 +30,9 @@ use pezsp_runtime_interface::pass_by::{ PassFatPointerAndRead, }; use pezsp_storage::TrackedStorageKey; +use scale_info::TypeInfo; +#[cfg(feature = "std")] +use serde::{Deserialize, Serialize}; /// An alphabet of possible parameters to use for benchmarking. #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] diff --git a/bizinikiwi/pezframe/benchmarking/src/v1.rs b/bizinikiwi/pezframe/benchmarking/src/v1.rs index edeb5aa9..a0c61e84 100644 --- a/bizinikiwi/pezframe/benchmarking/src/v1.rs +++ b/bizinikiwi/pezframe/benchmarking/src/v1.rs @@ -188,7 +188,8 @@ macro_rules! benchmarks { /// Same as [`benchmarks`] but for instantiable module. /// -/// NOTE: For pezpallet declared with [`pezframe_support::pezpallet`], use [`benchmarks_instance_pallet`]. +/// NOTE: For pezpallet declared with [`pezframe_support::pezpallet`], use +/// [`benchmarks_instance_pallet`]. #[macro_export] macro_rules! benchmarks_instance { ( @@ -1799,9 +1800,9 @@ pub fn show_benchmark_debug_info( /// /// At the end of `dispatch_benchmark`, you should return this batches object. /// -/// In the case where you have multiple instances of a pezpallet that you need to separately benchmark, -/// the name of your module struct will be used as a suffix to your outputted weight file. For -/// example: +/// In the case where you have multiple instances of a pezpallet that you need to separately +/// benchmark, the name of your module struct will be used as a suffix to your outputted weight +/// file. For example: /// /// ```ignore /// add_benchmark!(params, batches, pezpallet_balances, Balances); // pezpallet_balances.rs diff --git a/bizinikiwi/pezframe/bounties/src/lib.rs b/bizinikiwi/pezframe/bounties/src/lib.rs index 41fb3627..c667da6b 100644 --- a/bizinikiwi/pezframe/bounties/src/lib.rs +++ b/bizinikiwi/pezframe/bounties/src/lib.rs @@ -35,9 +35,9 @@ //! curator or once the bounty is active or payout is pending, resulting in the slash of the //! curator's deposit. //! -//! This pezpallet may opt into using a [`ChildBountyManager`] that enables bounties to be split into -//! sub-bounties, as children of an established bounty (called the parent in the context of it's -//! children). +//! This pezpallet may opt into using a [`ChildBountyManager`] that enables bounties to be split +//! into sub-bounties, as children of an established bounty (called the parent in the context of +//! it's children). //! //! > NOTE: The parent bounty cannot be closed if it has a non-zero number of it has active child //! > bounties associated with it. @@ -232,7 +232,9 @@ pub mod pezpallet { pub struct Pezpallet(_); #[pezpallet::config] - pub trait Config: pezframe_system::Config + pezpallet_treasury::Config { + pub trait Config: + pezframe_system::Config + pezpallet_treasury::Config + { /// The amount held on deposit for placing a bounty proposal. #[pezpallet::constant] type BountyDepositBase: Get>; diff --git a/bizinikiwi/pezframe/bounties/src/migrations/v4.rs b/bizinikiwi/pezframe/bounties/src/migrations/v4.rs index 1fd92401..9da949c4 100644 --- a/bizinikiwi/pezframe/bounties/src/migrations/v4.rs +++ b/bizinikiwi/pezframe/bounties/src/migrations/v4.rs @@ -29,7 +29,8 @@ use pezsp_io::{hashing::twox_128, storage}; use crate as pezpallet_bounties; -/// Migrate the storage of the bounties pezpallet to a new prefix, leaving all other storage untouched +/// Migrate the storage of the bounties pezpallet to a new prefix, leaving all other storage +/// untouched /// /// This new prefix must be the same as the one set in construct_runtime. For safety, use /// `PalletInfo` to get it, as: @@ -113,7 +114,11 @@ pub fn migrate< /// `pezframe_support::traits::OnRuntimeUpgrade::pre_upgrade` for further testing. /// /// Panics if anything goes wrong. -pub fn pre_migration>( +pub fn pre_migration< + T: pezpallet_bounties::Config, + P: GetStorageVersion + 'static, + N: AsRef, +>( old_pallet_name: N, new_pallet_name: N, ) { @@ -123,7 +128,8 @@ pub fn pre_migration::storage_prefix(); let storage_prefix_bounties_description = pezpallet_bounties::BountyDescriptions::::storage_prefix(); - let storage_prefix_bounties_approvals = pezpallet_bounties::BountyApprovals::::storage_prefix(); + let storage_prefix_bounties_approvals = + pezpallet_bounties::BountyApprovals::::storage_prefix(); log_migration("pre-migration", storage_prefix_bounties_count, old_pallet_name, new_pallet_name); log_migration("pre-migration", storage_prefix_bounties, old_pallet_name, new_pallet_name); log_migration( @@ -177,7 +183,8 @@ pub fn post_migration::storage_prefix(); let storage_prefix_bounties_description = pezpallet_bounties::BountyDescriptions::::storage_prefix(); - let storage_prefix_bounties_approvals = pezpallet_bounties::BountyApprovals::::storage_prefix(); + let storage_prefix_bounties_approvals = + pezpallet_bounties::BountyApprovals::::storage_prefix(); log_migration( "post-migration", storage_prefix_bounties_count, diff --git a/bizinikiwi/pezframe/broker/src/core_mask.rs b/bizinikiwi/pezframe/broker/src/core_mask.rs index b599252f..10f3b3f6 100644 --- a/bizinikiwi/pezframe/broker/src/core_mask.rs +++ b/bizinikiwi/pezframe/broker/src/core_mask.rs @@ -17,8 +17,8 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not}; -use scale_info::TypeInfo; use pezsp_core::RuntimeDebug; +use scale_info::TypeInfo; /// The number of bits in the `CoreMask`. pub const CORE_MASK_BITS: usize = 80; diff --git a/bizinikiwi/pezframe/broker/src/coretime_interface.rs b/bizinikiwi/pezframe/broker/src/coretime_interface.rs index a457148f..fea3e995 100644 --- a/bizinikiwi/pezframe/broker/src/coretime_interface.rs +++ b/bizinikiwi/pezframe/broker/src/coretime_interface.rs @@ -21,10 +21,10 @@ use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::fmt::Debug; use pezframe_support::Parameter; -use scale_info::TypeInfo; use pezsp_arithmetic::traits::AtLeast32BitUnsigned; use pezsp_core::RuntimeDebug; use pezsp_runtime::traits::BlockNumberProvider; +use scale_info::TypeInfo; use crate::Timeslice; diff --git a/bizinikiwi/pezframe/broker/src/lib.rs b/bizinikiwi/pezframe/broker/src/lib.rs index c94b4471..9d9b57fc 100644 --- a/bizinikiwi/pezframe/broker/src/lib.rs +++ b/bizinikiwi/pezframe/broker/src/lib.rs @@ -76,7 +76,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Weight information for all calls of this pezpallet. type WeightInfo: WeightInfo; diff --git a/bizinikiwi/pezframe/broker/src/test_fungibles.rs b/bizinikiwi/pezframe/broker/src/test_fungibles.rs index 51444537..f1af9fc4 100644 --- a/bizinikiwi/pezframe/broker/src/test_fungibles.rs +++ b/bizinikiwi/pezframe/broker/src/test_fungibles.rs @@ -26,10 +26,10 @@ use pezframe_support::{ }, }, }; -use scale_info::TypeInfo; use pezsp_arithmetic::traits::Zero; use pezsp_core::{Get, TypedGet}; use pezsp_runtime::{DispatchError, DispatchResult}; +use scale_info::TypeInfo; parameter_types! { static TestAssetOf: BTreeMap<(u32, Vec), Vec> = Default::default(); diff --git a/bizinikiwi/pezframe/broker/src/tests.rs b/bizinikiwi/pezframe/broker/src/tests.rs index fba2f2c1..f4bf829d 100644 --- a/bizinikiwi/pezframe/broker/src/tests.rs +++ b/bizinikiwi/pezframe/broker/src/tests.rs @@ -24,11 +24,11 @@ use pezframe_support::{ BoundedVec, }; use pezframe_system::RawOrigin::Root; -use pretty_assertions::assert_eq; use pezsp_runtime::{ traits::{BadOrigin, Get}, Perbill, TokenError, }; +use pretty_assertions::assert_eq; use CoreAssignment::*; use CoretimeTraceItem::*; use Finality::*; diff --git a/bizinikiwi/pezframe/broker/src/types.rs b/bizinikiwi/pezframe/broker/src/types.rs index 3f259724..4ea5715c 100644 --- a/bizinikiwi/pezframe/broker/src/types.rs +++ b/bizinikiwi/pezframe/broker/src/types.rs @@ -22,10 +22,10 @@ use crate::{ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use pezframe_support::traits::fungible::Inspect; use pezframe_system::Config as SConfig; -use scale_info::TypeInfo; use pezsp_arithmetic::Perbill; use pezsp_core::{ConstU32, RuntimeDebug}; use pezsp_runtime::BoundedVec; +use scale_info::TypeInfo; pub type BalanceOf = <::Currency as Inspect<::AccountId>>::Balance; pub type RelayBalanceOf = <::Coretime as CoretimeInterface>::Balance; diff --git a/bizinikiwi/pezframe/child-bounties/src/benchmarking.rs b/bizinikiwi/pezframe/child-bounties/src/benchmarking.rs index a95b02f2..8ed3ec31 100644 --- a/bizinikiwi/pezframe/child-bounties/src/benchmarking.rs +++ b/bizinikiwi/pezframe/child-bounties/src/benchmarking.rs @@ -280,15 +280,15 @@ mod benchmarks { // If `BountyUpdatePeriod` overflows the inactivity timeout the benchmark still // executes the slash - let origin: T::RuntimeOrigin = if Pezpallet::::treasury_block_number() <= inactivity_timeout - { - let child_curator = bounty_setup.child_curator; - T::RejectOrigin::try_successful_origin() - .unwrap_or_else(|_| RawOrigin::Signed(child_curator).into()) - } else { - let caller = whitelisted_caller(); - RawOrigin::Signed(caller).into() - }; + let origin: T::RuntimeOrigin = + if Pezpallet::::treasury_block_number() <= inactivity_timeout { + let child_curator = bounty_setup.child_curator; + T::RejectOrigin::try_successful_origin() + .unwrap_or_else(|_| RawOrigin::Signed(child_curator).into()) + } else { + let caller = whitelisted_caller(); + RawOrigin::Signed(caller).into() + }; #[extrinsic_call] _(origin as T::RuntimeOrigin, bounty_setup.bounty_id, bounty_setup.child_bounty_id); diff --git a/bizinikiwi/pezframe/child-bounties/src/lib.rs b/bizinikiwi/pezframe/child-bounties/src/lib.rs index b5979894..1b015131 100644 --- a/bizinikiwi/pezframe/child-bounties/src/lib.rs +++ b/bizinikiwi/pezframe/child-bounties/src/lib.rs @@ -163,7 +163,8 @@ pub mod pezpallet { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; diff --git a/bizinikiwi/pezframe/collective/src/benchmarking.rs b/bizinikiwi/pezframe/collective/src/benchmarking.rs index 4551e9dd..b05f6c8e 100644 --- a/bizinikiwi/pezframe/collective/src/benchmarking.rs +++ b/bizinikiwi/pezframe/collective/src/benchmarking.rs @@ -28,7 +28,8 @@ use pezframe_benchmarking::{ v2::*, }; use pezframe_system::{ - pezpallet_prelude::BlockNumberFor, Call as SystemCall, Pezpallet as System, RawOrigin as SystemOrigin, + pezpallet_prelude::BlockNumberFor, Call as SystemCall, Pezpallet as System, + RawOrigin as SystemOrigin, }; const SEED: u32 = 0; diff --git a/bizinikiwi/pezframe/collective/src/lib.rs b/bizinikiwi/pezframe/collective/src/lib.rs index e55aecde..7891af36 100644 --- a/bizinikiwi/pezframe/collective/src/lib.rs +++ b/bizinikiwi/pezframe/collective/src/lib.rs @@ -46,12 +46,12 @@ extern crate alloc; use alloc::{boxed::Box, vec, vec::Vec}; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::{marker::PhantomData, result}; -use scale_info::TypeInfo; use pezsp_io::storage; use pezsp_runtime::{ traits::{Dispatchable, Hash}, DispatchError, RuntimeDebug, }; +use scale_info::TypeInfo; use pezframe_support::{ dispatch::{ @@ -566,8 +566,8 @@ pub mod pezpallet { /// /// # WARNING: /// - /// The `pezpallet-collective` can also be managed by logic outside of the pezpallet through the - /// implementation of the trait [`ChangeMembers`]. + /// The `pezpallet-collective` can also be managed by logic outside of the pezpallet through + /// the implementation of the trait [`ChangeMembers`]. /// Any call to `set_members` must be careful that the member set doesn't get out of sync /// with other logic managing the member set. /// @@ -1088,7 +1088,10 @@ impl, I: 'static> Pezpallet { } // Only allow actual closing of the proposal after the voting period has ended. - ensure!(pezframe_system::Pezpallet::::block_number() >= voting.end, Error::::TooEarly); + ensure!( + pezframe_system::Pezpallet::::block_number() >= voting.end, + Error::::TooEarly + ); let prime_vote = Prime::::get().map(|who| voting.ayes.iter().any(|a| a == &who)); diff --git a/bizinikiwi/pezframe/collective/src/migrations/v4.rs b/bizinikiwi/pezframe/collective/src/migrations/v4.rs index 5ca185cf..53e4b086 100644 --- a/bizinikiwi/pezframe/collective/src/migrations/v4.rs +++ b/bizinikiwi/pezframe/collective/src/migrations/v4.rs @@ -35,7 +35,11 @@ use pezframe_support::{ /// The migration will look into the storage version in order not to trigger a migration on an up /// to date storage. Thus the on chain storage version must be less than 4 in order to trigger the /// migration. -pub fn migrate>( +pub fn migrate< + T: pezframe_system::Config, + P: GetStorageVersion + PalletInfoAccess, + N: AsRef, +>( old_pallet_name: N, ) -> Weight { let old_pallet_name = old_pallet_name.as_ref(); diff --git a/bizinikiwi/pezframe/contracts/mock-network/src/mocks/msg_queue.rs b/bizinikiwi/pezframe/contracts/mock-network/src/mocks/msg_queue.rs index 5af391c5..05fb02d7 100644 --- a/bizinikiwi/pezframe/contracts/mock-network/src/mocks/msg_queue.rs +++ b/bizinikiwi/pezframe/contracts/mock-network/src/mocks/msg_queue.rs @@ -35,7 +35,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type XcmExecutor: ExecuteXcm; } diff --git a/bizinikiwi/pezframe/contracts/proc-macro/src/lib.rs b/bizinikiwi/pezframe/contracts/proc-macro/src/lib.rs index 73858fe6..859b59d8 100644 --- a/bizinikiwi/pezframe/contracts/proc-macro/src/lib.rs +++ b/bizinikiwi/pezframe/contracts/proc-macro/src/lib.rs @@ -841,9 +841,9 @@ fn expand_functions(def: &EnvDef, expand_mode: ExpandMode) -> TokenStream2 { /// The function `bar` is additionally annotated with `unstable` which removes it from the stable /// interface. Check out the README to learn about unstable functions. /// -/// In legacy versions of pezpallet_contracts, it was a naming convention that all host functions had -/// to be named with the `seal_` prefix. For the sake of backwards compatibility, each host function -/// now can get a such prefix-named alias function generated by marking it by the +/// In legacy versions of pezpallet_contracts, it was a naming convention that all host functions +/// had to be named with the `seal_` prefix. For the sake of backwards compatibility, each host +/// function now can get a such prefix-named alias function generated by marking it by the /// `#[prefixed_alias]` attribute: /// /// ## Example diff --git a/bizinikiwi/pezframe/contracts/src/benchmarking/mod.rs b/bizinikiwi/pezframe/contracts/src/benchmarking/mod.rs index 4db1ccd8..c608e80c 100644 --- a/bizinikiwi/pezframe/contracts/src/benchmarking/mod.rs +++ b/bizinikiwi/pezframe/contracts/src/benchmarking/mod.rs @@ -417,7 +417,8 @@ mod benchmarks { StorageVersion::new(latest_version).put::>(); #[block] { - as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade(); + as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade( + ); } assert!(MigrationInProgress::::get().is_none()); } @@ -432,7 +433,8 @@ mod benchmarks { MigrationInProgress::::set(v.clone()); #[block] { - as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade(); + as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade( + ); } assert!(MigrationInProgress::::get().is_some()); assert_eq!(MigrationInProgress::::get(), v); @@ -446,7 +448,8 @@ mod benchmarks { StorageVersion::new(latest_version - 2).put::>(); #[block] { - as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade(); + as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade( + ); } assert!(MigrationInProgress::::get().is_some()); } @@ -565,7 +568,10 @@ mod benchmarks { // value and value transferred via call should be removed from the caller assert_eq!( T::Currency::balance(&instance.caller), - caller_funding::() - instance.value - value - deposit - Pezpallet::::min_balance(), + caller_funding::() - + instance.value - + value - deposit - + Pezpallet::::min_balance(), ); // contract should have received the value assert_eq!(T::Currency::balance(&instance.account_id), before + value); @@ -1830,8 +1836,8 @@ mod benchmarks { let key_type = pezsp_core::crypto::KeyTypeId(*b"code"); let pub_key = pezsp_io::crypto::sr25519_generate(key_type, None); - let sig = - pezsp_io::crypto::sr25519_sign(key_type, &pub_key, &message).expect("Generates signature"); + let sig = pezsp_io::crypto::sr25519_sign(key_type, &pub_key, &message) + .expect("Generates signature"); let sig = AsRef::<[u8; 64]>::as_ref(&sig).to_vec(); let sig_len = sig.len() as u32; diff --git a/bizinikiwi/pezframe/contracts/src/exec.rs b/bizinikiwi/pezframe/contracts/src/exec.rs index 6e60bc92..fbeacb28 100644 --- a/bizinikiwi/pezframe/contracts/src/exec.rs +++ b/bizinikiwi/pezframe/contracts/src/exec.rs @@ -41,7 +41,6 @@ use pezframe_support::{ Blake2_128Concat, BoundedVec, StorageHasher, }; use pezframe_system::{pezpallet_prelude::BlockNumberFor, RawOrigin}; -use smallvec::{Array, SmallVec}; use pezsp_core::{ ecdsa::Public as ECDSAPublic, sr25519::{Public as SR25519Public, Signature as SR25519Signature}, @@ -52,6 +51,7 @@ use pezsp_runtime::{ traits::{Convert, Dispatchable, Zero}, DispatchError, }; +use smallvec::{Array, SmallVec}; pub type AccountIdOf = ::AccountId; pub type MomentOf = <::Time as Time>::Moment; @@ -1723,8 +1723,8 @@ mod tests { use pezframe_support::{assert_err, assert_ok, parameter_types}; use pezframe_system::{EventRecord, Phase}; use pezpallet_contracts_uapi::ReturnFlags; - use pretty_assertions::assert_eq; use pezsp_runtime::{traits::Hash, DispatchError}; + use pretty_assertions::assert_eq; use std::{cell::RefCell, collections::hash_map::HashMap, rc::Rc}; type System = pezframe_system::Pezpallet; diff --git a/bizinikiwi/pezframe/contracts/src/lib.rs b/bizinikiwi/pezframe/contracts/src/lib.rs index 86561b53..41fd1891 100644 --- a/bizinikiwi/pezframe/contracts/src/lib.rs +++ b/bizinikiwi/pezframe/contracts/src/lib.rs @@ -27,8 +27,9 @@ //! //! This module extends accounts based on the [`pezframe_support::traits::fungible`] traits to have //! smart-contract functionality. It can be used with other modules that implement accounts based on -//! the [`pezframe_support::traits::fungible`] traits. These "smart-contract accounts" have the ability -//! to instantiate smart-contracts and make calls to other contract and non-contract accounts. +//! the [`pezframe_support::traits::fungible`] traits. These "smart-contract accounts" have the +//! ability to instantiate smart-contracts and make calls to other contract and non-contract +//! accounts. //! //! The smart-contract code is stored once, and later retrievable via its hash. //! This means that multiple smart-contracts can be instantiated from the same hash, without @@ -71,8 +72,8 @@ //! code an existing `code_hash` is supplied. //! * [`Pezpallet::call`] - Makes a call to an account, optionally transferring some balance. //! * [`Pezpallet::upload_code`] - Uploads new code without instantiating a contract from it. -//! * [`Pezpallet::remove_code`] - Removes the stored code and refunds the deposit to its owner. Only -//! allowed to code owner. +//! * [`Pezpallet::remove_code`] - Removes the stored code and refunds the deposit to its owner. +//! Only allowed to code owner. //! * [`Pezpallet::set_code`] - Changes the code of an existing contract. Only allowed to `Root` //! origin. //! * [`Pezpallet::migrate`] - Runs migration steps of current multi-block migration in priority, @@ -134,12 +135,12 @@ use pezframe_system::{ pezpallet_prelude::{BlockNumberFor, OriginFor}, EventRecord, Pezpallet as System, }; -use scale_info::TypeInfo; -use smallvec::Array; use pezsp_runtime::{ traits::{BadOrigin, Convert, Dispatchable, Saturating, StaticLookup, Zero}, DispatchError, RuntimeDebug, }; +use scale_info::TypeInfo; +use smallvec::Array; pub use crate::{ address::{AddressGenerator, DefaultAddressGenerator}, @@ -167,8 +168,8 @@ type EventRecordOf = /// The old weight type. /// -/// This is a copy of the [`pezframe_support::weights::OldWeight`] type since the contracts pezpallet -/// needs to support it indefinitely. +/// This is a copy of the [`pezframe_support::weights::OldWeight`] type since the contracts +/// pezpallet needs to support it indefinitely. type OldWeight = u64; /// Used as a sentinel value when reading and writing contract memory. @@ -277,7 +278,8 @@ pub mod pezpallet { /// The overarching event type. #[pezpallet::no_default_bounds] #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The overarching call type. #[pezpallet::no_default_bounds] @@ -1270,8 +1272,8 @@ pub mod pezpallet { TerminatedInConstructor, /// A call tried to invoke a contract that is flagged as non-reentrant. /// The only other cause is that a call from a contract into the runtime tried to call back - /// into `pezpallet-contracts`. This would make the whole pezpallet reentrant with regard to - /// contract code execution which is not supported. + /// into `pezpallet-contracts`. This would make the whole pezpallet reentrant with regard + /// to contract code execution which is not supported. ReentranceDenied, /// A contract attempted to invoke a state modifying API while being in read-only mode. StateChangeDenied, diff --git a/bizinikiwi/pezframe/contracts/src/migration.rs b/bizinikiwi/pezframe/contracts/src/migration.rs index 6384b592..5ab34559 100644 --- a/bizinikiwi/pezframe/contracts/src/migration.rs +++ b/bizinikiwi/pezframe/contracts/src/migration.rs @@ -67,7 +67,9 @@ pub mod v15; pub mod v16; include!(concat!(env!("OUT_DIR"), "/migration_codegen.rs")); -use crate::{weights::WeightInfo, Config, Error, MigrationInProgress, Pezpallet, Weight, LOG_TARGET}; +use crate::{ + weights::WeightInfo, Config, Error, MigrationInProgress, Pezpallet, Weight, LOG_TARGET, +}; use codec::{Codec, Decode}; use core::marker::PhantomData; use pezframe_support::{ @@ -578,7 +580,10 @@ mod test { #[test] fn test_storage_version_matches_last_migration_file() { - assert_eq!(StorageVersion::new(LATEST_MIGRATION_VERSION), crate::pezpallet::STORAGE_VERSION); + assert_eq!( + StorageVersion::new(LATEST_MIGRATION_VERSION), + crate::pezpallet::STORAGE_VERSION + ); } #[test] diff --git a/bizinikiwi/pezframe/contracts/src/migration/v11.rs b/bizinikiwi/pezframe/contracts/src/migration/v11.rs index 74be2946..654455a9 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v11.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v11.rs @@ -63,7 +63,8 @@ pub fn fill_old_queue(len: usize) { type DeletionQueue = StorageMap, Twox64Concat, u32, TrieId>; #[storage_alias] -type DeletionQueueCounter = StorageValue, DeletionQueueManager, ValueQuery>; +type DeletionQueueCounter = + StorageValue, DeletionQueueManager, ValueQuery>; #[derive(Encode, Decode, MaxEncodedLen, DefaultNoBound)] pub struct Migration { diff --git a/bizinikiwi/pezframe/contracts/src/migration/v12.rs b/bizinikiwi/pezframe/contracts/src/migration/v12.rs index 3bcf0ff2..e125e94b 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v12.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v12.rs @@ -29,11 +29,11 @@ use pezframe_support::{ pezpallet_prelude::*, storage_alias, traits::ReservableCurrency, weights::WeightMeter, DefaultNoBound, Identity, }; -use scale_info::prelude::format; use pezsp_core::hexdisplay::HexDisplay; #[cfg(feature = "try-runtime")] use pezsp_runtime::TryRuntimeError; use pezsp_runtime::{traits::Zero, FixedPointNumber, FixedU128, Saturating}; +use scale_info::prelude::format; mod v11 { use super::*; diff --git a/bizinikiwi/pezframe/contracts/src/migration/v13.rs b/bizinikiwi/pezframe/contracts/src/migration/v13.rs index f954e3cf..77873e52 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v13.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v13.rs @@ -72,8 +72,12 @@ pub fn store_old_contract_info(account: T::AccountId, info: crate::Co } #[storage_alias] -pub type ContractInfoOf = - StorageMap, Twox64Concat, ::AccountId, ContractInfo>; +pub type ContractInfoOf = StorageMap< + Pezpallet, + Twox64Concat, + ::AccountId, + ContractInfo, +>; #[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] diff --git a/bizinikiwi/pezframe/contracts/src/migration/v15.rs b/bizinikiwi/pezframe/contracts/src/migration/v15.rs index 165024e0..29625d22 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v15.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v15.rs @@ -111,8 +111,12 @@ struct ContractInfo { } #[storage_alias] -type ContractInfoOf = - StorageMap, Twox64Concat, ::AccountId, ContractInfo>; +type ContractInfoOf = StorageMap< + Pezpallet, + Twox64Concat, + ::AccountId, + ContractInfo, +>; #[derive(Encode, Decode, MaxEncodedLen, DefaultNoBound)] pub struct Migration { diff --git a/bizinikiwi/pezframe/contracts/src/migration/v16.rs b/bizinikiwi/pezframe/contracts/src/migration/v16.rs index a7c41f1a..6473cae0 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v16.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v16.rs @@ -51,8 +51,12 @@ pub fn store_old_contract_info( } #[storage_alias] -pub type ContractInfoOf = - StorageMap, Twox64Concat, ::AccountId, ContractInfo>; +pub type ContractInfoOf = StorageMap< + Pezpallet, + Twox64Concat, + ::AccountId, + ContractInfo, +>; #[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] diff --git a/bizinikiwi/pezframe/contracts/src/primitives.rs b/bizinikiwi/pezframe/contracts/src/primitives.rs index aba1989b..127660c2 100644 --- a/bizinikiwi/pezframe/contracts/src/primitives.rs +++ b/bizinikiwi/pezframe/contracts/src/primitives.rs @@ -21,11 +21,11 @@ use alloc::vec::Vec; use codec::{Decode, Encode, MaxEncodedLen}; use pezframe_support::weights::Weight; use pezpallet_contracts_uapi::ReturnFlags; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{Saturating, Zero}, DispatchError, RuntimeDebug, }; +use scale_info::TypeInfo; /// Result type of a `bare_call` or `bare_instantiate` call as well as `ContractsApi::call` and /// `ContractsApi::instantiate`. diff --git a/bizinikiwi/pezframe/contracts/src/storage.rs b/bizinikiwi/pezframe/contracts/src/storage.rs index 3cb05ca5..10a2ba8e 100644 --- a/bizinikiwi/pezframe/contracts/src/storage.rs +++ b/bizinikiwi/pezframe/contracts/src/storage.rs @@ -33,13 +33,13 @@ use pezframe_support::{ weights::{Weight, WeightMeter}, CloneNoBound, DefaultNoBound, }; -use scale_info::TypeInfo; use pezsp_core::Get; use pezsp_io::KillStorageResult; use pezsp_runtime::{ traits::{Hash, Saturating, Zero}, BoundedBTreeMap, DispatchError, DispatchResult, RuntimeDebug, }; +use scale_info::TypeInfo; use self::meter::Diff; @@ -458,7 +458,8 @@ impl DeletionQueueManager { /// /// Note: /// we use the delete counter to get the next value to read from the queue and thus don't pay - /// the cost of an extra call to `pezsp_io::storage::next_key` to lookup the next entry in the map + /// the cost of an extra call to `pezsp_io::storage::next_key` to lookup the next entry in the + /// map fn next(&mut self) -> Option> { if self.is_empty() { return None; diff --git a/bizinikiwi/pezframe/contracts/src/test_utils/builder.rs b/bizinikiwi/pezframe/contracts/src/test_utils/builder.rs index 71331fcc..161c6e44 100644 --- a/bizinikiwi/pezframe/contracts/src/test_utils/builder.rs +++ b/bizinikiwi/pezframe/contracts/src/test_utils/builder.rs @@ -23,8 +23,8 @@ use crate::{ }; use codec::{Encode, HasCompact}; use core::fmt::Debug; -use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo; use paste::paste; +use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo; use scale_info::TypeInfo; /// Helper macro to generate a builder for contract API calls. diff --git a/bizinikiwi/pezframe/contracts/src/tests.rs b/bizinikiwi/pezframe/contracts/src/tests.rs index a45a88ec..2fba0d93 100644 --- a/bizinikiwi/pezframe/contracts/src/tests.rs +++ b/bizinikiwi/pezframe/contracts/src/tests.rs @@ -45,8 +45,8 @@ use pezframe_support::{ assert_err, assert_err_ignore_postinfo, assert_err_with_weight, assert_noop, assert_ok, derive_impl, dispatch::{DispatchErrorWithPostInfo, PostDispatchInfo}, - pezpallet_prelude::EnsureOrigin, parameter_types, + pezpallet_prelude::EnsureOrigin, storage::child, traits::{ fungible::{BalancedHold, Inspect, Mutate, MutateHold}, @@ -57,7 +57,6 @@ use pezframe_support::{ }; use pezframe_system::{EventRecord, Phase}; use pezpallet_contracts_fixtures::compile_module; -use pretty_assertions::{assert_eq, assert_ne}; use pezsp_core::ByteArray; use pezsp_io::hashing::blake2_256; use pezsp_keystore::{testing::MemoryKeystore, KeystoreExt}; @@ -66,6 +65,7 @@ use pezsp_runtime::{ traits::{BlakeTwo256, Convert, IdentityLookup}, AccountId32, BuildStorage, DispatchError, Perbill, TokenError, }; +use pretty_assertions::{assert_eq, assert_ne}; type Block = pezframe_system::mocking::MockBlock; @@ -4533,7 +4533,8 @@ fn read_only_subsequent_call_cannot_store() { builder::bare_instantiate(Code::Upload(wasm_callee)).build_and_unwrap_account_id(); // Subsequent call input. - let input = (&addr_callee, pezpallet_contracts_uapi::CallFlags::empty().bits(), 0u64, 100u32); + let input = + (&addr_callee, pezpallet_contracts_uapi::CallFlags::empty().bits(), 0u64, 100u32); // Read-only call fails when modifying storage. assert_err_ignore_postinfo!( diff --git a/bizinikiwi/pezframe/contracts/src/wasm/mod.rs b/bizinikiwi/pezframe/contracts/src/wasm/mod.rs index ebb50e3c..e2dbe5db 100644 --- a/bizinikiwi/pezframe/contracts/src/wasm/mod.rs +++ b/bizinikiwi/pezframe/contracts/src/wasm/mod.rs @@ -520,9 +520,9 @@ mod tests { }; use pezframe_system::pezpallet_prelude::BlockNumberFor; use pezpallet_contracts_uapi::ReturnFlags; - use pretty_assertions::assert_eq; use pezsp_core::H256; use pezsp_runtime::DispatchError; + use pretty_assertions::assert_eq; use std::{ borrow::BorrowMut, cell::RefCell, diff --git a/bizinikiwi/pezframe/contracts/src/wasm/runtime.rs b/bizinikiwi/pezframe/contracts/src/wasm/runtime.rs index 7432ec27..2e9b867b 100644 --- a/bizinikiwi/pezframe/contracts/src/wasm/runtime.rs +++ b/bizinikiwi/pezframe/contracts/src/wasm/runtime.rs @@ -28,7 +28,7 @@ use alloc::{boxed::Box, vec, vec::Vec}; use codec::{Decode, DecodeLimit, Encode, MaxEncodedLen}; use core::fmt; use pezframe_support::{ - dispatch::DispatchInfo, ensure, pezpallet_prelude::DispatchResultWithPostInfo, parameter_types, + dispatch::DispatchInfo, ensure, parameter_types, pezpallet_prelude::DispatchResultWithPostInfo, traits::Get, weights::Weight, }; use pezpallet_contracts_proc_macro::define_env; @@ -61,8 +61,8 @@ pub enum AllowUnstableInterface { Yes, } -/// Trait implemented by the [`define_env`](pezpallet_contracts_proc_macro::define_env) macro for the -/// emitted `Env` struct. +/// Trait implemented by the [`define_env`](pezpallet_contracts_proc_macro::define_env) macro for +/// the emitted `Env` struct. pub trait Environment { /// Adds all declared functions to the supplied [`Linker`](wasmi::Linker) and /// [`Store`](wasmi::Store). diff --git a/bizinikiwi/pezframe/conviction-voting/src/conviction.rs b/bizinikiwi/pezframe/conviction-voting/src/conviction.rs index 3a12ef76..d77081bb 100644 --- a/bizinikiwi/pezframe/conviction-voting/src/conviction.rs +++ b/bizinikiwi/pezframe/conviction-voting/src/conviction.rs @@ -18,11 +18,11 @@ //! The conviction datatype. use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{Bounded, CheckedDiv, CheckedMul, Zero}, RuntimeDebug, }; +use scale_info::TypeInfo; use crate::types::Delegations; diff --git a/bizinikiwi/pezframe/conviction-voting/src/lib.rs b/bizinikiwi/pezframe/conviction-voting/src/lib.rs index bd7d5747..130560b8 100644 --- a/bizinikiwi/pezframe/conviction-voting/src/lib.rs +++ b/bizinikiwi/pezframe/conviction-voting/src/lib.rs @@ -173,8 +173,8 @@ pub mod pezpallet { >; /// The voting classes which have a non-zero lock requirement and the lock amounts which they - /// require. The actual amount locked on behalf of this pezpallet should always be the maximum of - /// this list. + /// require. The actual amount locked on behalf of this pezpallet should always be the maximum + /// of this list. #[pezpallet::storage] pub type ClassLocksFor, I: 'static = ()> = StorageMap< _, diff --git a/bizinikiwi/pezframe/conviction-voting/src/traits.rs b/bizinikiwi/pezframe/conviction-voting/src/traits.rs index fa61d6b3..7e925d2c 100644 --- a/bizinikiwi/pezframe/conviction-voting/src/traits.rs +++ b/bizinikiwi/pezframe/conviction-voting/src/traits.rs @@ -20,8 +20,8 @@ use crate::AccountVote; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use pezframe_support::dispatch::DispatchResult; -use scale_info::TypeInfo; use pezsp_runtime::RuntimeDebug; +use scale_info::TypeInfo; /// Represents the differents states of a referendum. #[derive( diff --git a/bizinikiwi/pezframe/conviction-voting/src/types.rs b/bizinikiwi/pezframe/conviction-voting/src/types.rs index 7dad282d..81a06e0a 100644 --- a/bizinikiwi/pezframe/conviction-voting/src/types.rs +++ b/bizinikiwi/pezframe/conviction-voting/src/types.rs @@ -22,11 +22,11 @@ use core::{fmt::Debug, marker::PhantomData}; use pezframe_support::{ traits::VoteTally, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{Saturating, Zero}, RuntimeDebug, }; +use scale_info::TypeInfo; use super::*; use crate::{AccountVote, Conviction, Vote}; diff --git a/bizinikiwi/pezframe/conviction-voting/src/vote.rs b/bizinikiwi/pezframe/conviction-voting/src/vote.rs index a3f508e4..3c332220 100644 --- a/bizinikiwi/pezframe/conviction-voting/src/vote.rs +++ b/bizinikiwi/pezframe/conviction-voting/src/vote.rs @@ -20,11 +20,11 @@ use crate::{Conviction, Delegations}; use codec::{Decode, DecodeWithMemTracking, Encode, EncodeLike, Input, MaxEncodedLen, Output}; use pezframe_support::{pezpallet_prelude::Get, BoundedVec}; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{Saturating, Zero}, RuntimeDebug, }; +use scale_info::TypeInfo; /// A number of lock periods, plus a vote, one way or the other. #[derive( diff --git a/bizinikiwi/pezframe/core-fellowship/src/lib.rs b/bizinikiwi/pezframe/core-fellowship/src/lib.rs index ad7ea3e2..0e30fdf7 100644 --- a/bizinikiwi/pezframe/core-fellowship/src/lib.rs +++ b/bizinikiwi/pezframe/core-fellowship/src/lib.rs @@ -40,15 +40,15 @@ //! - Pre-existing members may call `import_member` on themselves (formerly `import`) to have their //! rank recognised and be inducted into this pezpallet (to gain a salary and allow for eventual //! promotion). -//! - If, externally to this pezpallet, a member or candidate has their rank removed completely, then -//! `offboard` may be called to remove them entirely from this pezpallet. +//! - If, externally to this pezpallet, a member or candidate has their rank removed completely, +//! then `offboard` may be called to remove them entirely from this pezpallet. //! //! Note there is a difference between having a rank of 0 (whereby the account is a *candidate*) and //! having no rank at all (whereby we consider it *unranked*). An account can be demoted from rank //! 0 to become unranked. This process is called being offboarded and there is an extrinsic to do -//! this explicitly when external factors to this pezpallet have caused the tracked account to become -//! unranked. At rank 0, there is not a "demotion" period after which the account may be bumped to -//! become offboarded but rather an "offboard timeout". +//! this explicitly when external factors to this pezpallet have caused the tracked account to +//! become unranked. At rank 0, there is not a "demotion" period after which the account may be +//! bumped to become offboarded but rather an "offboard timeout". //! //! Candidates may be introduced (i.e. an account to go from unranked to rank of 0) by an origin //! of a different privilege to that for promotion. This allows the possibility for even a single @@ -64,9 +64,9 @@ extern crate alloc; use alloc::boxed::Box; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::{fmt::Debug, marker::PhantomData}; -use scale_info::TypeInfo; use pezsp_arithmetic::traits::{Saturating, Zero}; use pezsp_runtime::RuntimeDebug; +use scale_info::TypeInfo; use pezframe_support::{ defensive, @@ -219,8 +219,9 @@ pub mod pezpallet { /// The origin which has permission update the parameters. type ParamsOrigin: EnsureOrigin; - /// The origin which has permission to move a candidate into being tracked in this pezpallet. - /// Generally a very low-permission, such as a pre-existing member of rank 1 or above. + /// The origin which has permission to move a candidate into being tracked in this + /// pezpallet. Generally a very low-permission, such as a pre-existing member of rank 1 or + /// above. /// /// This allows the candidate to deposit evidence for their request to be promoted to a /// member. @@ -739,7 +740,9 @@ pub mod pezpallet { } } - impl, I: 'static> GetSalary, T::AccountId, T::Balance> for Pezpallet { + impl, I: 'static> GetSalary, T::AccountId, T::Balance> + for Pezpallet + { fn get_salary(rank: RankOf, who: &T::AccountId) -> T::Balance { let index = match Self::rank_to_index(rank) { Some(i) => i, @@ -822,7 +825,8 @@ impl, I: 'static> RankedMembersSwapHandler for P #[cfg(feature = "runtime-benchmarks")] impl, I: 'static> - pezpallet_ranked_collective::BenchmarkSetup<::AccountId> for Pezpallet + pezpallet_ranked_collective::BenchmarkSetup<::AccountId> + for Pezpallet { fn ensure_member(who: &::AccountId) { #[allow(deprecated)] diff --git a/bizinikiwi/pezframe/core-fellowship/src/tests/integration.rs b/bizinikiwi/pezframe/core-fellowship/src/tests/integration.rs index 22d68afe..a6b0eb27 100644 --- a/bizinikiwi/pezframe/core-fellowship/src/tests/integration.rs +++ b/bizinikiwi/pezframe/core-fellowship/src/tests/integration.rs @@ -21,8 +21,8 @@ use pezframe_support::{ assert_noop, assert_ok, derive_impl, hypothetically, hypothetically_ok, ord_parameter_types, - pezpallet_prelude::Weight, parameter_types, + pezpallet_prelude::Weight, traits::{ConstU16, EitherOf, IsInVec, MapSuccess, NoOpPoll, TryMapSuccess}, }; use pezframe_system::{pezpallet_prelude::BlockNumberFor, EnsureSignedBy}; diff --git a/bizinikiwi/pezframe/core-fellowship/src/tests/unit.rs b/bizinikiwi/pezframe/core-fellowship/src/tests/unit.rs index 7f0b7275..8d4ca889 100644 --- a/bizinikiwi/pezframe/core-fellowship/src/tests/unit.rs +++ b/bizinikiwi/pezframe/core-fellowship/src/tests/unit.rs @@ -23,13 +23,14 @@ use std::collections::BTreeMap; use core::cell::RefCell; use pezframe_support::{ - assert_noop, assert_ok, derive_impl, hypothetically, ord_parameter_types, + assert_noop, assert_ok, derive_impl, hypothetically, ord_parameter_types, parameter_types, pezpallet_prelude::Weight, - parameter_types, traits::{tokens::GetSalary, ConstU16, ConstU32, IsInVec, TryMapSuccess}, }; use pezframe_system::EnsureSignedBy; -use pezsp_runtime::{bounded_vec, traits::TryMorphInto, BuildStorage, DispatchError, DispatchResult}; +use pezsp_runtime::{ + bounded_vec, traits::TryMorphInto, BuildStorage, DispatchError, DispatchResult, +}; use crate as pezpallet_core_fellowship; use crate::*; diff --git a/bizinikiwi/pezframe/delegated-staking/src/impls.rs b/bizinikiwi/pezframe/delegated-staking/src/impls.rs index c8ed56d0..a2b9f3b4 100644 --- a/bizinikiwi/pezframe/delegated-staking/src/impls.rs +++ b/bizinikiwi/pezframe/delegated-staking/src/impls.rs @@ -107,7 +107,10 @@ impl DelegationMigrator for Pezpallet { agent: Agent, reward_account: &Self::AccountId, ) -> DispatchResult { - Pezpallet::::migrate_to_agent(RawOrigin::Signed(agent.get()).into(), reward_account.clone()) + Pezpallet::::migrate_to_agent( + RawOrigin::Signed(agent.get()).into(), + reward_account.clone(), + ) } fn migrate_delegation( agent: Agent, diff --git a/bizinikiwi/pezframe/delegated-staking/src/lib.rs b/bizinikiwi/pezframe/delegated-staking/src/lib.rs index f6128fac..f8a3b02b 100644 --- a/bizinikiwi/pezframe/delegated-staking/src/lib.rs +++ b/bizinikiwi/pezframe/delegated-staking/src/lib.rs @@ -38,13 +38,13 @@ //! //! ## Goals //! -//! Direct nomination on the Staking pezpallet does not scale well. Nominations pools were created to -//! address this by pooling delegator funds into one account and then staking it. This though had +//! Direct nomination on the Staking pezpallet does not scale well. Nominations pools were created +//! to address this by pooling delegator funds into one account and then staking it. This though had //! a very critical limitation that the funds were moved from delegator account to pool account //! and hence the delegator lost control over their funds for using it for other purposes such as -//! governance. This pezpallet aims to solve this by extending the staking pezpallet to support a new -//! primitive function: delegation of funds to an `agent` with the intent of staking. The agent can -//! then stake the delegated funds to [`Config::CoreStaking`] on behalf of the delegators. +//! governance. This pezpallet aims to solve this by extending the staking pezpallet to support a +//! new primitive function: delegation of funds to an `agent` with the intent of staking. The agent +//! can then stake the delegated funds to [`Config::CoreStaking`] on behalf of the delegators. //! //! ### Withdrawal Management //! Agent unbonding does not regulate ordering of consequent withdrawal for delegators. This is upto @@ -55,10 +55,10 @@ //! This pezpallet does not enforce any specific strategy for how rewards or slashes are applied. It //! is upto the `agent` account to decide how to apply the rewards and slashes. //! -//! This importantly allows clients of this pezpallet to build their own strategies for reward/slashes. -//! For example, an `agent` account can choose to first slash the reward pot before slashing the -//! delegators. Or part of the reward can go to an insurance fund that can be used to cover any -//! potential future slashes. The goal is to eventually allow foreign MultiLocations +//! This importantly allows clients of this pezpallet to build their own strategies for +//! reward/slashes. For example, an `agent` account can choose to first slash the reward pot before +//! slashing the delegators. Or part of the reward can go to an insurance fund that can be used to +//! cover any potential future slashes. The goal is to eventually allow foreign MultiLocations //! (smart contracts or pallets on another chain) to build their own pooled staking solutions //! similar to `NominationPools`. @@ -78,8 +78,8 @@ //! One of the reasons why direct nominators on staking pezpallet cannot scale well is because all //! nominators are slashed at the same time. This is expensive and needs to be bounded operation. //! -//! This pezpallet implements a lazy slashing mechanism. Any slashes to the `agent` are posted in its -//! `AgentLedger` as a pending slash. Since the actual amount is held in the multiple +//! This pezpallet implements a lazy slashing mechanism. Any slashes to the `agent` are posted in +//! its `AgentLedger` as a pending slash. Since the actual amount is held in the multiple //! `delegator` accounts, this pezpallet has no way to know how to apply slash. It is the `agent`'s //! responsibility to apply slashes for each delegator, one at a time. Staking pezpallet ensures the //! pending slash never exceeds staked amount and would freeze further withdraws until all pending @@ -93,8 +93,8 @@ //! //! ## Nomination Pool vs Delegation Staking //! This pezpallet is not a replacement for Nomination Pool but adds a new primitive in addition to -//! staking pezpallet that can be used by Nomination Pool to support delegation based staking. It can -//! be thought of as an extension to the Staking Pezpallet in relation to Nomination Pools. +//! staking pezpallet that can be used by Nomination Pool to support delegation based staking. It +//! can be thought of as an extension to the Staking Pezpallet in relation to Nomination Pools. //! Technically, these changes could be made in one of those pallets as well but that would have //! meant significant refactoring and high chances of introducing a regression. With this approach, //! we can keep the existing pallets with minimal changes and introduce a new pezpallet that can be @@ -191,7 +191,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Injected identifier for the pezpallet. #[pezpallet::constant] @@ -787,7 +788,8 @@ impl Pezpallet { ensure!( matches!( T::CoreStaking::status(&agent).expect("agent should be bonded"), - pezsp_staking::StakerStatus::Nominator(_) | pezsp_staking::StakerStatus::Idle + pezsp_staking::StakerStatus::Nominator(_) | + pezsp_staking::StakerStatus::Idle ), "agent should be bonded and not validator" ); diff --git a/bizinikiwi/pezframe/delegated-staking/src/migration.rs b/bizinikiwi/pezframe/delegated-staking/src/migration.rs index 0dab7e9c..b4c63df6 100644 --- a/bizinikiwi/pezframe/delegated-staking/src/migration.rs +++ b/bizinikiwi/pezframe/delegated-staking/src/migration.rs @@ -84,7 +84,8 @@ pub mod unversioned { Agents::::iter_keys().take(MaxAgents::get() as usize).for_each(|agent| { let old_proxy: T::AccountId = old_proxy_delegator(agent.clone()); - let held_balance = Pezpallet::::held_balance_of(Delegator::from(old_proxy.clone())); + let held_balance = + Pezpallet::::held_balance_of(Delegator::from(old_proxy.clone())); let delegation = Delegation::::get(&old_proxy); if delegation.is_some() || !held_balance.is_zero() { log!( diff --git a/bizinikiwi/pezframe/delegated-staking/src/mock.rs b/bizinikiwi/pezframe/delegated-staking/src/mock.rs index d90ab046..2f0f1e8f 100644 --- a/bizinikiwi/pezframe/delegated-staking/src/mock.rs +++ b/bizinikiwi/pezframe/delegated-staking/src/mock.rs @@ -17,9 +17,8 @@ use crate::{self as delegated_staking, types::AgentLedgerOuter}; use pezframe_support::{ - assert_ok, derive_impl, + assert_ok, derive_impl, parameter_types, pezpallet_prelude::*, - parameter_types, traits::{ConstU64, Currency, VariantCountOf}, PalletId, }; diff --git a/bizinikiwi/pezframe/delegated-staking/src/tests.rs b/bizinikiwi/pezframe/delegated-staking/src/tests.rs index 1bd06976..727cd3d4 100644 --- a/bizinikiwi/pezframe/delegated-staking/src/tests.rs +++ b/bizinikiwi/pezframe/delegated-staking/src/tests.rs @@ -650,8 +650,8 @@ mod staking_integration { DelegatedStaking::generate_proxy_delegator(Agent::from(agent)).get(); assert_ok!(DelegatedStaking::migrate_to_agent(RawOrigin::Signed(agent).into(), 201)); - // after migration, no provider left since free balance is 0 and staking pezpallet released - // all funds. + // after migration, no provider left since free balance is 0 and staking pezpallet + // released all funds. assert_eq!(System::providers(&agent), 0); assert_eq!(Balances::free_balance(agent), 0); // proxy delegator has one provider as well with no free balance. diff --git a/bizinikiwi/pezframe/democracy/src/conviction.rs b/bizinikiwi/pezframe/democracy/src/conviction.rs index 74aae975..20c838c2 100644 --- a/bizinikiwi/pezframe/democracy/src/conviction.rs +++ b/bizinikiwi/pezframe/democracy/src/conviction.rs @@ -20,11 +20,11 @@ use crate::types::Delegations; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::result::Result; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{Bounded, CheckedDiv, CheckedMul, Zero}, RuntimeDebug, }; +use scale_info::TypeInfo; /// A value denoting the strength of conviction of a vote. #[derive( diff --git a/bizinikiwi/pezframe/democracy/src/lib.rs b/bizinikiwi/pezframe/democracy/src/lib.rs index 62993dca..a814af4e 100644 --- a/bizinikiwi/pezframe/democracy/src/lib.rs +++ b/bizinikiwi/pezframe/democracy/src/lib.rs @@ -223,7 +223,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config + Sized { type WeightInfo: WeightInfo; #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The Scheduler. type Scheduler: ScheduleNamed< @@ -841,8 +842,8 @@ pub mod pezpallet { .try_insert(insert_position, who.clone()) .map_err(|_| Error::::TooMany)?; - let until = - pezframe_system::Pezpallet::::block_number().saturating_add(T::CooloffPeriod::get()); + let until = pezframe_system::Pezpallet::::block_number() + .saturating_add(T::CooloffPeriod::get()); Blacklist::::insert(&proposal_hash, (until, existing_vetoers)); Self::deposit_event(Event::::Vetoed { who, proposal_hash, until }); diff --git a/bizinikiwi/pezframe/democracy/src/migrations/unlock_and_unreserve_all_funds.rs b/bizinikiwi/pezframe/democracy/src/migrations/unlock_and_unreserve_all_funds.rs index 5f712630..059810d0 100644 --- a/bizinikiwi/pezframe/democracy/src/migrations/unlock_and_unreserve_all_funds.rs +++ b/bizinikiwi/pezframe/democracy/src/migrations/unlock_and_unreserve_all_funds.rs @@ -166,8 +166,8 @@ where /// 4. Prints summary statistics about the state to be migrated. /// 5. Encodes and returns pre-migration data to be used in post_upgrade. /// - /// Fails with a `TryRuntimeError` if somehow the amount reserved by this pezpallet is greater than - /// the actual total reserved amount for any accounts. + /// Fails with a `TryRuntimeError` if somehow the amount reserved by this pezpallet is greater + /// than the actual total reserved amount for any accounts. #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, pezsp_runtime::TryRuntimeError> { use alloc::collections::btree_set::BTreeSet; @@ -187,7 +187,8 @@ where .collect(); // Total deposited for each account *should* be less than or equal to the total reserved, - // however this does not hold for all cases due to bugs in the reserve logic of this pezpallet. + // however this does not hold for all cases due to bugs in the reserve logic of this + // pezpallet. let bugged_deposits = all_accounts .iter() .filter(|account| { diff --git a/bizinikiwi/pezframe/democracy/src/migrations/v1.rs b/bizinikiwi/pezframe/democracy/src/migrations/v1.rs index e6ad970b..1d19454e 100644 --- a/bizinikiwi/pezframe/democracy/src/migrations/v1.rs +++ b/bizinikiwi/pezframe/democracy/src/migrations/v1.rs @@ -32,7 +32,11 @@ mod v0 { #[storage_alias] pub type PublicProps = StorageValue< Pezpallet, - Vec<(PropIndex, ::Hash, ::AccountId)>, + Vec<( + PropIndex, + ::Hash, + ::AccountId, + )>, ValueQuery, >; diff --git a/bizinikiwi/pezframe/democracy/src/types.rs b/bizinikiwi/pezframe/democracy/src/types.rs index b647aba5..88f466a6 100644 --- a/bizinikiwi/pezframe/democracy/src/types.rs +++ b/bizinikiwi/pezframe/democracy/src/types.rs @@ -19,11 +19,11 @@ use crate::{AccountVote, Conviction, Vote, VoteThreshold}; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{Bounded, CheckedAdd, CheckedDiv, CheckedMul, CheckedSub, Saturating, Zero}, RuntimeDebug, }; +use scale_info::TypeInfo; /// A proposal index. pub type PropIndex = u32; diff --git a/bizinikiwi/pezframe/democracy/src/vote.rs b/bizinikiwi/pezframe/democracy/src/vote.rs index f334a2d2..4ca2e18d 100644 --- a/bizinikiwi/pezframe/democracy/src/vote.rs +++ b/bizinikiwi/pezframe/democracy/src/vote.rs @@ -20,11 +20,11 @@ use crate::{Conviction, Delegations, ReferendumIndex}; use codec::{Decode, DecodeWithMemTracking, Encode, EncodeLike, Input, MaxEncodedLen, Output}; use pezframe_support::traits::Get; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{Saturating, Zero}, BoundedVec, RuntimeDebug, }; +use scale_info::TypeInfo; /// A number of lock periods, plus a vote, one way or the other. #[derive(DecodeWithMemTracking, Copy, Clone, Eq, PartialEq, Default, RuntimeDebug)] diff --git a/bizinikiwi/pezframe/democracy/src/vote_threshold.rs b/bizinikiwi/pezframe/democracy/src/vote_threshold.rs index 97a38d98..1438bcc6 100644 --- a/bizinikiwi/pezframe/democracy/src/vote_threshold.rs +++ b/bizinikiwi/pezframe/democracy/src/vote_threshold.rs @@ -20,10 +20,10 @@ use crate::Tally; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::ops::{Add, Div, Mul, Rem}; +use pezsp_runtime::traits::{IntegerSquareRoot, Zero}; use scale_info::TypeInfo; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; -use pezsp_runtime::traits::{IntegerSquareRoot, Zero}; /// A means of determining if a vote is past pass threshold. #[derive( diff --git a/bizinikiwi/pezframe/derivatives/src/lib.rs b/bizinikiwi/pezframe/derivatives/src/lib.rs index 0abe0d78..3f88663e 100644 --- a/bizinikiwi/pezframe/derivatives/src/lib.rs +++ b/bizinikiwi/pezframe/derivatives/src/lib.rs @@ -29,8 +29,9 @@ //! //! #### The first scenario //! -//! The `pezpallet-derivatives` can be helpful when another pezpallet, which hosts the derivative assets, -//! doesn't provide a good enough way to create new assets in the context of them being derivatives. +//! The `pezpallet-derivatives` can be helpful when another pezpallet, which hosts the derivative +//! assets, doesn't provide a good enough way to create new assets in the context of them being +//! derivatives. //! //! For instance, the asset hosting pezpallet might have an asset class (NFT collection or fungible //! currency) creation extrinsic, but among its parameters, there could be things like some admin @@ -90,9 +91,9 @@ //! because `pezpallet-nfts` requires `CollectionId` to be incrementable. //! * It is desired to have a continuous ID space for all objects, both derivative and local. //! For instance, one might want to reuse the existing pezpallet combinations (like `pezpallet-nfts` -//! instance + `pezpallet-nfts-fractionalization` instance) without adding new pezpallet instances between -//! the one hosting NFTs and many special logic pallets. In this case, the original ID type would be -//! `(AssetId, AssetInstance)`, and the derivative ID type can be anything. +//! instance + `pezpallet-nfts-fractionalization` instance) without adding new pezpallet instances +//! between the one hosting NFTs and many special logic pallets. In this case, the original ID type +//! would be `(AssetId, AssetInstance)`, and the derivative ID type can be anything. #![recursion_limit = "256"] // Ensure we're `no_std` when compiling for Wasm. diff --git a/bizinikiwi/pezframe/derivatives/src/mock/mod.rs b/bizinikiwi/pezframe/derivatives/src/mock/mod.rs index 25a7e43e..2169d7e2 100644 --- a/bizinikiwi/pezframe/derivatives/src/mock/mod.rs +++ b/bizinikiwi/pezframe/derivatives/src/mock/mod.rs @@ -17,38 +17,40 @@ //! Test environment for `pezpallet-derivatives`. //! -//! It contains a simple NFT-like `unique_items` pezpallet that emulate both NFT collections and their -//! tokens (depending on the pezpallet instance). This test pezpallet is instatiated three times in the -//! test environment to cover the usage scenarios of `pezpallet-derivatives` described in it's crate -//! doc comment. +//! It contains a simple NFT-like `unique_items` pezpallet that emulate both NFT collections and +//! their tokens (depending on the pezpallet instance). This test pezpallet is instatiated three +//! times in the test environment to cover the usage scenarios of `pezpallet-derivatives` described +//! in it's crate doc comment. //! //! * The first instance, called `PredefinedIdCollections`, emulates NFT collections that are //! created with a predefined ID. //! The ID is set to XCM `AssetId`, so a derivative collection can be created directly using the -//! foreign collection's ID. This pezpallet instance illustrates and tests the `pezpallet-derivatives` -//! usage scenario #1 (i.e., when no suitable way of directly creating a derivative collection is -//! provided by the hosting pezpallet). The configuration of this instance can be found in the -//! [predefined_id_collections] module. The corresponding `pezpallet-derivatives` instance is called -//! `PredefinedIdDerivativeCollections`. +//! foreign collection's ID. This pezpallet instance illustrates and tests the +//! `pezpallet-derivatives` usage scenario #1 (i.e., when no suitable way of directly creating a +//! derivative collection is provided by the hosting pezpallet). The configuration of this instance +//! can be found in the [predefined_id_collections] module. The corresponding +//! `pezpallet-derivatives` instance is called `PredefinedIdDerivativeCollections`. //! //! * The second instance, called `AutoIdCollections`, emulates NFT collections that are created //! with an automatically assigned ID (e.g., an incremental one). //! The ID is set to `u64`, so a mapping between the foreign collection's ID and the derivative -//! collection ID is needed. This pezpallet instance illustrates and tests the `pezpallet-derivatives` -//! usage scenario #2 combined with scenario #1 (since we also test manual collection creation and -//! destruction). The configuration of this instance can be found in the [auto_id_collections] -//! module. The corresponding `pezpallet-derivatives` instance is called `AutoIdDerivativeCollections`. +//! collection ID is needed. This pezpallet instance illustrates and tests the +//! `pezpallet-derivatives` usage scenario #2 combined with scenario #1 (since we also test manual +//! collection creation and destruction). The configuration of this instance can be found in the +//! [auto_id_collections] module. The corresponding `pezpallet-derivatives` instance is called +//! `AutoIdDerivativeCollections`. //! //! * The third instance, called `PredefinedIdNfts`, emulates non-fungible tokens within collections //! from the pezpallet's second instance. //! The full NFT ID is a tuple consisting of the collection ID and a token ID, both of which are of //! the `u64` type. Since a foreign NFT is identified by `(AssetId, AssetInstance)`, we need the //! mapping between it and the derivative NFT ID. This pezpallet instance illustrates and tests the -//! `pezpallet-derivatives` usage scenario #2 without scenario #1 (the manual creation and destruction -//! of derivative NFTs is forbidden). The configuration of this instance can be found in the -//! [auto_id_nfts] module. The corresponding `pezpallet-derivatives` instance is called +//! `pezpallet-derivatives` usage scenario #2 without scenario #1 (the manual creation and +//! destruction of derivative NFTs is forbidden). The configuration of this instance can be found in +//! the [auto_id_nfts] module. The corresponding `pezpallet-derivatives` instance is called //! `DerivativeNfts`. Additionally, there is an example of asset transactors dealing with derivative -//! NFTs implemented using `pezpallet-derivatives`, which includes original-to-derivative ID mapping. +//! NFTs implemented using `pezpallet-derivatives`, which includes original-to-derivative ID +//! mapping. use super::*; use crate as pezpallet_derivatives; @@ -233,8 +235,8 @@ pub type CreateDerivativeOwnedBySovAcc CreateOp, >; -/// The `pezpallet-derivatives` instance corresponding to the `PredefinedIdCollections` instance of the -/// `unique_items` mock pezpallet. +/// The `pezpallet-derivatives` instance corresponding to the `PredefinedIdCollections` instance of +/// the `unique_items` mock pezpallet. pub type PredefinedIdDerivativeCollectionsInstance = pezpallet_derivatives::Instance1; impl pezpallet_derivatives::Config for Test { type WeightInfo = pezpallet_derivatives::TestWeightInfo; diff --git a/bizinikiwi/pezframe/derivatives/src/tests.rs b/bizinikiwi/pezframe/derivatives/src/tests.rs index 99921976..f7da6b83 100644 --- a/bizinikiwi/pezframe/derivatives/src/tests.rs +++ b/bizinikiwi/pezframe/derivatives/src/tests.rs @@ -17,8 +17,8 @@ use super::*; use crate as pezpallet_derivatives; -use pezframe_support::{assert_err, assert_ok, traits::tokens::asset_ops::common_strategies::*}; use mock::*; +use pezframe_support::{assert_err, assert_ok, traits::tokens::asset_ops::common_strategies::*}; use xcm::prelude::*; use xcm_executor::XcmExecutor; diff --git a/bizinikiwi/pezframe/dummy-dim/src/lib.rs b/bizinikiwi/pezframe/dummy-dim/src/lib.rs index 1eb83621..e576ca77 100644 --- a/bizinikiwi/pezframe/dummy-dim/src/lib.rs +++ b/bizinikiwi/pezframe/dummy-dim/src/lib.rs @@ -55,10 +55,11 @@ pub mod pezpallet { /// The runtime event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; - /// The origin which may command personhood updates through this pezpallet. Root can always do - /// this. + /// The origin which may command personhood updates through this pezpallet. Root can always + /// do this. type UpdateOrigin: EnsureOrigin; /// The maximum number of people supported in a single operation. diff --git a/bizinikiwi/pezframe/dummy-dim/src/mock.rs b/bizinikiwi/pezframe/dummy-dim/src/mock.rs index aec6e114..b4880ee8 100644 --- a/bizinikiwi/pezframe/dummy-dim/src/mock.rs +++ b/bizinikiwi/pezframe/dummy-dim/src/mock.rs @@ -16,7 +16,9 @@ // limitations under the License. use pezframe_support::derive_impl; -use pezframe_system::{offchain::CreateTransactionBase, pezpallet_prelude::ExtrinsicFor, EnsureRoot}; +use pezframe_system::{ + offchain::CreateTransactionBase, pezpallet_prelude::ExtrinsicFor, EnsureRoot, +}; use pezsp_core::{ConstU16, ConstU32, ConstU64, H256}; use pezsp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, diff --git a/bizinikiwi/pezframe/dummy-dim/src/tests.rs b/bizinikiwi/pezframe/dummy-dim/src/tests.rs index cbaebf54..92fb32db 100644 --- a/bizinikiwi/pezframe/dummy-dim/src/tests.rs +++ b/bizinikiwi/pezframe/dummy-dim/src/tests.rs @@ -107,7 +107,9 @@ fn personhood_recognition_and_suspension_works() { } assert_ok!(DummyDim::end_mutation_session(RuntimeOrigin::root())); - pezpallet_people::RingsState::::mutate(|s| *s = s.clone().end_key_migration().unwrap()); + pezpallet_people::RingsState::::mutate(|s| { + *s = s.clone().end_key_migration().unwrap() + }); assert_ok!(DummyDim::start_mutation_session(RuntimeOrigin::root())); for id in 50..100 { diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/benchmarking.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/benchmarking.rs index 8b5da942..c011f37d 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/benchmarking.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/benchmarking.rs @@ -271,7 +271,8 @@ mod benchmarks { #[block] { // fallback might decide to fail, that's okay.. - let maybe_err = Pezpallet::::manage(origin, crate::ManagerOperation::EmergencyFallback); + let maybe_err = + Pezpallet::::manage(origin, crate::ManagerOperation::EmergencyFallback); //.. but it cannot be bad origin. assert!(maybe_err.is_ok() || maybe_err.unwrap_err() != DispatchError::BadOrigin.into()); } diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/lib.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/lib.rs index a7d79d63..ebd4c0c1 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/lib.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/lib.rs @@ -17,7 +17,8 @@ //! # Multi-phase, multi-block, election provider pezpallet. //! -//! > This pezpallet is sometimes abbreviated as `EPMB`, and `pezpallet_election_provider_multi_phase` as +//! > This pezpallet is sometimes abbreviated as `EPMB`, and +//! > `pezpallet_election_provider_multi_phase` as //! > `EPM`. //! //! ## Overall idea @@ -35,16 +36,16 @@ //! with large enough blocks (in a dedicated teyrchain), the number of voters included in the NPoS //! system can grow significantly (yet, obviously not indefinitely). //! -//! Note that this pezpallet does not consider how the recipient is processing the results. To ensure -//! scalability, the recipient of this pezpallet's data (i.e. `pezpallet-staking`) must also be capable of -//! pagination and multi-block processing. +//! Note that this pezpallet does not consider how the recipient is processing the results. To +//! ensure scalability, the recipient of this pezpallet's data (i.e. `pezpallet-staking`) must also +//! be capable of pagination and multi-block processing. //! //! ## Companion pallets //! //! This pezpallet will only function in a sensible way if it is peered with its companion pallets. //! -//! - The [`verifier`] pezpallet provides a standard implementation of the [`verifier::Verifier`]. This -//! pezpallet is mandatory. +//! - The [`verifier`] pezpallet provides a standard implementation of the [`verifier::Verifier`]. +//! This pezpallet is mandatory. //! - The [`unsigned`] module provides the implementation of unsigned submission by validators. If //! this pezpallet is included, then [`Config::UnsignedPhase`] will determine its duration. //! - The [`signed`] module provides the implementation of the signed submission by any account. If @@ -61,8 +62,8 @@ //! //! ### Pezpallet Ordering: //! -//! TODO: @kiaenigma: this needs clarification and a enforcement. Signed pezpallet should come first. -//! Fixing this should yield removing `verifier_done` from the phase transition. +//! TODO: @kiaenigma: this needs clarification and a enforcement. Signed pezpallet should come +//! first. Fixing this should yield removing `verifier_done` from the phase transition. //! //! The ordering of these pallets in a runtime should be: //! * parent @@ -76,11 +77,11 @@ //! //! ## Pagination //! -//! Most of the external APIs of this pezpallet are paginated. All pagination follow a pattern where if -//! `N` pages exist, the first paginated call is `function(N-1)` and the last one is `function(0)`. -//! For example, with 3 pages, the `elect` of [`ElectionProvider`] is expected to be called as -//! `elect(2) -> elect(1) -> elect(0)`. In essence, calling a paginated function with index 0 is -//! always a signal of termination, meaning that no further calls will follow. +//! Most of the external APIs of this pezpallet are paginated. All pagination follow a pattern where +//! if `N` pages exist, the first paginated call is `function(N-1)` and the last one is +//! `function(0)`. For example, with 3 pages, the `elect` of [`ElectionProvider`] is expected to be +//! called as `elect(2) -> elect(1) -> elect(0)`. In essence, calling a paginated function with +//! index 0 is always a signal of termination, meaning that no further calls will follow. //! //! The snapshot creation for voters (Nominators in staking), submission of signed pages, validation //! of signed solutions and exporting of pages are all paginated. Note that this pezpallet is yet to @@ -95,8 +96,8 @@ //! ## Phases //! //! The operations in this pezpallet are divided intor rounds, a `u32` number stored in [`Round`]. -//! This value helps this pezpallet organize itself, and leaves the door open for lazy deletion of any -//! stale data. A round, under the happy path, starts by receiving the call to +//! This value helps this pezpallet organize itself, and leaves the door open for lazy deletion of +//! any stale data. A round, under the happy path, starts by receiving the call to //! [`ElectionProvider::start`], and is terminated by receiving a call to //! [`ElectionProvider::elect`] with value 0. //! @@ -124,7 +125,8 @@ //! * [`Config::Pages`] calls to elect are expected, but all in all the pezpallet will close a round //! once `elect(0)` is called. //! -//! > Given this, it is rather important for the user of this pezpallet to ensure it always terminates +//! > Given this, it is rather important for the user of this pezpallet to ensure it always +//! > terminates //! > election via `elect` before requesting a new one. //! //! ## Feasible Solution (correct solution) @@ -149,8 +151,8 @@ //! //! 1. Do nothing: [`Continue`] //! 2. Force us into the emergency phase: [`crate::InitiateEmergencyPhase`]. This initiates -//! [`Phase::Emergency`], which will halt almost all operations of this pezpallet, and it can only -//! be recovered by [`AdminOperation`], dispatched via [`Call::manage`]. +//! [`Phase::Emergency`], which will halt almost all operations of this pezpallet, and it can +//! only be recovered by [`AdminOperation`], dispatched via [`Call::manage`]. //! 3. compute an onchain from the give page of snapshot. //! //! Note that configuring the fallback to be onchain computation is not recommended, unless for @@ -182,16 +184,16 @@ // - Naming convention is: `${singular}_page` for singular, e.g. `voter_page` for `Vec`. // `paged_${plural}` for plural, e.g. `paged_voters` for `Vec>`. // -// - Since this crate has multiple `Pezpallet` and `Configs`, in each sub-pezpallet, we only reference the -// local `Pezpallet` without a prefix and allow it to be imported via `use`. Avoid `super::Pezpallet` -// except for the case of a modules that want to reference their local `Pezpallet` . The -// `crate::Pezpallet` is always reserved for the parent pezpallet. Other sibling pallets must be -// referenced with full path, e.g. `crate::Verifier::Pezpallet`. Do NOT write something like `use -// unsigned::Pezpallet as UnsignedPallet`. +// - Since this crate has multiple `Pezpallet` and `Configs`, in each sub-pezpallet, we only +// reference the local `Pezpallet` without a prefix and allow it to be imported via `use`. Avoid +// `super::Pezpallet` except for the case of a modules that want to reference their local +// `Pezpallet` . The `crate::Pezpallet` is always reserved for the parent pezpallet. Other sibling +// pallets must be referenced with full path, e.g. `crate::Verifier::Pezpallet`. Do NOT write +// something like `use unsigned::Pezpallet as UnsignedPallet`. // // - Respecting private storage items with wrapper We move all implementations out of the `mod -// pezpallet` as much as possible to ensure we NEVER access the internal storage items directly. All -// operations should happen with the wrapper types. +// pezpallet` as much as possible to ensure we NEVER access the internal storage items directly. +// All operations should happen with the wrapper types. #![cfg_attr(not(feature = "std"), no_std)] @@ -210,7 +212,6 @@ use pezframe_support::{ DebugNoBound, Twox64Concat, }; use pezframe_system::pezpallet_prelude::*; -use scale_info::TypeInfo; use pezsp_arithmetic::{ traits::{CheckedAdd, Zero}, PerThing, UpperOf, @@ -221,6 +222,7 @@ use pezsp_runtime::{ SaturatedConversion, }; use pezsp_std::{borrow::ToOwned, boxed::Box, prelude::*}; +use scale_info::TypeInfo; #[cfg(test)] mod mock; @@ -1630,8 +1632,8 @@ impl ElectionProvider for Pezpallet { .map_err(|err| { // if any pages returns an error, we go into the emergency phase and don't do // anything else anymore. This will prevent any new submissions to signed and - // unsigned pezpallet, and thus the verifier will also be almost stuck, except for the - // submission of emergency solutions. + // unsigned pezpallet, and thus the verifier will also be almost stuck, except for + // the submission of emergency solutions. log!(debug, "fallback also ({:?}) failed for page {:?}", err, remaining); err }) @@ -2904,9 +2906,9 @@ mod manage_ops { // This scenario have multiple outcomes: // 1. rotate in off => almost a noop // 2. rotate mid signed, validation, unsigned, done, but NOT export => clear all data, move to - // next round and be off. Note: all of the data in this pezpallet is indexed by the round index, - // so moving to the next round will implicitly make the old data unavaioable, even if not - // cleared out. This secnario needs further testing. + // next round and be off. Note: all of the data in this pezpallet is indexed by the round + // index, so moving to the next round will implicitly make the old data unavaioable, even if + // not cleared out. This secnario needs further testing. // 3. rotate mid export: same as above, except staking will be out of sync and will also need // governance intervention. // diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/mock/mod.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/mock/mod.rs index f64041a6..6f65fd6d 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/mock/mod.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/mock/mod.rs @@ -31,6 +31,7 @@ use crate::{ verifier::{self as verifier_pallet, AsynchronousVerifier, Status}, }; use codec::{Decode, Encode, MaxEncodedLen}; +use parking_lot::RwLock; use pezframe_election_provider_support::{ bounds::{ElectionBounds, ElectionBoundsBuilder}, InstantElectionProvider, NposSolution, SequentialPhragmen, @@ -42,8 +43,6 @@ use pezframe_support::{ weights::{constants, Weight}, }; use pezframe_system::EnsureRoot; -use parking_lot::RwLock; -pub use signed::*; use pezsp_core::{ offchain::{ testing::{PoolState, TestOffchainExt, TestTransactionPoolExt}, @@ -57,6 +56,7 @@ use pezsp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, BuildStorage, PerU16, Perbill, }; +pub use signed::*; pub use staking::*; use std::{sync::Arc, vec}; diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/signed/benchmarking.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/signed/benchmarking.rs index 83290b15..f2b5096c 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/signed/benchmarking.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/signed/benchmarking.rs @@ -64,7 +64,11 @@ mod benchmarks { if i == 0 { for p in 0..T::Pages::get() { let page = Some(Default::default()); - Pezpallet::::submit_page(RawOrigin::Signed(submitter.clone()).into(), p, page)?; + Pezpallet::::submit_page( + RawOrigin::Signed(submitter.clone()).into(), + p, + page, + )?; } } } diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/signed/mod.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/signed/mod.rs index 0bc99c65..ba161467 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/signed/mod.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/signed/mod.rs @@ -71,11 +71,11 @@ use pezframe_support::{ BoundedVec, Twox64Concat, }; use pezframe_system::{ensure_signed, pezpallet_prelude::*}; -use scale_info::TypeInfo; use pezsp_io::MultiRemovalResults; use pezsp_npos_elections::ElectionScore; use pezsp_runtime::{traits::Saturating, Perbill}; use pezsp_std::prelude::*; +use scale_info::TypeInfo; /// Explore all weights pub use crate::weights::traits::pezpallet_election_provider_multi_block_signed::*; @@ -984,7 +984,9 @@ pub mod pezpallet { impl Pezpallet { #[cfg(any(feature = "try-runtime", test, feature = "runtime-benchmarks"))] - pub(crate) fn do_try_state(_n: BlockNumberFor) -> Result<(), pezsp_runtime::TryRuntimeError> { + pub(crate) fn do_try_state( + _n: BlockNumberFor, + ) -> Result<(), pezsp_runtime::TryRuntimeError> { Submissions::::sanity_check_round(Self::current_round()) } diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/types.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/types.rs index 77a1fd7b..6f042f48 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/types.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/types.rs @@ -19,13 +19,13 @@ //! //! ## [`SolutionOf`] //! -//! This type is among the most cryptic used in the EPMB pezpallet. The origins of this type go back to -//! the fact that sending a solution, with hundreds or thousands of account-ids in it would be too -//! large for a chain to handle. This was particularly the case in a single page solution, as +//! This type is among the most cryptic used in the EPMB pezpallet. The origins of this type go back +//! to the fact that sending a solution, with hundreds or thousands of account-ids in it would be +//! too large for a chain to handle. This was particularly the case in a single page solution, as //! developed in `election-provider-multi-phase`. To combat this, a "compact" custom type is //! generated to encapsulate a solution. This type is generated by -//! [`pezframe_election_provider_support::generate_solution_type`]. See the documentation of this macro -//! for more information about the hacks used to reduce the size of the solution. +//! [`pezframe_election_provider_support::generate_solution_type`]. See the documentation of this +//! macro for more information about the hacks used to reduce the size of the solution. //! //! Consequently, the [`SolutionVoterIndexOf`] and [`SolutionTargetIndexOf`] and //! [`SolutionAccuracyOf`] are derived from this type. @@ -44,7 +44,6 @@ use pezframe_support::{ PartialEqNoBound, }; use pezframe_system::pezpallet_prelude::BlockNumberFor; -use scale_info::TypeInfo; use pezsp_core::Get; pub use pezsp_npos_elections::{ElectionResult, ElectionScore}; use pezsp_runtime::{ @@ -52,6 +51,7 @@ use pezsp_runtime::{ SaturatedConversion, Saturating, }; use pezsp_std::{collections::btree_set::BTreeSet, fmt::Debug, prelude::*}; +use scale_info::TypeInfo; /// The solution type used by this crate. pub type SolutionOf = ::Solution; @@ -280,8 +280,8 @@ pub enum Phase { /// /// Once this is active, no more signed or solutions will be accepted. Export(PageIndex), - /// The emergency phase. This is could be enabled by one of the fallbacks, and locks the pezpallet - /// such that only governance can change the state. + /// The emergency phase. This is could be enabled by one of the fallbacks, and locks the + /// pezpallet such that only governance can change the state. Emergency, } diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/miner.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/miner.rs index 3ace55e3..d5f12682 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/miner.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/miner.rs @@ -36,13 +36,13 @@ use codec::Encode; use pezframe_election_provider_support::{ExtendedBalance, NposSolver, Support, VoteWeight}; use pezframe_support::{traits::Get, BoundedVec}; use pezframe_system::pezpallet_prelude::*; -use scale_info::TypeInfo; use pezsp_npos_elections::EvaluateSupport; use pezsp_runtime::{ offchain::storage::{MutateStorageError, StorageValueRef}, traits::{SaturatedConversion, Saturating, Zero}, }; use pezsp_std::{collections::btree_map::BTreeMap, prelude::*}; +use scale_info::TypeInfo; // TODO: we should have a fuzzer for miner that ensures no matter the parameters, it generates a // valid solution. Esp. for the trimming. diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/mod.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/mod.rs index d48601e2..b573467b 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/mod.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/mod.rs @@ -17,8 +17,8 @@ //! ## The unsigned phase, and its miner. //! -//! This pezpallet deals with unsigned submissions. These are backup, "possibly" multi-page submissions -//! from validators. +//! This pezpallet deals with unsigned submissions. These are backup, "possibly" multi-page +//! submissions from validators. //! //! This pezpallet has two miners, described in [`unsigned::miner`]. //! diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/benchmarking.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/benchmarking.rs index d5d68836..9887b6c1 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/benchmarking.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/benchmarking.rs @@ -188,8 +188,8 @@ mod benchmarks { crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); crate::Pezpallet::::start().unwrap(); - // roll to signed validation, with a solution stored in the signed pezpallet, but this solution - // is corrupt in its msp. + // roll to signed validation, with a solution stored in the signed pezpallet, but this + // solution is corrupt in its msp. let mut paged_solution = crate::Pezpallet::::roll_to_signed_and_mine_full_solution(); let page_to_corrupt = crate::Pezpallet::::msp() - v; crate::log!( diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/impls.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/impls.rs index cd33e8be..3e435575 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/impls.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/impls.rs @@ -191,8 +191,8 @@ pub(crate) mod pezpallet { /// - The number of existing keys in `QueuedSolutionBackings` must always match that of the /// INVALID variant. /// - /// Moreover, the following conditions must be met when this pezpallet is in [`Status::Nothing`], - /// meaning that no ongoing asynchronous verification is ongoing. + /// Moreover, the following conditions must be met when this pezpallet is in + /// [`Status::Nothing`], meaning that no ongoing asynchronous verification is ongoing. /// /// - No keys should exist in the INVALID variant. /// - This implies that no data should exist in `QueuedSolutionBackings`. @@ -202,8 +202,8 @@ pub(crate) mod pezpallet { /// > the number of keys in the VALID variant. In fact, an empty solution with score of [0, 0, /// > 0] can also be correct. /// - /// No additional conditions must be met when the pezpallet is in [`Status::Ongoing`]. The number - /// of pages in + /// No additional conditions must be met when the pezpallet is in [`Status::Ongoing`]. The + /// number of pages in pub struct QueuedSolution(pezsp_std::marker::PhantomData); impl QueuedSolution { /// Private helper for mutating the storage group. @@ -275,7 +275,10 @@ pub(crate) mod pezpallet { /// known to be valid. At this stage, we write to the invalid variant. Once all pages are /// verified, a call to [`finalize_correct`] will seal the correct pages and flip the /// invalid/valid variants. - pub(crate) fn set_invalid_page(page: PageIndex, supports: SupportsOfVerifier>) { + pub(crate) fn set_invalid_page( + page: PageIndex, + supports: SupportsOfVerifier>, + ) { use pezframe_support::traits::TryCollect; Self::mutate_checked(|| { let backings: BoundedVec<_, _> = supports @@ -851,7 +854,9 @@ impl Pezpallet { } #[cfg(any(test, feature = "runtime-benchmarks", feature = "try-runtime"))] - pub(crate) fn do_try_state(_now: BlockNumberFor) -> Result<(), pezsp_runtime::TryRuntimeError> { + pub(crate) fn do_try_state( + _now: BlockNumberFor, + ) -> Result<(), pezsp_runtime::TryRuntimeError> { QueuedSolution::::sanity_check() } } diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/mod.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/mod.rs index 2b39c949..aa6c6dc2 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/mod.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/mod.rs @@ -17,8 +17,8 @@ //! # The Verifier Pezpallet //! -//! This pezpallet has no end-user functionality, and is only used internally by other pallets in the -//! EPMB machinery to verify solutions. +//! This pezpallet has no end-user functionality, and is only used internally by other pallets in +//! the EPMB machinery to verify solutions. //! //! ### *Feasibility* Check //! @@ -76,9 +76,9 @@ mod tests; // internal imports pub use crate::weights::traits::pezpallet_election_provider_multi_block_verifier::*; -use pezframe_election_provider_support::PageIndex; use impls::SupportsOfVerifier; pub use impls::{feasibility_check_page_inner_with_snapshot, pezpallet::*, Status}; +use pezframe_election_provider_support::PageIndex; use pezsp_core::Get; use pezsp_npos_elections::ElectionScore; use pezsp_std::{fmt::Debug, prelude::*}; @@ -227,8 +227,9 @@ pub enum VerificationResult { /// Something that can provide candidate solutions to the verifier. /// -/// In reality, this can be implemented by the [`crate::signed::Pezpallet`], where signed solutions are -/// queued and sorted based on claimed score, and they are put forth one by one, from best to worse. +/// In reality, this can be implemented by the [`crate::signed::Pezpallet`], where signed solutions +/// are queued and sorted based on claimed score, and they are put forth one by one, from best to +/// worse. pub trait SolutionDataProvider { /// The opaque solution type. type Solution; diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/tests.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/tests.rs index ec4fe36b..1a67b118 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/tests.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/tests.rs @@ -153,7 +153,9 @@ mod feasibility_check { paged.solution_pages[0].clone(), 0 ), - FeasibilityError::NposElection(pezsp_npos_elections::Error::SolutionInvalidIndex), + FeasibilityError::NposElection( + pezsp_npos_elections::Error::SolutionInvalidIndex + ), ); }) } diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/benchmarking.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/benchmarking.rs index 3f230f03..816a9a94 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/benchmarking.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/benchmarking.rs @@ -26,9 +26,9 @@ use pezframe_support::{ BoundedVec, }; use pezframe_system::RawOrigin; -use rand::{prelude::SliceRandom, rngs::SmallRng, SeedableRng}; use pezsp_arithmetic::{per_things::Percent, traits::One}; use pezsp_runtime::InnerOf; +use rand::{prelude::SliceRandom, rngs::SmallRng, SeedableRng}; use crate::{unsigned::IndexAssignmentOf, *}; @@ -252,7 +252,9 @@ mod benchmarks { #[block] { - Pezpallet::::finalize_signed_phase_accept_solution(ready, &receiver, deposit, call_fee); + Pezpallet::::finalize_signed_phase_accept_solution( + ready, &receiver, deposit, call_fee, + ); } assert_eq!(T::Currency::free_balance(&receiver), initial_balance + reward + call_fee); @@ -330,8 +332,9 @@ mod benchmarks { let witness = SolutionOrSnapshotSize { voters: v, targets: t }; let raw_solution = solution_with_size::(witness, a, d)?; - let ready_solution = Pezpallet::::feasibility_check(raw_solution, ElectionCompute::Signed) - .map_err(<&str>::from)?; + let ready_solution = + Pezpallet::::feasibility_check(raw_solution, ElectionCompute::Signed) + .map_err(<&str>::from)?; CurrentPhase::::put(Phase::Signed); // Assume a queued solution is stored, regardless of where it comes from. QueuedSolution::::put(ready_solution); @@ -396,8 +399,10 @@ mod benchmarks { }; let caller = pezframe_benchmarking::whitelisted_caller(); - let deposit = - Pezpallet::::deposit_for(&solution, SnapshotMetadata::::get().unwrap_or_default()); + let deposit = Pezpallet::::deposit_for( + &solution, + SnapshotMetadata::::get().unwrap_or_default(), + ); T::Currency::make_free_balance_be( &caller, T::Currency::minimum_balance() * 1000u32.into() + deposit, @@ -406,7 +411,9 @@ mod benchmarks { #[extrinsic_call] _(RawOrigin::Signed(caller), Box::new(solution)); - assert!(Pezpallet::::signed_submissions().len() as u32 == T::SignedMaxSubmissions::get()); + assert!( + Pezpallet::::signed_submissions().len() as u32 == T::SignedMaxSubmissions::get() + ); Ok(()) } diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/lib.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/lib.rs index f21040a3..91c9c688 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/lib.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/lib.rs @@ -23,10 +23,10 @@ //! ## Phases //! //! The timeline of pezpallet is as follows. At each block, -//! [`pezframe_election_provider_support::ElectionDataProvider::next_election_prediction`] is used to -//! estimate the time remaining to the next call to -//! [`pezframe_election_provider_support::ElectionProvider::elect`]. Based on this, a phase is chosen. -//! The timeline is as follows. +//! [`pezframe_election_provider_support::ElectionDataProvider::next_election_prediction`] is used +//! to estimate the time remaining to the next call to +//! [`pezframe_election_provider_support::ElectionProvider::elect`]. Based on this, a phase is +//! chosen. The timeline is as follows. //! //! ```ignore //! elect() @@ -39,7 +39,8 @@ //! `next_election_prediction`, but only ends when a call to [`ElectionProvider::elect`] happens. If //! no `elect` happens, the signed phase is extended. //! -//! > Given this, it is rather important for the user of this pezpallet to ensure it always terminates +//! > Given this, it is rather important for the user of this pezpallet to ensure it always +//! > terminates //! election via `elect` before requesting a new one. //! //! Each of the phases can be disabled by essentially setting their length to zero. If both phases @@ -67,11 +68,11 @@ //! origin can not bail out in any way, if their solution is queued. //! //! Upon the end of the signed phase, the solutions are examined from best to worse (i.e. `pop()`ed -//! until drained). Each solution undergoes an expensive `Pezpallet::feasibility_check`, which ensures -//! the score claimed by this score was correct, and it is valid based on the election data (i.e. -//! votes and targets). At each step, if the current best solution passes the feasibility check, -//! it is considered to be the best one. The sender of the origin is rewarded, and the rest of the -//! queued solutions get their deposit back and are discarded, without being checked. +//! until drained). Each solution undergoes an expensive `Pezpallet::feasibility_check`, which +//! ensures the score claimed by this score was correct, and it is valid based on the election data +//! (i.e. votes and targets). At each step, if the current best solution passes the feasibility +//! check, it is considered to be the best one. The sender of the origin is rewarded, and the rest +//! of the queued solutions get their deposit back and are discarded, without being checked. //! //! The following example covers all of the cases at the end of the signed phase: //! @@ -124,13 +125,13 @@ //! provided //! 2. Any other unforeseen internal error //! -//! A call to `T::ElectionProvider::elect` is made, and `Ok(_)` cannot be returned, then the pezpallet -//! proceeds to the [`Phase::Emergency`]. During this phase, any solution can be submitted from -//! [`Config::ForceOrigin`], without any checking, via [`Pezpallet::set_emergency_election_result`] -//! transaction. Hence, `[`Config::ForceOrigin`]` should only be set to a trusted origin, such as -//! the council or root. Once submitted, the forced solution is kept in [`QueuedSolution`] until the -//! next call to `T::ElectionProvider::elect`, where it is returned and [`Phase`] goes back to -//! `Off`. +//! A call to `T::ElectionProvider::elect` is made, and `Ok(_)` cannot be returned, then the +//! pezpallet proceeds to the [`Phase::Emergency`]. During this phase, any solution can be submitted +//! from [`Config::ForceOrigin`], without any checking, via +//! [`Pezpallet::set_emergency_election_result`] transaction. Hence, `[`Config::ForceOrigin`]` +//! should only be set to a trusted origin, such as the council or root. Once submitted, the forced +//! solution is kept in [`QueuedSolution`] until the next call to `T::ElectionProvider::elect`, +//! where it is returned and [`Phase`] goes back to `Off`. //! //! This implies that the user of this pezpallet (i.e. a staking pezpallet) should re-try calling //! `T::ElectionProvider::elect` in case of error, until `OK(_)` is returned. @@ -172,8 +173,8 @@ //! //! ## Error types //! -//! This pezpallet provides a verbose error system to ease future debugging and debugging. The overall -//! hierarchy of errors is as follows: +//! This pezpallet provides a verbose error system to ease future debugging and debugging. The +//! overall hierarchy of errors is as follows: //! //! 1. [`pezpallet::Error`]: These are the errors that can be returned in the dispatchables of the //! pezpallet, either signed or unsigned. Since decomposition with nested enums is not possible @@ -192,8 +193,8 @@ //! ## Multi-page election support //! //! The [`pezframe_election_provider_support::ElectionDataProvider`] and -//! [`pezframe_election_provider_support::ElectionProvider`] traits used by this pezpallet can support a -//! multi-page election. +//! [`pezframe_election_provider_support::ElectionProvider`] traits used by this pezpallet can +//! support a multi-page election. //! //! However, this pezpallet only supports single-page election and data //! provider and all the relevant trait implementation and configurations reflect that assumption. @@ -206,11 +207,11 @@ //! **Emergency-phase recovery script**: This script should be taken out of staking-miner in //! pezkuwi and ideally live in `bizinikiwi/utils/pezframe/elections`. //! -//! **Challenge Phase**. We plan on adding a third phase to the pezpallet, called the challenge phase. -//! This is a phase in which no further solutions are processed, and the current best solution might -//! be challenged by anyone (signed or unsigned). The main plan here is to enforce the solution to -//! be PJR. Checking PJR on-chain is quite expensive, yet proving that a solution is **not** PJR is -//! rather cheap. If a queued solution is successfully proven bad: +//! **Challenge Phase**. We plan on adding a third phase to the pezpallet, called the challenge +//! phase. This is a phase in which no further solutions are processed, and the current best +//! solution might be challenged by anyone (signed or unsigned). The main plan here is to enforce +//! the solution to be PJR. Checking PJR on-chain is quite expensive, yet proving that a solution is +//! **not** PJR is rather cheap. If a queued solution is successfully proven bad: //! //! 1. We must surely slash whoever submitted that solution (might be a challenge for unsigned //! solutions). @@ -258,7 +259,6 @@ use pezframe_support::{ DefaultNoBound, EqNoBound, PartialEqNoBound, }; use pezframe_system::{ensure_none, offchain::CreateBare, pezpallet_prelude::BlockNumberFor}; -use scale_info::TypeInfo; use pezsp_arithmetic::{ traits::{CheckedAdd, Zero}, UpperOf, @@ -271,6 +271,7 @@ use pezsp_runtime::{ }, DispatchError, ModuleError, PerThing, Perbill, RuntimeDebug, SaturatedConversion, }; +use scale_info::TypeInfo; #[cfg(feature = "try-runtime")] use pezsp_runtime::TryRuntimeError; @@ -576,8 +577,8 @@ pub enum FeasibilityError { WrongWinnerCount, /// The snapshot is not available. /// - /// Kinda defensive: The pezpallet should technically never attempt to do a feasibility check when - /// no snapshot is present. + /// Kinda defensive: The pezpallet should technically never attempt to do a feasibility check + /// when no snapshot is present. SnapshotUnavailable, /// Internal error from the election crate. NposElection(pezsp_npos_elections::Error), @@ -1008,8 +1009,8 @@ pub mod pezpallet { Ok(()) } - /// Set a solution in the queue, to be handed out to the client of this pezpallet in the next - /// call to `ElectionProvider::elect`. + /// Set a solution in the queue, to be handed out to the client of this pezpallet in the + /// next call to `ElectionProvider::elect`. /// /// This can only be set by `T::ForceOrigin`, and only when the phase is `Emergency`. /// diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/mock.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/mock.rs index d65778eb..9b8c8607 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/mock.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/mock.rs @@ -17,6 +17,8 @@ use super::*; use crate::{self as multi_phase, signed::GeometricDepositBase, unsigned::MinerConfig}; +use multi_phase::unsigned::{IndexAssignmentOf, VoterOf}; +use parking_lot::RwLock; use pezframe_election_provider_support::{ bounds::{DataProviderBounds, ElectionBounds, ElectionBoundsBuilder}, data_provider, onchain, ElectionDataProvider, NposSolution, SequentialPhragmen, @@ -28,8 +30,6 @@ use pezframe_support::{ weights::{constants, Weight}, BoundedVec, }; -use multi_phase::unsigned::{IndexAssignmentOf, VoterOf}; -use parking_lot::RwLock; use pezsp_core::{ offchain::{ testing::{PoolState, TestOffchainExt, TestTransactionPoolExt}, @@ -680,7 +680,9 @@ impl ExtBuilder { #[cfg(feature = "try-runtime")] ext.execute_with(|| { pezframe_support::assert_ok!( - >::try_state(System::block_number()) + >::try_state( + System::block_number() + ) ); }); } diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/remote_mining.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/remote_mining.rs index 79fff3e9..fbdfc7be 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/remote_mining.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/remote_mining.rs @@ -33,10 +33,10 @@ use pezframe_support::{ traits::Get, weights::constants::{WEIGHT_PROOF_SIZE_PER_MB, WEIGHT_REF_TIME_PER_SECOND}, }; -use remote_externalities::{Builder, Mode, OnlineConfig, Transport}; use pezsp_core::{ConstU32, H256}; use pezsp_npos_elections::BalancingConfig; use pezsp_runtime::{Perbill, Weight}; +use remote_externalities::{Builder, Mode, OnlineConfig, Transport}; pub mod pezkuwi { use super::*; diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/unsigned.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/unsigned.rs index 5576d6d6..65530b57 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/unsigned.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/unsigned.rs @@ -35,7 +35,6 @@ use pezframe_system::{ offchain::{CreateBare, SubmitTransaction}, pezpallet_prelude::BlockNumberFor, }; -use scale_info::TypeInfo; use pezsp_npos_elections::{ assignment_ratio_to_staked_normalized, assignment_staked_to_ratio_normalized, ElectionResult, ElectionScore, EvaluateSupport, @@ -44,6 +43,7 @@ use pezsp_runtime::{ offchain::storage::{MutateStorageError, StorageValueRef}, DispatchError, SaturatedConversion, }; +use scale_info::TypeInfo; /// Storage key used to store the last block number at which offchain worker ran. pub(crate) const OFFCHAIN_LAST_BLOCK: &[u8] = b"parity/multi-phase-unsigned-election"; @@ -64,12 +64,15 @@ pub type MinerVoterOf = pezframe_election_provider_support::Voter< >; /// The relative distribution of a voter's stake among the winning targets. -pub type Assignment = - pezsp_npos_elections::Assignment<::AccountId, SolutionAccuracyOf>; +pub type Assignment = pezsp_npos_elections::Assignment< + ::AccountId, + SolutionAccuracyOf, +>; -/// The [`IndexAssignment`][pezframe_election_provider_support::IndexAssignment] type specialized for a -/// particular runtime `T`. -pub type IndexAssignmentOf = pezframe_election_provider_support::IndexAssignmentOf>; +/// The [`IndexAssignment`][pezframe_election_provider_support::IndexAssignment] type specialized +/// for a particular runtime `T`. +pub type IndexAssignmentOf = + pezframe_election_provider_support::IndexAssignmentOf>; /// Error type of the pezpallet's [`crate::Config::Solver`]. pub type SolverErrorOf = <::Solver as NposSolver>::Error; @@ -477,8 +480,8 @@ impl Miner { }) } - /// Convert a raw solution from [`pezsp_npos_elections::ElectionResult`] to [`RawSolution`], which - /// is ready to be submitted to the chain. + /// Convert a raw solution from [`pezsp_npos_elections::ElectionResult`] to [`RawSolution`], + /// which is ready to be submitted to the chain. /// /// Will always reduce the solution as well. pub fn prepare_election_result_with_snapshot( diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/src/lib.rs b/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/src/lib.rs index 430aea50..d352a0f0 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/src/lib.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/src/lib.rs @@ -23,8 +23,8 @@ mod mock; pub(crate) const LOG_TARGET: &str = "tests::e2e-epm"; -use pezframe_support::{assert_err, assert_ok}; use mock::*; +use pezframe_support::{assert_err, assert_ok}; use pezpallet_timestamp::Now; use pezsp_core::Get; use pezsp_runtime::Perbill; @@ -146,7 +146,10 @@ fn mass_slash_doesnt_enter_emergency_phase() { .build_offchainify(); ext.execute_with(|| { - assert_eq!(pezpallet_staking::ForceEra::::get(), pezpallet_staking::Forcing::NotForcing); + assert_eq!( + pezpallet_staking::ForceEra::::get(), + pezpallet_staking::Forcing::NotForcing + ); let active_set_size_before_slash = Session::validators().len(); @@ -173,12 +176,16 @@ fn mass_slash_doesnt_enter_emergency_phase() { } // Ensure no more than disabling limit of validators (default 1/3) is disabled - let disabling_limit = pezpallet_session::disabling::UpToLimitWithReEnablingDisablingStrategy::< - SLASHING_DISABLING_FACTOR, - >::disable_limit(active_set_size_before_slash); + let disabling_limit = + pezpallet_session::disabling::UpToLimitWithReEnablingDisablingStrategy::< + SLASHING_DISABLING_FACTOR, + >::disable_limit(active_set_size_before_slash); assert!(disabled.len() == disabling_limit); - assert_eq!(pezpallet_staking::ForceEra::::get(), pezpallet_staking::Forcing::NotForcing); + assert_eq!( + pezpallet_staking::ForceEra::::get(), + pezpallet_staking::Forcing::NotForcing + ); }); } diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/src/mock.rs b/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/src/mock.rs index d393fd40..c368f5b6 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/src/mock.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/src/mock.rs @@ -42,6 +42,7 @@ use pezsp_staking::{ use std::collections::BTreeMap; use codec::Decode; +use parking_lot::RwLock; use pezframe_election_provider_support::{ bounds::ElectionBoundsBuilder, onchain, ElectionDataProvider, ExtendedBalance, SequentialPhragmen, Weight, @@ -51,7 +52,6 @@ use pezpallet_election_provider_multi_phase::{ QueuedSolution, SolutionAccuracyOf, }; use pezpallet_staking::{ActiveEra, CurrentEra, ErasStartSessionIndex, StakerStatus}; -use parking_lot::RwLock; use std::sync::Arc; use crate::{log, log_current_time}; diff --git a/bizinikiwi/pezframe/election-provider-support/solution-type/fuzzer/src/compact.rs b/bizinikiwi/pezframe/election-provider-support/solution-type/fuzzer/src/compact.rs index 45cba7b5..6ad4a144 100644 --- a/bizinikiwi/pezframe/election-provider-support/solution-type/fuzzer/src/compact.rs +++ b/bizinikiwi/pezframe/election-provider-support/solution-type/fuzzer/src/compact.rs @@ -15,8 +15,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -use pezframe_election_provider_solution_type::generate_solution_type; use honggfuzz::fuzz; +use pezframe_election_provider_solution_type::generate_solution_type; use pezsp_arithmetic::Percent; use pezsp_runtime::codec::{Encode, Error}; diff --git a/bizinikiwi/pezframe/election-provider-support/src/lib.rs b/bizinikiwi/pezframe/election-provider-support/src/lib.rs index d80e59ff..011ff0ec 100644 --- a/bizinikiwi/pezframe/election-provider-support/src/lib.rs +++ b/bizinikiwi/pezframe/election-provider-support/src/lib.rs @@ -42,7 +42,8 @@ //! ElectionProvider //! ``` //! -//! > It could also be possible that a third party pezpallet (C), provides the data of election to an +//! > It could also be possible that a third party pezpallet (C), provides the data of election to +//! > an //! > election provider (B), which then passes the election result to another pezpallet (A). //! //! ## Election Types @@ -218,13 +219,13 @@ pub use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; /// Re-export the solution generation macro. pub use pezframe_election_provider_solution_type::generate_solution_type; pub use pezframe_support::{traits::Get, weights::Weight, BoundedVec, DefaultNoBound}; -use scale_info::TypeInfo; /// Re-export some type as they are used in the interface. pub use pezsp_arithmetic::PerThing; pub use pezsp_npos_elections::{ Assignment, BalancingConfig, ElectionResult, Error, ExtendedBalance, IdentifierT, PerThing128, Support, Supports, VoteWeight, }; +use scale_info::TypeInfo; pub use traits::NposSolution; #[cfg(feature = "try-runtime")] @@ -238,8 +239,8 @@ pub mod private { vec::Vec, }; pub use codec; - pub use scale_info; pub use pezsp_arithmetic; + pub use scale_info; // Simple Extension trait to easily convert `None` from index closures to `Err`. // @@ -634,8 +635,8 @@ pub trait SortedListProvider { /// /// If this is implemented by a bags-list instance, it will be the smallest and largest bags. /// - /// This is useful to help another pezpallet that consumes this trait generate an even distribution - /// of nodes for testing/genesis. + /// This is useful to help another pezpallet that consumes this trait generate an even + /// distribution of nodes for testing/genesis. fn range() -> (Self::Score, Self::Score) { (Self::Score::min_value(), Self::Score::max_value()) } @@ -924,7 +925,9 @@ pub struct BoundedSupport> { pub voters: BoundedVec<(AccountId, ExtendedBalance), Bound>, } -impl> pezsp_npos_elections::Backings for &BoundedSupport { +impl> pezsp_npos_elections::Backings + for &BoundedSupport +{ fn total(&self) -> ExtendedBalance { self.total } @@ -963,7 +966,9 @@ impl> BoundedSupport { /// truncating if needed. /// /// Returns the number of backers removed. - pub fn sorted_truncate_from(mut support: pezsp_npos_elections::Support) -> (Self, u32) { + pub fn sorted_truncate_from( + mut support: pezsp_npos_elections::Support, + ) -> (Self, u32) { // If bounds meet, then short circuit. if let Ok(bounded) = support.clone().try_into() { return (bounded, 0); diff --git a/bizinikiwi/pezframe/election-provider-support/src/onchain.rs b/bizinikiwi/pezframe/election-provider-support/src/onchain.rs index 9bea7307..3f0347a2 100644 --- a/bizinikiwi/pezframe/election-provider-support/src/onchain.rs +++ b/bizinikiwi/pezframe/election-provider-support/src/onchain.rs @@ -223,7 +223,8 @@ mod tests { type Nonce = u64; type BlockNumber = u64; - pub type Header = pezsp_runtime::generic::Header; + pub type Header = + pezsp_runtime::generic::Header; pub type UncheckedExtrinsic = pezsp_runtime::generic::UncheckedExtrinsic; pub type Block = pezsp_runtime::generic::Block; diff --git a/bizinikiwi/pezframe/election-provider-support/src/tests.rs b/bizinikiwi/pezframe/election-provider-support/src/tests.rs index a94cb1e3..fc7fbacd 100644 --- a/bizinikiwi/pezframe/election-provider-support/src/tests.rs +++ b/bizinikiwi/pezframe/election-provider-support/src/tests.rs @@ -22,14 +22,14 @@ use crate::{ mock::*, BoundedSupport, BoundedSupports, IndexAssignment, NposSolution, TryFromOtherBounds, }; use pezframe_support::traits::ConstU32; -use rand::SeedableRng; use pezsp_npos_elections::{Support, Supports}; +use rand::SeedableRng; mod solution_type { use super::*; use codec::{Decode, Encode, MaxEncodedLen}; - // these need to come from the same dev-dependency `pezframe-election-provider-support`, not from - // the crate. + // these need to come from the same dev-dependency `pezframe-election-provider-support`, not + // from the crate. use crate::{generate_solution_type, Assignment, Error as NposError, NposSolution}; use core::fmt::Debug; diff --git a/bizinikiwi/pezframe/election-provider-support/src/traits.rs b/bizinikiwi/pezframe/election-provider-support/src/traits.rs index 2cfece42..c42775e8 100644 --- a/bizinikiwi/pezframe/election-provider-support/src/traits.rs +++ b/bizinikiwi/pezframe/election-provider-support/src/traits.rs @@ -21,9 +21,9 @@ use crate::{Assignment, IdentifierT, IndexAssignmentOf, PerThing128, VoteWeight} use alloc::vec::Vec; use codec::Encode; use core::fmt::Debug; -use scale_info::TypeInfo; use pezsp_arithmetic::traits::{Bounded, UniqueSaturatedInto}; use pezsp_npos_elections::{ElectionScore, Error, EvaluateSupport}; +use scale_info::TypeInfo; /// An opaque index-based, NPoS solution type. pub trait NposSolution diff --git a/bizinikiwi/pezframe/elections-phragmen/src/lib.rs b/bizinikiwi/pezframe/elections-phragmen/src/lib.rs index d4fc4034..78f568ec 100644 --- a/bizinikiwi/pezframe/elections-phragmen/src/lib.rs +++ b/bizinikiwi/pezframe/elections-phragmen/src/lib.rs @@ -103,6 +103,7 @@ extern crate alloc; use alloc::{vec, vec::Vec}; use codec::{Decode, DecodeWithMemTracking, Encode}; use core::cmp::Ordering; +use log; use pezframe_support::{ traits::{ defensive_prelude::*, ChangeMembers, Contains, ContainsLengthBound, Currency, Get, @@ -111,14 +112,13 @@ use pezframe_support::{ }, weights::Weight, }; -use log; -use scale_info::TypeInfo; use pezsp_npos_elections::{ElectionResult, ExtendedBalance}; use pezsp_runtime::{ traits::{Saturating, StaticLookup, Zero}, DispatchError, Perbill, RuntimeDebug, }; use pezsp_staking::currency_to_vote::CurrencyToVote; +use scale_info::TypeInfo; #[cfg(any(feature = "try-runtime", test))] use pezsp_runtime::TryRuntimeError; @@ -202,7 +202,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Identifier for the elections-phragmen pezpallet's lock #[pezpallet::constant] @@ -636,7 +637,10 @@ pub mod pezpallet { /// runner-up. /// /// Note that old members and runners-up are also candidates. - CandidateSlashed { candidate: ::AccountId, amount: BalanceOf }, + CandidateSlashed { + candidate: ::AccountId, + amount: BalanceOf, + }, /// A seat holder was slashed by amount by being forcefully removed from the set. SeatHolderSlashed { seat_holder: ::AccountId, @@ -1304,6 +1308,7 @@ impl Pezpallet { mod tests { use super::*; use crate as elections_phragmen; + use bizinikiwi_test_utils::assert_eq_uvec; use pezframe_support::{ assert_noop, assert_ok, derive_impl, dispatch::DispatchResultWithPostInfo, @@ -1312,7 +1317,6 @@ mod tests { }; use pezframe_system::ensure_signed; use pezsp_runtime::{testing::Header, BuildStorage}; - use bizinikiwi_test_utils::assert_eq_uvec; #[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)] impl pezframe_system::Config for Test { diff --git a/bizinikiwi/pezframe/elections-phragmen/src/migrations/unlock_and_unreserve_all_funds.rs b/bizinikiwi/pezframe/elections-phragmen/src/migrations/unlock_and_unreserve_all_funds.rs index de97b6f8..844824ce 100644 --- a/bizinikiwi/pezframe/elections-phragmen/src/migrations/unlock_and_unreserve_all_funds.rs +++ b/bizinikiwi/pezframe/elections-phragmen/src/migrations/unlock_and_unreserve_all_funds.rs @@ -206,7 +206,8 @@ where .collect(); // Total deposited for each account *should* be less than or equal to the total reserved, - // however this does not hold for all cases due to bugs in the reserve logic of this pezpallet. + // however this does not hold for all cases due to bugs in the reserve logic of this + // pezpallet. let bugged_deposits = all_accounts .iter() .filter(|account| { diff --git a/bizinikiwi/pezframe/elections-phragmen/src/migrations/v4.rs b/bizinikiwi/pezframe/elections-phragmen/src/migrations/v4.rs index 0d6a4a1f..075cd391 100644 --- a/bizinikiwi/pezframe/elections-phragmen/src/migrations/v4.rs +++ b/bizinikiwi/pezframe/elections-phragmen/src/migrations/v4.rs @@ -90,7 +90,9 @@ pub fn pre_migration>(new: N) { ), "unexpected next_key({}) = {:?}", new, - pezsp_core::hexdisplay::HexDisplay::from(&pezsp_io::storage::next_key(new.as_bytes()).unwrap()) + pezsp_core::hexdisplay::HexDisplay::from( + &pezsp_io::storage::next_key(new.as_bytes()).unwrap() + ) ); // ensure storage version is 3. assert_eq!(StorageVersion::get::>(), 3); diff --git a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/extensions.rs b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/extensions.rs index f5244706..b0c0ccb5 100644 --- a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/extensions.rs +++ b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/extensions.rs @@ -25,7 +25,6 @@ use core::{fmt, marker::PhantomData}; use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::{pezpallet_prelude::TransactionSource, traits::OriginTrait, Parameter}; -use scale_info::TypeInfo; use pezsp_runtime::{ impl_tx_ext_default, traits::{ @@ -34,6 +33,7 @@ use pezsp_runtime::{ }, transaction_validity::{InvalidTransaction, ValidTransaction}, }; +use scale_info::TypeInfo; use crate::pezpallet_coownership::{Config, Origin}; diff --git a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/lib.rs b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/lib.rs index ad3eb234..bb27f4f2 100644 --- a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/lib.rs +++ b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/lib.rs @@ -30,20 +30,22 @@ //! //! The [TransactionExtension](pezsp_runtime::traits::TransactionExtension) used in this example is //! [AuthorizeCoownership](extensions::AuthorizeCoownership). If activated, the extension will -//! authorize 2 signers as coowners, with a [coowner origin](pezpallet_coownership::Origin) specific to -//! the [coownership example pezpallet](pezpallet_coownership), by validating a signature of the rest of -//! the transaction from each party. This means any extensions after ours in the pipeline, their -//! implicits and the actual call. The extension pipeline used in our example checks the genesis -//! hash, transaction version and mortality of the transaction after the `AuthorizeCoownership` runs -//! as we want these transactions to run regardless of what origin passes through them and/or we -//! want their implicit data in any signature authorization happening earlier in the pipeline. +//! authorize 2 signers as coowners, with a [coowner origin](pezpallet_coownership::Origin) specific +//! to the [coownership example pezpallet](pezpallet_coownership), by validating a signature of the +//! rest of the transaction from each party. This means any extensions after ours in the pipeline, +//! their implicits and the actual call. The extension pipeline used in our example checks the +//! genesis hash, transaction version and mortality of the transaction after the +//! `AuthorizeCoownership` runs as we want these transactions to run regardless of what origin +//! passes through them and/or we want their implicit data in any signature authorization happening +//! earlier in the pipeline. //! //! In this example, aside from the [AuthorizeCoownership](extensions::AuthorizeCoownership) //! extension, we use the following pallets: //! - [pezpallet_coownership] - provides a coowner origin and the functionality to authorize it. //! - [pezpallet_assets] - a dummy asset pezpallet that tracks assets, identified by an //! [AssetId](pezpallet_assets::AssetId), and their respective owners, which can be either an -//! [account](pezpallet_assets::Owner::Single) or a [pair of owners](pezpallet_assets::Owner::Double). +//! [account](pezpallet_assets::Owner::Single) or a [pair of +//! owners](pezpallet_assets::Owner::Double). //! //! Assets are created in [pezpallet_assets] using the //! [create_asset](pezpallet_assets::Call::create_asset) call, which accepts traditionally signed @@ -56,9 +58,9 @@ //! ### Example usage #![doc = docify::embed!("src/tests.rs", create_coowned_asset_works)] //! -//! This example does not focus on any pezpallet logic or syntax, but rather on `TransactionExtension` -//! functionality. The pallets used are just skeletons to provide storage state and custom origin -//! choices and requirements, as shown in the examples. Any weight and/or +//! This example does not focus on any pezpallet logic or syntax, but rather on +//! `TransactionExtension` functionality. The pallets used are just skeletons to provide storage +//! state and custom origin choices and requirements, as shown in the examples. Any weight and/or //! transaction fee is out of scope for this example. #![cfg_attr(not(feature = "std"), no_std)] diff --git a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/mock.rs b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/mock.rs index f8fef716..6be6d0f7 100644 --- a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/mock.rs +++ b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/mock.rs @@ -44,8 +44,8 @@ mod example_runtime { VerifySignature, // Nonce check (and increment) for the caller. CheckNonce, - // If activated, will mutate the origin to a `pezpallet_coownership` origin of 2 accounts that - // own something. + // If activated, will mutate the origin to a `pezpallet_coownership` origin of 2 accounts + // that own something. AuthorizeCoownership, // Some other extensions that we want to run for every possible origin and we want captured // in any and all signature and authorization schemes (such as the traditional account diff --git a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/tests.rs b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/tests.rs index f49fabf1..254c5961 100644 --- a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/tests.rs +++ b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/tests.rs @@ -92,7 +92,10 @@ fn create_asset_works() { let res = xt.apply::(&uxt_info, uxt_len).unwrap(); // Asserting the results. - assert_eq!(pezframe_system::Account::::get(&alice_account).nonce, initial_nonce + 1); + assert_eq!( + pezframe_system::Account::::get(&alice_account).nonce, + initial_nonce + 1 + ); assert_eq!( pezpallet_assets::AssetOwners::::get(42), Some(pezpallet_assets::Owner::::Single(alice_account)) @@ -184,7 +187,10 @@ fn create_coowned_asset_works() { // Asserting the results. assert!(res.is_ok()); - assert_eq!(pezframe_system::Account::::get(charlie_account).nonce, initial_nonce + 1); + assert_eq!( + pezframe_system::Account::::get(charlie_account).nonce, + initial_nonce + 1 + ); assert_eq!( pezpallet_assets::AssetOwners::::get(42), Some(pezpallet_assets::Owner::::Double(alice_account, bob_account)) diff --git a/bizinikiwi/pezframe/examples/basic/src/lib.rs b/bizinikiwi/pezframe/examples/basic/src/lib.rs index a078cc24..895b3f95 100644 --- a/bizinikiwi/pezframe/examples/basic/src/lib.rs +++ b/bizinikiwi/pezframe/examples/basic/src/lib.rs @@ -65,6 +65,7 @@ extern crate alloc; use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode}; use core::marker::PhantomData; +use log::info; use pezframe_support::{ dispatch::{ClassifyDispatch, DispatchClass, DispatchResult, Pays, PaysFee, WeighData}, pezpallet_prelude::TransactionSource, @@ -72,8 +73,6 @@ use pezframe_support::{ weights::Weight, }; use pezframe_system::ensure_signed; -use log::info; -use scale_info::TypeInfo; use pezsp_runtime::{ impl_tx_ext_default, traits::{ @@ -82,6 +81,7 @@ use pezsp_runtime::{ }, transaction_validity::{InvalidTransaction, ValidTransaction}, }; +use scale_info::TypeInfo; // Re-export pezpallet items so that they can be accessed from the crate namespace. pub use pezpallet::*; @@ -103,8 +103,8 @@ const MILLICENTS: u32 = 1_000_000_000; // The `WeightData` trait has access to the arguments of the dispatch that it wants to assign a // weight to. Nonetheless, the trait itself cannot make any assumptions about what the generic type // of the arguments (`T`) is. Based on our needs, we could replace `T` with a more concrete type -// while implementing the trait. The `pezpallet::weight` expects whatever implements `WeighData` to -// replace `T` with a tuple of the dispatch arguments. This is exactly how we will craft the +// while implementing the trait. The `pezpallet::weight` expects whatever implements `WeighData` +// to replace `T` with a tuple of the dispatch arguments. This is exactly how we will craft the // implementation below. // // The rules of `WeightForSetDummy` are as follows: @@ -173,8 +173,8 @@ pub mod pezpallet { #[pezpallet::pezpallet] pub struct Pezpallet(_); - // This pezpallet implements the [`pezframe_support::traits::Hooks`] trait to define some logic to - // execute in some context. + // This pezpallet implements the [`pezframe_support::traits::Hooks`] trait to define some logic + // to execute in some context. #[pezpallet::hooks] impl Hooks> for Pezpallet { // `on_initialize` is executed at the beginning of the block before any extrinsic are @@ -275,9 +275,9 @@ pub mod pezpallet { // If you don't respect these rules, it is likely that your chain will be attackable. // // Each transaction must define a `#[pezpallet::weight(..)]` attribute to convey a set of - // static information about its dispatch. FRAME System and FRAME Executive pezpallet then use - // this information to properly execute the transaction, whilst keeping the total load of - // the chain in a moderate rate. + // static information about its dispatch. FRAME System and FRAME Executive pezpallet then + // use this information to properly execute the transaction, whilst keeping the total load + // of the chain in a moderate rate. // // The parenthesized value of the `#[pezpallet::weight(..)]` attribute can be any type that // implements a set of traits, namely [`WeighData`], [`ClassifyDispatch`], and @@ -447,11 +447,11 @@ impl Pezpallet { } } -// Similar to other FRAME pallets, your pezpallet can also define a transaction extension and perform -// some checks and [pre/post]processing [before/after] the transaction. A transaction extension can -// be any decodable type that implements `TransactionExtension`. See the trait definition for the -// full list of bounds. As a convention, you can follow this approach to create an extension for -// your pezpallet: +// Similar to other FRAME pallets, your pezpallet can also define a transaction extension and +// perform some checks and [pre/post]processing [before/after] the transaction. A transaction +// extension can be any decodable type that implements `TransactionExtension`. See the trait +// definition for the full list of bounds. As a convention, you can follow this approach to create +// an extension for your pezpallet: // - If the extension does not carry any data, then use a tuple struct with just a `marker` // (needed for the compiler to accept `T: Config`) will suffice. // - Otherwise, create a tuple struct which contains the external data. Of course, for the entire diff --git a/bizinikiwi/pezframe/examples/default-config/src/lib.rs b/bizinikiwi/pezframe/examples/default-config/src/lib.rs index 3004d47f..f19776c1 100644 --- a/bizinikiwi/pezframe/examples/default-config/src/lib.rs +++ b/bizinikiwi/pezframe/examples/default-config/src/lib.rs @@ -23,9 +23,9 @@ //! # Default Config Pezpallet Example //! -//! A simple example of a FRAME pezpallet that utilizes [`pezframe_support::derive_impl`] to demonstrate -//! the simpler way to implement `Config` trait of pallets. This example only showcases this in a -//! `mock.rs` environment, but the same applies to a real runtime as well. +//! A simple example of a FRAME pezpallet that utilizes [`pezframe_support::derive_impl`] to +//! demonstrate the simpler way to implement `Config` trait of pallets. This example only showcases +//! this in a `mock.rs` environment, but the same applies to a real runtime as well. //! //! See the source code of [`tests`] for a real examples. //! @@ -63,8 +63,8 @@ pub mod pezpallet { /// in our tests below. type OverwrittenDefaultValue: Get; - /// An input parameter that relies on `::AccountId`. This can - /// too have a default, as long as it is present in `pezframe_system::DefaultConfig`. + /// An input parameter that relies on `::AccountId`. This + /// can too have a default, as long as it is present in `pezframe_system::DefaultConfig`. type CanDeriveDefaultFromSystem: Get; /// We might choose to declare as one that doesn't have a default, for whatever semantical @@ -110,8 +110,8 @@ pub mod pezpallet { type OverwrittenDefaultType = u32; } - /// A type providing default configurations for this pezpallet in another environment. Examples - /// could be a teyrchain, or a solochain. + /// A type providing default configurations for this pezpallet in another environment. + /// Examples could be a teyrchain, or a solochain. /// /// Appropriate derive for `pezframe_system::DefaultConfig` needs to be provided. In this /// example, we simple derive `pezframe_system::config_preludes::TestDefaultConfig` again. diff --git a/bizinikiwi/pezframe/examples/kitchensink/src/benchmarking.rs b/bizinikiwi/pezframe/examples/kitchensink/src/benchmarking.rs index 9f8625a6..fd7af8b2 100644 --- a/bizinikiwi/pezframe/examples/kitchensink/src/benchmarking.rs +++ b/bizinikiwi/pezframe/examples/kitchensink/src/benchmarking.rs @@ -34,8 +34,8 @@ use pezframe_benchmarking::v2::*; use pezframe_support::pezpallet_prelude::TransactionSource; use pezframe_system::RawOrigin; -// To actually run this benchmark on pezpallet-example-kitchensink, we need to put this pezpallet into the -// runtime and compile it with `runtime-benchmarks` feature. The detail procedures are +// To actually run this benchmark on pezpallet-example-kitchensink, we need to put this pezpallet +// into the runtime and compile it with `runtime-benchmarks` feature. The detail procedures are // documented at: // https://docs.pezkuwichain.io/reference/how-to-guides/weights/add-benchmarks/ // @@ -98,8 +98,8 @@ mod benchmarks { } // This line generates test cases for benchmarking, and could be run by: - // `cargo test -p pezpallet-example-kitchensink --all-features`, you will see one line per case: - // `test benchmarking::bench_set_foo_benchmark ... ok` + // `cargo test -p pezpallet-example-kitchensink --all-features`, you will see one line per + // case: `test benchmarking::bench_set_foo_benchmark ... ok` // `test benchmarking::bench_set_foo_using_authorize_benchmark ... ok` in the result. // `test benchmarking::bench_authorize_set_foo_using_authorize_benchmark ... ok` in the // result. diff --git a/bizinikiwi/pezframe/examples/kitchensink/src/lib.rs b/bizinikiwi/pezframe/examples/kitchensink/src/lib.rs index 1bcd84ca..e9e07767 100644 --- a/bizinikiwi/pezframe/examples/kitchensink/src/lib.rs +++ b/bizinikiwi/pezframe/examples/kitchensink/src/lib.rs @@ -27,9 +27,9 @@ //! //! The kitchen-sink catalog of the the FRAME macros and their various syntax options. //! -//! This example does not focus on pezpallet instancing, `dev_mode`, and does nto include any 'where' -//! clauses on `T`. These will both incur additional complexity to the syntax, but are not discussed -//! here. +//! This example does not focus on pezpallet instancing, `dev_mode`, and does nto include any +//! 'where' clauses on `T`. These will both incur additional complexity to the syntax, but are not +//! discussed here. #![cfg_attr(not(feature = "std"), no_std)] @@ -56,18 +56,19 @@ pub mod pezpallet { use pezframe_support::pezpallet_prelude::*; use pezframe_system::pezpallet_prelude::*; - /// The config trait of the pezpallet. You can basically do anything with the config trait that you - /// can do with a normal rust trait: import items consisting of types, constants and functions. + /// The config trait of the pezpallet. You can basically do anything with the config trait that + /// you can do with a normal rust trait: import items consisting of types, constants and + /// functions. /// /// A very common pattern is for a pezpallet to import implementations of traits such as /// [`pezframe_support::traits::Currency`], [`pezframe_support::traits::fungibles::Inspect`] and - /// [`pezframe_support::traits::Get`]. These are all types that the pezpallet is delegating to the top - /// level runtime to provide to it. + /// [`pezframe_support::traits::Get`]. These are all types that the pezpallet is delegating to + /// the top level runtime to provide to it. /// /// The `FRAME`-specific syntax are: /// - /// * the use of `#[pezpallet::constant]`([`pezframe_support::procedural`]), which places a `Get` - /// implementation in the metadata. + /// * the use of `#[pezpallet::constant]`([`pezframe_support::procedural`]), which places a + /// `Get` implementation in the metadata. /// * `type RuntimeEvent`, which is mandatory if your pezpallet has events. See TODO. /// * Needless to say, because [`Config`] is bounded by [`pezframe_system::Config`], you can use /// all the items from [`pezframe_system::Config`] as well, such as `AccountId`. @@ -109,8 +110,8 @@ pub mod pezpallet { const STORAGE_VERSION: pezframe_support::traits::StorageVersion = StorageVersion::new(1); - /// The pezpallet struct. There's nothing special to FRAME about this; it can implement functions - /// in an impl blocks, traits and so on. + /// The pezpallet struct. There's nothing special to FRAME about this; it can implement + /// functions in an impl blocks, traits and so on. #[pezpallet::pezpallet] #[pezpallet::without_storage_info] #[pezpallet::storage_version(STORAGE_VERSION)] @@ -262,9 +263,9 @@ pub mod pezpallet { /// the variants actually use ``, the macro will generate a hidden `PhantomData` /// variant. /// - /// The `generate_deposit` macro generates a function on `Pezpallet` called `deposit_event` which - /// will properly convert the error type of your pezpallet into `RuntimeEvent` (recall `type - /// RuntimeEvent: From>`, so it can be converted) and deposit it via + /// The `generate_deposit` macro generates a function on `Pezpallet` called `deposit_event` + /// which will properly convert the error type of your pezpallet into `RuntimeEvent` (recall + /// `type RuntimeEvent: From>`, so it can be converted) and deposit it via /// `pezframe_system::Pezpallet::deposit_event`. #[pezpallet::event] #[pezpallet::generate_deposit(pub fn deposit_event)] @@ -285,8 +286,8 @@ pub mod pezpallet { SomethingBroke, } - /// All the possible hooks that a pezpallet can have. See [`pezframe_support::traits::Hooks`] for more - /// info. + /// All the possible hooks that a pezpallet can have. See [`pezframe_support::traits::Hooks`] + /// for more info. #[pezpallet::hooks] impl Hooks> for Pezpallet { fn integrity_test() {} @@ -327,15 +328,15 @@ pub mod pezpallet { } } - /// Allows you to define an enum on the pezpallet which will then instruct `construct_runtime` to - /// amalgamate all similarly-named enums from other pallets into an aggregate enum. + /// Allows you to define an enum on the pezpallet which will then instruct `construct_runtime` + /// to amalgamate all similarly-named enums from other pallets into an aggregate enum. #[pezpallet::composite_enum] pub enum HoldReason { Staking, } - /// Allows the pezpallet to provide some inherent. See [`pezframe_support::inherent::ProvideInherent`] - /// for more info. + /// Allows the pezpallet to provide some inherent. See + /// [`pezframe_support::inherent::ProvideInherent`] for more info. #[pezpallet::inherent] impl ProvideInherent for Pezpallet { type Call = Call; diff --git a/bizinikiwi/pezframe/examples/multi-block-migrations/src/lib.rs b/bizinikiwi/pezframe/examples/multi-block-migrations/src/lib.rs index 8107973d..067f22ba 100644 --- a/bizinikiwi/pezframe/examples/multi-block-migrations/src/lib.rs +++ b/bizinikiwi/pezframe/examples/multi-block-migrations/src/lib.rs @@ -20,8 +20,8 @@ //! # Multi-Block Migrations Example Pezpallet //! //! This pezpallet serves as a minimal example of a pezpallet that uses the [Multi-Block Migrations -//! Framework](pezframe_support::migrations). You can observe how to configure it in a runtime in the -//! `pez-kitchensink-runtime` crate. +//! Framework](pezframe_support::migrations). You can observe how to configure it in a runtime in +//! the `pez-kitchensink-runtime` crate. //! //! ## Introduction and Purpose //! diff --git a/bizinikiwi/pezframe/examples/offchain-worker/src/lib.rs b/bizinikiwi/pezframe/examples/offchain-worker/src/lib.rs index 8ace848b..960aa678 100644 --- a/bizinikiwi/pezframe/examples/offchain-worker/src/lib.rs +++ b/bizinikiwi/pezframe/examples/offchain-worker/src/lib.rs @@ -55,6 +55,7 @@ extern crate alloc; use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode}; +use lite_json::json::JsonValue; use pezframe_support::traits::Get; use pezframe_system::{ self as system, @@ -64,7 +65,6 @@ use pezframe_system::{ }, pezpallet_prelude::BlockNumberFor, }; -use lite_json::json::JsonValue; use pezsp_core::crypto::KeyTypeId; use pezsp_runtime::{ offchain::{ @@ -111,7 +111,8 @@ pub mod crypto { } // implemented for mock runtime in test - impl pezframe_system::offchain::AppCrypto<::Signer, Sr25519Signature> + impl + pezframe_system::offchain::AppCrypto<::Signer, Sr25519Signature> for TestAuthId { type RuntimeAppPublic = Public; diff --git a/bizinikiwi/pezframe/examples/single-block-migrations/src/lib.rs b/bizinikiwi/pezframe/examples/single-block-migrations/src/lib.rs index 6030b9d6..60f8c9b7 100644 --- a/bizinikiwi/pezframe/examples/single-block-migrations/src/lib.rs +++ b/bizinikiwi/pezframe/examples/single-block-migrations/src/lib.rs @@ -39,8 +39,8 @@ //! //! ## Pezpallet Overview //! -//! This example pezpallet contains a single storage item [`Value`](pezpallet::Value), which may be set by -//! any signed origin by calling the [`set_value`](crate::Call::set_value) extrinsic. +//! This example pezpallet contains a single storage item [`Value`](pezpallet::Value), which may be +//! set by any signed origin by calling the [`set_value`](crate::Call::set_value) extrinsic. //! //! For the purposes of this exercise, we imagine that in [`StorageVersion`] V0 of this pezpallet //! [`Value`](pezpallet::Value) is a `u32`, and this what is currently stored on-chain. @@ -51,7 +51,8 @@ //! pub type Value = StorageValue<_, u32>; //! ``` //! -//! In [`StorageVersion`] V1 of the pezpallet a new struct [`CurrentAndPreviousValue`] is introduced: +//! In [`StorageVersion`] V1 of the pezpallet a new struct [`CurrentAndPreviousValue`] is +//! introduced: #![doc = docify::embed!("src/lib.rs", CurrentAndPreviousValue)] //! and [`Value`](pezpallet::Value) is updated to store this new struct instead of a `u32`: #![doc = docify::embed!("src/lib.rs", Value)] @@ -118,9 +119,9 @@ //! //! Note that the storage migration logic is attached to a standalone struct implementing //! [`UncheckedOnRuntimeUpgrade`], rather than implementing the -//! [`Hooks::on_runtime_upgrade`](pezframe_support::traits::Hooks::on_runtime_upgrade) hook directly on -//! the pezpallet. The pezpallet hook is better suited for special types of logic that need to execute on -//! every runtime upgrade, but not so much for one-off storage migrations. +//! [`Hooks::on_runtime_upgrade`](pezframe_support::traits::Hooks::on_runtime_upgrade) hook directly +//! on the pezpallet. The pezpallet hook is better suited for special types of logic that need to +//! execute on every runtime upgrade, but not so much for one-off storage migrations. //! //! ### `MigrateV0ToV1` //! diff --git a/bizinikiwi/pezframe/examples/split/src/mock.rs b/bizinikiwi/pezframe/examples/split/src/mock.rs index f9ddc5c2..6054b353 100644 --- a/bizinikiwi/pezframe/examples/split/src/mock.rs +++ b/bizinikiwi/pezframe/examples/split/src/mock.rs @@ -48,5 +48,8 @@ impl pezpallet_template::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> pezsp_io::TestExternalities { - pezframe_system::GenesisConfig::::default().build_storage().unwrap().into() + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } diff --git a/bizinikiwi/pezframe/examples/src/lib.rs b/bizinikiwi/pezframe/examples/src/lib.rs index f4499f63..0d60ec27 100644 --- a/bizinikiwi/pezframe/examples/src/lib.rs +++ b/bizinikiwi/pezframe/examples/src/lib.rs @@ -22,37 +22,40 @@ //! //! ## Pallets //! -//! - [`pezpallet_example_basic`]: This pezpallet demonstrates concepts, APIs and structures common to -//! most FRAME runtimes. +//! - [`pezpallet_example_basic`]: This pezpallet demonstrates concepts, APIs and structures common +//! to most FRAME runtimes. //! -//! - [`pezpallet_example_offchain_worker`]: This pezpallet demonstrates concepts, APIs and structures -//! common to most offchain workers. +//! - [`pezpallet_example_offchain_worker`]: This pezpallet demonstrates concepts, APIs and +//! structures common to most offchain workers. //! -//! - [`pezpallet_default_config_example`]: This pezpallet demonstrates different ways to implement the -//! `Config` trait of pallets. +//! - [`pezpallet_default_config_example`]: This pezpallet demonstrates different ways to implement +//! the `Config` trait of pallets. //! -//! - [`pezpallet_dev_mode`]: This pezpallet demonstrates the ease of requirements for a pezpallet in "dev -//! mode". +//! - [`pezpallet_dev_mode`]: This pezpallet demonstrates the ease of requirements for a pezpallet +//! in "dev mode". //! -//! - [`pezpallet_example_kitchensink`]: This pezpallet demonstrates a catalog of all FRAME macros in use -//! and their various syntax options. +//! - [`pezpallet_example_kitchensink`]: This pezpallet demonstrates a catalog of all FRAME macros +//! in use and their various syntax options. //! -//! - [`pezpallet_example_split`]: A simple example of a FRAME pezpallet demonstrating the ability to -//! split sections across multiple files. +//! - [`pezpallet_example_split`]: A simple example of a FRAME pezpallet demonstrating the ability +//! to split sections across multiple files. //! -//! - [`pezpallet_example_frame_crate`]: Example pezpallet showcasing how one can be built using only the +//! - [`pezpallet_example_frame_crate`]: Example pezpallet showcasing how one can be built using +//! only the //! `frame` umbrella crate. //! -//! - [`pezpallet_example_single_block_migrations`]: An example pezpallet demonstrating best-practices for -//! writing storage migrations. +//! - [`pezpallet_example_single_block_migrations`]: An example pezpallet demonstrating +//! best-practices for writing storage migrations. //! -//! - [`pezpallet_example_tasks`]: This pezpallet demonstrates the use of `Tasks` to execute service work. +//! - [`pezpallet_example_tasks`]: This pezpallet demonstrates the use of `Tasks` to execute service +//! work. //! -//! - [`pezpallet_example_view_functions`]: This pezpallet demonstrates the use of view functions to query -//! pezpallet state. +//! - [`pezpallet_example_view_functions`]: This pezpallet demonstrates the use of view functions to +//! query pezpallet state. //! //! - [`pezpallet_example_authorization_tx_extension`]: An example `TransactionExtension` that //! authorizes a custom origin through signature validation, along with two support pallets to //! showcase the usage. //! -//! **Tip**: Use `cargo doc --package --open` to view each pezpallet's documentation. +//! **Tip**: Use `cargo doc --package --open` to view each pezpallet's +//! documentation. diff --git a/bizinikiwi/pezframe/examples/tasks/src/tests.rs b/bizinikiwi/pezframe/examples/tasks/src/tests.rs index 721574a6..4b830c8e 100644 --- a/bizinikiwi/pezframe/examples/tasks/src/tests.rs +++ b/bizinikiwi/pezframe/examples/tasks/src/tests.rs @@ -55,7 +55,9 @@ fn runtime_task_enumerate_works_via_pezframe_system_config() { Numbers::::insert(0, 1); Numbers::::insert(1, 4); assert_eq!( - ::RuntimeTask::iter().collect::>().len(), + ::RuntimeTask::iter() + .collect::>() + .len(), 2 ); }); @@ -77,7 +79,10 @@ fn runtime_task_enumerate_works_via_pallet_config() { #[test] fn task_index_works_at_pallet_level() { new_test_ext().execute_with(|| { - assert_eq!(crate::pezpallet::Task::::AddNumberIntoTotal { i: 2u32 }.task_index(), 0); + assert_eq!( + crate::pezpallet::Task::::AddNumberIntoTotal { i: 2u32 }.task_index(), + 0 + ); }); } @@ -85,11 +90,9 @@ fn task_index_works_at_pallet_level() { fn task_index_works_at_runtime_level() { new_test_ext().execute_with(|| { assert_eq!( - ::RuntimeTask::TasksExample(crate::pezpallet::Task::< - Runtime, - >::AddNumberIntoTotal { - i: 1u32 - }) + ::RuntimeTask::TasksExample( + crate::pezpallet::Task::::AddNumberIntoTotal { i: 1u32 } + ) .task_index(), 0 ); @@ -104,12 +107,9 @@ fn task_execution_works() { Numbers::::insert(0, 1); Numbers::::insert(1, 4); - let task = - ::RuntimeTask::TasksExample(crate::pezpallet::Task::< - Runtime, - >::AddNumberIntoTotal { - i: 1u32, - }); + let task = ::RuntimeTask::TasksExample( + crate::pezpallet::Task::::AddNumberIntoTotal { i: 1u32 }, + ); assert_ok!(System::do_task(RuntimeOrigin::signed(1), task.clone(),)); assert_eq!(Numbers::::get(0), Some(1)); assert_eq!(Numbers::::get(1), None); diff --git a/bizinikiwi/pezframe/examples/view-functions/src/tests.rs b/bizinikiwi/pezframe/examples/view-functions/src/tests.rs index db2d1e90..70487f88 100644 --- a/bizinikiwi/pezframe/examples/view-functions/src/tests.rs +++ b/bizinikiwi/pezframe/examples/view-functions/src/tests.rs @@ -19,13 +19,15 @@ #![cfg(test)] use crate::{ - pezpallet::{self, Pezpallet}, pallet2, + pezpallet::{self, Pezpallet}, }; use codec::{Decode, Encode}; use scale_info::meta_type; -use pezframe_support::{derive_impl, pezpallet_prelude::PalletInfoAccess, view_functions::ViewFunction}; +use pezframe_support::{ + derive_impl, pezpallet_prelude::PalletInfoAccess, view_functions::ViewFunction, +}; use pezsp_io::hashing::twox_128; use pezsp_metadata_ir::{ ItemDeprecationInfoIR, PalletViewFunctionMetadataIR, PalletViewFunctionParamMetadataIR, diff --git a/bizinikiwi/pezframe/executive/src/lib.rs b/bizinikiwi/pezframe/executive/src/lib.rs index eba5c419..4ece6101 100644 --- a/bizinikiwi/pezframe/executive/src/lib.rs +++ b/bizinikiwi/pezframe/executive/src/lib.rs @@ -24,9 +24,10 @@ //! //! ## Overview //! -//! The executive module is not a typical pezpallet providing functionality around a specific feature. -//! It is a cross-cutting framework component for the FRAME. It works in conjunction with the -//! [FRAME System module](../pezframe_system/index.html) to perform these cross-cutting functions. +//! The executive module is not a typical pezpallet providing functionality around a specific +//! feature. It is a cross-cutting framework component for the FRAME. It works in conjunction with +//! the [FRAME System module](../pezframe_system/index.html) to perform these cross-cutting +//! functions. //! //! The Executive module provides functions to: //! @@ -143,12 +144,12 @@ use pezsp_runtime::{ #[cfg(feature = "try-runtime")] use ::{ + log, pezframe_support::{ traits::{TryDecodeEntireStorage, TryDecodeEntireStorageError, TryState}, StorageNoopGuard, }, pezframe_try_runtime::{TryStateSelect, UpgradeCheckSelect}, - log, pezsp_runtime::TryRuntimeError, }; @@ -221,8 +222,8 @@ impl core::fmt::Debug for ExecutiveError { /// - `Block`: The block type of the runtime /// - `Context`: The context that is used when checking an extrinsic. /// - `UnsignedValidator`: The unsigned transaction validator of the runtime. -/// - `AllPalletsWithSystem`: Tuple that contains all pallets including frame system pezpallet. Will be -/// used to call hooks e.g. `on_initialize`. +/// - `AllPalletsWithSystem`: Tuple that contains all pallets including frame system pezpallet. Will +/// be used to call hooks e.g. `on_initialize`. /// - [**DEPRECATED** `OnRuntimeUpgrade`]: This parameter is deprecated and will be removed after /// September 2026. Use type `SingleBlockMigrations` in pezframe_system::Config instead. #[allow(deprecated)] @@ -617,7 +618,9 @@ where } } - fn extract_pre_digest(header: &pezframe_system::pezpallet_prelude::HeaderFor) -> Digest { + fn extract_pre_digest( + header: &pezframe_system::pezpallet_prelude::HeaderFor, + ) -> Digest { let mut digest = ::default(); header.digest().logs().iter().for_each(|d| { if d.as_pre_runtime().is_some() { @@ -685,8 +688,9 @@ where let n = *header.number(); assert!( n > BlockNumberFor::::zero() && - >::block_hash(n - BlockNumberFor::::one()) == - *header.parent_hash(), + >::block_hash( + n - BlockNumberFor::::one() + ) == *header.parent_hash(), "Parent hash should be valid.", ); } @@ -802,15 +806,16 @@ where >::finalize() } - /// Run the `on_idle` hook of all pezpallet, but only if there is weight remaining and there are no - /// ongoing MBMs. + /// Run the `on_idle` hook of all pezpallet, but only if there is weight remaining and there are + /// no ongoing MBMs. fn on_idle_hook(block_number: NumberFor) { if ::MultiBlockMigrator::ongoing() { return; } let weight = >::block_weight(); - let max_weight = >::get().max_block; + let max_weight = + >::get().max_block; let remaining_weight = max_weight.saturating_sub(weight.total()); if remaining_weight.all_gt(Weight::zero()) { @@ -832,7 +837,8 @@ where ); let weight = >::block_weight(); - let max_weight = >::get().max_block; + let max_weight = + >::get().max_block; let remaining = max_weight.saturating_sub(weight.total()); if remaining.all_gt(Weight::zero()) { diff --git a/bizinikiwi/pezframe/executive/src/tests.rs b/bizinikiwi/pezframe/executive/src/tests.rs index f1ba3dff..13fd97e6 100644 --- a/bizinikiwi/pezframe/executive/src/tests.rs +++ b/bizinikiwi/pezframe/executive/src/tests.rs @@ -22,12 +22,14 @@ use super::*; use pezframe_support::{ assert_err, assert_ok, derive_impl, migrations::MultiStepMigrator, - pezpallet_prelude::*, parameter_types, + pezpallet_prelude::*, traits::{fungible, ConstU8, Currency, IsInherent, VariantCount, VariantCountOf}, weights::{ConstantMultiplier, IdentityFee, RuntimeDbWeight, Weight, WeightMeter, WeightToFee}, }; -use pezframe_system::{pezpallet_prelude::*, ChainContext, LastRuntimeUpgrade, LastRuntimeUpgradeInfo}; +use pezframe_system::{ + pezpallet_prelude::*, ChainContext, LastRuntimeUpgrade, LastRuntimeUpgradeInfo, +}; use pezpallet_balances::Call as BalancesCall; use pezpallet_transaction_payment::FungibleAdapter; use pezsp_core::H256; @@ -757,7 +759,10 @@ fn block_weight_limit_enforced() { t.execute_with(|| { Executive::initialize_block(&Header::new_from_number(1)); // Base block execution weight + `on_initialize` weight from the custom module. - assert_eq!(>::block_weight().total(), base_block_weight); + assert_eq!( + >::block_weight().total(), + base_block_weight + ); for nonce in 0..=num_to_exhaust_block { let xt = UncheckedXt::new_signed( @@ -828,7 +833,10 @@ fn block_weight_and_size_is_stored_per_tx() { Executive::initialize_block(&Header::new_from_number(1)); - assert_eq!(>::block_weight().total(), base_block_weight); + assert_eq!( + >::block_weight().total(), + base_block_weight + ); assert_eq!(>::all_extrinsics_len(), 0); assert!(Executive::apply_extrinsic(xt.clone()).unwrap().is_ok()); @@ -856,7 +864,10 @@ fn block_weight_and_size_is_stored_per_tx() { Executive::initialize_block(&Header::new_from_number(2)); // Block weight cleaned up on `System::initialize` - assert_eq!(>::block_weight().total(), base_block_weight); + assert_eq!( + >::block_weight().total(), + base_block_weight + ); }); } @@ -1099,7 +1110,8 @@ fn all_weights_are_recorded_correctly() { let runtime_upgrade_weight = Executive::execute_on_runtime_upgrade(); let on_initialize_weight = >::on_initialize(block_number); - let base_block_weight = ::BlockWeights::get().base_block; + let base_block_weight = + ::BlockWeights::get().base_block; // Weights are recorded correctly assert_eq!( diff --git a/bizinikiwi/pezframe/fast-unstake/src/benchmarking.rs b/bizinikiwi/pezframe/fast-unstake/src/benchmarking.rs index 5e105088..3e0f5301 100644 --- a/bizinikiwi/pezframe/fast-unstake/src/benchmarking.rs +++ b/bizinikiwi/pezframe/fast-unstake/src/benchmarking.rs @@ -79,7 +79,8 @@ fn setup_staking(v: u32, until: EraIndex) { for era in 0..=until { let others = (0..T::Staking::max_exposure_page_size()) .map(|s| { - let who = pezframe_benchmarking::account::("nominator", era, s.into()); + let who = + pezframe_benchmarking::account::("nominator", era, s.into()); let value = ed; (who, value) }) @@ -103,7 +104,9 @@ mod benchmarks { fn on_idle_unstake(b: Linear<1, { T::BatchSize::get() }>) { ErasToCheckPerBlock::::put(1); for who in create_unexposed_batch::(b).into_iter() { - assert_ok!(Pezpallet::::register_fast_unstake(RawOrigin::Signed(who.clone()).into(),)); + assert_ok!(Pezpallet::::register_fast_unstake( + RawOrigin::Signed(who.clone()).into(), + )); } // Run on_idle once. This will check era 0. @@ -142,9 +145,9 @@ mod benchmarks { let stashes = create_unexposed_batch::(b) .into_iter() .map(|s| { - assert_ok!( - Pezpallet::::register_fast_unstake(RawOrigin::Signed(s.clone()).into(),) - ); + assert_ok!(Pezpallet::::register_fast_unstake( + RawOrigin::Signed(s.clone()).into(), + )); (s, T::Deposit::get()) }) .collect::>(); diff --git a/bizinikiwi/pezframe/fast-unstake/src/lib.rs b/bizinikiwi/pezframe/fast-unstake/src/lib.rs index 9e87c9d9..a7eb3916 100644 --- a/bizinikiwi/pezframe/fast-unstake/src/lib.rs +++ b/bizinikiwi/pezframe/fast-unstake/src/lib.rs @@ -25,9 +25,9 @@ //! //! # Fast Unstake Pezpallet //! -//! A pezpallet to allow participants of the staking system (represented by [`Config::Staking`], being -//! [`StakingInterface`]) to unstake quicker, if and only if they meet the condition of not being -//! exposed to any slashes. +//! A pezpallet to allow participants of the staking system (represented by [`Config::Staking`], +//! being [`StakingInterface`]) to unstake quicker, if and only if they meet the condition of not +//! being exposed to any slashes. //! //! ## Overview //! @@ -46,8 +46,8 @@ //! in the queue to be checked. //! //! A successful registration implies being fully unbonded and chilled in the staking system. These -//! effects persist even if the fast-unstake registration is retracted (see [`Pezpallet::deregister`] -//! and further). +//! effects persist even if the fast-unstake registration is retracted (see +//! [`Pezpallet::deregister`] and further). //! //! Once registered as a fast-unstaker, the staker will be queued and checked by the system. This //! can take a variable number of blocks based on demand, but will almost certainly be "faster" (as @@ -83,8 +83,8 @@ //! //! ## Low Level / Implementation Details //! -//! This pezpallet works off the basis of `on_idle`, meaning that it provides no guarantee about when -//! it will succeed, if at all. Moreover, the queue implementation is unordered. In case of +//! This pezpallet works off the basis of `on_idle`, meaning that it provides no guarantee about +//! when it will succeed, if at all. Moreover, the queue implementation is unordered. In case of //! congestion, no FIFO ordering is provided. //! //! A few important considerations can be concluded based on the `on_idle`-based implementation: @@ -187,7 +187,8 @@ pub mod pezpallet { #[pezpallet::constant] type Deposit: Get>; - /// The origin that can control this pezpallet, in other words invoke [`Pezpallet::control`]. + /// The origin that can control this pezpallet, in other words invoke + /// [`Pezpallet::control`]. type ControlOrigin: pezframe_support::traits::EnsureOrigin; /// Batch size. @@ -364,8 +365,8 @@ pub mod pezpallet { /// This is useful if one is registered, they are still waiting, and they change their mind. /// /// Note that the associated stash is still fully unbonded and chilled as a consequence of - /// calling [`Pezpallet::register_fast_unstake`]. Therefore, this should probably be followed - /// by a call to `rebond` in the staking system. + /// calling [`Pezpallet::register_fast_unstake`]. Therefore, this should probably be + /// followed by a call to `rebond` in the staking system. /// /// ## Events /// @@ -617,7 +618,8 @@ pub mod pezpallet { }); }, Err(_) => { - // don't put the head back in -- there is an internal error in the pezpallet. + // don't put the head back in -- there is an internal error in the + // pezpallet. Self::halt("checked is pruned via retain above") }, } diff --git a/bizinikiwi/pezframe/fast-unstake/src/mock.rs b/bizinikiwi/pezframe/fast-unstake/src/mock.rs index 85467351..fabb33e8 100644 --- a/bizinikiwi/pezframe/fast-unstake/src/mock.rs +++ b/bizinikiwi/pezframe/fast-unstake/src/mock.rs @@ -18,9 +18,8 @@ use crate::{self as fast_unstake}; use pezframe_election_provider_support::PageIndex; use pezframe_support::{ - assert_ok, derive_impl, + assert_ok, derive_impl, parameter_types, pezpallet_prelude::*, - parameter_types, traits::{ConstU64, Currency}, weights::constants::WEIGHT_REF_TIME_PER_SECOND, }; diff --git a/bizinikiwi/pezframe/fast-unstake/src/types.rs b/bizinikiwi/pezframe/fast-unstake/src/types.rs index c5eb61f5..ee89531e 100644 --- a/bizinikiwi/pezframe/fast-unstake/src/types.rs +++ b/bizinikiwi/pezframe/fast-unstake/src/types.rs @@ -22,8 +22,8 @@ use codec::{Decode, Encode, MaxEncodedLen}; use pezframe_support::{ traits::Currency, BoundedVec, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, }; -use scale_info::TypeInfo; use pezsp_staking::{EraIndex, StakingInterface}; +use scale_info::TypeInfo; /// Maximum number of eras that we might check for a single staker. /// diff --git a/bizinikiwi/pezframe/grandpa/src/equivocation.rs b/bizinikiwi/pezframe/grandpa/src/equivocation.rs index 3f4d4b11..37011399 100644 --- a/bizinikiwi/pezframe/grandpa/src/equivocation.rs +++ b/bizinikiwi/pezframe/grandpa/src/equivocation.rs @@ -37,9 +37,9 @@ use alloc::{boxed::Box, vec, vec::Vec}; use codec::{self as codec, Decode, Encode}; +use log::{error, info}; use pezframe_support::traits::{Get, KeyOwnerProofSystem}; use pezframe_system::pezpallet_prelude::BlockNumberFor; -use log::{error, info}; use pezsp_consensus_grandpa::{AuthorityId, EquivocationProof, RoundNumber, SetId, KEY_TYPE}; use pezsp_runtime::{ transaction_validity::{ diff --git a/bizinikiwi/pezframe/grandpa/src/lib.rs b/bizinikiwi/pezframe/grandpa/src/lib.rs index 9623d7a3..14c3efe5 100644 --- a/bizinikiwi/pezframe/grandpa/src/lib.rs +++ b/bizinikiwi/pezframe/grandpa/src/lib.rs @@ -45,7 +45,6 @@ use pezframe_support::{ WeakBoundedVec, }; use pezframe_system::pezpallet_prelude::BlockNumberFor; -use scale_info::TypeInfo; use pezsp_consensus_grandpa::{ ConsensusLog, EquivocationProof, ScheduledChange, SetId, GRANDPA_ENGINE_ID, RUNTIME_LOG_TARGET as LOG_TARGET, @@ -53,6 +52,7 @@ use pezsp_consensus_grandpa::{ use pezsp_runtime::{generic::DigestItem, traits::Zero, DispatchResult}; use pezsp_session::{GetSessionNumber, GetValidatorCount}; use pezsp_staking::{offence::OffenceReportSystem, SessionIndex}; +use scale_info::TypeInfo; mod default_weights; mod equivocation; diff --git a/bizinikiwi/pezframe/honzon/oracle/src/lib.rs b/bizinikiwi/pezframe/honzon/oracle/src/lib.rs index 4fc64754..d35dc3e5 100644 --- a/bizinikiwi/pezframe/honzon/oracle/src/lib.rs +++ b/bizinikiwi/pezframe/honzon/oracle/src/lib.rs @@ -86,12 +86,12 @@ use pezframe_support::{ PalletId, Parameter, }; use pezframe_system::pezpallet_prelude::*; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{AccountIdConversion, Member}, DispatchResult, RuntimeDebug, }; use pezsp_std::{prelude::*, vec}; +use scale_info::TypeInfo; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; diff --git a/bizinikiwi/pezframe/honzon/oracle/src/tests.rs b/bizinikiwi/pezframe/honzon/oracle/src/tests.rs index 15003002..45180cef 100644 --- a/bizinikiwi/pezframe/honzon/oracle/src/tests.rs +++ b/bizinikiwi/pezframe/honzon/oracle/src/tests.rs @@ -16,8 +16,8 @@ // limitations under the License. use super::*; -use pezframe_support::{assert_noop, assert_ok}; use mock::*; +use pezframe_support::{assert_noop, assert_ok}; #[test] fn should_feed_values_from_member() { diff --git a/bizinikiwi/pezframe/identity/src/benchmarking.rs b/bizinikiwi/pezframe/identity/src/benchmarking.rs index cc1ec872..04c305ac 100644 --- a/bizinikiwi/pezframe/identity/src/benchmarking.rs +++ b/bizinikiwi/pezframe/identity/src/benchmarking.rs @@ -44,11 +44,15 @@ fn assert_last_event(generic_event: ::RuntimeEvent) { fn run_to_block(n: pezframe_system::pezpallet_prelude::BlockNumberFor) { while pezframe_system::Pezpallet::::block_number() < n { crate::Pezpallet::::on_finalize(pezframe_system::Pezpallet::::block_number()); - pezframe_system::Pezpallet::::on_finalize(pezframe_system::Pezpallet::::block_number()); + pezframe_system::Pezpallet::::on_finalize( + pezframe_system::Pezpallet::::block_number(), + ); pezframe_system::Pezpallet::::set_block_number( pezframe_system::Pezpallet::::block_number() + One::one(), ); - pezframe_system::Pezpallet::::on_initialize(pezframe_system::Pezpallet::::block_number()); + pezframe_system::Pezpallet::::on_initialize( + pezframe_system::Pezpallet::::block_number(), + ); crate::Pezpallet::::on_initialize(pezframe_system::Pezpallet::::block_number()); } } diff --git a/bizinikiwi/pezframe/identity/src/legacy.rs b/bizinikiwi/pezframe/identity/src/legacy.rs index 87573695..406c1979 100644 --- a/bizinikiwi/pezframe/identity/src/legacy.rs +++ b/bizinikiwi/pezframe/identity/src/legacy.rs @@ -21,9 +21,11 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; #[cfg(feature = "runtime-benchmarks")] use enumflags2::BitFlag; use enumflags2::{bitflags, BitFlags}; -use pezframe_support::{traits::Get, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound}; -use scale_info::{build::Variants, Path, Type, TypeInfo}; +use pezframe_support::{ + traits::Get, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, +}; use pezsp_runtime::{BoundedVec, RuntimeDebug}; +use scale_info::{build::Variants, Path, Type, TypeInfo}; use crate::types::{Data, IdentityInformationProvider}; diff --git a/bizinikiwi/pezframe/identity/src/lib.rs b/bizinikiwi/pezframe/identity/src/lib.rs index 721e2dfa..41ac866c 100644 --- a/bizinikiwi/pezframe/identity/src/lib.rs +++ b/bizinikiwi/pezframe/identity/src/lib.rs @@ -48,8 +48,8 @@ //! - a username without setting an identity //! - an identity and a username //! -//! The username functionality implemented in this pezpallet is meant to be a user friendly lookup of -//! accounts. There are mappings in both directions, "account -> username" and "username -> +//! The username functionality implemented in this pezpallet is meant to be a user friendly lookup +//! of accounts. There are mappings in both directions, "account -> username" and "username -> //! account". //! //! Usernames are granted by authorities and grouped by suffix, with each suffix being administered @@ -156,7 +156,9 @@ pub mod pezpallet { } #[cfg(feature = "runtime-benchmarks")] impl BenchmarkHelper for () { - fn sign_message(message: &[u8]) -> (pezsp_runtime::MultiSigner, pezsp_runtime::MultiSignature) { + fn sign_message( + message: &[u8], + ) -> (pezsp_runtime::MultiSigner, pezsp_runtime::MultiSignature) { let public = pezsp_io::crypto::sr25519_generate(0.into(), None); let signature = pezsp_runtime::MultiSignature::Sr25519( pezsp_io::crypto::sr25519_sign( @@ -174,7 +176,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The currency trait. type Currency: ReservableCurrency; diff --git a/bizinikiwi/pezframe/identity/src/types.rs b/bizinikiwi/pezframe/identity/src/types.rs index b5e082fb..01586c09 100644 --- a/bizinikiwi/pezframe/identity/src/types.rs +++ b/bizinikiwi/pezframe/identity/src/types.rs @@ -23,14 +23,14 @@ use pezframe_support::{ traits::{ConstU32, Get}, BoundedVec, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, }; -use scale_info::{ - build::{Fields, Variants}, - Path, Type, TypeInfo, -}; use pezsp_runtime::{ traits::{Member, Zero}, RuntimeDebug, }; +use scale_info::{ + build::{Fields, Variants}, + Path, Type, TypeInfo, +}; /// An identifier for a single name registrar/identity verification service. pub type RegistrarIndex = u32; diff --git a/bizinikiwi/pezframe/im-online/src/lib.rs b/bizinikiwi/pezframe/im-online/src/lib.rs index 71268710..6aa8168e 100644 --- a/bizinikiwi/pezframe/im-online/src/lib.rs +++ b/bizinikiwi/pezframe/im-online/src/lib.rs @@ -99,7 +99,6 @@ use pezframe_system::{ pezpallet_prelude::*, }; pub use pezpallet::*; -use scale_info::TypeInfo; use pezsp_application_crypto::RuntimeAppPublic; use pezsp_runtime::{ offchain::storage::{MutateStorageError, StorageRetrievalError, StorageValueRef}, @@ -110,6 +109,7 @@ use pezsp_staking::{ offence::{Kind, Offence, ReportOffence}, SessionIndex, }; +use scale_info::TypeInfo; pub use weights::WeightInfo; pub mod sr25519 { @@ -278,7 +278,8 @@ pub mod pezpallet { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// A type for retrieving the validators supposed to be online in a session. type ValidatorSet: ValidatorSetWithIdentification; diff --git a/bizinikiwi/pezframe/im-online/src/mock.rs b/bizinikiwi/pezframe/im-online/src/mock.rs index b531e52d..835df18b 100644 --- a/bizinikiwi/pezframe/im-online/src/mock.rs +++ b/bizinikiwi/pezframe/im-online/src/mock.rs @@ -166,7 +166,9 @@ impl pezframe_support::traits::EstimateNextSessionRotation for TestNextSess // take the mock result if any and return it let mock = MockAverageSessionLength::mutate(|p| p.take()); - mock.unwrap_or(pezpallet_session::PeriodicSessions::::average_session_length()) + mock.unwrap_or( + pezpallet_session::PeriodicSessions::::average_session_length(), + ) } fn estimate_current_session_progress(now: u64) -> (Option, Weight) { diff --git a/bizinikiwi/pezframe/indices/src/lib.rs b/bizinikiwi/pezframe/indices/src/lib.rs index 7a537c59..75e84587 100644 --- a/bizinikiwi/pezframe/indices/src/lib.rs +++ b/bizinikiwi/pezframe/indices/src/lib.rs @@ -71,7 +71,8 @@ pub mod pezpallet { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; diff --git a/bizinikiwi/pezframe/insecure-randomness-collective-flip/src/lib.rs b/bizinikiwi/pezframe/insecure-randomness-collective-flip/src/lib.rs index 2543aac7..d50527ad 100644 --- a/bizinikiwi/pezframe/insecure-randomness-collective-flip/src/lib.rs +++ b/bizinikiwi/pezframe/insecure-randomness-collective-flip/src/lib.rs @@ -22,11 +22,11 @@ //! //! # Randomness Pezpallet //! -//! The Randomness Collective Flip pezpallet provides a [`random`](./struct.Module.html#method.random) -//! function that generates low-influence random values based on the block hashes from the previous -//! `81` blocks. Low-influence randomness can be useful when defending against relatively weak -//! adversaries. Using this pezpallet as a randomness source is advisable primarily in low-security -//! situations like testing. +//! The Randomness Collective Flip pezpallet provides a +//! [`random`](./struct.Module.html#method.random) function that generates low-influence random +//! values based on the block hashes from the previous `81` blocks. Low-influence randomness can be +//! useful when defending against relatively weak adversaries. Using this pezpallet as a randomness +//! source is advisable primarily in low-security situations like testing. //! //! ## Public Functions //! @@ -36,8 +36,8 @@ //! //! ### Prerequisites //! -//! Import the Randomness Collective Flip pezpallet and derive your pezpallet's configuration trait from -//! the system trait. +//! Import the Randomness Collective Flip pezpallet and derive your pezpallet's configuration trait +//! from the system trait. //! //! ### Example - Get random seed for the current block //! diff --git a/bizinikiwi/pezframe/lottery/src/lib.rs b/bizinikiwi/pezframe/lottery/src/lib.rs index c11b775d..298ef6fb 100644 --- a/bizinikiwi/pezframe/lottery/src/lib.rs +++ b/bizinikiwi/pezframe/lottery/src/lib.rs @@ -148,7 +148,8 @@ pub mod pezpallet { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The manager origin. type ManagerOrigin: EnsureOrigin; diff --git a/bizinikiwi/pezframe/membership/src/migrations/v4.rs b/bizinikiwi/pezframe/membership/src/migrations/v4.rs index 16c86d53..15b3e4b9 100644 --- a/bizinikiwi/pezframe/membership/src/migrations/v4.rs +++ b/bizinikiwi/pezframe/membership/src/migrations/v4.rs @@ -35,7 +35,11 @@ use pezframe_support::{ /// The migration will look into the storage version in order not to trigger a migration on an up /// to date storage. Thus the on chain storage version must be less than 4 in order to trigger the /// migration. -pub fn migrate>( +pub fn migrate< + T: pezframe_system::Config, + P: GetStorageVersion + PalletInfoAccess, + N: AsRef, +>( old_pallet_name: N, new_pallet_name: N, ) -> Weight { diff --git a/bizinikiwi/pezframe/membership/src/mock.rs b/bizinikiwi/pezframe/membership/src/mock.rs index a71439ce..11fc2763 100644 --- a/bizinikiwi/pezframe/membership/src/mock.rs +++ b/bizinikiwi/pezframe/membership/src/mock.rs @@ -107,7 +107,10 @@ pub(crate) fn new_test_ext() -> pezsp_io::TestExternalities { #[cfg(feature = "runtime-benchmarks")] pub(crate) fn new_bench_ext() -> pezsp_io::TestExternalities { - pezframe_system::GenesisConfig::::default().build_storage().unwrap().into() + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } #[cfg(feature = "runtime-benchmarks")] diff --git a/bizinikiwi/pezframe/merkle-mountain-range/src/lib.rs b/bizinikiwi/pezframe/merkle-mountain-range/src/lib.rs index 7ce3370f..da873d00 100644 --- a/bizinikiwi/pezframe/merkle-mountain-range/src/lib.rs +++ b/bizinikiwi/pezframe/merkle-mountain-range/src/lib.rs @@ -40,8 +40,8 @@ //! //! ## What for? //! -//! Primary use case for this pezpallet is to generate MMR root hashes, that can latter on be used by -//! BEEFY protocol (see ). +//! Primary use case for this pezpallet is to generate MMR root hashes, that can latter on be used +//! by BEEFY protocol (see ). //! MMR root hashes along with BEEFY will make it possible to build Super Light Clients (SLC) of //! Bizinikiwi-based chains. The SLC will be able to follow finality and can be shown proofs of more //! details that happened on the source chain. @@ -378,8 +378,8 @@ impl, I: 'static> Pezpallet { best_known_block_number: Option>, ) -> Result<(Vec>, LeafProof>), Error> { // check whether best_known_block_number provided, else use current best block - let best_known_block_number = - best_known_block_number.unwrap_or_else(|| >::block_number()); + let best_known_block_number = best_known_block_number + .unwrap_or_else(|| >::block_number()); let leaf_count = Self::block_num_to_leaf_count(best_known_block_number)?; @@ -428,8 +428,8 @@ impl, I: 'static> Pezpallet { best_known_block_number: Option>, ) -> Result>, Error> { // check whether best_known_block_number provided, else use current best block - let best_known_block_number = - best_known_block_number.unwrap_or_else(|| >::block_number()); + let best_known_block_number = best_known_block_number + .unwrap_or_else(|| >::block_number()); let leaf_count = Self::block_num_to_leaf_count(best_known_block_number)?; let prev_leaf_count = Self::block_num_to_leaf_count(prev_block_number)?; @@ -440,7 +440,8 @@ impl, I: 'static> Pezpallet { #[cfg(feature = "runtime-benchmarks")] pub fn generate_mock_ancestry_proof() -> Result>, Error> { - let leaf_count = Self::block_num_to_leaf_count(>::block_number())?; + let leaf_count = + Self::block_num_to_leaf_count(>::block_number())?; let mmr: ModuleMmr = mmr::Mmr::new(leaf_count); mmr.generate_mock_ancestry_proof() } diff --git a/bizinikiwi/pezframe/merkle-mountain-range/src/tests.rs b/bizinikiwi/pezframe/merkle-mountain-range/src/tests.rs index cdb7eef4..f9aad751 100644 --- a/bizinikiwi/pezframe/merkle-mountain-range/src/tests.rs +++ b/bizinikiwi/pezframe/merkle-mountain-range/src/tests.rs @@ -28,7 +28,10 @@ use frame::{ }; pub(crate) fn new_test_ext() -> TestState { - pezframe_system::GenesisConfig::::default().build_storage().unwrap().into() + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } fn register_offchain_ext(ext: &mut TestState) { @@ -260,7 +263,9 @@ fn should_generate_proofs_correctly() { // when generate proofs for all leaves. let proofs = (1_u64..=best_block_number) .into_iter() - .map(|block_num| crate::Pezpallet::::generate_proof(vec![block_num], None).unwrap()) + .map(|block_num| { + crate::Pezpallet::::generate_proof(vec![block_num], None).unwrap() + }) .collect::>(); // when generate historical proofs for all leaves let historical_proofs = (1_u64..best_block_number) @@ -545,7 +550,10 @@ fn generate_and_verify_batch_proof( // then assert_eq!(crate::Pezpallet::::verify_leaves(leaves, proof), Ok(())); historical_proofs.iter().for_each(|(leaves, proof)| { - assert_eq!(crate::Pezpallet::::verify_leaves(leaves.clone(), proof.clone()), Ok(())); + assert_eq!( + crate::Pezpallet::::verify_leaves(leaves.clone(), proof.clone()), + Ok(()) + ); }); }) } @@ -741,8 +749,8 @@ fn should_verify_canonicalized() { } // Generate proofs for some blocks. - let (leaves, proofs) = - ext.execute_with(|| crate::Pezpallet::::generate_proof(vec![1, 4, 5, 7], None).unwrap()); + let (leaves, proofs) = ext + .execute_with(|| crate::Pezpallet::::generate_proof(vec![1, 4, 5, 7], None).unwrap()); // Verify all previously generated proofs. ext.execute_with(|| { assert_eq!(crate::Pezpallet::::verify_leaves(leaves, proofs), Ok(())); @@ -773,7 +781,10 @@ fn does_not_panic_when_generating_historical_proofs() { register_offchain_ext(&mut ext); ext.execute_with(|| { // when leaf index is invalid - assert_eq!(crate::Pezpallet::::generate_proof(vec![10], None), Err(Error::LeafNotFound),); + assert_eq!( + crate::Pezpallet::::generate_proof(vec![10], None), + Err(Error::LeafNotFound), + ); // when leaves count is invalid assert_eq!( @@ -819,6 +830,9 @@ fn generating_and_verifying_ancestry_proofs_works_correctly() { } // Check that we can't generate ancestry proofs for a future block. - assert_eq!(Pezpallet::::generate_ancestry_proof(501, None), Err(Error::GenerateProof)); + assert_eq!( + Pezpallet::::generate_ancestry_proof(501, None), + Err(Error::GenerateProof) + ); }); } diff --git a/bizinikiwi/pezframe/message-queue/src/lib.rs b/bizinikiwi/pezframe/message-queue/src/lib.rs index 72ea6153..05129cdf 100644 --- a/bizinikiwi/pezframe/message-queue/src/lib.rs +++ b/bizinikiwi/pezframe/message-queue/src/lib.rs @@ -41,8 +41,8 @@ //! queues which hold at least one unprocessed message and are thereby *ready* to be serviced. The //! `ServiceHead` indicates which *ready* queue is the next to be serviced. //! The pezpallet implements [`pezframe_support::traits::EnqueueMessage`], -//! [`pezframe_support::traits::ServiceQueues`] and has [`pezframe_support::traits::ProcessMessage`] and -//! [`OnQueueChanged`] hooks to communicate with the outside world. +//! [`pezframe_support::traits::ServiceQueues`] and has [`pezframe_support::traits::ProcessMessage`] +//! and [`OnQueueChanged`] hooks to communicate with the outside world. //! //! NOTE: The storage items are not linked since they are not public. //! @@ -52,31 +52,32 @@ //! logic of how to handle the message since they are blobs. Storage changes are not rolled back on //! error. //! -//! A failed message can be temporarily or permanently overweight. The pezpallet will perpetually try -//! to execute a temporarily overweight message. A permanently overweight message is skipped and +//! A failed message can be temporarily or permanently overweight. The pezpallet will perpetually +//! try to execute a temporarily overweight message. A permanently overweight message is skipped and //! must be executed manually. //! //! **Reentrancy** //! //! This pezpallet has two entry points for executing (possibly recursive) logic; -//! [`Pezpallet::service_queues`] and [`Pezpallet::execute_overweight`]. Both entry points are guarded by -//! the same mutex to error on reentrancy. The only functions that are explicitly **allowed** to be -//! called by a message processor are: [`Pezpallet::enqueue_message`] and +//! [`Pezpallet::service_queues`] and [`Pezpallet::execute_overweight`]. Both entry points are +//! guarded by the same mutex to error on reentrancy. The only functions that are explicitly +//! **allowed** to be called by a message processor are: [`Pezpallet::enqueue_message`] and //! [`Pezpallet::enqueue_messages`]. All other functions are forbidden and error with //! [`Error::RecursiveDisallowed`]. //! //! **Pagination** //! //! Queues are stored in a *paged* manner by splitting their messages into [`Page`]s. This results -//! in a lot of complexity when implementing the pezpallet but is completely necessary to achieve the -//! second #[Design Goal](design-goals). The problem comes from the fact a message can *possibly* be -//! quite large, lets say 64KiB. This then results in a *MEL* of at least 64KiB which results in a -//! PoV of at least 64KiB. Now we have the assumption that most messages are much shorter than their -//! maximum allowed length. This would result in most messages having a pre-dispatch PoV size which -//! is much larger than their post-dispatch PoV size, possibly by a factor of thousand. Disregarding -//! this observation would cripple the processing power of the pezpallet since it cannot straighten out -//! this discrepancy at runtime. Conceptually, the implementation is packing as many messages into a -//! single bounded vec, as actually fit into the bounds. This reduces the wasted PoV. +//! in a lot of complexity when implementing the pezpallet but is completely necessary to achieve +//! the second #[Design Goal](design-goals). The problem comes from the fact a message can +//! *possibly* be quite large, lets say 64KiB. This then results in a *MEL* of at least 64KiB which +//! results in a PoV of at least 64KiB. Now we have the assumption that most messages are much +//! shorter than their maximum allowed length. This would result in most messages having a +//! pre-dispatch PoV size which is much larger than their post-dispatch PoV size, possibly by a +//! factor of thousand. Disregarding this observation would cripple the processing power of the +//! pezpallet since it cannot straighten out this discrepancy at runtime. Conceptually, the +//! implementation is packing as many messages into a single bounded vec, as actually fit into the +//! bounds. This reduces the wasted PoV. //! //! **Page Data Layout** //! @@ -88,13 +89,13 @@ //! //! **Weight Metering** //! -//! The pezpallet utilizes the [`pezsp_weights::WeightMeter`] to manually track its consumption to always -//! stay within the required limit. This implies that the message processor hook can calculate the -//! weight of a message without executing it. This restricts the possible use-cases but is necessary -//! since the pezpallet runs in `on_initialize` which has a hard weight limit. The weight meter is used -//! in a way that `can_accrue` and `check_accrue` are always used to check the remaining weight of -//! an operation before committing to it. The process of exiting due to insufficient weight is -//! termed "bailing". +//! The pezpallet utilizes the [`pezsp_weights::WeightMeter`] to manually track its consumption to +//! always stay within the required limit. This implies that the message processor hook can +//! calculate the weight of a message without executing it. This restricts the possible use-cases +//! but is necessary since the pezpallet runs in `on_initialize` which has a hard weight limit. The +//! weight meter is used in a way that `can_accrue` and `check_accrue` are always used to check the +//! remaining weight of an operation before committing to it. The process of exiting due to +//! insufficient weight is termed "bailing". //! //! # Scenario: Message enqueuing //! @@ -117,12 +118,12 @@ //! next *ready* queue. It then starts to service this queue by servicing as many pages of it as //! possible. Servicing a page means to execute as many message of it as possible. Each executed //! message is marked as *processed* if the [`Config::MessageProcessor`] return Ok. An event -//! [`Event::Processed`] is emitted afterwards. It is possible that the weight limit of the pezpallet -//! will never allow a specific message to be executed. In this case it remains as unprocessed and -//! is skipped. This process stops if either there are no more messages in the queue or the -//! remaining weight became insufficient to service this queue. If there is enough weight it tries -//! to advance to the next *ready* queue and service it. This continues until there are no more -//! queues on which it can make progress or not enough weight to check that. +//! [`Event::Processed`] is emitted afterwards. It is possible that the weight limit of the +//! pezpallet will never allow a specific message to be executed. In this case it remains as +//! unprocessed and is skipped. This process stops if either there are no more messages in the queue +//! or the remaining weight became insufficient to service this queue. If there is enough weight it +//! tries to advance to the next *ready* queue and service it. This continues until there are no +//! more queues on which it can make progress or not enough weight to check that. //! //! # Scenario: Overweight execution //! @@ -131,11 +132,11 @@ //! [`pezframe_support::traits::ServiceQueues::service_queues`]. //! //! Manual intervention in the form of -//! [`pezframe_support::traits::ServiceQueues::execute_overweight`] is necessary. Overweight messages -//! emit an [`Event::OverweightEnqueued`] event which can be used to extract the arguments for -//! manual execution. This only works on permanently overweight messages. There is no guarantee that -//! this will work since the message could be part of a stale page and be reaped before execution -//! commences. +//! [`pezframe_support::traits::ServiceQueues::execute_overweight`] is necessary. Overweight +//! messages emit an [`Event::OverweightEnqueued`] event which can be used to extract the arguments +//! for manual execution. This only works on permanently overweight messages. There is no guarantee +//! that this will work since the message could be part of a stale page and be reaped before +//! execution commences. //! //! # Terminology //! @@ -153,8 +154,8 @@ //! queues via their `ready_neighbours` fields. A `Queue` is *ready* if it contains at least one //! `Message` which can be processed. Can be empty. //! - `ServiceHead`: A pointer into the `ReadyRing` to the next `Queue` to be serviced. -//! - (`un`)`processed`: A message is marked as *processed* after it was executed by the pezpallet. A -//! message which was either: not yet executed or could not be executed remains as `unprocessed` +//! - (`un`)`processed`: A message is marked as *processed* after it was executed by the pezpallet. +//! A message which was either: not yet executed or could not be executed remains as `unprocessed` //! which is the default state for a message after being enqueued. //! - `knitting`/`unknitting`: The means of adding or removing a `Queue` from the `ReadyRing`. //! - `MEL`: The Max Encoded Length of a type, see [`codec::MaxEncodedLen`]. @@ -220,7 +221,6 @@ use pezframe_support::{ }; use pezframe_system::pezpallet_prelude::*; pub use pezpallet::*; -use scale_info::TypeInfo; use pezsp_arithmetic::traits::{BaseArithmetic, Unsigned}; use pezsp_core::{defer, H256}; use pezsp_runtime::{ @@ -228,6 +228,7 @@ use pezsp_runtime::{ SaturatedConversion, Saturating, TransactionOutcome, }; use pezsp_weights::WeightMeter; +use scale_info::TypeInfo; pub use weights::WeightInfo; /// Type for identifying a page. @@ -506,7 +507,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; @@ -814,8 +816,8 @@ enum MessageExecutionStatus { StackLimitReached, } -/// The context to pass to [`Pezpallet::service_queues_impl`] through on_idle and on_initialize hooks -/// We don't want to throw the defensive message if called from on_idle hook +/// The context to pass to [`Pezpallet::service_queues_impl`] through on_idle and on_initialize +/// hooks We don't want to throw the defensive message if called from on_idle hook #[derive(PartialEq)] enum ServiceQueuesContext { /// Context of on_idle hook. @@ -1773,8 +1775,8 @@ impl ServiceQueues for Pezpallet { return Err(ExecuteOverweightError::InsufficientWeight); } - Pezpallet::::do_execute_overweight(message_origin, page, index, weight.remaining()).map_err( - |e| match e { + Pezpallet::::do_execute_overweight(message_origin, page, index, weight.remaining()) + .map_err(|e| match e { Error::::InsufficientWeight => ExecuteOverweightError::InsufficientWeight, Error::::AlreadyProcessed => ExecuteOverweightError::AlreadyProcessed, Error::::QueuePaused => ExecuteOverweightError::QueuePaused, @@ -1782,8 +1784,7 @@ impl ServiceQueues for Pezpallet { ExecuteOverweightError::NotFound, Error::::RecursiveDisallowed => ExecuteOverweightError::RecursiveDisallowed, _ => ExecuteOverweightError::Other, - }, - ) + }) } } diff --git a/bizinikiwi/pezframe/message-queue/src/tests.rs b/bizinikiwi/pezframe/message-queue/src/tests.rs index adf86777..0508a250 100644 --- a/bizinikiwi/pezframe/message-queue/src/tests.rs +++ b/bizinikiwi/pezframe/message-queue/src/tests.rs @@ -24,8 +24,8 @@ use crate::{mock::*, *}; use pezframe_support::{ assert_noop, assert_ok, assert_storage_noop, traits::BatchFootprint, StorageNoopGuard, }; -use rand::{rngs::StdRng, Rng, SeedableRng}; use pezsp_crypto_hashing::blake2_256; +use rand::{rngs::StdRng, Rng, SeedableRng}; #[test] fn mocked_weight_works() { @@ -1250,8 +1250,10 @@ fn permanently_overweight_limit_is_valid_basic() { MessageQueue::enqueue_message(msg(&m), Here); MessageQueue::service_queues(w.into()); - let last_event = - pezframe_system::Pezpallet::::events().into_iter().last().expect("No event"); + let last_event = pezframe_system::Pezpallet::::events() + .into_iter() + .last() + .expect("No event"); // The weight overhead for a single message is set to 50. The message itself needs 200. // Every weight in range `[50, 249]` should result in a permanently overweight message: @@ -1310,8 +1312,10 @@ fn permanently_overweight_limit_is_valid_fuzzy() { MessageQueue::enqueue_message(msg(&m), Here); MessageQueue::service_queues(w.into()); - let last_event = - pezframe_system::Pezpallet::::events().into_iter().last().expect("No event"); + let last_event = pezframe_system::Pezpallet::::events() + .into_iter() + .last() + .expect("No event"); if w < o + 200 { assert_eq!( diff --git a/bizinikiwi/pezframe/meta-tx/src/lib.rs b/bizinikiwi/pezframe/meta-tx/src/lib.rs index 8522d3ff..f0fe448c 100644 --- a/bizinikiwi/pezframe/meta-tx/src/lib.rs +++ b/bizinikiwi/pezframe/meta-tx/src/lib.rs @@ -17,8 +17,8 @@ //! # Meta Tx (Meta Transaction) Pezpallet //! -//! This pezpallet enables the dispatch of transactions that are authorized by one party (the signer) -//! and executed by an untrusted third party (the relayer), who covers the transaction fees. +//! This pezpallet enables the dispatch of transactions that are authorized by one party (the +//! signer) and executed by an untrusted third party (the relayer), who covers the transaction fees. //! //! ## Pezpallet API //! @@ -47,8 +47,8 @@ //! and the signature of the payload, encompassing the call and the meta-transaction’s //! configurations, such as its mortality. The extensions follow the same [`TransactionExtension`] //! contract, and common types such as [`pezframe_system::CheckGenesis`], -//! [`pezframe_system::CheckMortality`], [`pezframe_system::CheckNonce`], etc., are applicable in the -//! context of meta transactions. Check the `mock` setup for the example. +//! [`pezframe_system::CheckMortality`], [`pezframe_system::CheckNonce`], etc., are applicable in +//! the context of meta transactions. Check the `mock` setup for the example. #![cfg_attr(not(feature = "std"), no_std)] @@ -100,7 +100,8 @@ impl MetaTx { } /// The [`MetaTx`] for the given config. -pub type MetaTxFor = MetaTx<::RuntimeCall, ::Extension>; +pub type MetaTxFor = + MetaTx<::RuntimeCall, ::Extension>; #[pezframe_support::pezpallet] pub mod pezpallet { @@ -121,7 +122,8 @@ pub mod pezpallet { type WeightInfo: WeightInfo; /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Transaction extension/s for meta transactions. /// /// The extensions that must be present in every meta transaction. This generally includes diff --git a/bizinikiwi/pezframe/meta-tx/src/mock.rs b/bizinikiwi/pezframe/meta-tx/src/mock.rs index 939f4738..2cba374a 100644 --- a/bizinikiwi/pezframe/meta-tx/src/mock.rs +++ b/bizinikiwi/pezframe/meta-tx/src/mock.rs @@ -105,7 +105,8 @@ impl pezframe_system::Config for Runtime { type AccountId = AccountId; type Lookup = IdentityLookup; type Block = pezframe_system::mocking::MockBlock; - type AccountData = pezpallet_balances::AccountData<::Balance>; + type AccountData = + pezpallet_balances::AccountData<::Balance>; } #[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)] diff --git a/bizinikiwi/pezframe/meta-tx/src/tests.rs b/bizinikiwi/pezframe/meta-tx/src/tests.rs index 23c4c2b7..17838f7f 100644 --- a/bizinikiwi/pezframe/meta-tx/src/tests.rs +++ b/bizinikiwi/pezframe/meta-tx/src/tests.rs @@ -16,8 +16,8 @@ // limitations under the License. use crate::*; -use pezframe_support::traits::tokens::fungible::Inspect; use mock::*; +use pezframe_support::traits::tokens::fungible::Inspect; use pezsp_io::hashing::blake2_256; use pezsp_keyring::Sr25519Keyring; use pezsp_runtime::{ @@ -387,7 +387,9 @@ fn meta_tx_call_fails() { actual_weight: Some(meta_tx_weight), pays_fee: Pays::Yes, }, - error: pezsp_runtime::DispatchError::Token(pezsp_runtime::TokenError::FundsUnavailable), + error: pezsp_runtime::DispatchError::Token( + pezsp_runtime::TokenError::FundsUnavailable, + ), }), })); diff --git a/bizinikiwi/pezframe/metadata-hash-extension/src/lib.rs b/bizinikiwi/pezframe/metadata-hash-extension/src/lib.rs index 3911fbf1..3b45a55d 100644 --- a/bizinikiwi/pezframe/metadata-hash-extension/src/lib.rs +++ b/bizinikiwi/pezframe/metadata-hash-extension/src/lib.rs @@ -41,12 +41,12 @@ extern crate self as pezframe_metadata_hash_extension; use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::{pezpallet_prelude::Weight, DebugNoBound}; use pezframe_system::Config; -use scale_info::TypeInfo; use pezsp_runtime::{ impl_tx_ext_default, traits::TransactionExtension, transaction_validity::{TransactionValidityError, UnknownTransaction}, }; +use scale_info::TypeInfo; #[cfg(test)] mod tests; diff --git a/bizinikiwi/pezframe/metadata-hash-extension/src/tests.rs b/bizinikiwi/pezframe/metadata-hash-extension/src/tests.rs index 2414c610..d7d6aad3 100644 --- a/bizinikiwi/pezframe/metadata-hash-extension/src/tests.rs +++ b/bizinikiwi/pezframe/metadata-hash-extension/src/tests.rs @@ -16,24 +16,24 @@ // limitations under the License. use crate::CheckMetadataHash; +use bizinikiwi_test_runtime_client::{ + prelude::*, + runtime::{self, ExtrinsicBuilder}, + DefaultTestClientBuilderExt, TestClientBuilder, +}; use codec::{Decode, Encode}; use frame_metadata::RuntimeMetadataPrefixed; +use merkleized_metadata::{generate_metadata_digest, ExtraInfo}; use pezframe_support::{ derive_impl, pezpallet_prelude::{InvalidTransaction, TransactionValidityError}, }; -use merkleized_metadata::{generate_metadata_digest, ExtraInfo}; use pezsp_api::{Metadata, ProvideRuntimeApi}; use pezsp_runtime::{ traits::{ExtrinsicLike, TransactionExtension}, transaction_validity::{TransactionSource, UnknownTransaction}, }; use pezsp_transaction_pool::runtime_api::TaggedTransactionQueue; -use bizinikiwi_test_runtime_client::{ - prelude::*, - runtime::{self, ExtrinsicBuilder}, - DefaultTestClientBuilderExt, TestClientBuilder, -}; type Block = pezframe_system::mocking::MockBlock; @@ -154,8 +154,12 @@ mod docs { type Signature = (); /// Unchecked extrinsic type as expected by this runtime. - pub type UncheckedExtrinsic = - pezsp_runtime::generic::UncheckedExtrinsic; + pub type UncheckedExtrinsic = pezsp_runtime::generic::UncheckedExtrinsic< + Address, + RuntimeCall, + Signature, + TxExtension, + >; } // Put here to not have it in the docs as well. diff --git a/bizinikiwi/pezframe/migrations/src/lib.rs b/bizinikiwi/pezframe/migrations/src/lib.rs index dacd8901..e143683f 100644 --- a/bizinikiwi/pezframe/migrations/src/lib.rs +++ b/bizinikiwi/pezframe/migrations/src/lib.rs @@ -30,10 +30,10 @@ //! //! ### Example //! -//! This example demonstrates a simple mocked walk through of a basic success scenario. The pezpallet -//! is configured with two migrations: one succeeding after just one step, and the second one -//! succeeding after two steps. A runtime upgrade is then enacted and the block number is advanced -//! until all migrations finish executing. Afterwards, the recorded historic migrations are +//! This example demonstrates a simple mocked walk through of a basic success scenario. The +//! pezpallet is configured with two migrations: one succeeding after just one step, and the second +//! one succeeding after two steps. A runtime upgrade is then enacted and the block number is +//! advanced until all migrations finish executing. Afterwards, the recorded historic migrations are //! checked and events are asserted. #![doc = docify::embed!("src/tests.rs", simple_works)] //! @@ -62,26 +62,26 @@ //! //! ### Design //! -//! Migrations are provided to the pezpallet through the associated type [`Config::Migrations`] of type -//! [`SteppedMigrations`]. This allows multiple migrations to be aggregated through a tuple. It +//! Migrations are provided to the pezpallet through the associated type [`Config::Migrations`] of +//! type [`SteppedMigrations`]. This allows multiple migrations to be aggregated through a tuple. It //! simplifies the trait bounds since all associated types of the trait must be provided by the -//! pezpallet. The actual progress of the pezpallet is stored in the [`Cursor`] storage item. This can -//! either be [`MigrationCursor::Active`] or [`MigrationCursor::Stuck`]. In the active case it +//! pezpallet. The actual progress of the pezpallet is stored in the [`Cursor`] storage item. This +//! can either be [`MigrationCursor::Active`] or [`MigrationCursor::Stuck`]. In the active case it //! points to the currently active migration and stores its inner cursor. The inner cursor can then //! be used by the migration to store its inner state and advance. Each time when the migration //! returns `Some(cursor)`, it signals the pezpallet that it is not done yet. //! //! The cursor is reset on each runtime upgrade. This ensures that it starts to execute at the //! first migration in the vector. The pallets cursor is only ever incremented or set to `Stuck` -//! once it encounters an error (Goal 4). Once in the stuck state, the pezpallet will stay stuck until -//! it is fixed through manual governance intervention. +//! once it encounters an error (Goal 4). Once in the stuck state, the pezpallet will stay stuck +//! until it is fixed through manual governance intervention. //! //! As soon as the cursor of the pezpallet becomes `Some(_)`; [`MultiStepMigrator::ongoing`] returns //! `true` (Goal 2). This can be used by upstream code to possibly pause transactions. -//! In `on_initialize` the pezpallet will load the current migration and check whether it was already -//! executed in the past by checking for membership of its ID in the [`Historic`] set. Historic -//! migrations are skipped without causing an error. Each successfully executed migration is added -//! to this set (Goal 5). +//! In `on_initialize` the pezpallet will load the current migration and check whether it was +//! already executed in the past by checking for membership of its ID in the [`Historic`] set. +//! Historic migrations are skipped without causing an error. Each successfully executed migration +//! is added to this set (Goal 5). //! //! This proceeds until no more migrations remain. At that point, the event `UpgradeCompleted` is //! emitted (Goal 1). @@ -90,14 +90,14 @@ //! This function wraps the inner `step` function into a transactional layer to allow rollback in //! the error case (Goal 6). //! -//! Weight limits must be checked by the migration itself. The pezpallet provides a [`WeightMeter`] for -//! that purpose. The pezpallet may return [`SteppedMigrationError::InsufficientWeight`] at any point. -//! In that scenario, one of two things will happen: if that migration was exclusively executed -//! in this block, and therefore required more than the maximum amount of weight possible, the -//! process becomes `Stuck`. Otherwise, one re-attempt is executed with the same logic in the next -//! block (Goal 3). Progress through the migrations is guaranteed by providing a timeout for each -//! migration via [`SteppedMigration::max_steps`]. The pezpallet **ONLY** guarantees progress if this -//! is set to sensible limits (Goal 7). +//! Weight limits must be checked by the migration itself. The pezpallet provides a [`WeightMeter`] +//! for that purpose. The pezpallet may return [`SteppedMigrationError::InsufficientWeight`] at any +//! point. In that scenario, one of two things will happen: if that migration was exclusively +//! executed in this block, and therefore required more than the maximum amount of weight possible, +//! the process becomes `Stuck`. Otherwise, one re-attempt is executed with the same logic in the +//! next block (Goal 3). Progress through the migrations is guaranteed by providing a timeout for +//! each migration via [`SteppedMigration::max_steps`]. The pezpallet **ONLY** guarantees progress +//! if this is set to sensible limits (Goal 7). //! //! ### Scenario: Governance cleanup //! @@ -333,7 +333,8 @@ pub mod pezpallet { /// The overarching event type of the runtime. #[pezpallet::no_default_bounds] #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// All the multi-block migrations to run. /// diff --git a/bizinikiwi/pezframe/migrations/src/mock.rs b/bizinikiwi/pezframe/migrations/src/mock.rs index a9236e40..49c53b5c 100644 --- a/bizinikiwi/pezframe/migrations/src/mock.rs +++ b/bizinikiwi/pezframe/migrations/src/mock.rs @@ -142,11 +142,15 @@ impl IntoRecord for Event { } pub trait IntoRecords { - fn into_records(self) -> Vec::RuntimeEvent, H256>>; + fn into_records( + self, + ) -> Vec::RuntimeEvent, H256>>; } impl IntoRecords for Vec { - fn into_records(self) -> Vec::RuntimeEvent, H256>> { + fn into_records( + self, + ) -> Vec::RuntimeEvent, H256>> { self.into_iter().map(|e| e.into_record()).collect() } } diff --git a/bizinikiwi/pezframe/mixnet/src/lib.rs b/bizinikiwi/pezframe/mixnet/src/lib.rs index e3dc7b1f..e5b5e610 100644 --- a/bizinikiwi/pezframe/mixnet/src/lib.rs +++ b/bizinikiwi/pezframe/mixnet/src/lib.rs @@ -34,12 +34,12 @@ use frame::{ }, prelude::*, }; -use serde::{Deserialize, Serialize}; use pezsp_application_crypto::RuntimeAppPublic; use pezsp_mixnet::types::{ AuthorityId, AuthoritySignature, KxPublic, Mixnode, MixnodesErr, PeerId, SessionIndex, SessionPhase, SessionStatus, KX_PUBLIC_SIZE, }; +use serde::{Deserialize, Serialize}; const LOG_TARGET: &str = "runtime::mixnet"; diff --git a/bizinikiwi/pezframe/multi-asset-bounties/src/benchmarking.rs b/bizinikiwi/pezframe/multi-asset-bounties/src/benchmarking.rs index 5f62aeab..07fd423f 100644 --- a/bizinikiwi/pezframe/multi-asset-bounties/src/benchmarking.rs +++ b/bizinikiwi/pezframe/multi-asset-bounties/src/benchmarking.rs @@ -265,9 +265,11 @@ pub fn set_status, I: 'static>( child_bounty_id: Option, new_payment_status: PaymentState>, ) -> Result<(), BenchmarkError> { - let bounty = - pezpallet_bounties::Pezpallet::::get_bounty_details(parent_bounty_id, child_bounty_id) - .expect("no bounty"); + let bounty = pezpallet_bounties::Pezpallet::::get_bounty_details( + parent_bounty_id, + child_bounty_id, + ) + .expect("no bounty"); let new_status = match bounty.3 { BountyStatus::FundingAttempted { curator, .. } => @@ -448,7 +450,10 @@ mod benchmarks { let s = create_funded_child_bounty::()?; let caller = s.child_curator.clone(); - >::Consideration::ensure_successful(&caller, s.child_value); + >::Consideration::ensure_successful( + &caller, + s.child_value, + ); #[block] { diff --git a/bizinikiwi/pezframe/multi-asset-bounties/src/lib.rs b/bizinikiwi/pezframe/multi-asset-bounties/src/lib.rs index 9bdcbb74..e11cbc58 100644 --- a/bizinikiwi/pezframe/multi-asset-bounties/src/lib.rs +++ b/bizinikiwi/pezframe/multi-asset-bounties/src/lib.rs @@ -96,11 +96,11 @@ use pezframe_support::{ use pezframe_system::pezpallet_prelude::{ ensure_signed, BlockNumberFor as SystemBlockNumberFor, OriginFor, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{AccountIdConversion, BadOrigin, Convert, Saturating, StaticLookup, TryConvert, Zero}, Permill, RuntimeDebug, }; +use scale_info::TypeInfo; pub type BalanceOf = <>::Paymaster as PayWithSource>::Balance; pub type BeneficiaryLookupOf = <>::BeneficiaryLookup as StaticLookup>::Source; @@ -515,8 +515,8 @@ pub mod pezpallet { /// The consideration cost incurred by the child-/bounty curator for committing to the role. /// - /// Determined by [`pezpallet::Config::Consideration`]. It is created when the curator accepts the - /// role, and is either burned if the curator misbehaves or consumed upon successful + /// Determined by [`pezpallet::Config::Consideration`]. It is created when the curator accepts + /// the role, and is either burned if the curator misbehaves or consumed upon successful /// completion of the child-/bounty. /// /// Note: If the parent curator is also assigned to the child-bounty, diff --git a/bizinikiwi/pezframe/multi-asset-bounties/src/mock.rs b/bizinikiwi/pezframe/multi-asset-bounties/src/mock.rs index 60316cb0..1ef51d79 100644 --- a/bizinikiwi/pezframe/multi-asset-bounties/src/mock.rs +++ b/bizinikiwi/pezframe/multi-asset-bounties/src/mock.rs @@ -325,9 +325,11 @@ pub fn get_payment_id( parent_bounty_id: BountyIndex, child_bounty_id: Option, ) -> Option { - let bounty = - pezpallet_bounties::Pezpallet::::get_bounty_details(parent_bounty_id, child_bounty_id) - .expect("no bounty"); + let bounty = pezpallet_bounties::Pezpallet::::get_bounty_details( + parent_bounty_id, + child_bounty_id, + ) + .expect("no bounty"); match bounty.3 { BountyStatus::FundingAttempted { diff --git a/bizinikiwi/pezframe/multi-asset-bounties/src/tests.rs b/bizinikiwi/pezframe/multi-asset-bounties/src/tests.rs index 1d6cacec..1dc80023 100644 --- a/bizinikiwi/pezframe/multi-asset-bounties/src/tests.rs +++ b/bizinikiwi/pezframe/multi-asset-bounties/src/tests.rs @@ -356,8 +356,11 @@ fn fund_child_bounty_works() { } ); assert_eq!( - pezpallet_bounties::CuratorDeposit::::get(s.parent_bounty_id, None::) - .unwrap(), + pezpallet_bounties::CuratorDeposit::::get( + s.parent_bounty_id, + None:: + ) + .unwrap(), consideration(s.value) ); assert_eq!( @@ -526,7 +529,10 @@ fn check_status_works() { } ); assert_eq!( - pezpallet_bounties::CuratorDeposit::::get(s.parent_bounty_id, None::), + pezpallet_bounties::CuratorDeposit::::get( + s.parent_bounty_id, + None:: + ), None ); @@ -576,8 +582,11 @@ fn check_status_works() { assert_eq!(Balances::free_balance(s.curator), Balances::minimum_balance()); assert_eq!(Balances::reserved_balance(s.curator), s.curator_deposit); assert_eq!( - pezpallet_bounties::CuratorDeposit::::get(s.parent_bounty_id, None::) - .unwrap(), + pezpallet_bounties::CuratorDeposit::::get( + s.parent_bounty_id, + None:: + ) + .unwrap(), consideration(s.value) ); @@ -607,7 +616,10 @@ fn check_status_works() { Balances::minimum_balance() + s.curator_deposit ); // initial assert_eq!( - pezpallet_bounties::CuratorDeposit::::get(s.parent_bounty_id, None::), + pezpallet_bounties::CuratorDeposit::::get( + s.parent_bounty_id, + None:: + ), None ); @@ -636,8 +648,11 @@ fn check_status_works() { assert!(Preimage::is_requested(&s.metadata)); assert_eq!(Balances::free_balance(s.curator), Balances::minimum_balance()); assert_eq!( - pezpallet_bounties::CuratorDeposit::::get(s.parent_bounty_id, None::) - .unwrap(), + pezpallet_bounties::CuratorDeposit::::get( + s.parent_bounty_id, + None:: + ) + .unwrap(), consideration(s.value) ); @@ -666,7 +681,10 @@ fn check_status_works() { ); assert!(!Preimage::is_requested(&s.metadata)); assert_eq!( - pezpallet_bounties::CuratorDeposit::::get(s.parent_bounty_id, None::), + pezpallet_bounties::CuratorDeposit::::get( + s.parent_bounty_id, + None:: + ), None ); assert_eq!( @@ -1046,7 +1064,10 @@ fn retry_payment_works() { } ); assert_eq!( - pezpallet_bounties::CuratorDeposit::::get(s.parent_bounty_id, None::), + pezpallet_bounties::CuratorDeposit::::get( + s.parent_bounty_id, + None:: + ), None ); @@ -1338,8 +1359,11 @@ fn accept_curator_works() { } ); assert_eq!( - pezpallet_bounties::CuratorDeposit::::get(s.parent_bounty_id, None::) - .unwrap(), + pezpallet_bounties::CuratorDeposit::::get( + s.parent_bounty_id, + None:: + ) + .unwrap(), consideration(s.value) ); assert_eq!(Balances::reserved_balance(&s.curator), s.curator_deposit); @@ -1596,7 +1620,10 @@ fn unassign_curator_works() { } ); assert_eq!( - pezpallet_bounties::CuratorDeposit::::get(s.parent_bounty_id, None::), + pezpallet_bounties::CuratorDeposit::::get( + s.parent_bounty_id, + None:: + ), None ); assert_eq!( @@ -1816,7 +1843,10 @@ fn propose_curator_works() { } ); assert_eq!( - pezpallet_bounties::CuratorDeposit::::get(s.parent_bounty_id, None::), + pezpallet_bounties::CuratorDeposit::::get( + s.parent_bounty_id, + None:: + ), None ); @@ -2001,8 +2031,11 @@ fn award_bounty_works() { } ); assert_eq!( - pezpallet_bounties::CuratorDeposit::::get(s.parent_bounty_id, None::) - .unwrap(), + pezpallet_bounties::CuratorDeposit::::get( + s.parent_bounty_id, + None:: + ) + .unwrap(), consideration(s.value) ); @@ -2147,7 +2180,10 @@ fn close_bounty_works() { } ); assert_eq!( - pezpallet_bounties::CuratorDeposit::::get(s.parent_bounty_id, None::), + pezpallet_bounties::CuratorDeposit::::get( + s.parent_bounty_id, + None:: + ), None ); diff --git a/bizinikiwi/pezframe/multisig/src/lib.rs b/bizinikiwi/pezframe/multisig/src/lib.rs index 619e33bf..1e2a51c2 100644 --- a/bizinikiwi/pezframe/multisig/src/lib.rs +++ b/bizinikiwi/pezframe/multisig/src/lib.rs @@ -146,7 +146,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The overarching call type. type RuntimeCall: Parameter @@ -198,8 +199,8 @@ pub mod pezpallet { /// - are freshly deploying this pezpallet: `RelaychainDataProvider` /// - Teyrchains with a reliably block production rate (PLO or bulk-coretime): /// - already have the pezpallet deployed: `pezframe_system::Pezpallet` - /// - are freshly deploying this pezpallet: no strong recommendation. Both local and remote - /// providers can be used. Relay provider can be a bit better in cases where the + /// - are freshly deploying this pezpallet: no strong recommendation. Both local and + /// remote providers can be used. Relay provider can be a bit better in cases where the /// teyrchain is lagging its block production to avoid clock skew. type BlockNumberProvider: BlockNumberProvider; } diff --git a/bizinikiwi/pezframe/nft-fractionalization/src/lib.rs b/bizinikiwi/pezframe/nft-fractionalization/src/lib.rs index 78422ef3..b12b50de 100644 --- a/bizinikiwi/pezframe/nft-fractionalization/src/lib.rs +++ b/bizinikiwi/pezframe/nft-fractionalization/src/lib.rs @@ -80,7 +80,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The currency mechanism, used for paying for deposits. type Currency: InspectFungible @@ -390,7 +391,12 @@ pub mod pezpallet { let pezpallet_account_balance = T::Currency::balance(&pezpallet_account); if pezpallet_account_balance < existential_deposit { - T::Currency::transfer(&depositor, &pezpallet_account, existential_deposit, Preserve)?; + T::Currency::transfer( + &depositor, + &pezpallet_account, + existential_deposit, + Preserve, + )?; } let metadata_deposit = T::Assets::calc_metadata_deposit(name.as_bytes(), symbol); if !metadata_deposit.is_zero() { diff --git a/bizinikiwi/pezframe/nfts/src/impl_nonfungibles.rs b/bizinikiwi/pezframe/nfts/src/impl_nonfungibles.rs index 206c3195..229a65a5 100644 --- a/bizinikiwi/pezframe/nfts/src/impl_nonfungibles.rs +++ b/bizinikiwi/pezframe/nfts/src/impl_nonfungibles.rs @@ -227,7 +227,9 @@ impl, I: 'static> Destroy<::AccountId> for Pezpa } } -impl, I: 'static> Mutate<::AccountId, ItemConfig> for Pezpallet { +impl, I: 'static> Mutate<::AccountId, ItemConfig> + for Pezpallet +{ fn mint_into( collection: &Self::CollectionId, item: &Self::ItemId, diff --git a/bizinikiwi/pezframe/nfts/src/lib.rs b/bizinikiwi/pezframe/nfts/src/lib.rs index 64e8b577..1bc3eda6 100644 --- a/bizinikiwi/pezframe/nfts/src/lib.rs +++ b/bizinikiwi/pezframe/nfts/src/lib.rs @@ -37,10 +37,10 @@ pub mod mock; mod tests; mod common_functions; -/// A library providing the feature set of this pezpallet. It contains modules with helper methods that -/// perform storage updates and checks required by this pezpallet's dispatchables. To use pezpallet level -/// features, make sure to set appropriate bitflags for [`Config::Features`] in your runtime -/// configuration trait. +/// A library providing the feature set of this pezpallet. It contains modules with helper methods +/// that perform storage updates and checks required by this pezpallet's dispatchables. To use +/// pezpallet level features, make sure to set appropriate bitflags for [`Config::Features`] in your +/// runtime configuration trait. mod features; mod impl_nonfungibles; mod types; @@ -116,10 +116,17 @@ pub mod pezpallet { let account = pezsp_runtime::MultiSigner::Sr25519(public).into_account(); (public.into(), account) } - fn sign(signer: &pezsp_runtime::MultiSigner, message: &[u8]) -> pezsp_runtime::MultiSignature { + fn sign( + signer: &pezsp_runtime::MultiSigner, + message: &[u8], + ) -> pezsp_runtime::MultiSignature { pezsp_runtime::MultiSignature::Sr25519( - pezsp_io::crypto::sr25519_sign(0.into(), &signer.clone().try_into().unwrap(), message) - .unwrap(), + pezsp_io::crypto::sr25519_sign( + 0.into(), + &signer.clone().try_into().unwrap(), + message, + ) + .unwrap(), ) } } diff --git a/bizinikiwi/pezframe/nfts/src/migration.rs b/bizinikiwi/pezframe/nfts/src/migration.rs index 57d36c16..cb58e0e1 100644 --- a/bizinikiwi/pezframe/nfts/src/migration.rs +++ b/bizinikiwi/pezframe/nfts/src/migration.rs @@ -16,8 +16,8 @@ // limitations under the License. use super::*; -use pezframe_support::traits::OnRuntimeUpgrade; use log; +use pezframe_support::traits::OnRuntimeUpgrade; #[cfg(feature = "try-runtime")] use pezsp_runtime::TryRuntimeError; diff --git a/bizinikiwi/pezframe/nis/src/benchmarking.rs b/bizinikiwi/pezframe/nis/src/benchmarking.rs index d75978cf..978a3993 100644 --- a/bizinikiwi/pezframe/nis/src/benchmarking.rs +++ b/bizinikiwi/pezframe/nis/src/benchmarking.rs @@ -42,7 +42,11 @@ fn fill_queues() -> Result<(), DispatchError> { Pezpallet::::place_bid(RawOrigin::Signed(caller.clone()).into(), T::MinBid::get(), 1)?; } for d in 1..queues { - Pezpallet::::place_bid(RawOrigin::Signed(caller.clone()).into(), T::MinBid::get(), 1 + d)?; + Pezpallet::::place_bid( + RawOrigin::Signed(caller.clone()).into(), + T::MinBid::get(), + 1 + d, + )?; } Ok(()) } @@ -58,7 +62,11 @@ mod benchmarks { let bid = T::MinBid::get(); T::Currency::set_balance(&caller, (ed + bid) * BalanceOf::::from(l + 1) + bid); for _ in 0..l { - Pezpallet::::place_bid(RawOrigin::Signed(caller.clone()).into(), T::MinBid::get(), 1)?; + Pezpallet::::place_bid( + RawOrigin::Signed(caller.clone()).into(), + T::MinBid::get(), + 1, + )?; } #[extrinsic_call] @@ -81,7 +89,11 @@ mod benchmarks { let ql = T::MaxQueueLen::get(); T::Currency::set_balance(&caller, (ed + bid) * BalanceOf::::from(ql + 1) + bid); for _ in 0..T::MaxQueueLen::get() { - Pezpallet::::place_bid(RawOrigin::Signed(caller.clone()).into(), T::MinBid::get(), 1)?; + Pezpallet::::place_bid( + RawOrigin::Signed(caller.clone()).into(), + T::MinBid::get(), + 1, + )?; } #[extrinsic_call] @@ -105,7 +117,11 @@ mod benchmarks { let bid = T::MinBid::get(); T::Currency::set_balance(&caller, (ed + bid) * BalanceOf::::from(l + 1) + bid); for _ in 0..l { - Pezpallet::::place_bid(RawOrigin::Signed(caller.clone()).into(), T::MinBid::get(), 1)?; + Pezpallet::::place_bid( + RawOrigin::Signed(caller.clone()).into(), + T::MinBid::get(), + 1, + )?; } #[extrinsic_call] @@ -138,9 +154,11 @@ mod benchmarks { _(origin as T::RuntimeOrigin); // Must fund at least 99.999% of the required amount. - let missing = - Perquintill::from_rational(T::Currency::balance(&Pezpallet::::account_id()), original) - .left_from_one(); + let missing = Perquintill::from_rational( + T::Currency::balance(&Pezpallet::::account_id()), + original, + ) + .left_from_one(); assert!(missing <= Perquintill::one() / 100_000); Ok(()) diff --git a/bizinikiwi/pezframe/nis/src/lib.rs b/bizinikiwi/pezframe/nis/src/lib.rs index d30fcc60..dec3bb2e 100644 --- a/bizinikiwi/pezframe/nis/src/lib.rs +++ b/bizinikiwi/pezframe/nis/src/lib.rs @@ -44,8 +44,8 @@ //! funds are unreserved. //! //! There's a target proportion of effective total issuance (i.e. accounting for existing receipts) -//! which the pezpallet attempts to have frozen at any one time. It will likely be gradually increased -//! over time by governance. +//! which the pezpallet attempts to have frozen at any one time. It will likely be gradually +//! increased over time by governance. //! //! As the proportion of effective total issuance represented by outstanding receipts drops below //! `FrozenFraction`, then bids are taken from queues and consolidated into receipts, with the queue @@ -195,7 +195,8 @@ pub mod pezpallet { /// Overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The treasury's pezpallet id, used for deriving its sovereign account ID. #[pezpallet::constant] @@ -917,8 +918,9 @@ pub mod pezpallet { /// The effective total issuance, hypothetically if all outstanding receipts were thawed at /// present. pub effective: Balance, - /// The amount needed to be accessible to this pezpallet in case all outstanding receipts were - /// thawed at present. If it is more than `holdings`, then the pezpallet will need funding. + /// The amount needed to be accessible to this pezpallet in case all outstanding receipts + /// were thawed at present. If it is more than `holdings`, then the pezpallet will need + /// funding. pub required: Balance, } diff --git a/bizinikiwi/pezframe/nis/src/mock.rs b/bizinikiwi/pezframe/nis/src/mock.rs index 30bc4496..cabe83b4 100644 --- a/bizinikiwi/pezframe/nis/src/mock.rs +++ b/bizinikiwi/pezframe/nis/src/mock.rs @@ -112,7 +112,8 @@ impl pezpallet_nis::Config for Test { type RuntimeEvent = RuntimeEvent; type PalletId = NisPalletId; type Currency = Balances; - type CurrencyBalance = >::Balance; + type CurrencyBalance = + >::Balance; type FundOrigin = pezframe_system::EnsureSigned; type Deficit = (); type IgnoredIssuance = IgnoredIssuance; @@ -150,5 +151,8 @@ pub fn new_test_ext() -> pezsp_io::TestExternalities { // our desired mockup, but without any balances. #[cfg(feature = "runtime-benchmarks")] pub fn new_test_ext_empty() -> pezsp_io::TestExternalities { - pezframe_system::GenesisConfig::::default().build_storage().unwrap().into() + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } diff --git a/bizinikiwi/pezframe/node-authorization/src/lib.rs b/bizinikiwi/pezframe/node-authorization/src/lib.rs index 2ee138aa..1f78185c 100644 --- a/bizinikiwi/pezframe/node-authorization/src/lib.rs +++ b/bizinikiwi/pezframe/node-authorization/src/lib.rs @@ -71,7 +71,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The maximum number of well known nodes that are allowed to set #[pezpallet::constant] diff --git a/bizinikiwi/pezframe/nomination-pools/benchmarking/src/inner.rs b/bizinikiwi/pezframe/nomination-pools/benchmarking/src/inner.rs index 07cc7a62..702dd099 100644 --- a/bizinikiwi/pezframe/nomination-pools/benchmarking/src/inner.rs +++ b/bizinikiwi/pezframe/nomination-pools/benchmarking/src/inner.rs @@ -198,10 +198,11 @@ impl ListScenario { )?; // Find a destination weight that will trigger the worst case scenario - let dest_weight_as_vote = ::VoterList::score_update_worst_case( - &pool_origin1, - is_increase, - ); + let dest_weight_as_vote = + ::VoterList::score_update_worst_case( + &pool_origin1, + is_increase, + ); let dest_weight: BalanceOf = dest_weight_as_vote.try_into().map_err(|_| "could not convert u64 to Balance")?; @@ -992,8 +993,8 @@ mod benchmarks { Some(deposit_amount), ); - // ugly type conversion between balances of pezpallet staking and pools (which really are same - // type). Maybe there is a better way? + // ugly type conversion between balances of pezpallet staking and pools (which really are + // same type). Maybe there is a better way? let slash_amount: u128 = deposit_amount.into() / 2; // slash pool by half diff --git a/bizinikiwi/pezframe/nomination-pools/benchmarking/src/mock.rs b/bizinikiwi/pezframe/nomination-pools/benchmarking/src/mock.rs index 368238bd..fdb1419f 100644 --- a/bizinikiwi/pezframe/nomination-pools/benchmarking/src/mock.rs +++ b/bizinikiwi/pezframe/nomination-pools/benchmarking/src/mock.rs @@ -18,9 +18,8 @@ use crate::VoterBagsListInstance; use pezframe_election_provider_support::VoteWeight; use pezframe_support::{ - derive_impl, + derive_impl, parameter_types, pezpallet_prelude::*, - parameter_types, traits::{ConstU64, Nothing, VariantCountOf}, PalletId, }; diff --git a/bizinikiwi/pezframe/nomination-pools/fuzzer/src/call.rs b/bizinikiwi/pezframe/nomination-pools/fuzzer/src/call.rs index 15061512..5de55bcf 100644 --- a/bizinikiwi/pezframe/nomination-pools/fuzzer/src/call.rs +++ b/bizinikiwi/pezframe/nomination-pools/fuzzer/src/call.rs @@ -23,11 +23,11 @@ //! Once a panic is found, it can be debugged with //! `cargo hfuzz run-debug per_thing_rational hfuzz_workspace/call/*.fuzz`. +use honggfuzz::fuzz; use pezframe_support::{ assert_ok, traits::{Currency, GetCallName, UnfilteredDispatchable}, }; -use honggfuzz::fuzz; use pezpallet_nomination_pools::{ log, mock::*, @@ -36,8 +36,8 @@ use pezpallet_nomination_pools::{ BondExtra, BondedPool, GlobalMaxCommission, LastPoolId, MaxPoolMembers, MaxPoolMembersPerPool, MaxPools, MinCreateBond, MinJoinBond, PoolId, }; -use rand::{seq::SliceRandom, Rng}; use pezsp_runtime::{assert_eq_error_rate, Perbill, Perquintill}; +use rand::{seq::SliceRandom, Rng}; const ERA: BlockNumber = 1000; const MAX_ED_MULTIPLE: Balance = 10_000; diff --git a/bizinikiwi/pezframe/nomination-pools/src/lib.rs b/bizinikiwi/pezframe/nomination-pools/src/lib.rs index 3ff32be0..b30b4456 100644 --- a/bizinikiwi/pezframe/nomination-pools/src/lib.rs +++ b/bizinikiwi/pezframe/nomination-pools/src/lib.rs @@ -17,8 +17,8 @@ //! # Nomination Pools for Staking Delegation //! -//! A pezpallet that allows members to delegate their stake to nominating pools. A nomination pool acts -//! as nominator and nominates validators on the members' behalf. +//! A pezpallet that allows members to delegate their stake to nominating pools. A nomination pool +//! acts as nominator and nominates validators on the members' behalf. //! //! # Index //! @@ -81,8 +81,8 @@ //! //! > A member can have up to [`Config::MaxUnbonding`] distinct active unbonding requests. //! -//! Second, once [`pezsp_staking::StakingInterface::bonding_duration`] eras have passed, the member can -//! call [`Call::withdraw_unbonded`] to withdraw any funds that are free. +//! Second, once [`pezsp_staking::StakingInterface::bonding_duration`] eras have passed, the member +//! can call [`Call::withdraw_unbonded`] to withdraw any funds that are free. //! //! For design docs see the [bonded pool](#bonded-pool) and [unbonding sub //! pools](#unbonding-sub-pools) sections. @@ -214,8 +214,8 @@ //! ## Design //! //! _Notes_: this section uses pseudo code to explain general design and does not necessarily -//! reflect the exact implementation. Additionally, a working knowledge of `pezpallet-staking`'s api is -//! assumed. +//! reflect the exact implementation. Additionally, a working knowledge of `pezpallet-staking`'s api +//! is assumed. //! //! ### Goals //! @@ -368,7 +368,6 @@ use pezframe_support::{ }, DefaultNoBound, PalletError, }; -use scale_info::TypeInfo; use pezsp_core::U256; use pezsp_runtime::{ traits::{ @@ -378,6 +377,7 @@ use pezsp_runtime::{ FixedPointNumber, Perbill, }; use pezsp_staking::{EraIndex, StakingInterface}; +use scale_info::TypeInfo; #[cfg(any(feature = "try-runtime", feature = "fuzzing", test, debug_assertions))] use pezsp_runtime::TryRuntimeError; @@ -1672,7 +1672,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Weight information for extrinsics in this pezpallet. type WeightInfo: weights::WeightInfo; @@ -1693,9 +1694,9 @@ pub mod pezpallet { /// a PITA to do). /// /// See the inline code docs of `Member::pending_rewards` and `RewardPool::update_recorded` - /// for example analysis. A [`pezsp_runtime::FixedU128`] should be fine for chains with balance - /// types similar to that of Pezkuwi and Kusama, in the absence of severe slashing (or - /// prevented via a reasonable `MaxPointsToBalance`), for many many years to come. + /// for example analysis. A [`pezsp_runtime::FixedU128`] should be fine for chains with + /// balance types similar to that of Pezkuwi and Kusama, in the absence of severe slashing + /// (or prevented via a reasonable `MaxPointsToBalance`), for many many years to come. type RewardCounter: FixedPointNumber + MaxEncodedLen + TypeInfo + Default + codec::FullCodec; /// The nomination pool's pezpallet id. @@ -2008,9 +2009,9 @@ pub mod pezpallet { CannotWithdrawAny, /// The amount does not meet the minimum bond to either join or create a pool. /// - /// The depositor can never unbond to a value less than `Pezpallet::depositor_min_bond`. The - /// caller does not have nominating permissions for the pool. Members can never unbond to a - /// value below `MinJoinBond`. + /// The depositor can never unbond to a value less than `Pezpallet::depositor_min_bond`. + /// The caller does not have nominating permissions for the pool. Members can never + /// unbond to a value below `MinJoinBond`. MinimumBondNotMet, /// The transaction could not be executed due to overflow risk for the pool. OverflowRisk, diff --git a/bizinikiwi/pezframe/nomination-pools/src/migration.rs b/bizinikiwi/pezframe/nomination-pools/src/migration.rs index 88aba4e8..3c9efb1b 100644 --- a/bizinikiwi/pezframe/nomination-pools/src/migration.rs +++ b/bizinikiwi/pezframe/nomination-pools/src/migration.rs @@ -36,8 +36,8 @@ pub mod versioned { ::DbWeight, >; - /// Migration V6 to V7 wrapped in a [`pezframe_support::migrations::VersionedMigration`], ensuring - /// the migration is only performed when on-chain version is 6. + /// Migration V6 to V7 wrapped in a [`pezframe_support::migrations::VersionedMigration`], + /// ensuring the migration is only performed when on-chain version is 6. pub type V6ToV7 = pezframe_support::migrations::VersionedMigration< 6, 7, @@ -621,9 +621,7 @@ pub mod v4 { /// /// This migration adds a `commission` field to every `BondedPoolInner`, if /// any. - #[deprecated( - note = "To avoid mangled storage please use `MigrateV3ToV5` instead." - )] + #[deprecated(note = "To avoid mangled storage please use `MigrateV3ToV5` instead.")] pub struct MigrateToV4(core::marker::PhantomData<(T, U)>); #[allow(deprecated)] impl> OnRuntimeUpgrade for MigrateToV4 { @@ -1155,7 +1153,9 @@ mod helpers { pub(crate) fn calculate_tvl_by_total_stake() -> BalanceOf { BondedPools::::iter_keys() .map(|id| { - T::StakeAdapter::total_stake(Pool::from(Pezpallet::::generate_bonded_account(id))) + T::StakeAdapter::total_stake(Pool::from(Pezpallet::::generate_bonded_account( + id, + ))) }) .reduce(|acc, total_balance| acc + total_balance) .unwrap_or_default() diff --git a/bizinikiwi/pezframe/nomination-pools/src/mock.rs b/bizinikiwi/pezframe/nomination-pools/src/mock.rs index 955614d9..70b41924 100644 --- a/bizinikiwi/pezframe/nomination-pools/src/mock.rs +++ b/bizinikiwi/pezframe/nomination-pools/src/mock.rs @@ -32,8 +32,8 @@ pub type BlockNumber = u64; pub type AccountId = u128; pub type Balance = u128; pub type RewardCounter = FixedU128; -// This sneaky little hack allows us to write code exactly as we would do in the pezpallet in the tests -// as well, e.g. `StorageItem::::get()`. +// This sneaky little hack allows us to write code exactly as we would do in the pezpallet in the +// tests as well, e.g. `StorageItem::::get()`. pub type T = Runtime; pub type Currency = ::Currency; diff --git a/bizinikiwi/pezframe/nomination-pools/src/tests.rs b/bizinikiwi/pezframe/nomination-pools/src/tests.rs index d72301c8..5ed79c4c 100644 --- a/bizinikiwi/pezframe/nomination-pools/src/tests.rs +++ b/bizinikiwi/pezframe/nomination-pools/src/tests.rs @@ -4614,7 +4614,9 @@ mod withdraw_unbonded { // pool is destroyed. assert!(!Metadata::::contains_key(1)); // ensure the pool account is reaped. - assert!(!pezframe_system::Account::::contains_key(&Pools::generate_bonded_account(1))); + assert!(!pezframe_system::Account::::contains_key(&Pools::generate_bonded_account( + 1 + ))); }) } diff --git a/bizinikiwi/pezframe/nomination-pools/test-delegate-stake/src/lib.rs b/bizinikiwi/pezframe/nomination-pools/test-delegate-stake/src/lib.rs index 184134d2..5bac54d5 100644 --- a/bizinikiwi/pezframe/nomination-pools/test-delegate-stake/src/lib.rs +++ b/bizinikiwi/pezframe/nomination-pools/test-delegate-stake/src/lib.rs @@ -21,6 +21,7 @@ #[allow(unexpected_cfgs)] mod mock; +use mock::*; use pezframe_support::{ assert_noop, assert_ok, hypothetically, traits::{ @@ -28,7 +29,6 @@ use pezframe_support::{ Currency, }, }; -use mock::*; use pezpallet_nomination_pools::{ BondExtra, BondedPools, CommissionChangeRate, ConfigOp, Error as PoolsError, Event as PoolsEvent, LastPoolId, PoolMember, PoolMembers, PoolState, diff --git a/bizinikiwi/pezframe/nomination-pools/test-delegate-stake/src/mock.rs b/bizinikiwi/pezframe/nomination-pools/test-delegate-stake/src/mock.rs index 2651648b..73f6e2c7 100644 --- a/bizinikiwi/pezframe/nomination-pools/test-delegate-stake/src/mock.rs +++ b/bizinikiwi/pezframe/nomination-pools/test-delegate-stake/src/mock.rs @@ -20,9 +20,8 @@ use pezframe_election_provider_support::VoteWeight; use pezframe_support::{ - assert_ok, derive_impl, + assert_ok, derive_impl, parameter_types, pezpallet_prelude::*, - parameter_types, traits::{ConstU64, ConstU8, Nothing, VariantCountOf}, PalletId, }; diff --git a/bizinikiwi/pezframe/offences/src/migration.rs b/bizinikiwi/pezframe/offences/src/migration.rs index 3cbb6834..222a3286 100644 --- a/bizinikiwi/pezframe/offences/src/migration.rs +++ b/bizinikiwi/pezframe/offences/src/migration.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use super::{Config, Kind, OffenceDetails, Pezpallet, Perbill, SessionIndex, LOG_TARGET}; +use super::{Config, Kind, OffenceDetails, Perbill, Pezpallet, SessionIndex, LOG_TARGET}; use alloc::vec::Vec; use pezframe_support::{ pezpallet_prelude::ValueQuery, @@ -90,7 +90,12 @@ pub mod v1 { /// Type of data stored as a deferred offence type DeferredOffenceOf = ( - Vec::AccountId, ::IdentificationTuple>>, + Vec< + OffenceDetails< + ::AccountId, + ::IdentificationTuple, + >, + >, Vec, SessionIndex, ); diff --git a/bizinikiwi/pezframe/origin-restriction/src/lib.rs b/bizinikiwi/pezframe/origin-restriction/src/lib.rs index cbee3a97..1886e1da 100644 --- a/bizinikiwi/pezframe/origin-restriction/src/lib.rs +++ b/bizinikiwi/pezframe/origin-restriction/src/lib.rs @@ -62,7 +62,6 @@ use pezframe_support::{ }; use pezframe_system::pezpallet_prelude::BlockNumberFor; use pezpallet_transaction_payment::OnChargeTransaction; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{ AsTransactionAuthorizedOrigin, DispatchInfoOf, DispatchOriginOf, Dispatchable, Implication, @@ -74,6 +73,7 @@ use pezsp_runtime::{ DispatchError::BadOrigin, DispatchResult, RuntimeDebug, SaturatedConversion, Saturating, Weight, }; +use scale_info::TypeInfo; /// The allowance for an entity, defining its usage limit and recovery rate. #[derive(Clone, Debug)] @@ -162,7 +162,8 @@ pub mod pezpallet { /// The runtime event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::error] diff --git a/bizinikiwi/pezframe/paged-list/src/lib.rs b/bizinikiwi/pezframe/paged-list/src/lib.rs index 3bb75696..6805d5bd 100644 --- a/bizinikiwi/pezframe/paged-list/src/lib.rs +++ b/bizinikiwi/pezframe/paged-list/src/lib.rs @@ -25,8 +25,8 @@ //! //! # Paged List Pezpallet //! -//! A thin wrapper pezpallet around a [`paged_list::StoragePagedList`]. It provides an API for a single -//! paginated list. It can be instantiated multiple times to provide multiple lists. +//! A thin wrapper pezpallet around a [`paged_list::StoragePagedList`]. It provides an API for a +//! single paginated list. It can be instantiated multiple times to provide multiple lists. //! //! ## Overview //! diff --git a/bizinikiwi/pezframe/paged-list/src/mock.rs b/bizinikiwi/pezframe/paged-list/src/mock.rs index 98d3d4f8..4ec1de61 100644 --- a/bizinikiwi/pezframe/paged-list/src/mock.rs +++ b/bizinikiwi/pezframe/paged-list/src/mock.rs @@ -62,7 +62,10 @@ pub type MetaOf = /// Build genesis storage according to the mock runtime. pub fn new_test_ext() -> TestState { - pezframe_system::GenesisConfig::::default().build_storage().unwrap().into() + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } /// Run this closure in test externalities. diff --git a/bizinikiwi/pezframe/paged-list/src/paged_list.rs b/bizinikiwi/pezframe/paged-list/src/paged_list.rs index fe705936..d3ff46c7 100644 --- a/bizinikiwi/pezframe/paged-list/src/paged_list.rs +++ b/bizinikiwi/pezframe/paged-list/src/paged_list.rs @@ -63,9 +63,9 @@ pub type ValueIndex = u32; /// [`storage::append`](frame::deps::pezsp_io::storage::append). It allows to directly extend /// the elements of `values` vector of the page without loading the whole vector from storage. A new /// page is instantiated once [`Page::next`] overflows `ValuesPerNewPage`. Its vector will also be -/// created through [`storage::append`](frame::deps::pezsp_io::storage::append). **Draining** advances -/// the internal indices identical to Iteration. It additionally persists the increments to storage -/// and thereby 'drains' elements. Completely drained pages are deleted from storage. +/// created through [`storage::append`](frame::deps::pezsp_io::storage::append). **Draining** +/// advances the internal indices identical to Iteration. It additionally persists the increments to +/// storage and thereby 'drains' elements. Completely drained pages are deleted from storage. /// /// # Further Observations /// @@ -522,7 +522,8 @@ mod tests { let as_vec = Vec::::decode(&mut &raw[..]).unwrap(); assert_eq!(as_vec.len(), 4, "Second page contains 4"); - let meta = pezsp_io::storage::get(&meta_key::()).expect("Meta should be present"); + let meta = + pezsp_io::storage::get(&meta_key::()).expect("Meta should be present"); let meta: StoragePagedListMeta = Decode::decode(&mut &meta[..]).unwrap(); assert_eq!(meta.first_page, 0); diff --git a/bizinikiwi/pezframe/parameters/src/lib.rs b/bizinikiwi/pezframe/parameters/src/lib.rs index 941dbd26..d0390109 100644 --- a/bizinikiwi/pezframe/parameters/src/lib.rs +++ b/bizinikiwi/pezframe/parameters/src/lib.rs @@ -32,19 +32,19 @@ //! //! ## Pezpallet API //! -//! This pezpallet exposes two APIs; one *inbound* side to update parameters, and one *outbound* side -//! to access said parameters. Parameters themselves are defined in the runtime config and will be -//! aggregated into an enum. Each parameter is addressed by a `key` and can have a default value. -//! This is not done by the pezpallet but through the [`pezframe_support::dynamic_params::dynamic_params`] -//! macro or alternatives. +//! This pezpallet exposes two APIs; one *inbound* side to update parameters, and one *outbound* +//! side to access said parameters. Parameters themselves are defined in the runtime config and will +//! be aggregated into an enum. Each parameter is addressed by a `key` and can have a default value. +//! This is not done by the pezpallet but through the +//! [`pezframe_support::dynamic_params::dynamic_params`] macro or alternatives. //! //! Note that this is incurring one storage read per access. This should not be a problem in most //! cases but must be considered in weight-restrained code. //! //! ### Inbound //! -//! The inbound side solely consists of the [`Pezpallet::set_parameter`] extrinsic to update the value -//! of a parameter. Each parameter can have their own admin origin as given by the +//! The inbound side solely consists of the [`Pezpallet::set_parameter`] extrinsic to update the +//! value of a parameter. Each parameter can have their own admin origin as given by the //! [`Config::AdminOrigin`]. //! //! ### Outbound @@ -60,13 +60,13 @@ //! //! ## Overview //! -//! This pezpallet is a good fit for updating parameters without a runtime upgrade. It is very handy to -//! not require a runtime upgrade for a simple parameter change since runtime upgrades require a lot -//! of diligence and always bear risks. It seems overkill to update the whole runtime for a simple -//! parameter change. This pezpallet allows for fine-grained control over who can update what. -//! The only down-side is that it trades off performance with convenience and should therefore only -//! be used in places where that is proven to be uncritical. Values that are rarely accessed but -//! change often would be a perfect fit. +//! This pezpallet is a good fit for updating parameters without a runtime upgrade. It is very handy +//! to not require a runtime upgrade for a simple parameter change since runtime upgrades require a +//! lot of diligence and always bear risks. It seems overkill to update the whole runtime for a +//! simple parameter change. This pezpallet allows for fine-grained control over who can update +//! what. The only down-side is that it trades off performance with convenience and should therefore +//! only be used in places where that is proven to be uncritical. Values that are rarely accessed +//! but change often would be a perfect fit. //! //! ### Example Configuration //! @@ -76,9 +76,9 @@ //! A permissioned origin can be define on a per-key basis like this: #![doc = docify::embed!("src/tests/mock.rs", custom_origin)] //! -//! The pezpallet will also require a default value for benchmarking. Ideally this is the variant with -//! the longest encoded length. Although in either case the PoV benchmarking will take the worst -//! case over the whole enum. +//! The pezpallet will also require a default value for benchmarking. Ideally this is the variant +//! with the longest encoded length. Although in either case the PoV benchmarking will take the +//! worst case over the whole enum. #![doc = docify::embed!("src/tests/mock.rs", benchmarking_default)] //! //! Now the aggregated parameter needs to be injected into the pezpallet config: @@ -94,14 +94,14 @@ //! //! ## Low Level / Implementation Details //! -//! The pezpallet stores the parameters in a storage map and implements the matching `Get` for -//! each `Key` type. The `Get` then accesses the `Parameters` map to retrieve the value. An event is -//! emitted every time that a value was updated. It is even emitted when the value is changed to the -//! same. +//! The pezpallet stores the parameters in a storage map and implements the matching `Get` +//! for each `Key` type. The `Get` then accesses the `Parameters` map to retrieve the value. An +//! event is emitted every time that a value was updated. It is even emitted when the value is +//! changed to the same. //! //! The key and value types themselves are defined by macros and aggregated into a runtime wide -//! enum. This enum is then injected into the pezpallet. This allows it to be used without any changes -//! to the pezpallet that the parameter will be utilized by. +//! enum. This enum is then injected into the pezpallet. This allows it to be used without any +//! changes to the pezpallet that the parameter will be utilized by. //! //! ### Design Goals //! @@ -149,7 +149,8 @@ pub mod pezpallet { /// The overarching event type. #[pezpallet::no_default_bounds] #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The overarching KV type of the parameters. /// diff --git a/bizinikiwi/pezframe/parameters/src/tests/mock.rs b/bizinikiwi/pezframe/parameters/src/tests/mock.rs index 385cfbe9..1a412a96 100644 --- a/bizinikiwi/pezframe/parameters/src/tests/mock.rs +++ b/bizinikiwi/pezframe/parameters/src/tests/mock.rs @@ -32,7 +32,8 @@ use crate::*; #[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)] impl pezframe_system::Config for Runtime { type Block = pezframe_system::mocking::MockBlock; - type AccountData = pezpallet_balances::AccountData<::Balance>; + type AccountData = + pezpallet_balances::AccountData<::Balance>; } #[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)] diff --git a/bizinikiwi/pezframe/parameters/src/tests/test_renamed.rs b/bizinikiwi/pezframe/parameters/src/tests/test_renamed.rs index 9b50923a..4f915036 100644 --- a/bizinikiwi/pezframe/parameters/src/tests/test_renamed.rs +++ b/bizinikiwi/pezframe/parameters/src/tests/test_renamed.rs @@ -34,7 +34,8 @@ use RuntimeParametersRenamed::*; #[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)] impl pezframe_system::Config for Runtime { type Block = pezframe_system::mocking::MockBlock; - type AccountData = pezpallet_balances::AccountData<::Balance>; + type AccountData = + pezpallet_balances::AccountData<::Balance>; } #[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)] diff --git a/bizinikiwi/pezframe/people/src/benchmarking.rs b/bizinikiwi/pezframe/people/src/benchmarking.rs index 24ac9903..e23a840f 100644 --- a/bizinikiwi/pezframe/people/src/benchmarking.rs +++ b/bizinikiwi/pezframe/people/src/benchmarking.rs @@ -464,7 +464,8 @@ mod benches { let temp_key = new_member_from::(u32::MAX, SEED).1; let new_person = pezpallet::Pezpallet::::reserve_new_id(); - pezpallet::Pezpallet::::recognize_personhood(new_person, Some(temp_key.clone())).unwrap(); + pezpallet::Pezpallet::::recognize_personhood(new_person, Some(temp_key.clone())) + .unwrap(); let new_key = new_member_from::(u32::MAX - 1, SEED).1; @@ -595,7 +596,8 @@ mod benches { let max_ring_size = T::MaxRingSize::get(); recognize_people::(&members); assert_ok!(pezpallet::Pezpallet::::onboard_people()); - let to_include = pezpallet::Pezpallet::::should_build_ring(RI_ZERO, max_ring_size).unwrap(); + let to_include = + pezpallet::Pezpallet::::should_build_ring(RI_ZERO, max_ring_size).unwrap(); assert_ok!(pezpallet::Pezpallet::::build_ring(RI_ZERO, to_include)); // Suspend all people in the ring @@ -698,7 +700,9 @@ mod benches { #[block] { - assert_ok!(pezpallet::Pezpallet::::migrate_keys_single_included_key(first_id, first_key)); + assert_ok!(pezpallet::Pezpallet::::migrate_keys_single_included_key( + first_id, first_key + )); } // Pending suspensions are reflected in the ring status. diff --git a/bizinikiwi/pezframe/people/src/extension.rs b/bizinikiwi/pezframe/people/src/extension.rs index 7c7f43f4..9f266843 100644 --- a/bizinikiwi/pezframe/people/src/extension.rs +++ b/bizinikiwi/pezframe/people/src/extension.rs @@ -25,13 +25,13 @@ use pezframe_support::{ CloneNoBound, DefaultNoBound, EqNoBound, PartialEqNoBound, }; use pezframe_system::{CheckNonce, ValidNonceInfo}; -use scale_info::TypeInfo; use pezsp_core::twox_64; use pezsp_runtime::{ traits::{DispatchInfoOf, TransactionExtension, ValidateResult}, transaction_validity::{InvalidTransaction, TransactionValidityError, ValidTransaction}, Saturating, }; +use scale_info::TypeInfo; /// Information required to transform an origin into a personal alias or personal identity. #[derive( diff --git a/bizinikiwi/pezframe/people/src/lib.rs b/bizinikiwi/pezframe/people/src/lib.rs index a114ddc1..768b75f0 100644 --- a/bizinikiwi/pezframe/people/src/lib.rs +++ b/bizinikiwi/pezframe/people/src/lib.rs @@ -24,10 +24,10 @@ //! The People pezpallet stores and manages identifiers of individuals who have proven their //! personhood. It tracks their personal IDs, organizes their cryptographic keys into rings, and //! allows them to use contextual aliases through authentication in extensions. When transactions -//! include cryptographic proofs of belonging to the people set, the pezpallet's transaction extension -//! verifies these proofs before allowing the transaction to proceed. This enables other pallets to -//! check if actions come from unique persons while preserving privacy through the ring-based -//! structure. +//! include cryptographic proofs of belonging to the people set, the pezpallet's transaction +//! extension verifies these proofs before allowing the transaction to proceed. This enables other +//! pallets to check if actions come from unique persons while preserving privacy through the +//! ring-based structure. //! //! The pezpallet accepts new persons after they prove their uniqueness elsewhere, stores their //! information, and supports removing persons via suspensions. While other systems (e.g., wallets) @@ -152,11 +152,11 @@ use pezframe_support::{ transactional, weights::WeightMeter, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{BadOrigin, Dispatchable}, ArithmeticError, RuntimeDebug, SaturatedConversion, Saturating, }; +use scale_info::TypeInfo; use verifiable::{Alias, GenerateVerifiable}; #[cfg(feature = "runtime-benchmarks")] @@ -200,7 +200,8 @@ pub mod pezpallet { /// The runtime event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Trait allowing cryptographic proof of membership without exposing the underlying member. /// Normally a Ring-VRF. @@ -337,8 +338,8 @@ pub mod pezpallet { #[pezpallet::storage] pub type NextPersonalId = StorageValue<_, PersonalId, ValueQuery>; - /// The state of the pezpallet regarding the actions that are currently allowed to be performed on - /// all existing rings. + /// The state of the pezpallet regarding the actions that are currently allowed to be performed + /// on all existing rings. #[pezpallet::storage] pub type RingsState = StorageValue<_, RingMembersState, ValueQuery>; @@ -653,9 +654,9 @@ pub mod pezpallet { impl Pezpallet { /// Build a ring root by including registered people. /// - /// This task is performed automatically by the pezpallet through the `on_idle` hook whenever - /// there is leftover weight in a block. This call is meant to be a backup in case of - /// extreme congestion and should be submitted by signed origins. + /// This task is performed automatically by the pezpallet through the `on_idle` hook + /// whenever there is leftover weight in a block. This call is meant to be a backup in + /// case of extreme congestion and should be submitted by signed origins. #[pezpallet::weight( T::WeightInfo::should_build_ring( limit.unwrap_or_else(T::MaxRingSize::get) @@ -715,9 +716,9 @@ pub mod pezpallet { /// registering them into the ring. This does not compute the root, that is done using /// `build_ring`. /// - /// This task is performed automatically by the pezpallet through the `on_idle` hook whenever - /// there is leftover weight in a block. This call is meant to be a backup in case of - /// extreme congestion and should be submitted by signed origins. + /// This task is performed automatically by the pezpallet through the `on_idle` hook + /// whenever there is leftover weight in a block. This call is meant to be a backup in + /// case of extreme congestion and should be submitted by signed origins. #[pezpallet::weight(T::WeightInfo::onboard_people())] #[pezpallet::call_index(101)] pub fn onboard_people_manual(origin: OriginFor) -> DispatchResultWithPostInfo { diff --git a/bizinikiwi/pezframe/people/src/mock.rs b/bizinikiwi/pezframe/people/src/mock.rs index fa6b8cb4..831c331d 100644 --- a/bizinikiwi/pezframe/people/src/mock.rs +++ b/bizinikiwi/pezframe/people/src/mock.rs @@ -377,7 +377,8 @@ pub fn setup_alias_account( }); let other_tx_ext = (pezframe_system::CheckNonce::::from(0),); // Here we simply ignore implicit as they are null. - let msg = (&EXTENSION_VERSION, &call, &other_tx_ext).using_encoded(pezsp_io::hashing::blake2_256); + let msg = + (&EXTENSION_VERSION, &call, &other_tx_ext).using_encoded(pezsp_io::hashing::blake2_256); let (proof, _alias) = Simple::create(commitment, secret, &context, &msg).expect("proof creation failed"); let tx_ext = ( diff --git a/bizinikiwi/pezframe/people/src/tests.rs b/bizinikiwi/pezframe/people/src/tests.rs index 56c3f864..f7891818 100644 --- a/bizinikiwi/pezframe/people/src/tests.rs +++ b/bizinikiwi/pezframe/people/src/tests.rs @@ -2750,7 +2750,8 @@ fn test_under_alias_revision_check() { setup_alias_account(&pk, &sk, MOCK_CONTEXT, alias_account); // The account can now use `under_alias` successfully - let dummy_call = Box::new(RuntimeCall::from(pezframe_system::Call::remark { remark: vec![] })); + let dummy_call = + Box::new(RuntimeCall::from(pezframe_system::Call::remark { remark: vec![] })); assert_ok!(PeoplePallet::under_alias( RuntimeOrigin::signed(alias_account), dummy_call.clone() diff --git a/bizinikiwi/pezframe/preimage/src/benchmarking.rs b/bizinikiwi/pezframe/preimage/src/benchmarking.rs index b8e9bf00..2503199c 100644 --- a/bizinikiwi/pezframe/preimage/src/benchmarking.rs +++ b/bizinikiwi/pezframe/preimage/src/benchmarking.rs @@ -110,7 +110,10 @@ mod benchmarks { fn unnote_preimage() { let caller = funded_account::(); let (preimage, hash) = preimage_and_hash::(); - assert_ok!(Pezpallet::::note_preimage(RawOrigin::Signed(caller.clone()).into(), preimage)); + assert_ok!(Pezpallet::::note_preimage( + RawOrigin::Signed(caller.clone()).into(), + preimage + )); #[extrinsic_call] _(RawOrigin::Signed(caller), hash); @@ -139,7 +142,10 @@ mod benchmarks { .expect("ManagerOrigin has no successful origin required for the benchmark"); let (preimage, hash) = preimage_and_hash::(); let noter = funded_account::(); - assert_ok!(Pezpallet::::note_preimage(RawOrigin::Signed(noter.clone()).into(), preimage)); + assert_ok!(Pezpallet::::note_preimage( + RawOrigin::Signed(noter.clone()).into(), + preimage + )); #[extrinsic_call] _(o as T::RuntimeOrigin, hash); diff --git a/bizinikiwi/pezframe/preimage/src/lib.rs b/bizinikiwi/pezframe/preimage/src/lib.rs index c9ab8c93..27b9ab8a 100644 --- a/bizinikiwi/pezframe/preimage/src/lib.rs +++ b/bizinikiwi/pezframe/preimage/src/lib.rs @@ -131,7 +131,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The Weight information for this pezpallet. type WeightInfo: weights::WeightInfo; diff --git a/bizinikiwi/pezframe/proxy/src/benchmarking.rs b/bizinikiwi/pezframe/proxy/src/benchmarking.rs index a06a86da..d080d3c6 100644 --- a/bizinikiwi/pezframe/proxy/src/benchmarking.rs +++ b/bizinikiwi/pezframe/proxy/src/benchmarking.rs @@ -306,7 +306,8 @@ mod benchmarks { proxy_type: T::ProxyType::default(), disambiguation_index: 0, at: ::BlockNumberProvider::current_block_number(), - extrinsic_index: pezframe_system::Pezpallet::::extrinsic_index().unwrap_or_default(), + extrinsic_index: pezframe_system::Pezpallet::::extrinsic_index() + .unwrap_or_default(), } .into(), ); diff --git a/bizinikiwi/pezframe/proxy/src/lib.rs b/bizinikiwi/pezframe/proxy/src/lib.rs index 75249700..3be8292c 100644 --- a/bizinikiwi/pezframe/proxy/src/lib.rs +++ b/bizinikiwi/pezframe/proxy/src/lib.rs @@ -16,8 +16,8 @@ // limitations under the License. //! # Proxy Pezpallet -//! A pezpallet allowing accounts to give permission to other accounts to dispatch types of calls from -//! their signed origin. +//! A pezpallet allowing accounts to give permission to other accounts to dispatch types of calls +//! from their signed origin. //! //! The accounts to which permission is delegated may be required to announce the action that they //! wish to execute some duration prior to execution happens. In this case, the target account may @@ -132,7 +132,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The overarching call type. type RuntimeCall: Parameter @@ -219,8 +220,8 @@ pub mod pezpallet { /// - are freshly deploying this pezpallet: `RelaychainDataProvider` /// - Teyrchains with a reliably block production rate (PLO or bulk-coretime): /// - already have the pezpallet deployed: `pezframe_system::Pezpallet` - /// - are freshly deploying this pezpallet: no strong recommendation. Both local and remote - /// providers can be used. Relay provider can be a bit better in cases where the + /// - are freshly deploying this pezpallet: no strong recommendation. Both local and + /// remote providers can be used. Relay provider can be a bit better in cases where the /// teyrchain is lagging its block production to avoid clock skew. type BlockNumberProvider: BlockNumberProvider; } @@ -357,7 +358,8 @@ pub mod pezpallet { T::Currency::reserve(&who, deposit)?; Proxies::::insert(&pure, (bounded_proxies, deposit)); - let extrinsic_index = >::extrinsic_index().unwrap_or_default(); + let extrinsic_index = + >::extrinsic_index().unwrap_or_default(); Self::deposit_event(Event::PureCreated { pure, who, diff --git a/bizinikiwi/pezframe/ranked-collective/src/lib.rs b/bizinikiwi/pezframe/ranked-collective/src/lib.rs index a7c45d84..ec60e030 100644 --- a/bizinikiwi/pezframe/ranked-collective/src/lib.rs +++ b/bizinikiwi/pezframe/ranked-collective/src/lib.rs @@ -53,13 +53,13 @@ use pezframe_support::{ }, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, }; -use scale_info::TypeInfo; use pezsp_arithmetic::traits::Saturating; use pezsp_runtime::{ traits::{Convert, StaticLookup}, ArithmeticError::Overflow, DispatchError, Perbill, RuntimeDebug, }; +use scale_info::TypeInfo; #[cfg(test)] mod tests; diff --git a/bizinikiwi/pezframe/recovery/src/lib.rs b/bizinikiwi/pezframe/recovery/src/lib.rs index 957ca50f..b0e760d8 100644 --- a/bizinikiwi/pezframe/recovery/src/lib.rs +++ b/bizinikiwi/pezframe/recovery/src/lib.rs @@ -237,7 +237,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; @@ -267,8 +268,8 @@ pub mod pezpallet { /// - are freshly deploying this pezpallet: `RelaychainDataProvider` /// - Teyrchains with a reliably block production rate (PLO or bulk-coretime): /// - already have the pezpallet deployed: `pezframe_system::Pezpallet` - /// - are freshly deploying this pezpallet: no strong recommendation. Both local and remote - /// providers can be used. Relay provider can be a bit better in cases where the + /// - are freshly deploying this pezpallet: no strong recommendation. Both local and + /// remote providers can be used. Relay provider can be a bit better in cases where the /// teyrchain is lagging its block production to avoid clock skew. type BlockNumberProvider: BlockNumberProvider; @@ -645,7 +646,8 @@ pub mod pezpallet { recovery_config.threshold as usize <= active_recovery.friends.len(), Error::::Threshold ); - pezframe_system::Pezpallet::::inc_consumers(&who).map_err(|_| Error::::BadState)?; + pezframe_system::Pezpallet::::inc_consumers(&who) + .map_err(|_| Error::::BadState)?; // Create the recovery storage item Proxy::::insert(&who, &account); Self::deposit_event(Event::::AccountRecovered { diff --git a/bizinikiwi/pezframe/referenda/src/lib.rs b/bizinikiwi/pezframe/referenda/src/lib.rs index 1b4b6002..a9fa69ae 100644 --- a/bizinikiwi/pezframe/referenda/src/lib.rs +++ b/bizinikiwi/pezframe/referenda/src/lib.rs @@ -82,11 +82,11 @@ use pezframe_support::{ }, BoundedVec, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{AtLeast32BitUnsigned, Bounded, Dispatchable, One, Saturating, Zero}, DispatchError, Perbill, }; +use scale_info::TypeInfo; mod branch; pub mod migration; @@ -814,9 +814,10 @@ impl, I: 'static> Polling for Pezpallet { r }); let now = T::BlockNumberProvider::current_block_number(); - let dummy_account_id = - codec::Decode::decode(&mut pezsp_runtime::traits::TrailingZeroInput::new(&b"dummy"[..])) - .expect("infinite length input; no invalid inputs for type; qed"); + let dummy_account_id = codec::Decode::decode( + &mut pezsp_runtime::traits::TrailingZeroInput::new(&b"dummy"[..]), + ) + .expect("infinite length input; no invalid inputs for type; qed"); let mut status = ReferendumStatusOf:: { track: class, origin: pezframe_support::dispatch::RawOrigin::Root.into(), diff --git a/bizinikiwi/pezframe/referenda/src/migration.rs b/bizinikiwi/pezframe/referenda/src/migration.rs index fecbc91e..d9f43d9a 100644 --- a/bizinikiwi/pezframe/referenda/src/migration.rs +++ b/bizinikiwi/pezframe/referenda/src/migration.rs @@ -19,8 +19,8 @@ use super::*; use codec::{Decode, Encode, EncodeLike, MaxEncodedLen}; -use pezframe_support::{pezpallet_prelude::*, storage_alias, traits::OnRuntimeUpgrade}; use log; +use pezframe_support::{pezpallet_prelude::*, storage_alias, traits::OnRuntimeUpgrade}; #[cfg(feature = "try-runtime")] use pezsp_runtime::TryRuntimeError; diff --git a/bizinikiwi/pezframe/referenda/src/types.rs b/bizinikiwi/pezframe/referenda/src/types.rs index 4e6cbe8a..83969dd9 100644 --- a/bizinikiwi/pezframe/referenda/src/types.rs +++ b/bizinikiwi/pezframe/referenda/src/types.rs @@ -25,9 +25,9 @@ use pezframe_support::{ traits::{schedule::v3::Anon, Bounded}, Parameter, }; -use scale_info::{Type, TypeInfo}; use pezsp_arithmetic::{Rounding::*, SignedRounding::*}; use pezsp_runtime::{FixedI64, PerThing, RuntimeDebug}; +use scale_info::{Type, TypeInfo}; pub type BalanceOf = <>::Currency as Currency<::AccountId>>::Balance; diff --git a/bizinikiwi/pezframe/remark/src/lib.rs b/bizinikiwi/pezframe/remark/src/lib.rs index 09cf6065..3c5077fe 100644 --- a/bizinikiwi/pezframe/remark/src/lib.rs +++ b/bizinikiwi/pezframe/remark/src/lib.rs @@ -46,7 +46,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; } diff --git a/bizinikiwi/pezframe/revive/dev-node/node/src/chain_spec.rs b/bizinikiwi/pezframe/revive/dev-node/node/src/chain_spec.rs index 3f762436..35969643 100644 --- a/bizinikiwi/pezframe/revive/dev-node/node/src/chain_spec.rs +++ b/bizinikiwi/pezframe/revive/dev-node/node/src/chain_spec.rs @@ -15,11 +15,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +use pez_revive_dev_runtime::WASM_BINARY; use pezkuwi_sdk::{ pezsc_service::{ChainType, Properties}, *, }; -use pez_revive_dev_runtime::WASM_BINARY; /// This is a specialization of the general Bizinikiwi ChainSpec type. pub type ChainSpec = pezsc_service::GenericChainSpec; diff --git a/bizinikiwi/pezframe/revive/dev-node/node/src/command.rs b/bizinikiwi/pezframe/revive/dev-node/node/src/command.rs index 14da51ec..c9b2d244 100644 --- a/bizinikiwi/pezframe/revive/dev-node/node/src/command.rs +++ b/bizinikiwi/pezframe/revive/dev-node/node/src/command.rs @@ -141,12 +141,17 @@ pub fn run_with_args(args: Vec) -> pezsc_cli::Result<()> { runner.run_node_until_exit(|config| async move { match config.network.network_backend { - pezsc_network::config::NetworkBackendType::Libp2p => - service::new_full::>(config, cli.consensus) - .map_err(pezsc_cli::Error::Service), + pezsc_network::config::NetworkBackendType::Libp2p => service::new_full::< + pezsc_network::NetworkWorker<_, _>, + >( + config, cli.consensus + ) + .map_err(pezsc_cli::Error::Service), pezsc_network::config::NetworkBackendType::Litep2p => service::new_full::< pezsc_network::Litep2pNetworkBackend, - >(config, cli.consensus) + >( + config, cli.consensus + ) .map_err(pezsc_cli::Error::Service), } }) diff --git a/bizinikiwi/pezframe/revive/dev-node/node/src/rpc.rs b/bizinikiwi/pezframe/revive/dev-node/node/src/rpc.rs index 517087c0..a9f82d4a 100644 --- a/bizinikiwi/pezframe/revive/dev-node/node/src/rpc.rs +++ b/bizinikiwi/pezframe/revive/dev-node/node/src/rpc.rs @@ -24,12 +24,12 @@ use crate::cli::Consensus; use jsonrpsee::{core::RpcResult, proc_macros::rpc, RpcModule}; +use pez_revive_dev_runtime::{AccountId, Nonce, OpaqueBlock}; use pezkuwi_sdk::{ pezsc_transaction_pool_api::TransactionPool, pezsp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}, *, }; -use pez_revive_dev_runtime::{AccountId, Nonce, OpaqueBlock}; use std::sync::Arc; /// Full client dependencies. diff --git a/bizinikiwi/pezframe/revive/dev-node/node/src/service.rs b/bizinikiwi/pezframe/revive/dev-node/node/src/service.rs index c60e5aad..892c50b5 100644 --- a/bizinikiwi/pezframe/revive/dev-node/node/src/service.rs +++ b/bizinikiwi/pezframe/revive/dev-node/node/src/service.rs @@ -16,6 +16,7 @@ // limitations under the License. use crate::cli::Consensus; +use pez_revive_dev_runtime::{OpaqueBlock as Block, Runtime, RuntimeApi}; use pezkuwi_sdk::{ pezsc_client_api::StorageProvider, pezsc_executor::WasmExecutor, @@ -24,7 +25,6 @@ use pezkuwi_sdk::{ pezsp_runtime::traits::Block as BlockT, *, }; -use pez_revive_dev_runtime::{OpaqueBlock as Block, Runtime, RuntimeApi}; use std::sync::Arc; type HostFunctions = pezsp_io::BizinikiwiHostFunctions; @@ -221,7 +221,8 @@ pub fn new_full: create_inherent_data_providers: timestamp_provider, }; - let authorship_future = pezsc_consensus_manual_seal::run_instant_seal_and_finalize(params); + let authorship_future = + pezsc_consensus_manual_seal::run_instant_seal_and_finalize(params); task_manager.spawn_essential_handle().spawn_blocking( "instant-seal", diff --git a/bizinikiwi/pezframe/revive/dev-node/runtime/src/lib.rs b/bizinikiwi/pezframe/revive/dev-node/runtime/src/lib.rs index 7c5e12bd..71e41d2e 100644 --- a/bizinikiwi/pezframe/revive/dev-node/runtime/src/lib.rs +++ b/bizinikiwi/pezframe/revive/dev-node/runtime/src/lib.rs @@ -30,14 +30,6 @@ use pezframe_support::weights::{ Weight, }; use pezframe_system::limits::BlockWeights; -use pezpallet_revive::{ - evm::{ - fees::{BlockRatioFee, Info as FeeInfo}, - runtime::EthExtra, - }, - AccountId32Mapper, -}; -use pezpallet_transaction_payment::{ConstFeeMultiplier, FeeDetails, Multiplier, RuntimeDispatchInfo}; use pezkuwi_sdk::{ pezkuwi_sdk_frame::{ deps::pezsp_genesis_builder, @@ -46,6 +38,16 @@ use pezkuwi_sdk::{ }, *, }; +use pezpallet_revive::{ + evm::{ + fees::{BlockRatioFee, Info as FeeInfo}, + runtime::EthExtra, + }, + AccountId32Mapper, +}; +use pezpallet_transaction_payment::{ + ConstFeeMultiplier, FeeDetails, Multiplier, RuntimeDispatchInfo, +}; use pezsp_weights::ConstantMultiplier; pub use pezkuwi_sdk::{ @@ -302,7 +304,8 @@ impl pezframe_system::Config for Runtime { type AccountId = AccountId; type Hash = Hash; type Nonce = Nonce; - type AccountData = pezpallet_balances::AccountData<::Balance>; + type AccountData = + pezpallet_balances::AccountData<::Balance>; } parameter_types! { diff --git a/bizinikiwi/pezframe/revive/fixtures/build.rs b/bizinikiwi/pezframe/revive/fixtures/build.rs index 0c5dfc25..14d56065 100644 --- a/bizinikiwi/pezframe/revive/fixtures/build.rs +++ b/bizinikiwi/pezframe/revive/fixtures/build.rs @@ -179,7 +179,8 @@ fn invoke_build(current_dir: &Path) -> Result<()> { // Note: panic_immediate_abort is now a real panic strategy in newer Rust nightlies // Use -Cpanic=immediate-abort instead of -Zbuild-std-features=panic_immediate_abort // -Zunstable-options must be in RUSTFLAGS as well for the rustc probe - let encoded_rustflags = ["-Dwarnings", "-Zunstable-options", "-Cpanic=immediate-abort"].join("\x1f"); + let encoded_rustflags = + ["-Dwarnings", "-Zunstable-options", "-Cpanic=immediate-abort"].join("\x1f"); let mut build_command = Command::new("cargo"); build_command @@ -190,11 +191,7 @@ fn invoke_build(current_dir: &Path) -> Result<()> { .env("RUSTUP_HOME", env::var("RUSTUP_HOME").unwrap_or_default()) // Support compilation on stable rust .env("RUSTC_BOOTSTRAP", "1") - .args([ - "build", - "--release", - "-Zbuild-std=core", - ]) + .args(["build", "--release", "-Zbuild-std=core"]) .arg("--target") .arg(polkavm_linker::target_json_path(polkavm_linker::TargetJsonArgs::default()).unwrap()); diff --git a/bizinikiwi/pezframe/revive/rpc/src/block_info_provider.rs b/bizinikiwi/pezframe/revive/rpc/src/block_info_provider.rs index 8ad1dc5e..6b7f41cc 100644 --- a/bizinikiwi/pezframe/revive/rpc/src/block_info_provider.rs +++ b/bizinikiwi/pezframe/revive/rpc/src/block_info_provider.rs @@ -16,7 +16,7 @@ // limitations under the License. use crate::{ - client::{SubscriptionType, BizinikiwiBlock, BizinikiwiBlockNumber}, + client::{BizinikiwiBlock, BizinikiwiBlockNumber, SubscriptionType}, subxt_client::SrcChainConfig, ClientError, }; @@ -50,7 +50,8 @@ pub trait BlockInfoProvider: Send + Sync { ) -> Result>, ClientError>; /// Get block by block hash. - async fn block_by_hash(&self, hash: &H256) -> Result>, ClientError>; + async fn block_by_hash(&self, hash: &H256) + -> Result>, ClientError>; } /// Provides information about blocks. @@ -86,7 +87,11 @@ impl SubxtBlockInfoProvider { #[async_trait] impl BlockInfoProvider for SubxtBlockInfoProvider { - async fn update_latest(&self, block: Arc, subscription_type: SubscriptionType) { + async fn update_latest( + &self, + block: Arc, + subscription_type: SubscriptionType, + ) { let mut latest = match subscription_type { SubscriptionType::FinalizedBlocks => self.latest_finalized_block.write().await, SubscriptionType::BestBlocks => self.latest_block.write().await, @@ -127,7 +132,10 @@ impl BlockInfoProvider for SubxtBlockInfoProvider { } } - async fn block_by_hash(&self, hash: &H256) -> Result>, ClientError> { + async fn block_by_hash( + &self, + hash: &H256, + ) -> Result>, ClientError> { let latest = self.latest_block().await; if hash == &latest.hash() { return Ok(Some(latest)); diff --git a/bizinikiwi/pezframe/revive/rpc/src/cli.rs b/bizinikiwi/pezframe/revive/rpc/src/cli.rs index abe5528f..3a48f4a2 100644 --- a/bizinikiwi/pezframe/revive/rpc/src/cli.rs +++ b/bizinikiwi/pezframe/revive/rpc/src/cli.rs @@ -16,7 +16,7 @@ // limitations under the License. //! The Ethereum JSON-RPC server. use crate::{ - client::{connect, Client, SubscriptionType, BizinikiwiBlockNumber}, + client::{connect, BizinikiwiBlockNumber, Client, SubscriptionType}, DebugRpcServer, DebugRpcServerImpl, EthRpcServer, EthRpcServerImpl, ReceiptExtractor, ReceiptProvider, SubxtBlockInfoProvider, SystemHealthRpcServer, SystemHealthRpcServerImpl, LOG_TARGET, @@ -270,7 +270,11 @@ fn rpc_module(is_dev: bool, client: Client) -> Result, pezsc_servi let mut module = RpcModule::new(()); module.merge(eth_api).map_err(|e| pezsc_service::Error::Application(e.into()))?; - module.merge(health_api).map_err(|e| pezsc_service::Error::Application(e.into()))?; - module.merge(debug_api).map_err(|e| pezsc_service::Error::Application(e.into()))?; + module + .merge(health_api) + .map_err(|e| pezsc_service::Error::Application(e.into()))?; + module + .merge(debug_api) + .map_err(|e| pezsc_service::Error::Application(e.into()))?; Ok(module) } diff --git a/bizinikiwi/pezframe/revive/rpc/src/client.rs b/bizinikiwi/pezframe/revive/rpc/src/client.rs index 290b8004..a18d6805 100644 --- a/bizinikiwi/pezframe/revive/rpc/src/client.rs +++ b/bizinikiwi/pezframe/revive/rpc/src/client.rs @@ -34,9 +34,9 @@ use pezpallet_revive::{ }, EthTransactError, }; -use runtime_api::RuntimeApi; use pezsp_runtime::traits::Block as BlockT; use pezsp_weights::Weight; +use runtime_api::RuntimeApi; use std::{ops::Range, sync::Arc, time::Duration}; use storage_api::StorageApi; use subxt::{ @@ -514,7 +514,10 @@ impl Client { } /// Get receipts count per block. - pub async fn receipts_count_per_block(&self, block_hash: &BizinikiwiBlockHash) -> Option { + pub async fn receipts_count_per_block( + &self, + block_hash: &BizinikiwiBlockHash, + ) -> Option { self.receipt_provider.receipts_count_per_block(block_hash).await } @@ -710,8 +713,8 @@ impl Client { // This could potentially fail under below circumstances: // - state has been pruned // - the block author cannot be obtained from the digest logs (highly unlikely) - // - the node we are targeting has an outdated revive pezpallet (or ETH block functionality is - // disabled) + // - the node we are targeting has an outdated revive pezpallet (or ETH block functionality + // is disabled) match self.runtime_api(block.hash()).eth_block().await { Ok(mut eth_block) => { log::trace!(target: LOG_TARGET, "Ethereum block from runtime API hash {:?}", eth_block.hash); diff --git a/bizinikiwi/pezframe/revive/rpc/src/receipt_provider.rs b/bizinikiwi/pezframe/revive/rpc/src/receipt_provider.rs index ab113fa2..ec8bf3b2 100644 --- a/bizinikiwi/pezframe/revive/rpc/src/receipt_provider.rs +++ b/bizinikiwi/pezframe/revive/rpc/src/receipt_provider.rs @@ -611,8 +611,8 @@ mod tests { use super::*; use crate::test::{MockBlockInfo, MockBlockInfoProvider}; use pezpallet_revive::evm::{ReceiptInfo, TransactionSigned}; - use pretty_assertions::assert_eq; use pezsp_core::{H160, H256}; + use pretty_assertions::assert_eq; use sqlx::SqlitePool; async fn count(pool: &SqlitePool, table: &str, block_hash: Option) -> usize { diff --git a/bizinikiwi/pezframe/revive/src/address.rs b/bizinikiwi/pezframe/revive/src/address.rs index 9ec2e800..8315421d 100644 --- a/bizinikiwi/pezframe/revive/src/address.rs +++ b/bizinikiwi/pezframe/revive/src/address.rs @@ -278,8 +278,8 @@ mod test { assert_err, traits::fungible::{InspectHold, Mutate}, }; - use pretty_assertions::assert_eq; use pezsp_core::{hex2array, H160}; + use pretty_assertions::assert_eq; #[test] fn create1_works() { diff --git a/bizinikiwi/pezframe/revive/src/benchmarking.rs b/bizinikiwi/pezframe/revive/src/benchmarking.rs index 90f974f9..9c617a18 100644 --- a/bizinikiwi/pezframe/revive/src/benchmarking.rs +++ b/bizinikiwi/pezframe/revive/src/benchmarking.rs @@ -46,6 +46,7 @@ use crate::{ use alloc::{vec, vec::Vec}; use alloy_core::sol_types::{SolInterface, SolValue}; use codec::{Encode, MaxEncodedLen}; +use k256::ecdsa::SigningKey; use pezframe_benchmarking::v2::*; use pezframe_support::{ self, assert_ok, @@ -55,13 +56,11 @@ use pezframe_support::{ weights::{Weight, WeightMeter}, }; use pezframe_system::RawOrigin; -use k256::ecdsa::SigningKey; use pezpallet_revive_uapi::{ pack_hi_lo, precompiles::{storage::IStorage, system::ISystem}, CallFlags, ReturnErrorCode, StorageFlags, }; -use revm::bytecode::Bytecode; use pezsp_consensus_aura::AURA_ENGINE_ID; use pezsp_consensus_babe::{ digests::{PreDigest, PrimaryPreDigest}, @@ -69,6 +68,7 @@ use pezsp_consensus_babe::{ }; use pezsp_consensus_slots::Slot; use pezsp_runtime::{generic::DigestItem, traits::Zero}; +use revm::bytecode::Bytecode; /// How many runs we do per API benchmark. /// @@ -938,7 +938,8 @@ mod benchmarks { input_bytes, ); } - let min: U256 = crate::Pezpallet::::convert_native_to_evm(T::Currency::minimum_balance()); + let min: U256 = + crate::Pezpallet::::convert_native_to_evm(T::Currency::minimum_balance()); let min = crate::precompiles::alloy::primitives::aliases::U256::abi_decode(&min.to_big_endian()) .unwrap(); @@ -1042,7 +1043,10 @@ mod benchmarks { [i, i, i, i], vec![i; 128], )); - pezframe_system::Pezpallet::::deposit_log(DigestItem::Seal([i, i, i, i], vec![i; 128])); + pezframe_system::Pezpallet::::deposit_log(DigestItem::Seal( + [i, i, i, i], + vec![i; 128], + )); pezframe_system::Pezpallet::::deposit_log(DigestItem::Other(vec![i; 128])); } @@ -1069,7 +1073,10 @@ mod benchmarks { AURA_ENGINE_ID, slot.encode(), )); - pezframe_system::Pezpallet::::deposit_log(DigestItem::Seal(AURA_ENGINE_ID, slot.encode())); + pezframe_system::Pezpallet::::deposit_log(DigestItem::Seal( + AURA_ENGINE_ID, + slot.encode(), + )); let result; #[block] @@ -1225,7 +1232,10 @@ mod benchmarks { assert!(PristineCode::::get(code_hash).is_some()); - T::Currency::set_balance(&instance.account_id, Pezpallet::::min_balance() * 10u32.into()); + T::Currency::set_balance( + &instance.account_id, + Pezpallet::::min_balance() * 10u32.into(), + ); let result; #[block] @@ -1248,7 +1258,10 @@ mod benchmarks { // Check that the beneficiary received the balance let balance = ::Currency::balance(&beneficiary); - assert_eq!(balance, Pezpallet::::min_balance() + Pezpallet::::min_balance() * 9u32.into()); + assert_eq!( + balance, + Pezpallet::::min_balance() + Pezpallet::::min_balance() * 9u32.into() + ); Ok(()) } @@ -2274,8 +2287,8 @@ mod benchmarks { let key_type = pezsp_core::crypto::KeyTypeId(*b"code"); let pub_key = pezsp_io::crypto::sr25519_generate(key_type, None); - let sig = - pezsp_io::crypto::sr25519_sign(key_type, &pub_key, &message).expect("Generates signature"); + let sig = pezsp_io::crypto::sr25519_sign(key_type, &pub_key, &message) + .expect("Generates signature"); let sig = AsRef::<[u8; 64]>::as_ref(&sig).to_vec(); let sig_len = sig.len() as u32; diff --git a/bizinikiwi/pezframe/revive/src/debug.rs b/bizinikiwi/pezframe/revive/src/debug.rs index 82b70538..e67df541 100644 --- a/bizinikiwi/pezframe/revive/src/debug.rs +++ b/bizinikiwi/pezframe/revive/src/debug.rs @@ -17,10 +17,10 @@ use crate::{Config, DebugSettingsOf}; use codec::{Decode, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; -use serde::{Deserialize, Serialize}; use pezsp_core::Get; use pezsp_runtime::RuntimeDebug; +use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; /// Debugging settings that can be configured when DebugEnabled config is true. #[derive( diff --git a/bizinikiwi/pezframe/revive/src/evm/api/debug_rpc_types.rs b/bizinikiwi/pezframe/revive/src/evm/api/debug_rpc_types.rs index ec0113bc..22a7b3fa 100644 --- a/bizinikiwi/pezframe/revive/src/evm/api/debug_rpc_types.rs +++ b/bizinikiwi/pezframe/revive/src/evm/api/debug_rpc_types.rs @@ -19,13 +19,13 @@ use crate::evm::Bytes; use alloc::{collections::BTreeMap, string::String, vec::Vec}; use codec::{Decode, Encode}; use derive_more::From; +use pezsp_core::{H160, H256, U256}; use scale_info::TypeInfo; use serde::{ de::{Error, MapAccess, Visitor}, ser::{SerializeMap, Serializer}, Deserialize, Serialize, }; -use pezsp_core::{H160, H256, U256}; /// The type of tracer to use. #[derive(TypeInfo, Debug, Clone, Encode, Decode, Serialize, Deserialize, PartialEq)] diff --git a/bizinikiwi/pezframe/revive/src/evm/api/rpc_types.rs b/bizinikiwi/pezframe/revive/src/evm/api/rpc_types.rs index 05dc222d..4e0627bd 100644 --- a/bizinikiwi/pezframe/revive/src/evm/api/rpc_types.rs +++ b/bizinikiwi/pezframe/revive/src/evm/api/rpc_types.rs @@ -19,8 +19,8 @@ use super::*; use alloc::vec::Vec; use codec::{Decode, Encode}; use pezframe_support::DefaultNoBound; -use scale_info::TypeInfo; use pezsp_core::{H160, U256}; +use scale_info::TypeInfo; /// Configuration specific to a dry-run execution. #[derive(Debug, Encode, Decode, TypeInfo, Clone, DefaultNoBound)] diff --git a/bizinikiwi/pezframe/revive/src/evm/block_hash.rs b/bizinikiwi/pezframe/revive/src/evm/block_hash.rs index 920a1f12..fe4f5569 100644 --- a/bizinikiwi/pezframe/revive/src/evm/block_hash.rs +++ b/bizinikiwi/pezframe/revive/src/evm/block_hash.rs @@ -33,8 +33,8 @@ use alloc::vec::Vec; use alloy_core::primitives::{bytes::BufMut, B256}; use codec::{Decode, Encode}; -use scale_info::TypeInfo; use pezsp_core::{H256, U256}; +use scale_info::TypeInfo; /// Details needed to reconstruct the receipt info in the RPC /// layer without losing accuracy. diff --git a/bizinikiwi/pezframe/revive/src/evm/block_hash/block_builder.rs b/bizinikiwi/pezframe/revive/src/evm/block_hash/block_builder.rs index 9c2ad66e..93abc93d 100644 --- a/bizinikiwi/pezframe/revive/src/evm/block_hash/block_builder.rs +++ b/bizinikiwi/pezframe/revive/src/evm/block_hash/block_builder.rs @@ -32,17 +32,17 @@ use alloc::{vec, vec::Vec}; use codec::{Decode, Encode}; use pezframe_support::traits::Time; -use scale_info::TypeInfo; use pezsp_arithmetic::traits::Saturating; use pezsp_core::{keccak_256, H160, H256, U256}; use pezsp_runtime::traits::{One, Zero}; +use scale_info::TypeInfo; const LOG_TARGET: &str = "runtime::revive::block_builder"; /// Ethereum block builder designed to incrementally build the transaction and receipt trie roots. /// -/// This builder is optimized to minimize memory usage and pezpallet storage by leveraging the internal -/// structure of the Ethereum trie and the RLP encoding of receipts. +/// This builder is optimized to minimize memory usage and pezpallet storage by leveraging the +/// internal structure of the Ethereum trie and the RLP encoding of receipts. #[cfg_attr(test, derive(pezframe_support::DefaultNoBound))] pub struct EthereumBlockBuilder { pub(crate) transaction_root_builder: IncrementalHashBuilder, diff --git a/bizinikiwi/pezframe/revive/src/evm/call.rs b/bizinikiwi/pezframe/revive/src/evm/call.rs index 5b82f3ee..bf320c32 100644 --- a/bizinikiwi/pezframe/revive/src/evm/call.rs +++ b/bizinikiwi/pezframe/revive/src/evm/call.rs @@ -26,7 +26,9 @@ use alloc::{boxed::Box, vec::Vec}; use codec::DecodeLimit; use pezframe_support::MAX_EXTRINSIC_DEPTH; use pezsp_core::Get; -use pezsp_runtime::{transaction_validity::InvalidTransaction, FixedPointNumber, SaturatedConversion}; +use pezsp_runtime::{ + transaction_validity::InvalidTransaction, FixedPointNumber, SaturatedConversion, +}; /// Result of decoding an eth transaction into a dispatchable call. pub struct CallInfo { diff --git a/bizinikiwi/pezframe/revive/src/evm/fees.rs b/bizinikiwi/pezframe/revive/src/evm/fees.rs index be581a09..ceddd92e 100644 --- a/bizinikiwi/pezframe/revive/src/evm/fees.rs +++ b/bizinikiwi/pezframe/revive/src/evm/fees.rs @@ -27,6 +27,7 @@ use crate::{ }; use codec::Encode; use core::marker::PhantomData; +use num_traits::Zero; use pezframe_support::{ dispatch::{DispatchClass, DispatchInfo, GetDispatchInfo}, pezpallet_prelude::Weight, @@ -34,7 +35,6 @@ use pezframe_support::{ weights::WeightToFee, }; use pezframe_system::Config as SysConfig; -use num_traits::Zero; use pezpallet_transaction_payment::{ Config as TxConfig, MultiplierUpdate, NextFeeMultiplier, Pezpallet as TxPallet, TxCreditHold, }; diff --git a/bizinikiwi/pezframe/revive/src/evm/runtime.rs b/bizinikiwi/pezframe/revive/src/evm/runtime.rs index a19e9a14..88ed273b 100644 --- a/bizinikiwi/pezframe/revive/src/evm/runtime.rs +++ b/bizinikiwi/pezframe/revive/src/evm/runtime.rs @@ -33,7 +33,6 @@ use pezframe_support::{ }, }; use pezpallet_transaction_payment::Config as TxConfig; -use scale_info::{StaticTypeInfo, TypeInfo}; use pezsp_core::U256; use pezsp_runtime::{ generic::{self, CheckedExtrinsic, ExtrinsicFormat}, @@ -44,6 +43,7 @@ use pezsp_runtime::{ transaction_validity::{InvalidTransaction, TransactionValidityError}, OpaqueExtrinsic, RuntimeDebug, Weight, }; +use scale_info::{StaticTypeInfo, TypeInfo}; /// Used to set the weight limit argument of a `eth_call` or `eth_instantiate_with_code` call. pub trait SetWeightLimit { diff --git a/bizinikiwi/pezframe/revive/src/evm/tx_extension.rs b/bizinikiwi/pezframe/revive/src/evm/tx_extension.rs index a170e345..4d624472 100644 --- a/bizinikiwi/pezframe/revive/src/evm/tx_extension.rs +++ b/bizinikiwi/pezframe/revive/src/evm/tx_extension.rs @@ -23,12 +23,12 @@ use pezframe_support::{ pezpallet_prelude::{InvalidTransaction, TransactionSource}, DebugNoBound, DefaultNoBound, }; -use scale_info::TypeInfo; use pezsp_runtime::{ impl_tx_ext_default, traits::{DispatchInfoOf, TransactionExtension, ValidateResult}, Weight, }; +use scale_info::TypeInfo; /// An extension that sets the origin to [`Origin::EthTransaction`] in case it originated from an /// eth transaction. diff --git a/bizinikiwi/pezframe/revive/src/exec.rs b/bizinikiwi/pezframe/revive/src/exec.rs index 6c1be2c4..b3cfd0e4 100644 --- a/bizinikiwi/pezframe/revive/src/exec.rs +++ b/bizinikiwi/pezframe/revive/src/exec.rs @@ -83,8 +83,9 @@ type VarSizedKey = BoundedVec>; const FRAME_ALWAYS_EXISTS_ON_INSTANTIATE: &str = "The return value is only `None` if no contract exists at the specified address. This cannot happen on instantiate or delegate; qed"; /// Code hash of existing account without code (keccak256 hash of empty data). -pub const EMPTY_CODE_HASH: H256 = - H256(pezsp_core::hex2array!("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")); +pub const EMPTY_CODE_HASH: H256 = H256(pezsp_core::hex2array!( + "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" +)); /// Combined key type for both fixed and variable sized storage keys. #[derive(Debug)] diff --git a/bizinikiwi/pezframe/revive/src/exec/tests.rs b/bizinikiwi/pezframe/revive/src/exec/tests.rs index 82644725..b3d781db 100644 --- a/bizinikiwi/pezframe/revive/src/exec/tests.rs +++ b/bizinikiwi/pezframe/revive/src/exec/tests.rs @@ -36,9 +36,9 @@ use assert_matches::assert_matches; use pezframe_support::{assert_err, assert_ok, parameter_types}; use pezframe_system::AccountInfo; use pezpallet_revive_uapi::ReturnFlags; -use pretty_assertions::assert_eq; use pezsp_io::hashing::keccak_256; use pezsp_runtime::DispatchError; +use pretty_assertions::assert_eq; use std::{cell::RefCell, collections::hash_map::HashMap, rc::Rc}; type System = pezframe_system::Pezpallet; diff --git a/bizinikiwi/pezframe/revive/src/impl_fungibles.rs b/bizinikiwi/pezframe/revive/src/impl_fungibles.rs index 7b3189f6..8c652974 100644 --- a/bizinikiwi/pezframe/revive/src/impl_fungibles.rs +++ b/bizinikiwi/pezframe/revive/src/impl_fungibles.rs @@ -42,7 +42,9 @@ use pezframe_support::{ use pezsp_core::{H160, U256}; use pezsp_runtime::{traits::AccountIdConversion, DispatchError}; -use super::{address::AddressMapper, pezpallet, Config, ContractResult, ExecConfig, Pezpallet, Weight}; +use super::{ + address::AddressMapper, pezpallet, Config, ContractResult, ExecConfig, Pezpallet, Weight, +}; use pez_ethereum_standards::IERC20; const GAS_LIMIT: Weight = Weight::from_parts(500_000_000_000, 10 * 1024 * 1024); diff --git a/bizinikiwi/pezframe/revive/src/lib.rs b/bizinikiwi/pezframe/revive/src/lib.rs index 42a944af..d9760dd3 100644 --- a/bizinikiwi/pezframe/revive/src/lib.rs +++ b/bizinikiwi/pezframe/revive/src/lib.rs @@ -84,11 +84,11 @@ use pezframe_system::{ pezpallet_prelude::{BlockNumberFor, OriginFor}, Pezpallet as System, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{BadOrigin, Bounded, Convert, Dispatchable, Saturating, UniqueSaturatedInto, Zero}, AccountId32, DispatchError, FixedPointNumber, FixedU128, }; +use scale_info::TypeInfo; pub use crate::{ address::{ @@ -107,9 +107,9 @@ pub use crate::{ pub use codec; pub use pezframe_support::{self, dispatch::DispatchInfo, traits::Time, weights::Weight}; pub use pezframe_system::{self, limits::BlockWeights}; -pub use primitives::*; pub use pezsp_core::{keccak_256, H160, H256, U256}; pub use pezsp_runtime; +pub use primitives::*; pub use weights::WeightInfo; #[cfg(doc)] @@ -171,7 +171,8 @@ pub mod pezpallet { /// The overarching event type. #[pezpallet::no_default_bounds] #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The overarching call type. #[pezpallet::no_default_bounds] @@ -950,8 +951,8 @@ pub mod pezpallet { // for transactions. Transactions are bounded to `MAX_TRANSACTION_PAYLOAD_SIZE`. // // To determine the maximum size of the receipts, we know the following: - // - (I) first receipt is stored into pezpallet storage and not given to the hasher until - // finalization. + // - (I) first receipt is stored into pezpallet storage and not given to the hasher + // until finalization. // - (II) the hasher will not consume more memory than the receipts we are giving it. // - (III) the hasher is capped by 3 x maximum entry for 3 or more transactions. // @@ -1042,8 +1043,8 @@ pub mod pezpallet { /// /// This call cannot be dispatched directly; attempting to do so will result in a failed /// transaction. It serves as a wrapper for an Ethereum transaction. When submitted, the - /// runtime converts it into a [`pezsp_runtime::generic::CheckedExtrinsic`] by recovering the - /// signer and validating the transaction. + /// runtime converts it into a [`pezsp_runtime::generic::CheckedExtrinsic`] by recovering + /// the signer and validating the transaction. #[allow(unused_variables)] #[pezpallet::call_index(0)] #[pezpallet::weight(Weight::MAX)] @@ -2597,8 +2598,8 @@ pezsp_api::decl_runtime_apis! { } } -/// This macro wraps bizinikiwi's `impl_runtime_apis!` and implements `pezpallet_revive` runtime APIs -/// and other required traits. +/// This macro wraps bizinikiwi's `impl_runtime_apis!` and implements `pezpallet_revive` runtime +/// APIs and other required traits. /// /// # Note /// diff --git a/bizinikiwi/pezframe/revive/src/migrations/v2.rs b/bizinikiwi/pezframe/revive/src/migrations/v2.rs index e91137ee..7454a316 100644 --- a/bizinikiwi/pezframe/revive/src/migrations/v2.rs +++ b/bizinikiwi/pezframe/revive/src/migrations/v2.rs @@ -108,8 +108,10 @@ impl SteppedMigration for Migration { } if !pezframe_system::Pezpallet::::account_exists(&Pezpallet::::account_id()) { - let _ = - T::Currency::mint_into(&Pezpallet::::account_id(), T::Currency::minimum_balance()); + let _ = T::Currency::mint_into( + &Pezpallet::::account_id(), + T::Currency::minimum_balance(), + ); } loop { diff --git a/bizinikiwi/pezframe/revive/src/primitives.rs b/bizinikiwi/pezframe/revive/src/primitives.rs index 169e527a..1ca60c39 100644 --- a/bizinikiwi/pezframe/revive/src/primitives.rs +++ b/bizinikiwi/pezframe/revive/src/primitives.rs @@ -25,12 +25,12 @@ use alloc::{boxed::Box, fmt::Debug, string::String, vec::Vec}; use codec::{Decode, Encode, MaxEncodedLen}; use pezframe_support::weights::Weight; use pezpallet_revive_uapi::ReturnFlags; -use scale_info::TypeInfo; use pezsp_core::Get; use pezsp_runtime::{ traits::{One, Saturating, Zero}, DispatchError, RuntimeDebug, }; +use scale_info::TypeInfo; /// Result type of a `bare_call` or `bare_instantiate` call as well as `ContractsApi::call` and /// `ContractsApi::instantiate`. diff --git a/bizinikiwi/pezframe/revive/src/storage.rs b/bizinikiwi/pezframe/revive/src/storage.rs index f8a0aade..652c93e2 100644 --- a/bizinikiwi/pezframe/revive/src/storage.rs +++ b/bizinikiwi/pezframe/revive/src/storage.rs @@ -39,13 +39,13 @@ use pezframe_support::{ weights::{Weight, WeightMeter}, CloneNoBound, DebugNoBound, DefaultNoBound, }; -use scale_info::TypeInfo; use pezsp_core::{Get, H160}; use pezsp_io::KillStorageResult; use pezsp_runtime::{ traits::{Hash, Saturating, Zero}, DispatchError, RuntimeDebug, }; +use scale_info::TypeInfo; pub enum AccountIdOrAddress { /// An account that is a contract. @@ -573,7 +573,8 @@ impl DeletionQueueManager { /// /// Note: /// we use the delete counter to get the next value to read from the queue and thus don't pay - /// the cost of an extra call to `pezsp_io::storage::next_key` to lookup the next entry in the map + /// the cost of an extra call to `pezsp_io::storage::next_key` to lookup the next entry in the + /// map fn next(&mut self) -> Option> { if self.is_empty() { return None; diff --git a/bizinikiwi/pezframe/revive/src/test_utils.rs b/bizinikiwi/pezframe/revive/src/test_utils.rs index c915b4a7..5f5779e0 100644 --- a/bizinikiwi/pezframe/revive/src/test_utils.rs +++ b/bizinikiwi/pezframe/revive/src/test_utils.rs @@ -23,8 +23,8 @@ pub mod builder; pub use pezsp_runtime::AccountId32; use crate::{BalanceOf, Config}; -use pezframe_support::weights::Weight; use hex_literal::hex; +use pezframe_support::weights::Weight; use pezsp_core::H160; const fn ee_suffix(mut account: [u8; 32]) -> AccountId32 { diff --git a/bizinikiwi/pezframe/revive/src/test_utils/builder.rs b/bizinikiwi/pezframe/revive/src/test_utils/builder.rs index 55bac5ef..035fc1df 100644 --- a/bizinikiwi/pezframe/revive/src/test_utils/builder.rs +++ b/bizinikiwi/pezframe/revive/src/test_utils/builder.rs @@ -18,12 +18,12 @@ use super::{deposit_limit, GAS_LIMIT}; use crate::{ address::AddressMapper, evm::TransactionSigned, AccountIdOf, BalanceOf, Code, Config, - ContractResult, ExecConfig, ExecReturnValue, InstantiateReturnValue, OriginFor, Pezpallet, Weight, - U256, + ContractResult, ExecConfig, ExecReturnValue, InstantiateReturnValue, OriginFor, Pezpallet, + Weight, U256, }; use alloc::{vec, vec::Vec}; -use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo; use paste::paste; +use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo; use pezsp_core::H160; /// Helper macro to generate a builder for contract API calls. diff --git a/bizinikiwi/pezframe/revive/src/tests.rs b/bizinikiwi/pezframe/revive/src/tests.rs index 9aea17cf..99f3b5da 100644 --- a/bizinikiwi/pezframe/revive/src/tests.rs +++ b/bizinikiwi/pezframe/revive/src/tests.rs @@ -37,9 +37,8 @@ use crate::{ PristineCode, }; use pezframe_support::{ - assert_ok, derive_impl, + assert_ok, derive_impl, parameter_types, pezpallet_prelude::EnsureOrigin, - parameter_types, traits::{ConstU32, ConstU64, FindAuthor, OriginTrait, StorageVersion}, weights::{constants::WEIGHT_REF_TIME_PER_SECOND, FixedFee, Weight}, }; diff --git a/bizinikiwi/pezframe/revive/src/tests/block_hash.rs b/bizinikiwi/pezframe/revive/src/tests/block_hash.rs index e1363329..536f9650 100644 --- a/bizinikiwi/pezframe/revive/src/tests/block_hash.rs +++ b/bizinikiwi/pezframe/revive/src/tests/block_hash.rs @@ -86,8 +86,9 @@ fn transactions_are_captured() { builder::bare_instantiate(Code::Upload(binary.clone())).build_and_unwrap_contract(); let Contract { addr: addr2, .. } = builder::bare_instantiate(Code::Upload(gas_binary.clone())).build_and_unwrap_contract(); - let balance = - Pezpallet::::convert_native_to_evm(BalanceWithDust::new_unchecked::(100, 10)); + let balance = Pezpallet::::convert_native_to_evm(BalanceWithDust::new_unchecked::< + Test, + >(100, 10)); ::FeeInfo::deposit_txfee(::Currency::issue(5_000_000_000)); @@ -144,8 +145,9 @@ fn events_are_captured() { // Bare call must not be captured. builder::bare_instantiate(Code::Existing(code_hash)).build_and_unwrap_contract(); - let balance = - Pezpallet::::convert_native_to_evm(BalanceWithDust::new_unchecked::(100, 10)); + let balance = Pezpallet::::convert_native_to_evm(BalanceWithDust::new_unchecked::< + Test, + >(100, 10)); ::FeeInfo::deposit_txfee(::Currency::issue( 500_000_000_000, diff --git a/bizinikiwi/pezframe/revive/src/tests/pvm.rs b/bizinikiwi/pezframe/revive/src/tests/pvm.rs index e65eb46e..3b76c04a 100644 --- a/bizinikiwi/pezframe/revive/src/tests/pvm.rs +++ b/bizinikiwi/pezframe/revive/src/tests/pvm.rs @@ -59,12 +59,12 @@ use pezframe_support::{ use pezframe_system::{EventRecord, Phase}; use pezpallet_revive_fixtures::compile_module; use pezpallet_revive_uapi::{ReturnErrorCode as RuntimeReturnCode, ReturnFlags}; -use pretty_assertions::{assert_eq, assert_ne}; use pezsp_core::U256; use pezsp_io::hashing::blake2_256; use pezsp_runtime::{ testing::H256, AccountId32, BoundedVec, DispatchError, SaturatedConversion, TokenError, }; +use pretty_assertions::{assert_eq, assert_ne}; #[test] fn eth_call_transfer_with_dust_works() { @@ -76,8 +76,9 @@ fn eth_call_transfer_with_dust_works() { ::FeeInfo::deposit_txfee(::Currency::issue(5_000_000_000)); - let balance = - Pezpallet::::convert_native_to_evm(BalanceWithDust::new_unchecked::(100, 10)); + let balance = Pezpallet::::convert_native_to_evm(BalanceWithDust::new_unchecked::< + Test, + >(100, 10)); assert_ok!(builder::eth_call(addr) .origin(Origin::EthTransaction(ALICE).into()) .value(balance) @@ -127,8 +128,9 @@ fn contract_call_transfer_with_dust_works() { let Contract { addr: addr_callee, .. } = builder::bare_instantiate(Code::Upload(binary_callee)).build_and_unwrap_contract(); - let balance = - Pezpallet::::convert_native_to_evm(BalanceWithDust::new_unchecked::(100, 10)); + let balance = Pezpallet::::convert_native_to_evm(BalanceWithDust::new_unchecked::< + Test, + >(100, 10)); assert_ok!(builder::call(addr_caller).data((balance, addr_callee).encode()).build()); assert_eq!(Pezpallet::::evm_balance(&addr_callee), balance); @@ -3296,7 +3298,8 @@ fn read_only_call_cannot_transfer() { assert_err_ignore_postinfo!( builder::call(addr_caller) .data( - (addr_callee, pezpallet_revive_uapi::CallFlags::READ_ONLY.bits(), 100u64).encode() + (addr_callee, pezpallet_revive_uapi::CallFlags::READ_ONLY.bits(), 100u64) + .encode() ) .build(), >::StateChangeDenied @@ -5203,7 +5206,8 @@ fn get_set_immutables_works() { let new_data = [0xdeu8; 8].to_vec(); - Pezpallet::::set_immutables(addr, BoundedVec::truncate_from(new_data.clone())).unwrap(); + Pezpallet::::set_immutables(addr, BoundedVec::truncate_from(new_data.clone())) + .unwrap(); let immutable_data = Pezpallet::::get_immutables(addr).unwrap(); assert_eq!(immutable_data, new_data); }); diff --git a/bizinikiwi/pezframe/revive/src/tests/sol.rs b/bizinikiwi/pezframe/revive/src/tests/sol.rs index d9e4a821..cc0330cc 100644 --- a/bizinikiwi/pezframe/revive/src/tests/sol.rs +++ b/bizinikiwi/pezframe/revive/src/tests/sol.rs @@ -27,7 +27,8 @@ use crate::{ AllowEvmBytecode, DebugFlag, ExtBuilder, RuntimeOrigin, Test, }, tracing::trace, - Code, Config, Error, EthBlockBuilderFirstValues, GenesisConfig, Origin, Pezpallet, PristineCode, + Code, Config, Error, EthBlockBuilderFirstValues, GenesisConfig, Origin, Pezpallet, + PristineCode, }; use alloy_core::sol_types::{SolCall, SolInterface}; use pezframe_support::{ diff --git a/bizinikiwi/pezframe/revive/src/tests/sol/block_info.rs b/bizinikiwi/pezframe/revive/src/tests/sol/block_info.rs index a04f5a7f..f0c0b4bf 100644 --- a/bizinikiwi/pezframe/revive/src/tests/sol/block_info.rs +++ b/bizinikiwi/pezframe/revive/src/tests/sol/block_info.rs @@ -27,8 +27,8 @@ use crate::{ use alloy_core::sol_types::{SolCall, SolInterface}; use pezframe_support::traits::fungible::Mutate; use pezpallet_revive_fixtures::{compile_module_with_type, BlockInfo, FixtureType}; -use pretty_assertions::assert_eq; use pezsp_core::H160; +use pretty_assertions::assert_eq; use test_case::test_case; /// Tests that the blocknumber opcode works as expected. diff --git a/bizinikiwi/pezframe/revive/src/tests/sol/contract.rs b/bizinikiwi/pezframe/revive/src/tests/sol/contract.rs index 047b1ce6..c20e2b6e 100644 --- a/bizinikiwi/pezframe/revive/src/tests/sol/contract.rs +++ b/bizinikiwi/pezframe/revive/src/tests/sol/contract.rs @@ -33,8 +33,8 @@ use alloy_core::{ use pezframe_support::{assert_err, traits::fungible::Mutate}; use pezpallet_revive_fixtures::{compile_module_with_type, Callee, Caller, FixtureType}; use pezpallet_revive_uapi::ReturnFlags; -use pretty_assertions::assert_eq; use pezsp_core::H160; +use pretty_assertions::assert_eq; use test_case::test_case; /// Tests that the `CALL` opcode works as expected by having one contract call another. diff --git a/bizinikiwi/pezframe/revive/src/tests/sol/system.rs b/bizinikiwi/pezframe/revive/src/tests/sol/system.rs index 54f44f85..bbb22988 100644 --- a/bizinikiwi/pezframe/revive/src/tests/sol/system.rs +++ b/bizinikiwi/pezframe/revive/src/tests/sol/system.rs @@ -28,10 +28,10 @@ use pezframe_support::traits::fungible::{Balanced, Mutate}; use pezpallet_revive_fixtures::{ compile_module_with_type, Callee, FixtureType, System as SystemFixture, }; -use pretty_assertions::assert_eq; -use revm::primitives::Bytes; use pezsp_core::H160; use pezsp_io::hashing::keccak_256; +use pretty_assertions::assert_eq; +use revm::primitives::Bytes; use test_case::test_case; #[test_case(FixtureType::Solc)] diff --git a/bizinikiwi/pezframe/revive/src/tests/sol/tx_info.rs b/bizinikiwi/pezframe/revive/src/tests/sol/tx_info.rs index 79b24a39..9235bf5c 100644 --- a/bizinikiwi/pezframe/revive/src/tests/sol/tx_info.rs +++ b/bizinikiwi/pezframe/revive/src/tests/sol/tx_info.rs @@ -25,8 +25,8 @@ use crate::{ use alloy_core::sol_types::{SolCall, SolInterface}; use pezframe_support::traits::fungible::Mutate; use pezpallet_revive_fixtures::{compile_module_with_type, FixtureType, TransactionInfo}; -use pretty_assertions::assert_eq; use pezsp_core::H160; +use pretty_assertions::assert_eq; use test_case::test_case; /// Tests that the gasprice opcode works as expected. diff --git a/bizinikiwi/pezframe/revive/src/vm/evm/instructions/block_info.rs b/bizinikiwi/pezframe/revive/src/vm/evm/instructions/block_info.rs index ac7cf9bd..b101fe66 100644 --- a/bizinikiwi/pezframe/revive/src/vm/evm/instructions/block_info.rs +++ b/bizinikiwi/pezframe/revive/src/vm/evm/instructions/block_info.rs @@ -23,8 +23,8 @@ use crate::{ Error, RuntimeCosts, }; use core::ops::ControlFlow; -use revm::interpreter::gas::BASE; use pezsp_core::U256; +use revm::interpreter::gas::BASE; /// EIP-1344: ChainID opcode pub fn chainid(interpreter: &mut Interpreter) -> ControlFlow { diff --git a/bizinikiwi/pezframe/revive/src/vm/evm/instructions/contract/call_helpers.rs b/bizinikiwi/pezframe/revive/src/vm/evm/instructions/contract/call_helpers.rs index c2971519..985f56c2 100644 --- a/bizinikiwi/pezframe/revive/src/vm/evm/instructions/contract/call_helpers.rs +++ b/bizinikiwi/pezframe/revive/src/vm/evm/instructions/contract/call_helpers.rs @@ -24,8 +24,8 @@ use crate::{ Pezpallet, RuntimeCosts, }; use core::ops::{ControlFlow, Range}; -use revm::interpreter::interpreter_action::CallScheme; use pezsp_core::{H160, U256}; +use revm::interpreter::interpreter_action::CallScheme; /// Gets memory input and output ranges for call instructions. pub fn get_memory_in_and_out_ranges<'a, E: Ext>( diff --git a/bizinikiwi/pezframe/revive/src/vm/evm/instructions/system.rs b/bizinikiwi/pezframe/revive/src/vm/evm/instructions/system.rs index 33f9f122..2bbcae1d 100644 --- a/bizinikiwi/pezframe/revive/src/vm/evm/instructions/system.rs +++ b/bizinikiwi/pezframe/revive/src/vm/evm/instructions/system.rs @@ -25,9 +25,9 @@ use crate::{ Config, Error, U256, }; use core::ops::ControlFlow; -use revm::interpreter::gas::{BASE, VERYLOW}; use pezsp_core::H256; use pezsp_io::hashing::keccak_256; +use revm::interpreter::gas::{BASE, VERYLOW}; // TODO: Fix the gas handling for the memory operations /// The Keccak-256 hash of the empty string `""`. diff --git a/bizinikiwi/pezframe/revive/src/vm/mod.rs b/bizinikiwi/pezframe/revive/src/vm/mod.rs index 4fbe6dc2..19fb6c8a 100644 --- a/bizinikiwi/pezframe/revive/src/vm/mod.rs +++ b/bizinikiwi/pezframe/revive/src/vm/mod.rs @@ -26,8 +26,8 @@ pub use runtime_costs::RuntimeCosts; use crate::{ exec::{ExecResult, Executable, ExportedFunction, Ext}, - pezframe_support::{ensure, error::BadOrigin}, gas::{GasMeter, Token}, + pezframe_support::{ensure, error::BadOrigin}, storage::meter::NestedMeter, weights::WeightInfo, AccountIdOf, BalanceOf, CodeInfoOf, CodeRemoved, Config, Error, ExecConfig, ExecError, diff --git a/bizinikiwi/pezframe/root-offences/src/lib.rs b/bizinikiwi/pezframe/root-offences/src/lib.rs index 1c8b8b3c..96267048 100644 --- a/bizinikiwi/pezframe/root-offences/src/lib.rs +++ b/bizinikiwi/pezframe/root-offences/src/lib.rs @@ -89,7 +89,8 @@ pub mod pezpallet { + pezpallet_session::historical::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The offence handler provided by the runtime. /// @@ -225,8 +226,8 @@ pub mod pezpallet { ) { let session_index = maybe_session_index.unwrap_or_else(|| { as pezframe_support::traits::ValidatorSet< - T::AccountId, - >>::session_index() + T::AccountId, + >>::session_index() }); T::OffenceHandler::on_offence(&offenders, &slash_fraction, session_index); } diff --git a/bizinikiwi/pezframe/root-offences/src/mock.rs b/bizinikiwi/pezframe/root-offences/src/mock.rs index 8f40f491..050d4ab9 100644 --- a/bizinikiwi/pezframe/root-offences/src/mock.rs +++ b/bizinikiwi/pezframe/root-offences/src/mock.rs @@ -205,7 +205,8 @@ impl Default for ExtBuilder { impl ExtBuilder { fn build(self) -> pezsp_io::TestExternalities { - let mut storage = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); + let mut storage = + pezframe_system::GenesisConfig::::default().build_storage().unwrap(); pezpallet_balances::GenesisConfig:: { balances: vec![ diff --git a/bizinikiwi/pezframe/root-offences/src/tests.rs b/bizinikiwi/pezframe/root-offences/src/tests.rs index 3b597454..e72bd933 100644 --- a/bizinikiwi/pezframe/root-offences/src/tests.rs +++ b/bizinikiwi/pezframe/root-offences/src/tests.rs @@ -16,11 +16,11 @@ // limitations under the License. use super::*; -use pezframe_support::{assert_err, assert_noop, assert_ok}; use mock::{ active_era, advance_blocks, start_session, ExtBuilder, RootOffences, RuntimeOrigin, System, Test as T, }; +use pezframe_support::{assert_err, assert_noop, assert_ok}; use pezpallet_staking::asset; #[test] diff --git a/bizinikiwi/pezframe/root-testing/src/lib.rs b/bizinikiwi/pezframe/root-testing/src/lib.rs index 71161e22..0bd38fb8 100644 --- a/bizinikiwi/pezframe/root-testing/src/lib.rs +++ b/bizinikiwi/pezframe/root-testing/src/lib.rs @@ -19,8 +19,8 @@ //! //! Pezpallet that contains extrinsics that can be useful in testing. //! -//! NOTE: This pezpallet should only be used for testing purposes and should not be used in production -//! runtimes! +//! NOTE: This pezpallet should only be used for testing purposes and should not be used in +//! production runtimes! #![cfg_attr(not(feature = "std"), no_std)] @@ -38,7 +38,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::pezpallet] diff --git a/bizinikiwi/pezframe/safe-mode/src/benchmarking.rs b/bizinikiwi/pezframe/safe-mode/src/benchmarking.rs index 75a27f65..3eff72d4 100644 --- a/bizinikiwi/pezframe/safe-mode/src/benchmarking.rs +++ b/bizinikiwi/pezframe/safe-mode/src/benchmarking.rs @@ -100,7 +100,8 @@ mod benchmarks { assert_eq!( EnteredUntil::::get().unwrap(), - pezframe_system::Pezpallet::::block_number() + 1u32.into() + T::ExtendDuration::get() + pezframe_system::Pezpallet::::block_number() + + 1u32.into() + T::ExtendDuration::get() ); Ok(()) } @@ -161,7 +162,9 @@ mod benchmarks { assert!(SafeMode::::do_exit(ExitReason::Force).is_ok()); pezframe_system::Pezpallet::::set_block_number(delay + One::one() + 2u32.into()); - pezframe_system::Pezpallet::::on_initialize(pezframe_system::Pezpallet::::block_number()); + pezframe_system::Pezpallet::::on_initialize( + pezframe_system::Pezpallet::::block_number(), + ); SafeMode::::on_initialize(pezframe_system::Pezpallet::::block_number()); #[extrinsic_call] @@ -197,7 +200,9 @@ mod benchmarks { pezframe_system::Pezpallet::::set_block_number( pezframe_system::Pezpallet::::block_number() + One::one(), ); - pezframe_system::Pezpallet::::on_initialize(pezframe_system::Pezpallet::::block_number()); + pezframe_system::Pezpallet::::on_initialize( + pezframe_system::Pezpallet::::block_number(), + ); SafeMode::::on_initialize(pezframe_system::Pezpallet::::block_number()); #[extrinsic_call] diff --git a/bizinikiwi/pezframe/safe-mode/src/lib.rs b/bizinikiwi/pezframe/safe-mode/src/lib.rs index 9145efb1..90468213 100644 --- a/bizinikiwi/pezframe/safe-mode/src/lib.rs +++ b/bizinikiwi/pezframe/safe-mode/src/lib.rs @@ -86,8 +86,9 @@ use frame::{ pub use pezpallet::*; pub use weights::*; -type BalanceOf = - <::Currency as fungible::Inspect<::AccountId>>::Balance; +type BalanceOf = <::Currency as fungible::Inspect< + ::AccountId, +>>::Balance; #[frame::pezpallet] pub mod pezpallet { @@ -100,7 +101,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Currency type for this pezpallet, used for Deposits. type Currency: Inspect @@ -109,11 +111,11 @@ pub mod pezpallet { /// The hold reason when reserving funds for entering or extending the safe-mode. type RuntimeHoldReason: From; - /// Contains all runtime calls in any pezpallet that can be dispatched even while the safe-mode - /// is entered. + /// Contains all runtime calls in any pezpallet that can be dispatched even while the + /// safe-mode is entered. /// - /// The safe-mode pezpallet cannot disable it's own calls, and does not need to be explicitly - /// added here. + /// The safe-mode pezpallet cannot disable it's own calls, and does not need to be + /// explicitly added here. type WhitelistedCalls: Contains; /// For how many blocks the safe-mode will be entered by [`Pezpallet::enter`]. diff --git a/bizinikiwi/pezframe/safe-mode/src/mock.rs b/bizinikiwi/pezframe/safe-mode/src/mock.rs index a7b774b7..3b7a0877 100644 --- a/bizinikiwi/pezframe/safe-mode/src/mock.rs +++ b/bizinikiwi/pezframe/safe-mode/src/mock.rs @@ -58,7 +58,8 @@ impl pezframe_system::Config for Test { Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, MaxEncodedLen, Debug, TypeInfo, )] pub enum HoldReason { - /// The safe-mode pezpallet holds funds since an account either entered or extended the safe-mode. + /// The safe-mode pezpallet holds funds since an account either entered or extended the + /// safe-mode. SafeMode, } diff --git a/bizinikiwi/pezframe/salary/src/lib.rs b/bizinikiwi/pezframe/salary/src/lib.rs index f7455600..cbf88cf0 100644 --- a/bizinikiwi/pezframe/salary/src/lib.rs +++ b/bizinikiwi/pezframe/salary/src/lib.rs @@ -93,7 +93,10 @@ pub mod pezpallet { /// Means by which we can make payments to accounts. This also defines the currency and the /// balance which we use to denote that currency. - type Paymaster: Pay::AccountId, AssetKind = ()>; + type Paymaster: Pay< + Beneficiary = ::AccountId, + AssetKind = (), + >; /// The current membership of payees. type Members: RankedMembers::AccountId>; @@ -469,7 +472,8 @@ impl, I: 'static> #[cfg(feature = "runtime-benchmarks")] impl, I: 'static> - pezpallet_ranked_collective::BenchmarkSetup<::AccountId> for Pezpallet + pezpallet_ranked_collective::BenchmarkSetup<::AccountId> + for Pezpallet { fn ensure_member(who: &::AccountId) { Self::init(pezframe_system::RawOrigin::Signed(who.clone()).into()).unwrap(); diff --git a/bizinikiwi/pezframe/salary/src/tests/unit.rs b/bizinikiwi/pezframe/salary/src/tests/unit.rs index 984b25dc..04b97a3f 100644 --- a/bizinikiwi/pezframe/salary/src/tests/unit.rs +++ b/bizinikiwi/pezframe/salary/src/tests/unit.rs @@ -20,7 +20,9 @@ use crate as pezpallet_salary; use crate::*; use core::cell::RefCell; -use frame::{deps::pezsp_runtime::traits::Identity, testing_prelude::*, traits::tokens::ConvertRank}; +use frame::{ + deps::pezsp_runtime::traits::Identity, testing_prelude::*, traits::tokens::ConvertRank, +}; use std::collections::BTreeMap; type Block = MockBlock; diff --git a/bizinikiwi/pezframe/scheduler/src/benchmarking.rs b/bizinikiwi/pezframe/scheduler/src/benchmarking.rs index a32919e1..556e574d 100644 --- a/bizinikiwi/pezframe/scheduler/src/benchmarking.rs +++ b/bizinikiwi/pezframe/scheduler/src/benchmarking.rs @@ -474,7 +474,9 @@ mod benchmarks { let address = Lookup::::get(name).unwrap(); let (when, index) = address; let period = BlockNumberFor::::one(); - assert!(Pezpallet::::set_retry(RawOrigin::Root.into(), (when, index), 10, period).is_ok()); + assert!( + Pezpallet::::set_retry(RawOrigin::Root.into(), (when, index), 10, period).is_ok() + ); #[extrinsic_call] _(RawOrigin::Root, (when, index)); diff --git a/bizinikiwi/pezframe/scheduler/src/lib.rs b/bizinikiwi/pezframe/scheduler/src/lib.rs index d6f1cb1b..5e2a4964 100644 --- a/bizinikiwi/pezframe/scheduler/src/lib.rs +++ b/bizinikiwi/pezframe/scheduler/src/lib.rs @@ -57,8 +57,8 @@ //! //! ## Warning //! -//! This Pezpallet executes all scheduled runtime calls in the [`on_initialize`] hook. Do not execute -//! any runtime calls which should not be considered mandatory. +//! This Pezpallet executes all scheduled runtime calls in the [`on_initialize`] hook. Do not +//! execute any runtime calls which should not be considered mandatory. //! //! Please be aware that any scheduled runtime calls executed in a future block may __fail__ or may //! result in __undefined behavior__ since the runtime could have upgraded between the time of @@ -101,12 +101,12 @@ use pezframe_support::{ weights::{Weight, WeightMeter}, }; use pezframe_system::{self as system}; -use scale_info::TypeInfo; use pezsp_io::hashing::blake2_256; use pezsp_runtime::{ traits::{BadOrigin, BlockNumberProvider, Dispatchable, One, Saturating, Zero}, BoundedVec, DispatchError, RuntimeDebug, }; +use scale_info::TypeInfo; pub use pezpallet::*; pub use weights::WeightInfo; @@ -265,7 +265,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The aggregated origin which the dispatch will take. type RuntimeOrigin: OriginTrait @@ -297,8 +298,8 @@ pub mod pezpallet { /// This will be used when canceling a task, to ensure that the origin that tries /// to cancel has greater or equal privileges as the origin that created the scheduled task. /// - /// For simplicity the [`EqualPrivilegeOnly`](pezframe_support::traits::EqualPrivilegeOnly) can - /// be used. This will only check if two given origins are equal. + /// For simplicity the [`EqualPrivilegeOnly`](pezframe_support::traits::EqualPrivilegeOnly) + /// can be used. This will only check if two given origins are equal. type OriginPrivilegeCmp: PrivilegeCmp; /// The maximum number of scheduled calls in the queue for a single block. @@ -330,13 +331,13 @@ pub mod pezpallet { /// - an arbitrary value through a custom implementation of the trait /// /// Suggested values: - /// - Solo- and Relay-chains should use `pezframe_system::Pezpallet`. There are no concerns with - /// this configuration. - /// - Teyrchains should also use `pezframe_system::Pezpallet` for the time being. The scheduler - /// pezpallet is not yet ready for the case that big numbers of blocks are skipped. In an - /// *Agile Coretime* chain with relay chain number provider configured, it could otherwise - /// happen that the scheduler will not be able to catch up to its agendas, since too many - /// relay blocks are missing if the teyrchain only produces blocks rarely. + /// - Solo- and Relay-chains should use `pezframe_system::Pezpallet`. There are no concerns + /// with this configuration. + /// - Teyrchains should also use `pezframe_system::Pezpallet` for the time being. The + /// scheduler pezpallet is not yet ready for the case that big numbers of blocks are + /// skipped. In an *Agile Coretime* chain with relay chain number provider configured, it + /// could otherwise happen that the scheduler will not be able to catch up to its agendas, + /// since too many relay blocks are missing if the teyrchain only produces blocks rarely. /// /// There is currently no migration provided to "hot-swap" block number providers and it is /// therefore highly advised to stay with the default (local) values. If you still want to diff --git a/bizinikiwi/pezframe/scheduler/src/migration.rs b/bizinikiwi/pezframe/scheduler/src/migration.rs index a11b2a9e..5fa779d0 100644 --- a/bizinikiwi/pezframe/scheduler/src/migration.rs +++ b/bizinikiwi/pezframe/scheduler/src/migration.rs @@ -305,8 +305,8 @@ mod test { use super::*; use crate::mock::*; use alloc::borrow::Cow; - use pezframe_support::Hashable; use bizinikiwi_test_utils::assert_eq_uvec; + use pezframe_support::Hashable; #[test] #[allow(deprecated)] diff --git a/bizinikiwi/pezframe/scheduler/src/mock.rs b/bizinikiwi/pezframe/scheduler/src/mock.rs index 438bb646..9630dc4e 100644 --- a/bizinikiwi/pezframe/scheduler/src/mock.rs +++ b/bizinikiwi/pezframe/scheduler/src/mock.rs @@ -32,7 +32,7 @@ use pezsp_weights::constants::WEIGHT_REF_TIME_PER_SECOND; #[pezframe_support::pezpallet] pub mod logger { use super::{OriginCaller, OriginTrait}; - use pezframe_support::{pezpallet_prelude::*, parameter_types}; + use pezframe_support::{parameter_types, pezpallet_prelude::*}; use pezframe_system::pezpallet_prelude::*; parameter_types! { @@ -62,7 +62,8 @@ pub mod logger { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::event] diff --git a/bizinikiwi/pezframe/scheduler/src/tests.rs b/bizinikiwi/pezframe/scheduler/src/tests.rs index 5284e4b8..c8809098 100644 --- a/bizinikiwi/pezframe/scheduler/src/tests.rs +++ b/bizinikiwi/pezframe/scheduler/src/tests.rs @@ -22,13 +22,13 @@ use crate::mock::{ logger::{self, Threshold}, new_test_ext, root, LoggerCall, RuntimeCall, Scheduler, Test, *, }; +use bizinikiwi_test_utils::assert_eq_uvec; use pezframe_support::{ assert_err, assert_noop, assert_ok, traits::{Contains, GetStorageVersion, OnInitialize, QueryPreimage, StorePreimage}, Hashable, }; use pezsp_runtime::traits::Hash; -use bizinikiwi_test_utils::assert_eq_uvec; #[test] #[docify::export] diff --git a/bizinikiwi/pezframe/session/benchmarking/src/inner.rs b/bizinikiwi/pezframe/session/benchmarking/src/inner.rs index e3120306..cff3293c 100644 --- a/bizinikiwi/pezframe/session/benchmarking/src/inner.rs +++ b/bizinikiwi/pezframe/session/benchmarking/src/inner.rs @@ -62,7 +62,8 @@ mod benchmarks { true, RewardDestination::Staked, )?; - let v_controller = pezpallet_staking::Pezpallet::::bonded(&v_stash).ok_or("not stash")?; + let v_controller = + pezpallet_staking::Pezpallet::::bonded(&v_stash).ok_or("not stash")?; let keys = T::Keys::decode(&mut TrailingZeroInput::zeroes()).unwrap(); let proof: Vec = vec![0, 1, 2, 3]; @@ -87,7 +88,8 @@ mod benchmarks { true, RewardDestination::Staked, )?; - let v_controller = pezpallet_staking::Pezpallet::::bonded(&v_stash).ok_or("not stash")?; + let v_controller = + pezpallet_staking::Pezpallet::::bonded(&v_stash).ok_or("not stash")?; let keys = T::Keys::decode(&mut TrailingZeroInput::zeroes()).unwrap(); let proof: Vec = vec![0, 1, 2, 3]; assert_ok!(Session::::ensure_can_pay_key_deposit(&v_controller)); diff --git a/bizinikiwi/pezframe/session/src/historical/mod.rs b/bizinikiwi/pezframe/session/src/historical/mod.rs index 75371982..d1936eed 100644 --- a/bizinikiwi/pezframe/session/src/historical/mod.rs +++ b/bizinikiwi/pezframe/session/src/historical/mod.rs @@ -74,7 +74,8 @@ pub mod pezpallet { pub trait Config: pezpallet_session::Config + pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Full identification of the validator. type FullIdentification: Parameter; diff --git a/bizinikiwi/pezframe/session/src/lib.rs b/bizinikiwi/pezframe/session/src/lib.rs index 94c014df..4b8e6ccd 100644 --- a/bizinikiwi/pezframe/session/src/lib.rs +++ b/bizinikiwi/pezframe/session/src/lib.rs @@ -88,8 +88,8 @@ //! //! ### Example from the FRAME //! -//! The [Staking pezpallet](../pezpallet_staking/index.html) uses the Session pezpallet to get the validator -//! set. +//! The [Staking pezpallet](../pezpallet_staking/index.html) uses the Session pezpallet to get the +//! validator set. //! //! ``` //! use pezpallet_session as session; @@ -270,8 +270,8 @@ pub trait SessionManager { } /// End the session. /// - /// Because the session pezpallet can queue validator set the ending session can be lower than the - /// last new session index. + /// Because the session pezpallet can queue validator set the ending session can be lower than + /// the last new session index. fn end_session(end_index: SessionIndex); /// Start an already planned session. /// @@ -405,7 +405,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// A stable ID for a validator. type ValidatorId: Member @@ -673,8 +674,8 @@ pub mod pezpallet { impl Pezpallet { /// Mint enough funds into `who`, such that they can pay the session key setting deposit. /// - /// Meant to be used if any pezpallet's benchmarking code wishes to set session keys, and wants - /// to make sure it will succeed. + /// Meant to be used if any pezpallet's benchmarking code wishes to set session keys, and + /// wants to make sure it will succeed. pub fn ensure_can_pay_key_deposit(who: &T::AccountId) -> Result<(), DispatchError> { use pezframe_support::traits::tokens::{Fortitude, Preservation}; let deposit = T::KeyDeposit::get(); diff --git a/bizinikiwi/pezframe/session/src/migrations/historical.rs b/bizinikiwi/pezframe/session/src/migrations/historical.rs index 0c037932..146072c5 100644 --- a/bizinikiwi/pezframe/session/src/migrations/historical.rs +++ b/bizinikiwi/pezframe/session/src/migrations/historical.rs @@ -60,7 +60,8 @@ pub fn migrate::storage_prefix(); + let storage_prefix = + pezpallet_session_historical::HistoricalSessions::::storage_prefix(); pezframe_support::storage::migration::move_storage_from_pallet( storage_prefix, OLD_PREFIX.as_bytes(), @@ -100,7 +101,8 @@ pub fn pre_migrate< let storage_prefix_historical_sessions = pezpallet_session_historical::HistoricalSessions::::storage_prefix(); - let storage_prefix_stored_range = pezpallet_session_historical::StoredRange::::storage_prefix(); + let storage_prefix_stored_range = + pezpallet_session_historical::StoredRange::::storage_prefix(); log_migration("pre-migration", storage_prefix_historical_sessions, OLD_PREFIX, new_pallet_name); log_migration("pre-migration", storage_prefix_stored_range, OLD_PREFIX, new_pallet_name); @@ -136,7 +138,8 @@ pub fn post_migrate< let storage_prefix_historical_sessions = pezpallet_session_historical::HistoricalSessions::::storage_prefix(); - let storage_prefix_stored_range = pezpallet_session_historical::StoredRange::::storage_prefix(); + let storage_prefix_stored_range = + pezpallet_session_historical::StoredRange::::storage_prefix(); log_migration( "post-migration", diff --git a/bizinikiwi/pezframe/society/src/lib.rs b/bizinikiwi/pezframe/society/src/lib.rs index 7752338f..7a3d397b 100644 --- a/bizinikiwi/pezframe/society/src/lib.rs +++ b/bizinikiwi/pezframe/society/src/lib.rs @@ -274,11 +274,6 @@ use pezframe_support::{ use pezframe_system::pezpallet_prelude::{ ensure_signed, BlockNumberFor as SystemBlockNumberFor, OriginFor, }; -use rand_chacha::{ - rand_core::{RngCore, SeedableRng}, - ChaChaRng, -}; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{ AccountIdConversion, CheckedAdd, CheckedSub, Hash, Saturating, StaticLookup, @@ -287,6 +282,11 @@ use pezsp_runtime::{ ArithmeticError::Overflow, Percent, RuntimeDebug, }; +use rand_chacha::{ + rand_core::{RngCore, SeedableRng}, + ChaChaRng, +}; +use scale_info::TypeInfo; pub use weights::WeightInfo; diff --git a/bizinikiwi/pezframe/society/src/migrations.rs b/bizinikiwi/pezframe/society/src/migrations.rs index 8a6ab4e9..2b20bc28 100644 --- a/bizinikiwi/pezframe/society/src/migrations.rs +++ b/bizinikiwi/pezframe/society/src/migrations.rs @@ -94,8 +94,9 @@ impl< } } -/// [`VersionUncheckedMigrateToV2`] wrapped in a [`pezframe_support::migrations::VersionedMigration`], -/// ensuring the migration is only performed when on-chain version is 0. +/// [`VersionUncheckedMigrateToV2`] wrapped in a +/// [`pezframe_support::migrations::VersionedMigration`], ensuring the migration is only performed +/// when on-chain version is 0. pub type MigrateToV2 = pezframe_support::migrations::VersionedMigration< 0, 2, diff --git a/bizinikiwi/pezframe/src/lib.rs b/bizinikiwi/pezframe/src/lib.rs index ff8a985c..fbedf7a9 100644 --- a/bizinikiwi/pezframe/src/lib.rs +++ b/bizinikiwi/pezframe/src/lib.rs @@ -40,8 +40,8 @@ //! 3. Accessing frame/bizinikiwi dependencies directly: `deps`. //! //! The main intended use of this crate is through preludes, which re-export most of the components -//! needed for pezpallet development. Domain-specific modules serve as a backup for organization, and -//! `deps` provides direct access to all dependencies if needed. +//! needed for pezpallet development. Domain-specific modules serve as a backup for organization, +//! and `deps` provides direct access to all dependencies if needed. //! //! //! ### Example Usage @@ -150,8 +150,8 @@ pub use pezframe_support::storage_alias; /// Macros used within the main [`pezpallet`] macro. /// -/// Note: All of these macros are "stubs" and not really usable outside `#[pezpallet] mod pezpallet { .. -/// }`. They are mainly provided for documentation and IDE support. +/// Note: All of these macros are "stubs" and not really usable outside `#[pezpallet] mod pezpallet +/// { .. }`. They are mainly provided for documentation and IDE support. /// /// To view a list of all the macros and their documentation, follow the links in the 'Re-exports' /// section below: @@ -171,7 +171,8 @@ pub mod pezpallet_macros { /// mod pezpallet {} /// ``` pub mod prelude { - /// `pezframe_system`'s parent crate, which is mandatory in all pallets build with this crate. + /// `pezframe_system`'s parent crate, which is mandatory in all pallets build with this + /// crate. /// /// Conveniently, the keyword `pezframe_system` is in scope as one uses `use /// pezkuwi_sdk_frame::prelude::*`. @@ -261,7 +262,9 @@ pub mod try_runtime { #[cfg(feature = "runtime-benchmarks")] pub mod benchmarking { mod shared { - pub use pezframe_benchmarking::{add_benchmark, v1::account, whitelist, whitelisted_caller}; + pub use pezframe_benchmarking::{ + add_benchmark, v1::account, whitelist, whitelisted_caller, + }; // all benchmarking functions. pub use pezframe_benchmarking::benchmarking::*; // The system origin, which is very often needed in benchmarking code. Might be tricky only @@ -430,8 +433,8 @@ pub mod runtime { /// ``` // TODO: This is because of wildcard imports, and it should be not needed once we can avoid // that. Imports like that are needed because we seem to need some unknown types in the macro - // expansion. See `pezsp_session::runtime_api::*;` as one example. All runtime api decls should be - // moved to file similarly. + // expansion. See `pezsp_session::runtime_api::*;` as one example. All runtime api decls should + // be moved to file similarly. #[allow(ambiguous_glob_reexports)] pub mod apis { pub use pezframe_system_rpc_runtime_api::*; @@ -453,10 +456,10 @@ pub mod runtime { /// Some note-worthy opinions in this prelude: /// /// - `u32` block number. - /// - [`pezsp_runtime::MultiAddress`] and [`pezsp_runtime::MultiSignature`] are used as the account id - /// and signature types. This implies that this prelude can possibly used with an - /// "account-index" system (eg `pezpallet-indices`). And, in any case, it should be paired with - /// `AccountIdLookup` in [`pezframe_system::Config::Lookup`]. + /// - [`pezsp_runtime::MultiAddress`] and [`pezsp_runtime::MultiSignature`] are used as the + /// account id and signature types. This implies that this prelude can possibly used with an + /// "account-index" system (eg `pezpallet-indices`). And, in any case, it should be paired + /// with `AccountIdLookup` in [`pezframe_system::Config::Lookup`]. pub mod types_common { use pezframe_system::Config as SysConfig; use pezsp_runtime::{generic, traits, OpaqueExtrinsic}; @@ -565,6 +568,7 @@ pub mod derive { CloneNoBound, DebugNoBound, DefaultNoBound, EqNoBound, OrdNoBound, PartialEqNoBound, PartialOrdNoBound, RuntimeDebugNoBound, }; + pub use pezsp_runtime::RuntimeDebug; pub use scale_info::TypeInfo; pub use serde; /// The `serde` `Serialize`/`Deserialize` derive macros and traits. @@ -573,7 +577,6 @@ pub mod derive { /// or specify the `#[serde(crate = "PATH_TO_THIS_CRATE::serde")]` attribute that points /// to the path where serde can be found. pub use serde::{Deserialize, Serialize}; - pub use pezsp_runtime::RuntimeDebug; } /// All hashing related components. diff --git a/bizinikiwi/pezframe/staking-async/ah-client/src/lib.rs b/bizinikiwi/pezframe/staking-async/ah-client/src/lib.rs index 70f6aaf7..6fb50740 100644 --- a/bizinikiwi/pezframe/staking-async/ah-client/src/lib.rs +++ b/bizinikiwi/pezframe/staking-async/ah-client/src/lib.rs @@ -181,8 +181,8 @@ impl OperatingMode { } } -/// See `pezpallet_staking::DefaultExposureOf`. This type is the same, except it is duplicated here so -/// that an rc-runtime can use it after `pezpallet-staking` is fully removed as a dependency. +/// See `pezpallet_staking::DefaultExposureOf`. This type is the same, except it is duplicated here +/// so that an rc-runtime can use it after `pezpallet-staking` is fully removed as a dependency. pub struct DefaultExposureOf(core::marker::PhantomData); impl @@ -255,9 +255,9 @@ pub mod pezpallet { /// /// Note that in case a single session report is larger than a single DMP message, it might /// still be sent over if we use - /// [`pezpallet_staking_async_rc_client::XCMSender::split_then_send`]. This will make the size - /// of each individual message smaller, yet, it will still try and push them all to the - /// queue at the same time. + /// [`pezpallet_staking_async_rc_client::XCMSender::split_then_send`]. This will make the + /// size of each individual message smaller, yet, it will still try and push them all to + /// the queue at the same time. type MaximumValidatorsWithPoints: Get; /// A type that gives us a reliable unix timestamp. @@ -323,8 +323,9 @@ pub mod pezpallet { /// Indicates the current operating mode of the pezpallet. /// - /// This value determines how the pezpallet behaves in response to incoming and outgoing messages, - /// particularly whether it should execute logic directly, defer it, or delegate it entirely. + /// This value determines how the pezpallet behaves in response to incoming and outgoing + /// messages, particularly whether it should execute logic directly, defer it, or delegate it + /// entirely. #[pezpallet::storage] pub type Mode = StorageValue<_, OperatingMode, ValueQuery>; @@ -698,8 +699,10 @@ pub mod pezpallet { } impl - historical::SessionManager>> - for Pezpallet + historical::SessionManager< + T::AccountId, + pezsp_staking::Exposure>, + > for Pezpallet { fn new_session( new_index: pezsp_staking::SessionIndex, @@ -718,7 +721,10 @@ pub mod pezpallet { ) -> Option>)>> { if Mode::::get() == OperatingMode::Passive { T::Fallback::new_session_genesis(new_index).map(|validators| { - validators.into_iter().map(|v| (v, pezsp_staking::Exposure::default())).collect() + validators + .into_iter() + .map(|v| (v, pezsp_staking::Exposure::default())) + .collect() }) } else { None @@ -805,7 +811,9 @@ pub mod pezpallet { } } - impl pezpallet_authorship::EventHandler> for Pezpallet { + impl pezpallet_authorship::EventHandler> + for Pezpallet + { fn note_author(author: T::AccountId) { match Mode::::get() { OperatingMode::Passive => T::Fallback::note_author(author), @@ -817,9 +825,9 @@ pub mod pezpallet { impl Pezpallet { /// Hook to be called when the AssetHub migration begins. /// - /// This transitions the pezpallet into [`OperatingMode::Buffered`], meaning it will act as the - /// primary staking module on the relay chain but will buffer outgoing messages instead of - /// sending them to AssetHub. + /// This transitions the pezpallet into [`OperatingMode::Buffered`], meaning it will act as + /// the primary staking module on the relay chain but will buffer outgoing messages + /// instead of sending them to AssetHub. /// /// While in this mode, the pezpallet stops delegating to the fallback implementation and /// temporarily accumulates events for later processing. @@ -834,11 +842,11 @@ pub mod pezpallet { /// Hook to be called when the AssetHub migration is complete. /// /// This transitions the pezpallet into [`OperatingMode::Active`], meaning the counterpart - /// pezpallet on AssetHub is ready to accept incoming messages, and this pezpallet can resume - /// sending them. + /// pezpallet on AssetHub is ready to accept incoming messages, and this pezpallet can + /// resume sending them. /// - /// In this mode, the pezpallet becomes fully active and processes all staking-related events - /// directly. + /// In this mode, the pezpallet becomes fully active and processes all staking-related + /// events directly. pub fn on_migration_end() { debug_assert!( Mode::::get() == OperatingMode::Buffered, diff --git a/bizinikiwi/pezframe/staking-async/ah-client/src/mock.rs b/bizinikiwi/pezframe/staking-async/ah-client/src/mock.rs index dcfedde5..3b43cdec 100644 --- a/bizinikiwi/pezframe/staking-async/ah-client/src/mock.rs +++ b/bizinikiwi/pezframe/staking-async/ah-client/src/mock.rs @@ -108,5 +108,8 @@ impl Config for Test { #[cfg(test)] pub fn new_test_ext() -> pezsp_io::TestExternalities { - pezframe_system::GenesisConfig::::default().build_storage().unwrap().into() + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } diff --git a/bizinikiwi/pezframe/staking-async/ahm-test/src/ah/mock.rs b/bizinikiwi/pezframe/staking-async/ahm-test/src/ah/mock.rs index 3fc6d9be..58834bbf 100644 --- a/bizinikiwi/pezframe/staking-async/ahm-test/src/ah/mock.rs +++ b/bizinikiwi/pezframe/staking-async/ahm-test/src/ah/mock.rs @@ -90,7 +90,9 @@ pub(crate) fn roll_until_next_active(mut end_index: SessionIndex) -> Vec::planned_era(); let active_era = pezpallet_staking_async::session_rotation::Rotator::::active_era(); - while pezpallet_staking_async::session_rotation::Rotator::::planned_era() == planned_era { + while pezpallet_staking_async::session_rotation::Rotator::::planned_era() == + planned_era + { let report = SessionReport { end_index, activation_timestamp: None, @@ -539,7 +541,8 @@ parameter_types! { static RcClientEventsIndex: usize = 0; } -pub(crate) fn rc_client_events_since_last_call() -> Vec> { +pub(crate) fn rc_client_events_since_last_call() -> Vec> +{ let all: Vec<_> = System::events() .into_iter() .filter_map( diff --git a/bizinikiwi/pezframe/staking-async/ahm-test/src/lib.rs b/bizinikiwi/pezframe/staking-async/ahm-test/src/lib.rs index de68f898..83b64499 100644 --- a/bizinikiwi/pezframe/staking-async/ahm-test/src/lib.rs +++ b/bizinikiwi/pezframe/staking-async/ahm-test/src/lib.rs @@ -71,7 +71,10 @@ mod tests { ); // then - assert_eq!(pezframe_system::Pezpallet::::block_number(), rc::Period::get()); + assert_eq!( + pezframe_system::Pezpallet::::block_number(), + rc::Period::get() + ); }); shared::in_rc(|| { @@ -194,7 +197,8 @@ mod tests { }, true, ); - let migration_start_block_number = pezframe_system::Pezpallet::::block_number(); + let migration_start_block_number = + pezframe_system::Pezpallet::::block_number(); // ensure era is still 1 on RC. // (Session events are received by AHClient and never passed on to staking-classic once @@ -420,7 +424,10 @@ mod tests { pezpallet_staking_async::ErasRewardPoints::::get(1).total; // staking async has always been in NotForcing, not doing anything since no session // reports come in - assert_eq!(pezpallet_staking_async::ForceEra::::get(), Forcing::NotForcing); + assert_eq!( + pezpallet_staking_async::ForceEra::::get(), + Forcing::NotForcing + ); // Verify all offences were properly queued in staking-async. // Should have offences for validators 1, 2, and 5 from different sessions (all map to @@ -580,21 +587,24 @@ mod tests { // Check for unapplied slashes for all validators with any of the slash fractions // Check validator 2 slashes - let slash_v2_100_present = pezpallet_staking_async::UnappliedSlashes::::get( - 3, - (2, Perbill::from_percent(100), 0), - ) - .is_some(); - let slash_v2_90_present = pezpallet_staking_async::UnappliedSlashes::::get( - 3, - (2, Perbill::from_percent(90), 0), - ) - .is_some(); - let slash_v2_70_present = pezpallet_staking_async::UnappliedSlashes::::get( - 3, - (2, Perbill::from_percent(70), 0), - ) - .is_some(); + let slash_v2_100_present = + pezpallet_staking_async::UnappliedSlashes::::get( + 3, + (2, Perbill::from_percent(100), 0), + ) + .is_some(); + let slash_v2_90_present = + pezpallet_staking_async::UnappliedSlashes::::get( + 3, + (2, Perbill::from_percent(90), 0), + ) + .is_some(); + let slash_v2_70_present = + pezpallet_staking_async::UnappliedSlashes::::get( + 3, + (2, Perbill::from_percent(70), 0), + ) + .is_some(); let total_slashes_v2 = slash_v2_100_present as u8 + slash_v2_90_present as u8 + slash_v2_70_present as u8; @@ -605,21 +615,24 @@ mod tests { ); // Check validator 1 slashes - let slash_v1_75_present = pezpallet_staking_async::UnappliedSlashes::::get( - 3, - (1, Perbill::from_percent(75), 0), - ) - .is_some(); - let slash_v1_85_present = pezpallet_staking_async::UnappliedSlashes::::get( - 3, - (1, Perbill::from_percent(85), 0), - ) - .is_some(); - let slash_v1_65_present = pezpallet_staking_async::UnappliedSlashes::::get( - 3, - (1, Perbill::from_percent(65), 0), - ) - .is_some(); + let slash_v1_75_present = + pezpallet_staking_async::UnappliedSlashes::::get( + 3, + (1, Perbill::from_percent(75), 0), + ) + .is_some(); + let slash_v1_85_present = + pezpallet_staking_async::UnappliedSlashes::::get( + 3, + (1, Perbill::from_percent(85), 0), + ) + .is_some(); + let slash_v1_65_present = + pezpallet_staking_async::UnappliedSlashes::::get( + 3, + (1, Perbill::from_percent(65), 0), + ) + .is_some(); let total_slashes_v1 = slash_v1_75_present as u8 + slash_v1_85_present as u8 + slash_v1_65_present as u8; @@ -630,21 +643,24 @@ mod tests { ); // Check validator 5 slashes - let slash_v5_55_present = pezpallet_staking_async::UnappliedSlashes::::get( - 3, - (5, Perbill::from_percent(55), 0), - ) - .is_some(); - let slash_v5_45_present = pezpallet_staking_async::UnappliedSlashes::::get( - 3, - (5, Perbill::from_percent(45), 0), - ) - .is_some(); - let slash_v5_40_present = pezpallet_staking_async::UnappliedSlashes::::get( - 3, - (5, Perbill::from_percent(40), 0), - ) - .is_some(); + let slash_v5_55_present = + pezpallet_staking_async::UnappliedSlashes::::get( + 3, + (5, Perbill::from_percent(55), 0), + ) + .is_some(); + let slash_v5_45_present = + pezpallet_staking_async::UnappliedSlashes::::get( + 3, + (5, Perbill::from_percent(45), 0), + ) + .is_some(); + let slash_v5_40_present = + pezpallet_staking_async::UnappliedSlashes::::get( + 3, + (5, Perbill::from_percent(40), 0), + ) + .is_some(); let total_slashes_v5 = slash_v5_55_present as u8 + slash_v5_45_present as u8 + slash_v5_40_present as u8; @@ -722,9 +738,18 @@ mod tests { assert_eq!( ah::staking_events_since_last_call(), vec![ - pezpallet_staking_async::Event::PagedElectionProceeded { page: 2, result: Ok(4) }, - pezpallet_staking_async::Event::PagedElectionProceeded { page: 1, result: Ok(0) }, - pezpallet_staking_async::Event::PagedElectionProceeded { page: 0, result: Ok(0) } + pezpallet_staking_async::Event::PagedElectionProceeded { + page: 2, + result: Ok(4) + }, + pezpallet_staking_async::Event::PagedElectionProceeded { + page: 1, + result: Ok(0) + }, + pezpallet_staking_async::Event::PagedElectionProceeded { + page: 0, + result: Ok(0) + } ] ); }); diff --git a/bizinikiwi/pezframe/staking-async/ahm-test/src/rc/mock.rs b/bizinikiwi/pezframe/staking-async/ahm-test/src/rc/mock.rs index 5db845ea..8fd29fd1 100644 --- a/bizinikiwi/pezframe/staking-async/ahm-test/src/rc/mock.rs +++ b/bizinikiwi/pezframe/staking-async/ahm-test/src/rc/mock.rs @@ -387,23 +387,27 @@ pub fn historical_events_since_last_call() -> Vec Vec { - let all = pezframe_system::Pezpallet::::read_events_for_pallet::(); + let all = pezframe_system::Pezpallet::::read_events_for_pallet::< + pezpallet_offences::Event, + >(); let seen = OffenceEventsIndex::get(); OffenceEventsIndex::set(all.len()); all.into_iter().skip(seen).collect() } pub fn session_events_since_last_call() -> Vec> { - let all = - pezframe_system::Pezpallet::::read_events_for_pallet::>(); + let all = pezframe_system::Pezpallet::::read_events_for_pallet::< + pezpallet_session::Event, + >(); let seen = SessionEventsIndex::get(); SessionEventsIndex::set(all.len()); all.into_iter().skip(seen).collect() } pub fn ah_client_events_since_last_call() -> Vec> { - let all = - pezframe_system::Pezpallet::::read_events_for_pallet::>(); + let all = pezframe_system::Pezpallet::::read_events_for_pallet::< + ah_client::Event, + >(); let seen = AhClientEventsIndex::get(); AhClientEventsIndex::set(all.len()); all.into_iter().skip(seen).collect() @@ -487,7 +491,9 @@ impl ExtBuilder { (112, vec![8, 1]), ] .into_iter() - .map(|(x, y)| (x, x, INITIAL_STAKE, pezpallet_staking_async::StakerStatus::Nominator(y))); + .map(|(x, y)| { + (x, x, INITIAL_STAKE, pezpallet_staking_async::StakerStatus::Nominator(y)) + }); let stakers = validators.chain(nominators).collect::>(); let balances = stakers @@ -541,7 +547,8 @@ impl ExtBuilder { } /// Progress until `sessions`, receive a `new_validator_set` with `id`, and go forward to `sessions -/// + 1` such that it is queued in pezpallet-session. If `active`, then progress until `sessions + 2` +/// + 1` such that it is queued in pezpallet-session. If `active`, then progress until `sessions + +/// 2` /// such that it is in the active session validators. pub(crate) fn receive_validator_set_at( sessions: SessionIndex, diff --git a/bizinikiwi/pezframe/staking-async/ahm-test/src/rc/test.rs b/bizinikiwi/pezframe/staking-async/ahm-test/src/rc/test.rs index 5c2a71c9..162f9c08 100644 --- a/bizinikiwi/pezframe/staking-async/ahm-test/src/rc/test.rs +++ b/bizinikiwi/pezframe/staking-async/ahm-test/src/rc/test.rs @@ -193,7 +193,10 @@ fn upon_receiving_election_queue_and_activate_next_session() { new_validator_set: vec![1, 2, 3, 4], }; - assert_ok!(ah_client::Pezpallet::::validator_set(RuntimeOrigin::root(), report)); + assert_ok!(ah_client::Pezpallet::::validator_set( + RuntimeOrigin::root(), + report + )); // session validators are not set yet. assert!(pezpallet_session::Validators::::get().is_empty()); @@ -275,7 +278,10 @@ fn upon_receiving_election_queue_and_activate_next_session() { leftover: false, new_validator_set: vec![1, 2, 3, 5], }; - assert_ok!(ah_client::Pezpallet::::validator_set(RuntimeOrigin::root(), report)); + assert_ok!(ah_client::Pezpallet::::validator_set( + RuntimeOrigin::root(), + report + )); // rotate one more session roll_until_matches(|| pezpallet_session::CurrentIndex::::get() == 6, false); @@ -971,11 +977,14 @@ mod session_pruning { ); assert_eq!( historical_events_since_last_call(), - vec![pezpallet_session::historical::Event::::RootStored { index: i + 1 }] + vec![pezpallet_session::historical::Event::::RootStored { + index: i + 1 + }] ) } - // ensure that we have the root for these recorded in the historical session pezpallet + // ensure that we have the root for these recorded in the historical session + // pezpallet assert_eq!(pezpallet_session::historical::StoredRange::::get(), Some((2, 12))); // send back a new validator set, but with some pruning info. @@ -1374,8 +1383,9 @@ mod splitting { assert!(ah_client::ValidatorSet::::get().is_none()); assert_eq!( - pezframe_system::Pezpallet::::read_events_for_pallet::>( - ), + pezframe_system::Pezpallet::::read_events_for_pallet::< + ah_client::Event, + >(), vec![ ah_client::Event::::ValidatorSetReceived { id: 0, @@ -1435,7 +1445,9 @@ mod key_proofs { assert_eq!(pezpallet_session::historical::StoredRange::::get(), Some((2, 5))); // generate the proof for one of the validators - use pezsp_runtime::{key_types::DUMMY, testing::UintAuthorityId, traits::OpaqueKeys}; + use pezsp_runtime::{ + key_types::DUMMY, testing::UintAuthorityId, traits::OpaqueKeys, + }; let key_ids = ::key_ids(); assert_eq!(key_ids.len(), 1, "we have inserted only one key type in mock"); @@ -1444,9 +1456,11 @@ mod key_proofs { let our_key = keys.get::(key_ids[0]); assert_eq!(key_ids[0], DUMMY); - let proof = - pezpallet_session::historical::Pezpallet::::prove((DUMMY, &our_key.encode()[..])) - .unwrap(); + let proof = pezpallet_session::historical::Pezpallet::::prove(( + DUMMY, + &our_key.encode()[..], + )) + .unwrap(); assert_eq!(proof.session, 3); assert_eq!(proof.validator_count, 4); diff --git a/bizinikiwi/pezframe/staking-async/ahm-test/src/shared.rs b/bizinikiwi/pezframe/staking-async/ahm-test/src/shared.rs index 5c498094..3ef8c01c 100644 --- a/bizinikiwi/pezframe/staking-async/ahm-test/src/shared.rs +++ b/bizinikiwi/pezframe/staking-async/ahm-test/src/shared.rs @@ -89,7 +89,8 @@ pub fn migrate_state() { } // exposure - for (era, account, overview) in pezpallet_staking::ErasStakersOverview::::drain() + for (era, account, overview) in + pezpallet_staking::ErasStakersOverview::::drain() { shared::in_ah(|| { pezpallet_staking_async::ErasStakersOverview::::insert( diff --git a/bizinikiwi/pezframe/staking-async/rc-client/src/lib.rs b/bizinikiwi/pezframe/staking-async/rc-client/src/lib.rs index f4b240a5..fdfcd1a7 100644 --- a/bizinikiwi/pezframe/staking-async/rc-client/src/lib.rs +++ b/bizinikiwi/pezframe/staking-async/rc-client/src/lib.rs @@ -53,10 +53,10 @@ //! Within this pezpallet, we need to talk to the staking-async pezpallet in AH. This is done via //! [`AHStakingInterface`] trait. //! -//! The staking pezpallet in AH has no communication with session pezpallet whatsoever, therefore its -//! implementation of `SessionManager`, and it associated type `SessionInterface` no longer exists. -//! Moreover, pezpallet-staking-async no longer has a notion of timestamp locally, and only relies in -//! the timestamp passed in in the `SessionReport`. +//! The staking pezpallet in AH has no communication with session pezpallet whatsoever, therefore +//! its implementation of `SessionManager`, and it associated type `SessionInterface` no longer +//! exists. Moreover, pezpallet-staking-async no longer has a notion of timestamp locally, and only +//! relies in the timestamp passed in in the `SessionReport`. //! //! ## Shared Types //! @@ -98,8 +98,8 @@ //! //! ### Asynchronous Model //! -//! Now, if staking lives in AH and the session pezpallet lives in the relay chain, how will this look -//! like? +//! Now, if staking lives in AH and the session pezpallet lives in the relay chain, how will this +//! look like? //! //! Staking knows that by the time the relay-chain session index `3` (and later on `6` and so on) is //! _planned_, it must have already returned a validator set via XCM. @@ -144,8 +144,8 @@ macro_rules! log { /// This trait should only encapsulate our _outgoing_ communication to the RC. Any incoming /// communication comes it directly via our calls. /// -/// In a real runtime, this is implemented via XCM calls, much like how the core-time pezpallet works. -/// In a test runtime, it can be wired to direct function calls. +/// In a real runtime, this is implemented via XCM calls, much like how the core-time pezpallet +/// works. In a test runtime, it can be wired to direct function calls. pub trait SendToRelayChain { /// The validator account ids. type AccountId; @@ -168,8 +168,8 @@ impl SendToRelayChain for () { /// This trait should only encapsulate our outgoing communications. Any incoming message is handled /// with `Call`s. /// -/// In a real runtime, this is implemented via XCM calls, much like how the coretime pezpallet works. -/// In a test runtime, it can be wired to direct function call. +/// In a real runtime, this is implemented via XCM calls, much like how the coretime pezpallet +/// works. In a test runtime, it can be wired to direct function call. pub trait SendToAssetHub { /// The validator account ids. type AccountId; diff --git a/bizinikiwi/pezframe/staking-async/runtimes/preset-store/src/lib.rs b/bizinikiwi/pezframe/staking-async/runtimes/preset-store/src/lib.rs index a0061197..1a7f2474 100644 --- a/bizinikiwi/pezframe/staking-async/runtimes/preset-store/src/lib.rs +++ b/bizinikiwi/pezframe/staking-async/runtimes/preset-store/src/lib.rs @@ -15,7 +15,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Simple pezpallet that stores the preset that was used to generate the genesis state in the state. +//! Simple pezpallet that stores the preset that was used to generate the genesis state in the +//! state. #![cfg_attr(not(feature = "std"), no_std)] diff --git a/bizinikiwi/pezframe/staking-async/runtimes/rc/constants/src/lib.rs b/bizinikiwi/pezframe/staking-async/runtimes/rc/constants/src/lib.rs index 1727477b..9504512c 100644 --- a/bizinikiwi/pezframe/staking-async/runtimes/rc/constants/src/lib.rs +++ b/bizinikiwi/pezframe/staking-async/runtimes/rc/constants/src/lib.rs @@ -63,8 +63,8 @@ pub mod fee { WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }; use pezkuwi_primitives::Balance; - use smallvec::smallvec; pub use pezsp_runtime::Perbill; + use smallvec::smallvec; /// The block saturation level. Fees will be updates based on this value. pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25); diff --git a/bizinikiwi/pezframe/staking-async/runtimes/rc/src/genesis_config_presets.rs b/bizinikiwi/pezframe/staking-async/runtimes/rc/src/genesis_config_presets.rs index 0fcf1e03..1306b6b8 100644 --- a/bizinikiwi/pezframe/staking-async/runtimes/rc/src/genesis_config_presets.rs +++ b/bizinikiwi/pezframe/staking-async/runtimes/rc/src/genesis_config_presets.rs @@ -25,8 +25,8 @@ use alloc::format; use alloc::{string::ToString, vec, vec::Vec}; use core::panic; use pezframe_support::build_struct_json_patch; -use pezpallet_staking_async_rc_runtime_constants::currency::UNITS as ZGR; use pezkuwi_primitives::{AccountId, AssignmentId, SchedulerParams, ValidatorId}; +use pezpallet_staking_async_rc_runtime_constants::currency::UNITS as ZGR; use pezsp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use pezsp_consensus_babe::AuthorityId as BabeId; use pezsp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId; diff --git a/bizinikiwi/pezframe/staking-async/runtimes/rc/src/impls.rs b/bizinikiwi/pezframe/staking-async/runtimes/rc/src/impls.rs index 9981eb5e..907d80eb 100644 --- a/bizinikiwi/pezframe/staking-async/runtimes/rc/src/impls.rs +++ b/bizinikiwi/pezframe/staking-async/runtimes/rc/src/impls.rs @@ -20,9 +20,9 @@ use codec::{Decode, Encode}; use core::marker::PhantomData; use pezframe_support::pezpallet_prelude::DispatchResult; use pezframe_system::RawOrigin; -use pezpallet_staking_async_rc_runtime_constants::currency::*; use pezkuwi_primitives::Balance; use pezkuwi_runtime_common::identity_migrator::{OnReapIdentity, WeightInfo}; +use pezpallet_staking_async_rc_runtime_constants::currency::*; use xcm::{latest::prelude::*, VersionedLocation, VersionedXcm}; use xcm_executor::traits::TransactAsset; diff --git a/bizinikiwi/pezframe/staking-async/runtimes/rc/src/lib.rs b/bizinikiwi/pezframe/staking-async/runtimes/rc/src/lib.rs index 42d43c87..209521c3 100644 --- a/bizinikiwi/pezframe/staking-async/runtimes/rc/src/lib.rs +++ b/bizinikiwi/pezframe/staking-async/runtimes/rc/src/lib.rs @@ -47,17 +47,6 @@ use pezframe_support::{ }; pub use pezframe_system::Call as SystemCall; use pezframe_system::{EnsureRoot, EnsureSigned}; -pub use pezpallet_balances::Call as BalancesCall; -use pezpallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; -use pezpallet_identity::legacy::IdentityInfo; -use pezpallet_session::{ - disabling::{DisablingDecision, DisablingStrategy}, - historical as session_historical, -}; -use pezpallet_staking_async_ah_client::{self as ah_client}; -use pezpallet_staking_async_rc_client::{self as rc_client}; -pub use pezpallet_timestamp::Call as TimestampCall; -use pezpallet_transaction_payment::{FeeDetails, FungibleAdapter, RuntimeDispatchInfo}; use pezkuwi_primitives::{ async_backing::Constraints, slashing, AccountId, AccountIndex, ApprovalVotingParams, Balance, BlockNumber, CandidateEvent, CandidateHash, @@ -94,7 +83,17 @@ use pezkuwi_runtime_teyrchains::{ scheduler as teyrchains_scheduler, session_info as teyrchains_session_info, shared as teyrchains_shared, }; -use scale_info::TypeInfo; +pub use pezpallet_balances::Call as BalancesCall; +use pezpallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; +use pezpallet_identity::legacy::IdentityInfo; +use pezpallet_session::{ + disabling::{DisablingDecision, DisablingStrategy}, + historical as session_historical, +}; +use pezpallet_staking_async_ah_client::{self as ah_client}; +use pezpallet_staking_async_rc_client::{self as rc_client}; +pub use pezpallet_timestamp::Call as TimestampCall; +use pezpallet_transaction_payment::{FeeDetails, FungibleAdapter, RuntimeDispatchInfo}; use pezsp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use pezsp_consensus_beefy::{ ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature}, @@ -116,6 +115,7 @@ use pezsp_staking::{offence::OffenceSeverity, SessionIndex}; #[cfg(any(feature = "std", test))] use pezsp_version::NativeVersion; use pezsp_version::RuntimeVersion; +use scale_info::TypeInfo; use xcm::{ latest::prelude::*, VersionedAsset, VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm, @@ -143,7 +143,9 @@ pub mod pezpallet_reward_point_filler { use super::*; #[pezpallet::config] - pub trait Config: pezframe_system::Config + pezpallet_staking_async_ah_client::Config { + pub trait Config: + pezframe_system::Config + pezpallet_staking_async_ah_client::Config + { type FillValidatorPointsTo: Get; } @@ -192,8 +194,8 @@ use impls::ToTeyrchainIdentityReaper; // Governance and configurations. pub mod governance; use governance::{ - pezpallet_custom_origins, AuctionAdmin, FellowshipAdmin, GeneralAdmin, LeaseAdmin, StakingAdmin, - Treasurer, TreasurySpender, + pezpallet_custom_origins, AuctionAdmin, FellowshipAdmin, GeneralAdmin, LeaseAdmin, + StakingAdmin, Treasurer, TreasurySpender, }; #[cfg(test)] @@ -236,10 +238,10 @@ pub fn native_version() -> NativeVersion { NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } } -/// A type to identify calls to the Identity pezpallet. These will be filtered to prevent invocation, -/// locking the state of the pezpallet and preventing further updates to identities and sub-identities. -/// The locked state will be the genesis state of a new system chain and then removed from the Relay -/// Chain. +/// A type to identify calls to the Identity pezpallet. These will be filtered to prevent +/// invocation, locking the state of the pezpallet and preventing further updates to identities and +/// sub-identities. The locked state will be the genesis state of a new system chain and then +/// removed from the Relay Chain. pub struct IsIdentityCall; impl Contains for IsIdentityCall { fn contains(c: &RuntimeCall) -> bool { @@ -1743,8 +1745,8 @@ parameter_types! { impl pezpallet_migrations::Config for Runtime { type RuntimeEvent = RuntimeEvent; // For this test runtime, always use MockedMigrations to satisfy both regular and benchmark - // builds. When runtime-benchmarks is enabled on pezframe-support (via --benches), the Migrations - // type must implement MockedMigrations, but LazyMigrationV1ToV2 doesn't. + // builds. When runtime-benchmarks is enabled on pezframe-support (via --benches), the + // Migrations type must implement MockedMigrations, but LazyMigrationV1ToV2 doesn't. type Migrations = pezpallet_migrations::mock_helpers::MockedMigrations; type CursorMaxLen = ConstU32<65_536>; type IdentifierMaxLen = ConstU32<256>; diff --git a/bizinikiwi/pezframe/staking-async/runtimes/rc/src/weights/mod.rs b/bizinikiwi/pezframe/staking-async/runtimes/rc/src/weights/mod.rs index 1be55502..833655f5 100644 --- a/bizinikiwi/pezframe/staking-async/runtimes/rc/src/weights/mod.rs +++ b/bizinikiwi/pezframe/staking-async/runtimes/rc/src/weights/mod.rs @@ -17,6 +17,22 @@ pub mod pezframe_system; pub mod pezframe_system_extensions; +pub mod pezkuwi_runtime_common_assigned_slots; +pub mod pezkuwi_runtime_common_auctions; +pub mod pezkuwi_runtime_common_crowdloan; +pub mod pezkuwi_runtime_common_identity_migrator; +pub mod pezkuwi_runtime_common_paras_registrar; +pub mod pezkuwi_runtime_common_slots; +pub mod pezkuwi_runtime_teyrchains_configuration; +pub mod pezkuwi_runtime_teyrchains_coretime; +pub mod pezkuwi_runtime_teyrchains_disputes; +pub mod pezkuwi_runtime_teyrchains_disputes_slashing; +pub mod pezkuwi_runtime_teyrchains_hrmp; +pub mod pezkuwi_runtime_teyrchains_inclusion; +pub mod pezkuwi_runtime_teyrchains_initializer; +pub mod pezkuwi_runtime_teyrchains_on_demand; +pub mod pezkuwi_runtime_teyrchains_paras; +pub mod pezkuwi_runtime_teyrchains_paras_inherent; pub mod pezpallet_asset_rate; pub mod pezpallet_balances; pub mod pezpallet_beefy_mmr; @@ -41,20 +57,4 @@ pub mod pezpallet_utility; pub mod pezpallet_vesting; pub mod pezpallet_whitelist; pub mod pezpallet_xcm; -pub mod pezkuwi_runtime_common_assigned_slots; -pub mod pezkuwi_runtime_common_auctions; -pub mod pezkuwi_runtime_common_crowdloan; -pub mod pezkuwi_runtime_common_identity_migrator; -pub mod pezkuwi_runtime_common_paras_registrar; -pub mod pezkuwi_runtime_common_slots; -pub mod pezkuwi_runtime_teyrchains_configuration; -pub mod pezkuwi_runtime_teyrchains_coretime; -pub mod pezkuwi_runtime_teyrchains_disputes; -pub mod pezkuwi_runtime_teyrchains_disputes_slashing; -pub mod pezkuwi_runtime_teyrchains_hrmp; -pub mod pezkuwi_runtime_teyrchains_inclusion; -pub mod pezkuwi_runtime_teyrchains_initializer; -pub mod pezkuwi_runtime_teyrchains_on_demand; -pub mod pezkuwi_runtime_teyrchains_paras; -pub mod pezkuwi_runtime_teyrchains_paras_inherent; pub mod xcm; diff --git a/bizinikiwi/pezframe/staking-async/runtimes/rc/src/xcm_config.rs b/bizinikiwi/pezframe/staking-async/runtimes/rc/src/xcm_config.rs index bfd58646..b57a220a 100644 --- a/bizinikiwi/pezframe/staking-async/runtimes/rc/src/xcm_config.rs +++ b/bizinikiwi/pezframe/staking-async/runtimes/rc/src/xcm_config.rs @@ -29,14 +29,14 @@ use pezframe_support::{ }, }; use pezframe_system::EnsureRoot; -use pezpallet_staking_async_rc_runtime_constants::{ - currency::CENTS, system_teyrchain::*, xcm::body::FELLOWSHIP_ADMIN_INDEX, -}; -use pezpallet_xcm::XcmPassthrough; use pezkuwi_runtime_common::{ xcm_sender::{ChildTeyrchainRouter, ExponentialPrice}, ToAuthor, }; +use pezpallet_staking_async_rc_runtime_constants::{ + currency::CENTS, system_teyrchain::*, xcm::body::FELLOWSHIP_ADMIN_INDEX, +}; +use pezpallet_xcm::XcmPassthrough; use pezsp_core::ConstU32; use xcm::latest::{prelude::*, ZAGROS_GENESIS_HASH}; use xcm_builder::{ diff --git a/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/governance/mod.rs b/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/governance/mod.rs index 29a65324..a43c2cf3 100644 --- a/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/governance/mod.rs +++ b/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/governance/mod.rs @@ -27,10 +27,10 @@ use pezframe_support::{ }, }; use pezframe_system::EnsureRootWithSuccess; -use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezkuwi_runtime_common::impls::{ ContainsParts, LocatableAssetConverter, VersionedLocatableAsset, VersionedLocationConverter, }; +use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezsp_runtime::{traits::IdentityLookup, Percent}; use xcm::latest::{ prelude::{InteriorLocation, PalletInstance}, diff --git a/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/lib.rs b/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/lib.rs index 1615a501..85760a4d 100644 --- a/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/lib.rs +++ b/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/lib.rs @@ -44,7 +44,12 @@ use assets_common::{ AssetIdForPoolAssets, AssetIdForPoolAssetsConvert, AssetIdForTrustBackedAssetsConvert, }; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use pezcumulus_pezpallet_teyrchain_system::{RelayNumberMonotonicallyIncreases, RelaychainDataProvider}; +use governance::{ + pezpallet_custom_origins, FellowshipAdmin, GeneralAdmin, StakingAdmin, Treasurer, +}; +use pezcumulus_pezpallet_teyrchain_system::{ + RelayNumberMonotonicallyIncreases, RelaychainDataProvider, +}; use pezcumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use pezframe_support::{ construct_runtime, derive_impl, @@ -66,12 +71,11 @@ use pezframe_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, EnsureSigned, EnsureSignedBy, }; -use governance::{pezpallet_custom_origins, FellowshipAdmin, GeneralAdmin, StakingAdmin, Treasurer}; +use pezkuwi_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use pezpallet_asset_conversion_tx_payment::SwapAssetAdapter; use pezpallet_nfts::PalletFeatures; use pezpallet_nomination_pools::PoolId; use pezpallet_xcm::EnsureXcm; -use pezkuwi_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use pezsp_api::impl_runtime_apis; use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata}; #[cfg(any(feature = "std", test))] @@ -721,8 +725,9 @@ impl InstanceFilter for ProxyType { RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_metadata { .. }) | RuntimeCall::Uniques(pezpallet_uniques::Call::clear_metadata { .. }) | RuntimeCall::Uniques(pezpallet_uniques::Call::clear_attribute { .. }) | - RuntimeCall::Uniques(pezpallet_uniques::Call::clear_collection_metadata { .. }) | - RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_max_supply { .. }) | + RuntimeCall::Uniques( + pezpallet_uniques::Call::clear_collection_metadata { .. } + ) | RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_max_supply { .. }) | RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } ), diff --git a/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/staking.rs b/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/staking.rs index 4123482f..ff784958 100644 --- a/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/staking.rs +++ b/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/staking.rs @@ -20,10 +20,10 @@ use super::*; use pezcumulus_primitives_core::relay_chain::SessionIndex; use pezframe_election_provider_support::{ElectionDataProvider, SequentialPhragmen}; use pezframe_support::traits::{ConstU128, EitherOf}; +use pezkuwi_runtime_common::{prod_or_fast, BalanceToU256, U256ToBalance}; use pezpallet_election_provider_multi_block::{self as multi_block, SolutionAccuracyOf}; use pezpallet_staking_async::UseValidatorsMap; use pezpallet_staking_async_rc_client as rc_client; -use pezkuwi_runtime_common::{prod_or_fast, BalanceToU256, U256ToBalance}; use pezsp_core::Get; use pezsp_npos_elections::BalancingConfig; use pezsp_runtime::{ @@ -444,7 +444,8 @@ impl pezpallet_staking_async::Config for Runtime { type VoterList = VoterList; type TargetList = UseValidatorsMap; type MaxValidatorSet = MaxValidatorSet; - type NominationsQuota = pezpallet_staking_async::FixedNominationsQuota<{ MaxNominations::get() }>; + type NominationsQuota = + pezpallet_staking_async::FixedNominationsQuota<{ MaxNominations::get() }>; type MaxUnlockingChunks = pezframe_support::traits::ConstU32<32>; type HistoryDepth = ConstU32<1>; type MaxControllersInDeprecationBatch = MaxControllersInDeprecationBatch; @@ -659,7 +660,9 @@ where mod tests { use super::*; use pezframe_election_provider_support::ElectionProvider; - use pezframe_support::weights::constants::{WEIGHT_PROOF_SIZE_PER_KB, WEIGHT_REF_TIME_PER_MILLIS}; + use pezframe_support::weights::constants::{ + WEIGHT_PROOF_SIZE_PER_KB, WEIGHT_REF_TIME_PER_MILLIS, + }; use pezpallet_election_provider_multi_block::{ self as mb, signed::WeightInfo as _, unsigned::WeightInfo as _, }; diff --git a/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/weights/mod.rs b/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/weights/mod.rs index bbb14081..e93f0b17 100644 --- a/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/weights/mod.rs +++ b/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/weights/mod.rs @@ -16,10 +16,11 @@ // limitations under the License. pub mod block_weights; +pub mod extrinsic_weights; +pub mod paritydb_weights; pub mod pezcumulus_pezpallet_teyrchain_system; pub mod pezcumulus_pezpallet_weight_reclaim; pub mod pezcumulus_pezpallet_xcmp_queue; -pub mod extrinsic_weights; pub mod pezframe_system; pub mod pezframe_system_extensions; pub mod pezpallet_asset_conversion; @@ -56,7 +57,6 @@ pub mod pezpallet_vesting; pub mod pezpallet_whitelist; pub mod pezpallet_xcm; pub mod pezpallet_xcm_bridge_hub_router; -pub mod paritydb_weights; pub mod rocksdb_weights; pub mod xcm; diff --git a/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/xcm_config.rs b/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/xcm_config.rs index 2d88c0da..8eaa27ad 100644 --- a/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/xcm_config.rs +++ b/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/src/xcm_config.rs @@ -35,9 +35,9 @@ use pezframe_support::{ }, }; use pezframe_system::EnsureRoot; -use pezpallet_xcm::XcmPassthrough; use pezkuwi_runtime_common::xcm_sender::ExponentialPrice; use pezkuwi_teyrchain_primitives::primitives::Sibling; +use pezpallet_xcm::XcmPassthrough; use pezsp_runtime::traits::{AccountIdConversion, ConvertInto, TryConvertInto}; use teyrchains_common::{ xcm_config::{ @@ -300,8 +300,8 @@ pub type Barrier = TrailingSetTopicAsId< // If the message is one that immediately attempts to pay for execution, then // allow it. AllowTopLevelPaidExecutionFrom, - // Parent, its pluralities (i.e. governance bodies), relay treasury pezpallet and - // sibling teyrchains get free execution. + // Parent, its pluralities (i.e. governance bodies), relay treasury pezpallet + // and sibling teyrchains get free execution. AllowExplicitUnpaidExecutionFrom<( ParentOrParentsPlurality, Equals, @@ -321,15 +321,20 @@ pub type Barrier = TrailingSetTopicAsId< >, >; -// TODO: This calls into the Assets pezpallet's default `BalanceToAssetBalance` implementation, which -// uses the ratio of minimum balances and requires asset sufficiency. This means that purchasing -// weight within XCM programs will still use the old way, and paying fees via asset conversion will -// only be possible when transacting locally. We should add an impl of this trait that does asset -// conversion. +// TODO: This calls into the Assets pezpallet's default `BalanceToAssetBalance` implementation, +// which uses the ratio of minimum balances and requires asset sufficiency. This means that +// purchasing weight within XCM programs will still use the old way, and paying fees via asset +// conversion will only be possible when transacting locally. We should add an impl of this trait +// that does asset conversion. pub type AssetFeeAsExistentialDepositMultiplierFeeCharger = AssetFeeAsExistentialDepositMultiplier< Runtime, WeightToFee, - pezpallet_assets::BalanceToAssetBalance, + pezpallet_assets::BalanceToAssetBalance< + Balances, + Runtime, + ConvertInto, + TrustBackedAssetsInstance, + >, TrustBackedAssetsInstance, >; @@ -338,7 +343,12 @@ pub type ForeignAssetFeeAsExistentialDepositMultiplierFeeCharger = AssetFeeAsExistentialDepositMultiplier< Runtime, WeightToFee, - pezpallet_assets::BalanceToAssetBalance, + pezpallet_assets::BalanceToAssetBalance< + Balances, + Runtime, + ConvertInto, + ForeignAssetsInstance, + >, ForeignAssetsInstance, >; diff --git a/bizinikiwi/pezframe/staking-async/src/ledger.rs b/bizinikiwi/pezframe/staking-async/src/ledger.rs index 9e41d750..3f7d2e9d 100644 --- a/bizinikiwi/pezframe/staking-async/src/ledger.rs +++ b/bizinikiwi/pezframe/staking-async/src/ledger.rs @@ -32,7 +32,7 @@ //! state consistency. use crate::{ - asset, log, BalanceOf, Bonded, Config, DecodeWithMemTracking, Error, Ledger, Pezpallet, Payee, + asset, log, BalanceOf, Bonded, Config, DecodeWithMemTracking, Error, Ledger, Payee, Pezpallet, RewardDestination, Vec, VirtualStakers, }; use alloc::{collections::BTreeMap, fmt::Debug}; @@ -42,9 +42,9 @@ use pezframe_support::{ traits::{Defensive, DefensiveSaturating, Get}, BoundedVec, CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound, }; -use scale_info::TypeInfo; use pezsp_runtime::{traits::Zero, DispatchResult, Perquintill, Rounding, Saturating}; use pezsp_staking::{EraIndex, OnStakingUpdate, StakingAccount, StakingInterface}; +use scale_info::TypeInfo; /// Just a Balance/BlockNumber tuple to encode when a chunk of funds will be unlocked. #[derive( diff --git a/bizinikiwi/pezframe/staking-async/src/lib.rs b/bizinikiwi/pezframe/staking-async/src/lib.rs index 3d855a7a..36c1c4e7 100644 --- a/bizinikiwi/pezframe/staking-async/src/lib.rs +++ b/bizinikiwi/pezframe/staking-async/src/lib.rs @@ -26,8 +26,8 @@ //! * It is capable of working with a multi-page `ElectionProvider``, aka. //! `pezpallet-election-provider-multi-block`. //! -//! While `pezpallet-staking` was somewhat general-purpose, this pezpallet is absolutely NOT right from -//! the get-go: It is designed to be used ONLY in Pezkuwi/Kusama AssetHub system teyrchains. +//! While `pezpallet-staking` was somewhat general-purpose, this pezpallet is absolutely NOT right +//! from the get-go: It is designed to be used ONLY in Pezkuwi/Kusama AssetHub system teyrchains. //! //! The workings of this pezpallet can be divided into a number of subsystems, as follows. //! @@ -198,6 +198,7 @@ pub mod weights; extern crate alloc; use alloc::{vec, vec::Vec}; use codec::{Decode, DecodeWithMemTracking, Encode, HasCompact, MaxEncodedLen}; +use ledger::LedgerIntegrityState; use pezframe_election_provider_support::ElectionProvider; use pezframe_support::{ traits::{ @@ -208,14 +209,13 @@ use pezframe_support::{ WeakBoundedVec, }; use pezframe_system::pezpallet_prelude::BlockNumberFor; -use ledger::LedgerIntegrityState; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{AtLeast32BitUnsigned, One, StaticLookup, UniqueSaturatedInto}, BoundedBTreeMap, Perbill, RuntimeDebug, Saturating, }; use pezsp_staking::{EraIndex, ExposurePage, PagedExposureMetadata, SessionIndex}; pub use pezsp_staking::{Exposure, IndividualExposure, StakerStatus}; +use scale_info::TypeInfo; pub use weights::WeightInfo; // public exports @@ -246,8 +246,8 @@ pub type BoundedExposuresOf = BoundedVec< MaxWinnersPerPageOf<::ElectionProvider>, >; -/// Alias for the maximum number of winners (aka. active validators), as defined in by this pezpallet's -/// config. +/// Alias for the maximum number of winners (aka. active validators), as defined in by this +/// pezpallet's config. pub type MaxWinnersOf = ::MaxValidatorSet; /// Alias for the maximum number of winners per page, as expected by the election provider. @@ -263,7 +263,8 @@ pub type RewardPoint = u32; /// The balance type of this pezpallet. pub type BalanceOf = ::CurrencyBalance; -type PositiveImbalanceOf = Debt<::AccountId, ::Currency>; +type PositiveImbalanceOf = + Debt<::AccountId, ::Currency>; pub type NegativeImbalanceOf = Credit<::AccountId, ::Currency>; diff --git a/bizinikiwi/pezframe/staking-async/src/mock.rs b/bizinikiwi/pezframe/staking-async/src/mock.rs index 47a7f3f9..7a80f327 100644 --- a/bizinikiwi/pezframe/staking-async/src/mock.rs +++ b/bizinikiwi/pezframe/staking-async/src/mock.rs @@ -624,7 +624,8 @@ impl ExtBuilder { } fn build(self) -> pezsp_io::TestExternalities { pezsp_tracing::try_init_simple(); - let mut storage = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); + let mut storage = + pezframe_system::GenesisConfig::::default().build_storage().unwrap(); let ed = ExistentialDeposit::get(); let mut maybe_stakers = vec![]; diff --git a/bizinikiwi/pezframe/staking-async/src/pezpallet/impls.rs b/bizinikiwi/pezframe/staking-async/src/pezpallet/impls.rs index 16907c11..d2379664 100644 --- a/bizinikiwi/pezframe/staking-async/src/pezpallet/impls.rs +++ b/bizinikiwi/pezframe/staking-async/src/pezpallet/impls.rs @@ -1582,8 +1582,8 @@ impl StakingInterface for Pezpallet { } fn set_payee(stash: &Self::AccountId, reward_acc: &Self::AccountId) -> DispatchResult { - // Since virtual stakers are not allowed to compound their rewards as this pezpallet does not - // manage their locks, we do not allow reward account to be set same as stash. For + // Since virtual stakers are not allowed to compound their rewards as this pezpallet does + // not manage their locks, we do not allow reward account to be set same as stash. For // external pallets that manage the virtual bond, they can claim rewards and re-bond them. ensure!( !Self::is_virtual_staker(stash) || stash != reward_acc, diff --git a/bizinikiwi/pezframe/staking-async/src/pezpallet/mod.rs b/bizinikiwi/pezframe/staking-async/src/pezpallet/mod.rs index 759685c1..020819a0 100644 --- a/bizinikiwi/pezframe/staking-async/src/pezpallet/mod.rs +++ b/bizinikiwi/pezframe/staking-async/src/pezpallet/mod.rs @@ -25,6 +25,7 @@ use crate::{ }; use alloc::{format, vec::Vec}; use codec::Codec; +pub use impls::*; use pezframe_election_provider_support::{ElectionProvider, SortedListProvider, VoteWeight}; use pezframe_support::{ assert_ok, @@ -41,12 +42,6 @@ use pezframe_support::{ BoundedBTreeSet, BoundedVec, }; use pezframe_system::{ensure_root, ensure_signed, pezpallet_prelude::*}; -pub use impls::*; -use rand::seq::SliceRandom; -use rand_chacha::{ - rand_core::{RngCore, SeedableRng}, - ChaChaRng, -}; use pezsp_core::{sr25519::Pair as SrPair, Pair}; use pezsp_runtime::{ traits::{StaticLookup, Zero}, @@ -57,6 +52,11 @@ use pezsp_staking::{ StakingAccount::{self, Controller, Stash}, StakingInterface, }; +use rand::seq::SliceRandom; +use rand_chacha::{ + rand_core::{RngCore, SeedableRng}, + ChaChaRng, +}; mod impls; @@ -148,8 +148,8 @@ pub mod pezpallet { /// Convert a balance into a number used for election calculation. This must fit into a /// `u64` but is allowed to be sensibly lossy. The `u64` is used to communicate with the - /// [`pezframe_election_provider_support`] crate which accepts u64 numbers and does operations - /// in 128. + /// [`pezframe_election_provider_support`] crate which accepts u64 numbers and does + /// operations in 128. /// Consequently, the backward convert is used convert the u128s from sp-elections back to a /// [`BalanceOf`]. #[pezpallet::no_default_bounds] @@ -502,10 +502,10 @@ pub mod pezpallet { /// Stakers whose funds are managed by other pallets. /// - /// This pezpallet does not apply any locks on them, therefore they are only virtually bonded. They - /// are expected to be keyless accounts and hence should not be allowed to mutate their ledger - /// directly via this pezpallet. Instead, these accounts are managed by other pallets and accessed - /// via low level apis. We keep track of them to do minimal integrity checks. + /// This pezpallet does not apply any locks on them, therefore they are only virtually bonded. + /// They are expected to be keyless accounts and hence should not be allowed to mutate their + /// ledger directly via this pezpallet. Instead, these accounts are managed by other pallets + /// and accessed via low level apis. We keep track of them to do minimal integrity checks. #[pezpallet::storage] pub type VirtualStakers = CountedStorageMap<_, Twox64Concat, T::AccountId, ()>; @@ -575,8 +575,8 @@ pub mod pezpallet { /// A bounded wrapper for [`pezsp_staking::ExposurePage`]. /// /// It has `Deref` and `DerefMut` impls that map it back [`pezsp_staking::ExposurePage`] for all - /// purposes. This is done in such a way because we prefer to keep the types in [`pezsp_staking`] - /// pure, and not polluted by pezpallet-specific bounding logic. + /// purposes. This is done in such a way because we prefer to keep the types in + /// [`pezsp_staking`] pure, and not polluted by pezpallet-specific bounding logic. /// /// It encoded and decodes exactly the same as [`pezsp_staking::ExposurePage`], and provides a /// manual `MaxEncodedLen` implementation, to be used in benchmarking @@ -2084,7 +2084,9 @@ pub mod pezpallet { /// /// If all pages are claimed, it returns an error `InvalidPage`. #[pezpallet::call_index(18)] - #[pezpallet::weight(T::WeightInfo::payout_stakers_alive_staked(T::MaxExposurePageSize::get()))] + #[pezpallet::weight(T::WeightInfo::payout_stakers_alive_staked( + T::MaxExposurePageSize::get() + ))] pub fn payout_stakers( origin: OriginFor, validator_stash: T::AccountId, @@ -2420,7 +2422,9 @@ pub mod pezpallet { /// and so it should not be assumed the highest staker would be on the topmost page and vice /// versa. If rewards are not claimed in [`Config::HistoryDepth`] eras, they are lost. #[pezpallet::call_index(26)] - #[pezpallet::weight(T::WeightInfo::payout_stakers_alive_staked(T::MaxExposurePageSize::get()))] + #[pezpallet::weight(T::WeightInfo::payout_stakers_alive_staked( + T::MaxExposurePageSize::get() + ))] pub fn payout_stakers_by_page( origin: OriginFor, validator_stash: T::AccountId, @@ -2626,8 +2630,8 @@ pub mod pezpallet { /// Manually and permissionlessly applies a deferred slash for a given era. /// /// Normally, slashes are automatically applied shortly after the start of the `slash_era`. - /// The automatic application of slashes is handled by the pezpallet's internal logic, and it - /// tries to apply one slash page per block of the era. + /// The automatic application of slashes is handled by the pezpallet's internal logic, and + /// it tries to apply one slash page per block of the era. /// If for some reason, one era is not enough for applying all slash pages, the remaining /// slashes need to be manually (permissionlessly) applied. /// diff --git a/bizinikiwi/pezframe/staking-async/src/session_rotation.rs b/bizinikiwi/pezframe/staking-async/src/session_rotation.rs index ce4e2a05..684b1c0f 100644 --- a/bizinikiwi/pezframe/staking-async/src/session_rotation.rs +++ b/bizinikiwi/pezframe/staking-async/src/session_rotation.rs @@ -437,7 +437,9 @@ impl Eras { } /// Ensure the given era is either absent or currently being pruned. - pub(crate) fn era_absent_or_pruning(era: EraIndex) -> Result<(), pezsp_runtime::TryRuntimeError> { + pub(crate) fn era_absent_or_pruning( + era: EraIndex, + ) -> Result<(), pezsp_runtime::TryRuntimeError> { if Self::era_pruning_in_progress(era) { Ok(()) } else { @@ -774,7 +776,9 @@ impl Rotator { // if the cap is zero (not set), we don't cap the era duration. uncapped_era_duration } else if uncapped_era_duration > cap { - Pezpallet::::deposit_event(Event::Unexpected(UnexpectedKind::EraDurationBoundExceeded)); + Pezpallet::::deposit_event(Event::Unexpected( + UnexpectedKind::EraDurationBoundExceeded, + )); // if the cap is set, and era duration exceeds the cap, we cap the era duration to the // maximum allowed. @@ -990,7 +994,10 @@ impl EraElectionPlanner { }, Err(e) => { log!(warn, "election provider page failed due to {:?} (page: {})", e, page); - Pezpallet::::deposit_event(Event::PagedElectionProceeded { page, result: Err(0) }); + Pezpallet::::deposit_event(Event::PagedElectionProceeded { + page, + result: Err(0), + }); }, } } diff --git a/bizinikiwi/pezframe/staking-async/src/slashing.rs b/bizinikiwi/pezframe/staking-async/src/slashing.rs index a171dd0c..78c39f4f 100644 --- a/bizinikiwi/pezframe/staking-async/src/slashing.rs +++ b/bizinikiwi/pezframe/staking-async/src/slashing.rs @@ -42,18 +42,18 @@ use crate::{ asset, log, session_rotation::Eras, BalanceOf, Config, NegativeImbalanceOf, OffenceQueue, - OffenceQueueEras, PagedExposure, Pezpallet, Perbill, ProcessingOffence, SlashRewardFraction, + OffenceQueueEras, PagedExposure, Perbill, Pezpallet, ProcessingOffence, SlashRewardFraction, UnappliedSlash, UnappliedSlashes, ValidatorSlashInEra, WeightInfo, }; use alloc::vec::Vec; use codec::{Decode, Encode, MaxEncodedLen}; use pezframe_support::traits::{Defensive, DefensiveSaturating, Get, Imbalance, OnUnbalanced}; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{Saturating, Zero}, RuntimeDebug, WeakBoundedVec, Weight, }; use pezsp_staking::{EraIndex, StakingInterface}; +use scale_info::TypeInfo; /// Parameters for performing a slash. #[derive(Clone)] @@ -398,7 +398,9 @@ pub fn do_slash( slash_era: EraIndex, ) { let mut ledger = - match Pezpallet::::ledger(pezsp_staking::StakingAccount::Stash(stash.clone())).defensive() { + match Pezpallet::::ledger(pezsp_staking::StakingAccount::Stash(stash.clone())) + .defensive() + { Ok(ledger) => ledger, Err(_) => return, // nothing to do. }; @@ -425,7 +427,10 @@ pub fn do_slash( .defensive_proof("ledger fetched from storage so it exists in storage; qed."); // trigger the event - >::deposit_event(super::Event::::Slashed { staker: stash.clone(), amount: value }); + >::deposit_event(super::Event::::Slashed { + staker: stash.clone(), + amount: value, + }); } /// Apply a previously-unapplied slash. diff --git a/bizinikiwi/pezframe/staking-async/src/testing_utils.rs b/bizinikiwi/pezframe/staking-async/src/testing_utils.rs index df0e20f2..dc5a504a 100644 --- a/bizinikiwi/pezframe/staking-async/src/testing_utils.rs +++ b/bizinikiwi/pezframe/staking-async/src/testing_utils.rs @@ -21,11 +21,11 @@ use crate::{Pezpallet as Staking, *}; use pezframe_benchmarking::account; use pezframe_system::RawOrigin; +use pezsp_io::hashing::blake2_256; use rand_chacha::{ rand_core::{RngCore, SeedableRng}, ChaChaRng, }; -use pezsp_io::hashing::blake2_256; use pezframe_election_provider_support::SortedListProvider; use pezframe_support::pezpallet_prelude::*; diff --git a/bizinikiwi/pezframe/staking-async/src/tests/election_provider.rs b/bizinikiwi/pezframe/staking-async/src/tests/election_provider.rs index ad6c122f..10c2b8c6 100644 --- a/bizinikiwi/pezframe/staking-async/src/tests/election_provider.rs +++ b/bizinikiwi/pezframe/staking-async/src/tests/election_provider.rs @@ -17,9 +17,9 @@ use super::*; use crate::session_rotation::{EraElectionPlanner, Eras}; +use bizinikiwi_test_utils::assert_eq_uvec; use pezframe_support::assert_ok; use pezsp_npos_elections::Support; -use bizinikiwi_test_utils::assert_eq_uvec; use crate::tests::session_mock::ReceivedValidatorSets; diff --git a/bizinikiwi/pezframe/staking-async/src/tests/mod.rs b/bizinikiwi/pezframe/staking-async/src/tests/mod.rs index 41ca0037..82462db8 100644 --- a/bizinikiwi/pezframe/staking-async/src/tests/mod.rs +++ b/bizinikiwi/pezframe/staking-async/src/tests/mod.rs @@ -19,6 +19,8 @@ use super::*; use crate::{asset, ledger::StakingLedgerInspect, mock::Session}; +use bizinikiwi_test_utils::assert_eq_uvec; +use mock::*; use pezframe_election_provider_support::{ bounds::{DataProviderBounds, ElectionBoundsBuilder}, SortedListProvider, @@ -28,12 +30,10 @@ use pezframe_support::{ pezpallet_prelude::*, traits::{InspectLockableCurrency, ReservableCurrency}, }; -use mock::*; use pezsp_runtime::{ assert_eq_error_rate, bounded_vec, traits::BadOrigin, Perbill, Percent, TokenError, }; use pezsp_staking::{Stake, StakingAccount, StakingInterface}; -use bizinikiwi_test_utils::assert_eq_uvec; mod bonding; mod configs; diff --git a/bizinikiwi/pezframe/staking/src/ledger.rs b/bizinikiwi/pezframe/staking/src/ledger.rs index 2f140c89..cda8b16a 100644 --- a/bizinikiwi/pezframe/staking/src/ledger.rs +++ b/bizinikiwi/pezframe/staking/src/ledger.rs @@ -36,7 +36,7 @@ use pezsp_runtime::DispatchResult; use pezsp_staking::{StakingAccount, StakingInterface}; use crate::{ - asset, BalanceOf, Bonded, Config, Error, Ledger, Pezpallet, Payee, RewardDestination, + asset, BalanceOf, Bonded, Config, Error, Ledger, Payee, Pezpallet, RewardDestination, StakingLedger, VirtualStakers, }; @@ -289,7 +289,8 @@ pub struct StakingLedgerInspect { #[codec(compact)] pub active: BalanceOf, pub unlocking: pezframe_support::BoundedVec>, T::MaxUnlockingChunks>, - pub legacy_claimed_rewards: pezframe_support::BoundedVec, + pub legacy_claimed_rewards: + pezframe_support::BoundedVec, } #[cfg(test)] diff --git a/bizinikiwi/pezframe/staking/src/lib.rs b/bizinikiwi/pezframe/staking/src/lib.rs index 1c40ce98..8b6613cd 100644 --- a/bizinikiwi/pezframe/staking/src/lib.rs +++ b/bizinikiwi/pezframe/staking/src/lib.rs @@ -25,8 +25,8 @@ //! //! ## Overview //! -//! The Staking pezpallet is the means by which a set of network maintainers (known as _authorities_ in -//! some contexts and _validators_ in others) are chosen based upon those who voluntarily place +//! The Staking pezpallet is the means by which a set of network maintainers (known as _authorities_ +//! in some contexts and _validators_ in others) are chosen based upon those who voluntarily place //! funds under deposit. Under deposit, those funds are rewarded under normal operation but are held //! at pain of _slash_ (expropriation) should the staked maintainer be found not to be discharging //! its duties properly. @@ -59,11 +59,11 @@ //! //! #### Staking //! -//! Almost any interaction with the Staking pezpallet requires a process of _**bonding**_ (also known -//! as being a _staker_). To become *bonded*, a fund-holding register known as the _stash account_, -//! which holds some or all of the funds that become frozen in place as part of the staking process. -//! The controller account, which this pezpallet now assigns the stash account to, issues instructions -//! on how funds shall be used. +//! Almost any interaction with the Staking pezpallet requires a process of _**bonding**_ (also +//! known as being a _staker_). To become *bonded*, a fund-holding register known as the _stash +//! account_, which holds some or all of the funds that become frozen in place as part of the +//! staking process. The controller account, which this pezpallet now assigns the stash account to, +//! issues instructions on how funds shall be used. //! //! An account can become a bonded stash account using the [`bond`](Call::bond) call. //! @@ -108,8 +108,8 @@ //! //! #### Rewards and Slash //! -//! The **reward and slashing** procedure is the core of the Staking pezpallet, attempting to _embrace -//! valid behavior_ while _punishing any misbehavior or lack of availability_. +//! The **reward and slashing** procedure is the core of the Staking pezpallet, attempting to +//! _embrace valid behavior_ while _punishing any misbehavior or lack of availability_. //! //! Rewards must be claimed for each era before it gets too old by //! [`HistoryDepth`](`Config::HistoryDepth`) using the `payout_stakers` call. Any account can call @@ -147,8 +147,9 @@ //! //! ### Dispatchable Functions //! -//! The dispatchable functions of the Staking pezpallet enable the steps needed for entities to accept -//! and change their role, alongside some helper functions to get/set the metadata of the pezpallet. +//! The dispatchable functions of the Staking pezpallet enable the steps needed for entities to +//! accept and change their role, alongside some helper functions to get/set the metadata of the +//! pezpallet. //! //! ### Public Functions //! @@ -224,8 +225,8 @@ //! they received during the era. Points are added to a validator using the method //! [`pezframe_support::traits::RewardsReporter::reward_by_ids`] implemented by the [`Pezpallet`]. //! -//! [`Pezpallet`] implements [`pezpallet_authorship::EventHandler`] to add reward points to block producer -//! and block producer of referenced uncles. +//! [`Pezpallet`] implements [`pezpallet_authorship::EventHandler`] to add reward points to block +//! producer and block producer of referenced uncles. //! //! The validator and its nominator split their reward as following: //! @@ -275,8 +276,8 @@ //! //! ## GenesisConfig //! -//! The Staking pezpallet depends on the [`GenesisConfig`]. The `GenesisConfig` is optional and allow -//! to set some initial stakers. +//! The Staking pezpallet depends on the [`GenesisConfig`]. The `GenesisConfig` is optional and +//! allow to set some initial stakers. //! //! ## Related Modules //! @@ -321,7 +322,6 @@ use pezframe_support::{ weights::Weight, BoundedVec, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, }; -use scale_info::TypeInfo; use pezsp_runtime::{ curve::PiecewiseLinear, traits::{AtLeast32BitUnsigned, Convert, StaticLookup, Zero}, @@ -332,6 +332,7 @@ use pezsp_staking::{ EraIndex, ExposurePage, OnStakingUpdate, Page, PagedExposureMetadata, SessionIndex, }; pub use pezsp_staking::{Exposure, IndividualExposure, StakerStatus}; +use scale_info::TypeInfo; pub use weights::WeightInfo; pub use pezpallet::{pezpallet::*, UseNominatorsAndValidatorsMap, UseValidatorsMap}; @@ -350,8 +351,8 @@ macro_rules! log { }; } -/// Alias for the maximum number of winners (aka. active validators), as defined in by this pezpallet's -/// config. +/// Alias for the maximum number of winners (aka. active validators), as defined in by this +/// pezpallet's config. pub type MaxWinnersOf = ::MaxValidatorSet; /// Alias for the maximum number of winners per page, as expected by the election provider. @@ -367,7 +368,8 @@ pub type RewardPoint = u32; /// The balance type of this pezpallet. pub type BalanceOf = ::CurrencyBalance; -type PositiveImbalanceOf = Debt<::AccountId, ::Currency>; +type PositiveImbalanceOf = + Debt<::AccountId, ::Currency>; pub type NegativeImbalanceOf = Credit<::AccountId, ::Currency>; @@ -1104,8 +1106,8 @@ impl Convert /// In the new model, we don't need to identify a validator with their full exposure anymore, and /// therefore [`UnitIdentificationOf`] is perfectly fine. Yet, for runtimes that used to work with /// [`ExposureOf`], we need to be able to decode old identification data, possibly stored in the -/// historical session pezpallet in older blocks. Therefore, this type is a good compromise, allowing -/// old exposure identifications to be decoded, and returning a few zero bytes +/// historical session pezpallet in older blocks. Therefore, this type is a good compromise, +/// allowing old exposure identifications to be decoded, and returning a few zero bytes /// (`Exposure::default`) for any new identification request. /// /// A typical usage of this type is: diff --git a/bizinikiwi/pezframe/staking/src/migrations.rs b/bizinikiwi/pezframe/staking/src/migrations.rs index a0b2668c..7047142a 100644 --- a/bizinikiwi/pezframe/staking/src/migrations.rs +++ b/bizinikiwi/pezframe/staking/src/migrations.rs @@ -161,7 +161,8 @@ pub mod v15 { type DefaultDisablingStrategy = pezpallet_session::disabling::UpToLimitDisablingStrategy; #[storage_alias] - pub(crate) type DisabledValidators = StorageValue, Vec, ValueQuery>; + pub(crate) type DisabledValidators = + StorageValue, Vec, ValueQuery>; pub struct VersionUncheckedMigrateV14ToV15(core::marker::PhantomData); impl UncheckedOnRuntimeUpgrade for VersionUncheckedMigrateV14ToV15 { diff --git a/bizinikiwi/pezframe/staking/src/mock.rs b/bizinikiwi/pezframe/staking/src/mock.rs index 48ea5c17..8025320d 100644 --- a/bizinikiwi/pezframe/staking/src/mock.rs +++ b/bizinikiwi/pezframe/staking/src/mock.rs @@ -148,8 +148,9 @@ impl pezpallet_session::Config for Test { type ValidatorId = AccountId; type ValidatorIdOf = pezsp_runtime::traits::ConvertInto; type NextSessionRotation = pezpallet_session::PeriodicSessions; - type DisablingStrategy = - pezpallet_session::disabling::UpToLimitWithReEnablingDisablingStrategy; + type DisablingStrategy = pezpallet_session::disabling::UpToLimitWithReEnablingDisablingStrategy< + DISABLING_LIMIT_FACTOR, + >; type WeightInfo = (); type Currency = Balances; type KeyDeposit = (); @@ -454,7 +455,8 @@ impl ExtBuilder { } fn build(self) -> pezsp_io::TestExternalities { pezsp_tracing::try_init_simple(); - let mut storage = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); + let mut storage = + pezframe_system::GenesisConfig::::default().build_storage().unwrap(); let ed = ExistentialDeposit::get(); let _ = pezpallet_balances::GenesisConfig:: { diff --git a/bizinikiwi/pezframe/staking/src/pezpallet/impls.rs b/bizinikiwi/pezframe/staking/src/pezpallet/impls.rs index ba078d6b..fbd9565b 100644 --- a/bizinikiwi/pezframe/staking/src/pezpallet/impls.rs +++ b/bizinikiwi/pezframe/staking/src/pezpallet/impls.rs @@ -456,7 +456,9 @@ impl Pezpallet { // Initial era has been set. let current_era_start_session_index = ErasStartSessionIndex::::get(current_era) .unwrap_or_else(|| { - pezframe_support::print("Error: start_session_index must be set for current_era"); + pezframe_support::print( + "Error: start_session_index must be set for current_era", + ); 0 }); @@ -2012,8 +2014,8 @@ impl StakingInterface for Pezpallet { } fn set_payee(stash: &Self::AccountId, reward_acc: &Self::AccountId) -> DispatchResult { - // Since virtual stakers are not allowed to compound their rewards as this pezpallet does not - // manage their locks, we do not allow reward account to be set same as stash. For + // Since virtual stakers are not allowed to compound their rewards as this pezpallet does + // not manage their locks, we do not allow reward account to be set same as stash. For // external pallets that manage the virtual bond, they can claim rewards and re-bond them. ensure!( !Self::is_virtual_staker(stash) || stash != reward_acc, diff --git a/bizinikiwi/pezframe/staking/src/pezpallet/mod.rs b/bizinikiwi/pezframe/staking/src/pezpallet/mod.rs index 7c6d38f5..77f7d22c 100644 --- a/bizinikiwi/pezframe/staking/src/pezpallet/mod.rs +++ b/bizinikiwi/pezframe/staking/src/pezpallet/mod.rs @@ -134,8 +134,8 @@ pub mod pezpallet { /// Convert a balance into a number used for election calculation. This must fit into a /// `u64` but is allowed to be sensibly lossy. The `u64` is used to communicate with the - /// [`pezframe_election_provider_support`] crate which accepts u64 numbers and does operations - /// in 128. + /// [`pezframe_election_provider_support`] crate which accepts u64 numbers and does + /// operations in 128. /// Consequently, the backward convert is used convert the u128s from sp-elections back to a /// [`BalanceOf`]. #[pezpallet::no_default_bounds] @@ -192,7 +192,8 @@ pub mod pezpallet { /// The overarching event type. #[pezpallet::no_default_bounds] #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Handler for the unbalanced reduction when slashing a staker. #[pezpallet::no_default_bounds] @@ -478,10 +479,10 @@ pub mod pezpallet { /// Stakers whose funds are managed by other pallets. /// - /// This pezpallet does not apply any locks on them, therefore they are only virtually bonded. They - /// are expected to be keyless accounts and hence should not be allowed to mutate their ledger - /// directly via this pezpallet. Instead, these accounts are managed by other pallets and accessed - /// via low level apis. We keep track of them to do minimal integrity checks. + /// This pezpallet does not apply any locks on them, therefore they are only virtually bonded. + /// They are expected to be keyless accounts and hence should not be allowed to mutate their + /// ledger directly via this pezpallet. Instead, these accounts are managed by other pallets + /// and accessed via low level apis. We keep track of them to do minimal integrity checks. #[pezpallet::storage] pub type VirtualStakers = CountedStorageMap<_, Twox64Concat, T::AccountId, ()>; @@ -732,7 +733,8 @@ pub mod pezpallet { /// The last planned session scheduled by the session pezpallet. /// - /// This is basically in sync with the call to [`pezpallet_session::SessionManager::new_session`]. + /// This is basically in sync with the call to + /// [`pezpallet_session::SessionManager::new_session`]. #[pezpallet::storage] pub type CurrentPlannedSession = StorageValue<_, SessionIndex, ValueQuery>; @@ -1727,7 +1729,9 @@ pub mod pezpallet { /// /// If all pages are claimed, it returns an error `InvalidPage`. #[pezpallet::call_index(18)] - #[pezpallet::weight(T::WeightInfo::payout_stakers_alive_staked(T::MaxExposurePageSize::get()))] + #[pezpallet::weight(T::WeightInfo::payout_stakers_alive_staked( + T::MaxExposurePageSize::get() + ))] pub fn payout_stakers( origin: OriginFor, validator_stash: T::AccountId, @@ -2069,7 +2073,9 @@ pub mod pezpallet { /// and so it should not be assumed the highest staker would be on the topmost page and vice /// versa. If rewards are not claimed in [`Config::HistoryDepth`] eras, they are lost. #[pezpallet::call_index(26)] - #[pezpallet::weight(T::WeightInfo::payout_stakers_alive_staked(T::MaxExposurePageSize::get()))] + #[pezpallet::weight(T::WeightInfo::payout_stakers_alive_staked( + T::MaxExposurePageSize::get() + ))] pub fn payout_stakers_by_page( origin: OriginFor, validator_stash: T::AccountId, diff --git a/bizinikiwi/pezframe/staking/src/slashing.rs b/bizinikiwi/pezframe/staking/src/slashing.rs index 77e92741..8ff18aca 100644 --- a/bizinikiwi/pezframe/staking/src/slashing.rs +++ b/bizinikiwi/pezframe/staking/src/slashing.rs @@ -50,8 +50,8 @@ //! Based on research at use crate::{ - asset, BalanceOf, Config, Error, Exposure, NegativeImbalanceOf, NominatorSlashInEra, Pezpallet, - Perbill, SpanSlash, UnappliedSlash, ValidatorSlashInEra, + asset, BalanceOf, Config, Error, Exposure, NegativeImbalanceOf, NominatorSlashInEra, Perbill, + Pezpallet, SpanSlash, UnappliedSlash, ValidatorSlashInEra, }; use alloc::vec::Vec; use codec::{Decode, Encode, MaxEncodedLen}; @@ -60,12 +60,12 @@ use pezframe_support::{ pezpallet_prelude::DecodeWithMemTracking, traits::{Defensive, DefensiveSaturating, Imbalance, OnUnbalanced}, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{Saturating, Zero}, DispatchResult, RuntimeDebug, }; use pezsp_staking::{EraIndex, StakingInterface}; +use scale_info::TypeInfo; /// The proportion of the slashing reward to be paid out on the first slashing detection. /// This is f_1 in the paper. @@ -559,7 +559,9 @@ pub fn do_slash( slash_era: EraIndex, ) { let mut ledger = - match Pezpallet::::ledger(pezsp_staking::StakingAccount::Stash(stash.clone())).defensive() { + match Pezpallet::::ledger(pezsp_staking::StakingAccount::Stash(stash.clone())) + .defensive() + { Ok(ledger) => ledger, Err(_) => return, // nothing to do. }; @@ -586,7 +588,10 @@ pub fn do_slash( .defensive_proof("ledger fetched from storage so it exists in storage; qed."); // trigger the event - >::deposit_event(super::Event::::Slashed { staker: stash.clone(), amount: value }); + >::deposit_event(super::Event::::Slashed { + staker: stash.clone(), + amount: value, + }); } /// Apply a previously-unapplied slash. diff --git a/bizinikiwi/pezframe/staking/src/testing_utils.rs b/bizinikiwi/pezframe/staking/src/testing_utils.rs index 08f375ea..c501477c 100644 --- a/bizinikiwi/pezframe/staking/src/testing_utils.rs +++ b/bizinikiwi/pezframe/staking/src/testing_utils.rs @@ -21,11 +21,11 @@ use crate::{Pezpallet as Staking, *}; use pezframe_benchmarking::account; use pezframe_system::RawOrigin; +use pezsp_io::hashing::blake2_256; use rand_chacha::{ rand_core::{RngCore, SeedableRng}, ChaChaRng, }; -use pezsp_io::hashing::blake2_256; use pezframe_election_provider_support::SortedListProvider; use pezframe_support::pezpallet_prelude::*; diff --git a/bizinikiwi/pezframe/staking/src/tests.rs b/bizinikiwi/pezframe/staking/src/tests.rs index ee2ccdbe..5032fe58 100644 --- a/bizinikiwi/pezframe/staking/src/tests.rs +++ b/bizinikiwi/pezframe/staking/src/tests.rs @@ -19,6 +19,8 @@ use super::{ConfigOp, Event, *}; use crate::{asset, ledger::StakingLedgerInspect}; +use bizinikiwi_test_utils::assert_eq_uvec; +use mock::*; use pezframe_election_provider_support::{ bounds::{DataProviderBounds, ElectionBoundsBuilder}, ElectionProvider, SortedListProvider, Support, @@ -33,9 +35,10 @@ use pezframe_support::{ ReservableCurrency, RewardsReporter, WithdrawReasons, }, }; -use mock::*; use pezpallet_balances::Error as BalancesError; -use pezpallet_session::{disabling::UpToLimitWithReEnablingDisablingStrategy, Event as SessionEvent}; +use pezpallet_session::{ + disabling::UpToLimitWithReEnablingDisablingStrategy, Event as SessionEvent, +}; use pezsp_runtime::{ assert_eq_error_rate, bounded_vec, traits::{BadOrigin, Dispatchable}, @@ -45,7 +48,6 @@ use pezsp_staking::{ offence::{OffenceDetails, OnOffenceHandler}, SessionIndex, StakingAccount, }; -use bizinikiwi_test_utils::assert_eq_uvec; #[test] fn set_staking_configs_works() { @@ -3478,7 +3480,9 @@ fn test_multi_page_payout_stakers_by_page() { // verify rewards have been paid out but still some left assert!(pezpallet_balances::TotalIssuance::::get() > pre_payout_total_issuance); - assert!(pezpallet_balances::TotalIssuance::::get() < pre_payout_total_issuance + payout); + assert!( + pezpallet_balances::TotalIssuance::::get() < pre_payout_total_issuance + payout + ); // verify the validator has been rewarded assert!(controller_balance_after_p0_payout > controller_balance_before_p0_payout); @@ -3748,7 +3752,9 @@ fn test_multi_page_payout_stakers_backward_compatible() { // verify rewards have been paid out but still some left assert!(pezpallet_balances::TotalIssuance::::get() > pre_payout_total_issuance); - assert!(pezpallet_balances::TotalIssuance::::get() < pre_payout_total_issuance + payout); + assert!( + pezpallet_balances::TotalIssuance::::get() < pre_payout_total_issuance + payout + ); // verify the validator has been rewarded assert!(controller_balance_after_p0_payout > controller_balance_before_p0_payout); @@ -8427,8 +8433,8 @@ mod validator_disabling_integration { #[cfg(all(feature = "try-runtime", test))] mod migration_tests { use super::*; - use pezframe_support::traits::UncheckedOnRuntimeUpgrade; use migrations::{v15, v16}; + use pezframe_support::traits::UncheckedOnRuntimeUpgrade; #[test] fn migrate_v15_to_v16_with_try_runtime() { diff --git a/bizinikiwi/pezframe/state-trie-migration/src/lib.rs b/bizinikiwi/pezframe/state-trie-migration/src/lib.rs index a7ffc4c6..55b6ad64 100644 --- a/bizinikiwi/pezframe/state-trie-migration/src/lib.rs +++ b/bizinikiwi/pezframe/state-trie-migration/src/lib.rs @@ -22,8 +22,8 @@ //! //! ## Migration Types //! -//! This pezpallet provides 2 ways to do this, each of which is suited for a particular use-case, and -//! can be enabled independently. +//! This pezpallet provides 2 ways to do this, each of which is suited for a particular use-case, +//! and can be enabled independently. //! //! ### Auto migration //! @@ -43,15 +43,15 @@ //! can be a good safe alternative, if the former system is not desirable. //! //! The (minor) caveat of this approach is that we cannot know in advance how many bytes reading a -//! certain number of keys will incur. To overcome this, the runtime needs to configure this pezpallet -//! with a `SignedDepositPerItem`. This is the per-item deposit that the origin of the signed -//! migration transactions need to have in their account (on top of the normal fee) and if the size -//! witness data that they claim is incorrect, this deposit is slashed. +//! certain number of keys will incur. To overcome this, the runtime needs to configure this +//! pezpallet with a `SignedDepositPerItem`. This is the per-item deposit that the origin of the +//! signed migration transactions need to have in their account (on top of the normal fee) and if +//! the size witness data that they claim is incorrect, this deposit is slashed. //! //! --- //! -//! Initially, this pezpallet does not contain any auto migration. They must be manually enabled by the -//! `ControlOrigin`. +//! Initially, this pezpallet does not contain any auto migration. They must be manually enabled by +//! the `ControlOrigin`. #![cfg_attr(not(feature = "std"), no_std)] @@ -508,7 +508,8 @@ pub mod pezpallet { /// The overarching event type. #[pezpallet::no_default_bounds] #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The currency provider type. #[pezpallet::no_default] @@ -1730,12 +1731,12 @@ pub(crate) mod remote_tests { weights::Weight, }; use pezframe_system::{pezpallet_prelude::BlockNumberFor, Pezpallet as System}; - use remote_externalities::Mode; use pezsp_core::H256; use pezsp_runtime::{ traits::{Block as BlockT, HashingFor, Header as _, One, Zero}, DeserializeOwned, }; + use remote_externalities::Mode; use thousands::Separable; #[allow(dead_code)] @@ -1861,8 +1862,8 @@ mod remote_tests_local { remote_tests::run_with_limits, *, }; - use remote_externalities::{Mode, OfflineConfig, OnlineConfig, SnapshotConfig}; use pezsp_runtime::traits::Bounded; + use remote_externalities::{Mode, OfflineConfig, OnlineConfig, SnapshotConfig}; use std::env::var as env_var; // we only use the hash type from this, so using the mock should be fine. diff --git a/bizinikiwi/pezframe/statement/src/lib.rs b/bizinikiwi/pezframe/statement/src/lib.rs index 3c53f6ac..0b63e17f 100644 --- a/bizinikiwi/pezframe/statement/src/lib.rs +++ b/bizinikiwi/pezframe/statement/src/lib.rs @@ -21,7 +21,8 @@ //! //! ## Overview //! -//! The Statement pezpallet provides means to create and validate statements for the statement store. +//! The Statement pezpallet provides means to create and validate statements for the statement +//! store. //! //! For each statement validation function calculates the following three values based on the //! statement author balance: @@ -71,7 +72,8 @@ pub mod pezpallet { { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The currency which is used to calculate account limits. type Currency: Inspect; /// Min balance for priority statements. @@ -141,7 +143,8 @@ where log::debug!(target: LOG_TARGET, "Validating statement {:?}", statement); let account: T::AccountId = match statement.proof() { Some(Proof::OnChain { who, block_hash, event_index }) => { - if pezframe_system::Pezpallet::::parent_hash().as_ref() != block_hash.as_slice() { + if pezframe_system::Pezpallet::::parent_hash().as_ref() != block_hash.as_slice() + { log::debug!(target: LOG_TARGET, "Bad block hash."); return Err(InvalidStatement::BadProof); } @@ -207,7 +210,9 @@ where fn collect_statements() { // Find `NewStatement` events and submit them to the store - for (index, event) in pezframe_system::Pezpallet::::read_events_no_consensus().enumerate() { + for (index, event) in + pezframe_system::Pezpallet::::read_events_no_consensus().enumerate() + { if let Ok(Event::::NewStatement { account, mut statement }) = event.event.try_into() { if statement.proof().is_none() { diff --git a/bizinikiwi/pezframe/statement/src/mock.rs b/bizinikiwi/pezframe/statement/src/mock.rs index ef655ae2..d0f8328e 100644 --- a/bizinikiwi/pezframe/statement/src/mock.rs +++ b/bizinikiwi/pezframe/statement/src/mock.rs @@ -76,9 +76,15 @@ pub fn new_test_ext() -> pezsp_io::TestExternalities { let mut t = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); let balances = pezpallet_balances::GenesisConfig:: { balances: vec![ - (pezsp_core::sr25519::Pair::from_string("//Alice", None).unwrap().public().into(), 6000), ( - pezsp_core::sr25519::Pair::from_string("//Charlie", None).unwrap().public().into(), + pezsp_core::sr25519::Pair::from_string("//Alice", None).unwrap().public().into(), + 6000, + ), + ( + pezsp_core::sr25519::Pair::from_string("//Charlie", None) + .unwrap() + .public() + .into(), 500000, ), ], diff --git a/bizinikiwi/pezframe/statement/src/tests.rs b/bizinikiwi/pezframe/statement/src/tests.rs index 473fb182..201dcb3e 100644 --- a/bizinikiwi/pezframe/statement/src/tests.rs +++ b/bizinikiwi/pezframe/statement/src/tests.rs @@ -116,7 +116,8 @@ fn validate_event() { event_index: 0, block_hash: parent_hash.into(), }); - let result = Pezpallet::::validate_statement(StatementSource::Chain, statement.clone()); + let result = + Pezpallet::::validate_statement(StatementSource::Chain, statement.clone()); assert_eq!(Ok(ValidStatement { max_count: 6, max_size: 3000 }), result); // Use wrong event index @@ -125,7 +126,8 @@ fn validate_event() { event_index: 1, block_hash: parent_hash.into(), }); - let result = Pezpallet::::validate_statement(StatementSource::Chain, statement.clone()); + let result = + Pezpallet::::validate_statement(StatementSource::Chain, statement.clone()); assert_eq!(Err(InvalidStatement::BadProof), result); // Use wrong block hash @@ -134,7 +136,8 @@ fn validate_event() { event_index: 0, block_hash: pezsp_core::H256::random().into(), }); - let result = Pezpallet::::validate_statement(StatementSource::Chain, statement.clone()); + let result = + Pezpallet::::validate_statement(StatementSource::Chain, statement.clone()); assert_eq!(Err(InvalidStatement::BadProof), result); }); } diff --git a/bizinikiwi/pezframe/sudo/src/extension.rs b/bizinikiwi/pezframe/sudo/src/extension.rs index 43213ce3..d584bf62 100644 --- a/bizinikiwi/pezframe/sudo/src/extension.rs +++ b/bizinikiwi/pezframe/sudo/src/extension.rs @@ -20,7 +20,6 @@ use alloc::vec; use codec::{Decode, DecodeWithMemTracking, Encode}; use core::{fmt, marker::PhantomData}; use pezframe_support::{dispatch::DispatchInfo, ensure, pezpallet_prelude::TransactionSource}; -use scale_info::TypeInfo; use pezsp_runtime::{ impl_tx_ext_default, traits::{AsSystemOriginSigner, DispatchInfoOf, Dispatchable, Hash, TransactionExtension}, @@ -29,6 +28,7 @@ use pezsp_runtime::{ ValidTransaction, }, }; +use scale_info::TypeInfo; /// Ensure that signed transactions are only valid if they are signed by sudo account. /// diff --git a/bizinikiwi/pezframe/sudo/src/lib.rs b/bizinikiwi/pezframe/sudo/src/lib.rs index 1b56fdc8..ff3d5919 100644 --- a/bizinikiwi/pezframe/sudo/src/lib.rs +++ b/bizinikiwi/pezframe/sudo/src/lib.rs @@ -25,8 +25,8 @@ //! //! # Sudo Pezpallet //! -//! A pezpallet to provide a way to execute privileged runtime calls using a specified sudo ("superuser -//! do") account. +//! A pezpallet to provide a way to execute privileged runtime calls using a specified sudo +//! ("superuser do") account. //! //! ## Pezpallet API //! @@ -85,7 +85,8 @@ //! meant to be used by constructing runtime calls from outside the runtime. //! //! -//! This pezpallet also defines a [`TransactionExtension`](pezsp_runtime::traits::TransactionExtension) +//! This pezpallet also defines a +//! [`TransactionExtension`](pezsp_runtime::traits::TransactionExtension) //! called [`CheckOnlySudoAccount`] to ensure that only signed transactions by the sudo account are //! accepted by the transaction pool. The intended use of this signed extension is to prevent other //! accounts from spamming the transaction pool for the initial phase of a chain, during which @@ -108,11 +109,11 @@ //! //! ## Low Level / Implementation Details //! -//! This pezpallet checks that the caller of its dispatchables is a signed account and ensures that the -//! caller matches the sudo key in storage. -//! A caller of this pezpallet's dispatchables does not pay any fees to dispatch a call. If the account -//! making one of these calls is not the sudo key, the pezpallet returns a [`Error::RequireSudo`] -//! error. +//! This pezpallet checks that the caller of its dispatchables is a signed account and ensures that +//! the caller matches the sudo key in storage. +//! A caller of this pezpallet's dispatchables does not pay any fees to dispatch a call. If the +//! account making one of these calls is not the sudo key, the pezpallet returns a +//! [`Error::RequireSudo`] error. //! //! Once an origin is verified, sudo calls use `dispatch_bypass_filter` from the //! [`UnfilteredDispatchable`](pezframe_support::traits::UnfilteredDispatchable) trait to allow call @@ -176,7 +177,8 @@ pub mod pezpallet { /// The overarching event type. #[pezpallet::no_default_bounds] #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// A sudo-able call. #[pezpallet::no_default_bounds] diff --git a/bizinikiwi/pezframe/sudo/src/mock.rs b/bizinikiwi/pezframe/sudo/src/mock.rs index de50a4e2..b53de1ad 100644 --- a/bizinikiwi/pezframe/sudo/src/mock.rs +++ b/bizinikiwi/pezframe/sudo/src/mock.rs @@ -32,7 +32,8 @@ pub mod logger { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::pezpallet] @@ -140,5 +141,8 @@ pub fn new_test_ext(root_key: u64) -> pezsp_io::TestExternalities { #[cfg(feature = "runtime-benchmarks")] pub fn new_bench_ext() -> pezsp_io::TestExternalities { - pezframe_system::GenesisConfig::::default().build_storage().unwrap().into() + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } diff --git a/bizinikiwi/pezframe/sudo/src/tests.rs b/bizinikiwi/pezframe/sudo/src/tests.rs index 2925ac42..0bef5dc7 100644 --- a/bizinikiwi/pezframe/sudo/src/tests.rs +++ b/bizinikiwi/pezframe/sudo/src/tests.rs @@ -18,11 +18,11 @@ //! Tests for the module. use super::*; -use pezframe_support::{assert_noop, assert_ok, weights::Weight}; use mock::{ new_test_ext, Logger, LoggerCall, RuntimeCall, RuntimeEvent as TestEvent, RuntimeOrigin, Sudo, SudoCall, System, Test, }; +use pezframe_support::{assert_noop, assert_ok, weights::Weight}; #[test] fn test_setup_works() { diff --git a/bizinikiwi/pezframe/support/procedural/examples/proc_main/tasks.rs b/bizinikiwi/pezframe/support/procedural/examples/proc_main/tasks.rs index 14eb4865..6adfd3a6 100644 --- a/bizinikiwi/pezframe/support/procedural/examples/proc_main/tasks.rs +++ b/bizinikiwi/pezframe/support/procedural/examples/proc_main/tasks.rs @@ -50,9 +50,10 @@ fn tasks_work() { super::new_test_ext().execute_with(|| { Numbers::::insert(0, 1); - let task = RuntimeTask::System(super::pezframe_system::Task::::AddNumberIntoTotal { - i: 0u32, - }); + let task = + RuntimeTask::System(super::pezframe_system::Task::::AddNumberIntoTotal { + i: 0u32, + }); assert_ok!(System::do_task(RuntimeOrigin::signed(1), task.clone(),)); assert_eq!(Numbers::::get(0), None); diff --git a/bizinikiwi/pezframe/support/procedural/src/construct_runtime/expand/freeze_reason.rs b/bizinikiwi/pezframe/support/procedural/src/construct_runtime/expand/freeze_reason.rs index 488a1556..e3fe56b9 100644 --- a/bizinikiwi/pezframe/support/procedural/src/construct_runtime/expand/freeze_reason.rs +++ b/bizinikiwi/pezframe/support/procedural/src/construct_runtime/expand/freeze_reason.rs @@ -20,7 +20,10 @@ use crate::construct_runtime::Pezpallet; use proc_macro2::TokenStream; use quote::quote; -pub fn expand_outer_freeze_reason(pezpallet_decls: &[Pezpallet], scrate: &TokenStream) -> TokenStream { +pub fn expand_outer_freeze_reason( + pezpallet_decls: &[Pezpallet], + scrate: &TokenStream, +) -> TokenStream { let mut conversion_fns = Vec::new(); let mut freeze_reason_variants = Vec::new(); let mut freeze_reason_variants_count = Vec::new(); diff --git a/bizinikiwi/pezframe/support/procedural/src/construct_runtime/expand/hold_reason.rs b/bizinikiwi/pezframe/support/procedural/src/construct_runtime/expand/hold_reason.rs index 6e6aceda..01fa90f8 100644 --- a/bizinikiwi/pezframe/support/procedural/src/construct_runtime/expand/hold_reason.rs +++ b/bizinikiwi/pezframe/support/procedural/src/construct_runtime/expand/hold_reason.rs @@ -20,7 +20,10 @@ use crate::construct_runtime::Pezpallet; use proc_macro2::TokenStream; use quote::quote; -pub fn expand_outer_hold_reason(pezpallet_decls: &[Pezpallet], scrate: &TokenStream) -> TokenStream { +pub fn expand_outer_hold_reason( + pezpallet_decls: &[Pezpallet], + scrate: &TokenStream, +) -> TokenStream { let mut conversion_fns = Vec::new(); let mut hold_reason_variants = Vec::new(); let mut hold_reason_variants_count = Vec::new(); diff --git a/bizinikiwi/pezframe/support/procedural/src/construct_runtime/expand/slash_reason.rs b/bizinikiwi/pezframe/support/procedural/src/construct_runtime/expand/slash_reason.rs index 55792d74..cbfa1cf7 100644 --- a/bizinikiwi/pezframe/support/procedural/src/construct_runtime/expand/slash_reason.rs +++ b/bizinikiwi/pezframe/support/procedural/src/construct_runtime/expand/slash_reason.rs @@ -20,7 +20,10 @@ use crate::construct_runtime::Pezpallet; use proc_macro2::TokenStream; use quote::quote; -pub fn expand_outer_slash_reason(pezpallet_decls: &[Pezpallet], scrate: &TokenStream) -> TokenStream { +pub fn expand_outer_slash_reason( + pezpallet_decls: &[Pezpallet], + scrate: &TokenStream, +) -> TokenStream { let mut conversion_fns = Vec::new(); let mut slash_reason_variants = Vec::new(); for decl in pezpallet_decls { diff --git a/bizinikiwi/pezframe/support/procedural/src/construct_runtime/mod.rs b/bizinikiwi/pezframe/support/procedural/src/construct_runtime/mod.rs index 68a13844..d4e7b254 100644 --- a/bizinikiwi/pezframe/support/procedural/src/construct_runtime/mod.rs +++ b/bizinikiwi/pezframe/support/procedural/src/construct_runtime/mod.rs @@ -28,9 +28,9 @@ //! From the explicit state, Bizinikiwi expands the pallets with additional information //! that is to be included in the runtime metadata. This expansion makes visible some extra //! parts of the pallets, mainly the `Error` if defined. The expanded state looks like -//! `System: pezframe_system expanded::{Error} ::{Pezpallet, Call}` and concatenates the extra expanded -//! parts with the user-provided parts. For example, the `Pezpallet`, `Call` and `Error` parts are -//! collected. +//! `System: pezframe_system expanded::{Error} ::{Pezpallet, Call}` and concatenates the extra +//! expanded parts with the user-provided parts. For example, the `Pezpallet`, `Call` and `Error` +//! parts are collected. //! //! Pallets must provide the `tt_extra_parts` and `tt_default_parts` macros for these transitions. //! These are automatically implemented by the `#[pezpallet::pezpallet]` macro. @@ -38,9 +38,9 @@ //! This macro also generates the following enums for ease of decoding: //! - `enum RuntimeCall`: This type contains the information needed to decode extrinsics. //! - `enum RuntimeEvent`: This type contains the information needed to decode events. -//! - `enum RuntimeError`: While this cannot be used directly to decode `pezsp_runtime::DispatchError` -//! from the chain, it contains the information needed to decode the -//! `pezsp_runtime::DispatchError::Module`. +//! - `enum RuntimeError`: While this cannot be used directly to decode +//! `pezsp_runtime::DispatchError` from the chain, it contains the information needed to decode +//! the `pezsp_runtime::DispatchError::Module`. //! //! # State Transitions //! @@ -63,12 +63,13 @@ //! # Implicit to Explicit //! //! The `construct_runtime` macro transforms the implicit declaration of each pezpallet -//! `System: pezframe_system` to an explicit one `System: pezframe_system::{Pezpallet, Call}` using the -//! `tt_default_parts` macro. +//! `System: pezframe_system` to an explicit one `System: pezframe_system::{Pezpallet, Call}` using +//! the `tt_default_parts` macro. //! //! The `tt_default_parts` macro exposes a comma separated list of pezpallet parts. For example, the -//! `Event` part is exposed only if the pezpallet implements an event via `#[pezpallet::event]` macro. -//! The tokens generated by this macro are ` expanded :: { Pezpallet, Call }` for our example. +//! `Event` part is exposed only if the pezpallet implements an event via `#[pezpallet::event]` +//! macro. The tokens generated by this macro are ` expanded :: { Pezpallet, Call }` for our +//! example. //! //! The `match_and_insert` macro takes in 3 arguments: //! - target: This is the `TokenStream` that contains the `construct_runtime!` macro. @@ -200,9 +201,10 @@ //! Users normally do not care about this transition. //! //! Similarly to the previous transition, the macro expansion transforms `System: -//! pezframe_system::{Pezpallet, Call}` into `System: pezframe_system expanded::{Error} ::{Pezpallet, Call}`. -//! The `expanded` section adds extra parts that the Bizinikiwi would like to expose for each pezpallet -//! by default. This is done to expose the appropriate types for metadata construction. +//! pezframe_system::{Pezpallet, Call}` into `System: pezframe_system expanded::{Error} +//! ::{Pezpallet, Call}`. The `expanded` section adds extra parts that the Bizinikiwi would like to +//! expose for each pezpallet by default. This is done to expose the appropriate types for metadata +//! construction. //! //! This time, instead of calling `tt_default_parts` we are using the `tt_extra_parts` macro. //! This macro returns the ` :: expanded { Error }` list of additional parts we would like to @@ -213,11 +215,13 @@ pub(crate) mod parse; use crate::pezpallet::parse::helper::two128_str; use cfg_expr::Predicate; +use itertools::Itertools; +use parse::{ + ExplicitRuntimeDeclaration, ImplicitRuntimeDeclaration, Pezpallet, RuntimeDeclaration, +}; use pezframe_support_procedural_tools::{ generate_access_from_frame_or_crate, generate_crate_access, generate_hidden_includes, }; -use itertools::Itertools; -use parse::{ExplicitRuntimeDeclaration, ImplicitRuntimeDeclaration, Pezpallet, RuntimeDeclaration}; use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; use quote::quote; @@ -289,10 +293,15 @@ fn construct_runtime_implicit_to_explicit( let mut expansion = quote::quote!( #pezframe_support::construct_runtime! { #input } ); - for pezpallet in definition.pallets.iter().filter(|pezpallet| pezpallet.pezpallet_parts.is_none()) { + for pezpallet in definition + .pallets + .iter() + .filter(|pezpallet| pezpallet.pezpallet_parts.is_none()) + { let pezpallet_path = &pezpallet.path; let pezpallet_name = &pezpallet.name; - let pezpallet_instance = pezpallet.instance.as_ref().map(|instance| quote::quote!(::<#instance>)); + let pezpallet_instance = + pezpallet.instance.as_ref().map(|instance| quote::quote!(::<#instance>)); expansion = quote::quote!( #pezframe_support::__private::tt_call! { macro = [{ #pezpallet_path::tt_default_parts }] @@ -328,7 +337,8 @@ fn construct_runtime_explicit_to_explicit_expanded( for pezpallet in definition.pallets.iter().filter(|pezpallet| !pezpallet.is_expanded) { let pezpallet_path = &pezpallet.path; let pezpallet_name = &pezpallet.name; - let pezpallet_instance = pezpallet.instance.as_ref().map(|instance| quote::quote!(::<#instance>)); + let pezpallet_instance = + pezpallet.instance.as_ref().map(|instance| quote::quote!(::<#instance>)); expansion = quote::quote!( #pezframe_support::__private::tt_call! { macro = [{ #pezpallet_path::tt_extra_parts }] @@ -539,7 +549,8 @@ pub(crate) fn decl_all_pallets<'a>( let pezpallet = &pezpallet_declaration.path; let docs = &pezpallet_declaration.docs; let mut generics = vec![quote!(#runtime)]; - generics.extend(pezpallet_declaration.instance.iter().map(|name| quote!(#pezpallet::#name))); + generics + .extend(pezpallet_declaration.instance.iter().map(|name| quote!(#pezpallet::#name))); let mut attrs = Vec::new(); for cfg in &pezpallet_declaration.cfg_pattern { let feat = format!("#[cfg({})]\n", cfg.original()); diff --git a/bizinikiwi/pezframe/support/procedural/src/construct_runtime/parse.rs b/bizinikiwi/pezframe/support/procedural/src/construct_runtime/parse.rs index 3db0e4a6..54cd6daf 100644 --- a/bizinikiwi/pezframe/support/procedural/src/construct_runtime/parse.rs +++ b/bizinikiwi/pezframe/support/procedural/src/construct_runtime/parse.rs @@ -197,7 +197,8 @@ pub struct PalletDeclaration { pub index: Option, /// The path of the pezpallet, e.g. `pezframe_system` in `System: pezframe_system`. pub path: PalletPath, - /// The instance of the pezpallet, e.g. `Instance1` in `Council: pezpallet_collective::`. + /// The instance of the pezpallet, e.g. `Instance1` in `Council: + /// pezpallet_collective::`. pub instance: Option, /// The declared pezpallet parts, /// e.g. `Some([Pezpallet, Call])` for `System: system::{Pezpallet, Call}` @@ -301,7 +302,16 @@ impl Parse for PalletDeclaration { None }; - Ok(Self { is_expanded, attrs, name, path, instance, pezpallet_parts, specified_parts, index }) + Ok(Self { + is_expanded, + attrs, + name, + path, + instance, + pezpallet_parts, + specified_parts, + index, + }) } } @@ -585,7 +595,8 @@ pub struct Pezpallet { pub index: u8, /// The path of the pezpallet, e.g. `pezframe_system` in `System: pezframe_system`. pub path: PalletPath, - /// The instance of the pezpallet, e.g. `Instance1` in `Council: pezpallet_collective::`. + /// The instance of the pezpallet, e.g. `Instance1` in `Council: + /// pezpallet_collective::`. pub instance: Option, /// The pezpallet parts to use for the pezpallet. pub pezpallet_parts: Vec, diff --git a/bizinikiwi/pezframe/support/procedural/src/dynamic_params.rs b/bizinikiwi/pezframe/support/procedural/src/dynamic_params.rs index f6dbcfca..e7763b47 100644 --- a/bizinikiwi/pezframe/support/procedural/src/dynamic_params.rs +++ b/bizinikiwi/pezframe/support/procedural/src/dynamic_params.rs @@ -18,8 +18,8 @@ //! Code for the `#[dynamic_params]`, `#[dynamic_pallet_params]` and //! `#[dynamic_aggregated_params_internal]` macros. -use pezframe_support_procedural_tools::generate_access_from_frame_or_crate; use inflector::Inflector; +use pezframe_support_procedural_tools::generate_access_from_frame_or_crate; use proc_macro2::{Span, TokenStream}; use quote::{format_ident, quote, ToTokens}; use syn::{parse2, spanned::Spanned, visit_mut, visit_mut::VisitMut, Result, Token}; diff --git a/bizinikiwi/pezframe/support/procedural/src/lib.rs b/bizinikiwi/pezframe/support/procedural/src/lib.rs index e5e0e8fc..eb01e476 100644 --- a/bizinikiwi/pezframe/support/procedural/src/lib.rs +++ b/bizinikiwi/pezframe/support/procedural/src/lib.rs @@ -37,8 +37,8 @@ mod storage_alias; mod transactional; mod tt_macro; -use pezframe_support_procedural_tools::generate_access_from_frame_or_crate; use macro_magic::{import_tokens_attr, import_tokens_attr_verbatim}; +use pezframe_support_procedural_tools::generate_access_from_frame_or_crate; use proc_macro::TokenStream; use quote::{quote, ToTokens}; use std::{cell::RefCell, str::FromStr}; @@ -129,19 +129,20 @@ fn counter_prefix(prefix: &str) -> String { /// * `path::to::pezpallet`: identifiers separated by colons which declare the path to a pezpallet /// definition. /// -/// * `::` optional: specify the instance of the pezpallet to use. If not specified it will -/// use the default instance (or the only instance in case of non-instantiable pallets). +/// * `::` optional: specify the instance of the pezpallet to use. If not specified it +/// will use the default instance (or the only instance in case of non-instantiable pallets). /// -/// * `::{ Part1, Part2, .. }` optional if pezpallet declared with `pezframe_support::pezpallet`: Comma -/// separated parts declared with their generic. If a pezpallet is declared with -/// `pezframe_support::pezpallet` macro then the parts can be automatically derived if not explicitly -/// provided. We provide support for the following module parts in a pezpallet: +/// * `::{ Part1, Part2, .. }` optional if pezpallet declared with `pezframe_support::pezpallet`: +/// Comma separated parts declared with their generic. If a pezpallet is declared with +/// `pezframe_support::pezpallet` macro then the parts can be automatically derived if not +/// explicitly provided. We provide support for the following module parts in a pezpallet: /// /// - `Pezpallet` - Required for all pallets /// - `Call` - If the pezpallet has callable functions /// - `Storage` - If the pezpallet uses storage /// - `Event` or `Event` (if the event is generic) - If the pezpallet emits events -/// - `Origin` or `Origin` (if the origin is generic) - If the pezpallet has instantiable origins +/// - `Origin` or `Origin` (if the origin is generic) - If the pezpallet has instantiable +/// origins /// - `Config` or `Config` (if the config is generic) - If the pezpallet builds the genesis /// storage with `GenesisConfig` /// - `Inherent` - If the pezpallet provides/can check inherents. @@ -151,23 +152,23 @@ fn counter_prefix(prefix: &str) -> String { /// the pezpallet usable in the runtime. /// /// * `exclude_parts { Part1, Part2 }` optional: comma separated parts without generics. I.e. one of -/// `Pezpallet`, `Call`, `Storage`, `Event`, `Origin`, `Config`, `Inherent`, `ValidateUnsigned`. It -/// is incompatible with `use_parts`. This specifies the part to exclude. In order to select +/// `Pezpallet`, `Call`, `Storage`, `Event`, `Origin`, `Config`, `Inherent`, `ValidateUnsigned`. +/// It is incompatible with `use_parts`. This specifies the part to exclude. In order to select /// subset of the pezpallet parts. /// /// For example excluding the part `Call` can be useful if the runtime doesn't want to make the /// pezpallet calls available. /// /// * `use_parts { Part1, Part2 }` optional: comma separated parts without generics. I.e. one of -/// `Pezpallet`, `Call`, `Storage`, `Event`, `Origin`, `Config`, `Inherent`, `ValidateUnsigned`. It -/// is incompatible with `exclude_parts`. This specifies the part to use. In order to select a +/// `Pezpallet`, `Call`, `Storage`, `Event`, `Origin`, `Config`, `Inherent`, `ValidateUnsigned`. +/// It is incompatible with `exclude_parts`. This specifies the part to use. In order to select a /// subset of the pezpallet parts. /// /// For example not using the part `Call` can be useful if the runtime doesn't want to make the /// pezpallet calls available. /// -/// * `= $n` optional: number to define at which index the pezpallet variants in `OriginCaller`, `Call` -/// and `Event` are encoded, and to define the ModuleToIndex value. +/// * `= $n` optional: number to define at which index the pezpallet variants in `OriginCaller`, +/// `Call` and `Event` are encoded, and to define the ModuleToIndex value. /// /// if `= $n` is not given, then index is resolved in the same way as fieldless enum in Rust /// (i.e. incrementally from previous index): @@ -424,7 +425,8 @@ pub fn impl_key_prefix_for_tuples(input: TokenStream) -> TokenStream { .into() } -/// Internal macro use by pezframe_support to generate dummy part checker for old pezpallet declaration +/// Internal macro use by pezframe_support to generate dummy part checker for old pezpallet +/// declaration #[proc_macro] pub fn __generate_dummy_part_checker(input: TokenStream) -> TokenStream { dummy_part_checker::generate_dummy_part_checker(input) @@ -468,7 +470,8 @@ pub fn __create_tt_macro(input: TokenStream) -> TokenStream { /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::storage_alias`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::storage_alias`. #[proc_macro_attribute] pub fn storage_alias(attributes: TokenStream, input: TokenStream) -> TokenStream { storage_alias::storage_alias(attributes.into(), input.into()) @@ -537,8 +540,8 @@ pub fn storage_alias(attributes: TokenStream, input: TokenStream) -> TokenStream /// attached with [`#[inject_runtime_type]`]) should not be injected with the respective concrete /// types. By default, all such types are injected. /// -/// You can also make use of `#[pezpallet::no_default]` on specific items in your default impl that you -/// want to ensure will not be copied over but that you nonetheless want to use locally in the +/// You can also make use of `#[pezpallet::no_default]` on specific items in your default impl that +/// you want to ensure will not be copied over but that you nonetheless want to use locally in the /// context of the foreign impl and the pezpallet (or context) in which it is defined. /// /// ## Use-Case Example: Auto-Derive Test Pezpallet Config Traits @@ -552,10 +555,11 @@ pub fn storage_alias(attributes: TokenStream, input: TokenStream) -> TokenStream /// implements a compatible `Config` such as `pezframe_system::Config` for a test/mock runtime, and /// should receive as its first argument the path to a `DefaultConfig` impl that has been registered /// via [`#[register_default_impl]`](`macro@register_default_impl`), and as its second argument, the -/// path to the auto-generated `DefaultConfig` for the existing pezpallet `Config` we want to base our -/// test config off of. +/// path to the auto-generated `DefaultConfig` for the existing pezpallet `Config` we want to base +/// our test config off of. /// -/// The following is what the `basic` example pezpallet would look like with a default testing config: +/// The following is what the `basic` example pezpallet would look like with a default testing +/// config: /// /// ```ignore /// #[derive_impl(pezframe_system::config_preludes::TestDefaultConfig as pezframe_system::pezpallet::DefaultConfig)] @@ -640,8 +644,8 @@ pub fn storage_alias(attributes: TokenStream, input: TokenStream) -> TokenStream /// [`#[pezpallet::no_default]`](`macro@no_default`), in which case it cannot be overridden, and any /// attempts to do so will result in a compiler error. /// -/// See `frame/examples/default-config/tests.rs` for a runnable end-to-end example pezpallet that makes -/// use of `derive_impl` to derive its testing config. +/// See `frame/examples/default-config/tests.rs` for a runnable end-to-end example pezpallet that +/// makes use of `derive_impl` to derive its testing config. /// /// See [here](`macro@config`) for more information and caveats about the auto-generated /// `DefaultConfig` trait. @@ -649,10 +653,10 @@ pub fn storage_alias(attributes: TokenStream, input: TokenStream) -> TokenStream /// ## Optional Conventions /// /// Note that as an optional convention, we encourage creating a `config_preludes` module inside of -/// your pezpallet. This is the convention we follow for `pezframe_system`'s `TestDefaultConfig` which, as -/// shown above, is located at `pezframe_system::config_preludes::TestDefaultConfig`. This is just a -/// suggested convention -- there is nothing in the code that expects modules with these names to be -/// in place, so there is no imperative to follow this pattern unless desired. +/// your pezpallet. This is the convention we follow for `pezframe_system`'s `TestDefaultConfig` +/// which, as shown above, is located at `pezframe_system::config_preludes::TestDefaultConfig`. This +/// is just a suggested convention -- there is nothing in the code that expects modules with these +/// names to be in place, so there is no imperative to follow this pattern unless desired. /// /// In `config_preludes`, you can place types named like: /// @@ -717,7 +721,8 @@ pub fn no_default(_: TokenStream, _: TokenStream) -> TokenStream { /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::no_default_bounds`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::no_default_bounds`. #[proc_macro_attribute] pub fn no_default_bounds(_: TokenStream, _: TokenStream) -> TokenStream { pezpallet_macro_stub() @@ -866,7 +871,8 @@ pub fn constant(_: TokenStream, _: TokenStream) -> TokenStream { /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::constant_name`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::constant_name`. #[proc_macro_attribute] pub fn constant_name(_: TokenStream, _: TokenStream) -> TokenStream { pezpallet_macro_stub() @@ -885,7 +891,8 @@ pub fn disable_pezframe_system_supertrait_check(_: TokenStream, _: TokenStream) /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::storage_version`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::storage_version`. #[proc_macro_attribute] pub fn storage_version(_: TokenStream, _: TokenStream) -> TokenStream { pezpallet_macro_stub() @@ -950,7 +957,8 @@ pub fn feeless_if(_: TokenStream, _: TokenStream) -> TokenStream { /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::extra_constants`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::extra_constants`. #[proc_macro_attribute] pub fn extra_constants(_: TokenStream, _: TokenStream) -> TokenStream { pezpallet_macro_stub() @@ -977,7 +985,8 @@ pub fn event(_: TokenStream, _: TokenStream) -> TokenStream { /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::include_metadata`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::include_metadata`. #[proc_macro_attribute] pub fn include_metadata(_: TokenStream, _: TokenStream) -> TokenStream { pezpallet_macro_stub() @@ -986,7 +995,8 @@ pub fn include_metadata(_: TokenStream, _: TokenStream) -> TokenStream { /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::generate_deposit`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::generate_deposit`. #[proc_macro_attribute] pub fn generate_deposit(_: TokenStream, _: TokenStream) -> TokenStream { pezpallet_macro_stub() @@ -1013,7 +1023,8 @@ pub fn getter(_: TokenStream, _: TokenStream) -> TokenStream { /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::storage_prefix`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::storage_prefix`. #[proc_macro_attribute] pub fn storage_prefix(_: TokenStream, _: TokenStream) -> TokenStream { pezpallet_macro_stub() @@ -1031,7 +1042,8 @@ pub fn unbounded(_: TokenStream, _: TokenStream) -> TokenStream { /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::whitelist_storage`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::whitelist_storage`. #[proc_macro_attribute] pub fn whitelist_storage(_: TokenStream, _: TokenStream) -> TokenStream { pezpallet_macro_stub() @@ -1059,7 +1071,8 @@ pub fn type_value(_: TokenStream, _: TokenStream) -> TokenStream { /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::genesis_config`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::genesis_config`. #[proc_macro_attribute] pub fn genesis_config(_: TokenStream, _: TokenStream) -> TokenStream { pezpallet_macro_stub() @@ -1068,7 +1081,8 @@ pub fn genesis_config(_: TokenStream, _: TokenStream) -> TokenStream { /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::genesis_build`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::genesis_build`. #[proc_macro_attribute] pub fn genesis_build(_: TokenStream, _: TokenStream) -> TokenStream { pezpallet_macro_stub() @@ -1086,7 +1100,8 @@ pub fn inherent(_: TokenStream, _: TokenStream) -> TokenStream { /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::validate_unsigned`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::validate_unsigned`. #[proc_macro_attribute] pub fn validate_unsigned(_: TokenStream, _: TokenStream) -> TokenStream { pezpallet_macro_stub() @@ -1114,7 +1129,8 @@ pub fn origin(_: TokenStream, _: TokenStream) -> TokenStream { /// /// --- /// -/// Documentation for this macro can be found at `pezframe_support::pezpallet_macros::composite_enum`. +/// Documentation for this macro can be found at +/// `pezframe_support::pezpallet_macros::composite_enum`. #[proc_macro_attribute] pub fn composite_enum(_: TokenStream, _: TokenStream) -> TokenStream { pezpallet_macro_stub() @@ -1125,9 +1141,9 @@ pub fn composite_enum(_: TokenStream, _: TokenStream) -> TokenStream { /// The off-chain worker can then create and submit all such work items at any given time. /// /// These work items are defined as instances of the `Task` trait (found at -/// `pezframe_support::traits::Task`). [`pezpallet:tasks_experimental`](macro@tasks_experimental) when -/// attached to an `impl` block inside a pezpallet, will generate an enum `Task` whose variants -/// are mapped to functions inside this `impl` block. +/// `pezframe_support::traits::Task`). [`pezpallet:tasks_experimental`](macro@tasks_experimental) +/// when attached to an `impl` block inside a pezpallet, will generate an enum `Task` whose +/// variants are mapped to functions inside this `impl` block. /// /// Each such function must have the following set of attributes: /// @@ -1460,11 +1476,11 @@ pub fn dynamic_aggregated_params_internal(attrs: TokenStream, input: TokenStream /// /// Authorize process comes with 2 attributes macro on top of the authorized call: /// -/// * `#[pezpallet::authorize($authorized_function)]` - defines the function that authorizes the call. -/// First argument is the transaction source `TransactionSource` then followed by the same as call -/// arguments but by reference `&`. Return type is `TransactionValidityWithRefund`. -/// * `#[pezpallet::weight_of_authorize($weight)]` - defines the value of the weight of the authorize -/// function. This attribute is similar to `#[pezpallet::weight]`: +/// * `#[pezpallet::authorize($authorized_function)]` - defines the function that authorizes the +/// call. First argument is the transaction source `TransactionSource` then followed by the same +/// as call arguments but by reference `&`. Return type is `TransactionValidityWithRefund`. +/// * `#[pezpallet::weight_of_authorize($weight)]` - defines the value of the weight of the +/// authorize function. This attribute is similar to `#[pezpallet::weight]`: /// * it can be ignore in `dev_mode` /// * it can be automatically infered from weight info. For the call `foo` the function /// `authorize_foo` in the weight info will be used. (weight info needs to be provided in the diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/expand/call.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/expand/call.rs index b6d7e285..ef8ecaaa 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/expand/call.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/expand/call.rs @@ -191,8 +191,9 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream { .collect::>() }); - let default_docs = - [syn::parse_quote!(r"Contains a variant per dispatchable extrinsic that this pezpallet has.")]; + let default_docs = [syn::parse_quote!( + r"Contains a variant per dispatchable extrinsic that this pezpallet has." + )]; let docs = if docs.is_empty() { &default_docs[..] } else { &docs[..] }; let maybe_compile_error = if def.call.is_none() { diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/expand/pezpallet_struct.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/expand/pezpallet_struct.rs index 17225bf0..b8ba1954 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/expand/pezpallet_struct.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/expand/pezpallet_struct.rs @@ -35,12 +35,13 @@ pub fn expand_pallet_struct(def: &mut Def) -> proc_macro2::TokenStream { let type_decl_gen = &def.type_decl_generics(def.pezpallet_struct.attr_span); let pezpallet_ident = &def.pezpallet_struct.pezpallet; let config_where_clause = &def.config.where_clause; - let deprecation_status = - match crate::deprecation::get_deprecation("e::quote! {#pezframe_support}, &def.item.attrs) - { - Ok(deprecation) => deprecation, - Err(e) => return e.into_compile_error(), - }; + let deprecation_status = match crate::deprecation::get_deprecation( + "e::quote! {#pezframe_support}, + &def.item.attrs, + ) { + Ok(deprecation) => deprecation, + Err(e) => return e.into_compile_error(), + }; let mut storages_where_clauses = vec![&def.config.where_clause]; storages_where_clauses.extend(def.storages.iter().map(|storage| &storage.where_clause)); @@ -105,8 +106,10 @@ pub fn expand_pallet_struct(def: &mut Def) -> proc_macro2::TokenStream { ) }; - let storage_info_span = - def.pezpallet_struct.without_storage_info.unwrap_or(def.pezpallet_struct.attr_span); + let storage_info_span = def + .pezpallet_struct + .without_storage_info + .unwrap_or(def.pezpallet_struct.attr_span); let storage_names = &def.storages.iter().map(|storage| &storage.ident).collect::>(); let storage_cfg_attrs = diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/expand/storage.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/expand/storage.rs index 05b3ed5c..4bd67e0c 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/expand/storage.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/expand/storage.rs @@ -157,7 +157,8 @@ pub fn process_generics(def: &mut Def) -> syn::Result syn::Result<()> { if let Some(QueryKind::ResultQuery(error_path, _)) = storage_def.query_kind.as_ref() { @@ -860,8 +861,8 @@ pub fn expand_storages(def: &mut Def) -> proc_macro2::TokenStream { .iter() .filter_map(|storage| { // A little hacky; don't generate for cfg gated storages to not get compile errors - // when building "frame-feature-testing" gated storages in the "pezframe-support-test" - // crate. + // when building "frame-feature-testing" gated storages in the + // "pezframe-support-test" crate. if storage.try_decode && storage.cfg_attrs.is_empty() { let ident = &storage.ident; let gen = &def.type_use_generics(storage.attr_span); diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/call.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/call.rs index bc8503f2..f0ec8a3c 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/call.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/call.rs @@ -298,7 +298,8 @@ impl CallDef { return Err(syn::Error::new(method.sig.span(), msg)); }, Some(syn::FnArg::Receiver(_)) => { - let msg = "Invalid pezpallet::call, first argument must be a typed argument, \ + let msg = + "Invalid pezpallet::call, first argument must be a typed argument, \ e.g. `origin: OriginFor`"; return Err(syn::Error::new(method.sig.span(), msg)); }, @@ -329,7 +330,8 @@ impl CallDef { }, FunctionAttr::Weight(w) => { if weight.is_some() { - let msg = "Invalid pezpallet::call, too many weight attributes given"; + let msg = + "Invalid pezpallet::call, too many weight attributes given"; return Err(syn::Error::new(method.sig.span(), msg)); } weight = Some(w); diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/composite.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/composite.rs index dc2529aa..7d966470 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/composite.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/composite.rs @@ -91,7 +91,8 @@ pub struct CompositeDef { pub composite_keyword: keyword::CompositeKeyword, /// Name of the associated type. pub ident: syn::Ident, - /// Type parameters and where clause attached to a declaration of the pezpallet::composite_enum. + /// Type parameters and where clause attached to a declaration of the + /// pezpallet::composite_enum. pub generics: syn::Generics, /// The span of the pezpallet::composite_enum attribute. pub attr_span: proc_macro2::Span, diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/config.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/config.rs index 3220ee04..58b5dc52 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/config.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/config.rs @@ -16,7 +16,9 @@ // limitations under the License. use super::helper; -use pezframe_support_procedural_tools::{get_cfg_attributes, get_doc_literals, is_using_frame_crate}; +use pezframe_support_procedural_tools::{ + get_cfg_attributes, get_doc_literals, is_using_frame_crate, +}; use proc_macro_warning::Warning; use quote::ToTokens; use syn::{parse_quote, spanned::Spanned, token, Token, TraitItemType}; @@ -43,8 +45,8 @@ mod keyword { #[derive(Default)] pub struct DefaultTrait { /// A bool for each sub-trait item indicates whether the item has - /// `#[pezpallet::no_default_bounds]` attached to it. If true, the item will not have any bounds - /// in the generated default sub-trait. + /// `#[pezpallet::no_default_bounds]` attached to it. If true, the item will not have any + /// bounds in the generated default sub-trait. pub items: Vec<(syn::TraitItem, bool)>, pub has_system: bool, } @@ -305,15 +307,17 @@ fn has_expected_system_config(path: syn::Path, pezframe_system: &syn::Path) -> b let mut expected_system_config = match (is_using_frame_crate(&path), is_using_frame_crate(&pezframe_system)) { (true, false) => - // We can't use the path to `pezframe_system` from `frame` if `pezframe_system` is not being - // in scope through `frame`. + // We can't use the path to `pezframe_system` from `frame` if `pezframe_system` is not + // being in scope through `frame`. return false, (false, true) => // We know that the only valid pezframe_system path is one that is `pezframe_system`, as // `frame` re-exports it as such. - syn::parse2::(quote::quote!(pezframe_system)).expect("is a valid path; qed"), + syn::parse2::(quote::quote!(pezframe_system)) + .expect("is a valid path; qed"), (_, _) => - // They are either both `pezframe_system` or both `pezkuwi_sdk_frame::xyz::pezframe_system`. + // They are either both `pezframe_system` or both + // `pezkuwi_sdk_frame::xyz::pezframe_system`. pezframe_system.clone(), }; @@ -634,7 +638,8 @@ mod tests { let path = syn::parse2::(quote::quote!(pezframe_system::Config)).unwrap(); let pezframe_system = - syn::parse2::(quote::quote!(pezkuwi_sdk_frame::deps::pezframe_system)).unwrap(); + syn::parse2::(quote::quote!(pezkuwi_sdk_frame::deps::pezframe_system)) + .unwrap(); assert!(has_expected_system_config(path.clone(), &pezframe_system)); let pezframe_system = @@ -645,10 +650,12 @@ mod tests { #[test] fn has_expected_system_config_works_with_frame_full_path() { let pezframe_system = - syn::parse2::(quote::quote!(pezkuwi_sdk_frame::deps::pezframe_system)).unwrap(); - let path = - syn::parse2::(quote::quote!(pezkuwi_sdk_frame::deps::pezframe_system::Config)) + syn::parse2::(quote::quote!(pezkuwi_sdk_frame::deps::pezframe_system)) .unwrap(); + let path = syn::parse2::(quote::quote!( + pezkuwi_sdk_frame::deps::pezframe_system::Config + )) + .unwrap(); assert!(has_expected_system_config(path, &pezframe_system)); let pezframe_system = @@ -661,10 +668,12 @@ mod tests { #[test] fn has_expected_system_config_works_with_other_frame_full_path() { let pezframe_system = - syn::parse2::(quote::quote!(pezkuwi_sdk_frame::xyz::pezframe_system)).unwrap(); - let path = - syn::parse2::(quote::quote!(pezkuwi_sdk_frame::xyz::pezframe_system::Config)) + syn::parse2::(quote::quote!(pezkuwi_sdk_frame::xyz::pezframe_system)) .unwrap(); + let path = syn::parse2::(quote::quote!( + pezkuwi_sdk_frame::xyz::pezframe_system::Config + )) + .unwrap(); assert!(has_expected_system_config(path, &pezframe_system)); let pezframe_system = @@ -677,29 +686,34 @@ mod tests { #[test] fn has_expected_system_config_does_not_works_with_mixed_frame_full_path() { let pezframe_system = - syn::parse2::(quote::quote!(pezkuwi_sdk_frame::xyz::pezframe_system)).unwrap(); - let path = - syn::parse2::(quote::quote!(pezkuwi_sdk_frame::deps::pezframe_system::Config)) + syn::parse2::(quote::quote!(pezkuwi_sdk_frame::xyz::pezframe_system)) .unwrap(); + let path = syn::parse2::(quote::quote!( + pezkuwi_sdk_frame::deps::pezframe_system::Config + )) + .unwrap(); assert!(!has_expected_system_config(path, &pezframe_system)); } #[test] fn has_expected_system_config_does_not_works_with_other_mixed_frame_full_path() { let pezframe_system = - syn::parse2::(quote::quote!(pezkuwi_sdk_frame::deps::pezframe_system)).unwrap(); - let path = - syn::parse2::(quote::quote!(pezkuwi_sdk_frame::xyz::pezframe_system::Config)) + syn::parse2::(quote::quote!(pezkuwi_sdk_frame::deps::pezframe_system)) .unwrap(); + let path = syn::parse2::(quote::quote!( + pezkuwi_sdk_frame::xyz::pezframe_system::Config + )) + .unwrap(); assert!(!has_expected_system_config(path, &pezframe_system)); } #[test] fn has_expected_system_config_does_not_work_with_frame_full_path_if_not_frame_crate() { let pezframe_system = syn::parse2::(quote::quote!(pezframe_system)).unwrap(); - let path = - syn::parse2::(quote::quote!(pezkuwi_sdk_frame::deps::pezframe_system::Config)) - .unwrap(); + let path = syn::parse2::(quote::quote!( + pezkuwi_sdk_frame::deps::pezframe_system::Config + )) + .unwrap(); assert!(!has_expected_system_config(path, &pezframe_system)); } diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/error.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/error.rs index ea381b1e..2c817ac3 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/error.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/error.rs @@ -67,7 +67,10 @@ impl ErrorDef { let item = if let syn::Item::Enum(item) = item { item } else { - return Err(syn::Error::new(item.span(), "Invalid pezpallet::error, expected item enum")); + return Err(syn::Error::new( + item.span(), + "Invalid pezpallet::error, expected item enum", + )); }; if !matches!(item.vis, syn::Visibility::Public(_)) { let msg = "Invalid pezpallet::error, `Error` must be public"; @@ -80,41 +83,42 @@ impl ErrorDef { vec![helper::check_type_def_gen_no_bounds(&item.generics, item.ident.span())?]; if item.generics.where_clause.is_some() { - let msg = "Invalid pezpallet::error, where clause is not allowed on pezpallet error item"; + let msg = + "Invalid pezpallet::error, where clause is not allowed on pezpallet error item"; return Err(syn::Error::new(item.generics.where_clause.as_ref().unwrap().span(), msg)); } let error = syn::parse2::(item.ident.to_token_stream())?; - let variants = item - .variants - .iter() - .map(|variant| { - let field_ty = match &variant.fields { - Fields::Unit => None, - Fields::Named(_) => Some(VariantField { is_named: true }), - Fields::Unnamed(_) => Some(VariantField { is_named: false }), - }; + let variants = + item.variants + .iter() + .map(|variant| { + let field_ty = match &variant.fields { + Fields::Unit => None, + Fields::Named(_) => Some(VariantField { is_named: true }), + Fields::Unnamed(_) => Some(VariantField { is_named: false }), + }; - match &variant.discriminant { - None | - Some((_, syn::Expr::Lit(syn::ExprLit { lit: syn::Lit::Int(_), .. }))) => {}, - Some((_, expr)) => { - let msg = "Invalid pezpallet::error, only integer discriminants are supported"; - return Err(syn::Error::new(expr.span(), msg)); - }, - } - let cfg_attrs: Vec = helper::get_item_cfg_attrs(&variant.attrs); - let maybe_allow_attrs = extract_or_return_allow_attrs(&variant.attrs).collect(); + match &variant.discriminant { + None | + Some((_, syn::Expr::Lit(syn::ExprLit { lit: syn::Lit::Int(_), .. }))) => {}, + Some((_, expr)) => { + let msg = "Invalid pezpallet::error, only integer discriminants are supported"; + return Err(syn::Error::new(expr.span(), msg)); + }, + } + let cfg_attrs: Vec = helper::get_item_cfg_attrs(&variant.attrs); + let maybe_allow_attrs = extract_or_return_allow_attrs(&variant.attrs).collect(); - Ok(VariantDef { - ident: variant.ident.clone(), - field: field_ty, - cfg_attrs, - maybe_allow_attrs, + Ok(VariantDef { + ident: variant.ident.clone(), + field: field_ty, + cfg_attrs, + maybe_allow_attrs, + }) }) - }) - .collect::>()?; + .collect::>()?; Ok(ErrorDef { attr_span, index, variants, instances, error }) } diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/event.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/event.rs index 06a39689..deb7a94f 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/event.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/event.rs @@ -104,7 +104,10 @@ impl EventDef { let item = if let syn::Item::Enum(item) = item { item } else { - return Err(syn::Error::new(item.span(), "Invalid pezpallet::event, expected enum item")); + return Err(syn::Error::new( + item.span(), + "Invalid pezpallet::event, expected enum item", + )); }; crate::deprecation::prevent_deprecation_attr_on_outer_enum(&item.attrs)?; diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/helper.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/helper.rs index cf85c656..39677af3 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/helper.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/helper.rs @@ -48,7 +48,8 @@ pub trait MutItemAttrs { fn mut_item_attrs(&mut self) -> Option<&mut Vec>; } -/// Take the first pezpallet attribute (e.g. attribute like `#[pezpallet..]`) and decode it to `Attr` +/// Take the first pezpallet attribute (e.g. attribute like `#[pezpallet..]`) and decode it to +/// `Attr` pub(crate) fn take_first_item_pallet_attr( item: &mut impl MutItemAttrs, ) -> syn::Result> @@ -58,7 +59,10 @@ where let Some(attrs) = item.mut_item_attrs() else { return Ok(None) }; let Some(index) = attrs.iter().position(|attr| { - attr.path().segments.first().map_or(false, |segment| segment.ident == "pezpallet") + attr.path() + .segments + .first() + .map_or(false, |segment| segment.ident == "pezpallet") }) else { return Ok(None); }; @@ -67,7 +71,8 @@ where Ok(Some(syn::parse2(pezpallet_attr.into_token_stream())?)) } -/// Take all the pezpallet attributes (e.g. attribute like `#[pezpallet..]`) and decode them to `Attr` +/// Take all the pezpallet attributes (e.g. attribute like `#[pezpallet..]`) and decode them to +/// `Attr` pub(crate) fn take_item_pallet_attrs(item: &mut impl MutItemAttrs) -> syn::Result> where Attr: syn::parse::Parse, diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/inherent.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/inherent.rs index 07fb0263..425081d7 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/inherent.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/inherent.rs @@ -34,7 +34,8 @@ impl InherentDef { }; if item.trait_.is_none() { - let msg = "Invalid pezpallet::inherent, expected impl<..> ProvideInherent for Pezpallet<..>"; + let msg = + "Invalid pezpallet::inherent, expected impl<..> ProvideInherent for Pezpallet<..>"; return Err(syn::Error::new(item.span(), msg)); } @@ -44,7 +45,8 @@ impl InherentDef { return Err(syn::Error::new(last.span(), msg)); } } else { - let msg = "Invalid pezpallet::inherent, expected impl<..> ProvideInherent for Pezpallet<..>"; + let msg = + "Invalid pezpallet::inherent, expected impl<..> ProvideInherent for Pezpallet<..>"; return Err(syn::Error::new(item.span(), msg)); } diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/mod.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/mod.rs index 650d08ab..d9d30ca3 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/mod.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/mod.rs @@ -609,8 +609,9 @@ enum PalletAttr { /// Can be used to reduce the repetitive weight annotation in the trivial case. It accepts one /// argument that is expected to be an implementation of the `WeightInfo` or something that /// behaves syntactically equivalent. This allows to annotate a `WeightInfo` for all the calls. - /// Now each call does not need to specify its own `#[pezpallet::weight]` but can instead use the - /// one from the `#[pezpallet::call]` definition. So instead of having to write it on each call: + /// Now each call does not need to specify its own `#[pezpallet::weight]` but can instead use + /// the one from the `#[pezpallet::call]` definition. So instead of having to write it on each + /// call: /// /// ```ignore /// #[pezpallet::call] @@ -631,9 +632,10 @@ enum PalletAttr { /// /// ### Dev Mode /// - /// Normally the `dev_mode` sets all weights of calls without a `#[pezpallet::weight]` annotation - /// to zero. Now when there is a `weight` attribute on the `#[pezpallet::call]`, then that is used - /// instead of the zero weight. So to say: it works together with `dev_mode`. + /// Normally the `dev_mode` sets all weights of calls without a `#[pezpallet::weight]` + /// annotation to zero. Now when there is a `weight` attribute on the `#[pezpallet::call]`, + /// then that is used instead of the zero weight. So to say: it works together with + /// `dev_mode`. RuntimeCall(Option, proc_macro2::Span), Error(proc_macro2::Span), Tasks(proc_macro2::Span), @@ -803,7 +805,8 @@ impl syn::parse::Parse for PalletAttr { } } -/// The optional weight annotation on a `#[pezpallet::call]` like `#[pezpallet::call(weight($type))]`. +/// The optional weight annotation on a `#[pezpallet::call]` like +/// `#[pezpallet::call(weight($type))]`. #[derive(Clone)] pub struct InheritedCallWeightAttr { pub typename: syn::Type, diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/pezpallet_struct.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/pezpallet_struct.rs index b5199669..b0a2eae8 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/pezpallet_struct.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/pezpallet_struct.rs @@ -130,7 +130,8 @@ impl PalletStructDef { } if item.generics.where_clause.is_some() { - let msg = "Invalid pezpallet::pezpallet, where clause not supported on Pezpallet declaration"; + let msg = + "Invalid pezpallet::pezpallet, where clause not supported on Pezpallet declaration"; return Err(syn::Error::new(item.generics.where_clause.span(), msg)); } diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/storage.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/storage.rs index dc6ea592..b35bf86b 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/storage.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/storage.rs @@ -704,7 +704,8 @@ fn process_generics( .collect::>(); process_named_generics(&storage_kind, args_span, &args, dev_mode) } else { - let msg = "Invalid pezpallet::storage, invalid generic declaration for storage. Expect only \ + let msg = + "Invalid pezpallet::storage, invalid generic declaration for storage. Expect only \ type generics or binding generics, e.g. `` or \ ``."; Err(syn::Error::new(segment.span(), msg)) @@ -792,7 +793,10 @@ impl StorageDef { let item = if let syn::Item::Type(item) = item { item } else { - return Err(syn::Error::new(item.span(), "Invalid pezpallet::storage, expect item type.")); + return Err(syn::Error::new( + item.span(), + "Invalid pezpallet::storage, expect item type.", + )); }; let attrs: Vec = helper::take_item_pallet_attrs(&mut item.attrs)?; @@ -920,7 +924,8 @@ impl StorageDef { .unwrap_or(Some(QueryKind::OptionQuery)); if let (None, Some(getter)) = (query_kind.as_ref(), getter.as_ref()) { - let msg = "Invalid pezpallet::storage, cannot generate getter because QueryKind is not \ + let msg = + "Invalid pezpallet::storage, cannot generate getter because QueryKind is not \ identifiable. QueryKind must be `OptionQuery`, `ResultQuery`, `ValueQuery`, or default \ one to be identifiable."; return Err(syn::Error::new(getter.span(), msg)); diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/tasks.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/tasks.rs index dae13e99..f5171377 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/tasks.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/tasks.rs @@ -506,7 +506,10 @@ fn extract_pallet_attr(item_enum: &mut ItemEnum) -> Result> .cloned() .collect(); if let Some(span) = duplicate { - return Err(Error::new(span, "only one `#[pezpallet::_]` attribute is supported on this item")); + return Err(Error::new( + span, + "only one `#[pezpallet::_]` attribute is supported on this item", + )); } Ok(attr) } diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/type_value.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/type_value.rs index dcf83cdf..131a435d 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/type_value.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/type_value.rs @@ -60,7 +60,8 @@ impl TypeValueDef { } } - let msg = "Invalid pezpallet::type_value, unexpected attribute, only doc attribute are \ + let msg = + "Invalid pezpallet::type_value, unexpected attribute, only doc attribute are \ allowed"; return Err(syn::Error::new(attr.span(), msg)); } diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/validate_unsigned.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/validate_unsigned.rs index cba87c9d..dd7d344e 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/validate_unsigned.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/validate_unsigned.rs @@ -31,7 +31,8 @@ impl ValidateUnsignedDef { }; if item.trait_.is_none() { - let msg = "Invalid pezpallet::validate_unsigned, expected impl<..> ValidateUnsigned for \ + let msg = + "Invalid pezpallet::validate_unsigned, expected impl<..> ValidateUnsigned for \ Pezpallet<..>"; return Err(syn::Error::new(item.span(), msg)); } @@ -42,7 +43,8 @@ impl ValidateUnsignedDef { return Err(syn::Error::new(last.span(), msg)); } } else { - let msg = "Invalid pezpallet::validate_unsigned, expected impl<..> ValidateUnsigned for \ + let msg = + "Invalid pezpallet::validate_unsigned, expected impl<..> ValidateUnsigned for \ Pezpallet<..>"; return Err(syn::Error::new(item.span(), msg)); } diff --git a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/view_functions.rs b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/view_functions.rs index 0eec808e..43585787 100644 --- a/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/view_functions.rs +++ b/bizinikiwi/pezframe/support/procedural/src/pezpallet/parse/view_functions.rs @@ -15,8 +15,8 @@ // See the License for the specific language governsing permissions and // limitations under the License. -use pezframe_support_procedural_tools::get_doc_literals; use inflector::Inflector; +use pezframe_support_procedural_tools::get_doc_literals; use syn::spanned::Spanned; /// Parsed representation of an impl block annotated with `pezpallet::view_functions`. diff --git a/bizinikiwi/pezframe/support/procedural/src/runtime/expand/mod.rs b/bizinikiwi/pezframe/support/procedural/src/runtime/expand/mod.rs index c04a18cb..8aa7b5fd 100644 --- a/bizinikiwi/pezframe/support/procedural/src/runtime/expand/mod.rs +++ b/bizinikiwi/pezframe/support/procedural/src/runtime/expand/mod.rs @@ -100,12 +100,14 @@ fn construct_runtime_implicit_to_explicit( let pezpallet_path = &pezpallet.path; let pezpallet_name = &pezpallet.name; let runtime_param = &pezpallet.runtime_param; - let pezpallet_segment_and_instance = match (&pezpallet.pezpallet_segment, &pezpallet.instance) { - (Some(segment), Some(instance)) => quote::quote!(::#segment<#runtime_param, #instance>), - (Some(segment), None) => quote::quote!(::#segment<#runtime_param>), - (None, Some(instance)) => quote::quote!(<#instance>), - (None, None) => quote::quote!(), - }; + let pezpallet_segment_and_instance = + match (&pezpallet.pezpallet_segment, &pezpallet.instance) { + (Some(segment), Some(instance)) => + quote::quote!(::#segment<#runtime_param, #instance>), + (Some(segment), None) => quote::quote!(::#segment<#runtime_param>), + (None, Some(instance)) => quote::quote!(<#instance>), + (None, None) => quote::quote!(), + }; expansion = quote::quote!( #pezframe_support::__private::tt_call! { macro = [{ #pezpallet_path::tt_default_parts_v2 }] diff --git a/bizinikiwi/pezframe/support/procedural/src/runtime/mod.rs b/bizinikiwi/pezframe/support/procedural/src/runtime/mod.rs index 1afce521..0e899595 100644 --- a/bizinikiwi/pezframe/support/procedural/src/runtime/mod.rs +++ b/bizinikiwi/pezframe/support/procedural/src/runtime/mod.rs @@ -35,9 +35,9 @@ //! is defined inside `#[runtime::derive]`: //! - `enum RuntimeCall`: This type contains the information needed to decode extrinsics. //! - `enum RuntimeEvent`: This type contains the information needed to decode events. -//! - `enum RuntimeError`: While this cannot be used directly to decode `pezsp_runtime::DispatchError` -//! from the chain, it contains the information needed to decode the -//! `pezsp_runtime::DispatchError::Module`. +//! - `enum RuntimeError`: While this cannot be used directly to decode +//! `pezsp_runtime::DispatchError` from the chain, it contains the information needed to decode +//! the `pezsp_runtime::DispatchError::Module`. //! //! # State Transitions //! @@ -53,12 +53,12 @@ //! ``` //! //! The `runtime` macro transforms the implicit declaration of each pezpallet -//! `System: pezframe_system` to an explicit one `System: pezframe_system + Pezpallet + Call` using the -//! `tt_default_parts_v2` macro. +//! `System: pezframe_system` to an explicit one `System: pezframe_system + Pezpallet + Call` using +//! the `tt_default_parts_v2` macro. //! -//! The `tt_default_parts_v2` macro exposes a plus separated list of pezpallet parts. For example, the -//! `Event` part is exposed only if the pezpallet implements an event via `#[pezpallet::event]` macro. -//! The tokens generated by this macro are `+ Pezpallet + Call` for our example. +//! The `tt_default_parts_v2` macro exposes a plus separated list of pezpallet parts. For example, +//! the `Event` part is exposed only if the pezpallet implements an event via `#[pezpallet::event]` +//! macro. The tokens generated by this macro are `+ Pezpallet + Call` for our example. //! //! The `match_and_insert` macro takes in 3 arguments: //! - target: This is the `TokenStream` that contains the `runtime` macro. @@ -66,8 +66,8 @@ //! - tokens: The tokens to added after the pattern match. //! //! The `runtime` macro uses the `tt_call` to get the default pezpallet parts via -//! the `tt_default_parts_v2` macro defined by each pezpallet. The pezpallet parts are then returned as -//! input to the `match_and_replace` macro. +//! the `tt_default_parts_v2` macro defined by each pezpallet. The pezpallet parts are then returned +//! as input to the `match_and_replace` macro. //! The `match_and_replace` then will modify the `runtime` to expand the implicit //! definition to the explicit one. //! diff --git a/bizinikiwi/pezframe/support/procedural/src/runtime/parse/mod.rs b/bizinikiwi/pezframe/support/procedural/src/runtime/parse/mod.rs index 782398f4..08ab8a45 100644 --- a/bizinikiwi/pezframe/support/procedural/src/runtime/parse/mod.rs +++ b/bizinikiwi/pezframe/support/procedural/src/runtime/parse/mod.rs @@ -211,7 +211,8 @@ impl Def { &bounds, )?; - if let Some(used_pallet) = indices.insert(pezpallet.index, pezpallet.name.clone()) + if let Some(used_pallet) = + indices.insert(pezpallet.index, pezpallet.name.clone()) { let msg = format!( "Pezpallet indices are conflicting: Both pallets {} and {} are at index {}", diff --git a/bizinikiwi/pezframe/support/procedural/src/runtime/parse/pezpallet.rs b/bizinikiwi/pezframe/support/procedural/src/runtime/parse/pezpallet.rs index 74c332eb..5a989070 100644 --- a/bizinikiwi/pezframe/support/procedural/src/runtime/parse/pezpallet.rs +++ b/bizinikiwi/pezframe/support/procedural/src/runtime/parse/pezpallet.rs @@ -16,7 +16,7 @@ // limitations under the License. use crate::{ - construct_runtime::parse::{Pezpallet, PalletPart, PalletPartKeyword, PalletPath}, + construct_runtime::parse::{PalletPart, PalletPartKeyword, PalletPath, Pezpallet}, runtime::parse::PalletDeclaration, }; use pezframe_support_procedural_tools::get_doc_literals; diff --git a/bizinikiwi/pezframe/support/procedural/src/runtime/parse/pezpallet_decl.rs b/bizinikiwi/pezframe/support/procedural/src/runtime/parse/pezpallet_decl.rs index 73957510..dd5ec986 100644 --- a/bizinikiwi/pezframe/support/procedural/src/runtime/parse/pezpallet_decl.rs +++ b/bizinikiwi/pezframe/support/procedural/src/runtime/parse/pezpallet_decl.rs @@ -24,7 +24,8 @@ pub struct PalletDeclaration { pub name: Ident, /// The path of the pezpallet, e.g. `pezframe_system` in `pub type System = pezframe_system`. pub path: syn::Path, - /// The segment of the pezpallet, e.g. `Pezpallet` in `pub type System = pezframe_system::Pezpallet`. + /// The segment of the pezpallet, e.g. `Pezpallet` in `pub type System = + /// pezframe_system::Pezpallet`. pub pezpallet_segment: Option, /// The runtime parameter of the pezpallet, e.g. `Runtime` in /// `pub type System = pezframe_system::Pezpallet`. diff --git a/bizinikiwi/pezframe/support/procedural/src/storage_alias.rs b/bizinikiwi/pezframe/support/procedural/src/storage_alias.rs index f43eb7e5..e98347c1 100644 --- a/bizinikiwi/pezframe/support/procedural/src/storage_alias.rs +++ b/bizinikiwi/pezframe/support/procedural/src/storage_alias.rs @@ -459,8 +459,8 @@ impl Parse for Input { enum PrefixType { /// An appropriate prefix will be determined automatically. /// - /// If generics are passed, this is assumed to be a pezpallet and the pezpallet name should be used. - /// Otherwise use the verbatim passed name as prefix. + /// If generics are passed, this is assumed to be a pezpallet and the pezpallet name should be + /// used. Otherwise use the verbatim passed name as prefix. Compatibility, /// The provided ident/name will be used as the prefix. Verbatim, diff --git a/bizinikiwi/pezframe/support/src/dispatch.rs b/bizinikiwi/pezframe/support/src/dispatch.rs index 586d6261..4527aeae 100644 --- a/bizinikiwi/pezframe/support/src/dispatch.rs +++ b/bizinikiwi/pezframe/support/src/dispatch.rs @@ -21,9 +21,6 @@ use crate::traits::UnfilteredDispatchable; use codec::{Codec, Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen}; use core::fmt; -use scale_info::TypeInfo; -#[cfg(feature = "std")] -use serde::{Deserialize, Serialize}; use pezsp_runtime::{ generic::{CheckedExtrinsic, UncheckedExtrinsic}, traits::{ @@ -32,6 +29,9 @@ use pezsp_runtime::{ DispatchError, }; use pezsp_weights::Weight; +use scale_info::TypeInfo; +#[cfg(feature = "std")] +use serde::{Deserialize, Serialize}; /// The return type of a `Dispatchable` in frame. When returned explicitly from /// a dispatchable function it allows overriding the default `PostDispatchInfo` @@ -60,8 +60,9 @@ pub type CallableCallFor = >::RuntimeCall; /// Means to checks if the dispatchable is feeless. /// /// This is automatically implemented for all dispatchables during pezpallet expansion. -/// If a call is marked by [`#[pezpallet::feeless_if]`](`macro@pezframe_support_procedural::feeless_if`) -/// attribute, the corresponding closure is checked. +/// If a call is marked by +/// [`#[pezpallet::feeless_if]`](`macro@pezframe_support_procedural::feeless_if`) attribute, the +/// corresponding closure is checked. pub trait CheckIfFeeless { /// The Origin type of the runtime. type Origin; @@ -1207,7 +1208,6 @@ mod per_dispatch_class_tests { #[cfg(test)] mod test_extensions { use codec::{Decode, DecodeWithMemTracking, Encode}; - use scale_info::TypeInfo; use pezsp_runtime::{ impl_tx_ext_default, traits::{ @@ -1217,6 +1217,7 @@ mod test_extensions { transaction_validity::TransactionValidityError, }; use pezsp_weights::Weight; + use scale_info::TypeInfo; use super::{DispatchResult, PostDispatchInfo}; diff --git a/bizinikiwi/pezframe/support/src/dispatch_context.rs b/bizinikiwi/pezframe/support/src/dispatch_context.rs index 2e56cbec..cf51418f 100644 --- a/bizinikiwi/pezframe/support/src/dispatch_context.rs +++ b/bizinikiwi/pezframe/support/src/dispatch_context.rs @@ -27,11 +27,11 @@ //! # FRAME integration //! //! The FRAME macros implement -//! [`UnfilteredDispatchable`](pezframe_support::traits::UnfilteredDispatchable) for each pezpallet `Call` -//! enum. Part of this implementation is the call to [`run_in_context`], so that each call to +//! [`UnfilteredDispatchable`](pezframe_support::traits::UnfilteredDispatchable) for each pezpallet +//! `Call` enum. Part of this implementation is the call to [`run_in_context`], so that each call to //! [`UnfilteredDispatchable::dispatch_bypass_filter`](crate::traits::UnfilteredDispatchable::dispatch_bypass_filter) -//! or [`Dispatchable::dispatch`](pezsp_runtime::traits::Dispatchable::dispatch) will run in a dispatch -//! context. +//! or [`Dispatchable::dispatch`](pezsp_runtime::traits::Dispatchable::dispatch) will run in a +//! dispatch context. //! //! # Example //! diff --git a/bizinikiwi/pezframe/support/src/instances.rs b/bizinikiwi/pezframe/support/src/instances.rs index 7dd6a9a3..9f595a77 100644 --- a/bizinikiwi/pezframe/support/src/instances.rs +++ b/bizinikiwi/pezframe/support/src/instances.rs @@ -17,8 +17,8 @@ //! Some instance placeholder to be used in [`pezframe_support::pezpallet`] attribute macro. //! -//! [`pezframe_support::pezpallet`] attribute macro does only requires the instance generic `I` to be -//! static (contrary to `decl_*` macro which requires instance generic to implement +//! [`pezframe_support::pezpallet`] attribute macro does only requires the instance generic `I` to +//! be static (contrary to `decl_*` macro which requires instance generic to implement //! [`pezframe_support::traits::Instance`]). //! //! Thus support provides some instance types to be used, This allow some instantiable pezpallet to @@ -28,12 +28,12 @@ //! pub trait Config: another_pallet::Config {} //! ``` //! -//! NOTE: [`pezframe_support::pezpallet`] will reexport them inside the module, in order to make them -//! accessible to [`pezframe_support::construct_runtime`]. +//! NOTE: [`pezframe_support::pezpallet`] will reexport them inside the module, in order to make +//! them accessible to [`pezframe_support::construct_runtime`]. /// `Instance1` to be used for instantiable pallets defined with the -/// [`#[pezpallet]`](`pezframe_support::pezpallet`) macro. Instances 2-16 are also available but are hidden -/// from docs. +/// [`#[pezpallet]`](`pezframe_support::pezpallet`) macro. Instances 2-16 are also available but are +/// hidden from docs. #[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] pub struct Instance1; diff --git a/bizinikiwi/pezframe/support/src/lib.rs b/bizinikiwi/pezframe/support/src/lib.rs index 960949a8..c4b00198 100644 --- a/bizinikiwi/pezframe/support/src/lib.rs +++ b/bizinikiwi/pezframe/support/src/lib.rs @@ -57,9 +57,6 @@ pub mod __private { pub use impl_trait_for_tuples; pub use log; pub use paste; - pub use scale_info; - pub use serde; - pub use serde_json; pub use pezsp_core::{Get, OpaqueMetadata, Void}; pub use pezsp_crypto_hashing_proc_macro; pub use pezsp_inherents; @@ -77,6 +74,9 @@ pub mod __private { pub use pezsp_state_machine::BasicExternalities; pub use pezsp_std; pub use pezsp_tracing; + pub use scale_info; + pub use serde; + pub use serde_json; pub use tt_call::*; } @@ -128,8 +128,8 @@ pub use pezsp_runtime::{ }; use codec::{Decode, Encode}; -use scale_info::TypeInfo; use pezsp_runtime::TypeId; +use scale_info::TypeInfo; /// A unified log target for support operations. pub const LOG_TARGET: &str = "runtime::pezframe-support"; @@ -146,17 +146,18 @@ impl TypeId for PalletId { const TYPE_ID: [u8; 4] = *b"modl"; } -/// Generate a [`#[pezpallet::storage]`](pezpallet_macros::storage) alias outside of a pezpallet. +/// Generate a [`#[pezpallet::storage]`](pezpallet_macros::storage) alias outside of a +/// pezpallet. /// -/// This storage alias works similarly to the [`#[pezpallet::storage]`](pezpallet_macros::storage) -/// attribute macro. It supports [`StorageValue`](storage::types::StorageValue), -/// [`StorageMap`](storage::types::StorageMap), +/// This storage alias works similarly to the +/// [`#[pezpallet::storage]`](pezpallet_macros::storage) attribute macro. It supports +/// [`StorageValue`](storage::types::StorageValue), [`StorageMap`](storage::types::StorageMap), /// [`StorageDoubleMap`](storage::types::StorageDoubleMap) and /// [`StorageNMap`](storage::types::StorageNMap). The main difference to the normal -/// [`#[pezpallet::storage]`](pezpallet_macros::storage) is the flexibility around declaring the -/// storage prefix to use. The storage prefix determines where to find the value in the -/// storage. [`#[pezpallet::storage]`](pezpallet_macros::storage) uses the name of the pezpallet as -/// declared in [`construct_runtime!`]. +/// [`#[pezpallet::storage]`](pezpallet_macros::storage) is the flexibility around declaring +/// the storage prefix to use. The storage prefix determines where to find the value in the +/// storage. [`#[pezpallet::storage]`](pezpallet_macros::storage) uses the name of the +/// pezpallet as declared in [`construct_runtime!`]. /// /// The flexibility around declaring the storage prefix makes this macro very useful for /// writing migrations etc. @@ -166,9 +167,10 @@ impl TypeId for PalletId { /// There are different ways to declare the `prefix` to use. The `prefix` type can either be /// declared explicitly by passing it to the macro as an attribute or by letting the macro /// guess on what the `prefix` type is. The `prefix` is always passed as the first generic -/// argument to the type declaration. When using [`#[pezpallet::storage]`](pezpallet_macros::storage) -/// this first generic argument is always `_`. Besides declaring the `prefix`, the rest of the -/// type declaration works as with [`#[pezpallet::storage]`](pezpallet_macros::storage). +/// argument to the type declaration. When using +/// [`#[pezpallet::storage]`](pezpallet_macros::storage) this first generic argument is always +/// `_`. Besides declaring the `prefix`, the rest of the type declaration works as with +/// [`#[pezpallet::storage]`](pezpallet_macros::storage). /// /// 1. Use the `verbatim` prefix type. This prefix type uses the given identifier as the /// `prefix`: @@ -178,8 +180,8 @@ impl TypeId for PalletId { /// configured in [`construct_runtime!`] as the `prefix`: #[doc = docify::embed!("src/tests/storage_alias.rs", pezpallet_name_attribute)] /// It requires that the given prefix type implements -/// [`PalletInfoAccess`](traits::PalletInfoAccess) (which is always the case for FRAME pezpallet -/// structs). In the example above, `Pezpallet` is the prefix type. +/// [`PalletInfoAccess`](traits::PalletInfoAccess) (which is always the case for FRAME +/// pezpallet structs). In the example above, `Pezpallet` is the prefix type. /// /// 3. Use the `dynamic` prefix type. This prefix type calls [`Get::get()`](traits::Get::get) /// to get the `prefix`: @@ -187,8 +189,8 @@ impl TypeId for PalletId { /// It requires that the given prefix type implements [`Get<'static str>`](traits::Get). /// /// 4. Let the macro "guess" what kind of prefix type to use. This only supports verbatim or -/// pezpallet name. The macro uses the presence of generic arguments to the prefix type as an -/// indication that it should use the pezpallet name as the `prefix`: +/// pezpallet name. The macro uses the presence of generic arguments to the prefix type as +/// an indication that it should use the pezpallet name as the `prefix`: #[doc = docify::embed!("src/tests/storage_alias.rs", storage_alias_guess)] pub use pezframe_support_procedural::storage_alias; @@ -444,7 +446,6 @@ pub mod pezpallet_prelude { pub use core::marker::PhantomData; pub use pezframe_support::pezpallet_macros::*; pub use pezframe_support_procedural::{inject_runtime_type, register_default_impl}; - pub use scale_info::TypeInfo; pub use pezsp_inherents::MakeFatalError; pub use pezsp_runtime::{ traits::{ @@ -460,6 +461,7 @@ pub mod pezpallet_prelude { DispatchError, RuntimeDebug, MAX_MODULE_ERROR_ENCODED_SIZE, }; pub use pezsp_weights::Weight; + pub use scale_info::TypeInfo; } /// The pezpallet macro has 2 purposes: @@ -488,7 +490,8 @@ pub mod pezpallet_prelude { /// } /// ``` /// -/// The documentation for each individual part can be found at [pezframe_support::pezpallet_macros] +/// The documentation for each individual part can be found at +/// [pezframe_support::pezpallet_macros] /// /// ## Dev Mode (`#[pezpallet(dev_mode)]`) /// @@ -517,8 +520,9 @@ pub mod pezpallet_prelude { /// * Call indices no longer need to be specified on every `#[pezpallet::call]` declaration. By /// default, dev mode pallets will assume a call index based on the order of the call. /// * All storages are marked as unbounded, meaning you do not need to implement -/// [`MaxEncodedLen`](pezframe_support::pezpallet_prelude::MaxEncodedLen) on storage types. This is -/// equivalent to specifying `#[pezpallet::unbounded]` on all storage type definitions. +/// [`MaxEncodedLen`](pezframe_support::pezpallet_prelude::MaxEncodedLen) on storage types. +/// This is equivalent to specifying `#[pezpallet::unbounded]` on all storage type +/// definitions. /// * Storage hashers no longer need to be specified and can be replaced by `_`. In dev mode, /// these will be replaced by `Blake2_128Concat`. In case of explicit key-binding, `Hasher` /// can simply be ignored when in `dev_mode`. @@ -572,20 +576,20 @@ pub mod pezpallet_prelude { /// It also implements on the pezpallet: /// /// * [`GetStorageVersion`](pezframe_support::traits::GetStorageVersion) -/// * [`OnGenesis`](pezframe_support::traits::OnGenesis): contains some logic to write the pezpallet -/// version into storage. -/// * [`PalletInfoAccess`](pezframe_support::traits::PalletInfoAccess) to ease access to pezpallet -/// information given by [`pezframe_support::traits::PalletInfo`]. (The implementation uses the -/// associated type [`pezframe_support::traits::PalletInfo`]). -/// * [`StorageInfoTrait`](pezframe_support::traits::StorageInfoTrait) to give information about -/// storages. +/// * [`OnGenesis`](pezframe_support::traits::OnGenesis): contains some logic to write the +/// pezpallet version into storage. +/// * [`PalletInfoAccess`](pezframe_support::traits::PalletInfoAccess) to ease access to +/// pezpallet information given by [`pezframe_support::traits::PalletInfo`]. (The +/// implementation uses the associated type [`pezframe_support::traits::PalletInfo`]). +/// * [`StorageInfoTrait`](pezframe_support::traits::StorageInfoTrait) to give information +/// about storages. /// /// If the attribute `set_storage_max_encoded_len` is set then the macro calls /// [`StorageInfoTrait`](pezframe_support::traits::StorageInfoTrait) for each storage in the /// implementation of [`StorageInfoTrait`](pezframe_support::traits::StorageInfoTrait) for the /// pezpallet. Otherwise, it implements -/// [`StorageInfoTrait`](pezframe_support::traits::StorageInfoTrait) for the pezpallet using the -/// [`PartialStorageInfoTrait`](pezframe_support::traits::PartialStorageInfoTrait) +/// [`StorageInfoTrait`](pezframe_support::traits::StorageInfoTrait) for the pezpallet using +/// the [`PartialStorageInfoTrait`](pezframe_support::traits::PartialStorageInfoTrait) /// implementation of storages. /// /// ## Note on deprecation. @@ -717,9 +721,9 @@ pub mod pezpallet_macros { /// Declares a storage as unbounded in potential size. /// /// When implementing the storage info (when `#[pezpallet::generate_storage_info]` is - /// specified on the pezpallet struct placeholder), the size of the storage will be declared - /// as unbounded. This can be useful for storage which can never go into PoV (Proof of - /// Validity). + /// specified on the pezpallet struct placeholder), the size of the storage will be + /// declared as unbounded. This can be useful for storage which can never go into PoV + /// (Proof of Validity). /// /// ## Example /// @@ -780,8 +784,8 @@ pub mod pezpallet_macros { /// Ensures the trait item will not be used as a default with the /// `#[derive_impl(..)]` attribute macro. /// - /// The optional attribute `#[pezpallet::no_default]` can be attached to trait items within a - /// `Config` trait impl that has [`#[pezpallet::config(with_default)]`](`config`) + /// The optional attribute `#[pezpallet::no_default]` can be attached to trait items within + /// a `Config` trait impl that has [`#[pezpallet::config(with_default)]`](`config`) /// attached. pub use pezframe_support_procedural::no_default; @@ -789,21 +793,21 @@ pub mod pezpallet_macros { /// [`#[import_section]`](`import_section`). /// /// Note that sections are imported by their module name/ident, and should be referred to - /// by their _full path_ from the perspective of the target pezpallet. Do not attempt to make - /// use of `use` statements to bring pezpallet sections into scope, as this will not work - /// (unless you do so as part of a wildcard import, in which case it will work). + /// by their _full path_ from the perspective of the target pezpallet. Do not attempt to + /// make use of `use` statements to bring pezpallet sections into scope, as this will not + /// work (unless you do so as part of a wildcard import, in which case it will work). /// /// ## Naming Logistics /// - /// Also note that because of how `#[pezpallet_section]` works, pezpallet section names must be - /// globally unique _within the crate in which they are defined_. For more information on - /// why this must be the case, see macro_magic's + /// Also note that because of how `#[pezpallet_section]` works, pezpallet section names + /// must be globally unique _within the crate in which they are defined_. For more + /// information on why this must be the case, see macro_magic's /// [`#[export_tokens]`](https://docs.rs/macro_magic/latest/macro_magic/attr.export_tokens.html) macro. /// /// Optionally, you may provide an argument to `#[pezpallet_section]` such as - /// `#[pezpallet_section(some_ident)]`, in the event that there is another pezpallet section in - /// same crate with the same ident/name. The ident you specify can then be used instead of - /// the module's ident name when you go to import it via + /// `#[pezpallet_section(some_ident)]`, in the event that there is another pezpallet + /// section in same crate with the same ident/name. The ident you specify can then be used + /// instead of the module's ident name when you go to import it via /// [`#[import_section]`](`import_section`). pub use pezframe_support_procedural::pezpallet_section; @@ -915,9 +919,9 @@ pub mod pezpallet_macros { /// `use` statements within your pezpallet section, so they are imported as well, or by /// otherwise ensuring that you have the same imports on the target pezpallet. /// - /// It is perfectly permissible to import multiple pezpallet sections into the same pezpallet, - /// which can be done by having multiple `#[import_section(something)]` attributes - /// attached to the pezpallet. + /// It is perfectly permissible to import multiple pezpallet sections into the same + /// pezpallet, which can be done by having multiple `#[import_section(something)]` + /// attributes attached to the pezpallet. /// /// Note that sections are imported by their module name/ident, and should be referred to /// by their _full path_ from the perspective of the target pezpallet. @@ -944,7 +948,8 @@ pub mod pezpallet_macros { /// } /// ``` /// - /// See [`pezpallet::storage`](`pezframe_support::pezpallet_macros::storage`) for more info. + /// See [`pezpallet::storage`](`pezframe_support::pezpallet_macros::storage`) for more + /// info. pub use pezframe_support_procedural::getter; /// Defines constants that are added to the constant field of @@ -1036,9 +1041,9 @@ pub mod pezpallet_macros { /// ``` /// /// I.e. a regular trait definition named `Config`, with the supertrait - /// [`pezframe_system::pezpallet::Config`](../../pezframe_system/pezpallet/trait.Config.html), and - /// optionally other supertraits and a where clause. (Specifying other supertraits here is - /// known as [tight coupling](https://docs.pezkuwichain.io/reference/how-to-guides/pezpallet-design/use-tight-coupling/)) + /// [`pezframe_system::pezpallet::Config`](../../pezframe_system/pezpallet/trait.Config. + /// html), and optionally other supertraits and a where clause. (Specifying other + /// supertraits here is known as [tight coupling](https://docs.pezkuwichain.io/reference/how-to-guides/pezpallet-design/use-tight-coupling/)) /// /// ## Optional: `with_default` /// @@ -1081,15 +1086,16 @@ pub mod pezpallet_macros { /// As shown above: /// * you may attach the [`#[pezpallet::no_default]`](`no_default`) /// attribute to specify that a particular trait item _cannot_ be used as a default when a - /// test `Config` is derived using the [`#[derive_impl(..)]`](`pezframe_support::derive_impl`) - /// attribute macro. This will cause that particular trait item to simply not appear in - /// default testing configs based on this config (the trait item will not be included in - /// `DefaultConfig`). + /// test `Config` is derived using the + /// [`#[derive_impl(..)]`](`pezframe_support::derive_impl`) attribute macro. This will + /// cause that particular trait item to simply not appear in default testing configs based + /// on this config (the trait item will not be included in `DefaultConfig`). /// * you may attach the [`#[pezpallet::no_default_bounds]`](`no_default_bounds`) /// attribute to specify that a particular trait item can be used as a default when a - /// test `Config` is derived using the [`#[derive_impl(..)]`](`pezframe_support::derive_impl`) - /// attribute macro. But its bounds cannot be enforced at this point and should be - /// discarded when generating the default config trait. + /// test `Config` is derived using the + /// [`#[derive_impl(..)]`](`pezframe_support::derive_impl`) attribute macro. But its + /// bounds cannot be enforced at this point and should be discarded when generating the + /// default config trait. /// * you may not specify any attribute to generate a trait item in the default config /// trait. /// @@ -1108,11 +1114,11 @@ pub mod pezpallet_macros { /// /// Consequently: /// - Any items that rely on externalities _must_ be marked with - /// [`#[pezpallet::no_default]`](`no_default`) or your trait will fail to compile when used - /// with [`derive_impl`](`pezframe_support::derive_impl`). - /// - Items marked with [`#[pezpallet::no_default]`](`no_default`) are entirely excluded from - /// the `DefaultConfig` trait, and therefore any impl of `DefaultConfig` doesn't need to - /// implement such items. + /// [`#[pezpallet::no_default]`](`no_default`) or your trait will fail to compile when + /// used with [`derive_impl`](`pezframe_support::derive_impl`). + /// - Items marked with [`#[pezpallet::no_default]`](`no_default`) are entirely excluded + /// from the `DefaultConfig` trait, and therefore any impl of `DefaultConfig` doesn't + /// need to implement such items. /// /// For more information, see: /// * [`pezframe_support::derive_impl`]. @@ -1246,8 +1252,8 @@ pub mod pezpallet_macros { /// [`ValidateUnsigned`](pezframe_support::pezpallet_prelude::ValidateUnsigned) for /// type `Pezpallet`, and some optional where clause. /// - /// NOTE: There is also the [`pezsp_runtime::traits::TransactionExtension`] trait that can be - /// used to add some specific logic for transaction validation. + /// NOTE: There is also the [`pezsp_runtime::traits::TransactionExtension`] trait that can + /// be used to add some specific logic for transaction validation. /// /// ## Macro expansion /// @@ -1258,9 +1264,9 @@ pub mod pezpallet_macros { /// Allows defining view functions on a pezpallet. /// /// A pezpallet view function is a read-only function providing access to the state of the - /// pezpallet from both outside and inside the runtime. It should provide a _stable_ interface - /// for querying the state of the pezpallet, avoiding direct storage access and upgrading - /// along with the runtime. + /// pezpallet from both outside and inside the runtime. It should provide a _stable_ + /// interface for querying the state of the pezpallet, avoiding direct storage access and + /// upgrading along with the runtime. /// /// ## Syntax /// View functions methods must be read-only and always return some output. A @@ -1295,23 +1301,23 @@ pub mod pezpallet_macros { /// /// ## Usage and implementation details /// To allow outside access to pezpallet view functions, you need to add a runtime API that - /// accepts view function queries and dispatches them to the right pezpallet. You can do that - /// by implementing the + /// accepts view function queries and dispatches them to the right pezpallet. You can do + /// that by implementing the /// [`RuntimeViewFunction`](pezframe_support::view_functions::runtime_api::RuntimeViewFunction) /// trait for the runtime inside an [`impl_runtime_apis!`](pezsp_api::impl_runtime_apis) /// block. /// /// The `RuntimeViewFunction` trait implements a hashing-based dispatching mechanism to - /// dispatch view functions to the right method in the right pezpallet based on their IDs. A - /// view function ID depends both on its pezpallet and on its method signature, so it remains - /// stable as long as those two elements are not modified. In general, pezpallet view - /// functions should expose a _stable_ interface and changes to the method signature are - /// strongly discouraged. For more details on the dispatching mechanism, see the + /// dispatch view functions to the right method in the right pezpallet based on their IDs. + /// A view function ID depends both on its pezpallet and on its method signature, so it + /// remains stable as long as those two elements are not modified. In general, pezpallet + /// view functions should expose a _stable_ interface and changes to the method signature + /// are strongly discouraged. For more details on the dispatching mechanism, see the /// [`DispatchViewFunction`](pezframe_support::view_functions::DispatchViewFunction) trait. pub use pezframe_support_procedural::view_functions; - /// Allows defining a struct implementing the [`Get`](pezframe_support::traits::Get) trait to - /// ease the use of storage types. + /// Allows defining a struct implementing the [`Get`](pezframe_support::traits::Get) trait + /// to ease the use of storage types. /// /// This attribute is meant to be used alongside [`#[pezpallet::storage]`](`storage`) to /// define a storage's default value. This attribute can be used multiple times. @@ -1498,8 +1504,8 @@ pub mod pezpallet_macros { /// /// ### Macro expansion /// - /// The macro implements the [`pezpallet_skip_feeless_payment::CheckIfFeeless`] trait on the - /// dispatchable and calls the corresponding closure in the implementation. + /// The macro implements the [`pezpallet_skip_feeless_payment::CheckIfFeeless`] trait on + /// the dispatchable and calls the corresponding closure in the implementation. /// /// [`pezpallet_skip_feeless_payment::SkipCheckIfFeeless`]: ../../pezpallet_skip_feeless_payment/struct.SkipCheckIfFeeless.html /// [`pezpallet_skip_feeless_payment::CheckIfFeeless`]: ../../pezpallet_skip_feeless_payment/struct.SkipCheckIfFeeless.html @@ -1562,8 +1568,8 @@ pub mod pezpallet_macros { /// /// ## Note on deprecation of Errors /// - /// - Usage of `deprecated` attribute will propagate deprecation information to the pezpallet - /// metadata where the item was declared. + /// - Usage of `deprecated` attribute will propagate deprecation information to the + /// pezpallet metadata where the item was declared. /// - For general usage examples of `deprecated` attribute please refer to /// - It's possible to deprecated either certain variants inside the `Error` or the whole /// `Error` itself. If both the `Error` and its variants are deprecated a compile error @@ -1618,8 +1624,8 @@ pub mod pezpallet_macros { /// /// ## Note on deprecation of Events /// - /// - Usage of `deprecated` attribute will propagate deprecation information to the pezpallet - /// metadata where the item was declared. + /// - Usage of `deprecated` attribute will propagate deprecation information to the + /// pezpallet metadata where the item was declared. /// - For general usage examples of `deprecated` attribute please refer to /// - It's possible to deprecated either certain variants inside the `Event` or the whole /// `Event` itself. If both the `Event` and its variants are deprecated a compile error @@ -1749,11 +1755,12 @@ pub mod pezpallet_macros { /// ## Weight info /// /// Each call needs to define a weight. - /// * The weight can be defined explicitly using the attribute `#[pezpallet::weight($expr)]` - /// (Note that argument of the call are available inside the expression). + /// * The weight can be defined explicitly using the attribute + /// `#[pezpallet::weight($expr)]` (Note that argument of the call are available inside + /// the expression). /// * Or it can be defined implicitly, the weight info for the calls needs to be specified - /// in the call attribute: `#[pezpallet::call(weight = $WeightInfo)]`, then each call that - /// doesn't have explicit weight will use `$WeightInfo::$call_name` as the weight. + /// in the call attribute: `#[pezpallet::call(weight = $WeightInfo)]`, then each call + /// that doesn't have explicit weight will use `$WeightInfo::$call_name` as the weight. /// /// * Or it can be simply ignored when the pezpallet is in `dev_mode`. /// @@ -1827,8 +1834,8 @@ pub mod pezpallet_macros { /// /// ## Note on deprecation of Calls /// - /// - Usage of `deprecated` attribute will propagate deprecation information to the pezpallet - /// metadata where the item was declared. + /// - Usage of `deprecated` attribute will propagate deprecation information to the + /// pezpallet metadata where the item was declared. /// - For general usage examples of `deprecated` attribute please refer to /// - Usage of `allow(deprecated)` on the item will propagate this attribute to the /// generated code. @@ -1885,8 +1892,8 @@ pub mod pezpallet_macros { pub use pezframe_support_procedural::genesis_config; /// Allows you to define how the state of your pezpallet at genesis is built. This - /// takes as input the `GenesisConfig` type (as `self`) and constructs the pezpallet's initial - /// state. + /// takes as input the `GenesisConfig` type (as `self`) and constructs the pezpallet's + /// initial state. /// /// The fields of the `GenesisConfig` can in turn be populated by the chain-spec. /// @@ -1947,8 +1954,8 @@ pub mod pezpallet_macros { pub use pezframe_support_procedural::genesis_build; /// Allows adding an associated type trait bounded by - /// [`Get`](pezframe_support::pezpallet_prelude::Get) from [`pezpallet::config`](`macro@config`) - /// into metadata. + /// [`Get`](pezframe_support::pezpallet_prelude::Get) from + /// [`pezpallet::config`](`macro@config`) into metadata. /// /// ## Example /// @@ -1969,8 +1976,8 @@ pub mod pezpallet_macros { /// /// ## Note on deprecation of constants /// - /// - Usage of `deprecated` attribute will propagate deprecation information to the pezpallet - /// metadata where the item was declared. + /// - Usage of `deprecated` attribute will propagate deprecation information to the + /// pezpallet metadata where the item was declared. /// - For general usage examples of `deprecated` attribute please refer to /// - Usage of `allow(deprecated)` on the item will propagate this attribute to the /// generated code. @@ -1983,7 +1990,8 @@ pub mod pezpallet_macros { /// Storage items are pointers to data stored on-chain (the *blockchain state*), under a /// specific key. The exact key is dependent on the type of the storage. /// - /// > From the perspective of this pezpallet, the entire blockchain state is abstracted behind + /// > From the perspective of this pezpallet, the entire blockchain state is abstracted + /// > behind /// > a key-value api, namely [`pezsp_io::storage`]. /// /// ## Storage Types @@ -2016,8 +2024,8 @@ pub mod pezpallet_macros { /// Each `Key` type requires its own designated `Hasher` declaration, so that /// [`StorageDoubleMap`](pezframe_support::storage::types::StorageDoubleMap) needs two of /// each, and [`StorageNMap`](pezframe_support::storage::types::StorageNMap) needs `N` such - /// pairs. Since [`StorageValue`](pezframe_support::storage::types::StorageValue) only stores - /// a single element, no configuration of hashers is needed. + /// pairs. Since [`StorageValue`](pezframe_support::storage::types::StorageValue) only + /// stores a single element, no configuration of hashers is needed. /// /// ### Syntax /// @@ -2077,24 +2085,25 @@ pub mod pezpallet_macros { /// /// There are three types of queries: /// - /// 1. [`OptionQuery`](pezframe_support::storage::types::OptionQuery): The default query type. - /// It returns `Some(V)` if the value is present, or `None` if it isn't, where `V` is - /// the value type. - /// 2. [`ValueQuery`](pezframe_support::storage::types::ValueQuery): Returns the value itself - /// if present; otherwise, it returns `Default::default()`. This behavior can be + /// 1. [`OptionQuery`](pezframe_support::storage::types::OptionQuery): The default query + /// type. It returns `Some(V)` if the value is present, or `None` if it isn't, where `V` + /// is the value type. + /// 2. [`ValueQuery`](pezframe_support::storage::types::ValueQuery): Returns the value + /// itself if present; otherwise, it returns `Default::default()`. This behavior can be /// adjusted with the `OnEmpty` generic parameter, which defaults to `OnEmpty = /// GetDefault`. - /// 3. [`ResultQuery`](pezframe_support::storage::types::ResultQuery): Returns `Result`, - /// where `V` is the value type. + /// 3. [`ResultQuery`](pezframe_support::storage::types::ResultQuery): Returns `Result`, where `V` is the value type. /// - /// See [`QueryKind`](pezframe_support::storage::types::QueryKindTrait) for further examples. + /// See [`QueryKind`](pezframe_support::storage::types::QueryKindTrait) for further + /// examples. /// /// ### Optimized Appending /// /// All storage items — such as /// [`StorageValue`](pezframe_support::storage::types::StorageValue), - /// [`StorageMap`](pezframe_support::storage::types::StorageMap), and their variants—offer an - /// `::append()` method optimized for collections. Using this method avoids the + /// [`StorageMap`](pezframe_support::storage::types::StorageMap), and their variants—offer + /// an `::append()` method optimized for collections. Using this method avoids the /// inefficiency of decoding and re-encoding entire collections when adding items. For /// instance, consider the storage declaration `type MyVal = StorageValue<_, Vec, /// ValueQuery>`. With `MyVal` storing a large list of bytes, `::append()` lets you @@ -2121,9 +2130,9 @@ pub mod pezpallet_macros { /// ### Hashers /// /// For all storage types, except - /// [`StorageValue`](pezframe_support::storage::types::StorageValue), a set of hashers needs - /// to be specified. The choice of hashers is crucial, especially in production chains. The - /// purpose of storage hashers in maps is to ensure the keys of a map are + /// [`StorageValue`](pezframe_support::storage::types::StorageValue), a set of hashers + /// needs to be specified. The choice of hashers is crucial, especially in production + /// chains. The purpose of storage hashers in maps is to ensure the keys of a map are /// uniformly distributed. An unbalanced map/trie can lead to inefficient performance. /// /// In general, hashers are categorized as either cryptographically secure or not. The @@ -2149,10 +2158,11 @@ pub mod pezpallet_macros { /// /// Internally, every storage type generates a "prefix". This prefix serves as the initial /// segment of the key utilized to store values in the on-chain state (i.e., the final key - /// used in [`pezsp_io::storage`](pezsp_io::storage)). For all storage types, the following rule - /// applies: + /// used in [`pezsp_io::storage`](pezsp_io::storage)). For all storage types, the following + /// rule applies: /// - /// > The storage prefix begins with `twox128(pezpallet_prefix) ++ twox128(STORAGE_PREFIX)`, + /// > The storage prefix begins with `twox128(pezpallet_prefix) ++ + /// > twox128(STORAGE_PREFIX)`, /// > where /// > `pezpallet_prefix` is the name assigned to the pezpallet instance in /// > [`pezframe_support::construct_runtime`](pezframe_support::construct_runtime), and @@ -2160,9 +2170,9 @@ pub mod pezpallet_macros { /// > as /// > `Foo` in `type Foo = StorageValue<..>`. /// - /// For [`StorageValue`](pezframe_support::storage::types::StorageValue), no additional key is - /// required. For map types, the prefix is extended with one or more keys defined by the - /// map. + /// For [`StorageValue`](pezframe_support::storage::types::StorageValue), no additional key + /// is required. For map types, the prefix is extended with one or more keys defined by + /// the map. /// /// #### Example #[doc = docify::embed!("src/lib.rs", example_storage_value_map_prefixes)] @@ -2197,8 +2207,8 @@ pub mod pezpallet_macros { /// /// ## Note on deprecation of storage items /// - /// - Usage of `deprecated` attribute will propagate deprecation information to the pezpallet - /// metadata where the storage item was declared. + /// - Usage of `deprecated` attribute will propagate deprecation information to the + /// pezpallet metadata where the storage item was declared. /// - For general usage examples of `deprecated` attribute please refer to /// - Usage of `allow(deprecated)` on the item will propagate this attribute to the /// generated code. @@ -2270,7 +2280,9 @@ pub mod pezpallet_macros { pub use pezframe_support_procedural::origin; } -#[deprecated(note = "Will be removed after July 2023; Use `pezsp_runtime::traits` directly instead.")] +#[deprecated( + note = "Will be removed after July 2023; Use `pezsp_runtime::traits` directly instead." +)] pub mod error { #[doc(hidden)] pub use pezsp_runtime::traits::{BadOrigin, LookupError}; diff --git a/bizinikiwi/pezframe/support/src/migrations.rs b/bizinikiwi/pezframe/support/src/migrations.rs index 562c6486..29ae008a 100644 --- a/bizinikiwi/pezframe/support/src/migrations.rs +++ b/bizinikiwi/pezframe/support/src/migrations.rs @@ -264,14 +264,14 @@ pub fn migrate_from_pallet_version_to_storage_version< /// pezpallet. /// /// This struct is generic over two parameters: -/// - `P` is a type that implements the `Get` trait for a static string, representing the pezpallet's -/// name. +/// - `P` is a type that implements the `Get` trait for a static string, representing the +/// pezpallet's name. /// - `DbWeight` is a type that implements the `Get` trait for `RuntimeDbWeight`, providing the /// weight for database operations. /// /// On runtime upgrade, the `on_runtime_upgrade` function will clear all storage items associated -/// with the specified pezpallet, logging the number of keys removed. If the `try-runtime` feature is -/// enabled, the `pre_upgrade` and `post_upgrade` functions can be used to verify the storage +/// with the specified pezpallet, logging the number of keys removed. If the `try-runtime` feature +/// is enabled, the `pre_upgrade` and `post_upgrade` functions can be used to verify the storage /// removal before and after the upgrade. /// /// # Examples: @@ -314,8 +314,8 @@ pub fn migrate_from_pallet_version_to_storage_version< pub struct RemovePallet, DbWeight: Get>( PhantomData<(P, DbWeight)>, ); -impl, DbWeight: Get> pezframe_support::traits::OnRuntimeUpgrade - for RemovePallet +impl, DbWeight: Get> + pezframe_support::traits::OnRuntimeUpgrade for RemovePallet { fn on_runtime_upgrade() -> pezframe_support::weights::Weight { let hashed_prefix = twox_128(P::get().as_bytes()); @@ -369,8 +369,8 @@ impl, DbWeight: Get> pezframe_support::tra /// `RemoveStorage` is a utility struct used to remove a storage item from a specific pezpallet. /// /// This struct is generic over three parameters: -/// - `P` is a type that implements the [`Get`] trait for a static string, representing the pezpallet's -/// name. +/// - `P` is a type that implements the [`Get`] trait for a static string, representing the +/// pezpallet's name. /// - `S` is a type that implements the [`Get`] trait for a static string, representing the storage /// name. /// - `DbWeight` is a type that implements the [`Get`] trait for [`RuntimeDbWeight`], providing the @@ -721,8 +721,10 @@ pub trait SteppedMigrations { /// /// Returns `None` if the index is out of bounds. #[cfg(feature = "try-runtime")] - fn nth_post_upgrade(n: u32, _state: Vec) - -> Option>; + fn nth_post_upgrade( + n: u32, + _state: Vec, + ) -> Option>; /// The maximal encoded length across all cursors. fn cursor_max_encoded_len() -> usize; @@ -882,7 +884,10 @@ impl SteppedMigrations for T { } #[cfg(feature = "try-runtime")] - fn nth_post_upgrade(n: u32, state: Vec) -> Option> { + fn nth_post_upgrade( + n: u32, + state: Vec, + ) -> Option> { if n != 0 { defensive!("nth_post_upgrade should only be called with n==0"); } @@ -970,7 +975,10 @@ impl SteppedMigrations for Tuple { } #[cfg(feature = "try-runtime")] - fn nth_post_upgrade(n: u32, state: Vec) -> Option> { + fn nth_post_upgrade( + n: u32, + state: Vec, + ) -> Option> { let mut i = 0; for_tuples! ( #( diff --git a/bizinikiwi/pezframe/support/src/storage/child.rs b/bizinikiwi/pezframe/support/src/storage/child.rs index eaeeba34..7052b5c5 100644 --- a/bizinikiwi/pezframe/support/src/storage/child.rs +++ b/bizinikiwi/pezframe/support/src/storage/child.rs @@ -208,7 +208,8 @@ pub fn kill(child_info: &ChildInfo, key: &[u8]) { /// Get a Vec of bytes from storage. pub fn get_raw(child_info: &ChildInfo, key: &[u8]) -> Option> { match child_info.child_type() { - ChildType::ParentKeyId => pezsp_io::default_child_storage::get(child_info.storage_key(), key), + ChildType::ParentKeyId => + pezsp_io::default_child_storage::get(child_info.storage_key(), key), } } diff --git a/bizinikiwi/pezframe/support/src/storage/migration.rs b/bizinikiwi/pezframe/support/src/storage/migration.rs index af6997b3..b6a2ad37 100644 --- a/bizinikiwi/pezframe/support/src/storage/migration.rs +++ b/bizinikiwi/pezframe/support/src/storage/migration.rs @@ -311,8 +311,8 @@ pub fn take_storage_item /// /// # Example /// -/// If a pezpallet named "my_example" has 2 storages named "Foo" and "Bar" and the pezpallet is renamed -/// "my_new_example_name", a migration can be: +/// If a pezpallet named "my_example" has 2 storages named "Foo" and "Bar" and the pezpallet is +/// renamed "my_new_example_name", a migration can be: /// ``` /// # use pezframe_support::storage::migration::move_storage_from_pallet; /// # pezsp_io::TestExternalities::new_empty().execute_with(|| { diff --git a/bizinikiwi/pezframe/support/src/storage/mod.rs b/bizinikiwi/pezframe/support/src/storage/mod.rs index 1c93e240..2f21731d 100644 --- a/bizinikiwi/pezframe/support/src/storage/mod.rs +++ b/bizinikiwi/pezframe/support/src/storage/mod.rs @@ -885,8 +885,9 @@ pub trait StorageNMap { /// Attempt to remove items from the map matching a `partial_key` prefix. /// - /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once - /// the resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. + /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. + /// Once the resultant `maybe_cursor` field is `None`, then no further items remain to be + /// deleted. /// /// NOTE: After the initial call for any given map, it is important that no further items /// are inserted into the map which match the `partial key`. If so, then the map may not be @@ -1391,8 +1392,9 @@ pub trait StoragePrefixedMap { /// Attempt to remove all items from the map. /// - /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once - /// the resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. + /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. + /// Once the resultant `maybe_cursor` field is `None`, then no further items remain to be + /// deleted. /// /// NOTE: After the initial call for any given map, it is important that no further items /// are inserted into the map. If so, then the map may not be empty when the resultant @@ -1752,8 +1754,8 @@ mod test { use super::*; use crate::{assert_ok, hash::Identity, pezpallet_prelude::NMapKey, Twox128}; use bounded_vec::BoundedVec; - use pezframe_support::traits::ConstU32; use generator::StorageValue as _; + use pezframe_support::traits::ConstU32; use pezsp_crypto_hashing::twox_128; use pezsp_io::TestExternalities; use weak_bounded_vec::WeakBoundedVec; diff --git a/bizinikiwi/pezframe/support/src/storage/storage_noop_guard.rs b/bizinikiwi/pezframe/support/src/storage/storage_noop_guard.rs index 3992e304..06a16114 100644 --- a/bizinikiwi/pezframe/support/src/storage/storage_noop_guard.rs +++ b/bizinikiwi/pezframe/support/src/storage/storage_noop_guard.rs @@ -59,7 +59,10 @@ impl<'a> StorageNoopGuard<'a> { /// Creates a new [`StorageNoopGuard`] with a custom error message. pub fn from_error_message(error_message: &'a str) -> Self { - Self { storage_root: pezsp_io::storage::root(pezsp_runtime::StateVersion::V1), error_message } + Self { + storage_root: pezsp_io::storage::root(pezsp_runtime::StateVersion::V1), + error_message, + } } /// Sets a custom error message for a [`StorageNoopGuard`]. diff --git a/bizinikiwi/pezframe/support/src/storage/types/counted_map.rs b/bizinikiwi/pezframe/support/src/storage/types/counted_map.rs index 980861a3..0f150031 100644 --- a/bizinikiwi/pezframe/support/src/storage/types/counted_map.rs +++ b/bizinikiwi/pezframe/support/src/storage/types/counted_map.rs @@ -338,8 +338,9 @@ where /// Attempt to remove all items from the map. /// - /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once - /// the resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. + /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. + /// Once the resultant `maybe_cursor` field is `None`, then no further items remain to be + /// deleted. /// /// NOTE: After the initial call for any given map, it is important that no further items /// are inserted into the map. If so, then the map may not be empty when the resultant diff --git a/bizinikiwi/pezframe/support/src/storage/types/counted_nmap.rs b/bizinikiwi/pezframe/support/src/storage/types/counted_nmap.rs index fc77585a..b2a76592 100644 --- a/bizinikiwi/pezframe/support/src/storage/types/counted_nmap.rs +++ b/bizinikiwi/pezframe/support/src/storage/types/counted_nmap.rs @@ -239,8 +239,9 @@ where /// Attempt to remove items from the map matching a `partial_key` prefix. /// - /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once - /// the resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. + /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. + /// Once the resultant `maybe_cursor` field is `None`, then no further items remain to be + /// deleted. /// /// NOTE: After the initial call for any given map, it is important that no further items /// are inserted into the map which match the `partial key`. If so, then the map may not be @@ -401,8 +402,9 @@ where /// Attempt to remove all items from the map. /// - /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once - /// the resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. + /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. + /// Once the resultant `maybe_cursor` field is `None`, then no further items remain to be + /// deleted. /// /// NOTE: After the initial call for any given map, it is important that no further items /// are inserted into the map. If so, then the map may not be empty when the resultant diff --git a/bizinikiwi/pezframe/support/src/storage/types/double_map.rs b/bizinikiwi/pezframe/support/src/storage/types/double_map.rs index 5f04de07..1c64c730 100644 --- a/bizinikiwi/pezframe/support/src/storage/types/double_map.rs +++ b/bizinikiwi/pezframe/support/src/storage/types/double_map.rs @@ -330,8 +330,9 @@ where /// Attempt to remove items from the map matching a `first_key` prefix. /// - /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once - /// the resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. + /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. + /// Once the resultant `maybe_cursor` field is `None`, then no further items remain to be + /// deleted. /// /// NOTE: After the initial call for any given map, it is important that no further items /// are inserted into the map which match the `first_key`. If so, then the map may not be @@ -523,8 +524,9 @@ where /// Attempt to remove all items from the map. /// - /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once - /// the resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. + /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. + /// Once the resultant `maybe_cursor` field is `None`, then no further items remain to be + /// deleted. /// /// NOTE: After the initial call for any given map, it is important that no further items /// are inserted into the map. If so, then the map may not be empty when the resultant diff --git a/bizinikiwi/pezframe/support/src/storage/types/map.rs b/bizinikiwi/pezframe/support/src/storage/types/map.rs index 7341e0ed..bcc22e72 100644 --- a/bizinikiwi/pezframe/support/src/storage/types/map.rs +++ b/bizinikiwi/pezframe/support/src/storage/types/map.rs @@ -89,8 +89,8 @@ where Key: FullCodec + MaxEncodedLen, { fn get() -> u32 { - // The `max_len` of the key hash plus the pezpallet prefix and storage prefix (which both are - // hashed with `Twox128`). + // The `max_len` of the key hash plus the pezpallet prefix and storage prefix (which both + // are hashed with `Twox128`). let z = Hasher::max_len::() + Twox128::max_len::<()>() * 2; z as u32 } @@ -336,8 +336,9 @@ where /// Attempt to remove all items from the map. /// - /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once - /// the resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. + /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. + /// Once the resultant `maybe_cursor` field is `None`, then no further items remain to be + /// deleted. /// /// NOTE: After the initial call for any given map, it is important that no further items /// are inserted into the map. If so, then the map may not be empty when the resultant diff --git a/bizinikiwi/pezframe/support/src/storage/types/nmap.rs b/bizinikiwi/pezframe/support/src/storage/types/nmap.rs index 45fa1c74..e7acb018 100755 --- a/bizinikiwi/pezframe/support/src/storage/types/nmap.rs +++ b/bizinikiwi/pezframe/support/src/storage/types/nmap.rs @@ -37,8 +37,8 @@ use pezsp_runtime::SaturatedConversion; /// A type representing an *NMap* in storage. This structure associates an arbitrary number of keys /// with a value of a specified type stored on-chain. /// -/// For example, [`StorageDoubleMap`](pezframe_support::storage::types::StorageDoubleMap) is a special -/// case of an *NMap* with N = 2. +/// For example, [`StorageDoubleMap`](pezframe_support::storage::types::StorageDoubleMap) is a +/// special case of an *NMap* with N = 2. /// /// For general information regarding the `#[pezpallet::storage]` attribute, refer to /// [`crate::pezpallet_macros::storage`]. @@ -238,8 +238,9 @@ where /// Attempt to remove items from the map matching a `partial_key` prefix. /// - /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once - /// the resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. + /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. + /// Once the resultant `maybe_cursor` field is `None`, then no further items remain to be + /// deleted. /// /// NOTE: After the initial call for any given map, it is important that no further items /// are inserted into the map which match the `partial key`. If so, then the map may not be @@ -402,8 +403,9 @@ where /// Attempt to remove all items from the map. /// - /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once - /// the resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. + /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. + /// Once the resultant `maybe_cursor` field is `None`, then no further items remain to be + /// deleted. /// /// NOTE: After the initial call for any given map, it is important that no further items /// are inserted into the map. If so, then the map may not be empty when the resultant diff --git a/bizinikiwi/pezframe/support/src/storage/unhashed.rs b/bizinikiwi/pezframe/support/src/storage/unhashed.rs index 2581e048..062b872c 100644 --- a/bizinikiwi/pezframe/support/src/storage/unhashed.rs +++ b/bizinikiwi/pezframe/support/src/storage/unhashed.rs @@ -127,8 +127,8 @@ pub fn kill_prefix(prefix: &[u8], limit: Option) -> pezsp_io::KillStorageRe /// cursor need not be passed in and a `None` may be passed instead. This exception may be useful /// then making this call solely from a block-hook such as `on_initialize`. /// -/// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once the -/// resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. +/// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once +/// the resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. /// /// NOTE: After the initial call for any given child storage, it is important that no keys further /// keys are inserted. If so, then they may or may not be deleted by subsequent calls. diff --git a/bizinikiwi/pezframe/support/src/tests/storage_alias.rs b/bizinikiwi/pezframe/support/src/tests/storage_alias.rs index ac277c84..ef635f5c 100644 --- a/bizinikiwi/pezframe/support/src/tests/storage_alias.rs +++ b/bizinikiwi/pezframe/support/src/tests/storage_alias.rs @@ -128,8 +128,8 @@ fn pezpallet_name_attribute() { Value::::put(1); assert_eq!(1, Value::::get().unwrap()); - // The prefix is the pezpallet name. In this case the pezpallet name is `System` as declared in - // `construct_runtime!`. + // The prefix is the pezpallet name. In this case the pezpallet name is `System` as declared + // in `construct_runtime!`. assert_eq!(&b"System"[..], Value::::pezpallet_prefix()); }); } diff --git a/bizinikiwi/pezframe/support/src/traits/dynamic_params.rs b/bizinikiwi/pezframe/support/src/traits/dynamic_params.rs index d65f2efb..85acdcca 100644 --- a/bizinikiwi/pezframe/support/src/traits/dynamic_params.rs +++ b/bizinikiwi/pezframe/support/src/traits/dynamic_params.rs @@ -83,8 +83,8 @@ impl AggregatedKeyValue for () { /// Allows to create a `ParameterStore` from a `RuntimeParameterStore`. /// -/// This concretization is useful when configuring pallets, since a pezpallet will require a parameter -/// store for its own KV type and not the aggregated runtime-wide KV type. +/// This concretization is useful when configuring pallets, since a pezpallet will require a +/// parameter store for its own KV type and not the aggregated runtime-wide KV type. pub struct ParameterStoreAdapter(core::marker::PhantomData<(PS, KV)>); impl ParameterStore for ParameterStoreAdapter diff --git a/bizinikiwi/pezframe/support/src/traits/error.rs b/bizinikiwi/pezframe/support/src/traits/error.rs index 0024ab9c..2dfdc2a3 100644 --- a/bizinikiwi/pezframe/support/src/traits/error.rs +++ b/bizinikiwi/pezframe/support/src/traits/error.rs @@ -25,16 +25,16 @@ use core::marker::PhantomData; /// ## Notes /// /// The pezpallet error enum has a maximum encoded size as defined by -/// [`pezframe_support::MAX_MODULE_ERROR_ENCODED_SIZE`]. If the pezpallet error type exceeds this size -/// limit, a static assertion during compilation will fail. The compilation error will be in the -/// format of `error[E0080]: evaluation of constant value failed` due to the usage of +/// [`pezframe_support::MAX_MODULE_ERROR_ENCODED_SIZE`]. If the pezpallet error type exceeds this +/// size limit, a static assertion during compilation will fail. The compilation error will be in +/// the format of `error[E0080]: evaluation of constant value failed` due to the usage of /// const assertions. pub trait PalletError: Encode + Decode { /// The maximum encoded size for the implementing type. /// /// This will be used to check whether the pezpallet error type is less than or equal to - /// [`pezframe_support::MAX_MODULE_ERROR_ENCODED_SIZE`], and if it is, a compilation error will be - /// thrown. + /// [`pezframe_support::MAX_MODULE_ERROR_ENCODED_SIZE`], and if it is, a compilation error will + /// be thrown. const MAX_ENCODED_SIZE: usize; } diff --git a/bizinikiwi/pezframe/support/src/traits/hooks.rs b/bizinikiwi/pezframe/support/src/traits/hooks.rs index 20c4f81c..3505b9e4 100644 --- a/bizinikiwi/pezframe/support/src/traits/hooks.rs +++ b/bizinikiwi/pezframe/support/src/traits/hooks.rs @@ -397,8 +397,8 @@ impl_for_tuples_attr! { /// > because they are not part of the consensus/main block building logic. See /// > [`OffchainWorker`](crate::traits::misc::OffchainWorker) for more information. /// -/// To learn more about the execution of hooks see the FRAME `Executive` pezpallet which is in charge -/// of dispatching extrinsics and calling hooks in the correct order. +/// To learn more about the execution of hooks see the FRAME `Executive` pezpallet which is in +/// charge of dispatching extrinsics and calling hooks in the correct order. pub trait Hooks { /// Block initialization hook. This is called at the very beginning of block execution. /// @@ -414,8 +414,8 @@ pub trait Hooks { /// complexity. For example, do not execute any unbounded iterations. /// /// NOTE: This function is called BEFORE ANY extrinsic in a block is applied, including inherent - /// extrinsics. Hence for instance, if you runtime includes `pezpallet-timestamp`, the `timestamp` - /// is not yet up to date at this point. + /// extrinsics. Hence for instance, if you runtime includes `pezpallet-timestamp`, the + /// `timestamp` is not yet up to date at this point. fn on_initialize(_n: BlockNumber) -> Weight { Weight::zero() } @@ -461,9 +461,9 @@ pub trait Hooks { /// Hook executed when a code change (aka. a "runtime upgrade") is detected by the FRAME /// `Executive` pezpallet. /// - /// Be aware that this is called before [`Hooks::on_initialize`] of any pezpallet; therefore, a lot - /// of the critical storage items such as `block_number` in system pezpallet might have not been - /// set yet. + /// Be aware that this is called before [`Hooks::on_initialize`] of any pezpallet; therefore, a + /// lot of the critical storage items such as `block_number` in system pezpallet might have not + /// been set yet. /// /// Similar to [`Hooks::on_initialize`], any code in this block is mandatory and MUST execute. /// It is strongly recommended to dry-run the execution of these hooks using diff --git a/bizinikiwi/pezframe/support/src/traits/messages.rs b/bizinikiwi/pezframe/support/src/traits/messages.rs index 6173cfd3..9e9f085d 100644 --- a/bizinikiwi/pezframe/support/src/traits/messages.rs +++ b/bizinikiwi/pezframe/support/src/traits/messages.rs @@ -23,10 +23,10 @@ use crate::defensive; use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode, FullCodec, MaxEncodedLen}; use core::{cmp::Ordering, fmt::Debug, marker::PhantomData}; -use scale_info::TypeInfo; use pezsp_core::{ConstU32, Get, TypedGet}; use pezsp_runtime::{traits::Convert, BoundedSlice, RuntimeDebug}; use pezsp_weights::{Weight, WeightMeter}; +use scale_info::TypeInfo; /// Errors that can happen when attempting to process a message with /// [`ProcessMessage::process_message()`]. diff --git a/bizinikiwi/pezframe/support/src/traits/metadata.rs b/bizinikiwi/pezframe/support/src/traits/metadata.rs index b92453ed..e3b99d44 100644 --- a/bizinikiwi/pezframe/support/src/traits/metadata.rs +++ b/bizinikiwi/pezframe/support/src/traits/metadata.rs @@ -185,7 +185,10 @@ impl StorageVersion { /// See [`STORAGE_VERSION_STORAGE_KEY_POSTFIX`] on how this key is built. pub fn storage_key() -> [u8; 32] { let pezpallet_name = P::name(); - crate::storage::storage_prefix(pezpallet_name.as_bytes(), STORAGE_VERSION_STORAGE_KEY_POSTFIX) + crate::storage::storage_prefix( + pezpallet_name.as_bytes(), + STORAGE_VERSION_STORAGE_KEY_POSTFIX, + ) } /// Put this storage version for the given pezpallet into the storage. @@ -268,8 +271,8 @@ impl Add for StorageVersion { /// If you (the reader) end up here, it probably means that you tried to compare /// [`GetStorageVersion::on_chain_storage_version`] against /// [`GetStorageVersion::in_code_storage_version`]. This basically means that the -/// [`storage_version`](crate::pezpallet_macros::storage_version) is missing from the pezpallet where the -/// mentioned functions are being called, and needs to be defined. +/// [`storage_version`](crate::pezpallet_macros::storage_version) is missing from the pezpallet +/// where the mentioned functions are being called, and needs to be defined. #[derive(Debug, Default)] pub struct NoStorageVersionSet; @@ -279,8 +282,8 @@ pub struct NoStorageVersionSet; /// 1. An in-code storage version /// 2. An on-chain storage version /// -/// The in-code storage version is the version of the pezpallet as defined in the runtime blob, and the -/// on-chain storage version is the version of the pezpallet stored on-chain. +/// The in-code storage version is the version of the pezpallet as defined in the runtime blob, and +/// the on-chain storage version is the version of the pezpallet stored on-chain. /// /// Storage versions should be only ever be out of sync when a pezpallet has been updated to a new /// version and the in-code version is incremented, but the migration has not yet been executed @@ -291,16 +294,17 @@ pub struct NoStorageVersionSet; pub trait GetStorageVersion { /// This type is generated by the [`pezpallet`](crate::pezpallet) macro. /// - /// If the [`storage_version`](crate::pezpallet_macros::storage_version) attribute isn't specified, - /// this is set to [`NoStorageVersionSet`] to signify that it is missing. + /// If the [`storage_version`](crate::pezpallet_macros::storage_version) attribute isn't + /// specified, this is set to [`NoStorageVersionSet`] to signify that it is missing. /// /// If the [`storage_version`](crate::pezpallet_macros::storage_version) attribute is specified, /// this is be set to a [`StorageVersion`] corresponding to the attribute. /// /// The intention of using [`NoStorageVersionSet`] instead of defaulting to a [`StorageVersion`] /// of zero is to prevent developers from forgetting to set - /// [`storage_version`](crate::pezpallet_macros::storage_version) when it is required, like in the - /// case that they wish to compare the in-code storage version to the on-chain storage version. + /// [`storage_version`](crate::pezpallet_macros::storage_version) when it is required, like in + /// the case that they wish to compare the in-code storage version to the on-chain storage + /// version. type InCodeStorageVersion; #[deprecated( diff --git a/bizinikiwi/pezframe/support/src/traits/misc.rs b/bizinikiwi/pezframe/support/src/traits/misc.rs index 6be845eb..4ab3f3ae 100644 --- a/bizinikiwi/pezframe/support/src/traits/misc.rs +++ b/bizinikiwi/pezframe/support/src/traits/misc.rs @@ -21,9 +21,9 @@ use crate::dispatch::{DispatchResult, Parameter}; use alloc::{vec, vec::Vec}; use codec::{CompactLen, Decode, DecodeLimit, Encode, EncodeLike, Input, MaxEncodedLen}; use impl_trait_for_tuples::impl_for_tuples; -use scale_info::{build::Fields, meta_type, Path, Type, TypeInfo, TypeParameter}; use pezsp_arithmetic::traits::{CheckedAdd, CheckedMul, CheckedSub, One, Saturating}; use pezsp_core::bounded::bounded_vec::TruncateFrom; +use scale_info::{build::Fields, meta_type, Path, Type, TypeInfo, TypeParameter}; use core::cmp::Ordering; #[doc(hidden)] diff --git a/bizinikiwi/pezframe/support/src/traits/preimages.rs b/bizinikiwi/pezframe/support/src/traits/preimages.rs index 8b581d84..efaa9e07 100644 --- a/bizinikiwi/pezframe/support/src/traits/preimages.rs +++ b/bizinikiwi/pezframe/support/src/traits/preimages.rs @@ -19,12 +19,12 @@ use alloc::borrow::Cow; use codec::{Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen}; -use scale_info::TypeInfo; use pezsp_core::RuntimeDebug; use pezsp_runtime::{ traits::{ConstU32, Hash}, DispatchError, }; +use scale_info::TypeInfo; pub type BoundedInline = crate::BoundedVec>; diff --git a/bizinikiwi/pezframe/support/src/traits/reality.rs b/bizinikiwi/pezframe/support/src/traits/reality.rs index b72501fc..c2665f97 100644 --- a/bizinikiwi/pezframe/support/src/traits/reality.rs +++ b/bizinikiwi/pezframe/support/src/traits/reality.rs @@ -21,9 +21,9 @@ use core::marker::PhantomData; use codec::{Decode, DecodeWithMemTracking, Encode, FullCodec, MaxEncodedLen}; use pezframe_support::{CloneNoBound, EqNoBound, Parameter, PartialEqNoBound}; -use scale_info::TypeInfo; use pezsp_core::ConstU32; use pezsp_runtime::{traits::Member, BoundedVec, DispatchError, DispatchResult, RuntimeDebug}; +use scale_info::TypeInfo; /// Identity of personhood. /// diff --git a/bizinikiwi/pezframe/support/src/traits/schedule.rs b/bizinikiwi/pezframe/support/src/traits/schedule.rs index b3199616..e0daf24b 100644 --- a/bizinikiwi/pezframe/support/src/traits/schedule.rs +++ b/bizinikiwi/pezframe/support/src/traits/schedule.rs @@ -22,8 +22,8 @@ use super::PreimageProvider; use alloc::vec::Vec; use codec::{Codec, Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen}; use core::{fmt::Debug, result::Result}; -use scale_info::TypeInfo; use pezsp_runtime::{traits::Saturating, DispatchError, RuntimeDebug}; +use scale_info::TypeInfo; /// Information relating to the period of a scheduled task. First item is the length of the /// period and the second is the number of times it should be executed in total before the task diff --git a/bizinikiwi/pezframe/support/src/traits/storage.rs b/bizinikiwi/pezframe/support/src/traits/storage.rs index 017a0c5d..f9f0629f 100644 --- a/bizinikiwi/pezframe/support/src/traits/storage.rs +++ b/bizinikiwi/pezframe/support/src/traits/storage.rs @@ -20,20 +20,20 @@ use alloc::{collections::btree_set::BTreeSet, vec, vec::Vec}; use codec::{Decode, DecodeWithMemTracking, Encode, FullCodec, MaxEncodedLen}; use core::{marker::PhantomData, mem, ops::Drop}; -use pezframe_support::CloneNoBound; use impl_trait_for_tuples::impl_for_tuples; -use scale_info::TypeInfo; +use pezframe_support::CloneNoBound; pub use pezsp_core::storage::TrackedStorageKey; use pezsp_core::Get; use pezsp_runtime::{ traits::{Convert, Member}, DispatchError, RuntimeDebug, }; +use scale_info::TypeInfo; /// An instance of a pezpallet in the storage. /// -/// It is required that these instances are unique, to support multiple instances per pezpallet in the -/// same runtime! +/// It is required that these instances are unique, to support multiple instances per pezpallet in +/// the same runtime! /// /// E.g. for module MyModule default instance will have prefix "MyModule" and other instances /// "InstanceNMyModule". diff --git a/bizinikiwi/pezframe/support/src/traits/tasks.rs b/bizinikiwi/pezframe/support/src/traits/tasks.rs index bb6e83ad..9b1b904b 100644 --- a/bizinikiwi/pezframe/support/src/traits/tasks.rs +++ b/bizinikiwi/pezframe/support/src/traits/tasks.rs @@ -21,9 +21,9 @@ use alloc::{vec, vec::IntoIter}; use codec::FullCodec; use core::{fmt::Debug, iter::Iterator}; -use scale_info::TypeInfo; use pezsp_runtime::DispatchError; use pezsp_weights::Weight; +use scale_info::TypeInfo; /// Contain's re-exports of all the supporting types for the [`Task`] trait. Used in the macro /// expansion of `RuntimeTask`. @@ -32,9 +32,9 @@ pub mod __private { pub use alloc::{vec, vec::IntoIter}; pub use codec::FullCodec; pub use core::{fmt::Debug, iter::Iterator}; - pub use scale_info::TypeInfo; pub use pezsp_runtime::DispatchError; pub use pezsp_weights::Weight; + pub use scale_info::TypeInfo; } /// A general-purpose trait which defines a type of service work (i.e., work to performed by an diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/asset_ops.rs b/bizinikiwi/pezframe/support/src/traits/tokens/asset_ops.rs index d79601ea..180a07d3 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/asset_ops.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/asset_ops.rs @@ -37,11 +37,12 @@ //! //! ### Usage Example //! -//! This example shows how to interact with pezpallet-uniques (assuming the pezpallet called Uniques in -//! the chain’s Runtime) via the asset ops. +//! This example shows how to interact with pezpallet-uniques (assuming the pezpallet called Uniques +//! in the chain’s Runtime) via the asset ops. //! //! If you are interested in the implementation example, you can look at the pezpallet-uniques -//! implementation. You can check out the pezpallet-uniques tests if you want more examples of usage. +//! implementation. You can check out the pezpallet-uniques tests if you want more examples of +//! usage. //! //! ```rust,ignore //! type Collection = pezpallet_uniques::asset_ops::Collection; diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/asset_ops/common_strategies.rs b/bizinikiwi/pezframe/support/src/traits/tokens/asset_ops/common_strategies.rs index 9abf5782..b6bb7db8 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/asset_ops/common_strategies.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/asset_ops/common_strategies.rs @@ -19,9 +19,9 @@ use super::*; use codec::{Decode, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; use pezsp_core::RuntimeDebug; use pezsp_runtime::traits::Convert; +use scale_info::TypeInfo; /// The `CheckState` is a strategy that accepts an `Inspect` value and the `Inner` strategy. /// diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/currency/reservable.rs b/bizinikiwi/pezframe/support/src/traits/tokens/currency/reservable.rs index f5d94b3b..03f07a07 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/currency/reservable.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/currency/reservable.rs @@ -17,8 +17,8 @@ //! The reservable currency trait. -use scale_info::TypeInfo; use pezsp_core::Get; +use scale_info::TypeInfo; use super::{super::misc::BalanceStatus, Currency}; use crate::{ diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/fungible/freeze.rs b/bizinikiwi/pezframe/support/src/traits/tokens/fungible/freeze.rs index 57df0c76..64777c54 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/fungible/freeze.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/fungible/freeze.rs @@ -20,12 +20,12 @@ //! See the [`crate::traits::fungible`] doc for more information about fungible traits //! including the place of the Freezes in FRAME. -use scale_info::TypeInfo; use pezsp_arithmetic::{ traits::{CheckedAdd, CheckedSub}, ArithmeticError, }; use pezsp_runtime::{DispatchResult, TokenError}; +use scale_info::TypeInfo; use crate::{ensure, traits::tokens::Fortitude}; diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/fungible/hold.rs b/bizinikiwi/pezframe/support/src/traits/tokens/fungible/hold.rs index e0ca2e82..89d676a6 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/fungible/hold.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/fungible/hold.rs @@ -31,12 +31,12 @@ use crate::{ Restriction::{self, Free, OnHold}, }, }; -use scale_info::TypeInfo; use pezsp_arithmetic::{ traits::{CheckedAdd, CheckedSub, Zero}, ArithmeticError, }; use pezsp_runtime::{DispatchError, DispatchResult, Saturating, TokenError}; +use scale_info::TypeInfo; use super::*; diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/fungible/imbalance.rs b/bizinikiwi/pezframe/support/src/traits/tokens/fungible/imbalance.rs index afa5a293..d25b6331 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/fungible/imbalance.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/fungible/imbalance.rs @@ -181,7 +181,8 @@ impl, OppositeOnDrop: HandleImbalance /// Converts a `fungibles` `imbalance` instance to an instance of a `fungible` imbalance type. /// /// This function facilitates imbalance conversions within the implementations of -/// [`pezframe_support::traits::fungibles::UnionOf`], [`pezframe_support::traits::fungible::UnionOf`], and +/// [`pezframe_support::traits::fungibles::UnionOf`], +/// [`pezframe_support::traits::fungible::UnionOf`], and /// [`pezframe_support::traits::fungible::ItemOf`] adapters. It is intended only for internal use /// within the current crate. pub(crate) fn from_fungibles< diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/fungible/item_of.rs b/bizinikiwi/pezframe/support/src/traits/tokens/fungible/item_of.rs index 57abaf79..b573acea 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/fungible/item_of.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/fungible/item_of.rs @@ -17,8 +17,8 @@ //! Adapter to use `fungibles::*` implementations as `fungible::*`. //! -//! This allows for a `fungibles` asset, e.g. from the `pezpallet_assets` pezpallet, to be used when a -//! `fungible` asset is expected. +//! This allows for a `fungibles` asset, e.g. from the `pezpallet_assets` pezpallet, to be used when +//! a `fungible` asset is expected. //! //! See the [`crate::traits::fungible`] doc for more information about fungible traits. diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/fungible/mod.rs b/bizinikiwi/pezframe/support/src/traits/tokens/fungible/mod.rs index 88786f73..d2bd8434 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/fungible/mod.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/fungible/mod.rs @@ -52,8 +52,8 @@ //! transfer. //! //! - **Held Balance**: Held balance still belongs to the account holder, but is suspended — it -//! cannot be transferred or used for most operations. It may be slashed by the pezpallet that placed -//! the hold. +//! cannot be transferred or used for most operations. It may be slashed by the pezpallet that +//! placed the hold. //! //! Multiple holds stack rather than overlay. This means that if an account has //! 3 holds for 100 units, the account can spend its funds for any reason down to 300 units, at @@ -164,9 +164,9 @@ mod union_of; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::marker::PhantomData; use pezframe_support_procedural::{CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound}; -use scale_info::TypeInfo; #[cfg(feature = "runtime-benchmarks")] use pezsp_runtime::Saturating; +use scale_info::TypeInfo; use super::{ Fortitude::{Force, Polite}, @@ -179,12 +179,12 @@ pub use hold::{ }; pub use imbalance::{Credit, Debt, HandleImbalanceDrop, Imbalance}; pub use item_of::ItemOf; -pub use regular::{ - Balanced, DecreaseIssuance, Dust, IncreaseIssuance, Inspect, Mutate, Unbalanced, -}; use pezsp_arithmetic::traits::Zero; use pezsp_core::Get; use pezsp_runtime::{traits::Convert, DispatchError}; +pub use regular::{ + Balanced, DecreaseIssuance, Dust, IncreaseIssuance, Inspect, Mutate, Unbalanced, +}; pub use union_of::{NativeFromLeft, NativeOrWithId, UnionOf}; #[cfg(feature = "experimental")] diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/fungible/union_of.rs b/bizinikiwi/pezframe/support/src/traits/tokens/fungible/union_of.rs index 0f9c3374..efa8b85c 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/fungible/union_of.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/fungible/union_of.rs @@ -30,13 +30,13 @@ use pezframe_support::traits::{ }, AccountTouch, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::Convert, DispatchError, DispatchResult, Either, Either::{Left, Right}, RuntimeDebug, }; +use scale_info::TypeInfo; /// The `NativeOrWithId` enum classifies an asset as either `Native` to the current chain or as an /// asset with a specific ID. diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/fungibles/freeze.rs b/bizinikiwi/pezframe/support/src/traits/tokens/fungibles/freeze.rs index 2335e208..3af9779f 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/fungibles/freeze.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/fungibles/freeze.rs @@ -20,12 +20,12 @@ //! See the [`crate::traits::fungibles`] doc for more information about fungibles traits. use crate::{ensure, traits::tokens::Fortitude}; -use scale_info::TypeInfo; use pezsp_arithmetic::{ traits::{CheckedAdd, CheckedSub}, ArithmeticError, }; use pezsp_runtime::{DispatchResult, TokenError}; +use scale_info::TypeInfo; /// Trait for inspecting a fungible asset which can be frozen. Freezing is essentially setting a /// minimum balance below which the total balance (inclusive of any funds placed on hold) may not diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/fungibles/hold.rs b/bizinikiwi/pezframe/support/src/traits/tokens/fungibles/hold.rs index d6bf0a36..4eb41839 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/fungibles/hold.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/fungibles/hold.rs @@ -30,12 +30,12 @@ use crate::{ Restriction::{self, Free, OnHold}, }, }; -use scale_info::TypeInfo; use pezsp_arithmetic::{ traits::{CheckedAdd, CheckedSub, Zero}, ArithmeticError, }; use pezsp_runtime::{DispatchError, DispatchResult, Saturating, TokenError}; +use scale_info::TypeInfo; use super::*; diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/fungibles/imbalance.rs b/bizinikiwi/pezframe/support/src/traits/tokens/fungibles/imbalance.rs index 0100f0b0..88edd0bc 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/fungibles/imbalance.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/fungibles/imbalance.rs @@ -195,7 +195,8 @@ impl< /// a specified `asset`. /// /// This function facilitates imbalance conversions within the implementations of -/// [`pezframe_support::traits::fungibles::UnionOf`], [`pezframe_support::traits::fungible::UnionOf`], and +/// [`pezframe_support::traits::fungibles::UnionOf`], +/// [`pezframe_support::traits::fungible::UnionOf`], and /// [`pezframe_support::traits::fungible::ItemOf`] adapters. It is intended only for internal use /// within the current crate. pub(crate) fn from_fungible< @@ -217,7 +218,8 @@ pub(crate) fn from_fungible< /// Converts a `fungibles` `imbalance` instance of one type to another using a specified `asset`. /// /// This function facilitates imbalance conversions within the implementations of -/// [`pezframe_support::traits::fungibles::UnionOf`], [`pezframe_support::traits::fungible::UnionOf`], and +/// [`pezframe_support::traits::fungibles::UnionOf`], +/// [`pezframe_support::traits::fungible::UnionOf`], and /// [`pezframe_support::traits::fungible::ItemOf`] adapters. It is intended only for internal use /// within the current crate. pub(crate) fn from_fungibles< diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/pay.rs b/bizinikiwi/pezframe/support/src/traits/tokens/pay.rs index 3f1dc35f..dfb57e85 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/pay.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/pay.rs @@ -19,9 +19,9 @@ use codec::{FullCodec, MaxEncodedLen}; use core::fmt::Debug; -use scale_info::TypeInfo; use pezsp_core::TypedGet; use pezsp_runtime::DispatchError; +use scale_info::TypeInfo; use super::{fungible, fungibles, Balance, Preservation::Expendable}; diff --git a/bizinikiwi/pezframe/support/src/traits/tokens/transfer.rs b/bizinikiwi/pezframe/support/src/traits/tokens/transfer.rs index 0b0e7fc5..44106e62 100644 --- a/bizinikiwi/pezframe/support/src/traits/tokens/transfer.rs +++ b/bizinikiwi/pezframe/support/src/traits/tokens/transfer.rs @@ -20,9 +20,9 @@ use crate::pezpallet_prelude::{Decode, Encode}; use core::fmt::Debug; use pezframe_support::traits::tokens::PaymentStatus; -use scale_info::TypeInfo; use pezsp_debug_derive::RuntimeDebug; use pezsp_runtime::codec::{FullCodec, MaxEncodedLen}; +use scale_info::TypeInfo; /// Is intended to be implemented using a `fungible` impl, but can also be implemented with /// XCM/Asset and made generic over assets. diff --git a/bizinikiwi/pezframe/support/src/traits/voting.rs b/bizinikiwi/pezframe/support/src/traits/voting.rs index 1929ae5f..fbbe5a34 100644 --- a/bizinikiwi/pezframe/support/src/traits/voting.rs +++ b/bizinikiwi/pezframe/support/src/traits/voting.rs @@ -49,8 +49,8 @@ pub trait VoteTally { /// A function that should be called before any use of the `runtime-benchmarks` gated functions /// of the `VoteTally` trait. /// - /// Should be used to set up any needed state in a Pezpallet which implements `VoteTally` so that - /// benchmarks that execute will complete successfully. `class` can be used to set up a + /// Should be used to set up any needed state in a Pezpallet which implements `VoteTally` so + /// that benchmarks that execute will complete successfully. `class` can be used to set up a /// particular class of voters, and `granularity` is used to determine the weight of one vote /// relative to total unanimity. /// diff --git a/bizinikiwi/pezframe/support/src/view_functions.rs b/bizinikiwi/pezframe/support/src/view_functions.rs index 2f499f39..2a321076 100644 --- a/bizinikiwi/pezframe/support/src/view_functions.rs +++ b/bizinikiwi/pezframe/support/src/view_functions.rs @@ -19,8 +19,8 @@ use alloc::vec::Vec; use codec::{Decode, DecodeAll, Encode, Output}; -use scale_info::TypeInfo; use pezsp_runtime::RuntimeDebug; +use scale_info::TypeInfo; /// The unique identifier for a view function. #[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] @@ -28,7 +28,8 @@ pub struct ViewFunctionId { /// The part of the id for dispatching view functions from the top level of the runtime. /// /// Specifies which view function grouping this view function belongs to. This could be a group - /// of view functions associated with a pezpallet, or a pezpallet agnostic group of view functions. + /// of view functions associated with a pezpallet, or a pezpallet agnostic group of view + /// functions. pub prefix: [u8; 16], /// The part of the id for dispatching to a view function within a group. pub suffix: [u8; 16], @@ -61,8 +62,8 @@ impl From for ViewFunctionDispatchError { } /// Implemented by both pallets and the runtime. The runtime is dispatching by prefix using the -/// pezpallet implementation of `ViewFunctionIdPrefix` then the pezpallet is dispatching by suffix using -/// the methods implementation of `ViewFunctionIdSuffix`. +/// pezpallet implementation of `ViewFunctionIdPrefix` then the pezpallet is dispatching by suffix +/// using the methods implementation of `ViewFunctionIdSuffix`. /// /// In more details, `ViewFunctionId` = `ViewFunctionIdPrefix` ++ `ViewFunctionIdSuffix`, where /// `ViewFunctionIdPrefix=twox_128(pezpallet_name)` and diff --git a/bizinikiwi/pezframe/support/test/compile_pass/src/lib.rs b/bizinikiwi/pezframe/support/test/compile_pass/src/lib.rs index adcb9bfa..3ef170f7 100644 --- a/bizinikiwi/pezframe/support/test/compile_pass/src/lib.rs +++ b/bizinikiwi/pezframe/support/test/compile_pass/src/lib.rs @@ -15,8 +15,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Test that `construct_runtime!` also works when `pezframe-support` or `pezframe-system` are renamed in -//! the `Cargo.toml`. +//! Test that `construct_runtime!` also works when `pezframe-support` or `pezframe-system` are +//! renamed in the `Cargo.toml`. #![cfg_attr(not(feature = "std"), no_std)] @@ -35,7 +35,9 @@ use pezsp_version::RuntimeVersion; pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: alloc::borrow::Cow::Borrowed("pezframe-support-test-compile-pass"), - impl_name: alloc::borrow::Cow::Borrowed("bizinikiwi-pezframe-support-test-compile-pass-runtime"), + impl_name: alloc::borrow::Cow::Borrowed( + "bizinikiwi-pezframe-support-test-compile-pass-runtime", + ), authoring_version: 0, spec_version: 0, impl_version: 0, diff --git a/bizinikiwi/pezframe/support/test/src/lib.rs b/bizinikiwi/pezframe/support/test/src/lib.rs index 221c42f8..d60453a3 100644 --- a/bizinikiwi/pezframe/support/test/src/lib.rs +++ b/bizinikiwi/pezframe/support/test/src/lib.rs @@ -125,8 +125,8 @@ pub mod pezpallet_prelude { pub type BlockNumberFor = ::BlockNumber; } -/// Provides an implementation of [`pezframe_support::traits::Randomness`] that should only be used in -/// tests! +/// Provides an implementation of [`pezframe_support::traits::Randomness`] that should only be used +/// in tests! pub struct TestRandomness(core::marker::PhantomData); impl diff --git a/bizinikiwi/pezframe/support/test/tests/authorize.rs b/bizinikiwi/pezframe/support/test/tests/authorize.rs index 122c3ab0..6d7bde51 100644 --- a/bizinikiwi/pezframe/support/test/tests/authorize.rs +++ b/bizinikiwi/pezframe/support/test/tests/authorize.rs @@ -412,8 +412,9 @@ fn valid_call_weight_test() { let info = tx.get_dispatch_info(); let len = tx.using_encoded(|e| e.len()); - let checked = Checkable::check(tx, &pezframe_system::ChainContext::::default()) - .expect("Transaction is general so signature is good"); + let checked = + Checkable::check(tx, &pezframe_system::ChainContext::::default()) + .expect("Transaction is general so signature is good"); checked .validate::(TransactionSource::External, &info, len) @@ -498,8 +499,9 @@ fn call_validity() { let info = tx.get_dispatch_info(); let len = tx.using_encoded(|e| e.len()); - let checked = Checkable::check(tx, &pezframe_system::ChainContext::::default()) - .expect("Transaction is general so signature is good"); + let checked = + Checkable::check(tx, &pezframe_system::ChainContext::::default()) + .expect("Transaction is general so signature is good"); let res = checked.validate::(TransactionSource::External, &info, len); assert_eq!(res, validate_res); diff --git a/bizinikiwi/pezframe/support/test/tests/enum_deprecation.rs b/bizinikiwi/pezframe/support/test/tests/enum_deprecation.rs index 359af958..09900446 100644 --- a/bizinikiwi/pezframe/support/test/tests/enum_deprecation.rs +++ b/bizinikiwi/pezframe/support/test/tests/enum_deprecation.rs @@ -61,7 +61,8 @@ pub mod pezpallet { type Balance: Parameter + Default + TypeInfo; #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::pezpallet] diff --git a/bizinikiwi/pezframe/support/test/tests/origin.rs b/bizinikiwi/pezframe/support/test/tests/origin.rs index dce69b5e..4db6be66 100644 --- a/bizinikiwi/pezframe/support/test/tests/origin.rs +++ b/bizinikiwi/pezframe/support/test/tests/origin.rs @@ -97,7 +97,8 @@ pub mod module { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::call] diff --git a/bizinikiwi/pezframe/support/test/tests/pallet.rs b/bizinikiwi/pezframe/support/test/tests/pallet.rs index 63f5aa7b..9ab28a8c 100644 --- a/bizinikiwi/pezframe/support/test/tests/pallet.rs +++ b/bizinikiwi/pezframe/support/test/tests/pallet.rs @@ -21,8 +21,8 @@ use pezframe_support::{ assert_ok, derive_impl, dispatch::{DispatchClass, DispatchInfo, GetDispatchInfo, Parameter, Pays}, dispatch_context::with_context, - pezpallet_prelude::{StorageInfoTrait, ValueQuery}, parameter_types, + pezpallet_prelude::{StorageInfoTrait, ValueQuery}, storage::{unhashed, unhashed::contains_prefixed_key}, traits::{ ConstU32, GetCallIndex, GetCallName, GetStorageVersion, OnFinalize, OnGenesis, @@ -33,7 +33,6 @@ use pezframe_support::{ OrdNoBound, PartialOrdNoBound, }; use pezframe_system::offchain::{CreateSignedTransaction, CreateTransactionBase, SigningTypes}; -use scale_info::{meta_type, TypeInfo}; use pezsp_io::{ hashing::{blake2_128, twox_128, twox_64}, TestExternalities, @@ -43,6 +42,7 @@ use pezsp_runtime::{ traits::{Block as BlockT, Dispatchable}, DispatchError, ModuleError, }; +use scale_info::{meta_type, TypeInfo}; parameter_types! { /// Used to control if the storage version should be updated. @@ -149,7 +149,8 @@ pub mod pezpallet { type Balance: Parameter + Default + TypeInfo; #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::extra_constants] @@ -678,7 +679,8 @@ pub mod pallet2 { } } -/// Test that the supertrait check works when we pass some parameter to the `pezframe_system::Config`. +/// Test that the supertrait check works when we pass some parameter to the +/// `pezframe_system::Config`. #[pezframe_support::pezpallet] pub mod pallet3 { #[pezpallet::config] @@ -704,7 +706,8 @@ pub mod pallet4 { impl Pezpallet {} } -/// Test that the supertrait check works when we pass some parameter to the `pezframe_system::Config`. +/// Test that the supertrait check works when we pass some parameter to the +/// `pezframe_system::Config`. #[pezframe_support::pezpallet] pub mod pallet5 { #[pezpallet::config] @@ -973,7 +976,10 @@ fn error_expand() { ); assert_eq!( as PalletError>::MAX_ENCODED_SIZE, 3); #[cfg(feature = "frame-feature-testing")] - assert_eq!(format!("{:?}", pezpallet::Error::::FeatureTest), String::from("FeatureTest"),); + assert_eq!( + format!("{:?}", pezpallet::Error::::FeatureTest), + String::from("FeatureTest"), + ); } #[test] @@ -993,8 +999,9 @@ fn inherent_expand() { let inherents = InherentData::new().create_extrinsics(); - let expected = - vec![UncheckedExtrinsic::new_bare(RuntimeCall::Example(pezpallet::Call::foo_no_post_info {}))]; + let expected = vec![UncheckedExtrinsic::new_bare(RuntimeCall::Example( + pezpallet::Call::foo_no_post_info {}, + ))]; assert_eq!(expected, inherents); let block = Block::new( @@ -1006,7 +1013,9 @@ fn inherent_expand() { Digest::default(), ), vec![ - UncheckedExtrinsic::new_bare(RuntimeCall::Example(pezpallet::Call::foo_no_post_info {})), + UncheckedExtrinsic::new_bare(RuntimeCall::Example( + pezpallet::Call::foo_no_post_info {}, + )), UncheckedExtrinsic::new_bare(RuntimeCall::Example(pezpallet::Call::foo { foo: 1, bar: 0, @@ -1025,7 +1034,9 @@ fn inherent_expand() { Digest::default(), ), vec![ - UncheckedExtrinsic::new_bare(RuntimeCall::Example(pezpallet::Call::foo_no_post_info {})), + UncheckedExtrinsic::new_bare(RuntimeCall::Example( + pezpallet::Call::foo_no_post_info {}, + )), UncheckedExtrinsic::new_bare(RuntimeCall::Example(pezpallet::Call::foo { foo: 0, bar: 0, @@ -1043,9 +1054,9 @@ fn inherent_expand() { BlakeTwo256::hash(b"test"), Digest::default(), ), - vec![UncheckedExtrinsic::new_bare(RuntimeCall::Example(pezpallet::Call::foo_storage_layer { - foo: 0, - }))], + vec![UncheckedExtrinsic::new_bare(RuntimeCall::Example( + pezpallet::Call::foo_storage_layer { foo: 0 }, + ))], ); let mut inherent = InherentData::new(); @@ -1081,12 +1092,14 @@ fn validate_unsigned_expand() { }; let call = pezpallet::Call::::foo_no_post_info {}; - let validity = pezpallet::Pezpallet::validate_unsigned(TransactionSource::Local, &call).unwrap_err(); + let validity = + pezpallet::Pezpallet::validate_unsigned(TransactionSource::Local, &call).unwrap_err(); assert_eq!(validity, TransactionValidityError::Invalid(InvalidTransaction::Call)); let call = pezpallet::Call::::foo_storage_layer { foo: 0 }; - let validity = pezpallet::Pezpallet::validate_unsigned(TransactionSource::External, &call).unwrap(); + let validity = + pezpallet::Pezpallet::validate_unsigned(TransactionSource::External, &call).unwrap(); assert_eq!(validity, ValidTransaction::default()); } @@ -1332,7 +1345,10 @@ fn pezpallet_hooks_expand() { #[test] fn pezpallet_on_genesis() { TestExternalities::default().execute_with(|| { - assert_eq!(pezpallet::Pezpallet::::on_chain_storage_version(), StorageVersion::new(0)); + assert_eq!( + pezpallet::Pezpallet::::on_chain_storage_version(), + StorageVersion::new(0) + ); pezpallet::Pezpallet::::on_genesis(); assert_eq!( pezpallet::Pezpallet::::in_code_storage_version(), @@ -1346,7 +1362,10 @@ fn migrate_from_pallet_version_to_storage_version() { const PALLET_VERSION_STORAGE_KEY_POSTFIX: &[u8] = b":__PALLET_VERSION__:"; fn pezpallet_version_key(name: &str) -> [u8; 32] { - pezframe_support::storage::storage_prefix(name.as_bytes(), PALLET_VERSION_STORAGE_KEY_POSTFIX) + pezframe_support::storage::storage_prefix( + name.as_bytes(), + PALLET_VERSION_STORAGE_KEY_POSTFIX, + ) } TestExternalities::default().execute_with(|| { @@ -2335,8 +2354,8 @@ fn pezpallet_on_chain_storage_version_initializes_correctly() { AllPalletsWithSystem, >; - // Simple example of a pezpallet with in-code version 10 being added to the runtime for the first - // time. + // Simple example of a pezpallet with in-code version 10 being added to the runtime for the + // first time. TestExternalities::default().execute_with(|| { let in_code_version = Example::in_code_storage_version(); @@ -2345,8 +2364,8 @@ fn pezpallet_on_chain_storage_version_initializes_correctly() { let exists = contains_prefixed_key(&pezpallet_hashed_prefix); assert_eq!(exists, false); - // [`pezframe_support::traits::BeforeAllRuntimeMigrations`] hook should initialize the storage - // version. + // [`pezframe_support::traits::BeforeAllRuntimeMigrations`] hook should initialize the + // storage version. Executive::execute_on_runtime_upgrade(); // Check that the storage version was initialized to the in-code version @@ -2533,7 +2552,9 @@ fn test_error_feature_parsing() { #[test] fn pezpallet_metadata() { - use pezsp_metadata_ir::{EnumDeprecationInfoIR, ItemDeprecationInfoIR, VariantDeprecationInfoIR}; + use pezsp_metadata_ir::{ + EnumDeprecationInfoIR, ItemDeprecationInfoIR, VariantDeprecationInfoIR, + }; let pallets = Runtime::metadata_ir().pallets; let example = pallets[0].clone(); let example2 = pallets[1].clone(); diff --git a/bizinikiwi/pezframe/support/test/tests/pezpallet_associated_types_metadata.rs b/bizinikiwi/pezframe/support/test/tests/pezpallet_associated_types_metadata.rs index 3066d9e7..6eba8ac2 100644 --- a/bizinikiwi/pezframe/support/test/tests/pezpallet_associated_types_metadata.rs +++ b/bizinikiwi/pezframe/support/test/tests/pezpallet_associated_types_metadata.rs @@ -16,8 +16,8 @@ // limitations under the License. use pezframe_support::{derive_impl, traits::ConstU32}; -use scale_info::meta_type; use pezsp_metadata_ir::PalletAssociatedTypeMetadataIR; +use scale_info::meta_type; pub type BlockNumber = u64; pub type Header = pezsp_runtime::generic::Header; @@ -36,7 +36,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { // Runtime events already propagated to the metadata. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; // Constants are already propagated. #[pezpallet::constant] @@ -61,7 +62,8 @@ pub mod pallet2 { pub trait Config: pezframe_system::Config { // Runtime events already propagated to the metadata. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; // Constants are already propagated. #[pezpallet::constant] @@ -98,7 +100,8 @@ pub mod pallet3 { pub trait Config: pezframe_system::Config { // Runtime events already propagated to the metadata. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; // Constants are already propagated. #[pezpallet::constant] @@ -193,7 +196,11 @@ fn associated_types_metadata() { pretty_assertions::assert_eq!(pezpallet.associated_types, vec![]); // Collect by default types that implement TypeInfo or Parameter. - let pezpallet = ir.pallets.iter().find(|pezpallet| pezpallet.name == "DefaultInclusion").unwrap(); + let pezpallet = ir + .pallets + .iter() + .find(|pezpallet| pezpallet.name == "DefaultInclusion") + .unwrap(); pretty_assertions::assert_eq!( pezpallet.associated_types, vec![ @@ -211,7 +218,11 @@ fn associated_types_metadata() { ); // Explicitly include associated types. - let pezpallet = ir.pallets.iter().find(|pezpallet| pezpallet.name == "ExplicitInclusion").unwrap(); + let pezpallet = ir + .pallets + .iter() + .find(|pezpallet| pezpallet.name == "ExplicitInclusion") + .unwrap(); pretty_assertions::assert_eq!( pezpallet.associated_types, vec![PalletAssociatedTypeMetadataIR { diff --git a/bizinikiwi/pezframe/support/test/tests/pezpallet_instance.rs b/bizinikiwi/pezframe/support/test/tests/pezpallet_instance.rs index 96462545..cac07c92 100644 --- a/bizinikiwi/pezframe/support/test/tests/pezpallet_instance.rs +++ b/bizinikiwi/pezframe/support/test/tests/pezpallet_instance.rs @@ -19,8 +19,8 @@ use core::any::TypeId; use pezframe_support::{ derive_impl, dispatch::{DispatchClass, DispatchInfo, GetDispatchInfo, Pays}, - pezpallet_prelude::ValueQuery, parameter_types, + pezpallet_prelude::ValueQuery, storage::unhashed, traits::{ ConstU32, GetCallName, OnFinalize, OnGenesis, OnInitialize, OnRuntimeUpgrade, @@ -409,7 +409,10 @@ fn error_expand() { ); assert_eq!( - format!("{:?}", pezpallet::Error::::InsufficientProposersBalance), + format!( + "{:?}", + pezpallet::Error::::InsufficientProposersBalance + ), String::from("InsufficientProposersBalance"), ); assert_eq!( @@ -613,21 +616,30 @@ fn storage_expand() { k.extend(1u8.using_encoded(blake2_128_concat)); k.extend(2u16.using_encoded(twox_64_concat)); assert_eq!(unhashed::get::(&k), Some(3u32)); - assert_eq!(&k[..32], &>::final_prefix()); + assert_eq!( + &k[..32], + &>::final_prefix() + ); >::insert(&1, &2, &3); let mut k = [twox_128(b"Instance1Example"), twox_128(b"DoubleMap2")].concat(); k.extend(1u16.using_encoded(twox_64_concat)); k.extend(2u32.using_encoded(blake2_128_concat)); assert_eq!(unhashed::get::(&k), Some(3u64)); - assert_eq!(&k[..32], &>::final_prefix()); + assert_eq!( + &k[..32], + &>::final_prefix() + ); >::insert(&1, &2, &3); let mut k = [twox_128(b"Instance1Example"), twox_128(b"DoubleMap3")].concat(); k.extend(1u32.using_encoded(blake2_128_concat)); k.extend(2u64.using_encoded(twox_64_concat)); assert_eq!(unhashed::get::(&k), Some(3u128)); - assert_eq!(&k[..32], &>::final_prefix()); + assert_eq!( + &k[..32], + &>::final_prefix() + ); assert_eq!( >::get(2, 3), Err(pezpallet::Error::::NonExistentStorageValue), @@ -902,14 +914,18 @@ fn metadata() { ], }), calls: Some(scale_info::meta_type::>().into()), - event: Some(PalletEventMetadata { ty: scale_info::meta_type::>() }), + event: Some(PalletEventMetadata { + ty: scale_info::meta_type::>(), + }), constants: vec![PalletConstantMetadata { name: "MyGetParam", ty: scale_info::meta_type::(), value: vec![10, 0, 0, 0], docs: vec![], }], - error: Some(PalletErrorMetadata { ty: scale_info::meta_type::>() }), + error: Some(PalletErrorMetadata { + ty: scale_info::meta_type::>(), + }), }; let mut example_pallet_instance1_metadata = example_pallet_metadata.clone(); @@ -917,19 +933,22 @@ fn metadata() { example_pallet_instance1_metadata.index = 2; match example_pallet_instance1_metadata.calls { Some(ref mut calls_meta) => { - calls_meta.ty = scale_info::meta_type::>(); + calls_meta.ty = + scale_info::meta_type::>(); }, _ => unreachable!(), } match example_pallet_instance1_metadata.event { Some(ref mut event_meta) => { - event_meta.ty = scale_info::meta_type::>(); + event_meta.ty = + scale_info::meta_type::>(); }, _ => unreachable!(), } match example_pallet_instance1_metadata.error { Some(ref mut error_meta) => { - error_meta.ty = scale_info::meta_type::>(); + error_meta.ty = + scale_info::meta_type::>(); }, _ => unreachable!(), } diff --git a/bizinikiwi/pezframe/support/test/tests/pezpallet_outer_enums_explicit.rs b/bizinikiwi/pezframe/support/test/tests/pezpallet_outer_enums_explicit.rs index 8b70f56a..2c5f629b 100644 --- a/bizinikiwi/pezframe/support/test/tests/pezpallet_outer_enums_explicit.rs +++ b/bizinikiwi/pezframe/support/test/tests/pezpallet_outer_enums_explicit.rs @@ -76,7 +76,7 @@ pezframe_support::construct_runtime!( #[cfg(feature = "experimental")] #[test] fn module_error_outer_enum_expand_explicit() { - use common::outer_enums::{pezpallet, pallet2}; + use common::outer_enums::{pallet2, pezpallet}; // The Runtime has *all* parts explicitly defined. // Check that all error types are propagated diff --git a/bizinikiwi/pezframe/support/test/tests/pezpallet_outer_enums_implicit.rs b/bizinikiwi/pezframe/support/test/tests/pezpallet_outer_enums_implicit.rs index d0651ffc..34f92666 100644 --- a/bizinikiwi/pezframe/support/test/tests/pezpallet_outer_enums_implicit.rs +++ b/bizinikiwi/pezframe/support/test/tests/pezpallet_outer_enums_implicit.rs @@ -76,7 +76,7 @@ pezframe_support::construct_runtime!( #[cfg(feature = "experimental")] #[test] fn module_error_outer_enum_expand_implicit() { - use common::outer_enums::{pezpallet, pallet2}; + use common::outer_enums::{pallet2, pezpallet}; // The Runtime has *all* parts implicitly defined. // Check that all error types are propagated diff --git a/bizinikiwi/pezframe/support/test/tests/runtime.rs b/bizinikiwi/pezframe/support/test/tests/runtime.rs index a446368c..14ccc6fe 100644 --- a/bizinikiwi/pezframe/support/test/tests/runtime.rs +++ b/bizinikiwi/pezframe/support/test/tests/runtime.rs @@ -29,7 +29,6 @@ use pezframe_system::{ limits::{BlockLength, BlockWeights}, DispatchEventInfo, }; -use scale_info::TypeInfo; use pezsp_core::sr25519; use pezsp_runtime::{ generic, @@ -37,6 +36,7 @@ use pezsp_runtime::{ DispatchError, ModuleError, }; use pezsp_version::RuntimeVersion; +use scale_info::TypeInfo; parameter_types! { pub static IntegrityTestExec: u32 = 0; @@ -102,7 +102,8 @@ mod module2 { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::hooks] @@ -238,7 +239,8 @@ pub mod module3 { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::call] @@ -624,7 +626,10 @@ fn event_codec() { #[test] fn call_codec() { use codec::Encode; - assert_eq!(RuntimeCall::System(pezframe_system::Call::remark { remark: vec![1] }).encode()[0], 30); + assert_eq!( + RuntimeCall::System(pezframe_system::Call::remark { remark: vec![1] }).encode()[0], + 30 + ); assert_eq!(RuntimeCall::Module1_1(module1::Call::fail {}).encode()[0], 31); assert_eq!(RuntimeCall::Module2(module2::Call::fail {}).encode()[0], 32); assert_eq!(RuntimeCall::Module1_2(module1::Call::fail {}).encode()[0], 33); @@ -759,9 +764,9 @@ fn test_metadata() { v14::{StorageEntryType::Plain, *}, *, }; - use scale_info::meta_type; use pezsp_core::Encode; use pezsp_metadata_ir::StorageEntryModifierIR::Optional; + use scale_info::meta_type; fn maybe_docs(doc: Vec<&'static str>) -> Vec<&'static str> { if cfg!(feature = "no-metadata-docs") { diff --git a/bizinikiwi/pezframe/support/test/tests/runtime_legacy_ordering.rs b/bizinikiwi/pezframe/support/test/tests/runtime_legacy_ordering.rs index 827e7032..986f1254 100644 --- a/bizinikiwi/pezframe/support/test/tests/runtime_legacy_ordering.rs +++ b/bizinikiwi/pezframe/support/test/tests/runtime_legacy_ordering.rs @@ -29,7 +29,6 @@ use pezframe_system::{ limits::{BlockLength, BlockWeights}, DispatchEventInfo, }; -use scale_info::TypeInfo; use pezsp_core::sr25519; use pezsp_runtime::{ generic, @@ -37,6 +36,7 @@ use pezsp_runtime::{ DispatchError, ModuleError, }; use pezsp_version::RuntimeVersion; +use scale_info::TypeInfo; parameter_types! { pub static IntegrityTestExec: u32 = 0; @@ -102,7 +102,8 @@ mod module2 { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::hooks] @@ -238,7 +239,8 @@ pub mod module3 { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::call] @@ -624,7 +626,10 @@ fn event_codec() { #[test] fn call_codec() { use codec::Encode; - assert_eq!(RuntimeCall::System(pezframe_system::Call::remark { remark: vec![1] }).encode()[0], 30); + assert_eq!( + RuntimeCall::System(pezframe_system::Call::remark { remark: vec![1] }).encode()[0], + 30 + ); assert_eq!(RuntimeCall::Module1_1(module1::Call::fail {}).encode()[0], 31); assert_eq!(RuntimeCall::Module2(module2::Call::fail {}).encode()[0], 32); assert_eq!(RuntimeCall::Module1_2(module1::Call::fail {}).encode()[0], 33); @@ -759,9 +764,9 @@ fn test_metadata() { v14::{StorageEntryType::Plain, *}, *, }; - use scale_info::meta_type; use pezsp_core::Encode; use pezsp_metadata_ir::StorageEntryModifierIR::Optional; + use scale_info::meta_type; fn maybe_docs(doc: Vec<&'static str>) -> Vec<&'static str> { if cfg!(feature = "no-metadata-docs") { diff --git a/bizinikiwi/pezframe/support/test/tests/runtime_metadata.rs b/bizinikiwi/pezframe/support/test/tests/runtime_metadata.rs index 1043d3f6..8dc9b130 100644 --- a/bizinikiwi/pezframe/support/test/tests/runtime_metadata.rs +++ b/bizinikiwi/pezframe/support/test/tests/runtime_metadata.rs @@ -17,12 +17,12 @@ #![allow(useless_deprecated)] use pezframe_support::{derive_impl, traits::ConstU32}; -use scale_info::{form::MetaForm, meta_type}; use pezsp_metadata_ir::{ ItemDeprecationInfoIR, RuntimeApiMetadataIR, RuntimeApiMethodMetadataIR, RuntimeApiMethodParamMetadataIR, }; use pezsp_runtime::traits::Block as BlockT; +use scale_info::{form::MetaForm, meta_type}; pub type BlockNumber = u64; pub type Header = pezsp_runtime::generic::Header; diff --git a/bizinikiwi/pezframe/system/benchmarking/src/extensions.rs b/bizinikiwi/pezframe/system/benchmarking/src/extensions.rs index b607abca..645c753f 100644 --- a/bizinikiwi/pezframe/system/benchmarking/src/extensions.rs +++ b/bizinikiwi/pezframe/system/benchmarking/src/extensions.rs @@ -28,8 +28,8 @@ use pezframe_support::{ }; use pezframe_system::{ pezpallet_prelude::*, CheckGenesis, CheckMortality, CheckNonZeroSender, CheckNonce, - CheckSpecVersion, CheckTxVersion, CheckWeight, Config, ExtensionsWeightInfo, Pezpallet as System, - RawOrigin, WeightReclaim, + CheckSpecVersion, CheckTxVersion, CheckWeight, Config, ExtensionsWeightInfo, + Pezpallet as System, RawOrigin, WeightReclaim, }; use pezsp_runtime::{ generic::Era, @@ -260,7 +260,8 @@ mod benchmarks { let base_extrinsic = ::BlockWeights::get() .get(DispatchClass::Normal) .base_extrinsic; - let extension_weight = ::ExtensionsWeightInfo::weight_reclaim(); + let extension_weight = + ::ExtensionsWeightInfo::weight_reclaim(); let info = DispatchInfo { call_weight: Weight::from_parts(base_extrinsic.ref_time() * 5, 0), extension_weight, diff --git a/bizinikiwi/pezframe/system/src/extensions/authorize_call.rs b/bizinikiwi/pezframe/system/src/extensions/authorize_call.rs index 9df98483..ffaa745f 100644 --- a/bizinikiwi/pezframe/system/src/extensions/authorize_call.rs +++ b/bizinikiwi/pezframe/system/src/extensions/authorize_call.rs @@ -230,8 +230,9 @@ mod tests { let info = tx.get_dispatch_info(); let len = tx.using_encoded(|e| e.len()); - let checked = Checkable::check(tx, &pezframe_system::ChainContext::::default()) - .expect("Transaction is general so signature is good"); + let checked = + Checkable::check(tx, &pezframe_system::ChainContext::::default()) + .expect("Transaction is general so signature is good"); let valid_tx = checked .validate::(TransactionSource::External, &info, len) @@ -263,8 +264,9 @@ mod tests { let info = tx.get_dispatch_info(); let len = tx.using_encoded(|e| e.len()); - let checked = Checkable::check(tx, &pezframe_system::ChainContext::::default()) - .expect("Transaction is general so signature is good"); + let checked = + Checkable::check(tx, &pezframe_system::ChainContext::::default()) + .expect("Transaction is general so signature is good"); let validate_err = checked .validate::(TransactionSource::External, &info, len) @@ -292,8 +294,9 @@ mod tests { let info = tx.get_dispatch_info(); let len = tx.using_encoded(|e| e.len()); - let checked = Checkable::check(tx, &pezframe_system::ChainContext::::default()) - .expect("Signature is good"); + let checked = + Checkable::check(tx, &pezframe_system::ChainContext::::default()) + .expect("Signature is good"); checked .validate::(TransactionSource::External, &info, len) @@ -314,7 +317,8 @@ mod tests { fn call_filter_preserved() { new_test_ext().execute_with(|| { let ext = pezframe_system::AuthorizeCall::::new(); - let filtered_call = RuntimeCall::System(pezframe_system::Call::remark { remark: vec![] }); + let filtered_call = + RuntimeCall::System(pezframe_system::Call::remark { remark: vec![] }); let origin = { let mut o: RuntimeOrigin = crate::Origin::::Signed(42).into(); diff --git a/bizinikiwi/pezframe/system/src/extensions/check_genesis.rs b/bizinikiwi/pezframe/system/src/extensions/check_genesis.rs index e9a08670..9fac8622 100644 --- a/bizinikiwi/pezframe/system/src/extensions/check_genesis.rs +++ b/bizinikiwi/pezframe/system/src/extensions/check_genesis.rs @@ -17,12 +17,12 @@ use crate::{pezpallet_prelude::BlockNumberFor, Config, Pezpallet}; use codec::{Decode, DecodeWithMemTracking, Encode}; -use scale_info::TypeInfo; use pezsp_runtime::{ impl_tx_ext_default, traits::{TransactionExtension, Zero}, transaction_validity::TransactionValidityError, }; +use scale_info::TypeInfo; /// Genesis hash check to provide replay protection between different networks. /// diff --git a/bizinikiwi/pezframe/system/src/extensions/check_mortality.rs b/bizinikiwi/pezframe/system/src/extensions/check_mortality.rs index eeb83cee..8a5b8760 100644 --- a/bizinikiwi/pezframe/system/src/extensions/check_mortality.rs +++ b/bizinikiwi/pezframe/system/src/extensions/check_mortality.rs @@ -18,13 +18,13 @@ use crate::{pezpallet_prelude::BlockNumberFor, BlockHash, Config, Pezpallet}; use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::pezpallet_prelude::TransactionSource; -use scale_info::TypeInfo; use pezsp_runtime::{ generic::Era, impl_tx_ext_default, traits::{DispatchInfoOf, SaturatedConversion, TransactionExtension, ValidateResult}, transaction_validity::{InvalidTransaction, TransactionValidityError, ValidTransaction}, }; +use scale_info::TypeInfo; /// Check for transaction mortality. /// diff --git a/bizinikiwi/pezframe/system/src/extensions/check_non_zero_sender.rs b/bizinikiwi/pezframe/system/src/extensions/check_non_zero_sender.rs index 2c2bc9c5..7fab4f4e 100644 --- a/bizinikiwi/pezframe/system/src/extensions/check_non_zero_sender.rs +++ b/bizinikiwi/pezframe/system/src/extensions/check_non_zero_sender.rs @@ -19,12 +19,12 @@ use crate::Config; use codec::{Decode, DecodeWithMemTracking, Encode}; use core::marker::PhantomData; use pezframe_support::{pezpallet_prelude::TransactionSource, traits::OriginTrait, DefaultNoBound}; -use scale_info::TypeInfo; use pezsp_runtime::{ impl_tx_ext_default, traits::{DispatchInfoOf, TransactionExtension}, transaction_validity::InvalidTransaction, }; +use scale_info::TypeInfo; /// Check to ensure that the sender is not the zero address. #[derive(Encode, Decode, DecodeWithMemTracking, DefaultNoBound, Clone, Eq, PartialEq, TypeInfo)] diff --git a/bizinikiwi/pezframe/system/src/extensions/check_nonce.rs b/bizinikiwi/pezframe/system/src/extensions/check_nonce.rs index fe4517d5..7c5dca14 100644 --- a/bizinikiwi/pezframe/system/src/extensions/check_nonce.rs +++ b/bizinikiwi/pezframe/system/src/extensions/check_nonce.rs @@ -24,7 +24,6 @@ use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::{ dispatch::DispatchInfo, pezpallet_prelude::TransactionSource, RuntimeDebugNoBound, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{ AsSystemOriginSigner, CheckedAdd, DispatchInfoOf, Dispatchable, One, PostDispatchInfoOf, @@ -36,6 +35,7 @@ use pezsp_runtime::{ DispatchResult, Saturating, }; use pezsp_weights::Weight; +use scale_info::TypeInfo; /// Nonce check and increment to give replay protection for transactions. /// diff --git a/bizinikiwi/pezframe/system/src/extensions/check_spec_version.rs b/bizinikiwi/pezframe/system/src/extensions/check_spec_version.rs index 341dfe4a..da379215 100644 --- a/bizinikiwi/pezframe/system/src/extensions/check_spec_version.rs +++ b/bizinikiwi/pezframe/system/src/extensions/check_spec_version.rs @@ -17,11 +17,11 @@ use crate::{Config, Pezpallet}; use codec::{Decode, DecodeWithMemTracking, Encode}; -use scale_info::TypeInfo; use pezsp_runtime::{ impl_tx_ext_default, traits::TransactionExtension, transaction_validity::TransactionValidityError, }; +use scale_info::TypeInfo; /// Ensure the runtime version registered in the transaction is the same as at present. /// diff --git a/bizinikiwi/pezframe/system/src/extensions/check_tx_version.rs b/bizinikiwi/pezframe/system/src/extensions/check_tx_version.rs index 802c8786..1c6fb99e 100644 --- a/bizinikiwi/pezframe/system/src/extensions/check_tx_version.rs +++ b/bizinikiwi/pezframe/system/src/extensions/check_tx_version.rs @@ -17,11 +17,11 @@ use crate::{Config, Pezpallet}; use codec::{Decode, DecodeWithMemTracking, Encode}; -use scale_info::TypeInfo; use pezsp_runtime::{ impl_tx_ext_default, traits::TransactionExtension, transaction_validity::TransactionValidityError, }; +use scale_info::TypeInfo; /// Ensure the transaction version registered in the transaction is the same as at present. /// diff --git a/bizinikiwi/pezframe/system/src/extensions/check_weight.rs b/bizinikiwi/pezframe/system/src/extensions/check_weight.rs index c16661f0..6af2bbdf 100644 --- a/bizinikiwi/pezframe/system/src/extensions/check_weight.rs +++ b/bizinikiwi/pezframe/system/src/extensions/check_weight.rs @@ -22,7 +22,6 @@ use pezframe_support::{ pezpallet_prelude::TransactionSource, traits::Get, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{ DispatchInfoOf, Dispatchable, PostDispatchInfoOf, TransactionExtension, ValidateResult, @@ -31,6 +30,7 @@ use pezsp_runtime::{ DispatchResult, }; use pezsp_weights::Weight; +use scale_info::TypeInfo; /// Block resource (weight) limit check. /// diff --git a/bizinikiwi/pezframe/system/src/extensions/weight_reclaim.rs b/bizinikiwi/pezframe/system/src/extensions/weight_reclaim.rs index ec980c25..97cb0570 100644 --- a/bizinikiwi/pezframe/system/src/extensions/weight_reclaim.rs +++ b/bizinikiwi/pezframe/system/src/extensions/weight_reclaim.rs @@ -18,7 +18,6 @@ use crate::Config; use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo}; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{ DispatchInfoOf, Dispatchable, PostDispatchInfoOf, TransactionExtension, ValidateResult, @@ -27,6 +26,7 @@ use pezsp_runtime::{ DispatchResult, }; use pezsp_weights::Weight; +use scale_info::TypeInfo; /// Reclaim the unused weight using the post dispatch information /// diff --git a/bizinikiwi/pezframe/system/src/lib.rs b/bizinikiwi/pezframe/system/src/lib.rs index be2815c1..5f204984 100644 --- a/bizinikiwi/pezframe/system/src/lib.rs +++ b/bizinikiwi/pezframe/system/src/lib.rs @@ -17,8 +17,8 @@ //! # System Pezpallet //! -//! The System pezpallet provides low-level access to core types and cross-cutting utilities. It acts -//! as the base layer for other pallets to interact with the Bizinikiwi framework components. +//! The System pezpallet provides low-level access to core types and cross-cutting utilities. It +//! acts as the base layer for other pallets to interact with the Bizinikiwi framework components. //! //! - [`Config`] //! @@ -37,8 +37,8 @@ //! //! ### Dispatchable Functions //! -//! The System pezpallet provides dispatchable functions that, with the exception of `remark`, manage -//! low-level or privileged functionality of a Bizinikiwi-based runtime. +//! The System pezpallet provides dispatchable functions that, with the exception of `remark`, +//! manage low-level or privileged functionality of a Bizinikiwi-based runtime. //! //! - `remark`: Make some on-chain remark. //! - `set_heap_pages`: Set the number of pages in the WebAssembly environment's heap. @@ -102,8 +102,6 @@ extern crate alloc; use alloc::{borrow::Cow, boxed::Box, vec, vec::Vec}; use core::{fmt::Debug, marker::PhantomData}; use pezpallet_prelude::{BlockNumberFor, HeaderFor}; -#[cfg(feature = "std")] -use serde::Serialize; use pezsp_io::hashing::blake2_256; #[cfg(feature = "runtime-benchmarks")] use pezsp_runtime::traits::TrailingZeroInput; @@ -121,6 +119,8 @@ use pezsp_runtime::{ DispatchError, RuntimeDebug, }; use pezsp_version::RuntimeVersion; +#[cfg(feature = "std")] +use serde::Serialize; use codec::{Decode, DecodeWithMemTracking, Encode, EncodeLike, FullCodec, MaxEncodedLen}; #[cfg(feature = "std")] @@ -142,13 +142,13 @@ use pezframe_support::{ }, Parameter, }; -use scale_info::TypeInfo; use pezsp_core::storage::well_known_keys; use pezsp_runtime::{ traits::{DispatchInfoOf, PostDispatchInfoOf}, transaction_validity::TransactionValidityError, }; use pezsp_weights::{RuntimeDbWeight, Weight, WeightMeter}; +use scale_info::TypeInfo; #[cfg(any(feature = "std", test))] use pezsp_io::TestExternalities; @@ -592,8 +592,8 @@ pub mod pezpallet { /// /// Used to define the type and conversion mechanism for referencing accounts in /// transactions. It's perfectly reasonable for this to be an identity conversion (with the - /// source type being `AccountId`), but other pallets (e.g. Indices pezpallet) may provide more - /// functional/efficient alternatives. + /// source type being `AccountId`), but other pallets (e.g. Indices pezpallet) may provide + /// more functional/efficient alternatives. type Lookup: StaticLookup; /// The Block type used by the runtime. This is used by `construct_runtime` to retrieve the @@ -672,8 +672,8 @@ pub mod pezpallet { /// The migrator that is used to run Multi-Block-Migrations. /// - /// Can be set to [`pezpallet-migrations`] or an alternative implementation of the interface. - /// The diagram in `pezframe_executive::block_flowchart` explains when it runs. + /// Can be set to [`pezpallet-migrations`] or an alternative implementation of the + /// interface. The diagram in `pezframe_executive::block_flowchart` explains when it runs. type MultiBlockMigrator: MultiStepMigrator; /// A callback that executes in *every block* directly before all inherents were applied. diff --git a/bizinikiwi/pezframe/system/src/limits.rs b/bizinikiwi/pezframe/system/src/limits.rs index 2a726533..72000109 100644 --- a/bizinikiwi/pezframe/system/src/limits.rs +++ b/bizinikiwi/pezframe/system/src/limits.rs @@ -29,8 +29,8 @@ use pezframe_support::{ dispatch::{DispatchClass, OneOrMany, PerDispatchClass}, weights::{constants, Weight}, }; -use scale_info::TypeInfo; use pezsp_runtime::{traits::Bounded, Perbill, RuntimeDebug}; +use scale_info::TypeInfo; /// Block length limit configuration. #[derive(RuntimeDebug, Clone, codec::Encode, codec::Decode, TypeInfo)] diff --git a/bizinikiwi/pezframe/system/src/mocking.rs b/bizinikiwi/pezframe/system/src/mocking.rs index ef6629c8..18d1336f 100644 --- a/bizinikiwi/pezframe/system/src/mocking.rs +++ b/bizinikiwi/pezframe/system/src/mocking.rs @@ -33,7 +33,8 @@ pub type MockBlock = generic::Block< MockUncheckedExtrinsic, >; -/// An implementation of `pezsp_runtime::traits::Block` to be used in tests with u32 BlockNumber type. +/// An implementation of `pezsp_runtime::traits::Block` to be used in tests with u32 BlockNumber +/// type. pub type MockBlockU32 = generic::Block< generic::Header, MockUncheckedExtrinsic, diff --git a/bizinikiwi/pezframe/system/src/offchain.rs b/bizinikiwi/pezframe/system/src/offchain.rs index 530d3060..f50fbdb2 100644 --- a/bizinikiwi/pezframe/system/src/offchain.rs +++ b/bizinikiwi/pezframe/system/src/offchain.rs @@ -26,8 +26,8 @@ //! //! ## Usage //! -//! Please refer to [`example-offchain-worker`](../../pezpallet_example_offchain_worker/index.html) for -//! a concrete example usage of this crate. +//! Please refer to [`example-offchain-worker`](../../pezpallet_example_offchain_worker/index.html) +//! for a concrete example usage of this crate. //! //! ### Submit a raw unsigned transaction //! @@ -58,12 +58,12 @@ use alloc::{boxed::Box, collections::btree_set::BTreeSet, vec::Vec}; use codec::Encode; -use scale_info::TypeInfo; use pezsp_runtime::{ app_crypto::RuntimeAppPublic, traits::{ExtrinsicLike, IdentifyAccount, One}, RuntimeDebug, }; +use scale_info::TypeInfo; /// Marker struct used to flag using all supported keys to sign a payload. pub struct ForAll {} @@ -542,12 +542,14 @@ pub trait SignMessage { pub trait CreateAuthorizedTransaction: CreateTransaction { /// Create the transaction extension to be used alongside an authorized call. /// - /// For more information about authorized call see [`pezframe_support::pezpallet_prelude::authorize`]. + /// For more information about authorized call see + /// [`pezframe_support::pezpallet_prelude::authorize`]. fn create_extension() -> Self::Extension; /// Create a new transaction for an authorized call. /// - /// For more information about authorized call see [`pezframe_support::pezpallet_prelude::authorize`]. + /// For more information about authorized call see + /// [`pezframe_support::pezpallet_prelude::authorize`]. fn create_authorized_transaction(call: Self::RuntimeCall) -> Self::Extrinsic { Self::create_transaction(call, Self::create_extension()) } diff --git a/bizinikiwi/pezframe/system/src/tests.rs b/bizinikiwi/pezframe/system/src/tests.rs index 08ba6bda..ad17d626 100644 --- a/bizinikiwi/pezframe/system/src/tests.rs +++ b/bizinikiwi/pezframe/system/src/tests.rs @@ -16,19 +16,19 @@ // limitations under the License. use crate::*; +use bizinikiwi_test_runtime_client::WasmExecutor; +use mock::{RuntimeOrigin, *}; use pezframe_support::{ assert_noop, assert_ok, dispatch::{Pays, PostDispatchInfo, WithPostDispatchInfo}, traits::{OnRuntimeUpgrade, WhitelistedStorageKeys}, }; -use mock::{RuntimeOrigin, *}; use pezsp_core::{hexdisplay::HexDisplay, H256}; use pezsp_runtime::{ traits::{BlakeTwo256, Header}, DispatchError, DispatchErrorWithPostInfo, }; use std::collections::BTreeSet; -use bizinikiwi_test_runtime_client::WasmExecutor; #[test] fn check_whitelist() { @@ -650,7 +650,9 @@ fn set_code_checks_works() { let read_runtime_version = ReadRuntimeVersion(version.encode()); let mut ext = new_test_ext(); - ext.register_extension(pezsp_core::traits::ReadRuntimeVersionExt::new(read_runtime_version)); + ext.register_extension(pezsp_core::traits::ReadRuntimeVersionExt::new( + read_runtime_version, + )); ext.execute_with(|| { let res = System::set_code(RawOrigin::Root.into(), vec![1, 2, 3, 4]); @@ -744,7 +746,8 @@ fn set_code_via_authorization_works() { assert_eq!(System::authorized_upgrade().unwrap().code_hash(), &hash); // Can't be sneaky - let mut bad_runtime = bizinikiwi_test_runtime_client::runtime::wasm_binary_unwrap().to_vec(); + let mut bad_runtime = + bizinikiwi_test_runtime_client::runtime::wasm_binary_unwrap().to_vec(); bad_runtime.extend(b"sneaky"); assert_noop!( System::apply_authorized_upgrade(RawOrigin::None.into(), bad_runtime), diff --git a/bizinikiwi/pezframe/timestamp/src/lib.rs b/bizinikiwi/pezframe/timestamp/src/lib.rs index da044c5e..1c742b60 100644 --- a/bizinikiwi/pezframe/timestamp/src/lib.rs +++ b/bizinikiwi/pezframe/timestamp/src/lib.rs @@ -34,8 +34,8 @@ //! //! ## Overview //! -//! The Timestamp pezpallet is designed to create a consensus-based time source. This helps ensure that -//! nodes maintain a synchronized view of time that all network participants can agree on. +//! The Timestamp pezpallet is designed to create a consensus-based time source. This helps ensure +//! that nodes maintain a synchronized view of time that all network participants can agree on. //! //! It defines an _acceptable range_ using a configurable constant to specify how much time must //! pass before setting the new timestamp. Validator nodes in the network must verify that the @@ -88,13 +88,13 @@ //! included in a block. //! //! To provide inherent data to the runtime, this pezpallet implements -//! [`ProvideInherent`](pezframe_support::inherent::ProvideInherent). It will only create an inherent -//! if the [`Call::set`] dispatchable is called, using the -//! [`inherent`](pezframe_support::pezpallet_macros::inherent) macro which enables validator nodes to call -//! into the runtime to check that the timestamp provided is valid. -//! The implementation of [`ProvideInherent`](pezframe_support::inherent::ProvideInherent) specifies a -//! constant called `MAX_TIMESTAMP_DRIFT_MILLIS` which is used to determine the acceptable range for -//! a valid timestamp. If a block author sets a timestamp to anything that is more than this +//! [`ProvideInherent`](pezframe_support::inherent::ProvideInherent). It will only create an +//! inherent if the [`Call::set`] dispatchable is called, using the +//! [`inherent`](pezframe_support::pezpallet_macros::inherent) macro which enables validator nodes +//! to call into the runtime to check that the timestamp provided is valid. +//! The implementation of [`ProvideInherent`](pezframe_support::inherent::ProvideInherent) specifies +//! a constant called `MAX_TIMESTAMP_DRIFT_MILLIS` which is used to determine the acceptable range +//! for a valid timestamp. If a block author sets a timestamp to anything that is more than this //! constant, a validator node will reject the block. //! //! The pezpallet also ensures that a timestamp is set at the start of each block by running an @@ -188,8 +188,8 @@ pub mod pezpallet { /// /// Be aware that this is different to the *expected* period that the block production /// apparatus provides. Your chosen consensus system will generally work with this to - /// determine a sensible block time. For example, in the Aura pezpallet it will be double this - /// period on default settings. + /// determine a sensible block time. For example, in the Aura pezpallet it will be double + /// this period on default settings. #[pezpallet::constant] type MinimumPeriod: Get; diff --git a/bizinikiwi/pezframe/tips/src/lib.rs b/bizinikiwi/pezframe/tips/src/lib.rs index 81a1b0a5..6a8281b0 100644 --- a/bizinikiwi/pezframe/tips/src/lib.rs +++ b/bizinikiwi/pezframe/tips/src/lib.rs @@ -133,7 +133,9 @@ pub mod pezpallet { pub struct Pezpallet(_); #[pezpallet::config] - pub trait Config: pezframe_system::Config + pezpallet_treasury::Config { + pub trait Config: + pezframe_system::Config + pezpallet_treasury::Config + { /// The overarching event type. #[allow(deprecated)] type RuntimeEvent: From> @@ -435,7 +437,10 @@ pub mod pezpallet { let tip = Tips::::get(hash).ok_or(Error::::UnknownTip)?; let n = tip.closes.as_ref().ok_or(Error::::StillOpen)?; - ensure!(pezframe_system::Pezpallet::::block_number() >= *n, Error::::Premature); + ensure!( + pezframe_system::Pezpallet::::block_number() >= *n, + Error::::Premature + ); // closed. Reasons::::remove(&tip.reason); Tips::::remove(hash); @@ -529,7 +534,8 @@ impl, I: 'static> Pezpallet { Self::retain_active_tips(&mut tip.tips); let threshold = T::Tippers::count().div_ceil(2); if tip.tips.len() >= threshold && tip.closes.is_none() { - tip.closes = Some(pezframe_system::Pezpallet::::block_number() + T::TipCountdown::get()); + tip.closes = + Some(pezframe_system::Pezpallet::::block_number() + T::TipCountdown::get()); true } else { false diff --git a/bizinikiwi/pezframe/tips/src/migrations/unreserve_deposits.rs b/bizinikiwi/pezframe/tips/src/migrations/unreserve_deposits.rs index f6d145b5..83980935 100644 --- a/bizinikiwi/pezframe/tips/src/migrations/unreserve_deposits.rs +++ b/bizinikiwi/pezframe/tips/src/migrations/unreserve_deposits.rs @@ -96,7 +96,8 @@ impl, I: 'static> UnreserveDeposits { /// * `BTreeMap`: Map of account IDs to their respective total /// reserved balance by this pezpallet /// * `pezframe_support::weights::Weight`: The weight of this operation. - fn get_deposits() -> (BTreeMap>, pezframe_support::weights::Weight) { + fn get_deposits() -> (BTreeMap>, pezframe_support::weights::Weight) + { use pezsp_core::Get; let mut tips_len = 0; @@ -130,8 +131,8 @@ where /// 5. Returns the pre-migration actual reserved balance for each account that will /// be part of the migration. /// - /// Fails with a `TryRuntimeError` if somehow the amount reserved by this pezpallet is greater than - /// the actual total reserved amount for any accounts. + /// Fails with a `TryRuntimeError` if somehow the amount reserved by this pezpallet is greater + /// than the actual total reserved amount for any accounts. #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, pezsp_runtime::TryRuntimeError> { use codec::Encode; @@ -147,8 +148,8 @@ where .collect(); // The deposit amount must be less than or equal to the reserved amount. - // If it is higher, there is either a bug with the pezpallet or a bug in the calculation of the - // deposit amount. + // If it is higher, there is either a bug with the pezpallet or a bug in the calculation of + // the deposit amount. ensure!( account_deposits.iter().all(|(account, deposit)| *deposit <= *account_reserved_before.get(account).unwrap_or(&Zero::zero())), diff --git a/bizinikiwi/pezframe/tips/src/migrations/v4.rs b/bizinikiwi/pezframe/tips/src/migrations/v4.rs index afa8ccd9..cf19f090 100644 --- a/bizinikiwi/pezframe/tips/src/migrations/v4.rs +++ b/bizinikiwi/pezframe/tips/src/migrations/v4.rs @@ -39,7 +39,11 @@ use crate as pezpallet_tips; /// The migration will look into the storage version in order not to trigger a migration on an up /// to date storage. Thus the on chain storage version must be less than 4 in order to trigger the /// migration. -pub fn migrate>( +pub fn migrate< + T: pezpallet_tips::Config, + P: GetStorageVersion + PalletInfoAccess, + N: AsRef, +>( old_pallet_name: N, ) -> Weight { let old_pallet_name = old_pallet_name.as_ref(); diff --git a/bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment/src/lib.rs b/bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment/src/lib.rs index e568ac28..0d88bc1a 100644 --- a/bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment/src/lib.rs +++ b/bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment/src/lib.rs @@ -52,7 +52,6 @@ use pezframe_support::{ DefaultNoBound, }; use pezpallet_transaction_payment::{ChargeTransactionPayment, OnChargeTransaction}; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{ AsSystemOriginSigner, DispatchInfoOf, Dispatchable, PostDispatchInfoOf, RefundWeight, @@ -60,6 +59,7 @@ use pezsp_runtime::{ }, transaction_validity::{InvalidTransaction, TransactionValidityError, ValidTransaction}, }; +use scale_info::TypeInfo; #[cfg(test)] mod mock; @@ -71,8 +71,8 @@ pub mod weights; mod benchmarking; mod payment; -use pezframe_support::{pezpallet_prelude::Weight, traits::tokens::AssetId}; pub use payment::*; +use pezframe_support::{pezpallet_prelude::Weight, traits::tokens::AssetId}; pub use weights::WeightInfo; /// Balance type alias for balances of the chain's native asset. @@ -112,7 +112,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config + pezpallet_transaction_payment::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The asset ID type that can be used for transaction payments in addition to a /// native asset. type AssetId: AssetId; @@ -316,7 +317,8 @@ where return Ok((ValidTransaction::default(), Val::NoCharge, origin)); }; // Non-mutating call of `compute_fee` to calculate the fee used in the transaction priority. - let fee = pezpallet_transaction_payment::Pezpallet::::compute_fee(len as u32, info, self.tip); + let fee = + pezpallet_transaction_payment::Pezpallet::::compute_fee(len as u32, info, self.tip); self.can_withdraw_fee(&who, call, info, fee)?; let priority = ChargeTransactionPayment::::get_priority(info, len, self.tip, fee); let validity = ValidTransaction { priority, ..Default::default() }; diff --git a/bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment/src/mock.rs b/bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment/src/mock.rs index db2ab341..04182744 100644 --- a/bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment/src/mock.rs +++ b/bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment/src/mock.rs @@ -20,9 +20,8 @@ use pezframe_support::{ derive_impl, dispatch::DispatchClass, instances::Instance2, - ord_parameter_types, + ord_parameter_types, parameter_types, pezpallet_prelude::*, - parameter_types, traits::{ fungible, fungibles, tokens::{ @@ -157,7 +156,10 @@ pub struct DealWithFungiblesFees; impl OnUnbalanced> for DealWithFungiblesFees { fn on_unbalanceds( mut fees_then_tips: impl Iterator< - Item = fungibles::Credit<::AccountId, NativeAndAssets>, + Item = fungibles::Credit< + ::AccountId, + NativeAndAssets, + >, >, ) { if let Some(fees) = fees_then_tips.next() { diff --git a/bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment/src/tests.rs b/bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment/src/tests.rs index 05b2e9c4..9c5ba6d2 100644 --- a/bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment/src/tests.rs +++ b/bizinikiwi/pezframe/transaction-payment/asset-conversion-tx-payment/src/tests.rs @@ -15,6 +15,7 @@ use super::*; +use mock::{ExtrinsicBaseWeight, *}; use pezframe_support::{ assert_ok, dispatch::{DispatchInfo, GetDispatchInfo, PostDispatchInfo}, @@ -28,7 +29,6 @@ use pezframe_support::{ weights::Weight, }; use pezframe_system as system; -use mock::{ExtrinsicBaseWeight, *}; use pezpallet_balances::Call as BalancesCall; use pezsp_runtime::{ traits::{DispatchTransaction, StaticLookup}, diff --git a/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/lib.rs b/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/lib.rs index 8a2fc232..de24a974 100644 --- a/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/lib.rs +++ b/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/lib.rs @@ -22,15 +22,15 @@ //! It does this by extending transactions to include an optional `AssetId` that specifies the asset //! to be used for payment (defaulting to the native token on `None`). It expects an -//! [`OnChargeAssetTransaction`] implementation analogously to [`pezpallet-transaction-payment`]. The -//! included [`FungiblesAdapter`] (implementing [`OnChargeAssetTransaction`]) determines the fee +//! [`OnChargeAssetTransaction`] implementation analogously to [`pezpallet-transaction-payment`]. +//! The included [`FungiblesAdapter`] (implementing [`OnChargeAssetTransaction`]) determines the fee //! amount by converting the fee calculated by [`pezpallet-transaction-payment`] into the desired //! asset. //! //! ## Integration -//! This pezpallet wraps FRAME's transaction payment pezpallet and functions as a replacement. This means -//! you should include both pallets in your `construct_runtime` macro, but only include this +//! This pezpallet wraps FRAME's transaction payment pezpallet and functions as a replacement. This +//! means you should include both pallets in your `construct_runtime` macro, but only include this //! pezpallet's [`TransactionExtension`] ([`ChargeAssetTxPayment`]). #![cfg_attr(not(feature = "std"), no_std)] @@ -49,7 +49,6 @@ use pezframe_support::{ DefaultNoBound, }; use pezpallet_transaction_payment::OnChargeTransaction; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{ AsSystemOriginSigner, DispatchInfoOf, Dispatchable, PostDispatchInfoOf, RefundWeight, @@ -57,6 +56,7 @@ use pezsp_runtime::{ }, transaction_validity::{InvalidTransaction, TransactionValidityError, ValidTransaction}, }; +use scale_info::TypeInfo; #[cfg(test)] mod mock; @@ -122,7 +122,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config + pezpallet_transaction_payment::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The fungibles instance used to pay for transactions in assets. type Fungibles: Balanced; /// The actual transaction charging logic that charges the fees. @@ -335,7 +336,8 @@ where return Ok((ValidTransaction::default(), Val::NoCharge, origin)); }; // Non-mutating call of `compute_fee` to calculate the fee used in the transaction priority. - let fee = pezpallet_transaction_payment::Pezpallet::::compute_fee(len as u32, info, self.tip); + let fee = + pezpallet_transaction_payment::Pezpallet::::compute_fee(len as u32, info, self.tip); self.can_withdraw_fee(&who, call, info, fee)?; let priority = ChargeTransactionPayment::::get_priority(info, len, self.tip, fee); let val = Val::Charge { tip: self.tip, who: who.clone(), fee }; diff --git a/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/mock.rs b/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/mock.rs index 39993b93..94bf4af4 100644 --- a/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/mock.rs +++ b/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/mock.rs @@ -20,8 +20,8 @@ use codec; use pezframe_support::{ derive_impl, dispatch::DispatchClass, - pezpallet_prelude::*, parameter_types, + pezpallet_prelude::*, traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, FindAuthor}, weights::{Weight, WeightToFee as WeightToFeeT}, ConsensusEngineId, diff --git a/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/payment.rs b/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/payment.rs index 80ce2ba1..97dc69a6 100644 --- a/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/payment.rs +++ b/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/payment.rs @@ -29,11 +29,11 @@ use pezframe_support::{ }, unsigned::TransactionValidityError, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{DispatchInfoOf, MaybeSerializeDeserialize, One, PostDispatchInfoOf}, transaction_validity::InvalidTransaction, }; +use scale_info::TypeInfo; /// Handle withdrawing, refunding and depositing of transaction fees. pub trait OnChargeAssetTransaction { @@ -112,8 +112,8 @@ impl> HandleCredit for () { /// The credit handler is given the complete fee in terms of the asset used for the transaction. pub struct FungiblesAdapter(PhantomData<(CON, HC)>); -/// Default implementation for a runtime instantiating this pezpallet, a balance to asset converter and -/// a credit handler. +/// Default implementation for a runtime instantiating this pezpallet, a balance to asset converter +/// and a credit handler. impl OnChargeAssetTransaction for FungiblesAdapter where T: Config, diff --git a/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/tests.rs b/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/tests.rs index 6c229ab6..e9228269 100644 --- a/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/tests.rs +++ b/bizinikiwi/pezframe/transaction-payment/asset-tx-payment/src/tests.rs @@ -15,6 +15,7 @@ use super::*; +use mock::{ExtrinsicBaseWeight, *}; use pezframe_support::{ assert_ok, dispatch::{DispatchInfo, GetDispatchInfo, PostDispatchInfo}, @@ -23,7 +24,6 @@ use pezframe_support::{ weights::Weight, }; use pezframe_system as system; -use mock::{ExtrinsicBaseWeight, *}; use pezpallet_balances::Call as BalancesCall; use pezsp_runtime::{ traits::{DispatchTransaction, StaticLookup}, diff --git a/bizinikiwi/pezframe/transaction-payment/rpc/src/lib.rs b/bizinikiwi/pezframe/transaction-payment/rpc/src/lib.rs index 09ad9bd9..b8b7e09b 100644 --- a/bizinikiwi/pezframe/transaction-payment/rpc/src/lib.rs +++ b/bizinikiwi/pezframe/transaction-payment/rpc/src/lib.rs @@ -28,7 +28,9 @@ use jsonrpsee::{ ErrorObjectOwned, }, }; -use pezpallet_transaction_payment_rpc_runtime_api::{FeeDetails, InclusionFee, RuntimeDispatchInfo}; +use pezpallet_transaction_payment_rpc_runtime_api::{ + FeeDetails, InclusionFee, RuntimeDispatchInfo, +}; use pezsp_api::ProvideRuntimeApi; use pezsp_blockchain::HeaderBackend; use pezsp_core::Bytes; diff --git a/bizinikiwi/pezframe/transaction-payment/skip-feeless-payment/src/lib.rs b/bizinikiwi/pezframe/transaction-payment/skip-feeless-payment/src/lib.rs index 530d238f..b8bff4a6 100644 --- a/bizinikiwi/pezframe/transaction-payment/skip-feeless-payment/src/lib.rs +++ b/bizinikiwi/pezframe/transaction-payment/skip-feeless-payment/src/lib.rs @@ -22,15 +22,15 @@ //! ## Overview //! //! It does this by wrapping an existing [`TransactionExtension`] implementation (e.g. -//! [`pezpallet-transaction-payment`]) and checking if the dispatchable is feeless before applying the -//! wrapped extension. If the dispatchable is indeed feeless, the extension is skipped and a custom -//! event is emitted instead. Otherwise, the extension is applied as usual. +//! [`pezpallet-transaction-payment`]) and checking if the dispatchable is feeless before applying +//! the wrapped extension. If the dispatchable is indeed feeless, the extension is skipped and a +//! custom event is emitted instead. Otherwise, the extension is applied as usual. //! //! //! ## Integration //! -//! This pezpallet wraps an existing transaction payment pezpallet. This means you should both pallets -//! in your [`construct_runtime`](pezframe_support::construct_runtime) macro and +//! This pezpallet wraps an existing transaction payment pezpallet. This means you should both +//! pallets in your [`construct_runtime`](pezframe_support::construct_runtime) macro and //! include this pezpallet's [`TransactionExtension`] ([`SkipCheckIfFeeless`]) that would accept the //! existing one as an argument. @@ -45,7 +45,6 @@ use pezframe_support::{ traits::{IsType, OriginTrait}, weights::Weight, }; -use scale_info::{StaticTypeInfo, TypeInfo}; use pezsp_runtime::{ traits::{ DispatchInfoOf, DispatchOriginOf, Implication, PostDispatchInfoOf, TransactionExtension, @@ -53,6 +52,7 @@ use pezsp_runtime::{ }, transaction_validity::TransactionValidityError, }; +use scale_info::{StaticTypeInfo, TypeInfo}; #[cfg(test)] mod mock; @@ -69,7 +69,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; } #[pezpallet::pezpallet] diff --git a/bizinikiwi/pezframe/transaction-payment/src/lib.rs b/bizinikiwi/pezframe/transaction-payment/src/lib.rs index 623cc3a8..facf9712 100644 --- a/bizinikiwi/pezframe/transaction-payment/src/lib.rs +++ b/bizinikiwi/pezframe/transaction-payment/src/lib.rs @@ -50,6 +50,7 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; +pub use payment::*; use pezframe_support::{ dispatch::{ DispatchClass, DispatchInfo, DispatchResult, GetDispatchInfo, Pays, PostDispatchInfo, @@ -60,7 +61,6 @@ use pezframe_support::{ RuntimeDebugNoBound, }; pub use pezpallet::*; -pub use payment::*; use pezsp_runtime::{ traits::{ Convert, DispatchInfoOf, Dispatchable, One, PostDispatchInfoOf, SaturatedConversion, @@ -352,7 +352,8 @@ pub mod pezpallet { /// The overarching event type. #[pezpallet::no_default_bounds] #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Handler for withdrawing, refunding and depositing the transaction fee. /// Transaction fees are withdrawn before the transaction is executed. @@ -521,9 +522,9 @@ impl Pezpallet { /// Query the data that we know about the fee of a given `call`. /// - /// This pezpallet is not and cannot be aware of the internals of a signed extension, for example - /// a tip. It only interprets the extrinsic as some encoded value and accounts for its weight - /// and length, the runtime's extrinsic base weight, and the current fee multiplier. + /// This pezpallet is not and cannot be aware of the internals of a signed extension, for + /// example a tip. It only interprets the extrinsic as some encoded value and accounts for its + /// weight and length, the runtime's extrinsic base weight, and the current fee multiplier. /// /// All dispatchables must be annotated with weight and will have some fee info. This function /// always returns. diff --git a/bizinikiwi/pezframe/transaction-payment/src/payment.rs b/bizinikiwi/pezframe/transaction-payment/src/payment.rs index beca756d..a8cab908 100644 --- a/bizinikiwi/pezframe/transaction-payment/src/payment.rs +++ b/bizinikiwi/pezframe/transaction-payment/src/payment.rs @@ -29,11 +29,11 @@ use pezframe_support::{ }, unsigned::TransactionValidityError, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{CheckedSub, DispatchInfoOf, PostDispatchInfoOf, Saturating, Zero}, transaction_validity::InvalidTransaction, }; +use scale_info::TypeInfo; type NegativeImbalanceOf = ::AccountId>>::NegativeImbalance; @@ -104,9 +104,9 @@ pub trait TxCreditHold { type Credit: FullCodec + DecodeWithMemTracking + MaxEncodedLen + TypeInfo + SuppressedDrop; } -/// Implements transaction payment for a pezpallet implementing the [`pezframe_support::traits::fungible`] -/// trait (eg. pezpallet_balances) using an unbalance handler (implementing -/// [`OnUnbalanced`]). +/// Implements transaction payment for a pezpallet implementing the +/// [`pezframe_support::traits::fungible`] trait (eg. pezpallet_balances) using an unbalance handler +/// (implementing [`OnUnbalanced`]). /// /// The unbalance handler is given 2 unbalanceds in [`OnUnbalanced::on_unbalanceds`]: `fee` and /// then `tip`. diff --git a/bizinikiwi/pezframe/transaction-payment/src/tests.rs b/bizinikiwi/pezframe/transaction-payment/src/tests.rs index 7654d443..9659a9a0 100644 --- a/bizinikiwi/pezframe/transaction-payment/src/tests.rs +++ b/bizinikiwi/pezframe/transaction-payment/src/tests.rs @@ -27,6 +27,7 @@ use pezsp_runtime::{ BuildStorage, }; +use mock::*; use pezframe_support::{ assert_ok, dispatch::{DispatchClass, DispatchInfo, GetDispatchInfo, PostDispatchInfo}, @@ -34,7 +35,6 @@ use pezframe_support::{ weights::Weight, }; use pezframe_system as system; -use mock::*; use pezpallet_balances::Call as BalancesCall; pub struct ExtBuilder { diff --git a/bizinikiwi/pezframe/transaction-storage/src/benchmarking.rs b/bizinikiwi/pezframe/transaction-storage/src/benchmarking.rs index c6634a7a..18454374 100644 --- a/bizinikiwi/pezframe/transaction-storage/src/benchmarking.rs +++ b/bizinikiwi/pezframe/transaction-storage/src/benchmarking.rs @@ -23,7 +23,9 @@ use crate::*; use alloc::{vec, vec::Vec}; use pezframe_benchmarking::v2::*; use pezframe_support::traits::{Get, OnFinalize, OnInitialize}; -use pezframe_system::{pezpallet_prelude::BlockNumberFor, EventRecord, Pezpallet as System, RawOrigin}; +use pezframe_system::{ + pezpallet_prelude::BlockNumberFor, EventRecord, Pezpallet as System, RawOrigin, +}; use pezsp_runtime::traits::{Bounded, CheckedDiv, One, Zero}; use pezsp_transaction_storage_proof::TransactionStorageProof; @@ -111,11 +113,15 @@ fn assert_last_event(generic_event: ::RuntimeEvent) { pub fn run_to_block(n: pezframe_system::pezpallet_prelude::BlockNumberFor) { while pezframe_system::Pezpallet::::block_number() < n { crate::Pezpallet::::on_finalize(pezframe_system::Pezpallet::::block_number()); - pezframe_system::Pezpallet::::on_finalize(pezframe_system::Pezpallet::::block_number()); + pezframe_system::Pezpallet::::on_finalize( + pezframe_system::Pezpallet::::block_number(), + ); pezframe_system::Pezpallet::::set_block_number( pezframe_system::Pezpallet::::block_number() + One::one(), ); - pezframe_system::Pezpallet::::on_initialize(pezframe_system::Pezpallet::::block_number()); + pezframe_system::Pezpallet::::on_initialize( + pezframe_system::Pezpallet::::block_number(), + ); crate::Pezpallet::::on_initialize(pezframe_system::Pezpallet::::block_number()); } } diff --git a/bizinikiwi/pezframe/transaction-storage/src/lib.rs b/bizinikiwi/pezframe/transaction-storage/src/lib.rs index ef4620fc..885e712f 100644 --- a/bizinikiwi/pezframe/transaction-storage/src/lib.rs +++ b/bizinikiwi/pezframe/transaction-storage/src/lib.rs @@ -113,7 +113,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// A dispatchable call. type RuntimeCall: Parameter + Dispatchable @@ -234,7 +235,8 @@ pub mod pezpallet { // Chunk data and compute storage root let chunk_count = num_chunks(data.len() as u32); let chunks = data.chunks(CHUNK_SIZE).map(|c| c.to_vec()).collect(); - let root = pezsp_io::trie::blake2_256_ordered_root(chunks, pezsp_runtime::StateVersion::V1); + let root = + pezsp_io::trie::blake2_256_ordered_root(chunks, pezsp_runtime::StateVersion::V1); let content_hash = pezsp_io::hashing::blake2_256(&data); let extrinsic_index = @@ -368,8 +370,8 @@ pub mod pezpallet { /// Storage fee per transaction. pub type EntryFee = StorageValue<_, BalanceOf>; - /// Storage period for data in blocks. Should match `pezsp_storage_proof::DEFAULT_STORAGE_PERIOD` - /// for block authoring. + /// Storage period for data in blocks. Should match + /// `pezsp_storage_proof::DEFAULT_STORAGE_PERIOD` for block authoring. #[pezpallet::storage] pub type StoragePeriod = StorageValue<_, BlockNumberFor, ValueQuery>; diff --git a/bizinikiwi/pezframe/treasury/src/lib.rs b/bizinikiwi/pezframe/treasury/src/lib.rs index fdaa5e5b..b4249c37 100644 --- a/bizinikiwi/pezframe/treasury/src/lib.rs +++ b/bizinikiwi/pezframe/treasury/src/lib.rs @@ -25,8 +25,8 @@ //! //! # Treasury Pezpallet //! -//! The Treasury pezpallet provides a "pot" of funds that can be managed by stakeholders in the system -//! and a structure for making spending proposals from this pot. +//! The Treasury pezpallet provides a "pot" of funds that can be managed by stakeholders in the +//! system and a structure for making spending proposals from this pot. //! //! ## Overview //! @@ -64,10 +64,10 @@ //! Spends can be initiated using either the `spend_local` or `spend` dispatchable. The //! `spend_local` dispatchable enables the creation of spends using the native currency of the //! chain, utilizing the funds stored in the pot. These spends are automatically paid out every -//! [`pezpallet::Config::SpendPeriod`]. On the other hand, the `spend` dispatchable allows spending of -//! any asset kind managed by the treasury, with payment facilitated by a designated -//! [`pezpallet::Config::Paymaster`]. To claim these spends, the `payout` dispatchable should be called -//! within some temporal bounds, starting from the moment they become valid and within one +//! [`pezpallet::Config::SpendPeriod`]. On the other hand, the `spend` dispatchable allows spending +//! of any asset kind managed by the treasury, with payment facilitated by a designated +//! [`pezpallet::Config::Paymaster`]. To claim these spends, the `payout` dispatchable should be +//! called within some temporal bounds, starting from the moment they become valid and within one //! [`pezpallet::Config::PayoutPeriod`]. #![cfg_attr(not(feature = "std"), no_std)] diff --git a/bizinikiwi/pezframe/treasury/src/tests.rs b/bizinikiwi/pezframe/treasury/src/tests.rs index b6003e0a..94a53b16 100644 --- a/bizinikiwi/pezframe/treasury/src/tests.rs +++ b/bizinikiwi/pezframe/treasury/src/tests.rs @@ -26,9 +26,8 @@ use pezsp_runtime::{ }; use pezframe_support::{ - assert_err_ignore_postinfo, assert_noop, assert_ok, derive_impl, + assert_err_ignore_postinfo, assert_noop, assert_ok, derive_impl, parameter_types, pezpallet_prelude::Pays, - parameter_types, traits::{ tokens::{ConversionFromAssetBalance, PaymentStatus}, ConstU32, ConstU64, OnInitialize, diff --git a/bizinikiwi/pezframe/tx-pause/src/lib.rs b/bizinikiwi/pezframe/tx-pause/src/lib.rs index 3f6fac51..0796fe01 100644 --- a/bizinikiwi/pezframe/tx-pause/src/lib.rs +++ b/bizinikiwi/pezframe/tx-pause/src/lib.rs @@ -107,7 +107,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The overarching call type. type RuntimeCall: Parameter diff --git a/bizinikiwi/pezframe/tx-pause/src/tests.rs b/bizinikiwi/pezframe/tx-pause/src/tests.rs index 0f860e4b..88c2b173 100644 --- a/bizinikiwi/pezframe/tx-pause/src/tests.rs +++ b/bizinikiwi/pezframe/tx-pause/src/tests.rs @@ -47,8 +47,9 @@ fn can_pause_all_calls_in_pallet_except_on_whitelist() { new_test_ext().execute_with(|| { assert_ok!(call_transfer(1, 1).dispatch(RuntimeOrigin::signed(0))); - let batch_call = - RuntimeCall::Utility(pezpallet_utility::Call::batch { calls: vec![call_transfer(1, 1)] }); + let batch_call = RuntimeCall::Utility(pezpallet_utility::Call::batch { + calls: vec![call_transfer(1, 1)], + }); assert_ok!(batch_call.clone().dispatch(RuntimeOrigin::signed(0))); assert_ok!(TxPause::pause( @@ -87,8 +88,9 @@ fn can_unpause_specific_call() { #[test] fn can_filter_balance_in_batch_when_paused() { new_test_ext().execute_with(|| { - let batch_call = - RuntimeCall::Utility(pezpallet_utility::Call::batch { calls: vec![call_transfer(1, 1)] }); + let batch_call = RuntimeCall::Utility(pezpallet_utility::Call::batch { + calls: vec![call_transfer(1, 1)], + }); assert_ok!(TxPause::pause( RuntimeOrigin::signed(mock::PauseOrigin::get()), @@ -146,8 +148,9 @@ fn fails_to_pause_unpausable_call_when_other_call_is_paused() { new_test_ext().execute_with(|| { assert_ok!(call_transfer(1, 1).dispatch(RuntimeOrigin::signed(0))); - let batch_call = - RuntimeCall::Utility(pezpallet_utility::Call::batch { calls: vec![call_transfer(1, 1)] }); + let batch_call = RuntimeCall::Utility(pezpallet_utility::Call::batch { + calls: vec![call_transfer(1, 1)], + }); assert_ok!(batch_call.clone().dispatch(RuntimeOrigin::signed(0))); assert_ok!(TxPause::pause( diff --git a/bizinikiwi/pezframe/uniques/src/asset_ops/collection.rs b/bizinikiwi/pezframe/uniques/src/asset_ops/collection.rs index 04af775d..531c80d8 100644 --- a/bizinikiwi/pezframe/uniques/src/asset_ops/collection.rs +++ b/bizinikiwi/pezframe/uniques/src/asset_ops/collection.rs @@ -124,11 +124,14 @@ impl, I: 'static> Create, I: 'static> Destroy> for Collection> { +impl, I: 'static> Destroy> + for Collection> +{ fn destroy(collection: &Self::Id, strategy: WithWitness) -> DispatchResult { let CheckState(witness, _) = strategy; - >::do_destroy_collection(collection.clone(), witness, None).map(|_witness| ()) + >::do_destroy_collection(collection.clone(), witness, None) + .map(|_witness| ()) } } diff --git a/bizinikiwi/pezframe/utility/src/lib.rs b/bizinikiwi/pezframe/utility/src/lib.rs index e11710c3..e7ca2d44 100644 --- a/bizinikiwi/pezframe/utility/src/lib.rs +++ b/bizinikiwi/pezframe/utility/src/lib.rs @@ -36,8 +36,8 @@ //! accounts are, for the purposes of proxy filtering considered exactly the same as the origin //! and are thus hampered with the origin's filters. //! -//! Since proxy filters are respected in all dispatches of this pezpallet, it should never need to be -//! filtered by any proxy. +//! Since proxy filters are respected in all dispatches of this pezpallet, it should never need to +//! be filtered by any proxy. //! //! ## Interface //! diff --git a/bizinikiwi/pezframe/verify-signature/src/extension.rs b/bizinikiwi/pezframe/verify-signature/src/extension.rs index e2c9f4d8..e2124039 100644 --- a/bizinikiwi/pezframe/verify-signature/src/extension.rs +++ b/bizinikiwi/pezframe/verify-signature/src/extension.rs @@ -21,7 +21,6 @@ use crate::{Config, WeightInfo}; use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::{pezpallet_prelude::TransactionSource, traits::OriginTrait}; -use scale_info::TypeInfo; use pezsp_io::hashing::blake2_256; use pezsp_runtime::{ impl_tx_ext_default, @@ -32,12 +31,13 @@ use pezsp_runtime::{ transaction_validity::{InvalidTransaction, TransactionValidityError, ValidTransaction}, }; use pezsp_weights::Weight; +use scale_info::TypeInfo; /// Extension that, if enabled, validates a signature type against the payload constructed from the /// call and the rest of the transaction extension pipeline. This extension provides the /// functionality that traditionally signed transactions had with the implicit signature checking -/// implemented in [`Checkable`](pezsp_runtime::traits::Checkable). It is meant to be placed ahead of -/// any other extensions that do authorization work in the [`TransactionExtension`] pipeline. +/// implemented in [`Checkable`](pezsp_runtime::traits::Checkable). It is meant to be placed ahead +/// of any other extensions that do authorization work in the [`TransactionExtension`] pipeline. #[derive(Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] pub enum VerifySignature diff --git a/bizinikiwi/pezframe/vesting/src/benchmarking.rs b/bizinikiwi/pezframe/vesting/src/benchmarking.rs index f78febb8..1c6e2e01 100644 --- a/bizinikiwi/pezframe/vesting/src/benchmarking.rs +++ b/bizinikiwi/pezframe/vesting/src/benchmarking.rs @@ -128,7 +128,11 @@ mod benchmarks { vest(RawOrigin::Signed(caller.clone())); // Vesting schedule is removed! - assert_eq!(Pezpallet::::vesting_balance(&caller), None, "Vesting schedule was not removed",); + assert_eq!( + Pezpallet::::vesting_balance(&caller), + None, + "Vesting schedule was not removed", + ); Ok(()) } @@ -194,7 +198,11 @@ mod benchmarks { vest_other(RawOrigin::Signed(caller.clone()), other_lookup); // Vesting schedule is removed. - assert_eq!(Pezpallet::::vesting_balance(&other), None, "Vesting schedule was not removed",); + assert_eq!( + Pezpallet::::vesting_balance(&other), + None, + "Vesting schedule was not removed", + ); Ok(()) } diff --git a/bizinikiwi/pezframe/vesting/src/lib.rs b/bizinikiwi/pezframe/vesting/src/lib.rs index 19c82a4a..9e46fac1 100644 --- a/bizinikiwi/pezframe/vesting/src/lib.rs +++ b/bizinikiwi/pezframe/vesting/src/lib.rs @@ -22,10 +22,10 @@ //! //! ## Overview //! -//! A simple pezpallet providing a means of placing a linear curve on an account's locked balance. This -//! pezpallet ensures that there is a lock in place preventing the balance to drop below the *unvested* -//! amount for any reason other than the ones specified in `UnvestedFundsAllowedWithdrawReasons` -//! configuration value. +//! A simple pezpallet providing a means of placing a linear curve on an account's locked balance. +//! This pezpallet ensures that there is a lock in place preventing the balance to drop below the +//! *unvested* amount for any reason other than the ones specified in +//! `UnvestedFundsAllowedWithdrawReasons` configuration value. //! //! As the amount vested increases over time, the amount unvested reduces. However, locks remain in //! place and explicit action is needed on behalf of the user to ensure that the amount locked is @@ -72,7 +72,6 @@ use pezframe_support::{ weights::Weight, }; use pezframe_system::pezpallet_prelude::BlockNumberFor; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{ AtLeast32BitUnsigned, BlockNumberProvider, Bounded, Convert, MaybeSerializeDeserialize, @@ -80,6 +79,7 @@ use pezsp_runtime::{ }, DispatchError, RuntimeDebug, }; +use scale_info::TypeInfo; pub use pezpallet::*; pub use vesting_info::*; @@ -87,8 +87,9 @@ pub use weights::WeightInfo; type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; -type MaxLocksOf = - <::Currency as LockableCurrency<::AccountId>>::MaxLocks; +type MaxLocksOf = <::Currency as LockableCurrency< + ::AccountId, +>>::MaxLocks; type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; const VESTING_ID: LockIdentifier = *b"vesting "; @@ -161,7 +162,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The currency trait. type Currency: LockableCurrency; @@ -199,8 +201,8 @@ pub mod pezpallet { /// - are freshly deploying this pezpallet: `RelaychainDataProvider` /// - Teyrchains with a reliably block production rate (PLO or bulk-coretime): /// - already have the pezpallet deployed: `pezframe_system::Pezpallet` - /// - are freshly deploying this pezpallet: no strong recommendation. Both local and remote - /// providers can be used. Relay provider can be a bit better in cases where the + /// - are freshly deploying this pezpallet: no strong recommendation. Both local and + /// remote providers can be used. Relay provider can be a bit better in cases where the /// teyrchain is lagging its block production to avoid clock skew. type BlockNumberProvider: BlockNumberProvider>; diff --git a/bizinikiwi/pezframe/whitelist/src/lib.rs b/bizinikiwi/pezframe/whitelist/src/lib.rs index 01019c6d..69fff4a8 100644 --- a/bizinikiwi/pezframe/whitelist/src/lib.rs +++ b/bizinikiwi/pezframe/whitelist/src/lib.rs @@ -60,7 +60,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The overarching call type. type RuntimeCall: IsType<::RuntimeCall> diff --git a/bizinikiwi/pezframe/whitelist/src/tests.rs b/bizinikiwi/pezframe/whitelist/src/tests.rs index b15489be..c88144b4 100644 --- a/bizinikiwi/pezframe/whitelist/src/tests.rs +++ b/bizinikiwi/pezframe/whitelist/src/tests.rs @@ -69,7 +69,8 @@ fn test_whitelist_call_and_remove() { #[test] fn test_whitelist_call_and_execute() { new_test_ext().execute_with(|| { - let call = RuntimeCall::System(pezframe_system::Call::remark_with_event { remark: vec![1] }); + let call = + RuntimeCall::System(pezframe_system::Call::remark_with_event { remark: vec![1] }); let call_weight = call.get_dispatch_info().call_weight; let encoded_call = call.encode(); let call_encoded_len = encoded_call.len() as u32; @@ -196,7 +197,8 @@ fn test_whitelist_call_and_execute_without_note_preimage() { #[test] fn test_whitelist_call_and_execute_decode_consumes_all() { new_test_ext().execute_with(|| { - let call = RuntimeCall::System(pezframe_system::Call::remark_with_event { remark: vec![1] }); + let call = + RuntimeCall::System(pezframe_system::Call::remark_with_event { remark: vec![1] }); let call_weight = call.get_dispatch_info().call_weight; let mut call = call.encode(); // Appending something does not make the encoded call invalid. diff --git a/bizinikiwi/primitives/api/src/lib.rs b/bizinikiwi/primitives/api/src/lib.rs index c11ed77a..e42cc6e7 100644 --- a/bizinikiwi/primitives/api/src/lib.rs +++ b/bizinikiwi/primitives/api/src/lib.rs @@ -17,12 +17,12 @@ //! Bizinikiwi runtime api //! -//! The Bizinikiwi runtime api is the interface between the node and the runtime. There isn't a fixed -//! set of runtime apis, instead it is up to the user to declare and implement these runtime apis. -//! The declaration of a runtime api is normally done outside of a runtime, while the implementation -//! of it has to be done in the runtime. We provide the [`decl_runtime_apis!`] macro for declaring -//! a runtime api and the [`impl_runtime_apis!`] for implementing them. The macro docs provide more -//! information on how to use them and what kind of attributes we support. +//! The Bizinikiwi runtime api is the interface between the node and the runtime. There isn't a +//! fixed set of runtime apis, instead it is up to the user to declare and implement these runtime +//! apis. The declaration of a runtime api is normally done outside of a runtime, while the +//! implementation of it has to be done in the runtime. We provide the [`decl_runtime_apis!`] macro +//! for declaring a runtime api and the [`impl_runtime_apis!`] for implementing them. The macro docs +//! provide more information on how to use them and what kind of attributes we support. //! //! It is required that each runtime implements at least the [`Core`] runtime api. This runtime api //! provides all the core functions that Bizinikiwi expects from a runtime. @@ -95,7 +95,6 @@ pub mod __private { pub use alloc::vec; pub use codec::{self, Decode, DecodeLimit, Encode}; pub use core::{mem, slice}; - pub use scale_info; pub use pezsp_core::offchain; #[cfg(not(feature = "std"))] pub use pezsp_core::to_bizinikiwi_wasm_fn_return_value; @@ -108,6 +107,7 @@ pub mod __private { ExtrinsicInclusionMode, TransactionOutcome, }; pub use pezsp_version::{create_apis_vec, ApiId, ApisVec, RuntimeVersion}; + pub use scale_info; #[cfg(all(any(target_arch = "riscv32", target_arch = "riscv64"), bizinikiwi_runtime))] pub use pezsp_runtime_interface::polkavm::{polkavm_abi, polkavm_export}; @@ -395,9 +395,9 @@ pub use pezsp_api_proc_macro::decl_runtime_apis; /// [`decl_runtime_apis!`] declares two version of the api - 1 (the default one, which is /// considered stable in our example) and 99 (which is considered staging). In /// `impl_runtime_apis!` a `cfg_attr` attribute is attached to the `ApiWithStagingMethod` -/// implementation. If the code is compiled with `enable-pezstaging-api` feature a version 99 of -/// the runtime api will be built which will include `pezstaging_one`. Note that `pezstaging_one` -/// implementation is feature gated by `#[cfg(feature = ... )]` attribute. +/// implementation. If the code is compiled with `enable-pezstaging-api` feature a version 99 +/// of the runtime api will be built which will include `pezstaging_one`. Note that +/// `pezstaging_one` implementation is feature gated by `#[cfg(feature = ... )]` attribute. /// /// If the code is compiled without `enable-pezstaging-api` version 1 (the default one) will be /// built which doesn't include `pezstaging_one`. diff --git a/bizinikiwi/primitives/api/test/benches/bench.rs b/bizinikiwi/primitives/api/test/benches/bench.rs index ba9ce543..99b026c7 100644 --- a/bizinikiwi/primitives/api/test/benches/bench.rs +++ b/bizinikiwi/primitives/api/test/benches/bench.rs @@ -15,11 +15,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -use criterion::{criterion_group, criterion_main, Criterion}; -use pezsp_api::ProvideRuntimeApi; use bizinikiwi_test_runtime_client::{ runtime::TestAPI, DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, }; +use criterion::{criterion_group, criterion_main, Criterion}; +use pezsp_api::ProvideRuntimeApi; fn pezsp_api_benchmark(c: &mut Criterion) { c.bench_function("add one with same runtime api", |b| { diff --git a/bizinikiwi/primitives/api/test/tests/runtime_calls.rs b/bizinikiwi/primitives/api/test/tests/runtime_calls.rs index 442ea5aa..9553b0ce 100644 --- a/bizinikiwi/primitives/api/test/tests/runtime_calls.rs +++ b/bizinikiwi/primitives/api/test/tests/runtime_calls.rs @@ -38,9 +38,9 @@ use bizinikiwi_test_runtime_client::{ DefaultTestClientBuilderExt, TestClient, TestClientBuilder, }; +use bizinikiwi_test_runtime_client::pezsc_executor::WasmExecutor; use codec::Encode; use pezsp_consensus::SelectChain; -use bizinikiwi_test_runtime_client::pezsc_executor::WasmExecutor; #[test] fn calling_runtime_function() { diff --git a/bizinikiwi/primitives/application-crypto/src/ed25519.rs b/bizinikiwi/primitives/application-crypto/src/ed25519.rs index 0bdfdcf7..f0e67ecb 100644 --- a/bizinikiwi/primitives/application-crypto/src/ed25519.rs +++ b/bizinikiwi/primitives/application-crypto/src/ed25519.rs @@ -71,7 +71,11 @@ impl RuntimePublic for Public { proof_of_possession: &Self::ProofOfPossession, ) -> bool { let proof_of_possession_statement = Pair::proof_of_possession_statement(owner); - pezsp_io::crypto::ed25519_verify(&proof_of_possession, &proof_of_possession_statement, &self) + pezsp_io::crypto::ed25519_verify( + &proof_of_possession, + &proof_of_possession_statement, + &self, + ) } fn to_raw_vec(&self) -> Vec { diff --git a/bizinikiwi/primitives/application-crypto/src/sr25519.rs b/bizinikiwi/primitives/application-crypto/src/sr25519.rs index e2bf0b01..de283459 100644 --- a/bizinikiwi/primitives/application-crypto/src/sr25519.rs +++ b/bizinikiwi/primitives/application-crypto/src/sr25519.rs @@ -68,7 +68,11 @@ impl RuntimePublic for Public { proof_of_possession: &Self::ProofOfPossession, ) -> bool { let proof_of_possession_statement = Pair::proof_of_possession_statement(owner); - pezsp_io::crypto::sr25519_verify(&proof_of_possession, &proof_of_possession_statement, &self) + pezsp_io::crypto::sr25519_verify( + &proof_of_possession, + &proof_of_possession_statement, + &self, + ) } fn to_raw_vec(&self) -> Vec { diff --git a/bizinikiwi/primitives/application-crypto/src/traits.rs b/bizinikiwi/primitives/application-crypto/src/traits.rs index 41d8f175..9c0d8a8d 100644 --- a/bizinikiwi/primitives/application-crypto/src/traits.rs +++ b/bizinikiwi/primitives/application-crypto/src/traits.rs @@ -20,7 +20,9 @@ use scale_info::TypeInfo; use alloc::vec::Vec; use core::fmt::Debug; -use pezsp_core::crypto::{CryptoType, CryptoTypeId, IsWrappedBy, KeyTypeId, Pair, Public, Signature}; +use pezsp_core::crypto::{ + CryptoType, CryptoTypeId, IsWrappedBy, KeyTypeId, Pair, Public, Signature, +}; /// Application-specific cryptographic object. /// diff --git a/bizinikiwi/primitives/application-crypto/test/src/bls381.rs b/bizinikiwi/primitives/application-crypto/test/src/bls381.rs index 13b9b2c3..d36f9233 100644 --- a/bizinikiwi/primitives/application-crypto/test/src/bls381.rs +++ b/bizinikiwi/primitives/application-crypto/test/src/bls381.rs @@ -17,6 +17,10 @@ //! Integration tests for bls12-381 +use bizinikiwi_test_runtime_client::{ + runtime::{TestAPI, TEST_OWNER}, + DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, +}; use pezsp_api::{ApiExt, ProvideRuntimeApi}; use pezsp_application_crypto::{bls381::AppPair, RuntimePublic}; use pezsp_core::{ @@ -28,10 +32,6 @@ use pezsp_core::{ }; use pezsp_keystore::{testing::MemoryKeystore, Keystore, KeystoreExt}; use std::sync::Arc; -use bizinikiwi_test_runtime_client::{ - runtime::{TestAPI, TEST_OWNER}, - DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, -}; #[test] fn bls381_works_in_runtime() { diff --git a/bizinikiwi/primitives/application-crypto/test/src/ecdsa.rs b/bizinikiwi/primitives/application-crypto/test/src/ecdsa.rs index f6d9c4c7..d36e0063 100644 --- a/bizinikiwi/primitives/application-crypto/test/src/ecdsa.rs +++ b/bizinikiwi/primitives/application-crypto/test/src/ecdsa.rs @@ -16,6 +16,10 @@ // limitations under the License. //! Integration tests for ecdsa +use bizinikiwi_test_runtime_client::{ + runtime::{TestAPI, TEST_OWNER}, + DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, +}; use pezsp_api::{ApiExt, ProvideRuntimeApi}; use pezsp_application_crypto::{ecdsa::AppPair, RuntimePublic}; use pezsp_core::{ @@ -26,10 +30,6 @@ use pezsp_core::{ }; use pezsp_keystore::{testing::MemoryKeystore, Keystore, KeystoreExt}; use std::sync::Arc; -use bizinikiwi_test_runtime_client::{ - runtime::{TestAPI, TEST_OWNER}, - DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, -}; #[test] fn ecdsa_works_in_runtime() { diff --git a/bizinikiwi/primitives/application-crypto/test/src/ecdsa_bls381.rs b/bizinikiwi/primitives/application-crypto/test/src/ecdsa_bls381.rs index 54b137b0..afdf64a9 100644 --- a/bizinikiwi/primitives/application-crypto/test/src/ecdsa_bls381.rs +++ b/bizinikiwi/primitives/application-crypto/test/src/ecdsa_bls381.rs @@ -17,6 +17,10 @@ //! Integration tests for ecdsa-bls12-381 +use bizinikiwi_test_runtime_client::{ + runtime::{TestAPI, TEST_OWNER}, + DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, +}; use pezsp_api::{ApiExt, ProvideRuntimeApi}; use pezsp_application_crypto::{ecdsa_bls381::AppPair, RuntimePublic}; use pezsp_core::{ @@ -28,10 +32,6 @@ use pezsp_core::{ }; use pezsp_keystore::{testing::MemoryKeystore, Keystore, KeystoreExt}; use std::sync::Arc; -use bizinikiwi_test_runtime_client::{ - runtime::{TestAPI, TEST_OWNER}, - DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, -}; #[test] fn ecdsa_bls381_works_in_runtime() { diff --git a/bizinikiwi/primitives/application-crypto/test/src/ed25519.rs b/bizinikiwi/primitives/application-crypto/test/src/ed25519.rs index 14747ef0..95ede728 100644 --- a/bizinikiwi/primitives/application-crypto/test/src/ed25519.rs +++ b/bizinikiwi/primitives/application-crypto/test/src/ed25519.rs @@ -17,6 +17,10 @@ //! Integration tests for ed25519 +use bizinikiwi_test_runtime_client::{ + runtime::{TestAPI, TEST_OWNER}, + DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, +}; use pezsp_api::{ApiExt, ProvideRuntimeApi}; use pezsp_application_crypto::{ed25519::AppPair, RuntimePublic}; use pezsp_core::{ @@ -27,10 +31,6 @@ use pezsp_core::{ }; use pezsp_keystore::{testing::MemoryKeystore, Keystore, KeystoreExt}; use std::sync::Arc; -use bizinikiwi_test_runtime_client::{ - runtime::{TestAPI, TEST_OWNER}, - DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, -}; #[test] fn ed25519_works_in_runtime() { diff --git a/bizinikiwi/primitives/application-crypto/test/src/sr25519.rs b/bizinikiwi/primitives/application-crypto/test/src/sr25519.rs index da87574e..b9063413 100644 --- a/bizinikiwi/primitives/application-crypto/test/src/sr25519.rs +++ b/bizinikiwi/primitives/application-crypto/test/src/sr25519.rs @@ -17,6 +17,10 @@ //! Integration tests for sr25519 +use bizinikiwi_test_runtime_client::{ + runtime::{TestAPI, TEST_OWNER}, + DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, +}; use pezsp_api::{ApiExt, ProvideRuntimeApi}; use pezsp_application_crypto::{sr25519::AppPair, RuntimePublic}; use pezsp_core::{ @@ -27,10 +31,6 @@ use pezsp_core::{ }; use pezsp_keystore::{testing::MemoryKeystore, Keystore, KeystoreExt}; use std::sync::Arc; -use bizinikiwi_test_runtime_client::{ - runtime::{TestAPI, TEST_OWNER}, - DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, -}; #[test] fn sr25519_works_in_runtime() { diff --git a/bizinikiwi/primitives/arithmetic/benches/bench.rs b/bizinikiwi/primitives/arithmetic/benches/bench.rs index 18cfb836..3ef7f2af 100644 --- a/bizinikiwi/primitives/arithmetic/benches/bench.rs +++ b/bizinikiwi/primitives/arithmetic/benches/bench.rs @@ -16,8 +16,8 @@ // limitations under the License. use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput}; -use rand::Rng; use pezsp_arithmetic::biguint::{BigUint, Single}; +use rand::Rng; fn random_big_uint(size: usize) -> BigUint { let mut rng = rand::thread_rng(); diff --git a/bizinikiwi/primitives/arithmetic/src/per_things.rs b/bizinikiwi/primitives/arithmetic/src/per_things.rs index 91252859..873608b4 100644 --- a/bizinikiwi/primitives/arithmetic/src/per_things.rs +++ b/bizinikiwi/primitives/arithmetic/src/per_things.rs @@ -40,8 +40,8 @@ //! //! Each of these can be used to construct and represent ratios within our runtime. //! You will find types like [`Perbill`](Perbill) being used often in pezpallet -//! development. `pezpallet_referenda` is a good example of a pezpallet which makes good use of fixed -//! point arithmetic, as it relies on representing various curves and thresholds relating to +//! development. `pezpallet_referenda` is a good example of a pezpallet which makes good use of +//! fixed point arithmetic, as it relies on representing various curves and thresholds relating to //! governance. //! //! #### Fixed Point Arithmetic with [`PerThing`](PerThing) diff --git a/bizinikiwi/primitives/blockchain/src/header_metadata.rs b/bizinikiwi/primitives/blockchain/src/header_metadata.rs index b8af044c..f770a98e 100644 --- a/bizinikiwi/primitives/blockchain/src/header_metadata.rs +++ b/bizinikiwi/primitives/blockchain/src/header_metadata.rs @@ -19,12 +19,12 @@ //! to compute routes efficiently over the tree of headers. use parking_lot::Mutex; -use schnellru::{ByLength, LruMap}; use pezsp_core::U256; use pezsp_runtime::{ traits::{Block as BlockT, Header, NumberFor, One}, Saturating, }; +use schnellru::{ByLength, LruMap}; /// Set to the expected max difference between `best` and `finalized` blocks at sync. pub(crate) const LRU_CACHE_SIZE: u32 = 5_000; diff --git a/bizinikiwi/primitives/consensus/babe/src/lib.rs b/bizinikiwi/primitives/consensus/babe/src/lib.rs index 815ad2a1..5efbba90 100644 --- a/bizinikiwi/primitives/consensus/babe/src/lib.rs +++ b/bizinikiwi/primitives/consensus/babe/src/lib.rs @@ -28,10 +28,10 @@ pub mod inherents; #[cfg(not(feature = "std"))] use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; +use pezsp_runtime::{traits::Header, ConsensusEngineId, RuntimeDebug}; use scale_info::TypeInfo; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -use pezsp_runtime::{traits::Header, ConsensusEngineId, RuntimeDebug}; use crate::digests::{NextConfigDescriptor, NextEpochDescriptor}; diff --git a/bizinikiwi/primitives/consensus/beefy/src/commitment.rs b/bizinikiwi/primitives/consensus/beefy/src/commitment.rs index 82df720d..d9f5d242 100644 --- a/bizinikiwi/primitives/consensus/beefy/src/commitment.rs +++ b/bizinikiwi/primitives/consensus/beefy/src/commitment.rs @@ -18,9 +18,9 @@ use alloc::{vec, vec::Vec}; use codec::{Decode, DecodeWithMemTracking, Encode, Error, Input}; use core::cmp; -use scale_info::TypeInfo; use pezsp_application_crypto::RuntimeAppPublic; use pezsp_runtime::traits::Hash; +use scale_info::TypeInfo; use crate::{BeefyAuthorityId, Payload, ValidatorSet, ValidatorSetId}; diff --git a/bizinikiwi/primitives/consensus/beefy/src/lib.rs b/bizinikiwi/primitives/consensus/beefy/src/lib.rs index 7bf25072..dbf0d661 100644 --- a/bizinikiwi/primitives/consensus/beefy/src/lib.rs +++ b/bizinikiwi/primitives/consensus/beefy/src/lib.rs @@ -49,7 +49,6 @@ pub use payload::{known_payloads, BeefyPayloadId, Payload, PayloadProvider}; use alloc::vec::Vec; use codec::{Codec, Decode, DecodeWithMemTracking, Encode}; use core::fmt::{Debug, Display}; -use scale_info::TypeInfo; use pezsp_application_crypto::{AppPublic, RuntimeAppPublic}; use pezsp_core::H256; use pezsp_runtime::{ @@ -57,6 +56,7 @@ use pezsp_runtime::{ OpaqueValue, }; use pezsp_weights::Weight; +use scale_info::TypeInfo; /// Key type for BEEFY module. pub const KEY_TYPE: pezsp_core::crypto::KeyTypeId = pezsp_application_crypto::key_types::BEEFY; diff --git a/bizinikiwi/primitives/consensus/beefy/src/mmr.rs b/bizinikiwi/primitives/consensus/beefy/src/mmr.rs index 31c84f25..410f20b6 100644 --- a/bizinikiwi/primitives/consensus/beefy/src/mmr.rs +++ b/bizinikiwi/primitives/consensus/beefy/src/mmr.rs @@ -29,11 +29,11 @@ use crate::{ecdsa_crypto::AuthorityId, ConsensusLog, MmrRootHash, BEEFY_ENGINE_ID}; use alloc::vec::Vec; use codec::{Decode, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; use pezsp_runtime::{ generic::OpaqueDigestItemId, traits::{Block, Header}, }; +use scale_info::TypeInfo; /// A provider for extra data that gets added to the Mmr leaf pub trait BeefyDataProvider { @@ -48,7 +48,8 @@ impl BeefyDataProvider> for () { } } -/// A standard leaf that gets added every block to the MMR constructed by Bizinikiwi's `pezpallet_mmr`. +/// A standard leaf that gets added every block to the MMR constructed by Bizinikiwi's +/// `pezpallet_mmr`. #[derive(Debug, PartialEq, Eq, Clone, Encode, Decode, TypeInfo)] pub struct MmrLeaf { /// Version of the leaf format. diff --git a/bizinikiwi/primitives/consensus/beefy/src/payload.rs b/bizinikiwi/primitives/consensus/beefy/src/payload.rs index 95a563d7..60102fd7 100644 --- a/bizinikiwi/primitives/consensus/beefy/src/payload.rs +++ b/bizinikiwi/primitives/consensus/beefy/src/payload.rs @@ -17,8 +17,8 @@ use alloc::{vec, vec::Vec}; use codec::{Decode, DecodeWithMemTracking, Encode}; -use scale_info::TypeInfo; use pezsp_runtime::traits::Block; +use scale_info::TypeInfo; /// Id of different payloads in the [`crate::Commitment`] data. pub type BeefyPayloadId = [u8; 2]; diff --git a/bizinikiwi/primitives/consensus/common/src/lib.rs b/bizinikiwi/primitives/consensus/common/src/lib.rs index 10892d91..ef43c395 100644 --- a/bizinikiwi/primitives/consensus/common/src/lib.rs +++ b/bizinikiwi/primitives/consensus/common/src/lib.rs @@ -35,9 +35,9 @@ pub mod error; mod select_chain; pub use self::error::Error; -pub use select_chain::SelectChain; pub use pezsp_inherents::InherentData; pub use pezsp_state_machine::Backend as StateBackend; +pub use select_chain::SelectChain; /// Block status. #[derive(Debug, PartialEq, Eq, Clone)] diff --git a/bizinikiwi/primitives/consensus/grandpa/src/lib.rs b/bizinikiwi/primitives/consensus/grandpa/src/lib.rs index 0c5bc8d6..9c4861f3 100644 --- a/bizinikiwi/primitives/consensus/grandpa/src/lib.rs +++ b/bizinikiwi/primitives/consensus/grandpa/src/lib.rs @@ -26,13 +26,13 @@ use serde::Serialize; use alloc::vec::Vec; use codec::{Codec, Decode, DecodeWithMemTracking, Encode}; -use scale_info::TypeInfo; #[cfg(feature = "std")] use pezsp_keystore::KeystorePtr; use pezsp_runtime::{ traits::{Header as HeaderT, NumberFor}, ConsensusEngineId, OpaqueValue, RuntimeDebug, }; +use scale_info::TypeInfo; /// The log target to be used by client code. pub const CLIENT_LOG_TARGET: &str = "grandpa"; diff --git a/bizinikiwi/primitives/consensus/sassafras/src/lib.rs b/bizinikiwi/primitives/consensus/sassafras/src/lib.rs index 2b8085be..30897553 100644 --- a/bizinikiwi/primitives/consensus/sassafras/src/lib.rs +++ b/bizinikiwi/primitives/consensus/sassafras/src/lib.rs @@ -25,9 +25,9 @@ extern crate alloc; use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; use pezsp_core::crypto::KeyTypeId; use pezsp_runtime::{ConsensusEngineId, RuntimeDebug}; +use scale_info::TypeInfo; pub use pezsp_consensus_slots::{Slot, SlotDuration}; diff --git a/bizinikiwi/primitives/consensus/slots/src/lib.rs b/bizinikiwi/primitives/consensus/slots/src/lib.rs index 8a95dc9d..c18fa7b7 100644 --- a/bizinikiwi/primitives/consensus/slots/src/lib.rs +++ b/bizinikiwi/primitives/consensus/slots/src/lib.rs @@ -20,8 +20,8 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; use pezsp_timestamp::Timestamp; +use scale_info::TypeInfo; /// Unit type wrapper that represents a slot. #[derive( diff --git a/bizinikiwi/primitives/core/fuzz/fuzz_targets/fuzz_address_uri.rs b/bizinikiwi/primitives/core/fuzz/fuzz_targets/fuzz_address_uri.rs index 7ed131a4..94d45f1e 100644 --- a/bizinikiwi/primitives/core/fuzz/fuzz_targets/fuzz_address_uri.rs +++ b/bizinikiwi/primitives/core/fuzz/fuzz_targets/fuzz_address_uri.rs @@ -18,12 +18,12 @@ #![no_main] extern crate libfuzzer_sys; -extern crate regex; extern crate pezsp_core; +extern crate regex; use libfuzzer_sys::fuzz_target; -use regex::Regex; use pezsp_core::crypto::AddressUri; +use regex::Regex; use std::sync::LazyLock; static SECRET_PHRASE_REGEX: LazyLock = LazyLock::new(|| { diff --git a/bizinikiwi/primitives/io/src/lib.rs b/bizinikiwi/primitives/io/src/lib.rs index 417b0743..035acc54 100644 --- a/bizinikiwi/primitives/io/src/lib.rs +++ b/bizinikiwi/primitives/io/src/lib.rs @@ -60,9 +60,9 @@ //! Such error messages should always be interpreted as "code accessing host functions accessed //! outside of externalities". //! -//! An externality is any type that implements [`pezsp_externalities::Externalities`]. A simple example -//! of which is [`TestExternalities`], which is commonly used in tests and is exported from this -//! crate. +//! An externality is any type that implements [`pezsp_externalities::Externalities`]. A simple +//! example of which is [`TestExternalities`], which is commonly used in tests and is exported from +//! this crate. //! //! ``` //! use pezsp_io::{storage::get, TestExternalities}; @@ -288,8 +288,9 @@ pub trait Storage { /// operating on the same prefix should always pass `Some`, and this should be equal to the /// previous call result's `maybe_cursor` field. /// - /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. Once - /// the resultant `maybe_cursor` field is `None`, then no further items remain to be deleted. + /// Returns [`MultiRemovalResults`](pezsp_io::MultiRemovalResults) to inform about the result. + /// Once the resultant `maybe_cursor` field is `None`, then no further items remain to be + /// deleted. /// /// NOTE: After the initial call for any given prefix, it is important that no keys further /// keys under the same prefix are inserted. If so, then they may or may not be deleted by diff --git a/bizinikiwi/primitives/merkle-mountain-range/src/lib.rs b/bizinikiwi/primitives/merkle-mountain-range/src/lib.rs index 7f164d97..68fe4b9e 100644 --- a/bizinikiwi/primitives/merkle-mountain-range/src/lib.rs +++ b/bizinikiwi/primitives/merkle-mountain-range/src/lib.rs @@ -28,9 +28,9 @@ pub use mmr_lib; use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode}; use core::fmt; -use scale_info::TypeInfo; use pezsp_debug_derive::RuntimeDebug; use pezsp_runtime::traits; +use scale_info::TypeInfo; pub mod utils; diff --git a/bizinikiwi/primitives/metadata-ir/src/types.rs b/bizinikiwi/primitives/metadata-ir/src/types.rs index 3c51a823..88ac1783 100644 --- a/bizinikiwi/primitives/metadata-ir/src/types.rs +++ b/bizinikiwi/primitives/metadata-ir/src/types.rs @@ -192,8 +192,8 @@ pub struct PalletMetadataIR { pub error: Option>, /// Config's trait associated types. pub associated_types: Vec>, - /// Define the index of the pezpallet, this index will be used for the encoding of pezpallet event, - /// call and origin variants. + /// Define the index of the pezpallet, this index will be used for the encoding of pezpallet + /// event, call and origin variants. pub index: u8, /// Pezpallet documentation. pub docs: Vec, @@ -534,8 +534,9 @@ pub struct OuterEnumsIR { /// /// # Note /// - /// - This type cannot be used directly to decode `pezsp_runtime::DispatchError` from the chain. - /// It provides just the information needed to decode `pezsp_runtime::DispatchError::Module`. + /// - This type cannot be used directly to decode `pezsp_runtime::DispatchError` from the + /// chain. It provides just the information needed to decode + /// `pezsp_runtime::DispatchError::Module`. /// - Decoding the 5 error bytes into this type will not always lead to all of the bytes being /// consumed; many error types do not require all of the bytes to represent them fully. pub error_enum_ty: T::Type, diff --git a/bizinikiwi/primitives/npos-elections/fuzzer/src/common.rs b/bizinikiwi/primitives/npos-elections/fuzzer/src/common.rs index f58e74ce..4235b3d8 100644 --- a/bizinikiwi/primitives/npos-elections/fuzzer/src/common.rs +++ b/bizinikiwi/primitives/npos-elections/fuzzer/src/common.rs @@ -20,9 +20,9 @@ // Each function will be used based on which fuzzer binary is being used. #![allow(dead_code)] -use rand::{self, seq::SliceRandom, Rng, RngCore}; use pezsp_npos_elections::{phragmms, seq_phragmen, BalancingConfig, ElectionResult, VoteWeight}; use pezsp_runtime::Perbill; +use rand::{self, seq::SliceRandom, Rng, RngCore}; use std::collections::{BTreeMap, HashSet}; /// converts x into the range [a, b] in a pseudo-fair way. diff --git a/bizinikiwi/primitives/npos-elections/fuzzer/src/phragmen_balancing.rs b/bizinikiwi/primitives/npos-elections/fuzzer/src/phragmen_balancing.rs index 4192c13d..1489d80d 100644 --- a/bizinikiwi/primitives/npos-elections/fuzzer/src/phragmen_balancing.rs +++ b/bizinikiwi/primitives/npos-elections/fuzzer/src/phragmen_balancing.rs @@ -21,11 +21,11 @@ mod common; use common::*; use honggfuzz::fuzz; -use rand::{self, SeedableRng}; use pezsp_npos_elections::{ assignment_ratio_to_staked_normalized, seq_phragmen, to_supports, BalancingConfig, ElectionResult, EvaluateSupport, VoteWeight, }; +use rand::{self, SeedableRng}; fn main() { loop { diff --git a/bizinikiwi/primitives/npos-elections/fuzzer/src/phragmen_pjr.rs b/bizinikiwi/primitives/npos-elections/fuzzer/src/phragmen_pjr.rs index dbcd6e97..84082af6 100644 --- a/bizinikiwi/primitives/npos-elections/fuzzer/src/phragmen_pjr.rs +++ b/bizinikiwi/primitives/npos-elections/fuzzer/src/phragmen_pjr.rs @@ -46,8 +46,8 @@ use clap::Parser; mod common; use common::{generate_random_npos_inputs, to_range}; -use rand::{self, SeedableRng}; use pezsp_npos_elections::{pjr_check_core, seq_phragmen_core, setup_inputs, standard_threshold}; +use rand::{self, SeedableRng}; type AccountId = u64; diff --git a/bizinikiwi/primitives/npos-elections/fuzzer/src/phragmms_balancing.rs b/bizinikiwi/primitives/npos-elections/fuzzer/src/phragmms_balancing.rs index d5acc6d5..f732fc39 100644 --- a/bizinikiwi/primitives/npos-elections/fuzzer/src/phragmms_balancing.rs +++ b/bizinikiwi/primitives/npos-elections/fuzzer/src/phragmms_balancing.rs @@ -21,12 +21,12 @@ mod common; use common::*; use honggfuzz::fuzz; -use rand::{self, SeedableRng}; use pezsp_npos_elections::{ assignment_ratio_to_staked_normalized, phragmms, to_supports, BalancingConfig, ElectionResult, EvaluateSupport, VoteWeight, }; use pezsp_runtime::Perbill; +use rand::{self, SeedableRng}; fn main() { loop { diff --git a/bizinikiwi/primitives/npos-elections/fuzzer/src/reduce.rs b/bizinikiwi/primitives/npos-elections/fuzzer/src/reduce.rs index a8da615c..3bf5d746 100644 --- a/bizinikiwi/primitives/npos-elections/fuzzer/src/reduce.rs +++ b/bizinikiwi/primitives/npos-elections/fuzzer/src/reduce.rs @@ -34,8 +34,8 @@ use honggfuzz::fuzz; mod common; use common::to_range; -use rand::{self, Rng, RngCore, SeedableRng}; use pezsp_npos_elections::{reduce, to_support_map, ExtendedBalance, StakedAssignment}; +use rand::{self, Rng, RngCore, SeedableRng}; type Balance = u128; type AccountId = u64; diff --git a/bizinikiwi/primitives/npos-elections/src/lib.rs b/bizinikiwi/primitives/npos-elections/src/lib.rs index 0b677b2d..c44a4d64 100644 --- a/bizinikiwi/primitives/npos-elections/src/lib.rs +++ b/bizinikiwi/primitives/npos-elections/src/lib.rs @@ -79,11 +79,11 @@ extern crate alloc; use alloc::{collections::btree_map::BTreeMap, rc::Rc, vec, vec::Vec}; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::{cell::RefCell, cmp::Ordering}; +use pezsp_arithmetic::{traits::Zero, Normalizable, PerThing, Rational128, ThresholdOrd}; +use pezsp_core::RuntimeDebug; use scale_info::TypeInfo; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -use pezsp_arithmetic::{traits::Zero, Normalizable, PerThing, Rational128, ThresholdOrd}; -use pezsp_core::RuntimeDebug; #[cfg(test)] mod mock; @@ -481,8 +481,8 @@ pub struct ElectionResult { /// /// This complements the [`ElectionResult`] and is needed to run the balancing post-processing. /// -/// This, at the current version, resembles the `Exposure` defined in the Staking pezpallet, yet they -/// do not necessarily have to be the same. +/// This, at the current version, resembles the `Exposure` defined in the Staking pezpallet, yet +/// they do not necessarily have to be the same. #[derive(RuntimeDebug, Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Support { diff --git a/bizinikiwi/primitives/npos-elections/src/tests.rs b/bizinikiwi/primitives/npos-elections/src/tests.rs index 58a7a19e..8135c9eb 100644 --- a/bizinikiwi/primitives/npos-elections/src/tests.rs +++ b/bizinikiwi/primitives/npos-elections/src/tests.rs @@ -21,8 +21,8 @@ use crate::{ balancing, helpers::*, mock::*, seq_phragmen, seq_phragmen_core, setup_inputs, to_support_map, Assignment, BalancingConfig, ElectionResult, ExtendedBalance, StakedAssignment, Support, Voter, }; -use pezsp_arithmetic::{PerU16, Perbill, Percent, Permill}; use bizinikiwi_test_utils::assert_eq_uvec; +use pezsp_arithmetic::{PerU16, Perbill, Percent, Permill}; #[test] fn float_phragmen_poc_works() { diff --git a/bizinikiwi/primitives/rpc/src/number.rs b/bizinikiwi/primitives/rpc/src/number.rs index 383422bf..d5df410c 100644 --- a/bizinikiwi/primitives/rpc/src/number.rs +++ b/bizinikiwi/primitives/rpc/src/number.rs @@ -18,8 +18,8 @@ //! A number type that can be serialized both as a number or a string that encodes a number in a //! string. -use serde::{Deserialize, Serialize}; use pezsp_core::U256; +use serde::{Deserialize, Serialize}; use std::fmt::Debug; /// A number type that can be serialized both as a number or a string that encodes a number in a diff --git a/bizinikiwi/primitives/runtime/src/generic/header.rs b/bizinikiwi/primitives/runtime/src/generic/header.rs index 9a3f99a8..e2f1985a 100644 --- a/bizinikiwi/primitives/runtime/src/generic/header.rs +++ b/bizinikiwi/primitives/runtime/src/generic/header.rs @@ -23,9 +23,9 @@ use crate::{ scale_info::TypeInfo, traits::{self, AtLeast32BitUnsigned, BlockNumber, Hash as HashT, MaybeDisplay, Member}, }; +use pezsp_core::U256; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -use pezsp_core::U256; /// Abstraction over a block header for a bizinikiwi chain. #[derive( diff --git a/bizinikiwi/primitives/runtime/src/generic/unchecked_extrinsic.rs b/bizinikiwi/primitives/runtime/src/generic/unchecked_extrinsic.rs index 79600768..0b2a5692 100644 --- a/bizinikiwi/primitives/runtime/src/generic/unchecked_extrinsic.rs +++ b/bizinikiwi/primitives/runtime/src/generic/unchecked_extrinsic.rs @@ -35,9 +35,9 @@ use codec::{ Input, }; use core::fmt; -use scale_info::{build::Fields, meta_type, Path, StaticTypeInfo, Type, TypeInfo, TypeParameter}; use pezsp_io::hashing::blake2_256; use pezsp_weights::Weight; +use scale_info::{build::Fields, meta_type, Path, StaticTypeInfo, Type, TypeInfo, TypeParameter}; /// Type to represent the version of the [Extension](TransactionExtension) used in this extrinsic. pub type ExtensionVersion = u8; diff --git a/bizinikiwi/primitives/runtime/src/lib.rs b/bizinikiwi/primitives/runtime/src/lib.rs index 76de2cb2..8a1d4e34 100644 --- a/bizinikiwi/primitives/runtime/src/lib.rs +++ b/bizinikiwi/primitives/runtime/src/lib.rs @@ -53,12 +53,12 @@ pub use alloc::vec::Vec; #[doc(hidden)] pub use codec; #[doc(hidden)] +pub use pezsp_std; +#[doc(hidden)] pub use scale_info; #[cfg(feature = "serde")] #[doc(hidden)] pub use serde; -#[doc(hidden)] -pub use pezsp_std; #[doc(hidden)] pub use paste; diff --git a/bizinikiwi/primitives/runtime/src/offchain/http.rs b/bizinikiwi/primitives/runtime/src/offchain/http.rs index 22694217..f863612a 100644 --- a/bizinikiwi/primitives/runtime/src/offchain/http.rs +++ b/bizinikiwi/primitives/runtime/src/offchain/http.rs @@ -327,7 +327,8 @@ impl Response { /// Retrieve the headers for this response. pub fn headers(&mut self) -> &Headers { if self.headers.is_none() { - self.headers = Some(Headers { raw: pezsp_io::offchain::http_response_headers(self.id) }); + self.headers = + Some(Headers { raw: pezsp_io::offchain::http_response_headers(self.id) }); } self.headers.as_ref().expect("Headers were just set; qed") } @@ -406,8 +407,11 @@ impl Iterator for ResponseBody { } if self.filled_up_to.is_none() { - let result = - pezsp_io::offchain::http_response_read_body(self.id, &mut self.buffer, self.deadline); + let result = pezsp_io::offchain::http_response_read_body( + self.id, + &mut self.buffer, + self.deadline, + ); match result { Err(e) => { self.error = Some(e); diff --git a/bizinikiwi/primitives/runtime/src/runtime_logger.rs b/bizinikiwi/primitives/runtime/src/runtime_logger.rs index cc6cb23d..732e0147 100644 --- a/bizinikiwi/primitives/runtime/src/runtime_logger.rs +++ b/bizinikiwi/primitives/runtime/src/runtime_logger.rs @@ -65,11 +65,11 @@ impl log::Log for RuntimeLogger { #[cfg(test)] mod tests { - use pezsp_api::ProvideRuntimeApi; - use std::env; use bizinikiwi_test_runtime_client::{ runtime::TestAPI, DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, }; + use pezsp_api::ProvideRuntimeApi; + use std::env; #[test] fn ensure_runtime_logger_works() { diff --git a/bizinikiwi/primitives/runtime/src/testing.rs b/bizinikiwi/primitives/runtime/src/testing.rs index f2203e92..8b7d70e5 100644 --- a/bizinikiwi/primitives/runtime/src/testing.rs +++ b/bizinikiwi/primitives/runtime/src/testing.rs @@ -24,9 +24,9 @@ use crate::{ traits::{self, BlakeTwo256, Dispatchable, LazyExtrinsic, OpaqueKeys}, DispatchResultWithInfo, KeyTypeId, OpaqueExtrinsic, }; -use serde::{de::Error as DeError, Deserialize, Deserializer, Serialize}; use pezsp_core::crypto::{key_types, ByteArray, CryptoType, Dummy}; pub use pezsp_core::{sr25519, H256}; +use serde::{de::Error as DeError, Deserialize, Deserializer, Serialize}; use std::{cell::RefCell, fmt::Debug}; /// A dummy type which can be used instead of regular cryptographic primitives. diff --git a/bizinikiwi/primitives/runtime/src/traits/mod.rs b/bizinikiwi/primitives/runtime/src/traits/mod.rs index 4d9daa5b..a4dca934 100644 --- a/bizinikiwi/primitives/runtime/src/traits/mod.rs +++ b/bizinikiwi/primitives/runtime/src/traits/mod.rs @@ -33,8 +33,6 @@ use codec::{ #[doc(hidden)] pub use core::{fmt::Debug, marker::PhantomData}; use impl_trait_for_tuples::impl_for_tuples; -#[cfg(feature = "serde")] -use serde::{de::DeserializeOwned, Deserialize, Serialize}; use pezsp_application_crypto::AppCrypto; pub use pezsp_arithmetic::traits::{ checked_pow, ensure_pow, AtLeast32Bit, AtLeast32BitUnsigned, Bounded, CheckedAdd, CheckedDiv, @@ -50,6 +48,8 @@ pub use pezsp_core::{ ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, ConstUint, Get, GetDefault, TryCollect, TypedGet, }; +#[cfg(feature = "serde")] +use serde::{de::DeserializeOwned, Deserialize, Serialize}; #[cfg(feature = "std")] use std::fmt::Display; #[cfg(feature = "std")] @@ -157,8 +157,9 @@ pub trait AppVerify { } impl< - S: Verify::Public as pezsp_application_crypto::AppPublic>::Generic> - + From, + S: Verify< + Signer = <::Public as pezsp_application_crypto::AppPublic>::Generic, + > + From, T: pezsp_application_crypto::Wraps + pezsp_application_crypto::AppCrypto + pezsp_application_crypto::AppSignature @@ -1279,8 +1280,8 @@ pub trait Header: // via `HeaderFor` or `BlockNumberFor`. // // This is needed to fix the "cyclical" issue in loading Header/BlockNumber as part of a -// `pezpallet::call`. Essentially, `construct_runtime` aggregates all calls to create a `RuntimeCall` -// that is then used to define `UncheckedExtrinsic`. +// `pezpallet::call`. Essentially, `construct_runtime` aggregates all calls to create a +// `RuntimeCall` that is then used to define `UncheckedExtrinsic`. // ```ignore // pub type UncheckedExtrinsic = // generic::UncheckedExtrinsic; diff --git a/bizinikiwi/primitives/runtime/src/traits/transaction_extension/as_transaction_extension.rs b/bizinikiwi/primitives/runtime/src/traits/transaction_extension/as_transaction_extension.rs index 7c17a2c6..6ec35148 100644 --- a/bizinikiwi/primitives/runtime/src/traits/transaction_extension/as_transaction_extension.rs +++ b/bizinikiwi/primitives/runtime/src/traits/transaction_extension/as_transaction_extension.rs @@ -20,8 +20,8 @@ #![allow(deprecated)] -use scale_info::TypeInfo; use pezsp_core::RuntimeDebug; +use scale_info::TypeInfo; use crate::{ traits::{AsSystemOriginSigner, SignedExtension, ValidateResult}, diff --git a/bizinikiwi/primitives/runtime/src/transaction_validity.rs b/bizinikiwi/primitives/runtime/src/transaction_validity.rs index c13eac65..6fd1a668 100644 --- a/bizinikiwi/primitives/runtime/src/transaction_validity.rs +++ b/bizinikiwi/primitives/runtime/src/transaction_validity.rs @@ -22,8 +22,8 @@ use crate::{ RuntimeDebug, }; use alloc::{vec, vec::Vec}; -use scale_info::TypeInfo; use pezsp_weights::Weight; +use scale_info::TypeInfo; /// Priority for a transaction. Additive. Higher is better. pub type TransactionPriority = u64; diff --git a/bizinikiwi/primitives/runtime/src/type_with_default.rs b/bizinikiwi/primitives/runtime/src/type_with_default.rs index 1572ba1f..d0432db2 100644 --- a/bizinikiwi/primitives/runtime/src/type_with_default.rs +++ b/bizinikiwi/primitives/runtime/src/type_with_default.rs @@ -31,8 +31,8 @@ use num_traits::{ CheckedAdd, CheckedDiv, CheckedMul, CheckedNeg, CheckedRem, CheckedShl, CheckedShr, CheckedSub, Num, NumCast, PrimInt, Saturating, ToPrimitive, }; -use scale_info::{StaticTypeInfo, TypeInfo}; use pezsp_core::Get; +use scale_info::{StaticTypeInfo, TypeInfo}; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; @@ -523,9 +523,9 @@ impl> CompactAs for TypeWithDefault { #[cfg(test)] mod tests { use super::TypeWithDefault; - use scale_info::TypeInfo; use pezsp_arithmetic::traits::{AtLeast16Bit, AtLeast32Bit, AtLeast8Bit}; use pezsp_core::Get; + use scale_info::TypeInfo; #[test] #[allow(dead_code)] diff --git a/bizinikiwi/primitives/staking/src/lib.rs b/bizinikiwi/primitives/staking/src/lib.rs index 569d8d39..f6798cde 100644 --- a/bizinikiwi/primitives/staking/src/lib.rs +++ b/bizinikiwi/primitives/staking/src/lib.rs @@ -26,11 +26,11 @@ use crate::currency_to_vote::CurrencyToVote; use alloc::{collections::btree_map::BTreeMap, vec, vec::Vec}; use codec::{Decode, DecodeWithMemTracking, Encode, FullCodec, HasCompact, MaxEncodedLen}; use core::ops::{Add, AddAssign, Sub, SubAssign}; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{AtLeast32BitUnsigned, Zero}, DispatchError, DispatchResult, Perbill, RuntimeDebug, Saturating, }; +use scale_info::TypeInfo; pub mod offence; @@ -330,8 +330,8 @@ pub trait StakingUnchecked: StakingInterface { /// Book-keep a new bond for `keyless_who` without applying any locks (hence virtual). /// /// It is important that `keyless_who` is a keyless account and therefore cannot interact with - /// staking pezpallet directly. Caller is responsible for ensuring the passed amount is locked and - /// valid. + /// staking pezpallet directly. Caller is responsible for ensuring the passed amount is locked + /// and valid. fn virtual_bond( keyless_who: &Self::AccountId, value: Self::Balance, diff --git a/bizinikiwi/primitives/staking/src/offence.rs b/bizinikiwi/primitives/staking/src/offence.rs index d6869284..9776318e 100644 --- a/bizinikiwi/primitives/staking/src/offence.rs +++ b/bizinikiwi/primitives/staking/src/offence.rs @@ -169,7 +169,9 @@ impl OnOffenceHandler } /// A details about an offending authority for a particular kind of offence. -#[derive(Clone, PartialEq, Eq, Encode, Decode, pezsp_runtime::RuntimeDebug, scale_info::TypeInfo)] +#[derive( + Clone, PartialEq, Eq, Encode, Decode, pezsp_runtime::RuntimeDebug, scale_info::TypeInfo, +)] pub struct OffenceDetails { /// The offending authority id pub offender: Offender, diff --git a/bizinikiwi/primitives/state-machine/src/lib.rs b/bizinikiwi/primitives/state-machine/src/lib.rs index 847e1dab..7ddb2b93 100644 --- a/bizinikiwi/primitives/state-machine/src/lib.rs +++ b/bizinikiwi/primitives/state-machine/src/lib.rs @@ -165,7 +165,6 @@ mod execution { use super::*; use codec::Codec; use hash_db::Hasher; - use smallvec::SmallVec; use pezsp_core::{ hexdisplay::HexDisplay, storage::{ChildInfo, ChildType, PrefixedStorageKey}, @@ -173,6 +172,7 @@ mod execution { }; use pezsp_externalities::Extensions; use pezsp_trie::PrefixedMemoryDB; + use smallvec::SmallVec; use std::collections::{HashMap, HashSet}; pub(crate) type CallResult = Result, E>; diff --git a/bizinikiwi/primitives/state-machine/src/testing.rs b/bizinikiwi/primitives/state-machine/src/testing.rs index 0229943e..af2b0fd2 100644 --- a/bizinikiwi/primitives/state-machine/src/testing.rs +++ b/bizinikiwi/primitives/state-machine/src/testing.rs @@ -143,7 +143,12 @@ where /// Insert key/value into backend. /// /// This only supports inserting keys in child tries. - pub fn insert_child(&mut self, c: pezsp_core::storage::ChildInfo, k: StorageKey, v: StorageValue) { + pub fn insert_child( + &mut self, + c: pezsp_core::storage::ChildInfo, + k: StorageKey, + v: StorageValue, + ) { self.backend.insert(vec![(Some(c), vec![(k, Some(v))])], self.state_version); } @@ -260,7 +265,8 @@ where let mut proving_ext = Ext::new(&mut self.overlay, &proving_backend, Some(&mut self.extensions)); - let outcome = pezsp_externalities::set_and_run_with_externalities(&mut proving_ext, execute); + let outcome = + pezsp_externalities::set_and_run_with_externalities(&mut proving_ext, execute); let proof = proving_backend.extract_proof().expect("Failed to extract storage proof"); (outcome, proof) @@ -394,7 +400,10 @@ where self.extension_by_type_id(TypeId::of::()).and_then(::downcast_mut) } - fn register_extension(&mut self, ext: T) -> Result<(), pezsp_externalities::Error> { + fn register_extension( + &mut self, + ext: T, + ) -> Result<(), pezsp_externalities::Error> { self.register_extension_with_type_id(TypeId::of::(), Box::new(ext)) } diff --git a/bizinikiwi/primitives/statement-store/src/ecies.rs b/bizinikiwi/primitives/statement-store/src/ecies.rs index 83362a47..0fc3a879 100644 --- a/bizinikiwi/primitives/statement-store/src/ecies.rs +++ b/bizinikiwi/primitives/statement-store/src/ecies.rs @@ -20,9 +20,9 @@ // end::description[] use aes_gcm::{aead::Aead, AeadCore, KeyInit}; +use pezsp_core::crypto::Pair; use rand::rngs::OsRng; use sha2::Digest; -use pezsp_core::crypto::Pair; /// x25519 secret key. pub type SecretKey = x25519_dalek::StaticSecret; @@ -92,7 +92,10 @@ pub fn encrypt_x25519(pk: &PublicKey, plaintext: &[u8]) -> Result, Error /// Encrypt `plaintext` with the given ed25519 public key. Decryption can be performed with the /// matching secret key. -pub fn encrypt_ed25519(pk: &pezsp_core::ed25519::Public, plaintext: &[u8]) -> Result, Error> { +pub fn encrypt_ed25519( + pk: &pezsp_core::ed25519::Public, + plaintext: &[u8], +) -> Result, Error> { let ed25519 = curve25519_dalek::edwards::CompressedEdwardsY(pk.0); let x25519 = ed25519.decompress().ok_or(Error::BadData)?.to_montgomery(); let montgomery = x25519_dalek::PublicKey::from(x25519.to_bytes()); @@ -118,7 +121,10 @@ pub fn decrypt_x25519(sk: &SecretKey, encrypted: &[u8]) -> Result, Error } /// Decrypt with the given ed25519 key pair. -pub fn decrypt_ed25519(pair: &pezsp_core::ed25519::Pair, encrypted: &[u8]) -> Result, Error> { +pub fn decrypt_ed25519( + pair: &pezsp_core::ed25519::Pair, + encrypted: &[u8], +) -> Result, Error> { let raw = pair.to_raw_vec(); let hash: [u8; 32] = sha2::Sha512::digest(&raw).as_slice()[..32] .try_into() @@ -130,8 +136,8 @@ pub fn decrypt_ed25519(pair: &pezsp_core::ed25519::Pair, encrypted: &[u8]) -> Re #[cfg(test)] mod test { use super::*; - use rand::rngs::OsRng; use pezsp_core::crypto::Pair; + use rand::rngs::OsRng; #[test] fn basic_x25519_encryption() { diff --git a/bizinikiwi/primitives/statement-store/src/lib.rs b/bizinikiwi/primitives/statement-store/src/lib.rs index 72662a69..2f4ee1b0 100644 --- a/bizinikiwi/primitives/statement-store/src/lib.rs +++ b/bizinikiwi/primitives/statement-store/src/lib.rs @@ -24,10 +24,10 @@ extern crate alloc; use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode}; -use scale_info::TypeInfo; use pezsp_application_crypto::RuntimeAppPublic; #[cfg(feature = "std")] use pezsp_core::Pair; +use scale_info::TypeInfo; /// Statement topic. pub type Topic = [u8; 32]; @@ -175,7 +175,9 @@ impl Field { } /// Statement structure. -#[derive(DecodeWithMemTracking, TypeInfo, pezsp_core::RuntimeDebug, Clone, PartialEq, Eq, Default)] +#[derive( + DecodeWithMemTracking, TypeInfo, pezsp_core::RuntimeDebug, Clone, PartialEq, Eq, Default, +)] pub struct Statement { proof: Option, decryption_key: Option, diff --git a/bizinikiwi/primitives/statement-store/src/runtime_api.rs b/bizinikiwi/primitives/statement-store/src/runtime_api.rs index 7e09e1a8..e7755159 100644 --- a/bizinikiwi/primitives/statement-store/src/runtime_api.rs +++ b/bizinikiwi/primitives/statement-store/src/runtime_api.rs @@ -20,7 +20,6 @@ use crate::{Hash, Statement, Topic}; use alloc::vec::Vec; use codec::{Decode, Encode}; -use scale_info::TypeInfo; use pezsp_runtime::RuntimeDebug; use pezsp_runtime_interface::{ pass_by::{ @@ -29,6 +28,7 @@ use pezsp_runtime_interface::{ }, runtime_interface, }; +use scale_info::TypeInfo; #[cfg(feature = "std")] use pezsp_externalities::ExternalitiesExt; diff --git a/bizinikiwi/primitives/storage/src/lib.rs b/bizinikiwi/primitives/storage/src/lib.rs index 1fe173c1..1003ff41 100644 --- a/bizinikiwi/primitives/storage/src/lib.rs +++ b/bizinikiwi/primitives/storage/src/lib.rs @@ -21,9 +21,9 @@ extern crate alloc; +use pezsp_debug_derive::RuntimeDebug; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -use pezsp_debug_derive::RuntimeDebug; use alloc::vec::Vec; use codec::{Decode, Encode}; diff --git a/bizinikiwi/primitives/trie/src/accessed_nodes_tracker.rs b/bizinikiwi/primitives/trie/src/accessed_nodes_tracker.rs index efb9c025..e19dd443 100644 --- a/bizinikiwi/primitives/trie/src/accessed_nodes_tracker.rs +++ b/bizinikiwi/primitives/trie/src/accessed_nodes_tracker.rs @@ -19,8 +19,8 @@ use alloc::collections::BTreeSet; use core::hash::Hash; -use scale_info::TypeInfo; use pezsp_core::{Decode, Encode}; +use scale_info::TypeInfo; use trie_db::{RecordedForKey, TrieAccess, TrieRecorder}; /// Error associated with the `AccessedNodesTracker` module. diff --git a/bizinikiwi/primitives/trie/src/cache/mod.rs b/bizinikiwi/primitives/trie/src/cache/mod.rs index d730e826..17977922 100644 --- a/bizinikiwi/primitives/trie/src/cache/mod.rs +++ b/bizinikiwi/primitives/trie/src/cache/mod.rs @@ -856,8 +856,8 @@ impl<'a, H: Hasher> trie_db::TrieCache> for TrieCache<'a, H> { #[cfg(test)] mod tests { use super::*; - use rand::{thread_rng, Rng}; use pezsp_core::H256; + use rand::{thread_rng, Rng}; use trie_db::{Bytes, Trie, TrieDBBuilder, TrieDBMutBuilder, TrieHash, TrieMut}; type MemoryDB = crate::MemoryDB; diff --git a/bizinikiwi/primitives/trie/src/trie_codec.rs b/bizinikiwi/primitives/trie/src/trie_codec.rs index 64b3b832..30236a27 100644 --- a/bizinikiwi/primitives/trie/src/trie_codec.rs +++ b/bizinikiwi/primitives/trie/src/trie_codec.rs @@ -80,7 +80,8 @@ where let mut iter = trie.iter()?; - let childtrie_roots = pezsp_core::storage::well_known_keys::DEFAULT_CHILD_STORAGE_KEY_PREFIX; + let childtrie_roots = + pezsp_core::storage::well_known_keys::DEFAULT_CHILD_STORAGE_KEY_PREFIX; if iter.seek(childtrie_roots).is_ok() { loop { match iter.next() { @@ -161,7 +162,8 @@ where let mut iter = trie.iter()?; - let childtrie_roots = pezsp_core::storage::well_known_keys::DEFAULT_CHILD_STORAGE_KEY_PREFIX; + let childtrie_roots = + pezsp_core::storage::well_known_keys::DEFAULT_CHILD_STORAGE_KEY_PREFIX; if iter.seek(childtrie_roots).is_ok() { loop { match iter.next() { diff --git a/bizinikiwi/primitives/version/proc-macro/src/decl_runtime_version.rs b/bizinikiwi/primitives/version/proc-macro/src/decl_runtime_version.rs index 86a9be38..d28fe0b0 100644 --- a/bizinikiwi/primitives/version/proc-macro/src/decl_runtime_version.rs +++ b/bizinikiwi/primitives/version/proc-macro/src/decl_runtime_version.rs @@ -289,8 +289,11 @@ mod tests { .encode(); assert_eq!( - pezsp_version::RuntimeVersion::decode_with_version_hint(&mut &version_bytes[..], Some(4)) - .unwrap(), + pezsp_version::RuntimeVersion::decode_with_version_hint( + &mut &version_bytes[..], + Some(4) + ) + .unwrap(), pezsp_version::RuntimeVersion { spec_name: "hello".into(), impl_name: "world".into(), diff --git a/bizinikiwi/primitives/version/src/lib.rs b/bizinikiwi/primitives/version/src/lib.rs index 0ed44a91..1ba433f7 100644 --- a/bizinikiwi/primitives/version/src/lib.rs +++ b/bizinikiwi/primitives/version/src/lib.rs @@ -45,11 +45,11 @@ use std::collections::HashSet; #[doc(hidden)] pub use alloc::borrow::Cow; use codec::{Decode, Encode, Input}; -use scale_info::TypeInfo; #[allow(deprecated)] pub use pezsp_runtime::{create_runtime_str, StateVersion}; #[doc(hidden)] pub use pezsp_std; +use scale_info::TypeInfo; #[cfg(feature = "std")] use pezsp_runtime::traits::Block as BlockT; @@ -208,18 +208,18 @@ pub struct RuntimeVersion { /// /// This number must change when an existing call (pezpallet index, call index) is changed, /// either through an alteration in its user-level semantics, a parameter - /// added/removed, a parameter type changed, or a call/pezpallet changing its index. An alteration - /// of the user level semantics is for example when the call was before `transfer` and now is - /// `transfer_all`, the semantics of the call changed completely. + /// added/removed, a parameter type changed, or a call/pezpallet changing its index. An + /// alteration of the user level semantics is for example when the call was before `transfer` + /// and now is `transfer_all`, the semantics of the call changed completely. /// - /// Removing a pezpallet or a call doesn't require a *bump* as long as no pezpallet or call is put at - /// the same index. Removing doesn't require a bump as the chain will reject a transaction - /// referencing this removed call/pezpallet while decoding and thus, the user isn't at risk to - /// execute any unknown call. FRAME runtime devs have control over the index of a call/pezpallet - /// to prevent that an index gets reused. + /// Removing a pezpallet or a call doesn't require a *bump* as long as no pezpallet or call is + /// put at the same index. Removing doesn't require a bump as the chain will reject a + /// transaction referencing this removed call/pezpallet while decoding and thus, the user + /// isn't at risk to execute any unknown call. FRAME runtime devs have control over the index + /// of a call/pezpallet to prevent that an index gets reused. /// - /// Adding a new pezpallet or call also doesn't require a *bump* as long as they also don't reuse - /// any previously used index. + /// Adding a new pezpallet or call also doesn't require a *bump* as long as they also don't + /// reuse any previously used index. /// /// This number should never decrease. pub transaction_version: u32, diff --git a/bizinikiwi/primitives/wasm-interface/Cargo.toml b/bizinikiwi/primitives/wasm-interface/Cargo.toml index 650e9601..132eb302 100644 --- a/bizinikiwi/primitives/wasm-interface/Cargo.toml +++ b/bizinikiwi/primitives/wasm-interface/Cargo.toml @@ -25,5 +25,10 @@ wasmtime = { optional = true, workspace = true } [features] default = ["std"] -std = ["anyhow?/std", "codec/std", "log/std"] +std = [ + "anyhow?/std", + "codec/std", + "log/std", + "wasmtime?/std" +] wasmtime = ["anyhow", "dep:wasmtime"] diff --git a/bizinikiwi/primitives/weights/src/lib.rs b/bizinikiwi/primitives/weights/src/lib.rs index 0f10d09b..5a030f9d 100644 --- a/bizinikiwi/primitives/weights/src/lib.rs +++ b/bizinikiwi/primitives/weights/src/lib.rs @@ -26,15 +26,15 @@ mod weight_v2; use bounded_collections::Get; use codec::{Decode, Encode}; -use scale_info::TypeInfo; -#[cfg(feature = "serde")] -use serde::{Deserialize, Serialize}; -use smallvec::SmallVec; use pezsp_arithmetic::{ traits::{BaseArithmetic, SaturatedConversion, Unsigned}, Perbill, }; use pezsp_debug_derive::RuntimeDebug; +use scale_info::TypeInfo; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; +use smallvec::SmallVec; pub use weight_meter::*; pub use weight_v2::*; diff --git a/bizinikiwi/test-utils/cli/src/lib.rs b/bizinikiwi/test-utils/cli/src/lib.rs index 72f52a84..f303caa2 100644 --- a/bizinikiwi/test-utils/cli/src/lib.rs +++ b/bizinikiwi/test-utils/cli/src/lib.rs @@ -23,8 +23,8 @@ use nix::{ unistd::Pid, }; use pez_node_primitives::{Hash, Header}; -use regex::Regex; use pezsp_rpc::{list::ListOrValue, number::NumberOrHex}; +use regex::Regex; use std::{ io::{BufRead, BufReader, Read}, ops::{Deref, DerefMut}, diff --git a/bizinikiwi/test-utils/client/src/lib.rs b/bizinikiwi/test-utils/client/src/lib.rs index 3bf17be9..45ade806 100644 --- a/bizinikiwi/test-utils/client/src/lib.rs +++ b/bizinikiwi/test-utils/client/src/lib.rs @@ -34,13 +34,13 @@ pub use pezsp_runtime::{Storage, StorageChild}; use futures::{future::Future, stream::StreamExt}; use pezsc_client_api::BlockchainEvents; use pezsc_service::client::{ClientConfig, LocalCallExecutor}; -use serde::Deserialize; use pezsp_core::{storage::ChildInfo, testing::TaskExecutor}; use pezsp_runtime::{ codec::Encode, traits::{Block as BlockT, Header}, OpaqueExtrinsic, }; +use serde::Deserialize; use std::{ collections::{HashMap, HashSet}, pin::Pin, @@ -186,8 +186,10 @@ impl pezsc_consensus::LongestChain, ) where - ExecutorDispatch: - pezsc_client_api::CallExecutor + pezsc_executor::RuntimeVersionOf + Clone + 'static, + ExecutorDispatch: pezsc_client_api::CallExecutor + + pezsc_executor::RuntimeVersionOf + + Clone + + 'static, Backend: pezsc_client_api::backend::Backend, >::OffchainStorage: 'static, { diff --git a/bizinikiwi/test-utils/runtime/client/src/block_builder_ext.rs b/bizinikiwi/test-utils/runtime/client/src/block_builder_ext.rs index 5e8f4e6c..33ee16e5 100644 --- a/bizinikiwi/test-utils/runtime/client/src/block_builder_ext.rs +++ b/bizinikiwi/test-utils/runtime/client/src/block_builder_ext.rs @@ -17,9 +17,9 @@ //! Block Builder extensions for tests. +use bizinikiwi_test_runtime::*; use pezsc_block_builder::BlockBuilderApi; use pezsp_api::{ApiExt, ProvideRuntimeApi}; -use bizinikiwi_test_runtime::*; /// Extension trait for test block builder. pub trait BlockBuilderExt { @@ -43,12 +43,14 @@ pub trait BlockBuilderExt { ) -> Result<(), pezsp_blockchain::Error>; } -impl<'a, A> BlockBuilderExt for pezsc_block_builder::BlockBuilder<'a, bizinikiwi_test_runtime::Block, A> +impl<'a, A> BlockBuilderExt + for pezsc_block_builder::BlockBuilder<'a, bizinikiwi_test_runtime::Block, A> where A: ProvideRuntimeApi + pezsp_api::CallApiAt + 'a, - A::Api: BlockBuilderApi + ApiExt, + A::Api: + BlockBuilderApi + ApiExt, { fn push_transfer( &mut self, diff --git a/bizinikiwi/test-utils/runtime/client/src/lib.rs b/bizinikiwi/test-utils/runtime/client/src/lib.rs index 026d9ac7..2dd47ff9 100644 --- a/bizinikiwi/test-utils/runtime/client/src/lib.rs +++ b/bizinikiwi/test-utils/runtime/client/src/lib.rs @@ -23,15 +23,15 @@ pub mod trait_tests; mod block_builder_ext; -pub use pezsc_consensus::LongestChain; -use std::sync::Arc; pub use bizinikiwi_test_client::*; pub use bizinikiwi_test_runtime as runtime; +pub use pezsc_consensus::LongestChain; +use std::sync::Arc; pub use self::block_builder_ext::BlockBuilderExt; -use pezsp_core::storage::ChildInfo; use bizinikiwi_test_runtime::genesismap::GenesisStorageBuilder; +use pezsp_core::storage::ChildInfo; /// A prelude to import in tests. pub mod prelude { @@ -185,7 +185,10 @@ pub trait TestClientBuilderExt: Sized { } impl TestClientBuilderExt - for TestClientBuilder, B> + for TestClientBuilder< + client::LocalCallExecutor, + B, + > where B: pezsc_client_api::backend::Backend + 'static, { diff --git a/bizinikiwi/test-utils/runtime/client/src/trait_tests.rs b/bizinikiwi/test-utils/runtime/client/src/trait_tests.rs index 1a489c07..72cc2737 100644 --- a/bizinikiwi/test-utils/runtime/client/src/trait_tests.rs +++ b/bizinikiwi/test-utils/runtime/client/src/trait_tests.rs @@ -25,6 +25,7 @@ use std::sync::Arc; use crate::{ BlockBuilderExt, ClientBlockImportExt, Sr25519Keyring, TestClientBuilder, TestClientBuilderExt, }; +use bizinikiwi_test_runtime::Transfer; use futures::executor::block_on; use pezsc_block_builder::BlockBuilderBuilder; use pezsc_client_api::{ @@ -33,7 +34,6 @@ use pezsc_client_api::{ }; use pezsp_consensus::BlockOrigin; use pezsp_runtime::traits::Block as BlockT; -use bizinikiwi_test_runtime::Transfer; /// helper to test the `leaves` implementation for various backends pub fn test_leaves_for_backend(backend: Arc) diff --git a/bizinikiwi/test-utils/runtime/src/bizinikiwi_test_pallet.rs b/bizinikiwi/test-utils/runtime/src/bizinikiwi_test_pallet.rs index 0b15da39..7c69757b 100644 --- a/bizinikiwi/test-utils/runtime/src/bizinikiwi_test_pallet.rs +++ b/bizinikiwi/test-utils/runtime/src/bizinikiwi_test_pallet.rs @@ -240,7 +240,9 @@ pub mod pezpallet { } } -pub fn validate_runtime_call(call: &pezpallet::Call) -> TransactionValidity { +pub fn validate_runtime_call( + call: &pezpallet::Call, +) -> TransactionValidity { log::trace!(target: LOG_TARGET, "validate_runtime_call {call:?}"); match call { Call::call_do_not_propagate {} => diff --git a/bizinikiwi/test-utils/runtime/src/genesismap.rs b/bizinikiwi/test-utils/runtime/src/genesismap.rs index 344b8df7..d91e79e5 100644 --- a/bizinikiwi/test-utils/runtime/src/genesismap.rs +++ b/bizinikiwi/test-utils/runtime/src/genesismap.rs @@ -18,7 +18,7 @@ //! Tool for creating the genesis block. use super::{ - currency, bizinikiwi_test_pallet, wasm_binary_unwrap, AccountId, Balance, RuntimeGenesisConfig, + bizinikiwi_test_pallet, currency, wasm_binary_unwrap, AccountId, Balance, RuntimeGenesisConfig, }; use codec::Encode; use pezsc_service::construct_genesis_block; diff --git a/bizinikiwi/test-utils/runtime/src/lib.rs b/bizinikiwi/test-utils/runtime/src/lib.rs index ef5ef6a4..a9505ba8 100644 --- a/bizinikiwi/test-utils/runtime/src/lib.rs +++ b/bizinikiwi/test-utils/runtime/src/lib.rs @@ -21,11 +21,11 @@ extern crate alloc; +pub mod bizinikiwi_test_pallet; #[cfg(feature = "std")] pub mod extrinsic; #[cfg(feature = "std")] pub mod genesismap; -pub mod bizinikiwi_test_pallet; #[cfg(not(feature = "std"))] use alloc::{vec, vec::Vec}; @@ -45,9 +45,9 @@ use pezframe_system::{ limits::{BlockLength, BlockWeights}, CheckNonce, CheckWeight, }; -use scale_info::TypeInfo; use pezsp_application_crypto::Ss58Codec; use pezsp_keyring::Sr25519Keyring; +use scale_info::TypeInfo; use pezsp_application_crypto::{ecdsa, ed25519, sr25519, RuntimeAppPublic}; @@ -61,7 +61,6 @@ use pezsp_trie::{ }; use trie_db::{Trie, TrieMut}; -use serde_json::json; use pezsp_api::{decl_runtime_apis, impl_runtime_apis}; pub use pezsp_core::hash::H256; use pezsp_genesis_builder::PresetId; @@ -77,6 +76,7 @@ use pezsp_runtime::{ #[cfg(any(feature = "std", test))] use pezsp_version::NativeVersion; use pezsp_version::RuntimeVersion; +use serde_json::json; pub use pezsp_consensus_babe::{AllowedSlots, BabeEpochConfiguration, Slot}; @@ -947,7 +947,8 @@ fn test_read_child_storage() { fn test_witness(proof: StorageProof, root: crate::Hash) { use pezsp_externalities::Externalities; let db: pezsp_trie::MemoryDB = proof.into_memory_db(); - let backend = pezsp_state_machine::TrieBackendBuilder::<_, crate::Hashing>::new(db, root).build(); + let backend = + pezsp_state_machine::TrieBackendBuilder::<_, crate::Hashing>::new(db, root).build(); let mut overlay = pezsp_state_machine::OverlayedChanges::default(); let mut ext = pezsp_state_machine::Ext::new( &mut overlay, @@ -1146,9 +1147,11 @@ pub mod storage_key_generator { #[cfg(test)] mod tests { use super::*; + use bizinikiwi_test_runtime_client::{ + prelude::*, runtime::TestAPI, DefaultTestClientBuilderExt, TestClientBuilder, + }; use codec::Encode; use pezframe_support::dispatch::DispatchInfo; - use pretty_assertions::assert_eq; use pezsc_block_builder::BlockBuilderBuilder; use pezsp_api::{ApiExt, ProvideRuntimeApi}; use pezsp_consensus::BlockOrigin; @@ -1157,9 +1160,7 @@ mod tests { traits::{DispatchTransaction, Hash as _}, transaction_validity::{InvalidTransaction, TransactionSource::External, ValidTransaction}, }; - use bizinikiwi_test_runtime_client::{ - prelude::*, runtime::TestAPI, DefaultTestClientBuilderExt, TestClientBuilder, - }; + use pretty_assertions::assert_eq; #[test] fn expected_keys_vec_are_matching() { @@ -1351,14 +1352,14 @@ mod tests { mod genesis_builder_tests { use super::*; use crate::genesismap::GenesisStorageBuilder; - use pretty_assertions::assert_eq; use pezsc_executor::{error::Result, WasmExecutor}; use pezsc_executor_common::runtime_blob::RuntimeBlob; - use serde_json::json; use pezsp_application_crypto::Ss58Codec; use pezsp_core::traits::Externalities; use pezsp_genesis_builder::Result as BuildResult; use pezsp_state_machine::BasicExternalities; + use pretty_assertions::assert_eq; + use serde_json::json; use std::{fs, io::Write}; use storage_key_generator::hex; diff --git a/bizinikiwi/test-utils/runtime/transaction-pool/src/lib.rs b/bizinikiwi/test-utils/runtime/transaction-pool/src/lib.rs index b7ffb782..6069d302 100644 --- a/bizinikiwi/test-utils/runtime/transaction-pool/src/lib.rs +++ b/bizinikiwi/test-utils/runtime/transaction-pool/src/lib.rs @@ -20,6 +20,13 @@ //! See [`TestApi`] for more information. use async_trait::async_trait; +use bizinikiwi_test_runtime_client::{ + runtime::{ + AccountId, Block, BlockNumber, Extrinsic, ExtrinsicBuilder, Hash, Header, Nonce, Transfer, + TransferData, + }, + Sr25519Keyring::{self, *}, +}; use codec::Encode; use parking_lot::RwLock; use pezsc_transaction_pool::{ChainApi, ValidateTransactionPriority}; @@ -38,13 +45,6 @@ use std::{ collections::{BTreeMap, HashMap, HashSet}, sync::Arc, }; -use bizinikiwi_test_runtime_client::{ - runtime::{ - AccountId, Block, BlockNumber, Extrinsic, ExtrinsicBuilder, Hash, Header, Nonce, Transfer, - TransferData, - }, - Sr25519Keyring::{self, *}, -}; /// Error type used by [`TestApi`]. #[derive(Debug, thiserror::Error)] diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/extrinsic/bench.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/extrinsic/bench.rs index 230f6555..3414519c 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/extrinsic/bench.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/extrinsic/bench.rs @@ -36,8 +36,8 @@ use crate::shared::{StatSelect, Stats}; use clap::Args; use codec::Encode; use log::info; -use serde::Serialize; use pezsp_trie::proof_size_extension::ProofSizeExt; +use serde::Serialize; use std::{marker::PhantomData, sync::Arc, time::Instant}; /// Parameters to configure an *overhead* benchmark. diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/lib.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/lib.rs index 69c6714e..a64268df 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/lib.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/lib.rs @@ -29,14 +29,16 @@ pub use block::BlockCmd; pub use extrinsic::{ExtrinsicBuilder, ExtrinsicCmd, ExtrinsicFactory}; pub use machine::{MachineCmd, BIZINIKIWI_REFERENCE_HARDWARE}; pub use overhead::{ - remark_builder::{DynamicRemarkBuilder, BizinikiwiRemarkBuilder}, + remark_builder::{BizinikiwiRemarkBuilder, DynamicRemarkBuilder}, OpaqueBlock, OverheadCmd, }; pub use pezpallet::PalletCmd; pub use pezsc_service::BasePath; pub use storage::StorageCmd; -use pezsc_cli::{CliConfiguration, DatabaseParams, ImportParams, PruningParams, Result, SharedParams}; +use pezsc_cli::{ + CliConfiguration, DatabaseParams, ImportParams, PruningParams, Result, SharedParams, +}; /// The root `benchmarking` command. /// diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/overhead/command.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/overhead/command.rs index 4057914f..a857add2 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/overhead/command.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/overhead/command.rs @@ -37,11 +37,11 @@ use crate::{ }; use clap::{error::ErrorKind, Args, CommandFactory, Parser}; use codec::{Decode, Encode}; -use pezcumulus_client_teyrchain_inherent::MockValidationDataInherentDataProvider; use fake_runtime_api::RuntimeApi as FakeRuntimeApi; -use pezframe_support::Deserialize; use genesis_state::WARN_SPEC_GENESIS_CTOR; use log::info; +use pezcumulus_client_teyrchain_inherent::MockValidationDataInherentDataProvider; +use pezframe_support::Deserialize; use pezkuwi_teyrchain_primitives::primitives::Id as ParaId; use pezsc_block_builder::BlockBuilderApi; use pezsc_chain_spec::{ChainSpec, ChainSpecExtension, GenesisBlockBuilder}; @@ -51,8 +51,6 @@ use pezsc_client_db::{BlocksPruning, DatabaseSettings}; use pezsc_executor::WasmExecutor; use pezsc_runtime_utilities::fetch_latest_metadata_from_code_blob; use pezsc_service::{new_client, new_db_backend, BasePath, ClientConfig, TFullClient, TaskManager}; -use serde::Serialize; -use serde_json::{json, Value}; use pezsp_api::{ApiExt, CallApiAt, Core, ProvideRuntimeApi}; use pezsp_blockchain::HeaderBackend; use pezsp_core::H256; @@ -64,6 +62,8 @@ use pezsp_runtime::{ }; use pezsp_storage::Storage; use pezsp_wasm_interface::HostFunctions; +use serde::Serialize; +use serde_json::{json, Value}; use std::{ fmt::{Debug, Display, Formatter}, fs, @@ -225,7 +225,8 @@ fn create_inherent_data + HeaderBackend, Blo }; // Timestamp inherent that is very common in bizinikiwi chains. - let timestamp = pezsp_timestamp::InherentDataProvider::new(std::time::Duration::default().into()); + let timestamp = + pezsp_timestamp::InherentDataProvider::new(std::time::Duration::default().into()); let _ = futures::executor::block_on(timestamp.provide_inherent_data(&mut inherent_data)); let _ = diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/command.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/command.rs index f240f6c5..a0de87ba 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/command.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/command.rs @@ -28,12 +28,12 @@ use crate::{ }; use clap::{error::ErrorKind, CommandFactory}; use codec::{Decode, DecodeWithMemTracking, Encode}; +use linked_hash_map::LinkedHashMap; use pezframe_benchmarking::{ Analysis, BenchmarkBatch, BenchmarkBatchSplitResults, BenchmarkList, BenchmarkParameter, BenchmarkResult, BenchmarkSelector, }; use pezframe_support::traits::StorageInfo; -use linked_hash_map::LinkedHashMap; use pezsc_cli::{execution_method_from_cli, ChainSpec, CliConfiguration, Result, SharedParams}; use pezsc_client_db::BenchmarkingState; use pezsc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; @@ -117,9 +117,8 @@ fn combine_batches( let mut all_benchmarks = LinkedHashMap::<_, (Vec, Vec)>::new(); - db_batches - .into_iter() - .for_each(|BenchmarkBatch { pezpallet, instance, benchmark, results }| { + db_batches.into_iter().for_each( + |BenchmarkBatch { pezpallet, instance, benchmark, results }| { // We use this key to uniquely identify a benchmark among batches. let key = (pezpallet, instance, benchmark); @@ -131,11 +130,11 @@ fn combine_batches( all_benchmarks.insert(key, (Vec::new(), results)); }, } - }); + }, + ); - time_batches - .into_iter() - .for_each(|BenchmarkBatch { pezpallet, instance, benchmark, results }| { + time_batches.into_iter().for_each( + |BenchmarkBatch { pezpallet, instance, benchmark, results }| { // We use this key to uniquely identify a benchmark among batches. let key = (pezpallet, instance, benchmark); @@ -144,7 +143,8 @@ fn combine_batches( Some(x) => x.0.extend(results), None => panic!("all benchmark keys should have been populated by db batches"), } - }); + }, + ); all_benchmarks .into_iter() @@ -582,19 +582,21 @@ impl PalletCmd { fn select_benchmarks_to_run(&self, list: Vec) -> Result> { // Use the benchmark list and the user input to determine the set of benchmarks to run. let mut benchmarks_to_run = Vec::new(); - list.iter().filter(|item| self.pezpallet_selected(&item.pezpallet)).for_each(|item| { - for benchmark in &item.benchmarks { - if self.extrinsic_selected(&item.pezpallet, &benchmark.name) { - benchmarks_to_run.push(( - item.pezpallet.clone(), - item.instance.clone(), - benchmark.name.clone(), - benchmark.components.clone(), - benchmark.pov_modes.clone(), - )) + list.iter() + .filter(|item| self.pezpallet_selected(&item.pezpallet)) + .for_each(|item| { + for benchmark in &item.benchmarks { + if self.extrinsic_selected(&item.pezpallet, &benchmark.name) { + benchmarks_to_run.push(( + item.pezpallet.clone(), + item.instance.clone(), + benchmark.name.clone(), + benchmark.components.clone(), + benchmark.pov_modes.clone(), + )) + } } - } - }); + }); // Convert `Vec` to `String` for better readability. let benchmarks_to_run: Vec<_> = benchmarks_to_run .into_iter() @@ -841,7 +843,8 @@ impl PalletCmd { ) { for batch in batches.iter() { // Print benchmark metadata - let pezpallet = String::from_utf8(batch.pezpallet.clone()).expect("Encoded from String; qed"); + let pezpallet = + String::from_utf8(batch.pezpallet.clone()).expect("Encoded from String; qed"); let benchmark = String::from_utf8(batch.benchmark.clone()).expect("Encoded from String; qed"); println!( @@ -1163,7 +1166,15 @@ mod tests { "--genesis-builder", "none", ])?; - cli_succeed(&["test", "--extrinsic", "", "--pezpallet", "", "--runtime", "path/to/runtime"])?; + cli_succeed(&[ + "test", + "--extrinsic", + "", + "--pezpallet", + "", + "--runtime", + "path/to/runtime", + ])?; cli_succeed(&[ "test", "--extrinsic", diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/logging.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/logging.rs index 197d503e..40783100 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/logging.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/logging.rs @@ -56,7 +56,8 @@ pub fn init(arg: Option) { }); } -/// Alternative implementation to `pezsp_runtime_interface::logging::HostFunctions` for benchmarking. +/// Alternative implementation to `pezsp_runtime_interface::logging::HostFunctions` for +/// benchmarking. #[runtime_interface] pub trait Logging { #[allow(dead_code)] diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/mod.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/mod.rs index b8001539..a38c328f 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/mod.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/mod.rs @@ -32,8 +32,8 @@ use std::{fmt::Debug, path::PathBuf}; /// Logging target const LOG_TARGET: &'static str = "frame::benchmark::pezpallet"; -// Add a more relaxed parsing for pezpallet names by allowing pezpallet directory names with `-` to be -// used like crate names with `_` +// Add a more relaxed parsing for pezpallet names by allowing pezpallet directory names with `-` to +// be used like crate names with `_` fn parse_pallet_name(pezpallet: &str) -> std::result::Result { Ok(pezpallet.replace("-", "_")) } diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/writer.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/writer.rs index 7f0cf93a..85eaca02 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/writer.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/writer.rs @@ -169,7 +169,8 @@ fn map_results( worst_case_map_values, additional_trie_layers, ); - let pezpallet_benchmarks = all_benchmarks.entry((pezpallet_name, instance_name)).or_default(); + let pezpallet_benchmarks = + all_benchmarks.entry((pezpallet_name, instance_name)).or_default(); pezpallet_benchmarks.push(benchmark_data); } Ok(all_benchmarks) @@ -287,7 +288,10 @@ fn get_benchmark_data( // We add additional comments showing which storage items were touched. // We find the worst case proof size, and use that as the final proof size result. let mut storage_per_prefix = HashMap::, Vec>::new(); - let pov_mode = pov_modes.get(&(pezpallet.clone(), benchmark.clone())).cloned().unwrap_or_default(); + let pov_mode = pov_modes + .get(&(pezpallet.clone(), benchmark.clone())) + .cloned() + .unwrap_or_default(); let comments = process_storage_results( &mut storage_per_prefix, &batch.db_results, @@ -579,7 +583,8 @@ pub(crate) fn process_storage_results( let mut prefix_result = result.clone(); let key_info = storage_info_map.get(&prefix); let pezpallet_name = match key_info { - Some(k) => String::from_utf8(k.pezpallet_name.clone()).expect("encoded from string"), + Some(k) => + String::from_utf8(k.pezpallet_name.clone()).expect("encoded from string"), None => "".to_string(), }; let storage_name = match key_info { diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/shared/genesis_state.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/shared/genesis_state.rs index fedff3c6..04d4f088 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/shared/genesis_state.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/shared/genesis_state.rs @@ -18,9 +18,9 @@ use crate::overhead::command::TeyrchainExtension; use pezsc_chain_spec::{ChainSpec, GenericChainSpec, GenesisConfigBuilderRuntimeCaller}; use pezsc_cli::Result; -use serde_json::Value; use pezsp_storage::{well_known_keys::CODE, Storage}; use pezsp_wasm_interface::HostFunctions; +use serde_json::Value; use std::{borrow::Cow, path::PathBuf}; /// When the runtime could not build the genesis storage. diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/shared/mod.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/shared/mod.rs index d213466d..b09712b9 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/shared/mod.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/shared/mod.rs @@ -27,8 +27,8 @@ pub use stats::{StatSelect, Stats}; pub use weight_params::WeightParams; use clap::Args; -use rand::prelude::*; use pezsc_sysinfo::gather_sysinfo; +use rand::prelude::*; use serde::Serialize; /// A Handlebars helper to add an underscore after every 3rd character, diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/storage/cmd.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/storage/cmd.rs index 645f54b5..8c27d336 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/storage/cmd.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/storage/cmd.rs @@ -28,9 +28,9 @@ use pezsp_storage::{ChildInfo, ChildType, PrefixedStorageKey, StateVersion}; use clap::{Args, Parser, ValueEnum}; use log::info; +use pezsp_runtime::generic::BlockId; use rand::prelude::*; use serde::Serialize; -use pezsp_runtime::generic::BlockId; use std::{fmt::Debug, path::PathBuf, sync::Arc}; use super::template::TemplateData; diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/storage/mod.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/storage/mod.rs index 14a5bb4d..52044d98 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/storage/mod.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/storage/mod.rs @@ -39,7 +39,8 @@ pub(crate) fn get_wasm_module() -> Box std::result::Result<(), String> { let tmp_dir = tempfile::tempdir().expect("Should be able to create tmp dir."); let base_path = tmp_dir.path(); - let wasm = pezcumulus_test_runtime::WASM_BINARY.ok_or("WASM binary not available".to_string())?; + let wasm = + pezcumulus_test_runtime::WASM_BINARY.ok_or("WASM binary not available".to_string())?; let runtime_path = base_path.join("runtime.wasm"); let _ = fs::write(&runtime_path, wasm).map_err(|e| format!("Unable to write runtime file: {}", e)); @@ -118,7 +119,8 @@ fn setup_chain_spec(tmp_dir: &Path, raw: bool) -> Result<(PathBuf, PathBuf), Str let base_path = tmp_dir.to_path_buf(); let chain_spec_path = base_path.join("chain_spec.json"); - let wasm = pezcumulus_test_runtime::WASM_BINARY.ok_or("WASM binary not available".to_string())?; + let wasm = + pezcumulus_test_runtime::WASM_BINARY.ok_or("WASM binary not available".to_string())?; let mut properties = pezsc_chain_spec::Properties::new(); properties.insert("tokenSymbol".into(), "UNIT".into()); diff --git a/bizinikiwi/utils/pezframe/remote-externalities/src/lib.rs b/bizinikiwi/utils/pezframe/remote-externalities/src/lib.rs index 73dbbdb0..1a5fb270 100644 --- a/bizinikiwi/utils/pezframe/remote-externalities/src/lib.rs +++ b/bizinikiwi/utils/pezframe/remote-externalities/src/lib.rs @@ -22,11 +22,11 @@ mod logging; +use bizinikiwi_rpc_client::{rpc_params, BatchRequestBuilder, ChainApi, ClientT, StateApi}; use codec::{Compact, Decode, Encode}; use indicatif::{ProgressBar, ProgressStyle}; use jsonrpsee::{core::params::ArrayParams, http_client::HttpClient}; use log::*; -use serde::de::DeserializeOwned; use pezsp_core::{ hexdisplay::HexDisplay, storage::{ @@ -39,6 +39,7 @@ use pezsp_runtime::{ StateVersion, }; use pezsp_state_machine::TestExternalities; +use serde::de::DeserializeOwned; use std::{ cmp::{max, min}, fs, @@ -47,7 +48,6 @@ use std::{ sync::Arc, time::{Duration, Instant}, }; -use bizinikiwi_rpc_client::{rpc_params, BatchRequestBuilder, ChainApi, ClientT, StateApi}; use tokio_retry::{strategy::FixedInterval, Retry}; type Result = std::result::Result; @@ -105,8 +105,8 @@ impl Snapshot { } } -/// An externalities that acts exactly the same as [`pezsp_io::TestExternalities`] but has a few extra -/// bits and pieces to it, and can be loaded remotely. +/// An externalities that acts exactly the same as [`pezsp_io::TestExternalities`] but has a few +/// extra bits and pieces to it, and can be loaded remotely. pub struct RemoteExternalities { /// The inner externalities. pub inner_ext: TestExternalities>, diff --git a/bizinikiwi/utils/pezframe/rpc/client/src/lib.rs b/bizinikiwi/utils/pezframe/rpc/client/src/lib.rs index 20fc9993..306f1c3f 100644 --- a/bizinikiwi/utils/pezframe/rpc/client/src/lib.rs +++ b/bizinikiwi/utils/pezframe/rpc/client/src/lib.rs @@ -38,8 +38,8 @@ //! ``` use async_trait::async_trait; -use serde::de::DeserializeOwned; use pezsp_runtime::traits::{Block as BlockT, Header as HeaderT}; +use serde::de::DeserializeOwned; use std::collections::VecDeque; pub use jsonrpsee::{ diff --git a/bizinikiwi/utils/pezframe/rpc/state-trie-migration-rpc/src/lib.rs b/bizinikiwi/utils/pezframe/rpc/state-trie-migration-rpc/src/lib.rs index f122d2a2..73a5b666 100644 --- a/bizinikiwi/utils/pezframe/rpc/state-trie-migration-rpc/src/lib.rs +++ b/bizinikiwi/utils/pezframe/rpc/state-trie-migration-rpc/src/lib.rs @@ -25,8 +25,8 @@ use jsonrpsee::{ }; use pezsc_client_api::TrieCacheContext; use pezsc_rpc_api::check_if_safe; -use serde::{Deserialize, Serialize}; use pezsp_runtime::traits::Block as BlockT; +use serde::{Deserialize, Serialize}; use std::sync::Arc; use pezsp_core::{ @@ -88,7 +88,8 @@ where // get all child trie roots for key_value in trie.iter().map_err(|e| format!("TrieDB node iterator error: {}", e))? { let (key, value) = key_value.map_err(|e| format!("TrieDB node iterator error: {}", e))?; - if key[..].starts_with(pezsp_core::storage::well_known_keys::DEFAULT_CHILD_STORAGE_KEY_PREFIX) + if key[..] + .starts_with(pezsp_core::storage::well_known_keys::DEFAULT_CHILD_STORAGE_KEY_PREFIX) { let prefixed_key = PrefixedStorageKey::new(key); let (_type, unprefixed) = ChildType::from_prefixed_key(&prefixed_key).unwrap(); diff --git a/bizinikiwi/utils/pezframe/rpc/support/src/lib.rs b/bizinikiwi/utils/pezframe/rpc/support/src/lib.rs index a81b0b92..e1c1fcd1 100644 --- a/bizinikiwi/utils/pezframe/rpc/support/src/lib.rs +++ b/bizinikiwi/utils/pezframe/rpc/support/src/lib.rs @@ -15,18 +15,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Combines [pezsc_rpc_api::state::StateApiClient] with [pezframe_support::storage::generator] traits -//! to provide strongly typed chain state queries over rpc. +//! Combines [pezsc_rpc_api::state::StateApiClient] with [pezframe_support::storage::generator] +//! traits to provide strongly typed chain state queries over rpc. #![warn(missing_docs)] use codec::{DecodeAll, FullCodec, FullEncode}; use core::marker::PhantomData; -use pezframe_support::storage::generator::{StorageDoubleMap, StorageMap, StorageValue}; use jsonrpsee::core::ClientError as RpcError; +use pezframe_support::storage::generator::{StorageDoubleMap, StorageMap, StorageValue}; use pezsc_rpc_api::state::StateApiClient; -use serde::{de::DeserializeOwned, Serialize}; use pezsp_storage::{StorageData, StorageKey}; +use serde::{de::DeserializeOwned, Serialize}; /// A typed query on chain state usable from an RPC client. /// diff --git a/bizinikiwi/utils/pezframe/rpc/system/src/lib.rs b/bizinikiwi/utils/pezframe/rpc/system/src/lib.rs index dbdadfbf..2feba42b 100644 --- a/bizinikiwi/utils/pezframe/rpc/system/src/lib.rs +++ b/bizinikiwi/utils/pezframe/rpc/system/src/lib.rs @@ -217,6 +217,7 @@ mod tests { use super::*; use assert_matches::assert_matches; + use bizinikiwi_test_runtime_client::{runtime::Transfer, Sr25519Keyring}; use futures::executor::block_on; use pezsc_rpc_api::DenyUnsafe; use pezsc_transaction_pool::BasicPool; @@ -224,7 +225,6 @@ mod tests { transaction_validity::{InvalidTransaction, TransactionValidityError}, ApplyExtrinsicResult, }; - use bizinikiwi_test_runtime_client::{runtime::Transfer, Sr25519Keyring}; fn deny_unsafe() -> Extensions { let mut ext = Extensions::new(); diff --git a/bizinikiwi/utils/txtesttool/bin/main.rs b/bizinikiwi/utils/txtesttool/bin/main.rs index 36ce0e91..1c0272eb 100644 --- a/bizinikiwi/utils/txtesttool/bin/main.rs +++ b/bizinikiwi/utils/txtesttool/bin/main.rs @@ -5,9 +5,6 @@ #![allow(dead_code)] #![allow(unused_variables)] -use clap::Parser; -use codec::Compact; -use std::{fs, fs::File, io::BufReader, time::Duration}; use bizinikiwi_txtesttool::{ block_monitor::BlockMonitor, cli::{Cli, CliCommand}, @@ -20,6 +17,9 @@ use bizinikiwi_txtesttool::{ EthTransactionsSink, SubstrateTransaction, SubstrateTransactionsSink, SENDER_SEED, }, }; +use clap::Parser; +use codec::Compact; +use std::{fs, fs::File, io::BufReader, time::Duration}; use subxt::{ext::frame_metadata::RuntimeMetadataPrefixed, PolkadotConfig}; use tracing::info; diff --git a/bizinikiwi/utils/txtesttool/src/subxt_transaction.rs b/bizinikiwi/utils/txtesttool/src/subxt_transaction.rs index 050c8768..1f608905 100644 --- a/bizinikiwi/utils/txtesttool/src/subxt_transaction.rs +++ b/bizinikiwi/utils/txtesttool/src/subxt_transaction.rs @@ -356,10 +356,7 @@ where } } - async fn submit( - &self, - tx: &dyn Transaction>, - ) -> Result, Error> { + async fn submit(&self, tx: &dyn Transaction>) -> Result, Error> { let tx = tx.as_any().downcast_ref::>().unwrap(); tx.transaction.submit().await.map_err(|e| e.into()) } @@ -382,9 +379,7 @@ where } fn transaction_monitor(&self) -> Option<&dyn TransactionMonitor>> { - self.block_monitor - .as_ref() - .map(|m| m as &dyn TransactionMonitor>) + self.block_monitor.as_ref().map(|m| m as &dyn TransactionMonitor>) } } diff --git a/bizinikiwi/utils/wasm-builder/src/lib.rs b/bizinikiwi/utils/wasm-builder/src/lib.rs index adecc145..9d3b013d 100644 --- a/bizinikiwi/utils/wasm-builder/src/lib.rs +++ b/bizinikiwi/utils/wasm-builder/src/lib.rs @@ -63,9 +63,9 @@ //! //! By using environment variables, you can configure which Wasm binaries are built and how: //! -//! - `BIZINIKIWI_RUNTIME_TARGET` - Sets the target for building runtime. Supported values are `wasm` -//! or `riscv` (experimental, do not use it in production!). By default the target is equal to -//! `wasm`. +//! - `BIZINIKIWI_RUNTIME_TARGET` - Sets the target for building runtime. Supported values are +//! `wasm` or `riscv` (experimental, do not use it in production!). By default the target is equal +//! to `wasm`. //! - `SKIP_WASM_BUILD` - Skips building any Wasm binary. This is useful when only native should be //! recompiled. If this is the first run and there doesn't exist a Wasm binary, this will set both //! variables to `None`. diff --git a/docs/sdk/packages/guides/first-pezpallet/src/lib.rs b/docs/sdk/packages/guides/first-pezpallet/src/lib.rs index b28783dc..69348115 100644 --- a/docs/sdk/packages/guides/first-pezpallet/src/lib.rs +++ b/docs/sdk/packages/guides/first-pezpallet/src/lib.rs @@ -295,7 +295,11 @@ pub mod pezpallet { fn mint_works() { StateBuilder::default().build_and_execute(|| { // given the initial state, when: - assert_ok!(Pezpallet::::mint_unsafe(RuntimeOrigin::signed(ALICE), BOB, 100)); + assert_ok!(Pezpallet::::mint_unsafe( + RuntimeOrigin::signed(ALICE), + BOB, + 100 + )); // then: assert_eq!(Balances::::get(&BOB), Some(200)); diff --git a/docs/sdk/packages/guides/first-runtime/src/lib.rs b/docs/sdk/packages/guides/first-runtime/src/lib.rs index d66af46c..6333932e 100644 --- a/docs/sdk/packages/guides/first-runtime/src/lib.rs +++ b/docs/sdk/packages/guides/first-runtime/src/lib.rs @@ -62,8 +62,8 @@ construct_runtime!( mod runtime_types { use super::*; pub(super) type SignedExtra = ( - // `frame` already provides all the signed extensions from `pezframe-system`. We just add the - // one related to tx-payment here. + // `frame` already provides all the signed extensions from `pezframe-system`. We just add + // the one related to tx-payment here. frame::runtime::types_common::SystemTransactionExtensionsOf, pezpallet_transaction_payment::ChargeTransactionPayment, ); diff --git a/docs/sdk/src/reference_docs/chain_spec_runtime/src/presets.rs b/docs/sdk/src/reference_docs/chain_spec_runtime/src/presets.rs index 3a428b13..76a7999c 100644 --- a/docs/sdk/src/reference_docs/chain_spec_runtime/src/presets.rs +++ b/docs/sdk/src/reference_docs/chain_spec_runtime/src/presets.rs @@ -23,9 +23,9 @@ use crate::{ }; use alloc::vec; use pezframe_support::build_struct_json_patch; -use serde_json::{json, to_string, Value}; use pezsp_application_crypto::Ss58Codec; use pezsp_keyring::Sr25519Keyring; +use serde_json::{json, to_string, Value}; /// A demo preset with strings only. pub const PRESET_1: &str = "preset_1"; diff --git a/pezbridges/bin/runtime-common/src/extensions.rs b/pezbridges/bin/runtime-common/src/extensions.rs index c89ca570..70f6a48f 100644 --- a/pezbridges/bin/runtime-common/src/extensions.rs +++ b/pezbridges/bin/runtime-common/src/extensions.rs @@ -19,14 +19,16 @@ //! checks. use bp_relayers::ExplicitOrAccountParams; -use pezbp_runtime::Teyrchain; use bp_teyrchains::SubmitTeyrchainHeadsInfo; +use pezbp_runtime::Teyrchain; use pezpallet_bridge_grandpa::{ BridgedBlockNumber, CallSubType as GrandpaCallSubType, SubmitFinalityProofHelper, }; use pezpallet_bridge_messages::CallSubType as MessagesCallSubType; use pezpallet_bridge_relayers::Pezpallet as RelayersPallet; -use pezpallet_bridge_teyrchains::{CallSubType as TeyrchainsCallSubtype, SubmitTeyrchainHeadsHelper}; +use pezpallet_bridge_teyrchains::{ + CallSubType as TeyrchainsCallSubtype, SubmitTeyrchainHeadsHelper, +}; use pezsp_runtime::{ traits::{Get, UniqueSaturatedInto}, transaction_validity::{TransactionPriority, TransactionValidity, ValidTransactionBuilder}, @@ -220,7 +222,8 @@ where } impl, I: 'static> - BridgeRuntimeFilterCall for pezpallet_bridge_messages::Pezpallet + BridgeRuntimeFilterCall + for pezpallet_bridge_messages::Pezpallet where T::RuntimeCall: MessagesCallSubType, { @@ -378,14 +381,13 @@ mod tests { use bp_messages::{InboundLaneData, MessageNonce, OutboundLaneData}; use bp_pezkuwi_core::teyrchains::{ParaHeadsProof, ParaId}; use bp_relayers::{RewardsAccountOwner, RewardsAccountParams}; - use pezbp_runtime::HeaderId; use bp_test_utils::{make_default_justification, test_keyring, TEST_GRANDPA_SET_ID}; use bp_teyrchains::{BestParaHeadHash, ParaInfo}; use codec::{Decode, Encode, MaxEncodedLen}; + use pezbp_runtime::HeaderId; use pezframe_support::{assert_err, assert_ok, traits::fungible::Mutate}; use pezpallet_bridge_grandpa::{Call as GrandpaCall, StoredAuthoritySet}; use pezpallet_bridge_teyrchains::Call as TeyrchainsCall; - use scale_info::TypeInfo; use pezsp_runtime::{ traits::{ parameter_types, AsSystemOriginSigner, AsTransactionAuthorizedOrigin, ConstU64, @@ -396,6 +398,7 @@ mod tests { }, DispatchError, }; + use scale_info::TypeInfo; parameter_types! { pub MsgProofsRewardsAccount: RewardsAccountParams = RewardsAccountParams::new( diff --git a/pezbridges/bin/runtime-common/src/integrity.rs b/pezbridges/bin/runtime-common/src/integrity.rs index 4afe1454..19d78d7b 100644 --- a/pezbridges/bin/runtime-common/src/integrity.rs +++ b/pezbridges/bin/runtime-common/src/integrity.rs @@ -21,8 +21,8 @@ use bp_header_pez_chain::ChainWithGrandpa; use bp_messages::{ChainWithMessages, InboundLaneData, MessageNonce}; -use pezbp_runtime::{AccountIdOf, Chain}; use codec::Encode; +use pezbp_runtime::{AccountIdOf, Chain}; use pezframe_support::{storage::generator::StorageValue, traits::Get, weights::Weight}; use pezframe_system::limits; use pezpallet_bridge_messages::{ThisChainOf, WeightInfoExt as _}; @@ -56,8 +56,8 @@ macro_rules! assert_chain_types( } ); -/// Macro that ensures that the bridge messages pezpallet is configured properly to bridge using given -/// configuration. +/// Macro that ensures that the bridge messages pezpallet is configured properly to bridge using +/// given configuration. #[macro_export] macro_rules! assert_bridge_messages_pallet_types( ( @@ -193,8 +193,8 @@ struct AssertBridgeGrandpaPalletNames<'a> { pub with_bridged_chain_grandpa_pallet_name: &'a str, } -/// Tests that bridge pezpallet names used in `construct_runtime!()` macro call are matching constants -/// from chain primitives crates. +/// Tests that bridge pezpallet names used in `construct_runtime!()` macro call are matching +/// constants from chain primitives crates. fn assert_bridge_grandpa_pallet_names(params: AssertBridgeGrandpaPalletNames) where R: pezpallet_bridge_grandpa::Config, @@ -202,13 +202,13 @@ where { // check that the bridge GRANDPA pezpallet has required name assert_eq!( - pezpallet_bridge_grandpa::PalletOwner::::storage_value_final_key().to_vec(), - pezbp_runtime::storage_value_key( - params.with_bridged_chain_grandpa_pallet_name, - "PalletOwner", - ) - .0, - ); + pezpallet_bridge_grandpa::PalletOwner::::storage_value_final_key().to_vec(), + pezbp_runtime::storage_value_key( + params.with_bridged_chain_grandpa_pallet_name, + "PalletOwner", + ) + .0, + ); assert_eq!( pezpallet_bridge_grandpa::PalletOperatingMode::::storage_value_final_key().to_vec(), pezbp_runtime::storage_value_key( @@ -227,8 +227,8 @@ struct AssertBridgeMessagesPalletNames<'a> { pub with_bridged_chain_messages_pallet_name: &'a str, } -/// Tests that bridge pezpallet names used in `construct_runtime!()` macro call are matching constants -/// from chain primitives crates. +/// Tests that bridge pezpallet names used in `construct_runtime!()` macro call are matching +/// constants from chain primitives crates. fn assert_bridge_messages_pallet_names(params: AssertBridgeMessagesPalletNames) where R: pezpallet_bridge_messages::Config, @@ -292,7 +292,9 @@ pub fn assert_complete_with_teyrchain_bridge_constants( R: pezframe_system::Config + pezpallet_bridge_teyrchains::Config + pezpallet_bridge_messages::Config, - >::BridgedRelayChain: ChainWithGrandpa, + >::BridgedRelayChain: ChainWithGrandpa, PI: 'static, MI: 'static, { @@ -370,7 +372,9 @@ pub fn check_message_lane_weights< >::encoded_size_hint_u32( this_chain_max_unrewarded_relayers as _ ); - pezpallet_bridge_messages::ensure_able_to_receive_confirmation::>( + pezpallet_bridge_messages::ensure_able_to_receive_confirmation::< + Weights, + >( C::max_extrinsic_size(), C::max_extrinsic_weight(), max_incoming_inbound_lane_data_proof_size, diff --git a/pezbridges/bin/runtime-common/src/messages_api.rs b/pezbridges/bin/runtime-common/src/messages_api.rs index 8830ea85..ef1d436d 100644 --- a/pezbridges/bin/runtime-common/src/messages_api.rs +++ b/pezbridges/bin/runtime-common/src/messages_api.rs @@ -31,12 +31,14 @@ where { (begin..=end) .filter_map(|nonce| { - let message_data = - pezpallet_bridge_messages::Pezpallet::::outbound_message_data(lane, nonce)?; + let message_data = pezpallet_bridge_messages::Pezpallet::< + Runtime, + MessagesPalletInstance, + >::outbound_message_data(lane, nonce)?; Some(OutboundMessageDetails { nonce, - // dispatch message weight is always zero at the source chain, since we're paying for - // dispatch at the target chain + // dispatch message weight is always zero at the source chain, since we're paying + // for dispatch at the target chain dispatch_weight: pezframe_support::weights::Weight::zero(), size: message_data.len() as _, }) diff --git a/pezbridges/bin/runtime-common/src/messages_benchmarking.rs b/pezbridges/bin/runtime-common/src/messages_benchmarking.rs index e07ffad0..700db3b9 100644 --- a/pezbridges/bin/runtime-common/src/messages_benchmarking.rs +++ b/pezbridges/bin/runtime-common/src/messages_benchmarking.rs @@ -24,8 +24,8 @@ use bp_messages::{ target_chain::FromBridgedChainMessagesProof, MessagePayload, }; use bp_pezkuwi_core::teyrchains::ParaHash; -use pezbp_runtime::{AccountIdOf, Chain, HashOf, Teyrchain}; use codec::Encode; +use pezbp_runtime::{AccountIdOf, Chain, HashOf, Teyrchain}; use pezframe_support::weights::Weight; use pezpallet_bridge_messages::{ benchmarking::{MessageDeliveryProofParams, MessageProofParams}, diff --git a/pezbridges/bin/runtime-common/src/mock.rs b/pezbridges/bin/runtime-common/src/mock.rs index a4d0ac58..4cc159a5 100644 --- a/pezbridges/bin/runtime-common/src/mock.rs +++ b/pezbridges/bin/runtime-common/src/mock.rs @@ -24,9 +24,9 @@ use bp_messages::{ ChainWithMessages, HashedLaneId, LaneIdType, MessageNonce, }; use bp_relayers::{PayRewardFromAccount, RewardsAccountParams}; -use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, Teyrchain}; use bp_teyrchains::SingleParaStoredHeaderDataBuilder; use codec::Encode; +use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, Teyrchain}; use pezframe_support::{ derive_impl, parameter_types, weights::{ConstantMultiplier, IdentityFee, RuntimeDbWeight, Weight}, @@ -197,12 +197,13 @@ impl pezpallet_bridge_messages::Config for TestRuntime { type LaneId = TestLaneIdType; type DeliveryPayments = (); - type DeliveryConfirmationPayments = pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< - TestRuntime, - (), - (), - ConstU32<100_000>, - >; + type DeliveryConfirmationPayments = + pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< + TestRuntime, + (), + (), + ConstU32<100_000>, + >; type OnMessagesDelivered = (); type MessageDispatch = DummyMessageDispatch; diff --git a/pezbridges/bin/runtime-common/src/teyrchains_benchmarking.rs b/pezbridges/bin/runtime-common/src/teyrchains_benchmarking.rs index bd1155d1..2bf96878 100644 --- a/pezbridges/bin/runtime-common/src/teyrchains_benchmarking.rs +++ b/pezbridges/bin/runtime-common/src/teyrchains_benchmarking.rs @@ -21,11 +21,13 @@ use crate::messages_benchmarking::insert_header_to_grandpa_pallet; use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHead, ParaHeadsProof, ParaId}; -use pezbp_runtime::{grow_storage_value, record_all_trie_keys, Chain, UnverifiedStorageProofParams}; use bp_teyrchains::{ teyrchain_head_storage_key_at_source, RelayBlockHash, RelayBlockHasher, RelayBlockNumber, }; use codec::Encode; +use pezbp_runtime::{ + grow_storage_value, record_all_trie_keys, Chain, UnverifiedStorageProofParams, +}; use pezframe_support::traits::Get; use pezsp_std::prelude::*; use pezsp_trie::{trie_types::TrieDBMutBuilderV1, LayoutV1, MemoryDB, TrieMut}; diff --git a/pezbridges/chains/chain-pezcumulus/src/lib.rs b/pezbridges/chains/chain-pezcumulus/src/lib.rs index 664c2a21..22a57991 100644 --- a/pezbridges/chains/chain-pezcumulus/src/lib.rs +++ b/pezbridges/chains/chain-pezcumulus/src/lib.rs @@ -124,9 +124,9 @@ pub type Address = MultiAddress; // `75% * WEIGHT_REF_TIME_PER_SECOND * 1 / 2 * 50% = 0.75 * 1_000_000_000_000 / 2 * 0.5 = // 187_500_000_000` // -// According to (preliminary) weights of messages pezpallet, cost of additional message is zero and the -// cost of additional relayer is `8_000_000 + db read + db write`. Let's say we want no more than -// 4096 unconfirmed messages (no any scientific justification for that - it just looks large +// According to (preliminary) weights of messages pezpallet, cost of additional message is zero and +// the cost of additional relayer is `8_000_000 + db read + db write`. Let's say we want no more +// than 4096 unconfirmed messages (no any scientific justification for that - it just looks large // enough). And then we can't have more than 4096 relayers. E.g. for 1024 relayers is (using // `RocksDbWeight`): // diff --git a/pezbridges/chains/chain-pezkuwi-bulletin/src/lib.rs b/pezbridges/chains/chain-pezkuwi-bulletin/src/lib.rs index 93b40be2..cd417988 100644 --- a/pezbridges/chains/chain-pezkuwi-bulletin/src/lib.rs +++ b/pezbridges/chains/chain-pezkuwi-bulletin/src/lib.rs @@ -21,6 +21,7 @@ use bp_header_pez_chain::ChainWithGrandpa; use bp_messages::{ChainWithMessages, MessageNonce}; +use codec::{Decode, DecodeWithMemTracking, Encode}; use pezbp_runtime::{ decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, extensions::{ @@ -29,18 +30,17 @@ use pezbp_runtime::{ }, Chain, ChainId, TransactionEra, }; -use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::{ dispatch::DispatchClass, parameter_types, weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight}, }; use pezframe_system::limits; -use scale_info::TypeInfo; use pezsp_runtime::{ impl_tx_ext_default, traits::Dispatchable, transaction_validity::TransactionValidityError, Perbill, StateVersion, }; +use scale_info::TypeInfo; // This chain reuses most of Pezkuwi primitives. pub use bp_pezkuwi_core::{ diff --git a/pezbridges/modules/beefy/src/lib.rs b/pezbridges/modules/beefy/src/lib.rs index b6025334..37d980d4 100644 --- a/pezbridges/modules/beefy/src/lib.rs +++ b/pezbridges/modules/beefy/src/lib.rs @@ -277,8 +277,8 @@ pub mod pezpallet { /// The current number of requests which have written to storage. /// - /// If the `RequestCount` hits `MaxRequests`, no more calls will be allowed to the pezpallet until - /// the request capacity is increased. + /// If the `RequestCount` hits `MaxRequests`, no more calls will be allowed to the pezpallet + /// until the request capacity is increased. /// /// The `RequestCount` is decreased by one at the beginning of every block. This is to ensure /// that the pezpallet can always make progress. @@ -415,11 +415,11 @@ pub mod pezpallet { #[cfg(test)] mod tests { use super::*; - use pezbp_runtime::{BasicOperatingMode, OwnedBridgeModuleError}; use bp_test_utils::generate_owned_bridge_module_tests; - use pezframe_support::{assert_noop, assert_ok, traits::Get}; use mock::*; use mock_chain::*; + use pezbp_runtime::{BasicOperatingMode, OwnedBridgeModuleError}; + use pezframe_support::{assert_noop, assert_ok, traits::Get}; use pezsp_consensus_beefy::mmr::BeefyAuthoritySet; use pezsp_runtime::DispatchError; diff --git a/pezbridges/modules/beefy/src/mock.rs b/pezbridges/modules/beefy/src/mock.rs index 62cdfa38..e88a012d 100644 --- a/pezbridges/modules/beefy/src/mock.rs +++ b/pezbridges/modules/beefy/src/mock.rs @@ -22,8 +22,8 @@ use crate::{ }; use bp_beefy::{BeefyValidatorSignatureOf, ChainWithBeefy, Commitment, MmrDataOrHash}; -use pezbp_runtime::{BasicOperatingMode, Chain, ChainId}; use codec::Encode; +use pezbp_runtime::{BasicOperatingMode, Chain, ChainId}; use pezframe_support::{construct_runtime, derive_impl, weights::Weight}; use pezsp_core::{sr25519::Signature, Pair}; use pezsp_runtime::{ diff --git a/pezbridges/modules/beefy/src/mock_chain.rs b/pezbridges/modules/beefy/src/mock_chain.rs index 516dc29f..c06c0361 100644 --- a/pezbridges/modules/beefy/src/mock_chain.rs +++ b/pezbridges/modules/beefy/src/mock_chain.rs @@ -29,10 +29,10 @@ use crate::{ use bp_beefy::{BeefyPayload, Commitment, ValidatorSetId, MMR_ROOT_PAYLOAD_ID}; use codec::Encode; use pezpallet_mmr::NodeIndex; -use rand::Rng; use pezsp_consensus_beefy::mmr::{BeefyNextAuthoritySet, MmrLeafVersion}; use pezsp_core::Pair; use pezsp_runtime::traits::{Hash, Header as HeaderT}; +use rand::Rng; use std::collections::HashMap; #[derive(Debug, Clone)] diff --git a/pezbridges/modules/grandpa/src/benchmarking.rs b/pezbridges/modules/grandpa/src/benchmarking.rs index 9c79e9ca..6a736eb5 100644 --- a/pezbridges/modules/grandpa/src/benchmarking.rs +++ b/pezbridges/modules/grandpa/src/benchmarking.rs @@ -43,11 +43,11 @@ use crate::*; use bp_header_pez_chain::justification::required_justification_precommits; -use pezbp_runtime::BasicOperatingMode; use bp_test_utils::{ accounts, make_justification_for_header, JustificationGeneratorParams, TEST_GRANDPA_ROUND, TEST_GRANDPA_SET_ID, }; +use pezbp_runtime::BasicOperatingMode; use pezframe_benchmarking::{benchmarks_instance_pallet, whitelisted_caller}; use pezframe_system::RawOrigin; use pezsp_consensus_grandpa::AuthorityId; diff --git a/pezbridges/modules/grandpa/src/call_ext.rs b/pezbridges/modules/grandpa/src/call_ext.rs index e1c95703..9a56838c 100644 --- a/pezbridges/modules/grandpa/src/call_ext.rs +++ b/pezbridges/modules/grandpa/src/call_ext.rs @@ -308,12 +308,12 @@ mod tests { StoredAuthoritySet, WeightInfo, }; use bp_header_pez_chain::{ChainWithGrandpa, SubmitFinalityProofInfo}; - use pezbp_runtime::{BasicOperatingMode, HeaderId}; use bp_test_utils::{ make_default_justification, make_justification_for_header, JustificationGeneratorParams, TEST_GRANDPA_SET_ID, }; use codec::Encode; + use pezbp_runtime::{BasicOperatingMode, HeaderId}; use pezframe_support::weights::Weight; use pezsp_runtime::{testing::DigestItem, traits::Header as _, SaturatedConversion}; @@ -518,12 +518,13 @@ mod tests { // when `improved_by` is less than the free interval BUT it is a mandatory header let mut mandatory_header = test_header(100); - let consensus_log = pezsp_consensus_grandpa::ConsensusLog::::ScheduledChange( - pezsp_consensus_grandpa::ScheduledChange { - next_authorities: bp_test_utils::authority_list(), - delay: 0, - }, - ); + let consensus_log = + pezsp_consensus_grandpa::ConsensusLog::::ScheduledChange( + pezsp_consensus_grandpa::ScheduledChange { + next_authorities: bp_test_utils::authority_list(), + delay: 0, + }, + ); mandatory_header.digest = pezsp_runtime::Digest { logs: vec![DigestItem::Consensus( pezsp_consensus_grandpa::GRANDPA_ENGINE_ID, @@ -711,8 +712,9 @@ mod tests { #[test] fn check_obsolete_submit_finality_proof_ignores_other_calls() { run_test(|| { - let call = - RuntimeCall::System(pezframe_system::Call::::remark { remark: vec![42] }); + let call = RuntimeCall::System(pezframe_system::Call::::remark { + remark: vec![42], + }); assert_eq!(RuntimeCall::check_obsolete_submit_finality_proof(&call), Ok(None)); }) diff --git a/pezbridges/modules/grandpa/src/lib.rs b/pezbridges/modules/grandpa/src/lib.rs index a630ee7a..4ec02dd5 100644 --- a/pezbridges/modules/grandpa/src/lib.rs +++ b/pezbridges/modules/grandpa/src/lib.rs @@ -22,9 +22,10 @@ //! verified, finalized headers are stored in the pezpallet, thereby creating a sparse header chain. //! This sparse header chain can be used as a source of truth for other higher-level applications. //! -//! The pezpallet is responsible for tracking GRANDPA validator set hand-offs. We only import headers -//! with justifications signed by the current validator set we know of. The header is inspected for -//! a `ScheduledChanges` digest item, which is then used to update to next validator set. +//! The pezpallet is responsible for tracking GRANDPA validator set hand-offs. We only import +//! headers with justifications signed by the current validator set we know of. The header is +//! inspected for a `ScheduledChanges` digest item, which is then used to update to next validator +//! set. //! //! Since this pezpallet only tracks finalized headers it does not deal with forks. Forks can only //! occur if the GRANDPA validator set on the bridged chain is either colluding or there is a severe @@ -198,7 +199,8 @@ pub mod pezpallet { ) } - /// Bootstrap the bridge pezpallet with an initial header and authority set from which to sync. + /// Bootstrap the bridge pezpallet with an initial header and authority set from which to + /// sync. /// /// The initial configuration provided does not need to be the genesis header of the bridged /// chain, it can be any arbitrary header. You can also provide the next scheduled set @@ -517,7 +519,8 @@ pub mod pezpallet { InvalidJustification, /// The authority set from the underlying header chain is invalid. InvalidAuthoritySet, - /// The header being imported is older than the best finalized header known to the pezpallet. + /// The header being imported is older than the best finalized header known to the + /// pezpallet. OldHeader, /// The scheduled authority set change found in the header is unsupported by the pezpallet. /// @@ -814,7 +817,7 @@ pub fn initialize_for_benchmarks, I: 'static>(header: BridgedHeader initialize_bridge::(InitializationData { header: Box::new(header), authority_list: pezsp_std::vec::Vec::new(), /* we don't verify any proofs in external - * benchmarks */ + * benchmarks */ set_id: 0, operating_mode: pezbp_runtime::BasicOperatingMode::Normal, }) @@ -836,13 +839,13 @@ mod tests { System, TestBridgedChain, TestHeader, TestNumber, TestRuntime, MAX_BRIDGED_AUTHORITIES, }; use bp_header_pez_chain::BridgeGrandpaCall; - use pezbp_runtime::BasicOperatingMode; use bp_test_utils::{ authority_list, generate_owned_bridge_module_tests, make_default_justification, make_justification_for_header, JustificationGeneratorParams, ALICE, BOB, TEST_GRANDPA_SET_ID, }; use codec::Encode; + use pezbp_runtime::BasicOperatingMode; use pezframe_support::{ assert_err, assert_noop, assert_ok, dispatch::{Pays, PostDispatchInfo}, @@ -1470,7 +1473,9 @@ mod tests { >::put(HeaderId(2, hash)); >::insert(hash, header.build()); - assert_ok!(Pezpallet::::verify_storage_proof(hash, storage_proof).map(|_| ())); + assert_ok!( + Pezpallet::::verify_storage_proof(hash, storage_proof).map(|_| ()) + ); }); } diff --git a/pezbridges/modules/grandpa/src/storage_types.rs b/pezbridges/modules/grandpa/src/storage_types.rs index 81c37308..6de347fd 100644 --- a/pezbridges/modules/grandpa/src/storage_types.rs +++ b/pezbridges/modules/grandpa/src/storage_types.rs @@ -21,9 +21,9 @@ use crate::{Config, Error}; use bp_header_pez_chain::{AuthoritySet, ChainWithGrandpa}; use codec::{Decode, Encode, MaxEncodedLen}; use pezframe_support::{traits::Get, BoundedVec, CloneNoBound, RuntimeDebugNoBound}; -use scale_info::TypeInfo; use pezsp_consensus_grandpa::{AuthorityId, AuthorityList, AuthorityWeight, SetId}; use pezsp_std::marker::PhantomData; +use scale_info::TypeInfo; /// A bounded list of Grandpa authorities with associated weights. pub type StoredAuthorityList = diff --git a/pezbridges/modules/messages/src/benchmarking.rs b/pezbridges/modules/messages/src/benchmarking.rs index 834b3c24..053f0701 100644 --- a/pezbridges/modules/messages/src/benchmarking.rs +++ b/pezbridges/modules/messages/src/benchmarking.rs @@ -29,8 +29,8 @@ use bp_messages::{ InboundLaneData, LaneState, MessageNonce, OutboundLaneData, UnrewardedRelayer, UnrewardedRelayersState, }; -use pezbp_runtime::{AccountIdOf, HashOf, UnverifiedStorageProofParams}; use codec::Decode; +use pezbp_runtime::{AccountIdOf, HashOf, UnverifiedStorageProofParams}; use pezframe_benchmarking::{account, v2::*}; use pezframe_support::weights::Weight; use pezframe_system::RawOrigin; diff --git a/pezbridges/modules/messages/src/inbound_lane.rs b/pezbridges/modules/messages/src/inbound_lane.rs index dd623d69..943dd516 100644 --- a/pezbridges/modules/messages/src/inbound_lane.rs +++ b/pezbridges/modules/messages/src/inbound_lane.rs @@ -23,11 +23,11 @@ use bp_messages::{ ChainWithMessages, DeliveredMessages, InboundLaneData, LaneState, MessageKey, MessageNonce, OutboundLaneData, ReceptionResult, UnrewardedRelayer, }; -use pezbp_runtime::AccountIdOf; use codec::{Decode, Encode, EncodeLike, MaxEncodedLen}; -use scale_info::{Type, TypeInfo}; +use pezbp_runtime::AccountIdOf; use pezsp_runtime::RuntimeDebug; use pezsp_std::prelude::PartialEq; +use scale_info::{Type, TypeInfo}; /// Inbound lane storage. pub trait InboundLaneStorage { diff --git a/pezbridges/modules/messages/src/lanes_manager.rs b/pezbridges/modules/messages/src/lanes_manager.rs index c2c3b36a..e7e477d4 100644 --- a/pezbridges/modules/messages/src/lanes_manager.rs +++ b/pezbridges/modules/messages/src/lanes_manager.rs @@ -24,11 +24,11 @@ use bp_messages::{ target_chain::MessageDispatch, ChainWithMessages, InboundLaneData, LaneState, MessageKey, MessageNonce, OutboundLaneData, }; -use pezbp_runtime::AccountIdOf; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; +use pezbp_runtime::AccountIdOf; use pezframe_support::{ensure, pezsp_runtime::RuntimeDebug, PalletError}; -use scale_info::TypeInfo; use pezsp_std::marker::PhantomData; +use scale_info::TypeInfo; /// Lanes manager errors. #[derive( @@ -183,9 +183,9 @@ impl, I: 'static> RuntimeInboundLaneStorage { /// maximal configured. /// /// Maximal inbound lane state set size is configured by the - /// `MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX` constant from the pezpallet configuration. The PoV - /// of the call includes the maximal size of inbound lane state. If the actual size is smaller, - /// we may subtract extra bytes from this component. + /// `MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX` constant from the pezpallet configuration. The + /// PoV of the call includes the maximal size of inbound lane state. If the actual size is + /// smaller, we may subtract extra bytes from this component. pub fn extra_proof_size_bytes(&self) -> u64 { let max_encoded_len = StoredInboundLaneData::::max_encoded_len(); let relayers_count = self.data().relayers.len(); diff --git a/pezbridges/modules/messages/src/lib.rs b/pezbridges/modules/messages/src/lib.rs index 2f650e3e..da30e842 100644 --- a/pezbridges/modules/messages/src/lib.rs +++ b/pezbridges/modules/messages/src/lib.rs @@ -64,11 +64,11 @@ use bp_messages::{ MessageNonce, MessagePayload, MessagesOperatingMode, OutboundLaneData, OutboundMessageDetails, UnrewardedRelayersState, VerificationError, }; +use codec::{Decode, Encode}; use pezbp_runtime::{ AccountIdOf, BasicOperatingMode, HashOf, OwnedBridgeModule, PreComputedSize, RangeInclusiveExt, Size, }; -use codec::{Decode, Encode}; use pezframe_support::{dispatch::PostDispatchInfo, ensure, fail, traits::Get, DefaultNoBound}; use pezsp_std::{marker::PhantomData, prelude::*}; @@ -677,7 +677,8 @@ pub struct SendMessageArgs, I: 'static> { payload: StoredMessagePayload, } -impl bp_messages::source_chain::MessagesBridge for Pezpallet +impl bp_messages::source_chain::MessagesBridge + for Pezpallet where T: Config, I: 'static, diff --git a/pezbridges/modules/messages/src/migration.rs b/pezbridges/modules/messages/src/migration.rs index 54e6f71c..e46ef6f6 100644 --- a/pezbridges/modules/messages/src/migration.rs +++ b/pezbridges/modules/messages/src/migration.rs @@ -31,8 +31,8 @@ pub mod v0 { use super::Config; use crate::BridgedChainOf; use bp_messages::{MessageNonce, UnrewardedRelayer}; - use pezbp_runtime::AccountIdOf; use codec::{Decode, Encode}; + use pezbp_runtime::AccountIdOf; use pezsp_std::collections::vec_deque::VecDeque; #[derive(Encode, Decode, Clone, PartialEq, Eq)] @@ -107,7 +107,9 @@ pub mod v1 { } #[cfg(feature = "try-runtime")] - fn post_upgrade(state: pezsp_std::vec::Vec) -> Result<(), pezsp_runtime::DispatchError> { + fn post_upgrade( + state: pezsp_std::vec::Vec, + ) -> Result<(), pezsp_runtime::DispatchError> { use codec::Decode; const LOG_TARGET: &str = "runtime::bridge-messages-migration"; diff --git a/pezbridges/modules/messages/src/outbound_lane.rs b/pezbridges/modules/messages/src/outbound_lane.rs index 987c4c5b..c16d444b 100644 --- a/pezbridges/modules/messages/src/outbound_lane.rs +++ b/pezbridges/modules/messages/src/outbound_lane.rs @@ -24,9 +24,9 @@ use bp_messages::{ }; use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::{traits::Get, BoundedVec, PalletError}; -use scale_info::TypeInfo; use pezsp_runtime::RuntimeDebug; use pezsp_std::{collections::vec_deque::VecDeque, marker::PhantomData, ops::RangeInclusive}; +use scale_info::TypeInfo; /// Outbound lane storage. pub trait OutboundLaneStorage { diff --git a/pezbridges/modules/messages/src/proofs.rs b/pezbridges/modules/messages/src/proofs.rs index 4451c8e1..82b6e5a7 100644 --- a/pezbridges/modules/messages/src/proofs.rs +++ b/pezbridges/modules/messages/src/proofs.rs @@ -25,10 +25,10 @@ use bp_messages::{ ChainWithMessages, InboundLaneData, Message, MessageKey, MessageNonce, MessagePayload, OutboundLaneData, VerificationError, }; +use codec::Decode; use pezbp_runtime::{ HashOf, HasherOf, RangeInclusiveExt, RawStorageProof, StorageProofChecker, StorageProofError, }; -use codec::Decode; use pezsp_std::vec::Vec; /// 'Parsed' message delivery proof - inbound lane id and its state. @@ -218,8 +218,8 @@ mod tests { use bp_header_pez_chain::{HeaderChainError, StoredHeaderDataBuilder}; use bp_messages::LaneState; - use pezbp_runtime::{HeaderId, StorageProofError}; use codec::Encode; + use pezbp_runtime::{HeaderId, StorageProofError}; use pezsp_runtime::traits::Header; fn using_messages_proof( diff --git a/pezbridges/modules/messages/src/tests/messages_generation.rs b/pezbridges/modules/messages/src/tests/messages_generation.rs index eff384b4..014bcfb8 100644 --- a/pezbridges/modules/messages/src/tests/messages_generation.rs +++ b/pezbridges/modules/messages/src/tests/messages_generation.rs @@ -20,11 +20,11 @@ use bp_messages::{ storage_keys, ChainWithMessages, InboundLaneData, MessageKey, MessageNonce, MessagePayload, OutboundLaneData, }; +use codec::Encode; use pezbp_runtime::{ grow_storage_value, record_all_trie_keys, AccountIdOf, Chain, HashOf, HasherOf, RawStorageProof, UnverifiedStorageProofParams, }; -use codec::Encode; use pezsp_std::{ops::RangeInclusive, prelude::*}; use pezsp_trie::{trie_types::TrieDBMutBuilderV1, LayoutV1, MemoryDB, TrieMut}; diff --git a/pezbridges/modules/messages/src/tests/mock.rs b/pezbridges/modules/messages/src/tests/mock.rs index 4a2f1e35..e84438f9 100644 --- a/pezbridges/modules/messages/src/tests/mock.rs +++ b/pezbridges/modules/messages/src/tests/mock.rs @@ -39,21 +39,21 @@ use bp_messages::{ Message, MessageKey, MessageNonce, OutboundLaneData, UnrewardedRelayer, UnrewardedRelayersState, }; +use codec::{Decode, DecodeWithMemTracking, Encode}; use pezbp_runtime::{ messages::MessageDispatchResult, Chain, ChainId, Size, UnverifiedStorageProofParams, }; -use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::{ derive_impl, weights::{constants::RocksDbWeight, Weight}, }; -use scale_info::TypeInfo; use pezsp_core::H256; use pezsp_runtime::{ testing::Header as BizinikiwiHeader, traits::{BlakeTwo256, ConstU32}, BuildStorage, StateVersion, }; +use scale_info::TypeInfo; use std::{collections::VecDeque, ops::RangeInclusive}; pub type AccountId = u64; @@ -354,7 +354,8 @@ impl TestMessageDispatch { pub fn emulate_enqueued_message(lane: TestLaneIdType) { let key = (b"dispatched", lane).encode(); - let dispatched = pezframe_support::storage::unhashed::get_or_default::(&key[..]); + let dispatched = + pezframe_support::storage::unhashed::get_or_default::(&key[..]); pezframe_support::storage::unhashed::put(&key[..], &(dispatched + 1)); } } @@ -460,7 +461,9 @@ pub fn inbound_unrewarded_relayers_state(lane: TestLaneIdType) -> UnrewardedRela /// Return test externalities to use in tests. pub fn new_test_ext() -> pezsp_io::TestExternalities { - let mut t = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); + let mut t = pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap(); pezpallet_balances::GenesisConfig:: { balances: vec![(ENDOWED_ACCOUNT, 1_000_000)], ..Default::default() diff --git a/pezbridges/modules/messages/src/tests/pezpallet_tests.rs b/pezbridges/modules/messages/src/tests/pezpallet_tests.rs index 4ec0dbbf..b3cf34fa 100644 --- a/pezbridges/modules/messages/src/tests/pezpallet_tests.rs +++ b/pezbridges/modules/messages/src/tests/pezpallet_tests.rs @@ -23,7 +23,7 @@ use crate::{ tests::mock::{RuntimeEvent as TestEvent, *}, weights_ext::WeightInfoExt, Call, Config, Error, Event, InboundLanes, LanesManagerError, OutboundLanes, OutboundMessages, - Pezpallet, PalletOperatingMode, PalletOwner, StoredInboundLaneData, + PalletOperatingMode, PalletOwner, Pezpallet, StoredInboundLaneData, }; use bp_messages::{ @@ -34,9 +34,9 @@ use bp_messages::{ OutboundLaneData, OutboundMessageDetails, UnrewardedRelayer, UnrewardedRelayersState, VerificationError, }; -use pezbp_runtime::{BasicOperatingMode, PreComputedSize, RangeInclusiveExt, Size}; use bp_test_utils::generate_owned_bridge_module_tests; use codec::Encode; +use pezbp_runtime::{BasicOperatingMode, PreComputedSize, RangeInclusiveExt, Size}; use pezframe_support::{ assert_err, assert_noop, assert_ok, dispatch::Pays, @@ -248,7 +248,10 @@ fn send_message_rejects_too_large_message() { .extra .extend_from_slice(&vec![0u8; max_outbound_payload_size as usize]); assert_noop!( - Pezpallet::::validate_message(test_lane_id(), &message_payload.clone(),), + Pezpallet::::validate_message( + test_lane_id(), + &message_payload.clone(), + ), Error::::MessageRejectedByPallet(VerificationError::MessageTooLarge), ); diff --git a/pezbridges/modules/messages/src/weights_ext.rs b/pezbridges/modules/messages/src/weights_ext.rs index f3c1f118..178d6176 100644 --- a/pezbridges/modules/messages/src/weights_ext.rs +++ b/pezbridges/modules/messages/src/weights_ext.rs @@ -284,8 +284,8 @@ pub trait WeightInfoExt: WeightInfo { // storage values that are read during the call. So we may ignore the weight of this check. // // However, during (2) we read and update storage values of other pallets - // (`pezpallet-bridge-relayers` and balances/assets pezpallet). So we need to add this weight to the - // weight of our call. Hence two following methods. + // (`pezpallet-bridge-relayers` and balances/assets pezpallet). So we need to add this weight to + // the weight of our call. Hence two following methods. /// Extra weight that is added to the `receive_messages_proof` call weight by signed extensions /// that are declared at runtime level. diff --git a/pezbridges/modules/relayers/src/extension/grandpa_adapter.rs b/pezbridges/modules/relayers/src/extension/grandpa_adapter.rs index 76510721..6855a486 100644 --- a/pezbridges/modules/relayers/src/extension/grandpa_adapter.rs +++ b/pezbridges/modules/relayers/src/extension/grandpa_adapter.rs @@ -22,8 +22,8 @@ use crate::{ }; use bp_relayers::{BatchCallUnpacker, ExtensionCallData, ExtensionCallInfo, ExtensionConfig}; -use pezbp_runtime::{Chain, StaticStrProvider}; use core::marker::PhantomData; +use pezbp_runtime::{Chain, StaticStrProvider}; use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo}; use pezframe_system::Config as SystemConfig; use pezpallet_bridge_grandpa::{ diff --git a/pezbridges/modules/relayers/src/extension/messages_adapter.rs b/pezbridges/modules/relayers/src/extension/messages_adapter.rs index 36d56930..a95f223d 100644 --- a/pezbridges/modules/relayers/src/extension/messages_adapter.rs +++ b/pezbridges/modules/relayers/src/extension/messages_adapter.rs @@ -20,8 +20,8 @@ use crate::{extension::verify_messages_call_succeeded, Config as BridgeRelayersConfig}; use bp_relayers::{ExtensionCallData, ExtensionCallInfo, ExtensionConfig}; -use pezbp_runtime::StaticStrProvider; use core::marker::PhantomData; +use pezbp_runtime::StaticStrProvider; use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo}; use pezpallet_bridge_messages::{ CallSubType as BridgeMessagesCallSubType, Config as BridgeMessagesConfig, LaneIdOf, diff --git a/pezbridges/modules/relayers/src/extension/mod.rs b/pezbridges/modules/relayers/src/extension/mod.rs index 41a28d0d..3f3f21dc 100644 --- a/pezbridges/modules/relayers/src/extension/mod.rs +++ b/pezbridges/modules/relayers/src/extension/mod.rs @@ -29,9 +29,9 @@ use bp_relayers::{ ExplicitOrAccountParams, ExtensionCallData, ExtensionCallInfo, ExtensionConfig, RewardsAccountOwner, RewardsAccountParams, }; -use pezbp_runtime::{Chain, RangeInclusiveExt, StaticStrProvider}; use codec::{Decode, DecodeWithMemTracking, Encode}; use core::{fmt::Debug, marker::PhantomData}; +use pezbp_runtime::{Chain, RangeInclusiveExt, StaticStrProvider}; use pezframe_support::{ dispatch::{DispatchInfo, PostDispatchInfo}, pezpallet_prelude::TransactionSource, @@ -45,7 +45,6 @@ use pezpallet_bridge_messages::{ use pezpallet_transaction_payment::{ Config as TransactionPaymentConfig, OnChargeTransaction, Pezpallet as TransactionPaymentPallet, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{ AsSystemOriginSigner, DispatchInfoOf, Dispatchable, PostDispatchInfoOf, @@ -54,6 +53,7 @@ use pezsp_runtime::{ transaction_validity::{InvalidTransaction, TransactionValidityError, ValidTransactionBuilder}, DispatchResult, RuntimeDebug, }; +use scale_info::TypeInfo; pub use grandpa_adapter::WithGrandpaChainExtensionConfig; pub use messages_adapter::WithMessagesExtensionConfig; @@ -464,16 +464,18 @@ mod tests { }; use bp_pezkuwi_core::teyrchains::{ParaHeadsProof, ParaId}; use bp_relayers::RuntimeWithUtilityPallet; - use pezbp_runtime::{BasicOperatingMode, HeaderId, Teyrchain}; use bp_test_utils::{make_default_justification, test_keyring, TEST_GRANDPA_SET_ID}; use bp_teyrchains::{BestParaHeadHash, ParaInfo, SubmitTeyrchainHeadsInfo}; + use pezbp_runtime::{BasicOperatingMode, HeaderId, Teyrchain}; use pezframe_support::{ __private::pezsp_tracing, assert_storage_noop, parameter_types, traits::{fungible::Mutate, ReservableCurrency}, weights::Weight, }; - use pezpallet_bridge_grandpa::{Call as GrandpaCall, Pezpallet as GrandpaPallet, StoredAuthoritySet}; + use pezpallet_bridge_grandpa::{ + Call as GrandpaCall, Pezpallet as GrandpaPallet, StoredAuthoritySet, + }; use pezpallet_bridge_messages::{Call as MessagesCall, Pezpallet as MessagesPallet}; use pezpallet_bridge_teyrchains::{Call as TeyrchainsCall, Pezpallet as TeyrchainsPallet}; use pezpallet_utility::Call as UtilityCall; diff --git a/pezbridges/modules/relayers/src/extension/priority.rs b/pezbridges/modules/relayers/src/extension/priority.rs index 9de24e16..6d006fb6 100644 --- a/pezbridges/modules/relayers/src/extension/priority.rs +++ b/pezbridges/modules/relayers/src/extension/priority.rs @@ -157,8 +157,8 @@ mod integrity_tests { pub fn ensure_priority_boost_is_sane( tip_boost_per_header: BalanceOf, ) where - Runtime: - pezpallet_transaction_payment::Config + pezpallet_bridge_grandpa::Config, + Runtime: pezpallet_transaction_payment::Config + + pezpallet_bridge_grandpa::Config, GrandpaInstance: 'static, PriorityBoostPerHeader: Get, Runtime::RuntimeCall: Dispatchable, @@ -189,8 +189,8 @@ mod integrity_tests { tip: BalanceOf, ) -> TransactionPriority where - Runtime: - pezpallet_transaction_payment::Config + pezpallet_bridge_grandpa::Config, + Runtime: pezpallet_transaction_payment::Config + + pezpallet_bridge_grandpa::Config, GrandpaInstance: 'static, Runtime::RuntimeCall: Dispatchable, BalanceOf: Send + Sync + FixedPointOperand, diff --git a/pezbridges/modules/relayers/src/extension/teyrchain_adapter.rs b/pezbridges/modules/relayers/src/extension/teyrchain_adapter.rs index 28fca52f..28e90356 100644 --- a/pezbridges/modules/relayers/src/extension/teyrchain_adapter.rs +++ b/pezbridges/modules/relayers/src/extension/teyrchain_adapter.rs @@ -25,8 +25,8 @@ use crate::{ }; use bp_relayers::{BatchCallUnpacker, ExtensionCallData, ExtensionCallInfo, ExtensionConfig}; -use pezbp_runtime::{StaticStrProvider, Teyrchain}; use core::marker::PhantomData; +use pezbp_runtime::{StaticStrProvider, Teyrchain}; use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo}; use pezframe_system::Config as SystemConfig; use pezpallet_bridge_grandpa::{ diff --git a/pezbridges/modules/relayers/src/lib.rs b/pezbridges/modules/relayers/src/lib.rs index 9bb7e768..41f7d89f 100644 --- a/pezbridges/modules/relayers/src/lib.rs +++ b/pezbridges/modules/relayers/src/lib.rs @@ -23,8 +23,8 @@ extern crate alloc; pub use bp_relayers::RewardLedger; use bp_relayers::{PaymentProcedure, Registration, RelayerRewardsKeyProvider, StakeAndSlash}; -use pezbp_runtime::StorageDoubleMapKeyProvider; use core::marker::PhantomData; +use pezbp_runtime::StorageDoubleMapKeyProvider; use pezframe_support::{fail, traits::tokens::Balance}; use pezsp_arithmetic::traits::{AtLeast32BitUnsigned, Zero}; use pezsp_runtime::{ @@ -32,8 +32,8 @@ use pezsp_runtime::{ Saturating, }; -pub use pezpallet::*; pub use payment_adapter::{DeliveryConfirmationPaymentsAdapter, PayRewardFromAccount}; +pub use pezpallet::*; pub use stake_adapter::StakeAndSlashNamed; pub use weights::WeightInfo; pub use weights_ext::WeightInfoExt; @@ -1000,7 +1000,9 @@ mod tests { let reserved_balance = Balances::reserved_balance(REGISTER_RELAYER); let free_balance = Balances::free_balance(REGISTER_RELAYER); - assert_ok!(Pezpallet::::deregister(RuntimeOrigin::signed(REGISTER_RELAYER))); + assert_ok!(Pezpallet::::deregister(RuntimeOrigin::signed( + REGISTER_RELAYER + ))); assert_eq!( Balances::reserved_balance(REGISTER_RELAYER), reserved_balance - Stake::get() diff --git a/pezbridges/modules/relayers/src/migration.rs b/pezbridges/modules/relayers/src/migration.rs index 7e15ddfa..8ec34e20 100644 --- a/pezbridges/modules/relayers/src/migration.rs +++ b/pezbridges/modules/relayers/src/migration.rs @@ -30,12 +30,12 @@ pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); pub mod v0 { use crate::{Config, Pezpallet}; use bp_relayers::RewardsAccountOwner; - use pezbp_runtime::{ChainId, StorageDoubleMapKeyProvider}; use codec::{Codec, Decode, Encode, EncodeLike, MaxEncodedLen}; use core::marker::PhantomData; + use pezbp_runtime::{ChainId, StorageDoubleMapKeyProvider}; use pezframe_support::{pezpallet_prelude::OptionQuery, Blake2_128Concat, Identity}; - use scale_info::TypeInfo; use pezsp_runtime::traits::AccountIdConversion; + use scale_info::TypeInfo; /// Structure used to identify the account that pays a reward to the relayer. #[derive(Copy, Clone, Debug, Decode, Encode, Eq, PartialEq, TypeInfo, MaxEncodedLen)] @@ -122,11 +122,12 @@ pub mod v1 { use crate::{Config, Pezpallet}; use bp_messages::LaneIdType; use bp_relayers::RewardsAccountParams; - use pezbp_runtime::StorageDoubleMapKeyProvider; use codec::{Codec, EncodeLike}; use core::marker::PhantomData; + use pezbp_runtime::StorageDoubleMapKeyProvider; use pezframe_support::{ - pezpallet_prelude::OptionQuery, traits::UncheckedOnRuntimeUpgrade, Blake2_128Concat, Identity, + pezpallet_prelude::OptionQuery, traits::UncheckedOnRuntimeUpgrade, Blake2_128Concat, + Identity, }; use pezsp_arithmetic::traits::Zero; diff --git a/pezbridges/modules/relayers/src/mock.rs b/pezbridges/modules/relayers/src/mock.rs index f18a5a6c..5ba55cb7 100644 --- a/pezbridges/modules/relayers/src/mock.rs +++ b/pezbridges/modules/relayers/src/mock.rs @@ -26,9 +26,9 @@ use bp_messages::{ use bp_relayers::{ PayRewardFromAccount, PaymentProcedure, RewardsAccountOwner, RewardsAccountParams, }; -use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, Teyrchain}; use bp_teyrchains::SingleParaStoredHeaderDataBuilder; use codec::Encode; +use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, Teyrchain}; use pezframe_support::{ derive_impl, parameter_types, traits::fungible::Mutate, @@ -267,12 +267,13 @@ impl pezpallet_bridge_messages::Config for TestRuntime { type LaneId = TestLaneIdType; type DeliveryPayments = (); - type DeliveryConfirmationPayments = pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< - TestRuntime, - (), - (), - ConstU64<100_000>, - >; + type DeliveryConfirmationPayments = + pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< + TestRuntime, + (), + (), + ConstU64<100_000>, + >; type OnMessagesDelivered = (); type MessageDispatch = DummyMessageDispatch; @@ -408,7 +409,9 @@ pub fn test_reward_account_param() -> RewardsAccountParams { /// Return test externalities to use in tests. pub fn new_test_ext() -> pezsp_io::TestExternalities { - let t = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); + let t = pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap(); pezsp_io::TestExternalities::new(t) } diff --git a/pezbridges/modules/relayers/src/payment_adapter.rs b/pezbridges/modules/relayers/src/payment_adapter.rs index 9272d66d..2697da5b 100644 --- a/pezbridges/modules/relayers/src/payment_adapter.rs +++ b/pezbridges/modules/relayers/src/payment_adapter.rs @@ -26,8 +26,8 @@ use bp_messages::{ }; pub use bp_relayers::PayRewardFromAccount; use bp_relayers::{RewardsAccountOwner, RewardsAccountParams}; -use pezbp_runtime::Chain; use core::{marker::PhantomData, ops::RangeInclusive}; +use pezbp_runtime::Chain; use pezframe_support::{pezsp_runtime::SaturatedConversion, traits::Get}; use pezpallet_bridge_messages::LaneIdOf; use pezsp_arithmetic::traits::{Saturating, Zero}; @@ -55,8 +55,10 @@ where confirmation_relayer: &T::AccountId, received_range: &RangeInclusive, ) -> MessageNonce { - let relayers_rewards = - bp_messages::calc_relayers_rewards::(pez_messages_relayers, received_range); + let relayers_rewards = bp_messages::calc_relayers_rewards::( + pez_messages_relayers, + received_range, + ); let rewarded_relayers = relayers_rewards.len(); register_relayers_rewards::( diff --git a/pezbridges/modules/teyrchains/src/call_ext.rs b/pezbridges/modules/teyrchains/src/call_ext.rs index 8349ae23..9c4d6373 100644 --- a/pezbridges/modules/teyrchains/src/call_ext.rs +++ b/pezbridges/modules/teyrchains/src/call_ext.rs @@ -16,8 +16,8 @@ use crate::{Config, GrandpaPalletOf, Pezpallet, RelayBlockNumber}; use bp_header_pez_chain::HeaderChain; -use pezbp_runtime::{HeaderId, OwnedBridgeModule}; use bp_teyrchains::{BestParaHeadHash, SubmitTeyrchainHeadsInfo}; +use pezbp_runtime::{HeaderId, OwnedBridgeModule}; use pezframe_support::{ dispatch::CallableCallFor, traits::{Get, IsSubType}, @@ -260,8 +260,8 @@ mod tests { }; use bp_header_pez_chain::StoredHeaderData; use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHeadsProof, ParaId}; - use pezbp_runtime::BasicOperatingMode; use bp_teyrchains::BestParaHeadHash; + use pezbp_runtime::BasicOperatingMode; fn validate_submit_teyrchain_heads( num: RelayBlockNumber, diff --git a/pezbridges/modules/teyrchains/src/lib.rs b/pezbridges/modules/teyrchains/src/lib.rs index d4f1e748..238e0995 100644 --- a/pezbridges/modules/teyrchains/src/lib.rs +++ b/pezbridges/modules/teyrchains/src/lib.rs @@ -29,22 +29,22 @@ pub use weights_ext::WeightInfoExt; use bp_header_pez_chain::{HeaderChain, HeaderChainError}; use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHead, ParaHeadsProof, ParaId}; -use pezbp_runtime::{Chain, HashOf, HeaderId, HeaderIdOf, Teyrchain}; use bp_teyrchains::{ ParaInfo, ParaStoredHeaderData, RelayBlockHash, RelayBlockHasher, RelayBlockNumber, SubmitTeyrchainHeadsInfo, }; +use pezbp_runtime::{Chain, HashOf, HeaderId, HeaderIdOf, Teyrchain}; use pezframe_support::{dispatch::PostDispatchInfo, DefaultNoBound}; use pezpallet_bridge_grandpa::SubmitFinalityProofHelper; -use proofs::{StorageProofAdapter, TeyrchainsStorageProofAdapter}; use pezsp_std::{marker::PhantomData, vec::Vec}; +use proofs::{StorageProofAdapter, TeyrchainsStorageProofAdapter}; -#[cfg(feature = "runtime-benchmarks")] -use pezbp_runtime::HeaderOf; #[cfg(feature = "runtime-benchmarks")] use bp_teyrchains::ParaStoredHeaderDataBuilder; #[cfg(feature = "runtime-benchmarks")] use codec::Encode; +#[cfg(feature = "runtime-benchmarks")] +use pezbp_runtime::HeaderOf; // Re-export in crate namespace for `construct_runtime!`. pub use call_ext::*; @@ -75,14 +75,14 @@ struct UpdateTeyrchainHeadArtifacts { #[pezframe_support::pezpallet] pub mod pezpallet { use super::*; - use pezbp_runtime::{ - BasicOperatingMode, BoundedStorageValue, OwnedBridgeModule, StorageDoubleMapKeyProvider, - StorageMapKeyProvider, - }; use bp_teyrchains::{ BestParaHeadHash, ImportedParaHeadsKeyProvider, OnNewHead, ParaStoredHeaderDataBuilder, ParasInfoKeyProvider, }; + use pezbp_runtime::{ + BasicOperatingMode, BoundedStorageValue, OwnedBridgeModule, StorageDoubleMapKeyProvider, + StorageMapKeyProvider, + }; use pezframe_support::pezpallet_prelude::*; use pezframe_system::pezpallet_prelude::*; @@ -98,7 +98,8 @@ pub mod pezpallet { #[pezpallet::event] #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event, I: 'static = ()> { - /// The caller has provided head of teyrchain that the pezpallet is not configured to track. + /// The caller has provided head of teyrchain that the pezpallet is not configured to + /// track. UntrackedTeyrchainRejected { /// Identifier of the teyrchain that is not tracked by the pezpallet. teyrchain: ParaId, @@ -119,7 +120,8 @@ pub mod pezpallet { /// Actual teyrchain head hash. actual_teyrchain_head_hash: ParaHash, }, - /// The caller has provided obsolete teyrchain head, which is already known to the pezpallet. + /// The caller has provided obsolete teyrchain head, which is already known to the + /// pezpallet. RejectedObsoleteTeyrchainHead { /// Identifier of the teyrchain with obsolete head. teyrchain: ParaId, @@ -189,7 +191,8 @@ pub mod pezpallet { /// Benchmarks results from runtime we're plugged into. type WeightInfo: WeightInfoExt; - /// Instance of bridges GRANDPA pezpallet (within this runtime) that this pezpallet is linked to. + /// Instance of bridges GRANDPA pezpallet (within this runtime) that this pezpallet is + /// linked to. /// /// The GRANDPA pezpallet instance must be configured to import headers of relay chain that /// we're interested in. @@ -583,8 +586,10 @@ pub mod pezpallet { && SubmitFinalityProofHelper::::has_free_header_slots(); let pays_fee = if is_free { tracing::trace!(target: LOG_TARGET, "Teyrchain heads update transaction is free"); - pezpallet_bridge_grandpa::on_free_header_imported::( - ); + pezpallet_bridge_grandpa::on_free_header_imported::< + T, + T::BridgesGrandpaPalletInstance, + >(); Pays::No } else { tracing::trace!(target: LOG_TARGET, "Teyrchain heads update transaction is paid"); @@ -791,7 +796,8 @@ impl, I: 'static, C: Teyrchain> HeaderChain } } -/// (Re)initialize pezpallet with given header for using it in `pezpallet-bridge-messages` benchmarks. +/// (Re)initialize pezpallet with given header for using it in `pezpallet-bridge-messages` +/// benchmarks. #[cfg(feature = "runtime-benchmarks")] pub fn initialize_for_benchmarks, I: 'static, PC: Teyrchain>( header: HeaderOf, @@ -839,10 +845,6 @@ pub(crate) mod tests { use bp_header_pez_chain::{justification::GrandpaJustification, StoredHeaderGrandpaInfo}; use bp_pezkuwi_core::teyrchains::ParaHead; - use pezbp_runtime::{ - BasicOperatingMode, OwnedBridgeModuleError, StorageDoubleMapKeyProvider, - StorageMapKeyProvider, StorageProofError, - }; use bp_test_utils::{ authority_list, generate_owned_bridge_module_tests, make_default_justification, TEST_GRANDPA_SET_ID, @@ -850,6 +852,10 @@ pub(crate) mod tests { use bp_teyrchains::{ BestParaHeadHash, BridgeTeyrchainCall, ImportedParaHeadsKeyProvider, ParasInfoKeyProvider, }; + use pezbp_runtime::{ + BasicOperatingMode, OwnedBridgeModuleError, StorageDoubleMapKeyProvider, + StorageMapKeyProvider, StorageProofError, + }; use pezframe_support::{ assert_noop, assert_ok, dispatch::DispatchResultWithPostInfo, @@ -1842,9 +1848,10 @@ pub(crate) mod tests { initialize(Default::default()); // set free headers limit to `4` let mut free_headers_remaining = 4; - pezpallet_bridge_grandpa::FreeHeadersRemaining::::set( - Some(free_headers_remaining), - ); + pezpallet_bridge_grandpa::FreeHeadersRemaining::< + TestRuntime, + BridgesGrandpaPalletInstance, + >::set(Some(free_headers_remaining)); // import free GRANDPA and teyrchain headers let mut relay_block_number = 0; for i in 0..2 { @@ -1882,7 +1889,10 @@ pub(crate) mod tests { let (state_root, proof, teyrchains) = prepare_teyrchain_heads_proof::(vec![(2, head_data(2, 7))]); relay_block_number = relay_block_number + FreeHeadersInterval::get(); - let result = pezpallet_bridge_grandpa::Pezpallet::::submit_finality_proof_ex( + let result = pezpallet_bridge_grandpa::Pezpallet::< + TestRuntime, + BridgesGrandpaPalletInstance, + >::submit_finality_proof_ex( RuntimeOrigin::signed(1), Box::new(test_relay_header(relay_block_number, state_root)), make_default_justification(&test_relay_header(relay_block_number, state_root)), diff --git a/pezbridges/modules/teyrchains/src/proofs.rs b/pezbridges/modules/teyrchains/src/proofs.rs index 4d56b59e..f41e083a 100644 --- a/pezbridges/modules/teyrchains/src/proofs.rs +++ b/pezbridges/modules/teyrchains/src/proofs.rs @@ -19,9 +19,9 @@ use crate::{Config, GrandpaPalletOf, RelayBlockHash, RelayBlockHasher}; use bp_header_pez_chain::{HeaderChain, HeaderChainError}; use bp_pezkuwi_core::teyrchains::{ParaHead, ParaId}; -use pezbp_runtime::{RawStorageProof, StorageProofChecker, StorageProofError}; use bp_teyrchains::teyrchain_head_storage_key_at_source; use codec::Decode; +use pezbp_runtime::{RawStorageProof, StorageProofChecker, StorageProofError}; use pezframe_support::traits::Get; /// Abstraction over storage proof manipulation, hiding implementation details of actual storage diff --git a/pezbridges/modules/xcm-bridge-hub-router/src/lib.rs b/pezbridges/modules/xcm-bridge-hub-router/src/lib.rs index 2076c33d..f8da03bd 100644 --- a/pezbridges/modules/xcm-bridge-hub-router/src/lib.rs +++ b/pezbridges/modules/xcm-bridge-hub-router/src/lib.rs @@ -445,8 +445,8 @@ impl, I: 'static> FeeTracker for Pezpallet { #[cfg(test)] mod tests { use super::*; - use pezframe_support::assert_ok; use mock::*; + use pezframe_support::assert_ok; use pezframe_support::traits::Hooks; use pezframe_system::{EventRecord, Phase}; diff --git a/pezbridges/modules/xcm-bridge-hub-router/src/mock.rs b/pezbridges/modules/xcm-bridge-hub-router/src/mock.rs index a885c6aa..3e7947b4 100644 --- a/pezbridges/modules/xcm-bridge-hub-router/src/mock.rs +++ b/pezbridges/modules/xcm-bridge-hub-router/src/mock.rs @@ -88,7 +88,9 @@ impl pezpallet_xcm_bridge_hub_router::Config<()> for TestRuntime { type FeeAsset = BridgeFeeAsset; } -pub struct LatestOrNoneForLocationVersionChecker(pezsp_std::marker::PhantomData); +pub struct LatestOrNoneForLocationVersionChecker( + pezsp_std::marker::PhantomData, +); impl> GetVersion for LatestOrNoneForLocationVersionChecker { @@ -172,7 +174,9 @@ impl XcmChannelStatusProvider for TestLocalXcmChannelManager { /// Return test externalities to use in tests. pub fn new_test_ext() -> pezsp_io::TestExternalities { - let t = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); + let t = pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap(); pezsp_io::TestExternalities::new(t) } diff --git a/pezbridges/modules/xcm-bridge-hub-router/src/weights.rs b/pezbridges/modules/xcm-bridge-hub-router/src/weights.rs index 03099089..883843c0 100644 --- a/pezbridges/modules/xcm-bridge-hub-router/src/weights.rs +++ b/pezbridges/modules/xcm-bridge-hub-router/src/weights.rs @@ -55,7 +55,8 @@ pub trait WeightInfo { fn report_bridge_status() -> Weight; } -/// Weights for `pezpallet_xcm_bridge_hub_router` that are generated using one of the Bridge testnets. +/// Weights for `pezpallet_xcm_bridge_hub_router` that are generated using one of the Bridge +/// testnets. /// /// Those weights are test only and must never be used in production. pub struct BridgeWeight(PhantomData); diff --git a/pezbridges/modules/xcm-bridge-hub/src/dispatcher.rs b/pezbridges/modules/xcm-bridge-hub/src/dispatcher.rs index 6ebb8024..8f21fc84 100644 --- a/pezbridges/modules/xcm-bridge-hub/src/dispatcher.rs +++ b/pezbridges/modules/xcm-bridge-hub/src/dispatcher.rs @@ -24,13 +24,13 @@ use crate::{Config, Pezpallet, LOG_TARGET}; use bp_messages::target_chain::{DispatchMessage, MessageDispatch}; -use pezbp_runtime::messages::MessageDispatchResult; use bp_xcm_bridge_hub::{LocalXcmChannelManager, XcmAsPlainPayload}; use codec::{Decode, DecodeWithMemTracking, Encode}; +use pezbp_runtime::messages::MessageDispatchResult; use pezframe_support::{weights::Weight, CloneNoBound, EqNoBound, PartialEqNoBound}; use pezpallet_bridge_messages::{Config as BridgeMessagesConfig, WeightInfoExt}; -use scale_info::TypeInfo; use pezsp_runtime::SaturatedConversion; +use scale_info::TypeInfo; use xcm::prelude::*; use xcm_builder::{DispatchBlob, DispatchBlobError}; diff --git a/pezbridges/modules/xcm-bridge-hub/src/exporter.rs b/pezbridges/modules/xcm-bridge-hub/src/exporter.rs index 4774c2b3..d748f2de 100644 --- a/pezbridges/modules/xcm-bridge-hub/src/exporter.rs +++ b/pezbridges/modules/xcm-bridge-hub/src/exporter.rs @@ -355,9 +355,9 @@ impl, I: 'static> Pezpallet { /// /// We are using `HaulBlobExporter`, which requires `HaulBlob` implementation. It assumes that /// there's a single channel between two bridge hubs - `HaulBlob` only accepts the blob and nothing -/// else. But bridge messages pezpallet may have a dedicated channel (lane) for every pair of bridged -/// chains. So we are using our own `ExportXcm` implementation, but to utilize `HaulBlobExporter` we -/// still need this `DummyHaulBlob`. +/// else. But bridge messages pezpallet may have a dedicated channel (lane) for every pair of +/// bridged chains. So we are using our own `ExportXcm` implementation, but to utilize +/// `HaulBlobExporter` we still need this `DummyHaulBlob`. pub struct DummyHaulBlob; impl HaulBlob for DummyHaulBlob { @@ -371,8 +371,8 @@ mod tests { use super::*; use crate::{mock::*, Bridges, LaneToBridge, LanesManagerOf}; - use pezbp_runtime::RangeInclusiveExt; use bp_xcm_bridge_hub::{Bridge, BridgeLocations, BridgeState}; + use pezbp_runtime::RangeInclusiveExt; use pezframe_support::{assert_ok, traits::EnsureOrigin}; use pezpallet_bridge_messages::InboundLaneStorage; use xcm_builder::{NetworkExportTable, UnpaidRemoteExporter}; diff --git a/pezbridges/modules/xcm-bridge-hub/src/lib.rs b/pezbridges/modules/xcm-bridge-hub/src/lib.rs index 81beccff..710eb2b3 100644 --- a/pezbridges/modules/xcm-bridge-hub/src/lib.rs +++ b/pezbridges/modules/xcm-bridge-hub/src/lib.rs @@ -18,9 +18,9 @@ //! open and close bridges between local (to this pezpallet location) and remote XCM //! destinations. //! -//! The `pezpallet_xcm_bridge_hub` pezpallet is used to manage (open, close) bridges between chains from -//! different consensuses. The new extrinsics `fn open_bridge` and `fn close_bridge` are introduced. -//! Other chains can manage channels with different bridged global consensuses. +//! The `pezpallet_xcm_bridge_hub` pezpallet is used to manage (open, close) bridges between chains +//! from different consensuses. The new extrinsics `fn open_bridge` and `fn close_bridge` are +//! introduced. Other chains can manage channels with different bridged global consensuses. //! //! # Concept of `lane` and `LaneId` //! @@ -48,8 +48,8 @@ //! //! # Concept of `bridge` and `BridgeId` //! -//! The `pezpallet_xcm_bridge_hub` pezpallet needs to store some metadata about opened bridges. The bridge -//! (or bridge metadata) is stored under the `BridgeId` key. +//! The `pezpallet_xcm_bridge_hub` pezpallet needs to store some metadata about opened bridges. The +//! bridge (or bridge metadata) is stored under the `BridgeId` key. //! //! `BridgeId` is generated from `bridge_origin_relative_location` and //! `bridge_origin_universal_location` using the `latest` XCM structs. `BridgeId` is not transferred @@ -62,8 +62,8 @@ //! //! # Migrations and State //! -//! This pezpallet implements `try_state`, ensuring compatibility and checking everything so we know if -//! any migration is needed. `do_try_state` checks for `BridgeId` compatibility, which is +//! This pezpallet implements `try_state`, ensuring compatibility and checking everything so we know +//! if any migration is needed. `do_try_state` checks for `BridgeId` compatibility, which is //! recalculated on runtime upgrade. Upgrading to a new XCM version should not break anything, //! except removing older XCM versions. In such cases, we need to add migration for `BridgeId` and //! stored `Versioned*` structs and update `LaneToBridge` mapping, but this won't affect `LaneId` @@ -144,11 +144,11 @@ #![cfg_attr(not(feature = "std"), no_std)] use bp_messages::{LaneState, MessageNonce}; -use pezbp_runtime::{AccountIdOf, BalanceOf, RangeInclusiveExt}; use bp_xcm_bridge_hub::BridgeLocationsError; pub use bp_xcm_bridge_hub::{ Bridge, BridgeId, BridgeLocations, BridgeState, LocalXcmChannelManager, }; +use pezbp_runtime::{AccountIdOf, BalanceOf, RangeInclusiveExt}; use pezframe_support::{traits::fungible::MutateHold, DefaultNoBound}; use pezframe_system::Config as SystemConfig; use pezpallet_bridge_messages::{Config as BridgeMessagesConfig, LanesManagerError}; @@ -215,8 +215,8 @@ pub mod pezpallet { /// Checks the XCM version for the destination. type DestinationVersion: GetVersion; - /// The origin that is allowed to call privileged operations on the pezpallet, e.g. open/close - /// bridge for locations. + /// The origin that is allowed to call privileged operations on the pezpallet, e.g. + /// open/close bridge for locations. type ForceOrigin: EnsureOrigin<::RuntimeOrigin>; /// A set of XCM locations within local consensus system that are allowed to open /// bridges with remote destinations. @@ -691,10 +691,15 @@ pub mod pezpallet { Ok(bridge.lane_id) } - /// Ensure the correctness of the state of the connected `pezpallet_bridge_messages` instance. + /// Ensure the correctness of the state of the connected `pezpallet_bridge_messages` + /// instance. pub fn do_try_state_for_messages() -> Result<(), pezsp_runtime::TryRuntimeError> { // check that all `InboundLanes` laneIds have mapping to some bridge. - for lane_id in pezpallet_bridge_messages::InboundLanes::::iter_keys() { + for lane_id in pezpallet_bridge_messages::InboundLanes::< + T, + T::BridgeMessagesPalletInstance, + >::iter_keys() + { tracing::info!(target: LOG_TARGET, ?lane_id, "Checking `do_try_state_for_messages` for `InboundLanes`..."); ensure!( LaneToBridge::::get(lane_id).is_some(), @@ -703,7 +708,11 @@ pub mod pezpallet { } // check that all `OutboundLanes` laneIds have mapping to some bridge. - for lane_id in pezpallet_bridge_messages::OutboundLanes::::iter_keys() { + for lane_id in pezpallet_bridge_messages::OutboundLanes::< + T, + T::BridgeMessagesPalletInstance, + >::iter_keys() + { tracing::info!(target: LOG_TARGET, ?lane_id, "Checking `do_try_state_for_messages` for `OutboundLanes`"); ensure!( LaneToBridge::::get(lane_id).is_some(), @@ -839,7 +848,9 @@ mod tests { use bp_messages::LaneIdType; use mock::*; - use pezframe_support::{assert_err, assert_noop, assert_ok, traits::fungible::Mutate, BoundedVec}; + use pezframe_support::{ + assert_err, assert_noop, assert_ok, traits::fungible::Mutate, BoundedVec, + }; use pezframe_system::{EventRecord, Phase}; use pezsp_runtime::TryRuntimeError; diff --git a/pezbridges/modules/xcm-bridge-hub/src/mock.rs b/pezbridges/modules/xcm-bridge-hub/src/mock.rs index 1741c087..497628ff 100644 --- a/pezbridges/modules/xcm-bridge-hub/src/mock.rs +++ b/pezbridges/modules/xcm-bridge-hub/src/mock.rs @@ -22,9 +22,9 @@ use bp_messages::{ target_chain::{DispatchMessage, MessageDispatch}, ChainWithMessages, HashedLaneId, MessageNonce, }; -use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, HashOf}; use bp_xcm_bridge_hub::{BridgeId, LocalXcmChannelManager}; use codec::{Decode, Encode}; +use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, HashOf}; use pezframe_support::{ assert_ok, derive_impl, parameter_types, traits::{EnsureOrigin, Equals, Everything, Get, OriginTrait}, @@ -276,8 +276,8 @@ thread_local! { /// The `SendXcm` implementation directly executes XCM using `XcmExecutor`. /// -/// We ensure that the `ExportMessage` produced by `pezpallet_xcm_bridge_hub_router` is compatible with -/// the `ExportXcm` implementation of `pezpallet_xcm_bridge_hub`. +/// We ensure that the `ExportMessage` produced by `pezpallet_xcm_bridge_hub_router` is compatible +/// with the `ExportXcm` implementation of `pezpallet_xcm_bridge_hub`. /// /// Note: The crucial part is that `ExportMessage` is processed by `XcmExecutor`, which calls the /// `ExportXcm` implementation of `pezpallet_xcm_bridge_hub` as `MessageExporter`. @@ -663,7 +663,9 @@ impl MessageDispatch for TestMessageDispatch { /// Run pezpallet test. pub fn run_test(test: impl FnOnce() -> T) -> T { pezsp_io::TestExternalities::new( - pezframe_system::GenesisConfig::::default().build_storage().unwrap(), + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap(), ) .execute_with(test) } diff --git a/pezbridges/primitives/beefy/src/lib.rs b/pezbridges/primitives/beefy/src/lib.rs index 5e6f2578..088e1c7f 100644 --- a/pezbridges/primitives/beefy/src/lib.rs +++ b/pezbridges/primitives/beefy/src/lib.rs @@ -35,16 +35,16 @@ pub use pezsp_consensus_beefy::{ ValidatorSetId, BEEFY_ENGINE_ID, }; -use pezbp_runtime::{BasicOperatingMode, BlockNumberOf, Chain, HashOf}; use codec::{Decode, Encode}; +use pezbp_runtime::{BasicOperatingMode, BlockNumberOf, Chain, HashOf}; use pezframe_support::Parameter; -use scale_info::TypeInfo; -use serde::{Deserialize, Serialize}; use pezsp_runtime::{ traits::{Convert, MaybeSerializeDeserialize}, RuntimeAppPublic, RuntimeDebug, }; use pezsp_std::prelude::*; +use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; /// Bizinikiwi-based chain with BEEFY && MMR pallets deployed. /// diff --git a/pezbridges/primitives/header-chain/src/call_info.rs b/pezbridges/primitives/header-chain/src/call_info.rs index 321b768d..c58fdd0c 100644 --- a/pezbridges/primitives/header-chain/src/call_info.rs +++ b/pezbridges/primitives/header-chain/src/call_info.rs @@ -18,13 +18,13 @@ use crate::{justification, InitializationData}; -use pezbp_runtime::HeaderOf; use codec::{Decode, Encode}; +use pezbp_runtime::HeaderOf; use pezframe_support::{weights::Weight, RuntimeDebugNoBound}; -use scale_info::TypeInfo; use pezsp_consensus_grandpa::SetId; use pezsp_runtime::traits::{Header as HeaderT, Zero}; use pezsp_std::{boxed::Box, fmt::Debug}; +use scale_info::TypeInfo; /// A minimized version of `pezpallet-bridge-grandpa::Call` that can be used without a runtime. #[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)] diff --git a/pezbridges/primitives/header-chain/src/justification/mod.rs b/pezbridges/primitives/header-chain/src/justification/mod.rs index c519a3f8..b69b017e 100644 --- a/pezbridges/primitives/header-chain/src/justification/mod.rs +++ b/pezbridges/primitives/header-chain/src/justification/mod.rs @@ -30,12 +30,12 @@ pub use verification::{ PrecommitError, }; -use pezbp_runtime::{BlockNumberOf, Chain, HashOf, HeaderId}; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; +use pezbp_runtime::{BlockNumberOf, Chain, HashOf, HeaderId}; use pezsp_consensus_grandpa::{AuthorityId, AuthoritySignature}; use pezsp_runtime::{traits::Header as HeaderT, RuntimeDebug, SaturatedConversion}; use pezsp_std::prelude::*; +use scale_info::TypeInfo; /// A GRANDPA Justification is a proof that a given header was finalized /// at a certain height and with a certain set of authorities. diff --git a/pezbridges/primitives/header-chain/src/justification/verification/mod.rs b/pezbridges/primitives/header-chain/src/justification/verification/mod.rs index f2ad6829..0cb5ac1e 100644 --- a/pezbridges/primitives/header-chain/src/justification/verification/mod.rs +++ b/pezbridges/primitives/header-chain/src/justification/verification/mod.rs @@ -22,8 +22,8 @@ pub mod strict; use crate::{justification::GrandpaJustification, AuthoritySet}; -use pezbp_runtime::HeaderId; use finality_grandpa::voter_set::VoterSet; +use pezbp_runtime::HeaderId; use pezsp_consensus_grandpa::{AuthorityId, AuthoritySignature, SetId}; use pezsp_runtime::{traits::Header as HeaderT, RuntimeDebug}; use pezsp_std::{ diff --git a/pezbridges/primitives/header-chain/src/lib.rs b/pezbridges/primitives/header-chain/src/lib.rs index 18d27371..fdae2361 100644 --- a/pezbridges/primitives/header-chain/src/lib.rs +++ b/pezbridges/primitives/header-chain/src/lib.rs @@ -23,20 +23,20 @@ use crate::justification::{ GrandpaJustification, JustificationVerificationContext, JustificationVerificationError, }; +use codec::{Codec, Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen}; +use core::{clone::Clone, cmp::Eq, default::Default, fmt::Debug}; use pezbp_runtime::{ BasicOperatingMode, BlockNumberOf, Chain, HashOf, HasherOf, HeaderOf, RawStorageProof, StorageProofChecker, StorageProofError, UnderlyingChainProvider, }; -use codec::{Codec, Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen}; -use core::{clone::Clone, cmp::Eq, default::Default, fmt::Debug}; use pezframe_support::PalletError; -use scale_info::TypeInfo; -use serde::{Deserialize, Serialize}; use pezsp_consensus_grandpa::{ AuthorityList, ConsensusLog, ScheduledChange, SetId, GRANDPA_ENGINE_ID, }; use pezsp_runtime::{traits::Header as HeaderT, Digest, RuntimeDebug, SaturatedConversion}; use pezsp_std::{boxed::Box, vec::Vec}; +use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; pub use call_info::{BridgeGrandpaCall, BridgeGrandpaCallOf, SubmitFinalityProofInfo}; @@ -251,8 +251,8 @@ pub trait FindEquivocations, BlockHash: Copy> TransactionEra::Immortal => pezsp_runtime::generic::Era::immortal(), // `unique_saturated_into` is fine here - mortality `u64::MAX` is not something we // expect to see on any chain - TransactionEra::Mortal(header_id, period) => - pezsp_runtime::generic::Era::mortal(period as _, header_id.0.unique_saturated_into()), + TransactionEra::Mortal(header_id, period) => pezsp_runtime::generic::Era::mortal( + period as _, + header_id.0.unique_saturated_into(), + ), } } @@ -437,10 +439,10 @@ pub trait OwnedBridgeModule { Ok(()) } - /// Pezpallet owner has a right to halt all module operations and then resume it. If it is `None`, - /// then there are no direct ways to halt/resume module operations, but other runtime methods - /// may still be used to do that (i.e. democracy::referendum to update halt flag directly - /// or call the `set_operating_mode`). + /// Pezpallet owner has a right to halt all module operations and then resume it. If it is + /// `None`, then there are no direct ways to halt/resume module operations, but other runtime + /// methods may still be used to do that (i.e. democracy::referendum to update halt flag + /// directly or call the `set_operating_mode`). fn module_owner() -> Option { Self::OwnerStorage::get() } diff --git a/pezbridges/primitives/runtime/src/messages.rs b/pezbridges/primitives/runtime/src/messages.rs index 91367797..013bd3dc 100644 --- a/pezbridges/primitives/runtime/src/messages.rs +++ b/pezbridges/primitives/runtime/src/messages.rs @@ -18,8 +18,8 @@ use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::weights::Weight; -use scale_info::TypeInfo; use pezsp_runtime::RuntimeDebug; +use scale_info::TypeInfo; /// Message dispatch result. #[derive(Encode, Decode, DecodeWithMemTracking, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)] diff --git a/pezbridges/primitives/runtime/src/storage_proof.rs b/pezbridges/primitives/runtime/src/storage_proof.rs index 0be35abc..7a9249e7 100644 --- a/pezbridges/primitives/runtime/src/storage_proof.rs +++ b/pezbridges/primitives/runtime/src/storage_proof.rs @@ -25,9 +25,9 @@ use pezsp_trie::{ use codec::{Decode, DecodeWithMemTracking, Encode}; use hash_db::{HashDB, Hasher, EMPTY_PREFIX}; -use scale_info::TypeInfo; #[cfg(feature = "test-helpers")] use pezsp_trie::{recorder_ext::RecorderExt, Recorder, TrieDBBuilder, TrieError, TrieHash}; +use scale_info::TypeInfo; #[cfg(feature = "test-helpers")] use trie_db::{Trie, TrieConfiguration, TrieDBMut}; @@ -336,7 +336,8 @@ pub mod tests_for_storage_proof_checker { // checking proof against invalid commitment fails assert_eq!( - >::new(pezsp_core::H256::random(), proof).err(), + >::new(pezsp_core::H256::random(), proof) + .err(), Some(StorageProofError::StorageRootMismatch) ); } diff --git a/pezbridges/primitives/runtime/src/storage_types.rs b/pezbridges/primitives/runtime/src/storage_types.rs index 368a1826..4805d659 100644 --- a/pezbridges/primitives/runtime/src/storage_types.rs +++ b/pezbridges/primitives/runtime/src/storage_types.rs @@ -19,9 +19,9 @@ use codec::{Decode, Encode, MaxEncodedLen}; use pezframe_support::traits::Get; -use scale_info::{Type, TypeInfo}; use pezsp_runtime::RuntimeDebug; use pezsp_std::{marker::PhantomData, ops::Deref}; +use scale_info::{Type, TypeInfo}; /// Error that is returned when the value size exceeds maximal configured size. #[derive(RuntimeDebug)] diff --git a/pezbridges/primitives/test-utils/src/lib.rs b/pezbridges/primitives/test-utils/src/lib.rs index 9e19787b..15c241fc 100644 --- a/pezbridges/primitives/test-utils/src/lib.rs +++ b/pezbridges/primitives/test-utils/src/lib.rs @@ -21,9 +21,9 @@ use bp_header_pez_chain::justification::{required_justification_precommits, GrandpaJustification}; use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHead, ParaHeadsProof, ParaId}; -use pezbp_runtime::record_all_trie_keys; use bp_teyrchains::teyrchain_head_storage_key_at_source; use codec::Encode; +use pezbp_runtime::record_all_trie_keys; use pezsp_consensus_grandpa::{AuthorityId, AuthoritySignature, AuthorityWeight, SetId}; use pezsp_runtime::traits::{Header as HeaderT, One, Zero}; use pezsp_std::prelude::*; @@ -162,7 +162,10 @@ fn generate_chain(fork_id: u32, depth: u32, ancestor: &H) -> Vec // Modifying the digest so headers at the same height but in different forks have different // hashes - header.digest_mut().logs.push(pezsp_runtime::DigestItem::Other(fork_id.encode())); + header + .digest_mut() + .logs + .push(pezsp_runtime::DigestItem::Other(fork_id.encode())); headers.push(header); } diff --git a/pezbridges/primitives/teyrchains/src/call_info.rs b/pezbridges/primitives/teyrchains/src/call_info.rs index 9d813823..9e599d17 100644 --- a/pezbridges/primitives/teyrchains/src/call_info.rs +++ b/pezbridges/primitives/teyrchains/src/call_info.rs @@ -19,11 +19,11 @@ use crate::{ParaHash, ParaId, RelayBlockHash, RelayBlockNumber}; use bp_pezkuwi_core::teyrchains::ParaHeadsProof; -use pezbp_runtime::HeaderId; use codec::{Decode, Encode}; -use scale_info::TypeInfo; +use pezbp_runtime::HeaderId; use pezsp_runtime::RuntimeDebug; use pezsp_std::vec::Vec; +use scale_info::TypeInfo; /// A minimized version of `pezpallet-bridge-teyrchains::Call` that can be used without a runtime. #[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)] diff --git a/pezbridges/primitives/teyrchains/src/lib.rs b/pezbridges/primitives/teyrchains/src/lib.rs index 5f10ed24..c8829b40 100644 --- a/pezbridges/primitives/teyrchains/src/lib.rs +++ b/pezbridges/primitives/teyrchains/src/lib.rs @@ -23,16 +23,16 @@ pub use bp_header_pez_chain::StoredHeaderData; pub use call_info::{BridgeTeyrchainCall, SubmitTeyrchainHeadsInfo}; use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHead, ParaId}; +use codec::{Decode, Encode, MaxEncodedLen}; use pezbp_runtime::{ BlockNumberOf, Chain, HashOf, HeaderOf, StorageDoubleMapKeyProvider, StorageMapKeyProvider, Teyrchain, }; -use codec::{Decode, Encode, MaxEncodedLen}; use pezframe_support::{weights::Weight, Blake2_128Concat, Twox64Concat}; -use scale_info::TypeInfo; use pezsp_core::storage::StorageKey; use pezsp_runtime::{traits::Header as HeaderT, RuntimeDebug}; use pezsp_std::{marker::PhantomData, prelude::*}; +use scale_info::TypeInfo; /// Block hash of the bridged relay chain. pub type RelayBlockHash = bp_pezkuwi_core::Hash; @@ -75,7 +75,11 @@ pub fn teyrchain_head_storage_key_at_source( paras_pallet_name: &str, para_id: ParaId, ) -> StorageKey { - pezbp_runtime::storage_map_final_key::(paras_pallet_name, "Heads", ¶_id.encode()) + pezbp_runtime::storage_map_final_key::( + paras_pallet_name, + "Heads", + ¶_id.encode(), + ) } /// Can be use to access the runtime storage key of the teyrchains info at the target chain. @@ -92,7 +96,8 @@ impl StorageMapKeyProvider for ParasInfoKeyProvider { /// Can be use to access the runtime storage key of the teyrchain head at the target chain. /// -/// The head is stored by the `pezpallet-bridge-teyrchains` pezpallet in the `ImportedParaHeads` map. +/// The head is stored by the `pezpallet-bridge-teyrchains` pezpallet in the `ImportedParaHeads` +/// map. pub struct ImportedParaHeadsKeyProvider; impl StorageDoubleMapKeyProvider for ImportedParaHeadsKeyProvider { const MAP_NAME: &'static str = "ImportedParaHeads"; @@ -108,7 +113,8 @@ impl StorageDoubleMapKeyProvider for ImportedParaHeadsKeyProvider { /// `pezbp_runtime::StoredHeaderData` structure. /// /// We do not know exact structure of the teyrchain head, so we always store encoded version -/// of the `pezbp_runtime::StoredHeaderData`. It is only decoded when we talk about specific teyrchain. +/// of the `pezbp_runtime::StoredHeaderData`. It is only decoded when we talk about specific +/// teyrchain. #[derive(Clone, Decode, Encode, PartialEq, RuntimeDebug, TypeInfo)] pub struct ParaStoredHeaderData(pub Vec); diff --git a/pezbridges/primitives/xcm-bridge-hub-router/src/lib.rs b/pezbridges/primitives/xcm-bridge-hub-router/src/lib.rs index a5cd604c..0ebd3ea8 100644 --- a/pezbridges/primitives/xcm-bridge-hub-router/src/lib.rs +++ b/pezbridges/primitives/xcm-bridge-hub-router/src/lib.rs @@ -19,9 +19,9 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::{Decode, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; use pezsp_core::H256; use pezsp_runtime::{FixedU128, RuntimeDebug}; +use scale_info::TypeInfo; use xcm::latest::prelude::Location; /// Minimal delivery fee factor. @@ -57,7 +57,8 @@ impl Default for BridgeState { } } -/// A minimized version of `pezpallet-xcm-bridge-hub-router::Call` that can be used without a runtime. +/// A minimized version of `pezpallet-xcm-bridge-hub-router::Call` that can be used without a +/// runtime. #[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)] #[allow(non_camel_case_types)] pub enum XcmBridgeHubRouterCall { diff --git a/pezbridges/primitives/xcm-bridge-hub/src/call_info.rs b/pezbridges/primitives/xcm-bridge-hub/src/call_info.rs index 743ce86d..042dd7d2 100644 --- a/pezbridges/primitives/xcm-bridge-hub/src/call_info.rs +++ b/pezbridges/primitives/xcm-bridge-hub/src/call_info.rs @@ -18,8 +18,8 @@ use bp_messages::MessageNonce; use codec::{Decode, Encode}; -use scale_info::TypeInfo; use pezsp_std::boxed::Box; +use scale_info::TypeInfo; use xcm::prelude::VersionedInteriorLocation; /// A minimized version of `pezpallet_xcm_bridge_hub::Call` that can be used without a runtime. diff --git a/pezbridges/primitives/xcm-bridge-hub/src/lib.rs b/pezbridges/primitives/xcm-bridge-hub/src/lib.rs index c08d2bed..44093dd4 100644 --- a/pezbridges/primitives/xcm-bridge-hub/src/lib.rs +++ b/pezbridges/primitives/xcm-bridge-hub/src/lib.rs @@ -20,18 +20,18 @@ #![cfg_attr(not(feature = "std"), no_std)] use bp_messages::LaneIdType; -use pezbp_runtime::{AccountIdOf, BalanceOf, Chain}; pub use call_info::XcmBridgeHubCall; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; +use pezbp_runtime::{AccountIdOf, BalanceOf, Chain}; use pezframe_support::{ ensure, pezsp_runtime::RuntimeDebug, CloneNoBound, PalletError, PartialEqNoBound, RuntimeDebugNoBound, }; -use scale_info::TypeInfo; -use serde::{Deserialize, Serialize}; use pezsp_core::H256; use pezsp_io::hashing::blake2_256; use pezsp_std::boxed::Box; +use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; use xcm::{ latest::prelude::*, prelude::XcmVersion, IntoVersion, VersionedInteriorLocation, VersionedLocation, diff --git a/pezbridges/relays/client-bizinikiwi/src/calls.rs b/pezbridges/relays/client-bizinikiwi/src/calls.rs index 7ef39d8e..71aa0bac 100644 --- a/pezbridges/relays/client-bizinikiwi/src/calls.rs +++ b/pezbridges/relays/client-bizinikiwi/src/calls.rs @@ -17,8 +17,8 @@ //! Basic runtime calls. use codec::{Decode, Encode}; -use scale_info::TypeInfo; use pezsp_std::{boxed::Box, vec::Vec}; +use scale_info::TypeInfo; use xcm::{VersionedLocation, VersionedXcm}; diff --git a/pezbridges/relays/client-bizinikiwi/src/chain.rs b/pezbridges/relays/client-bizinikiwi/src/chain.rs index 042f29aa..f5261b29 100644 --- a/pezbridges/relays/client-bizinikiwi/src/chain.rs +++ b/pezbridges/relays/client-bizinikiwi/src/chain.rs @@ -19,22 +19,22 @@ use crate::calls::UtilityCall; use crate::SimpleRuntimeVersion; use bp_header_pez_chain::ChainWithGrandpa as ChainWithGrandpaBase; use bp_messages::ChainWithMessages as ChainWithMessagesBase; +use codec::{Codec, Decode, Encode, MaxEncodedLen}; +use jsonrpsee::core::{DeserializeOwned, Serialize}; +use num_traits::Zero; use pezbp_runtime::{ Chain as ChainBase, EncodedOrDecodedCall, HashOf, Teyrchain as TeyrchainBase, TransactionEra, TransactionEraOf, UnderlyingChainProvider, }; -use codec::{Codec, Decode, Encode, MaxEncodedLen}; use pezframe_support::Parameter; -use jsonrpsee::core::{DeserializeOwned, Serialize}; -use num_traits::Zero; use pezsc_transaction_pool_api::TransactionStatus; -use scale_info::TypeInfo; use pezsp_core::{storage::StorageKey, Pair}; use pezsp_runtime::{ generic::SignedBlock, traits::{AtLeast32BitUnsigned, Block as BlockT, Member}, ConsensusEngineId, EncodedJustification, }; +use scale_info::TypeInfo; use std::{fmt::Debug, time::Duration}; /// Signed block type of given chain. @@ -128,8 +128,8 @@ pub type CallOf = ::Call; /// Transaction status of the chain. pub type TransactionStatusOf = TransactionStatus, HashOf>; -/// Bizinikiwi-based chain with `AccountData` generic argument of `pezframe_system::AccountInfo` set to -/// the `pezpallet_balances::AccountData`. +/// Bizinikiwi-based chain with `AccountData` generic argument of `pezframe_system::AccountInfo` set +/// to the `pezpallet_balances::AccountData`. pub trait ChainWithBalances: Chain { /// Return runtime storage key for getting `pezframe_system::AccountInfo` of given account. fn account_info_storage_key(account_id: &Self::AccountId) -> StorageKey; diff --git a/pezbridges/relays/client-bizinikiwi/src/client/caching.rs b/pezbridges/relays/client-bizinikiwi/src/client/caching.rs index 800ce07e..f806e892 100644 --- a/pezbridges/relays/client-bizinikiwi/src/client/caching.rs +++ b/pezbridges/relays/client-bizinikiwi/src/client/caching.rs @@ -32,9 +32,8 @@ use async_std::{ }; use async_trait::async_trait; use codec::Encode; -use pezframe_support::weights::Weight; use futures::{FutureExt, StreamExt}; -use quick_cache::unsync::Cache; +use pezframe_support::weights::Weight; use pezsp_consensus_grandpa::{AuthorityId, OpaqueKeyOwnershipProof, SetId}; use pezsp_core::{ storage::{StorageData, StorageKey}, @@ -43,6 +42,7 @@ use pezsp_core::{ use pezsp_runtime::{traits::Header as _, transaction_validity::TransactionValidity}; use pezsp_trie::StorageProof; use pezsp_version::RuntimeVersion; +use quick_cache::unsync::Cache; /// `quick_cache::unsync::Cache` wrapped in async-aware synchronization primitives. type SyncCache = Arc>>; diff --git a/pezbridges/relays/client-bizinikiwi/src/client/mod.rs b/pezbridges/relays/client-bizinikiwi/src/client/mod.rs index 1819d6ba..90263fda 100644 --- a/pezbridges/relays/client-bizinikiwi/src/client/mod.rs +++ b/pezbridges/relays/client-bizinikiwi/src/client/mod.rs @@ -20,8 +20,8 @@ use crate::{Chain, ConnectionParams}; use caching::CachingClient; use num_traits::Saturating; -use rpc::RpcClient; use pezsp_version::RuntimeVersion; +use rpc::RpcClient; pub mod caching; pub mod rpc; diff --git a/pezbridges/relays/client-bizinikiwi/src/client/rpc.rs b/pezbridges/relays/client-bizinikiwi/src/client/rpc.rs index 68f86f35..07a8fbc9 100644 --- a/pezbridges/relays/client-bizinikiwi/src/client/rpc.rs +++ b/pezbridges/relays/client-bizinikiwi/src/client/rpc.rs @@ -37,17 +37,16 @@ use crate::{ use async_std::sync::{Arc, Mutex, RwLock}; use async_trait::async_trait; -use pezbp_runtime::HeaderIdProvider; use codec::Encode; -use pezframe_support::weights::Weight; use futures::TryFutureExt; use jsonrpsee::{ core::{client::Subscription as RpcSubscription, ClientError}, ws_client::{WsClient, WsClientBuilder}, }; use num_traits::Zero; +use pezbp_runtime::HeaderIdProvider; +use pezframe_support::weights::Weight; use pezpallet_transaction_payment::RuntimeDispatchInfo; -use relay_utils::{relay_loop::RECONNECT_DELAY, STALL_TIMEOUT}; use pezsp_core::{ storage::{StorageData, StorageKey}, Bytes, Hasher, Pair, @@ -58,6 +57,7 @@ use pezsp_runtime::{ }; use pezsp_trie::StorageProof; use pezsp_version::RuntimeVersion; +use relay_utils::{relay_loop::RECONNECT_DELAY, STALL_TIMEOUT}; use std::{cmp::Ordering, future::Future, marker::PhantomData}; const MAX_SUBSCRIPTION_CAPACITY: usize = 4096; @@ -132,8 +132,8 @@ impl RpcClient { } } - /// Try to connect to Bizinikiwi node over websocket. Returns Bizinikiwi RPC client if connection - /// has been established or error otherwise. + /// Try to connect to Bizinikiwi node over websocket. Returns Bizinikiwi RPC client if + /// connection has been established or error otherwise. async fn try_connect(params: Arc) -> Result { let (tokio, client) = Self::build_client(¶ms).await?; diff --git a/pezbridges/relays/client-bizinikiwi/src/client/traits.rs b/pezbridges/relays/client-bizinikiwi/src/client/traits.rs index 31e099bb..319fda93 100644 --- a/pezbridges/relays/client-bizinikiwi/src/client/traits.rs +++ b/pezbridges/relays/client-bizinikiwi/src/client/traits.rs @@ -22,8 +22,8 @@ use crate::{ }; use async_trait::async_trait; -use pezbp_runtime::{StorageDoubleMapKeyProvider, StorageMapKeyProvider}; use codec::{Decode, Encode}; +use pezbp_runtime::{StorageDoubleMapKeyProvider, StorageMapKeyProvider}; use pezframe_support::weights::Weight; use pezsp_core::{ storage::{StorageData, StorageKey}, diff --git a/pezbridges/relays/client-bizinikiwi/src/error.rs b/pezbridges/relays/client-bizinikiwi/src/error.rs index 0a78d85e..096cfbb4 100644 --- a/pezbridges/relays/client-bizinikiwi/src/error.rs +++ b/pezbridges/relays/client-bizinikiwi/src/error.rs @@ -20,10 +20,10 @@ use crate::{BlockNumberOf, Chain, HashOf, SimpleRuntimeVersion}; use bp_header_pez_chain::SubmitFinalityProofCallExtras; use bp_pezkuwi_core::teyrchains::ParaId; use jsonrpsee::core::ClientError as RpcError; -use relay_utils::MaybeConnectionError; use pezsc_rpc_api::system::Health; use pezsp_core::{storage::StorageKey, Bytes}; use pezsp_runtime::transaction_validity::TransactionValidityError; +use relay_utils::MaybeConnectionError; use thiserror::Error; /// Result type used by Bizinikiwi client. diff --git a/pezbridges/relays/client-bizinikiwi/src/metrics/float_storage_value.rs b/pezbridges/relays/client-bizinikiwi/src/metrics/float_storage_value.rs index 5aba349f..1fbbf601 100644 --- a/pezbridges/relays/client-bizinikiwi/src/metrics/float_storage_value.rs +++ b/pezbridges/relays/client-bizinikiwi/src/metrics/float_storage_value.rs @@ -20,12 +20,12 @@ use async_std::sync::{Arc, RwLock}; use async_trait::async_trait; use codec::Decode; use num_traits::One; +use pezsp_core::storage::{StorageData, StorageKey}; +use pezsp_runtime::{traits::UniqueSaturatedInto, FixedPointNumber, FixedU128}; use relay_utils::metrics::{ metric_name, register, F64SharedRef, Gauge, Metric, PrometheusError, Registry, StandaloneMetric, F64, }; -use pezsp_core::storage::{StorageData, StorageKey}; -use pezsp_runtime::{traits::UniqueSaturatedInto, FixedPointNumber, FixedU128}; use std::{marker::PhantomData, time::Duration}; /// Storage value update interval (in blocks). diff --git a/pezbridges/relays/client-bizinikiwi/src/test_chain.rs b/pezbridges/relays/client-bizinikiwi/src/test_chain.rs index 71ca5c9c..d2a8276d 100644 --- a/pezbridges/relays/client-bizinikiwi/src/test_chain.rs +++ b/pezbridges/relays/client-bizinikiwi/src/test_chain.rs @@ -26,8 +26,8 @@ use crate::{ Error as BizinikiwiError, SignParam, UnsignedTransaction, }; use bp_messages::{ChainWithMessages as ChainWithMessagesBase, MessageNonce}; -use pezbp_runtime::ChainId; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; +use pezbp_runtime::ChainId; use pezframe_support::{pezsp_runtime::StateVersion, weights::Weight}; use scale_info::TypeInfo; use std::time::Duration; diff --git a/pezbridges/relays/client-bizinikiwi/src/transaction_tracker.rs b/pezbridges/relays/client-bizinikiwi/src/transaction_tracker.rs index fed5fea6..bcd849e4 100644 --- a/pezbridges/relays/client-bizinikiwi/src/transaction_tracker.rs +++ b/pezbridges/relays/client-bizinikiwi/src/transaction_tracker.rs @@ -20,8 +20,8 @@ use crate::{Chain, Error, HashOf, HeaderIdOf, Subscription, TransactionStatusOf} use async_trait::async_trait; use futures::{future::Either, Future, FutureExt, Stream, StreamExt}; -use relay_utils::{HeaderId, TrackedTransactionStatus}; use pezsp_runtime::traits::Header as _; +use relay_utils::{HeaderId, TrackedTransactionStatus}; use std::time::Duration; /// Transaction tracker environment. diff --git a/pezbridges/relays/equivocation/src/block_checker.rs b/pezbridges/relays/equivocation/src/block_checker.rs index 582669a7..6fab38bc 100644 --- a/pezbridges/relays/equivocation/src/block_checker.rs +++ b/pezbridges/relays/equivocation/src/block_checker.rs @@ -20,9 +20,9 @@ use crate::{ }; use bp_header_pez_chain::{FinalityProof, FindEquivocations as FindEquivocationsT}; -use pez_finality_relay::FinalityProofsBuf; use futures::future::{BoxFuture, FutureExt}; use num_traits::Saturating; +use pez_finality_relay::FinalityProofsBuf; /// First step in the block checking state machine. /// diff --git a/pezbridges/relays/equivocation/src/equivocation_loop.rs b/pezbridges/relays/equivocation/src/equivocation_loop.rs index 33c6c40d..99f59fd7 100644 --- a/pezbridges/relays/equivocation/src/equivocation_loop.rs +++ b/pezbridges/relays/equivocation/src/equivocation_loop.rs @@ -20,9 +20,9 @@ use crate::{ }; use crate::block_checker::BlockChecker; -use pez_finality_relay::{FinalityProofsBuf, FinalityProofsStream}; use futures::{select_biased, FutureExt}; use num_traits::Saturating; +use pez_finality_relay::{FinalityProofsBuf, FinalityProofsStream}; use relay_utils::{metrics::MetricsParams, FailedClient}; use std::{future::Future, time::Duration}; diff --git a/pezbridges/relays/equivocation/src/mock.rs b/pezbridges/relays/equivocation/src/mock.rs index c01cfd07..7100acff 100644 --- a/pezbridges/relays/equivocation/src/mock.rs +++ b/pezbridges/relays/equivocation/src/mock.rs @@ -19,8 +19,8 @@ use crate::{EquivocationDetectionPipeline, HeaderFinalityInfo, SourceClient, TargetClient}; use async_trait::async_trait; use bp_header_pez_chain::{FinalityProof, FindEquivocations}; -use pez_finality_relay::{FinalityPipeline, SourceClientBase}; use futures::{Stream, StreamExt}; +use pez_finality_relay::{FinalityPipeline, SourceClientBase}; use relay_utils::{ relay_loop::Client as RelayClient, HeaderId, MaybeConnectionError, TrackedTransactionStatus, TransactionTracker, diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/bridge.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/bridge.rs index 1ac79b41..66d74b46 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/bridge.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/bridge.rs @@ -19,7 +19,7 @@ use crate::{ equivocation::BizinikiwiEquivocationDetectionPipeline, finality::BizinikiwiFinalitySyncPipeline, - messages::{MessagesRelayLimits, BizinikiwiMessageLane}, + messages::{BizinikiwiMessageLane, MessagesRelayLimits}, teyrchains::BizinikiwiTeyrchainsPipeline, }; use bp_teyrchains::{RelayBlockHash, RelayBlockHasher, RelayBlockNumber}; diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/init_bridge.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/init_bridge.rs index 2c948fc0..cbcf177a 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/init_bridge.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/init_bridge.rs @@ -23,10 +23,10 @@ use crate::{ cli::{bridge::CliBridgeBase, chain_schema::*}, finality_base::engine::Engine, }; -use pezbp_runtime::Chain as ChainBase; use clap::Parser; -use relay_bizinikiwi_client::{AccountKeyPairOf, Chain, UnsignedTransaction}; +use pezbp_runtime::Chain as ChainBase; use pezsp_core::Pair; +use relay_bizinikiwi_client::{AccountKeyPairOf, Chain, UnsignedTransaction}; /// Bridge initialization params. #[derive(Parser)] diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/mod.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/mod.rs index 5e3e940a..5621ddce 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/mod.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/mod.rs @@ -17,8 +17,8 @@ //! Deal with CLI args of bizinikiwi-to-bizinikiwi relay. use clap::Parser; -use rbtag::BuildInfo; use pezsp_runtime::traits::TryConvert; +use rbtag::BuildInfo; use std::str::FromStr; pub mod bridge; diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/mod.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/mod.rs index 0922bf99..c705a9fd 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/mod.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/mod.rs @@ -46,13 +46,13 @@ use crate::{ HeadersToRelay, TaggedAccount, TransactionParams, }; use pezbp_runtime::BalanceOf; +use pezsp_core::Pair; +use pezsp_runtime::traits::TryConvert; use relay_bizinikiwi_client::{ AccountIdOf, AccountKeyPairOf, Chain, ChainWithBalances, ChainWithMessages, ChainWithRuntimeVersion, ChainWithTransactions, }; use relay_utils::metrics::MetricsParams; -use pezsp_core::Pair; -use pezsp_runtime::traits::TryConvert; /// Parameters that have the same names across all bridges. #[derive(Debug, PartialEq, Parser)] diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/relay_to_relay.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/relay_to_relay.rs index 71e80ffe..a5266e50 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/relay_to_relay.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/relay_to_relay.rs @@ -31,10 +31,10 @@ use crate::{ finality::BizinikiwiFinalitySyncPipeline, on_demand::{headers::OnDemandHeadersRelay, OnDemandRelay}, }; +use pezsp_core::Pair; use relay_bizinikiwi_client::{ AccountIdOf, AccountKeyPairOf, ChainWithRuntimeVersion, ChainWithTransactions, Client, }; -use pezsp_core::Pair; /// A base relay between two standalone (relay) chains. /// diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/relay_to_teyrchain.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/relay_to_teyrchain.rs index 8feb1c04..8e6f58b5 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/relay_to_teyrchain.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/relay_to_teyrchain.rs @@ -35,11 +35,11 @@ use crate::{ }; use bp_pezkuwi_core::teyrchains::ParaHash; use bp_teyrchains::{RelayBlockHash, RelayBlockHasher, RelayBlockNumber}; +use pezsp_core::Pair; use relay_bizinikiwi_client::{ AccountIdOf, AccountKeyPairOf, Chain, ChainWithRuntimeVersion, ChainWithTransactions, Client, Teyrchain, }; -use pezsp_core::Pair; /// A base relay between standalone (relay) chain and a teyrchain from another consensus system. /// diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/teyrchain_to_teyrchain.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/teyrchain_to_teyrchain.rs index c617b4ea..16c8719a 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/teyrchain_to_teyrchain.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_headers_and_messages/teyrchain_to_teyrchain.rs @@ -32,11 +32,11 @@ use crate::{ }; use bp_pezkuwi_core::teyrchains::ParaHash; use bp_teyrchains::{RelayBlockHash, RelayBlockHasher, RelayBlockNumber}; +use pezsp_core::Pair; use relay_bizinikiwi_client::{ AccountIdOf, AccountKeyPairOf, Chain, ChainWithRuntimeVersion, ChainWithTransactions, Client, Teyrchain, }; -use pezsp_core::Pair; /// A base relay between two teyrchain from different consensus systems. /// diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_messages.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_messages.rs index faeb1011..c630659b 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_messages.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_messages.rs @@ -28,12 +28,12 @@ use pezsp_core::Pair; use bp_messages::MessageNonce; use pezbp_runtime::HeaderIdProvider; +use pezsp_runtime::traits::TryConvert; use relay_bizinikiwi_client::{ AccountIdOf, AccountKeyPairOf, BalanceOf, Chain, ChainWithRuntimeVersion, ChainWithTransactions, Client, }; use relay_utils::UniqueSaturatedInto; -use pezsp_runtime::traits::TryConvert; /// Messages relaying params. #[derive(Parser)] diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_teyrchains.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_teyrchains.rs index da48e3c7..ee9789e7 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_teyrchains.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/cli/relay_teyrchains.rs @@ -19,8 +19,8 @@ use async_std::sync::Mutex; use async_trait::async_trait; use bp_pezkuwi_core::BlockNumber as RelayBlockNumber; -use pezbp_runtime::HeaderIdProvider; use clap::Parser; +use pezbp_runtime::HeaderIdProvider; use relay_bizinikiwi_client::{Client, Teyrchain}; use relay_utils::metrics::{GlobalMetrics, StandaloneMetric}; use std::sync::Arc; diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/equivocation/mod.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/equivocation/mod.rs index 80442232..dabb95a5 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/equivocation/mod.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/equivocation/mod.rs @@ -27,14 +27,14 @@ use crate::{ }; use async_trait::async_trait; -use pezbp_runtime::{AccountIdOf, BlockNumberOf, HashOf}; use pez_equivocation_detector::EquivocationDetectionPipeline; use pez_finality_relay::FinalityPipeline; +use pezbp_runtime::{AccountIdOf, BlockNumberOf, HashOf}; use pezpallet_grandpa::{Call as GrandpaCall, Config as GrandpaConfig}; -use relay_bizinikiwi_client::{AccountKeyPairOf, CallOf, Chain, ChainWithTransactions, Client}; -use relay_utils::metrics::MetricsParams; use pezsp_core::Pair; use pezsp_runtime::traits::{Block, Header}; +use relay_bizinikiwi_client::{AccountKeyPairOf, CallOf, Chain, ChainWithTransactions, Client}; +use relay_utils::metrics::MetricsParams; use std::marker::PhantomData; /// Convenience trait that adds bounds to `BizinikiwiEquivocationDetectionPipeline`. diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/equivocation/source.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/equivocation/source.rs index b6b94167..e6d8118a 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/equivocation/source.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/equivocation/source.rs @@ -18,17 +18,17 @@ use crate::{ equivocation::{ - EquivocationDetectionPipelineAdapter, EquivocationProofOf, ReportEquivocationCallBuilder, - BizinikiwiEquivocationDetectionPipeline, + BizinikiwiEquivocationDetectionPipeline, EquivocationDetectionPipelineAdapter, + EquivocationProofOf, ReportEquivocationCallBuilder, }, finality_base::{engine::Engine, finality_proofs, BizinikiwiFinalityProofsStream}, TransactionParams, }; use async_trait::async_trait; -use pezbp_runtime::{HashOf, TransactionEra}; use pez_equivocation_detector::SourceClient; use pez_finality_relay::SourceClientBase; +use pezbp_runtime::{HashOf, TransactionEra}; use relay_bizinikiwi_client::{ AccountKeyPairOf, Client, Error, TransactionTracker, UnsignedTransaction, }; diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/equivocation/target.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/equivocation/target.rs index e230cb81..4e094694 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/equivocation/target.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/equivocation/target.rs @@ -18,19 +18,19 @@ use crate::{ equivocation::{ - EquivocationDetectionPipelineAdapter, FinalityProoffOf, FinalityVerificationContextfOf, - BizinikiwiEquivocationDetectionPipeline, + BizinikiwiEquivocationDetectionPipeline, EquivocationDetectionPipelineAdapter, + FinalityProoffOf, FinalityVerificationContextfOf, }, finality_base::{best_synced_header_id, engine::Engine}, }; use async_trait::async_trait; use bp_header_pez_chain::HeaderFinalityInfo; -use pezbp_runtime::{BlockNumberOf, HashOf}; use pez_equivocation_detector::TargetClient; +use pezbp_runtime::{BlockNumberOf, HashOf}; +use pezsp_runtime::traits::Header; use relay_bizinikiwi_client::{Client, Error}; use relay_utils::relay_loop::Client as RelayClient; -use pezsp_runtime::traits::Header; use std::marker::PhantomData; /// Bizinikiwi node as equivocation source. diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/error.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/error.rs index 809bc16e..a2cf6348 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/error.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/error.rs @@ -16,9 +16,9 @@ //! Relay errors. -use relay_bizinikiwi_client as client; use pezsp_consensus_grandpa::AuthorityList; use pezsp_runtime::traits::MaybeDisplay; +use relay_bizinikiwi_client as client; use std::fmt::Debug; use thiserror::Error; diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/finality/initialize.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/finality/initialize.rs index 95836852..cb9f324c 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/finality/initialize.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/finality/initialize.rs @@ -25,12 +25,12 @@ use crate::{error::Error, finality_base::engine::Engine}; use pezsp_core::Pair; use pezbp_runtime::HeaderIdOf; +use pezsp_runtime::traits::Header as HeaderT; use relay_bizinikiwi_client::{ AccountKeyPairOf, Chain, ChainWithTransactions, Client, Error as BizinikiwiError, UnsignedTransaction, }; use relay_utils::{TrackedTransactionStatus, TransactionTracker}; -use pezsp_runtime::traits::Header as HeaderT; /// Submit headers-bridge initialization transaction. pub async fn initialize< diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/finality/mod.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/finality/mod.rs index 5f82b11e..7c2df4cd 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/finality/mod.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/finality/mod.rs @@ -29,12 +29,12 @@ use pez_finality_relay::{ FinalityPipeline, FinalitySyncPipeline, HeadersToRelay, SourceClient, TargetClient, }; use pezpallet_bridge_grandpa::{Call as BridgeGrandpaCall, Config as BridgeGrandpaConfig}; +use pezsp_core::Pair; use relay_bizinikiwi_client::{ transaction_stall_timeout, AccountIdOf, AccountKeyPairOf, BlockNumberOf, CallOf, Chain, ChainWithTransactions, Client, HashOf, HeaderOf, SyncHeader, }; use relay_utils::{metrics::MetricsParams, TrackedTransactionStatus, TransactionTracker}; -use pezsp_core::Pair; use std::{fmt::Debug, marker::PhantomData}; pub mod initialize; diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/finality/source.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/finality/source.rs index 63e97425..f6bb51df 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/finality/source.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/finality/source.rs @@ -17,7 +17,7 @@ //! Default generic implementation of finality source for basic Bizinikiwi client. use crate::{ - finality::{FinalitySyncPipelineAdapter, BizinikiwiFinalitySyncPipeline}, + finality::{BizinikiwiFinalitySyncPipeline, FinalitySyncPipelineAdapter}, finality_base::{ engine::Engine, finality_proofs, BizinikiwiFinalityProof, BizinikiwiFinalityProofsStream, }, @@ -27,12 +27,12 @@ use async_std::sync::{Arc, Mutex}; use async_trait::async_trait; use bp_header_pez_chain::FinalityProof; use codec::Decode; -use pez_finality_relay::{SourceClient, SourceClientBase}; use futures::{ select, stream::{try_unfold, Stream, StreamExt, TryStreamExt}, }; use num_traits::One; +use pez_finality_relay::{SourceClient, SourceClientBase}; use relay_bizinikiwi_client::{BlockNumberOf, BlockWithJustification, Client, Error, HeaderOf}; use relay_utils::{relay_loop::Client as RelayClient, UniqueSaturatedInto}; diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/finality/target.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/finality/target.rs index ed31fd2e..2f99b49d 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/finality/target.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/finality/target.rs @@ -18,22 +18,22 @@ use crate::{ finality::{ - FinalitySyncPipelineAdapter, SubmitFinalityProofCallBuilder, BizinikiwiFinalitySyncPipeline, + BizinikiwiFinalitySyncPipeline, FinalitySyncPipelineAdapter, SubmitFinalityProofCallBuilder, }, finality_base::{best_synced_header_id, engine::Engine, BizinikiwiFinalityProof}, TransactionParams, }; use async_trait::async_trait; -use pezbp_runtime::BlockNumberOf; use pez_finality_relay::TargetClient; +use pezbp_runtime::BlockNumberOf; +use pezsp_core::Pair; +use pezsp_runtime::traits::Header; use relay_bizinikiwi_client::{ AccountIdOf, AccountKeyPairOf, Chain, Client, Error, HeaderIdOf, HeaderOf, SyncHeader, TransactionEra, TransactionTracker, UnsignedTransaction, }; use relay_utils::relay_loop::Client as RelayClient; -use pezsp_core::Pair; -use pezsp_runtime::traits::Header; /// Bizinikiwi client as Bizinikiwi finality target. pub struct BizinikiwiFinalityTarget { diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/finality_base/engine.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/finality_base/engine.rs index e11c0eec..e2defb22 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/finality_base/engine.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/finality_base/engine.rs @@ -26,17 +26,17 @@ use bp_header_pez_chain::{ AuthoritySet, ConsensusLogReader, FinalityProof, FindEquivocations, GrandpaConsensusLogReader, HeaderFinalityInfo, HeaderGrandpaInfo, StoredHeaderGrandpaInfo, SubmitFinalityProofCallExtras, }; -use pezbp_runtime::{BasicOperatingMode, HeaderIdProvider, OperatingMode}; use codec::{Decode, Encode}; use futures::stream::StreamExt; use num_traits::{One, Zero}; +use pezbp_runtime::{BasicOperatingMode, HeaderIdProvider, OperatingMode}; +use pezsp_consensus_grandpa::{AuthorityList as GrandpaAuthoritiesSet, GRANDPA_ENGINE_ID}; +use pezsp_core::{storage::StorageKey, Bytes}; +use pezsp_runtime::{scale_info::TypeInfo, traits::Header, ConsensusEngineId}; use relay_bizinikiwi_client::{ BlockNumberOf, Chain, ChainWithGrandpa, Client, Error as BizinikiwiError, HashOf, HeaderOf, Subscription, }; -use pezsp_consensus_grandpa::{AuthorityList as GrandpaAuthoritiesSet, GRANDPA_ENGINE_ID}; -use pezsp_core::{storage::StorageKey, Bytes}; -use pezsp_runtime::{scale_info::TypeInfo, traits::Header, ConsensusEngineId}; use std::{fmt::Debug, marker::PhantomData}; /// Finality engine, used by the Bizinikiwi chain. @@ -185,7 +185,8 @@ impl Engine for Grandpa { type ConsensusLogReader = GrandpaConsensusLogReader<::Number>; type FinalityProof = GrandpaJustification>; type FinalityVerificationContext = JustificationVerificationContext; - type EquivocationProof = pezsp_consensus_grandpa::EquivocationProof, BlockNumberOf>; + type EquivocationProof = + pezsp_consensus_grandpa::EquivocationProof, BlockNumberOf>; type EquivocationsFinder = GrandpaEquivocationsFinder; type KeyOwnerProof = C::KeyOwnerProof; type InitializationData = bp_header_pez_chain::InitializationData; @@ -196,7 +197,9 @@ impl Engine for Grandpa { } fn pezpallet_operating_mode_key() -> StorageKey { - bp_header_pez_chain::storage_keys::pezpallet_operating_mode_key(C::WITH_CHAIN_GRANDPA_PALLET_NAME) + bp_header_pez_chain::storage_keys::pezpallet_operating_mode_key( + C::WITH_CHAIN_GRANDPA_PALLET_NAME, + ) } async fn source_finality_proofs( @@ -247,8 +250,8 @@ impl Engine for Grandpa { source_client: impl Client, ) -> Result, BlockNumberOf>> { // In ideal world we just need to get best finalized header and then to read GRANDPA - // authorities set (`pezpallet_grandpa::CurrentSetId` + `GrandpaApi::grandpa_authorities()`) at - // this header. + // authorities set (`pezpallet_grandpa::CurrentSetId` + `GrandpaApi::grandpa_authorities()`) + // at this header. // // But now there are problems with this approach - `CurrentSetId` may return invalid value. // So here we're waiting for the next justification, read the authorities set and then try @@ -369,9 +372,10 @@ impl Engine for Grandpa { target_client: &impl Client, at: HashOf, ) -> Result { - let current_authority_set_key = bp_header_pez_chain::storage_keys::current_authority_set_key( - C::WITH_CHAIN_GRANDPA_PALLET_NAME, - ); + let current_authority_set_key = + bp_header_pez_chain::storage_keys::current_authority_set_key( + C::WITH_CHAIN_GRANDPA_PALLET_NAME, + ); let authority_set: AuthoritySet = target_client .storage_value(at, current_authority_set_key) .await? diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/finality_base/mod.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/finality_base/mod.rs index 15fee46f..ec70882b 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/finality_base/mod.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/finality_base/mod.rs @@ -22,9 +22,9 @@ pub mod engine; use crate::finality_base::engine::Engine; use async_trait::async_trait; -use pezbp_runtime::{HashOf, HeaderIdOf}; use codec::Decode; use futures::{stream::unfold, Stream, StreamExt}; +use pezbp_runtime::{HashOf, HeaderIdOf}; use relay_bizinikiwi_client::{Chain, Client, Error}; use std::{fmt::Debug, pin::Pin}; @@ -40,9 +40,10 @@ pub trait BizinikiwiFinalityPipeline: 'static + Clone + Debug + Send + Sync { } /// Bizinikiwi finality proof. Specific to the used `FinalityEngine`. -pub type BizinikiwiFinalityProof

= <

::FinalityEngine as Engine< -

::SourceChain, ->>::FinalityProof; +pub type BizinikiwiFinalityProof

= + <

::FinalityEngine as Engine< +

::SourceChain, + >>::FinalityProof; /// Bizinikiwi finality proofs stream. pub type BizinikiwiFinalityProofsStream

= diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/lib.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/lib.rs index 84b6809a..fcb81e09 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/lib.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/lib.rs @@ -131,8 +131,8 @@ impl BatchCallBuilder for () { /// Module for handling storage proofs compatibility. pub mod proofs { use pezbp_runtime::{HashOf, RawStorageProof}; - use relay_bizinikiwi_client::Chain; use pezsp_trie::StorageProof; + use relay_bizinikiwi_client::Chain; /// Converts proof to `RawStorageProof` type. pub fn to_raw_storage_proof( diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/messages/metrics.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/messages/metrics.rs index f0f00aa9..7ff9e937 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/messages/metrics.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/messages/metrics.rs @@ -20,17 +20,17 @@ use crate::TaggedAccount; use bp_relayers::{RewardsAccountOwner, RewardsAccountParams}; use codec::{Decode, EncodeLike}; -use pezframe_system::AccountInfo; use pez_messages_relay::Labeled; +use pezframe_system::AccountInfo; use pezpallet_balances::AccountData; +use pezsp_core::storage::StorageData; +use pezsp_runtime::{FixedPointNumber, FixedU128}; use relay_bizinikiwi_client::{ metrics::{FixedU128OrOne, FloatStorageValue, FloatStorageValueMetric}, AccountIdOf, BalanceOf, Chain, ChainWithBalances, ChainWithMessages, ChainWithRewards, Client, Error as BizinikiwiError, NonceOf, }; use relay_utils::metrics::{MetricsParams, StandaloneMetric}; -use pezsp_core::storage::StorageData; -use pezsp_runtime::{FixedPointNumber, FixedU128}; use std::{fmt::Debug, marker::PhantomData}; /// Add relay accounts balance metrics. diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/messages/mod.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/messages/mod.rs index fb1f454f..0291a01f 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/messages/mod.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/messages/mod.rs @@ -29,11 +29,15 @@ use async_std::sync::Arc; use bp_messages::{ target_chain::FromBridgedChainMessagesProof, ChainWithMessages as _, MessageNonce, }; -use pezbp_runtime::{AccountIdOf, EncodedOrDecodedCall, HeaderIdOf, TransactionEra, WeightExtraOps}; use codec::{Codec, Encode, EncodeLike}; -use pezframe_support::{dispatch::GetDispatchInfo, weights::Weight}; use pez_messages_relay::{message_lane::MessageLane, message_lane_loop::BatchTransaction, Labeled}; +use pezbp_runtime::{ + AccountIdOf, EncodedOrDecodedCall, HeaderIdOf, TransactionEra, WeightExtraOps, +}; +use pezframe_support::{dispatch::GetDispatchInfo, weights::Weight}; use pezpallet_bridge_messages::{Call as BridgeMessagesCall, Config as BridgeMessagesConfig}; +use pezsp_core::Pair; +use pezsp_runtime::traits::Zero; use relay_bizinikiwi_client::{ transaction_stall_timeout, AccountKeyPairOf, BalanceOf, BlockNumberOf, CallOf, Chain, ChainBase, ChainWithMessages, ChainWithTransactions, Client, Error as BizinikiwiError, HashOf, @@ -43,8 +47,6 @@ use relay_utils::{ metrics::{GlobalMetrics, MetricsParams, StandaloneMetric}, STALL_TIMEOUT, }; -use pezsp_core::Pair; -use pezsp_runtime::traits::Zero; use std::{fmt::Debug, marker::PhantomData, ops::RangeInclusive}; pub mod metrics; @@ -291,8 +293,8 @@ where .map_err(Into::into) } -/// Deliver range of Bizinikiwi-to-Bizinikiwi messages. No checks are made to ensure that transaction -/// will succeed. +/// Deliver range of Bizinikiwi-to-Bizinikiwi messages. No checks are made to ensure that +/// transaction will succeed. pub async fn relay_messages_range( source_client: impl Client, target_client: impl Client, @@ -396,8 +398,10 @@ where P: BizinikiwiMessageLane, R: BridgeMessagesConfig, I: 'static, - R::BridgedChain: - pezbp_runtime::Chain, Hash = HashOf>, + R::BridgedChain: pezbp_runtime::Chain< + AccountId = AccountIdOf, + Hash = HashOf, + >, CallOf: From> + GetDispatchInfo, { fn build_receive_messages_proof_call( diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/messages/source.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/messages/source.rs index 1ed837a4..c04c6e70 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/messages/source.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/messages/source.rs @@ -21,8 +21,8 @@ use crate::{ finality_base::best_synced_header_id, messages::{ - BatchProofTransaction, MessageLaneAdapter, ReceiveMessagesDeliveryProofCallBuilder, - BizinikiwiMessageLane, + BatchProofTransaction, BizinikiwiMessageLane, MessageLaneAdapter, + ReceiveMessagesDeliveryProofCallBuilder, }, on_demand::OnDemandRelay, proofs::to_raw_storage_proof, @@ -37,9 +37,8 @@ use bp_messages::{ ChainWithMessages as _, InboundMessageDetails, MessageNonce, MessagePayload, MessagesOperatingMode, OutboundMessageDetails, }; -use pezbp_runtime::{BasicOperatingMode, HeaderIdProvider, RangeInclusiveExt}; use codec::{Decode, Encode}; -use pezframe_support::weights::Weight; +use num_traits::Zero; use pez_messages_relay::{ message_lane::{MessageLane, SourceHeaderIdOf, TargetHeaderIdOf}, message_lane_loop::{ @@ -47,14 +46,15 @@ use pez_messages_relay::{ SourceClientState, }, }; -use num_traits::Zero; +use pezbp_runtime::{BasicOperatingMode, HeaderIdProvider, RangeInclusiveExt}; +use pezframe_support::weights::Weight; +use pezsp_core::Pair; use relay_bizinikiwi_client::{ AccountIdOf, AccountKeyPairOf, BalanceOf, Chain, ChainWithMessages, Client, Error as BizinikiwiError, HashOf, HeaderIdOf, TransactionEra, TransactionTracker, UnsignedTransaction, }; use relay_utils::relay_loop::Client as RelayClient; -use pezsp_core::Pair; use std::ops::RangeInclusive; /// Intermediate message proof returned by the source Bizinikiwi node. Includes everything diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/messages/target.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/messages/target.rs index 1e49f649..fbbb352a 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/messages/target.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/messages/target.rs @@ -24,8 +24,8 @@ use crate::{ ensure_messages_pallet_active, read_client_state_from_both_chains, BizinikiwiMessagesProof, }, - BatchProofTransaction, MessageLaneAdapter, ReceiveMessagesProofCallBuilder, - BizinikiwiMessageLane, + BatchProofTransaction, BizinikiwiMessageLane, MessageLaneAdapter, + ReceiveMessagesProofCallBuilder, }, on_demand::OnDemandRelay, proofs::to_raw_storage_proof, @@ -43,12 +43,12 @@ use pez_messages_relay::{ message_lane::{MessageLane, SourceHeaderIdOf, TargetHeaderIdOf}, message_lane_loop::{NoncesSubmitArtifacts, TargetClient, TargetClientState}, }; +use pezsp_core::Pair; use relay_bizinikiwi_client::{ AccountIdOf, AccountKeyPairOf, BalanceOf, CallOf, Chain, Client, Error as BizinikiwiError, HashOf, TransactionEra, TransactionTracker, UnsignedTransaction, }; use relay_utils::relay_loop::Client as RelayClient; -use pezsp_core::Pair; use std::{collections::VecDeque, convert::TryFrom, ops::RangeInclusive}; /// Message receiving proof returned by the target Bizinikiwi node. diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/on_demand/headers.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/on_demand/headers.rs index 77b068b9..d9958d22 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/on_demand/headers.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/on_demand/headers.rs @@ -21,12 +21,14 @@ use crate::finality::SubmitFinalityProofCallBuilder; use async_std::sync::{Arc, Mutex}; use async_trait::async_trait; use bp_header_pez_chain::ConsensusLogReader; -use pezbp_runtime::HeaderIdProvider; use futures::{select, FutureExt}; use num_traits::{One, Saturating, Zero}; +use pezbp_runtime::HeaderIdProvider; use pezsp_runtime::traits::Header; -use pez_finality_relay::{FinalitySyncParams, HeadersToRelay, TargetClient as FinalityTargetClient}; +use pez_finality_relay::{ + FinalitySyncParams, HeadersToRelay, TargetClient as FinalityTargetClient, +}; use relay_bizinikiwi_client::{ AccountIdOf, AccountKeyPairOf, BlockNumberOf, CallOf, Chain, Client, Error as BizinikiwiError, HeaderIdOf, @@ -38,7 +40,7 @@ use relay_utils::{ use crate::{ finality::{ - source::{RequiredHeaderNumberRef, BizinikiwiFinalitySource}, + source::{BizinikiwiFinalitySource, RequiredHeaderNumberRef}, target::BizinikiwiFinalityTarget, BizinikiwiFinalitySyncPipeline, RECENT_FINALITY_PROOFS_LIMIT, }, @@ -212,7 +214,8 @@ async fn background_task( required_header_number: RequiredHeaderNumberRef, metrics_params: Option, ) where - AccountIdOf: From< as pezsp_core::Pair>::Public>, + AccountIdOf: + From< as pezsp_core::Pair>::Public>, { let relay_task_name = on_demand_headers_relay_name::(); let target_transactions_mortality = target_transaction_params.mortality; @@ -493,7 +496,8 @@ async fn best_finalized_source_header_at_target( where P: BizinikiwiFinalitySyncPipeline, TargetClnt: Client, - AccountIdOf: From< as pezsp_core::Pair>::Public>, + AccountIdOf: + From< as pezsp_core::Pair>::Public>, { finality_target .best_finalized_source_block_id() diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/on_demand/teyrchains.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/on_demand/teyrchains.rs index 8d9b2192..c2155e89 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/on_demand/teyrchains.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/on_demand/teyrchains.rs @@ -20,8 +20,8 @@ use crate::{ messages::source::best_finalized_peer_header_at_self, on_demand::OnDemandRelay, teyrchains::{ - source::TeyrchainsSource, target::TeyrchainsTarget, SubmitTeyrchainHeadsCallBuilder, - BizinikiwiTeyrchainsPipeline, TeyrchainsPipelineAdapter, + source::TeyrchainsSource, target::TeyrchainsTarget, BizinikiwiTeyrchainsPipeline, + SubmitTeyrchainHeadsCallBuilder, TeyrchainsPipelineAdapter, }, TransactionParams, }; @@ -32,10 +32,10 @@ use async_std::{ }; use async_trait::async_trait; use bp_pezkuwi_core::teyrchains::{ParaHash, ParaId}; -use pezbp_runtime::HeaderIdProvider; use bp_teyrchains::{RelayBlockHash, RelayBlockHasher, RelayBlockNumber}; use futures::{select, FutureExt}; use num_traits::Zero; +use pezbp_runtime::HeaderIdProvider; use relay_bizinikiwi_client::{ is_ancient_block, AccountIdOf, AccountKeyPairOf, BlockNumberOf, CallOf, Chain, Client, Error as BizinikiwiError, HashOf, HeaderIdOf, TeyrchainBase, @@ -247,7 +247,8 @@ async fn background_task( P::SourceTeyrchain: Chain, P::SourceRelayChain: Chain, - AccountIdOf: From< as pezsp_core::Pair>::Public>, + AccountIdOf: + From< as pezsp_core::Pair>::Public>, { let relay_task_name = on_demand_teyrchains_relay_name::(); let target_transactions_mortality = target_transaction_params.mortality; diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/teyrchains/source.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/teyrchains/source.rs index e846d871..2a22a14f 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/teyrchains/source.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/teyrchains/source.rs @@ -23,9 +23,9 @@ use crate::{ use async_std::sync::{Arc, Mutex}; use async_trait::async_trait; use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHead, ParaHeadsProof, ParaId}; -use pezbp_runtime::HeaderIdProvider; use bp_teyrchains::teyrchain_head_storage_key_at_source; use codec::Decode; +use pezbp_runtime::HeaderIdProvider; use relay_bizinikiwi_client::{ is_ancient_block, Chain, Client, Error as BizinikiwiError, HeaderIdOf, HeaderOf, RelayChain, TeyrchainBase, diff --git a/pezbridges/relays/lib-bizinikiwi-relay/src/teyrchains/target.rs b/pezbridges/relays/lib-bizinikiwi-relay/src/teyrchains/target.rs index 3068af32..4889a937 100644 --- a/pezbridges/relays/lib-bizinikiwi-relay/src/teyrchains/target.rs +++ b/pezbridges/relays/lib-bizinikiwi-relay/src/teyrchains/target.rs @@ -18,7 +18,7 @@ use crate::{ teyrchains::{ - SubmitTeyrchainHeadsCallBuilder, BizinikiwiTeyrchainsPipeline, TeyrchainsPipelineAdapter, + BizinikiwiTeyrchainsPipeline, SubmitTeyrchainHeadsCallBuilder, TeyrchainsPipelineAdapter, }, TransactionParams, }; @@ -28,20 +28,20 @@ use bp_pezkuwi_core::{ teyrchains::{ParaHash, ParaHeadsProof, ParaId}, BlockNumber as RelayBlockNumber, }; +use bp_teyrchains::{ + ImportedParaHeadsKeyProvider, ParaInfo, ParaStoredHeaderData, ParasInfoKeyProvider, +}; use pezbp_runtime::{ Chain as ChainBase, HeaderId, HeaderIdProvider, StorageDoubleMapKeyProvider, StorageMapKeyProvider, }; -use bp_teyrchains::{ - ImportedParaHeadsKeyProvider, ParaInfo, ParaStoredHeaderData, ParasInfoKeyProvider, -}; +use pezsp_core::Pair; +use pezsp_runtime::traits::Header; use relay_bizinikiwi_client::{ AccountIdOf, AccountKeyPairOf, BlockNumberOf, Chain, Client, Error as BizinikiwiError, HeaderIdOf, RelayChain, TeyrchainBase, TransactionEra, TransactionTracker, UnsignedTransaction, }; use relay_utils::relay_loop::Client as RelayClient; -use pezsp_core::Pair; -use pezsp_runtime::traits::Header; use teyrchains_relay::teyrchains_loop::TargetClient; /// Bizinikiwi client as teyrchain heads source. diff --git a/pezbridges/relays/messages/src/lib.rs b/pezbridges/relays/messages/src/lib.rs index f5636a71..b69c80b8 100644 --- a/pezbridges/relays/messages/src/lib.rs +++ b/pezbridges/relays/messages/src/lib.rs @@ -14,8 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity Bridges Common. If not, see . -//! Relaying [`pezpallet-bridge-messages`](../pezpallet_bridge_messages/index.html) application specific -//! data. Message lane allows sending arbitrary messages between bridged chains. This +//! Relaying [`pezpallet-bridge-messages`](../pezpallet_bridge_messages/index.html) application +//! specific data. Message lane allows sending arbitrary messages between bridged chains. This //! module provides entrypoint that starts reading messages from given message lane //! of source chain and submits proof-of-message-at-source-chain transactions to the //! target chain. Additionally, proofs-of-messages-delivery are sent back from the diff --git a/pezbridges/relays/messages/src/message_lane.rs b/pezbridges/relays/messages/src/message_lane.rs index 88e15899..e954da0d 100644 --- a/pezbridges/relays/messages/src/message_lane.rs +++ b/pezbridges/relays/messages/src/message_lane.rs @@ -21,8 +21,8 @@ use crate::metrics::Labeled; use num_traits::{SaturatingAdd, Zero}; -use relay_utils::{BlockNumberBase, HeaderId}; use pezsp_arithmetic::traits::AtLeast32BitUnsigned; +use relay_utils::{BlockNumberBase, HeaderId}; use std::{fmt::Debug, ops::Sub}; /// One-way message lane. diff --git a/pezbridges/relays/teyrchains/src/teyrchains_loop.rs b/pezbridges/relays/teyrchains/src/teyrchains_loop.rs index 0e138531..4155b18f 100644 --- a/pezbridges/relays/teyrchains/src/teyrchains_loop.rs +++ b/pezbridges/relays/teyrchains/src/teyrchains_loop.rs @@ -688,9 +688,9 @@ mod tests { use super::*; use async_std::sync::{Arc, Mutex}; use futures::{SinkExt, StreamExt}; + use pezsp_core::H256; use relay_bizinikiwi_client::test_chain::{TestChain, TestTeyrchain}; use relay_utils::{HeaderId, MaybeConnectionError}; - use pezsp_core::H256; use std::collections::HashMap; const PARA_10_HASH: ParaHash = H256([10u8; 32]); diff --git a/pezbridges/relays/utils/src/lib.rs b/pezbridges/relays/utils/src/lib.rs index 26d61d11..3fcb5ea4 100644 --- a/pezbridges/relays/utils/src/lib.rs +++ b/pezbridges/relays/utils/src/lib.rs @@ -16,10 +16,10 @@ //! Utilities used by different relays. -pub use pezbp_runtime::HeaderId; pub use error::Error; -pub use relay_loop::{relay_loop, relay_metrics}; +pub use pezbp_runtime::HeaderId; pub use pezsp_runtime::traits::{UniqueSaturatedFrom, UniqueSaturatedInto}; +pub use relay_loop::{relay_loop, relay_metrics}; use std::fmt::Debug; use async_trait::async_trait; diff --git a/pezbridges/snowbridge/pezpallets/ethereum-client/src/benchmarking/mod.rs b/pezbridges/snowbridge/pezpallets/ethereum-client/src/benchmarking/mod.rs index dd4589fa..a02cb259 100644 --- a/pezbridges/snowbridge/pezpallets/ethereum-client/src/benchmarking/mod.rs +++ b/pezbridges/snowbridge/pezpallets/ethereum-client/src/benchmarking/mod.rs @@ -4,9 +4,9 @@ use super::*; mod util; use crate::Pezpallet as EthereumBeaconClient; +use hex_literal::hex; use pezframe_benchmarking::v2::*; use pezframe_system::RawOrigin; -use hex_literal::hex; use pezsnowbridge_beacon_primitives::{ fast_aggregate_verify, merkle_proof::{generalized_index_length, subtree_index}, diff --git a/pezbridges/snowbridge/pezpallets/ethereum-client/src/benchmarking/util.rs b/pezbridges/snowbridge/pezpallets/ethereum-client/src/benchmarking/util.rs index 50a162db..1f3ec773 100644 --- a/pezbridges/snowbridge/pezpallets/ethereum-client/src/benchmarking/util.rs +++ b/pezbridges/snowbridge/pezpallets/ethereum-client/src/benchmarking/util.rs @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2023 Snowfork use crate::{ - decompress_sync_committee_bits, Config, CurrentSyncCommittee, Pezpallet as EthereumBeaconClient, - Update, ValidatorsRoot, Vec, + decompress_sync_committee_bits, Config, CurrentSyncCommittee, + Pezpallet as EthereumBeaconClient, Update, ValidatorsRoot, Vec, }; use pezsnowbridge_beacon_primitives::PublicKeyPrepared; use pezsp_core::H256; diff --git a/pezbridges/snowbridge/pezpallets/ethereum-client/src/lib.rs b/pezbridges/snowbridge/pezpallets/ethereum-client/src/lib.rs index 53dbb7b6..6dd17e3d 100644 --- a/pezbridges/snowbridge/pezpallets/ethereum-client/src/lib.rs +++ b/pezbridges/snowbridge/pezpallets/ethereum-client/src/lib.rs @@ -85,7 +85,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; #[pezpallet::constant] type ForkVersions: Get; /// Minimum gap between finalized headers for an update to be free. diff --git a/pezbridges/snowbridge/pezpallets/ethereum-client/src/mock.rs b/pezbridges/snowbridge/pezpallets/ethereum-client/src/mock.rs index c407449e..ebdfb54a 100644 --- a/pezbridges/snowbridge/pezpallets/ethereum-client/src/mock.rs +++ b/pezbridges/snowbridge/pezpallets/ethereum-client/src/mock.rs @@ -10,8 +10,8 @@ use pezsp_std::default::Default; use std::{fs::File, path::PathBuf}; type Block = pezframe_system::mocking::MockBlock; -use pezframe_support::traits::ConstU32; use hex_literal::hex; +use pezframe_support::traits::ConstU32; use pezsp_runtime::BuildStorage; fn load_fixture(basename: String) -> Result diff --git a/pezbridges/snowbridge/pezpallets/ethereum-client/src/tests.rs b/pezbridges/snowbridge/pezpallets/ethereum-client/src/tests.rs index 0057a9f4..c69710b3 100644 --- a/pezbridges/snowbridge/pezpallets/ethereum-client/src/tests.rs +++ b/pezbridges/snowbridge/pezpallets/ethereum-client/src/tests.rs @@ -13,8 +13,8 @@ use crate::{ FinalizedBeaconState, LatestFinalizedBlockRoot, LatestSyncCommitteeUpdatePeriod, NextSyncCommittee, SyncCommitteePrepared, }; -use pezframe_support::{assert_err, assert_noop, assert_ok, pezpallet_prelude::Pays}; use hex_literal::hex; +use pezframe_support::{assert_err, assert_noop, assert_ok, pezpallet_prelude::Pays}; use pezsnowbridge_beacon_primitives::{ merkle_proof::{generalized_index_length, subtree_index}, types::deneb, diff --git a/pezbridges/snowbridge/pezpallets/ethereum-client/src/types.rs b/pezbridges/snowbridge/pezpallets/ethereum-client/src/types.rs index 42361a36..ac094b2a 100644 --- a/pezbridges/snowbridge/pezpallets/ethereum-client/src/types.rs +++ b/pezbridges/snowbridge/pezpallets/ethereum-client/src/types.rs @@ -13,7 +13,8 @@ pub type SyncCommitteePrepared = pezsnowbridge_beacon_primitives::SyncCommitteeP pub type SyncAggregate = pezsnowbridge_beacon_primitives::SyncAggregate; pub type CheckpointUpdate = pezsnowbridge_beacon_primitives::CheckpointUpdate; pub type Update = pezsnowbridge_beacon_primitives::Update; -pub type NextSyncCommitteeUpdate = pezsnowbridge_beacon_primitives::NextSyncCommitteeUpdate; +pub type NextSyncCommitteeUpdate = + pezsnowbridge_beacon_primitives::NextSyncCommitteeUpdate; pub use pezsnowbridge_beacon_primitives::{AncestryProof, ExecutionProof}; diff --git a/pezbridges/snowbridge/pezpallets/inbound-queue-v2/src/lib.rs b/pezbridges/snowbridge/pezpallets/inbound-queue-v2/src/lib.rs index bc53533e..f415a6ed 100644 --- a/pezbridges/snowbridge/pezpallets/inbound-queue-v2/src/lib.rs +++ b/pezbridges/snowbridge/pezpallets/inbound-queue-v2/src/lib.rs @@ -81,7 +81,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The verifier for inbound messages from Ethereum. type Verifier: Verifier; /// XCM message sender. @@ -99,7 +100,8 @@ pub mod pezpallet { type Helper: BenchmarkHelper; /// Reward discriminator type. type RewardKind: Parameter + MaxEncodedLen + Send + Sync + Copy + Clone; - /// The default RewardKind discriminator for rewards allocated to relayers from this pezpallet. + /// The default RewardKind discriminator for rewards allocated to relayers from this + /// pezpallet. #[pezpallet::constant] type DefaultRewardKind: Get; /// Relayer reward payment. diff --git a/pezbridges/snowbridge/pezpallets/inbound-queue-v2/src/mock.rs b/pezbridges/snowbridge/pezpallets/inbound-queue-v2/src/mock.rs index e1b6e95f..b2c023a6 100644 --- a/pezbridges/snowbridge/pezpallets/inbound-queue-v2/src/mock.rs +++ b/pezbridges/snowbridge/pezpallets/inbound-queue-v2/src/mock.rs @@ -3,8 +3,8 @@ use super::*; use crate::{self as inbound_queue_v2}; -use pezframe_support::{derive_impl, parameter_types, traits::ConstU32}; use hex_literal::hex; +use pezframe_support::{derive_impl, parameter_types, traits::ConstU32}; use pezsnowbridge_beacon_primitives::{ types::deneb, BeaconHeader, ExecutionProof, VersionedExecutionPayloadHeader, }; diff --git a/pezbridges/snowbridge/pezpallets/inbound-queue/src/lib.rs b/pezbridges/snowbridge/pezpallets/inbound-queue/src/lib.rs index f3a2f375..c0051978 100644 --- a/pezbridges/snowbridge/pezpallets/inbound-queue/src/lib.rs +++ b/pezbridges/snowbridge/pezpallets/inbound-queue/src/lib.rs @@ -47,10 +47,10 @@ use pezframe_support::{ PalletError, }; use pezframe_system::ensure_signed; -use scale_info::TypeInfo; use pezsp_core::H160; use pezsp_runtime::traits::Zero; use pezsp_std::vec; +use scale_info::TypeInfo; use xcm::prelude::{ send_xcm, Junction::*, Location, SendError as XcmpSendError, SendXcm, Xcm, XcmContext, XcmHash, }; @@ -69,8 +69,9 @@ use pezsp_runtime::{traits::Saturating, SaturatedConversion, TokenError}; pub use weights::WeightInfo; -type BalanceOf = - <::Token as Inspect<::AccountId>>::Balance; +type BalanceOf = <::Token as Inspect< + ::AccountId, +>>::Balance; pub use pezpallet::*; @@ -98,7 +99,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The verifier for inbound messages from Ethereum type Verifier: Verifier; diff --git a/pezbridges/snowbridge/pezpallets/inbound-queue/src/mock.rs b/pezbridges/snowbridge/pezpallets/inbound-queue/src/mock.rs index 2b04f1db..01736791 100644 --- a/pezbridges/snowbridge/pezpallets/inbound-queue/src/mock.rs +++ b/pezbridges/snowbridge/pezpallets/inbound-queue/src/mock.rs @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: 2023 Snowfork use super::*; -use pezframe_support::{derive_impl, parameter_types, traits::ConstU32, weights::IdentityFee}; use hex_literal::hex; +use pezframe_support::{derive_impl, parameter_types, traits::ConstU32, weights::IdentityFee}; use pezsnowbridge_beacon_primitives::{ types::deneb, BeaconHeader, ExecutionProof, Fork, ForkVersions, VersionedExecutionPayloadHeader, }; diff --git a/pezbridges/snowbridge/pezpallets/inbound-queue/src/test.rs b/pezbridges/snowbridge/pezpallets/inbound-queue/src/test.rs index 5de34e3c..15255c0f 100644 --- a/pezbridges/snowbridge/pezpallets/inbound-queue/src/test.rs +++ b/pezbridges/snowbridge/pezpallets/inbound-queue/src/test.rs @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: 2023 Snowfork use super::*; -use pezframe_support::{assert_noop, assert_ok}; use hex_literal::hex; +use pezframe_support::{assert_noop, assert_ok}; use pezsnowbridge_core::ChannelId; use pezsnowbridge_inbound_queue_primitives::Proof; use pezsp_keyring::Sr25519Keyring as Keyring; diff --git a/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/lib.rs b/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/lib.rs index 2196cb82..7fe7fc4d 100644 --- a/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/lib.rs +++ b/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/lib.rs @@ -118,7 +118,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type Hashing: Hash; @@ -163,7 +164,8 @@ pub mod pezpallet { type GatewayAddress: Get; /// Reward discriminator type. type RewardKind: Parameter + MaxEncodedLen + Send + Sync + Copy + Clone; - /// The default RewardKind discriminator for rewards allocated to relayers from this pezpallet. + /// The default RewardKind discriminator for rewards allocated to relayers from this + /// pezpallet. #[pezpallet::constant] type DefaultRewardKind: Get; /// Relayer reward payment. diff --git a/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/mock.rs b/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/mock.rs index 38632f95..6583da19 100644 --- a/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/mock.rs +++ b/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/mock.rs @@ -11,7 +11,6 @@ use pezframe_support::{ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use hex_literal::hex; -use scale_info::TypeInfo; use pezsnowbridge_core::{AgentId, AgentIdOf, ChannelId, ParaId}; use pezsnowbridge_outbound_queue_primitives::{v2::*, Log, Proof, VerificationError, Verifier}; use pezsnowbridge_test_utils::mock_rewards::{BridgeReward, MockRewardLedger}; @@ -21,6 +20,7 @@ use pezsp_runtime::{ AccountId32, BuildStorage, }; use pezsp_std::marker::PhantomData; +use scale_info::TypeInfo; use xcm::prelude::Here; use xcm_executor::traits::ConvertLocation; diff --git a/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/test.rs b/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/test.rs index 250a96e4..c5a65a60 100644 --- a/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/test.rs +++ b/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/test.rs @@ -6,13 +6,13 @@ use crate::{ }; use alloy_core::primitives::FixedBytes; use codec::Encode; +use hex_literal::hex; use pezframe_support::{ assert_err, assert_noop, assert_ok, traits::{Hooks, ProcessMessage, ProcessMessageError, QueueFootprintQuery}, weights::WeightMeter, BoundedVec, }; -use hex_literal::hex; use pezsnowbridge_core::{digest_item::SnowbridgeDigestItem, ChannelId, ParaId}; use pezsnowbridge_outbound_queue_primitives::{ v2::{abi::OutboundMessageWrapper, Command, Initializer, SendMessage}, diff --git a/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/types.rs b/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/types.rs index f808249f..65b39077 100644 --- a/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/types.rs +++ b/pezbridges/snowbridge/pezpallets/outbound-queue-v2/src/types.rs @@ -3,11 +3,11 @@ use super::Pezpallet; use codec::{Decode, Encode, MaxEncodedLen}; use pezframe_support::traits::ProcessMessage; -use scale_info::TypeInfo; pub use pezsnowbridge_merkle_tree::MerkleProof; use pezsp_core::H256; use pezsp_runtime::RuntimeDebug; use pezsp_std::prelude::*; +use scale_info::TypeInfo; pub type ProcessMessageOriginOf = as ProcessMessage>::Origin; diff --git a/pezbridges/snowbridge/pezpallets/outbound-queue/src/lib.rs b/pezbridges/snowbridge/pezpallets/outbound-queue/src/lib.rs index 566d2287..114cebc4 100644 --- a/pezbridges/snowbridge/pezpallets/outbound-queue/src/lib.rs +++ b/pezbridges/snowbridge/pezpallets/outbound-queue/src/lib.rs @@ -18,8 +18,8 @@ //! 3. The underlying message queue is implemented by [`Config::MessageQueue`] //! 4. The message queue delivers messages back to this pezpallet via the implementation for //! [`pezframe_support::traits::ProcessMessage::process_message`] -//! 5. The message is processed in `Pezpallet::do_process_message`: a. Assigned a nonce b. ABI-encoded, -//! hashed, and stored in the `MessageLeaves` vector +//! 5. The message is processed in `Pezpallet::do_process_message`: a. Assigned a nonce b. +//! ABI-encoded, hashed, and stored in the `MessageLeaves` vector //! 6. At the end of the block, a merkle root is constructed from all the leaves in `MessageLeaves`. //! 7. This merkle root is inserted into the teyrchain header as a digest item //! 8. Offchain relayers are able to relay the message to Ethereum after: a. Generating a merkle @@ -140,7 +140,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type Hashing: Hash; diff --git a/pezbridges/snowbridge/pezpallets/outbound-queue/src/types.rs b/pezbridges/snowbridge/pezpallets/outbound-queue/src/types.rs index a04ee6c4..192a70c3 100644 --- a/pezbridges/snowbridge/pezpallets/outbound-queue/src/types.rs +++ b/pezbridges/snowbridge/pezpallets/outbound-queue/src/types.rs @@ -3,11 +3,11 @@ use codec::{Decode, Encode}; use ethabi::Token; use pezframe_support::traits::ProcessMessage; -use scale_info::TypeInfo; use pezsnowbridge_core::ChannelId; use pezsp_core::H256; use pezsp_runtime::RuntimeDebug; use pezsp_std::prelude::*; +use scale_info::TypeInfo; use super::Pezpallet; diff --git a/pezbridges/snowbridge/pezpallets/system-frontend/src/lib.rs b/pezbridges/snowbridge/pezpallets/system-frontend/src/lib.rs index 951b3e65..3783a50e 100644 --- a/pezbridges/snowbridge/pezpallets/system-frontend/src/lib.rs +++ b/pezbridges/snowbridge/pezpallets/system-frontend/src/lib.rs @@ -46,7 +46,8 @@ pub type AccountIdOf = ::AccountId; pub const LOG_TARGET: &str = "snowbridge-system-frontend"; -/// Call indices within BridgeHub runtime for dispatchables within `pezsnowbridge-pezpallet-system-v2` +/// Call indices within BridgeHub runtime for dispatchables within +/// `pezsnowbridge-pezpallet-system-v2` #[allow(clippy::large_enum_variant)] #[derive(Encode, Decode, Debug, PartialEq, Clone, TypeInfo)] pub enum BridgeHubRuntime { @@ -88,7 +89,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Origin check for XCM locations that can register token type RegisterTokenOrigin: EnsureOriginWithArg< diff --git a/pezbridges/snowbridge/pezpallets/system-v2/src/lib.rs b/pezbridges/snowbridge/pezpallets/system-v2/src/lib.rs index a17e5865..c2c55903 100644 --- a/pezbridges/snowbridge/pezpallets/system-v2/src/lib.rs +++ b/pezbridges/snowbridge/pezpallets/system-v2/src/lib.rs @@ -75,7 +75,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config + pezsnowbridge_pezpallet_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Send messages to Ethereum and add additional relayer rewards if deposited type OutboundQueue: SendMessage + AddTip; /// Add to the relayer reward for a specific message diff --git a/pezbridges/snowbridge/pezpallets/system/src/lib.rs b/pezbridges/snowbridge/pezpallets/system/src/lib.rs index d5197139..fd73e4b4 100644 --- a/pezbridges/snowbridge/pezpallets/system/src/lib.rs +++ b/pezbridges/snowbridge/pezpallets/system/src/lib.rs @@ -62,8 +62,9 @@ use pezframe_support::traits::OriginTrait; pub use pezpallet::*; -pub type BalanceOf = - <::Token as Inspect<::AccountId>>::Balance; +pub type BalanceOf = <::Token as Inspect< + ::AccountId, +>>::Balance; pub type AccountIdOf = ::AccountId; pub type PricingParametersOf = PricingParametersRecord>; @@ -109,7 +110,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Send messages to Ethereum type OutboundQueue: SendMessage>; @@ -247,7 +249,8 @@ pub mod pezpallet { #[pezpallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { fn build(&self) { - Pezpallet::::initialize(self.para_id, self.asset_hub_para_id).expect("infallible; qed"); + Pezpallet::::initialize(self.para_id, self.asset_hub_para_id) + .expect("infallible; qed"); } } diff --git a/pezbridges/snowbridge/pezpallets/system/src/migration.rs b/pezbridges/snowbridge/pezpallets/system/src/migration.rs index ecb607bf..6b6402ce 100644 --- a/pezbridges/snowbridge/pezpallets/system/src/migration.rs +++ b/pezbridges/snowbridge/pezpallets/system/src/migration.rs @@ -116,7 +116,9 @@ pub mod v1 { /// Calculate the fee required to pay for gas on Ethereum. fn calculate_remote_fee_v2(params: &PricingParametersOf) -> U256 { - use pezsnowbridge_outbound_queue_primitives::v2::{Command, ConstantGasMeter, GasMeter}; + use pezsnowbridge_outbound_queue_primitives::v2::{ + Command, ConstantGasMeter, GasMeter, + }; let command = Command::UnlockNativeToken { token: H160::zero(), recipient: H160::zero(), diff --git a/pezbridges/snowbridge/pezpallets/system/src/tests.rs b/pezbridges/snowbridge/pezpallets/system/src/tests.rs index bc838727..534c6c73 100644 --- a/pezbridges/snowbridge/pezpallets/system/src/tests.rs +++ b/pezbridges/snowbridge/pezpallets/system/src/tests.rs @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2023 Snowfork use crate::{mock::*, *}; -use pezframe_support::{assert_noop, assert_ok}; use hex_literal::hex; +use pezframe_support::{assert_noop, assert_ok}; use pezsnowbridge_core::eth; use pezsp_core::H256; use pezsp_runtime::{AccountId32, DispatchError::BadOrigin}; diff --git a/pezbridges/snowbridge/primitives/beacon/src/bls.rs b/pezbridges/snowbridge/primitives/beacon/src/bls.rs index ac30e45c..57c4ffd2 100644 --- a/pezbridges/snowbridge/primitives/beacon/src/bls.rs +++ b/pezbridges/snowbridge/primitives/beacon/src/bls.rs @@ -2,15 +2,15 @@ // SPDX-FileCopyrightText: 2023 Snowfork use crate::{PublicKey, Signature}; use codec::{Decode, DecodeWithMemTracking, Encode}; -use pezframe_support::{ensure, PalletError}; pub use milagro_bls::{ AggregatePublicKey, AggregateSignature, PublicKey as PublicKeyPrepared, Signature as SignaturePrepared, }; -use scale_info::TypeInfo; +use pezframe_support::{ensure, PalletError}; use pezsp_core::H256; use pezsp_runtime::RuntimeDebug; use pezsp_std::prelude::*; +use scale_info::TypeInfo; #[derive( Copy, diff --git a/pezbridges/snowbridge/primitives/beacon/src/types.rs b/pezbridges/snowbridge/primitives/beacon/src/types.rs index 3683a144..b87e5fbe 100644 --- a/pezbridges/snowbridge/primitives/beacon/src/types.rs +++ b/pezbridges/snowbridge/primitives/beacon/src/types.rs @@ -2,10 +2,10 @@ // SPDX-FileCopyrightText: 2023 Snowfork use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use pezframe_support::{CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound}; -use scale_info::TypeInfo; use pezsp_core::{H160, H256, U256}; use pezsp_runtime::RuntimeDebug; use pezsp_std::{boxed::Box, iter::repeat, prelude::*}; +use scale_info::TypeInfo; use crate::config::{PUBKEY_SIZE, SIGNATURE_SIZE}; @@ -625,11 +625,11 @@ pub enum Mode { pub mod deneb { use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::{CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound}; + use pezsp_core::{H160, H256, U256}; + use pezsp_std::prelude::*; use scale_info::TypeInfo; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; - use pezsp_core::{H160, H256, U256}; - use pezsp_std::prelude::*; /// ExecutionPayloadHeader /// diff --git a/pezbridges/snowbridge/primitives/beacon/src/updates.rs b/pezbridges/snowbridge/primitives/beacon/src/updates.rs index 5a015b63..6160cf5d 100644 --- a/pezbridges/snowbridge/primitives/beacon/src/updates.rs +++ b/pezbridges/snowbridge/primitives/beacon/src/updates.rs @@ -2,9 +2,9 @@ // SPDX-FileCopyrightText: 2023 Snowfork use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::{CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound}; -use scale_info::TypeInfo; use pezsp_core::H256; use pezsp_std::prelude::*; +use scale_info::TypeInfo; use crate::types::{BeaconHeader, SyncAggregate, SyncCommittee}; diff --git a/pezbridges/snowbridge/primitives/core/src/lib.rs b/pezbridges/snowbridge/primitives/core/src/lib.rs index 8442643f..6d011b77 100644 --- a/pezbridges/snowbridge/primitives/core/src/lib.rs +++ b/pezbridges/snowbridge/primitives/core/src/lib.rs @@ -20,17 +20,17 @@ pub use location::{AgentId, AgentIdOf, TokenId, TokenIdOf}; pub use pezkuwi_teyrchain_primitives::primitives::{ Id as ParaId, IsSystem, Sibling as SiblingParaId, }; -pub use ringbuffer::{RingBufferMap, RingBufferMapImpl}; pub use pezsp_core::U256; +pub use ringbuffer::{RingBufferMap, RingBufferMapImpl}; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use pezframe_support::{traits::Contains, BoundedVec}; use hex_literal::hex; -use scale_info::TypeInfo; +use pezframe_support::{traits::Contains, BoundedVec}; use pezsp_core::{ConstU32, H256}; use pezsp_io::hashing::keccak_256; use pezsp_runtime::{traits::AccountIdConversion, RuntimeDebug}; use pezsp_std::prelude::*; +use scale_info::TypeInfo; use xcm::latest::{Asset, Junction::Teyrchain, Location, Result as XcmResult, XcmContext}; use xcm_executor::traits::TransactAsset; diff --git a/pezbridges/snowbridge/primitives/core/src/operating_mode.rs b/pezbridges/snowbridge/primitives/core/src/operating_mode.rs index 6a23dafc..bb548f81 100644 --- a/pezbridges/snowbridge/primitives/core/src/operating_mode.rs +++ b/pezbridges/snowbridge/primitives/core/src/operating_mode.rs @@ -1,6 +1,6 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; use pezsp_runtime::RuntimeDebug; +use scale_info::TypeInfo; /// Basic operating modes for a bridges module (Normal/Halted). #[derive( diff --git a/pezbridges/snowbridge/primitives/core/src/pricing.rs b/pezbridges/snowbridge/primitives/core/src/pricing.rs index 04a3d56c..c7e4f76c 100644 --- a/pezbridges/snowbridge/primitives/core/src/pricing.rs +++ b/pezbridges/snowbridge/primitives/core/src/pricing.rs @@ -1,9 +1,9 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; use pezsp_arithmetic::traits::{BaseArithmetic, Unsigned, Zero}; use pezsp_core::U256; use pezsp_runtime::{FixedU128, RuntimeDebug}; use pezsp_std::prelude::*; +use scale_info::TypeInfo; #[derive( Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo, diff --git a/pezbridges/snowbridge/primitives/core/src/reward.rs b/pezbridges/snowbridge/primitives/core/src/reward.rs index f3dd7e8d..74459036 100644 --- a/pezbridges/snowbridge/primitives/core/src/reward.rs +++ b/pezbridges/snowbridge/primitives/core/src/reward.rs @@ -7,13 +7,13 @@ use crate::reward::RewardPaymentError::{ChargeFeesFailure, XcmSendFailure}; use bp_relayers::PaymentProcedure; use codec::DecodeWithMemTracking; use pezframe_support::{dispatch::GetDispatchInfo, PalletError}; -use scale_info::TypeInfo; use pezsp_runtime::{ codec::{Decode, Encode}, traits::Get, DispatchError, }; use pezsp_std::{fmt::Debug, marker::PhantomData}; +use scale_info::TypeInfo; use xcm::{ opaque::latest::prelude::Xcm, prelude::{ExecuteXcm, Junction::*, Location, SendXcm, *}, diff --git a/pezbridges/snowbridge/primitives/inbound-queue/src/v1.rs b/pezbridges/snowbridge/primitives/inbound-queue/src/v1.rs index 814b777d..5257b333 100644 --- a/pezbridges/snowbridge/primitives/inbound-queue/src/v1.rs +++ b/pezbridges/snowbridge/primitives/inbound-queue/src/v1.rs @@ -6,11 +6,11 @@ use crate::{CallIndex, EthereumLocationsConverterFor}; use codec::{Decode, DecodeWithMemTracking, Encode}; use core::marker::PhantomData; use pezframe_support::{traits::tokens::Balance as BalanceT, PalletError}; -use scale_info::TypeInfo; use pezsnowbridge_core::TokenId; use pezsp_core::{Get, RuntimeDebug, H160, H256}; use pezsp_runtime::{traits::MaybeConvert, MultiAddress}; use pezsp_std::prelude::*; +use scale_info::TypeInfo; use xcm::prelude::{Junction::AccountKey20, *}; const MINIMUM_DEPOSIT: u128 = 1; @@ -462,8 +462,8 @@ mod tests { v1::{Command, ConvertMessage, Destination, MessageToXcm, MessageV1, VersionedMessage}, CallIndex, EthereumLocationsConverterFor, }; - use pezframe_support::{assert_ok, parameter_types}; use hex_literal::hex; + use pezframe_support::{assert_ok, parameter_types}; use pezsnowbridge_test_utils::mock_converter::{ add_location_override, reanchor_to_ethereum, LocationIdConvert, }; diff --git a/pezbridges/snowbridge/primitives/inbound-queue/src/v2/converter.rs b/pezbridges/snowbridge/primitives/inbound-queue/src/v2/converter.rs index 9a1173a8..dcdeb854 100644 --- a/pezbridges/snowbridge/primitives/inbound-queue/src/v2/converter.rs +++ b/pezbridges/snowbridge/primitives/inbound-queue/src/v2/converter.rs @@ -425,8 +425,8 @@ mod tests { use super::*; use codec::Encode; - use pezframe_support::{assert_err, assert_ok, parameter_types}; use hex_literal::hex; + use pezframe_support::{assert_err, assert_ok, parameter_types}; use pezsnowbridge_core::TokenId; use pezsnowbridge_test_utils::mock_converter::{ add_location_override, reanchor_to_ethereum, LocationIdConvert, diff --git a/pezbridges/snowbridge/primitives/inbound-queue/src/v2/message.rs b/pezbridges/snowbridge/primitives/inbound-queue/src/v2/message.rs index e1663b6c..b0079a7e 100644 --- a/pezbridges/snowbridge/primitives/inbound-queue/src/v2/message.rs +++ b/pezbridges/snowbridge/primitives/inbound-queue/src/v2/message.rs @@ -9,9 +9,9 @@ use alloy_core::{ sol_types::{SolEvent, SolType}, }; use codec::{Decode, Encode}; -use scale_info::TypeInfo; use pezsp_core::{RuntimeDebug, H160, H256}; use pezsp_std::prelude::*; +use scale_info::TypeInfo; sol! { interface IGatewayV2 { @@ -245,8 +245,8 @@ impl TryFrom<&IGatewayV2::EthereumAsset> for EthereumAsset { #[cfg(test)] mod tests { use super::*; - use pezframe_support::assert_ok; use hex_literal::hex; + use pezframe_support::assert_ok; use pezsp_core::H160; #[test] diff --git a/pezbridges/snowbridge/primitives/merkle-tree/src/lib.rs b/pezbridges/snowbridge/primitives/merkle-tree/src/lib.rs index aa91c2bc..e9611bae 100644 --- a/pezbridges/snowbridge/primitives/merkle-tree/src/lib.rs +++ b/pezbridges/snowbridge/primitives/merkle-tree/src/lib.rs @@ -25,9 +25,9 @@ use alloc::vec; use alloc::vec::Vec; use codec::{Decode, Encode}; -use scale_info::TypeInfo; use pezsp_core::{RuntimeDebug, H256}; use pezsp_runtime::traits::Hash; +use scale_info::TypeInfo; /// Construct a root hash of a Binary Merkle Tree created from given leaves. /// diff --git a/pezbridges/snowbridge/primitives/outbound-queue/src/lib.rs b/pezbridges/snowbridge/primitives/outbound-queue/src/lib.rs index aa52f6bd..4edcf454 100644 --- a/pezbridges/snowbridge/primitives/outbound-queue/src/lib.rs +++ b/pezbridges/snowbridge/primitives/outbound-queue/src/lib.rs @@ -9,9 +9,9 @@ pub mod v2; use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::PalletError; -use scale_info::TypeInfo; use pezsp_arithmetic::traits::{BaseArithmetic, Unsigned}; use pezsp_core::RuntimeDebug; +use scale_info::TypeInfo; pub use pezsnowbridge_verification_primitives::*; diff --git a/pezbridges/snowbridge/primitives/outbound-queue/src/v1/converter/tests.rs b/pezbridges/snowbridge/primitives/outbound-queue/src/v1/converter/tests.rs index 2e8f67df..8c641938 100644 --- a/pezbridges/snowbridge/primitives/outbound-queue/src/v1/converter/tests.rs +++ b/pezbridges/snowbridge/primitives/outbound-queue/src/v1/converter/tests.rs @@ -3,8 +3,8 @@ use crate::{ v1::{Command::UnlockNativeToken, Fee}, SendError, SendMessageFeeProvider, }; -use pezframe_support::parameter_types; use hex_literal::hex; +use pezframe_support::parameter_types; use pezsnowbridge_core::AgentIdOf; use pezsp_std::default::Default; use xcm::{ diff --git a/pezbridges/snowbridge/primitives/outbound-queue/src/v1/message.rs b/pezbridges/snowbridge/primitives/outbound-queue/src/v1/message.rs index 7e9d359e..4e2992bf 100644 --- a/pezbridges/snowbridge/primitives/outbound-queue/src/v1/message.rs +++ b/pezbridges/snowbridge/primitives/outbound-queue/src/v1/message.rs @@ -5,11 +5,11 @@ use crate::{OperatingMode, SendError, SendMessageFeeProvider}; use codec::{Decode, DecodeWithMemTracking, Encode}; use ethabi::Token; -use scale_info::TypeInfo; use pezsnowbridge_core::{pricing::UD60x18, ChannelId}; use pezsp_arithmetic::traits::{BaseArithmetic, Unsigned}; use pezsp_core::{RuntimeDebug, H160, H256, U256}; use pezsp_std::{borrow::ToOwned, vec, vec::Vec}; +use scale_info::TypeInfo; /// Enqueued outbound messages need to be versioned to prevent data corruption /// or loss after forkless runtime upgrades diff --git a/pezbridges/snowbridge/primitives/outbound-queue/src/v2/converter/tests.rs b/pezbridges/snowbridge/primitives/outbound-queue/src/v2/converter/tests.rs index b4c37deb..f0087dca 100644 --- a/pezbridges/snowbridge/primitives/outbound-queue/src/v2/converter/tests.rs +++ b/pezbridges/snowbridge/primitives/outbound-queue/src/v2/converter/tests.rs @@ -3,8 +3,8 @@ use crate::{ v2::{convert::XcmConverterError, Command, Message}, SendError, SendMessageFeeProvider, }; -use pezframe_support::{parameter_types, BoundedVec}; use hex_literal::hex; +use pezframe_support::{parameter_types, BoundedVec}; use pezsnowbridge_core::{AgentIdOf, TokenIdOf}; use pezsp_core::H256; use pezsp_std::default::Default; diff --git a/pezbridges/snowbridge/primitives/outbound-queue/src/v2/message.rs b/pezbridges/snowbridge/primitives/outbound-queue/src/v2/message.rs index cadb5d85..af9d10e8 100644 --- a/pezbridges/snowbridge/primitives/outbound-queue/src/v2/message.rs +++ b/pezbridges/snowbridge/primitives/outbound-queue/src/v2/message.rs @@ -4,9 +4,9 @@ use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::{pezpallet_prelude::ConstU32, BoundedVec}; -use scale_info::TypeInfo; use pezsp_core::{RuntimeDebug, H160, H256}; use pezsp_std::vec::Vec; +use scale_info::TypeInfo; use crate::{OperatingMode, SendError}; use abi::{ diff --git a/pezbridges/snowbridge/primitives/outbound-queue/src/v2/mod.rs b/pezbridges/snowbridge/primitives/outbound-queue/src/v2/mod.rs index 70d570d7..d10900ef 100644 --- a/pezbridges/snowbridge/primitives/outbound-queue/src/v2/mod.rs +++ b/pezbridges/snowbridge/primitives/outbound-queue/src/v2/mod.rs @@ -10,9 +10,9 @@ pub use delivery_receipt::*; pub use message::*; use codec::{Decode, Encode}; -use scale_info::TypeInfo; use pezsp_runtime::RuntimeDebug; use pezsp_std::prelude::*; +use scale_info::TypeInfo; /// The `XCM::Transact` payload for calling arbitrary smart contracts on Ethereum. /// On Ethereum, this call will be dispatched by the agent contract acting as a proxy diff --git a/pezbridges/snowbridge/primitives/verification/src/lib.rs b/pezbridges/snowbridge/primitives/verification/src/lib.rs index 0f013c3b..ec5ed52c 100644 --- a/pezbridges/snowbridge/primitives/verification/src/lib.rs +++ b/pezbridges/snowbridge/primitives/verification/src/lib.rs @@ -4,10 +4,10 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::{Decode, DecodeWithMemTracking, Encode}; use pezframe_support::PalletError; -use scale_info::TypeInfo; use pezsnowbridge_beacon_primitives::{BeaconHeader, ExecutionProof}; use pezsp_core::{RuntimeDebug, H160, H256}; use pezsp_std::prelude::*; +use scale_info::TypeInfo; /// A trait for verifying inbound messages from Ethereum. pub trait Verifier { diff --git a/pezbridges/snowbridge/runtime/runtime-common/src/v2/register_token.rs b/pezbridges/snowbridge/runtime/runtime-common/src/v2/register_token.rs index 51e46ff7..3985fe7d 100644 --- a/pezbridges/snowbridge/runtime/runtime-common/src/v2/register_token.rs +++ b/pezbridges/snowbridge/runtime/runtime-common/src/v2/register_token.rs @@ -28,7 +28,8 @@ impl< for ForeignAssetOwner where for<'a> &'a RuntimeOrigin::PalletsOrigin: TryInto<&'a XcmOrigin>, - >::AssetId: From, + >::AssetId: + From, { type Success = L; @@ -75,7 +76,8 @@ impl< for LocalAssetOwner where RuntimeOrigin: Into, RuntimeOrigin>> + From>, - >::AssetId: From, + >::AssetId: + From, { type Success = L; diff --git a/pezbridges/snowbridge/runtime/test-common/src/lib.rs b/pezbridges/snowbridge/runtime/test-common/src/lib.rs index bd1ae700..861a3084 100644 --- a/pezbridges/snowbridge/runtime/test-common/src/lib.rs +++ b/pezbridges/snowbridge/runtime/test-common/src/lib.rs @@ -177,18 +177,23 @@ pub fn send_transfer_token_message_success( // start next block >::set_block_number(next_block_number); >::on_initialize(next_block_number); - >::on_initialize(next_block_number); + >::on_initialize( + next_block_number, + ); >::on_initialize(next_block_number); // finish next block >::on_finalize(next_block_number); - >::on_finalize(next_block_number); + >::on_finalize( + next_block_number, + ); let included_head = >::finalize(); let origin: ParaId = assethub_teyrchain_id.into(); let channel_id: ChannelId = origin.into(); - let nonce = pezsnowbridge_pezpallet_outbound_queue::Nonce::::try_get(channel_id); + let nonce = + pezsnowbridge_pezpallet_outbound_queue::Nonce::::try_get(channel_id); assert_ok!(nonce); assert_eq!(nonce.unwrap(), 1); @@ -475,15 +480,19 @@ pub fn ethereum_extrinsic( 10_000_000_000_000_u128.saturated_into::>(), ) .unwrap(); - let balance_before = - >::free_balance(&alice_account.clone().into()); + let balance_before = >::free_balance( + &alice_account.clone().into(), + ); - assert_ok!(>::force_checkpoint( - RuntimeHelper::::root_origin(), - initial_checkpoint.clone(), - )); - let balance_after_checkpoint = - >::free_balance(&alice_account.clone().into()); + assert_ok!( + >::force_checkpoint( + RuntimeHelper::::root_origin(), + initial_checkpoint.clone(), + ) + ); + let balance_after_checkpoint = >::free_balance( + &alice_account.clone().into(), + ); let update_call: ::RuntimeCall = pezsnowbridge_pezpallet_ethereum_client::Call::::submit { @@ -512,8 +521,9 @@ pub fn ethereum_extrinsic( // Finalized header update let update_outcome = construct_and_apply_extrinsic(alice, update_call.into()); assert_ok!(update_outcome); - let balance_after_update = - >::free_balance(&alice_account.clone().into()); + let balance_after_update = >::free_balance( + &alice_account.clone().into(), + ); // All the extrinsics in this test do no fit into 1 block let _ = RuntimeHelper::::run_to_block(2, alice_account.clone().into()); @@ -526,14 +536,18 @@ pub fn ethereum_extrinsic( pezsnowbridge_pezpallet_ethereum_client::Error::::InvalidUpdateSlot ); let balance_after_invalid_update = - >::free_balance(&alice_account.clone().into()); + >::free_balance( + &alice_account.clone().into(), + ); // Sync committee update let sync_committee_outcome = construct_and_apply_extrinsic(alice, update_sync_committee_call.into()); assert_ok!(sync_committee_outcome); let balance_after_sync_com_update = - >::free_balance(&alice_account.clone().into()); + >::free_balance( + &alice_account.clone().into(), + ); // Invalid sync committee update let invalid_sync_committee_outcome = @@ -543,7 +557,9 @@ pub fn ethereum_extrinsic( pezsnowbridge_pezpallet_ethereum_client::Error::::InvalidUpdateSlot ); let balance_after_invalid_sync_com_update = - >::free_balance(&alice_account.clone().into()); + >::free_balance( + &alice_account.clone().into(), + ); // Assert paid operations are charged and free operations are free // Checkpoint is a free operation @@ -610,10 +626,12 @@ pub fn ethereum_to_pezkuwi_message_extrinsics_work( ) .unwrap(); - assert_ok!(>::force_checkpoint( - RuntimeHelper::::root_origin(), - initial_checkpoint, - )); + assert_ok!( + >::force_checkpoint( + RuntimeHelper::::root_origin(), + initial_checkpoint, + ) + ); let update_sync_committee_call: ::RuntimeCall = pezsnowbridge_pezpallet_ethereum_client::Call::::submit { diff --git a/pezbridges/snowbridge/test-utils/src/mock_outbound_queue.rs b/pezbridges/snowbridge/test-utils/src/mock_outbound_queue.rs index 80136e52..a6aae84e 100644 --- a/pezbridges/snowbridge/test-utils/src/mock_outbound_queue.rs +++ b/pezbridges/snowbridge/test-utils/src/mock_outbound_queue.rs @@ -20,7 +20,9 @@ impl SendMessage for MockOkOutboundQueue { Ok(()) } - fn deliver(_: Self::Ticket) -> Result { + fn deliver( + _: Self::Ticket, + ) -> Result { Ok(H256::zero()) } } @@ -55,7 +57,9 @@ impl SendMessageV1 for MockOkOutboundQueueV1 { Ok(((), Fee::from((0, 0)))) } - fn deliver(_: Self::Ticket) -> Result { + fn deliver( + _: Self::Ticket, + ) -> Result { Ok(H256::zero()) } } diff --git a/pezbridges/snowbridge/test-utils/src/mock_rewards.rs b/pezbridges/snowbridge/test-utils/src/mock_rewards.rs index 562d5032..dbd9fc8b 100644 --- a/pezbridges/snowbridge/test-utils/src/mock_rewards.rs +++ b/pezbridges/snowbridge/test-utils/src/mock_rewards.rs @@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2023 Snowfork use bp_relayers::{PaymentProcedure, RewardLedger, RewardsAccountOwner, RewardsAccountParams}; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use pezframe_support::{pezpallet_prelude::DispatchResult, parameter_types, pezsp_runtime}; +use pezframe_support::{parameter_types, pezpallet_prelude::DispatchResult, pezsp_runtime}; use scale_info::TypeInfo; use xcm::opaque::latest::Location; diff --git a/pezcumulus/client/bootnodes/src/advertisement.rs b/pezcumulus/client/bootnodes/src/advertisement.rs index 553cc26b..690fc9a5 100644 --- a/pezcumulus/client/bootnodes/src/advertisement.rs +++ b/pezcumulus/client/bootnodes/src/advertisement.rs @@ -19,15 +19,14 @@ use crate::config::MAX_ADDRESSES; use codec::{Compact, CompactRef, Decode, Encode}; +use futures::{future::Fuse, pin_mut, FutureExt, StreamExt}; +use ip_network::IpNetwork; +use log::{debug, error, trace, warn}; use pezcumulus_primitives_core::{ relay_chain::{Hash as RelayHash, Header as RelayHeader}, ParaId, }; use pezcumulus_relay_chain_interface::{RelayChainInterface, RelayChainResult}; -use futures::{future::Fuse, pin_mut, FutureExt, StreamExt}; -use ip_network::IpNetwork; -use log::{debug, error, trace, warn}; -use prost::Message; use pezsc_network::{ config::OutgoingResponse, event::{DhtEvent, Event}, @@ -38,6 +37,7 @@ use pezsc_network::{ }; use pezsp_consensus_babe::{digests::CompatibleDigestItem, Epoch, Randomness}; use pezsp_runtime::traits::Header as _; +use prost::Message; use std::{collections::HashSet, pin::Pin, sync::Arc}; use tokio::time::Sleep; diff --git a/pezcumulus/client/bootnodes/src/discovery.rs b/pezcumulus/client/bootnodes/src/discovery.rs index 2c72cda5..5cbd4779 100644 --- a/pezcumulus/client/bootnodes/src/discovery.rs +++ b/pezcumulus/client/bootnodes/src/discovery.rs @@ -34,8 +34,6 @@ use crate::{config::MAX_ADDRESSES, schema::Response}; use codec::{CompactRef, Decode, Encode}; -use pezcumulus_primitives_core::{relay_chain::Hash as RelayHash, ParaId}; -use pezcumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult}; use futures::{ channel::oneshot, future::{BoxFuture, Fuse, FusedFuture}, @@ -44,7 +42,8 @@ use futures::{ FutureExt, StreamExt, }; use log::{debug, error, info, trace, warn}; -use prost::Message; +use pezcumulus_primitives_core::{relay_chain::Hash as RelayHash, ParaId}; +use pezcumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult}; use pezsc_network::{ event::{DhtEvent, Event}, request_responses::{IfDisconnected, RequestFailure}, @@ -52,6 +51,7 @@ use pezsc_network::{ KademliaKey, Multiaddr, PeerId, ProtocolName, }; use pezsp_consensus_babe::{Epoch, Randomness}; +use prost::Message; use std::{collections::HashSet, pin::Pin, sync::Arc, time::Duration}; use tokio::time::{sleep, Sleep}; diff --git a/pezcumulus/client/bootnodes/src/task.rs b/pezcumulus/client/bootnodes/src/task.rs index 02d36162..71824c8f 100644 --- a/pezcumulus/client/bootnodes/src/task.rs +++ b/pezcumulus/client/bootnodes/src/task.rs @@ -22,11 +22,13 @@ use crate::{ config::paranode_protocol_name, discovery::{BootnodeDiscovery, BootnodeDiscoveryParams}, }; -use pezcumulus_primitives_core::{relay_chain::BlockId, ParaId}; -use pezcumulus_relay_chain_interface::RelayChainInterface; use log::{debug, error}; use num_traits::Zero; -use pezsc_network::{request_responses::IncomingRequest, service::traits::NetworkService, Multiaddr}; +use pezcumulus_primitives_core::{relay_chain::BlockId, ParaId}; +use pezcumulus_relay_chain_interface::RelayChainInterface; +use pezsc_network::{ + request_responses::IncomingRequest, service::traits::NetworkService, Multiaddr, +}; use pezsc_service::TaskManager; use std::sync::Arc; diff --git a/pezcumulus/client/cli/src/lib.rs b/pezcumulus/client/cli/src/lib.rs index c6f533f9..0ad6faa6 100644 --- a/pezcumulus/client/cli/src/lib.rs +++ b/pezcumulus/client/cli/src/lib.rs @@ -134,12 +134,11 @@ where B: BlockT, C: HeaderBackend + 'static, { - let genesis_hash = - client - .hash(Zero::zero())? - .ok_or(pezsc_cli::Error::Client(pezsp_blockchain::Error::Backend( - "Failed to lookup genesis block hash when exporting genesis head data.".into(), - )))?; + let genesis_hash = client.hash(Zero::zero())?.ok_or(pezsc_cli::Error::Client( + pezsp_blockchain::Error::Backend( + "Failed to lookup genesis block hash when exporting genesis head data.".into(), + ), + ))?; let genesis_header = client.header(genesis_hash)?.ok_or(pezsc_cli::Error::Client( pezsp_blockchain::Error::Backend( "Failed to lookup genesis header by hash when exporting genesis head data.".into(), @@ -456,7 +455,9 @@ impl pezsc_cli::CliConfiguration for NormalizedRunCmd { Ok(self.base.rpc_params.rpc_rate_limit) } - fn rpc_rate_limit_whitelisted_ips(&self) -> pezsc_cli::Result> { + fn rpc_rate_limit_whitelisted_ips( + &self, + ) -> pezsc_cli::Result> { Ok(self.base.rpc_params.rpc_rate_limit_whitelisted_ips.clone()) } diff --git a/pezcumulus/client/collator/src/lib.rs b/pezcumulus/client/collator/src/lib.rs index c7ddfe16..2e96b475 100644 --- a/pezcumulus/client/collator/src/lib.rs +++ b/pezcumulus/client/collator/src/lib.rs @@ -17,9 +17,9 @@ //! Pezcumulus Collator implementation for Bizinikiwi. -use pezkuwi_pez_node_primitives::CollationGenerationConfig; use pezkuwi_node_subsystem::messages::{CollationGenerationMessage, CollatorProtocolMessage}; use pezkuwi_overseer::Handle as OverseerHandle; +use pezkuwi_pez_node_primitives::CollationGenerationConfig; use pezkuwi_primitives::{CollatorPair, Id as ParaId}; pub mod service; @@ -34,9 +34,9 @@ pub mod relay_chain_driven { channel::{mpsc, oneshot}, prelude::*, }; - use pezkuwi_pez_node_primitives::{CollationGenerationConfig, CollationResult}; use pezkuwi_node_subsystem::messages::{CollationGenerationMessage, CollatorProtocolMessage}; use pezkuwi_overseer::Handle as OverseerHandle; + use pezkuwi_pez_node_primitives::{CollationGenerationConfig, CollationResult}; use pezkuwi_primitives::{CollatorPair, Id as ParaId}; use pezcumulus_primitives_core::{relay_chain::Hash as PHash, PersistedValidationData}; diff --git a/pezcumulus/client/consensus/aura/src/collators/basic.rs b/pezcumulus/client/consensus/aura/src/collators/basic.rs index 9770a60b..b02091ca 100644 --- a/pezcumulus/client/consensus/aura/src/collators/basic.rs +++ b/pezcumulus/client/consensus/aura/src/collators/basic.rs @@ -32,8 +32,8 @@ use pezcumulus_client_consensus_proposer::ProposerInterface; use pezcumulus_primitives_core::{relay_chain::BlockId as RBlockId, CollectCollationInfo}; use pezcumulus_relay_chain_interface::RelayChainInterface; -use pezkuwi_pez_node_primitives::CollationResult; use pezkuwi_overseer::Handle as OverseerHandle; +use pezkuwi_pez_node_primitives::CollationResult; use pezkuwi_primitives::{CollatorPair, Id as ParaId, ValidationCode}; use futures::{channel::mpsc::Receiver, prelude::*}; diff --git a/pezcumulus/client/consensus/aura/src/collators/lookahead.rs b/pezcumulus/client/consensus/aura/src/collators/lookahead.rs index 579f89ba..50899deb 100644 --- a/pezcumulus/client/consensus/aura/src/collators/lookahead.rs +++ b/pezcumulus/client/consensus/aura/src/collators/lookahead.rs @@ -40,9 +40,9 @@ use pezcumulus_primitives_aura::AuraUnincludedSegmentApi; use pezcumulus_primitives_core::{CollectCollationInfo, PersistedValidationData}; use pezcumulus_relay_chain_interface::RelayChainInterface; -use pezkuwi_pez_node_primitives::SubmitCollationParams; use pezkuwi_node_subsystem::messages::CollationGenerationMessage; use pezkuwi_overseer::Handle as OverseerHandle; +use pezkuwi_pez_node_primitives::SubmitCollationParams; use pezkuwi_primitives::{CollatorPair, Id as ParaId, OccupiedCoreAssumption}; use crate::{ diff --git a/pezcumulus/client/consensus/aura/src/collators/mod.rs b/pezcumulus/client/consensus/aura/src/collators/mod.rs index 4cfd5f58..dcb4265e 100644 --- a/pezcumulus/client/consensus/aura/src/collators/mod.rs +++ b/pezcumulus/client/consensus/aura/src/collators/mod.rs @@ -323,6 +323,7 @@ mod tests { use super::*; use crate::collators::{can_build_upon, BackingGroupConnectionHelper}; use codec::Encode; + use futures::StreamExt; use pezcumulus_primitives_aura::Slot; use pezcumulus_primitives_core::BlockT; use pezcumulus_relay_chain_interface::PHash; @@ -332,7 +333,6 @@ mod tests { TestClientBuilderExt, }; use pezcumulus_test_relay_sproof_builder::RelayStateSproofBuilder; - use futures::StreamExt; use pezkuwi_overseer::{Event, Handle}; use pezkuwi_primitives::HeadData; use pezsc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy}; diff --git a/pezcumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs b/pezcumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs index dbfa52e0..bd0d1028 100644 --- a/pezcumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs +++ b/pezcumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs @@ -30,6 +30,7 @@ use crate::{ }, LOG_TARGET, }; +use futures::prelude::*; use pezcumulus_client_collator::service::ServiceInterface as CollatorServiceInterface; use pezcumulus_client_consensus_common::{self as consensus_common, TeyrchainBlockImportMarker}; use pezcumulus_client_consensus_proposer::ProposerInterface; @@ -39,7 +40,6 @@ use pezcumulus_primitives_core::{ PersistedValidationData, RelayParentOffsetApi, }; use pezcumulus_relay_chain_interface::RelayChainInterface; -use futures::prelude::*; use pezkuwi_primitives::{ Block as RelayBlock, CoreIndex, Hash as RelayHash, Header as RelayHeader, Id as ParaId, }; diff --git a/pezcumulus/client/consensus/aura/src/collators/slot_based/block_import.rs b/pezcumulus/client/consensus/aura/src/collators/slot_based/block_import.rs index c574fe5a..c85d8a2b 100644 --- a/pezcumulus/client/consensus/aura/src/collators/slot_based/block_import.rs +++ b/pezcumulus/client/consensus/aura/src/collators/slot_based/block_import.rs @@ -133,9 +133,9 @@ where ))); } - params.state_action = StateAction::ApplyChanges(pezsc_consensus::StorageChanges::Changes( - gen_storage_changes, - )); + params.state_action = StateAction::ApplyChanges( + pezsc_consensus::StorageChanges::Changes(gen_storage_changes), + ); let _ = self.sender.unbounded_send((block, storage_proof)); } diff --git a/pezcumulus/client/consensus/aura/src/collators/slot_based/collation_task.rs b/pezcumulus/client/consensus/aura/src/collators/slot_based/collation_task.rs index 9b083d4c..22ba8ea1 100644 --- a/pezcumulus/client/consensus/aura/src/collators/slot_based/collation_task.rs +++ b/pezcumulus/client/consensus/aura/src/collators/slot_based/collation_task.rs @@ -21,13 +21,13 @@ use std::path::PathBuf; use pezcumulus_client_collator::service::ServiceInterface as CollatorServiceInterface; use pezcumulus_relay_chain_interface::RelayChainInterface; -use pezkuwi_pez_node_primitives::{MaybeCompressedPoV, SubmitCollationParams}; use pezkuwi_node_subsystem::messages::CollationGenerationMessage; use pezkuwi_overseer::Handle as OverseerHandle; +use pezkuwi_pez_node_primitives::{MaybeCompressedPoV, SubmitCollationParams}; use pezkuwi_primitives::{CollatorPair, Id as ParaId}; -use pezcumulus_primitives_core::relay_chain::BlockId; use futures::prelude::*; +use pezcumulus_primitives_core::relay_chain::BlockId; use crate::export_pov_to_path; use pezsc_utils::mpsc::TracingUnboundedReceiver; diff --git a/pezcumulus/client/consensus/aura/src/collators/slot_based/mod.rs b/pezcumulus/client/consensus/aura/src/collators/slot_based/mod.rs index 222e7bbd..45e82ebb 100644 --- a/pezcumulus/client/consensus/aura/src/collators/slot_based/mod.rs +++ b/pezcumulus/client/consensus/aura/src/collators/slot_based/mod.rs @@ -29,8 +29,8 @@ //! //! 1. Awaits the next production signal from the internal timer //! 2. Retrieves the current best relay chain block and identifies a valid parent block (see -//! [find_potential_parents][pezcumulus_client_consensus_common::find_potential_parents] for parent -//! selection criteria) +//! [find_potential_parents][pezcumulus_client_consensus_common::find_potential_parents] for +//! parent selection criteria) //! 3. Validates that: //! - The teyrchain has an assigned core on the relay chain //! - No block has been previously built on the target core @@ -70,13 +70,13 @@ use self::{block_builder_task::run_block_builder, collation_task::run_collation_ pub use block_import::{SlotBasedBlockImport, SlotBasedBlockImportHandle}; use codec::Codec; use consensus_common::TeyrchainCandidate; +use futures::FutureExt; use pezcumulus_client_collator::service::ServiceInterface as CollatorServiceInterface; use pezcumulus_client_consensus_common::{self as consensus_common, TeyrchainBlockImportMarker}; use pezcumulus_client_consensus_proposer::ProposerInterface; use pezcumulus_primitives_aura::AuraUnincludedSegmentApi; use pezcumulus_primitives_core::RelayParentOffsetApi; use pezcumulus_relay_chain_interface::RelayChainInterface; -use futures::FutureExt; use pezkuwi_primitives::{ CollatorPair, CoreIndex, Hash as RelayHash, Id as ParaId, ValidationCodeHash, }; diff --git a/pezcumulus/client/consensus/aura/src/collators/slot_based/slot_timer.rs b/pezcumulus/client/consensus/aura/src/collators/slot_based/slot_timer.rs index 55fa9551..c3f80043 100644 --- a/pezcumulus/client/consensus/aura/src/collators/slot_based/slot_timer.rs +++ b/pezcumulus/client/consensus/aura/src/collators/slot_based/slot_timer.rs @@ -397,8 +397,8 @@ where #[cfg(test)] mod tests { use super::*; - use rstest::rstest; use pezsc_consensus_aura::SlotDuration; + use rstest::rstest; const RELAY_CHAIN_SLOT_DURATION: u64 = 6000; #[rstest] diff --git a/pezcumulus/client/consensus/aura/src/collators/slot_based/tests.rs b/pezcumulus/client/consensus/aura/src/collators/slot_based/tests.rs index b2f49c23..6c30d99b 100644 --- a/pezcumulus/client/consensus/aura/src/collators/slot_based/tests.rs +++ b/pezcumulus/client/consensus/aura/src/collators/slot_based/tests.rs @@ -21,21 +21,21 @@ use super::{ }; use async_trait::async_trait; use codec::Encode; +use futures::Stream; use pezcumulus_primitives_core::{ClaimQueueOffset, CoreInfo, CoreSelector, CumulusDigestItem}; use pezcumulus_relay_chain_interface::*; -use futures::Stream; use pezkuwi_node_subsystem_util::runtime::ClaimQueueSnapshot; use pezkuwi_primitives::{ CandidateEvent, CommittedCandidateReceiptV2, CoreIndex, Hash as RelayHash, Header as RelayHeader, Id as ParaId, }; -use rstest::rstest; use pezsc_consensus_babe::{ AuthorityId, ConsensusLog as BabeConsensusLog, NextEpochDescriptor, BABE_ENGINE_ID, }; use pezsp_core::sr25519; use pezsp_runtime::{generic::BlockId, testing::Header as TestHeader, traits::Header}; use pezsp_version::RuntimeVersion; +use rstest::rstest; use std::{ collections::{BTreeMap, HashMap, VecDeque}, pin::Pin, diff --git a/pezcumulus/client/consensus/aura/src/equivocation_import_queue.rs b/pezcumulus/client/consensus/aura/src/equivocation_import_queue.rs index b9770ecb..a8bee1a8 100644 --- a/pezcumulus/client/consensus/aura/src/equivocation_import_queue.rs +++ b/pezcumulus/client/consensus/aura/src/equivocation_import_queue.rs @@ -21,9 +21,9 @@ /// may see equivocations in a different order, and therefore may not agree on which blocks /// should be thrown out and which ones should be kept. use codec::Codec; +use parking_lot::Mutex; use pezcumulus_client_consensus_common::TeyrchainBlockImportMarker; use pezcumulus_primitives_core::{CumulusDigestItem, RelayBlockIdentifier}; -use parking_lot::Mutex; use pezkuwi_primitives::Hash as RHash; use pezsc_consensus::{ import_queue::{BasicQueue, Verifier as VerifierT}, @@ -31,7 +31,6 @@ use pezsc_consensus::{ }; use pezsc_consensus_aura::{standalone as aura_internal, AuthoritiesTracker}; use pezsc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_TRACE}; -use schnellru::{ByLength, LruMap}; use pezsp_api::ProvideRuntimeApi; use pezsp_block_builder::BlockBuilder as BlockBuilderApi; use pezsp_blockchain::{HeaderBackend, HeaderMetadata}; @@ -40,6 +39,7 @@ use pezsp_consensus_aura::{AuraApi, Slot, SlotDuration}; use pezsp_core::crypto::Pair; use pezsp_inherents::CreateInherentDataProviders; use pezsp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor}; +use schnellru::{ByLength, LruMap}; use std::{fmt::Debug, sync::Arc}; const LRU_WINDOW: u32 = 512; @@ -305,12 +305,12 @@ where mod test { use super::*; use codec::Encode; + use futures::FutureExt; use pezcumulus_test_client::{ runtime::Block, seal_block, Client, InitBlockBuilder, TestClientBuilder, TestClientBuilderExt, }; use pezcumulus_test_relay_sproof_builder::RelayStateSproofBuilder; - use futures::FutureExt; use pezkuwi_primitives::{HeadData, PersistedValidationData}; use pezsc_client_api::HeaderBackend; use pezsp_consensus_aura::sr25519; diff --git a/pezcumulus/client/consensus/aura/src/import_queue.rs b/pezcumulus/client/consensus/aura/src/import_queue.rs index 98703e50..bab0ebef 100644 --- a/pezcumulus/client/consensus/aura/src/import_queue.rs +++ b/pezcumulus/client/consensus/aura/src/import_queue.rs @@ -19,7 +19,6 @@ use codec::Codec; use pezcumulus_client_consensus_common::TeyrchainBlockImportMarker; -use prometheus_endpoint::Registry; use pezsc_client_api::{backend::AuxStore, BlockOf, UsageProvider}; use pezsc_consensus::{import_queue::DefaultImportQueue, BlockImport}; use pezsc_consensus_aura::{AuraVerifier, CompatibilityMode}; @@ -33,6 +32,7 @@ use pezsp_consensus_aura::AuraApi; use pezsp_core::crypto::Pair; use pezsp_inherents::CreateInherentDataProviders; use pezsp_runtime::traits::Block as BlockT; +use prometheus_endpoint::Registry; use std::{fmt::Debug, sync::Arc}; /// Parameters for [`import_queue`]. @@ -86,17 +86,19 @@ where CIDP: CreateInherentDataProviders + Sync + Send + 'static, CIDP::InherentDataProviders: InherentDataProviderExt + Send + Sync, { - pezsc_consensus_aura::import_queue::(pezsc_consensus_aura::ImportQueueParams { - block_import, - justification_import: None, - client, - create_inherent_data_providers, - spawner, - registry, - check_for_equivocation: pezsc_consensus_aura::CheckForEquivocation::No, - telemetry, - compatibility_mode: CompatibilityMode::None, - }) + pezsc_consensus_aura::import_queue::( + pezsc_consensus_aura::ImportQueueParams { + block_import, + justification_import: None, + client, + create_inherent_data_providers, + spawner, + registry, + check_for_equivocation: pezsc_consensus_aura::CheckForEquivocation::No, + telemetry, + compatibility_mode: CompatibilityMode::None, + }, + ) } /// Parameters of [`build_verifier`]. diff --git a/pezcumulus/client/consensus/common/src/level_monitor.rs b/pezcumulus/client/consensus/common/src/level_monitor.rs index bd5b810b..93209d14 100644 --- a/pezcumulus/client/consensus/common/src/level_monitor.rs +++ b/pezcumulus/client/consensus/common/src/level_monitor.rs @@ -17,7 +17,9 @@ use pezsc_client_api::{blockchain::Backend as _, Backend, HeaderBackend as _}; use pezsp_blockchain::{HashAndNumber, HeaderMetadata, TreeRoute}; -use pezsp_runtime::traits::{Block as BlockT, NumberFor, One, Saturating, UniqueSaturatedInto, Zero}; +use pezsp_runtime::traits::{ + Block as BlockT, NumberFor, One, Saturating, UniqueSaturatedInto, Zero, +}; use std::{ collections::{HashMap, HashSet}, sync::Arc, diff --git a/pezcumulus/client/consensus/common/src/parent_search.rs b/pezcumulus/client/consensus/common/src/parent_search.rs index 03284ea9..56310506 100644 --- a/pezcumulus/client/consensus/common/src/parent_search.rs +++ b/pezcumulus/client/consensus/common/src/parent_search.rs @@ -360,8 +360,9 @@ pub fn search_child_branches_for_parents( // because they have already been posted on chain. let is_potential = is_pending || is_included || { let digest = entry.header.digest(); - let is_hash_in_ancestry_check = pezcumulus_primitives_core::extract_relay_parent(digest) - .map_or(false, is_hash_in_ancestry); + let is_hash_in_ancestry_check = + pezcumulus_primitives_core::extract_relay_parent(digest) + .map_or(false, is_hash_in_ancestry); let is_root_in_ancestry_check = pezcumulus_primitives_core::rpsr_digest::extract_relay_parent_storage_root(digest) .map(|(r, _n)| r) diff --git a/pezcumulus/client/consensus/common/src/tests.rs b/pezcumulus/client/consensus/common/src/tests.rs index ded79e73..466436d7 100644 --- a/pezcumulus/client/consensus/common/src/tests.rs +++ b/pezcumulus/client/consensus/common/src/tests.rs @@ -20,6 +20,8 @@ use crate::*; use crate::teyrchain_consensus::run_teyrchain_consensus; use async_trait::async_trait; use codec::Encode; +use futures::{channel::mpsc, executor::block_on, select, FutureExt, Stream, StreamExt}; +use futures_timer::Delay; use pezcumulus_client_pov_recovery::RecoveryKind; use pezcumulus_primitives_core::{ relay_chain::{BlockId, BlockNumber, CoreState}, @@ -34,8 +36,6 @@ use pezcumulus_test_client::{ Backend, Client, InitBlockBuilder, TestClientBuilder, TestClientBuilderExt, }; use pezcumulus_test_relay_sproof_builder::RelayStateSproofBuilder; -use futures::{channel::mpsc, executor::block_on, select, FutureExt, Stream, StreamExt}; -use futures_timer::Delay; use pezkuwi_primitives::{CandidateEvent, HeadData}; use pezsc_client_api::{Backend as _, UsageProvider}; use pezsc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy}; diff --git a/pezcumulus/client/consensus/common/src/teyrchain_consensus.rs b/pezcumulus/client/consensus/common/src/teyrchain_consensus.rs index c96d0b27..346ddff5 100644 --- a/pezcumulus/client/consensus/common/src/teyrchain_consensus.rs +++ b/pezcumulus/client/consensus/common/src/teyrchain_consensus.rs @@ -20,10 +20,10 @@ use pezsc_client_api::{ Backend, BlockBackend, BlockImportNotification, BlockchainEvents, Finalizer, UsageProvider, }; use pezsc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy}; -use schnellru::{ByLength, LruMap}; use pezsp_blockchain::Error as ClientError; use pezsp_consensus::{BlockOrigin, BlockStatus}; use pezsp_runtime::traits::{Block as BlockT, Header as HeaderT}; +use schnellru::{ByLength, LruMap}; use pezcumulus_client_pov_recovery::{RecoveryKind, RecoveryRequest}; use pezcumulus_relay_chain_interface::RelayChainInterface; diff --git a/pezcumulus/client/consensus/proposer/src/lib.rs b/pezcumulus/client/consensus/proposer/src/lib.rs index aa793efc..769282ba 100644 --- a/pezcumulus/client/consensus/proposer/src/lib.rs +++ b/pezcumulus/client/consensus/proposer/src/lib.rs @@ -64,7 +64,8 @@ pub trait ProposerInterface { /// /// Also specify any required inherent digests, the maximum proposal duration, /// and the block size limit in bytes. See the documentation on - /// [`pezsp_consensus::Proposer::propose`] for more details on how to interpret these parameters. + /// [`pezsp_consensus::Proposer::propose`] for more details on how to interpret these + /// parameters. /// /// The `InherentData` and `Digest` are left deliberately general in order to accommodate /// all possible collator selection algorithms or inherent creation mechanisms, diff --git a/pezcumulus/client/network/src/lib.rs b/pezcumulus/client/network/src/lib.rs index af88d9a1..4c4393f2 100644 --- a/pezcumulus/client/network/src/lib.rs +++ b/pezcumulus/client/network/src/lib.rs @@ -29,8 +29,8 @@ use pezsp_core::traits::SpawnNamed; use pezsp_runtime::traits::{Block as BlockT, Header as HeaderT}; use pezcumulus_relay_chain_interface::RelayChainInterface; -use pezkuwi_pez_node_primitives::{CollationSecondedSignal, Statement}; use pezkuwi_node_subsystem::messages::RuntimeApiRequest; +use pezkuwi_pez_node_primitives::{CollationSecondedSignal, Statement}; use pezkuwi_primitives::{ CandidateReceiptV2 as CandidateReceipt, CompactStatement, Hash as PHash, Id as ParaId, OccupiedCoreAssumption, SigningContext, UncheckedSigned, diff --git a/pezcumulus/client/network/src/tests.rs b/pezcumulus/client/network/src/tests.rs index 8363e302..a431e962 100644 --- a/pezcumulus/client/network/src/tests.rs +++ b/pezcumulus/client/network/src/tests.rs @@ -17,14 +17,14 @@ use super::*; use async_trait::async_trait; +use futures::{executor::block_on, poll, task::Poll, FutureExt, Stream, StreamExt}; +use parking_lot::Mutex; use pezcumulus_primitives_core::relay_chain::{BlockId, CoreIndex}; use pezcumulus_relay_chain_inprocess_interface::{check_block_in_chain, BlockCheckStatus}; use pezcumulus_relay_chain_interface::{ OverseerHandle, PHeader, ParaId, RelayChainError, RelayChainResult, }; use pezcumulus_test_service::runtime::{Block, Hash, Header}; -use futures::{executor::block_on, poll, task::Poll, FutureExt, Stream, StreamExt}; -use parking_lot::Mutex; use pezkuwi_pez_node_primitives::{SignedFullStatement, Statement}; use pezkuwi_primitives::{ BlockNumber, CandidateCommitments, CandidateDescriptorV2, CandidateEvent, CollatorPair, @@ -37,7 +37,6 @@ use pezkuwi_test_client::{ Client as PClient, ClientBlockImportExt, DefaultTestClientBuilderExt, FullBackend as PBackend, InitPezkuwiBlockBuilder, TestClientBuilder, TestClientBuilderExt, }; -use rstest::rstest; use pezsc_client_api::{Backend, BlockchainEvents}; use pezsp_blockchain::HeaderBackend; use pezsp_consensus::BlockOrigin; @@ -47,6 +46,7 @@ use pezsp_keystore::{testing::MemoryKeystore, Keystore, KeystorePtr}; use pezsp_runtime::RuntimeAppPublic; use pezsp_state_machine::StorageValue; use pezsp_version::RuntimeVersion; +use rstest::rstest; use std::{ borrow::Cow, collections::{BTreeMap, VecDeque}, diff --git a/pezcumulus/client/pov-recovery/src/active_candidate_recovery.rs b/pezcumulus/client/pov-recovery/src/active_candidate_recovery.rs index 02202476..372470e6 100644 --- a/pezcumulus/client/pov-recovery/src/active_candidate_recovery.rs +++ b/pezcumulus/client/pov-recovery/src/active_candidate_recovery.rs @@ -17,8 +17,8 @@ use pezsp_runtime::traits::Block as BlockT; -use pezkuwi_pez_node_primitives::PoV; use pezkuwi_node_subsystem::messages::AvailabilityRecoveryMessage; +use pezkuwi_pez_node_primitives::PoV; use futures::{channel::oneshot, stream::FuturesUnordered, Future, FutureExt, StreamExt}; diff --git a/pezcumulus/client/pov-recovery/src/lib.rs b/pezcumulus/client/pov-recovery/src/lib.rs index e12bf604..05c43519 100644 --- a/pezcumulus/client/pov-recovery/src/lib.rs +++ b/pezcumulus/client/pov-recovery/src/lib.rs @@ -52,9 +52,9 @@ use pezsc_consensus::import_queue::{ImportQueueService, IncomingBlock}; use pezsp_consensus::{BlockOrigin, BlockStatus, SyncOracle}; use pezsp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor}; -use pezkuwi_pez_node_primitives::{PoV, POV_BOMB_LIMIT}; use pezkuwi_node_subsystem::messages::AvailabilityRecoveryMessage; use pezkuwi_overseer::Handle as OverseerHandle; +use pezkuwi_pez_node_primitives::{PoV, POV_BOMB_LIMIT}; use pezkuwi_primitives::{ CandidateReceiptV2 as CandidateReceipt, CommittedCandidateReceiptV2 as CommittedCandidateReceipt, Id as ParaId, SessionIndex, diff --git a/pezcumulus/client/pov-recovery/src/tests.rs b/pezcumulus/client/pov-recovery/src/tests.rs index 6da115a9..db7dab6c 100644 --- a/pezcumulus/client/pov-recovery/src/tests.rs +++ b/pezcumulus/client/pov-recovery/src/tests.rs @@ -18,6 +18,7 @@ use super::*; use assert_matches::assert_matches; use codec::{Decode, Encode}; +use futures::{channel::mpsc, SinkExt, Stream}; use pezcumulus_primitives_core::relay_chain::{ BlockId, CandidateCommitments, CandidateDescriptorV2, CoreIndex, CoreState, }; @@ -26,14 +27,12 @@ use pezcumulus_relay_chain_interface::{ PersistedValidationData, RelayChainResult, StorageValue, ValidationCodeHash, ValidatorId, }; use pezcumulus_test_client::runtime::{Block, Header}; -use futures::{channel::mpsc, SinkExt, Stream}; -use pezkuwi_pez_node_primitives::AvailableData; use pezkuwi_node_subsystem::{ messages::{AvailabilityRecoveryMessage, RuntimeApiRequest}, RecoveryError, TimeoutExt, }; +use pezkuwi_pez_node_primitives::AvailableData; use pezkuwi_primitives::CandidateEvent; -use rstest::rstest; use pezsc_client_api::{ BlockImportNotification, ClientInfo, CompactProof, FinalityNotification, FinalityNotifications, FinalizeSummary, ImportNotifications, StorageEventStream, StorageKey, @@ -44,6 +43,7 @@ use pezsp_api::RuntimeApiInfo; use pezsp_blockchain::Info; use pezsp_runtime::{generic::SignedBlock, Justifications}; use pezsp_version::RuntimeVersion; +use rstest::rstest; use std::{ borrow::Cow, collections::{BTreeMap, VecDeque}, @@ -177,7 +177,10 @@ impl BlockBackend for TeyrchainClient { unimplemented!() } - fn block_status(&self, hash: Block::Hash) -> pezsp_blockchain::Result { + fn block_status( + &self, + hash: Block::Hash, + ) -> pezsp_blockchain::Result { Ok(self .inner .lock() @@ -1320,7 +1323,8 @@ async fn chained_recovery_success() { .expect("Poisoned lock") .insert(header.hash(), BlockStatus::InChainWithState); - let (unpin_sender, _unpin_receiver) = pezsc_utils::mpsc::tracing_unbounded("test_unpin", 10); + let (unpin_sender, _unpin_receiver) = + pezsc_utils::mpsc::tracing_unbounded("test_unpin", 10); import_notifications_tx .unbounded_send(BlockImportNotification::new( header.hash(), diff --git a/pezcumulus/client/relay-chain-inprocess-interface/src/lib.rs b/pezcumulus/client/relay-chain-inprocess-interface/src/lib.rs index 405f912a..cbdfc90e 100644 --- a/pezcumulus/client/relay-chain-inprocess-interface/src/lib.rs +++ b/pezcumulus/client/relay-chain-inprocess-interface/src/lib.rs @@ -23,6 +23,7 @@ use std::{ }; use async_trait::async_trait; +use futures::{FutureExt, Stream, StreamExt}; use pezcumulus_client_bootnodes::bootnode_request_response_config; use pezcumulus_primitives_core::{ relay_chain::{ @@ -34,13 +35,12 @@ use pezcumulus_primitives_core::{ InboundDownwardMessage, ParaId, PersistedValidationData, }; use pezcumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult}; -use futures::{FutureExt, Stream, StreamExt}; use pezkuwi_primitives::CandidateEvent; use pezkuwi_service::{ builder::PezkuwiServiceBuilder, CollatorOverseerGen, CollatorPair, Configuration, FullBackend, FullClient, Handle, NewFull, NewFullParams, TaskManager, }; -use pezsc_cli::{RuntimeVersion, BizinikiwiCli}; +use pezsc_cli::{BizinikiwiCli, RuntimeVersion}; use pezsc_client_api::{ blockchain::BlockStatus, Backend, BlockchainEvents, HeaderBackend, ImportNotifications, StorageProof, TrieCacheContext, diff --git a/pezcumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs b/pezcumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs index 2dd36028..ce88df48 100644 --- a/pezcumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs +++ b/pezcumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs @@ -20,10 +20,10 @@ use std::{ pin::Pin, }; +use futures::{Stream, StreamExt}; use pezcumulus_primitives_core::{InboundDownwardMessage, ParaId, PersistedValidationData}; use pezcumulus_relay_chain_interface::{RelayChainError, RelayChainResult}; use pezcumulus_relay_chain_rpc_interface::RelayChainRpcClient; -use futures::{Stream, StreamExt}; use pezkuwi_core_primitives::{Block, BlockNumber, Hash, Header}; use pezkuwi_overseer::{ChainApiBackend, RuntimeApiSubsystemClient}; use pezkuwi_primitives::{ @@ -217,7 +217,8 @@ impl RuntimeApiSubsystemClient for BlockChainRpcClient { &self, at: Hash, para_id: pezcumulus_primitives_core::ParaId, - ) -> Result>, pezsp_api::ApiError> { + ) -> Result>, pezsp_api::ApiError> + { Ok(self .rpc_client .teyrchain_host_candidate_pending_availability(at, para_id) @@ -324,7 +325,10 @@ impl RuntimeApiSubsystemClient for BlockChainRpcClient { .await?) } - async fn current_epoch(&self, at: Hash) -> Result { + async fn current_epoch( + &self, + at: Hash, + ) -> Result { Ok(self.rpc_client.babe_api_current_epoch(at).await?) } @@ -335,7 +339,10 @@ impl RuntimeApiSubsystemClient for BlockChainRpcClient { Ok(self.rpc_client.authority_discovery_authorities(at).await?) } - async fn api_version_teyrchain_host(&self, at: Hash) -> Result, pezsp_api::ApiError> { + async fn api_version_teyrchain_host( + &self, + at: Hash, + ) -> Result, pezsp_api::ApiError> { let api_id = >::ID; Ok(self.rpc_client.runtime_version(at).await.map(|v| v.api_version(&api_id))?) } diff --git a/pezcumulus/client/relay-chain-minimal-node/src/lib.rs b/pezcumulus/client/relay-chain-minimal-node/src/lib.rs index b1a75ec5..805cbbf7 100644 --- a/pezcumulus/client/relay-chain-minimal-node/src/lib.rs +++ b/pezcumulus/client/relay-chain-minimal-node/src/lib.rs @@ -17,10 +17,10 @@ use collator_overseer::NewMinimalNode; +use network::build_collator_network; use pezcumulus_client_bootnodes::bootnode_request_response_config; use pezcumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult}; use pezcumulus_relay_chain_rpc_interface::{RelayChainRpcClient, RelayChainRpcInterface, Url}; -use network::build_collator_network; use pezkuwi_network_bridge::{peer_sets_info, IsAuthority}; use pezkuwi_node_network_protocol::{ peer_set::{PeerSet, PeerSetProtocolNames}, @@ -107,22 +107,22 @@ async fn build_interface( )> { let collator_pair = CollatorPair::generate().0; let blockchain_rpc_client = Arc::new(BlockChainRpcClient::new(client.clone())); - let collator_node = match pezkuwi_config.network.network_backend { - pezsc_network::config::NetworkBackendType::Libp2p => - new_minimal_relay_chain::>( - pezkuwi_config, - collator_pair.clone(), - blockchain_rpc_client, - ) - .await?, - pezsc_network::config::NetworkBackendType::Litep2p => - new_minimal_relay_chain::( - pezkuwi_config, - collator_pair.clone(), - blockchain_rpc_client, - ) - .await?, - }; + let collator_node = + match pezkuwi_config.network.network_backend { + pezsc_network::config::NetworkBackendType::Libp2p => + new_minimal_relay_chain::< + RelayBlock, + pezsc_network::NetworkWorker, + >(pezkuwi_config, collator_pair.clone(), blockchain_rpc_client) + .await?, + pezsc_network::config::NetworkBackendType::Litep2p => + new_minimal_relay_chain::( + pezkuwi_config, + collator_pair.clone(), + blockchain_rpc_client, + ) + .await?, + }; task_manager.add_child(collator_node.task_manager); Ok(( Arc::new(RelayChainRpcInterface::new(client, collator_node.overseer_handle)), diff --git a/pezcumulus/client/relay-chain-rpc-interface/src/lib.rs b/pezcumulus/client/relay-chain-rpc-interface/src/lib.rs index e2527edd..0beebf6e 100644 --- a/pezcumulus/client/relay-chain-rpc-interface/src/lib.rs +++ b/pezcumulus/client/relay-chain-rpc-interface/src/lib.rs @@ -17,6 +17,7 @@ use async_trait::async_trait; use core::time::Duration; +use futures::{FutureExt, Stream, StreamExt}; use pezcumulus_primitives_core::{ relay_chain::{ CandidateEvent, CommittedCandidateReceiptV2 as CommittedCandidateReceipt, @@ -28,7 +29,6 @@ use pezcumulus_primitives_core::{ use pezcumulus_relay_chain_interface::{ BlockNumber, CoreState, PHeader, RelayChainError, RelayChainInterface, RelayChainResult, }; -use futures::{FutureExt, Stream, StreamExt}; use pezkuwi_overseer::Handle; use pezsc_client_api::StorageProof; diff --git a/pezcumulus/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs b/pezcumulus/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs index 77377639..a6279142 100644 --- a/pezcumulus/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs +++ b/pezcumulus/client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs @@ -15,9 +15,6 @@ // You should have received a copy of the GNU General Public License // along with Pezcumulus. If not, see . -use pezcumulus_primitives_core::relay_chain::{ - Block as RelayBlock, BlockNumber as RelayNumber, Hash as RelayHash, Header as RelayHeader, -}; use futures::{ channel::{mpsc::Sender, oneshot::Sender as OneshotSender}, future::BoxFuture, @@ -32,9 +29,12 @@ use jsonrpsee::{ }, ws_client::WsClientBuilder, }; +use pezcumulus_primitives_core::relay_chain::{ + Block as RelayBlock, BlockNumber as RelayNumber, Hash as RelayHash, Header as RelayHeader, +}; use pezsc_rpc_api::chain::ChainApiClient; -use schnellru::{ByLength, LruMap}; use pezsp_runtime::generic::SignedBlock; +use schnellru::{ByLength, LruMap}; use std::{sync::Arc, time::Duration}; use tokio::sync::mpsc::{ channel as tokio_channel, Receiver as TokioReceiver, Sender as TokioSender, diff --git a/pezcumulus/client/relay-chain-streams/src/lib.rs b/pezcumulus/client/relay-chain-streams/src/lib.rs index f76e106e..06c850e1 100644 --- a/pezcumulus/client/relay-chain-streams/src/lib.rs +++ b/pezcumulus/client/relay-chain-streams/src/lib.rs @@ -19,8 +19,8 @@ use std::sync::Arc; -use pezcumulus_relay_chain_interface::{RelayChainInterface, RelayChainResult}; use futures::{Stream, StreamExt}; +use pezcumulus_relay_chain_interface::{RelayChainInterface, RelayChainResult}; use pezkuwi_node_subsystem::messages::RuntimeApiRequest; use pezkuwi_primitives::{ CommittedCandidateReceiptV2 as CommittedCandidateReceipt, Hash as PHash, Id as ParaId, diff --git a/pezcumulus/client/service/src/lib.rs b/pezcumulus/client/service/src/lib.rs index 87a76960..f579d078 100644 --- a/pezcumulus/client/service/src/lib.rs +++ b/pezcumulus/client/service/src/lib.rs @@ -19,6 +19,7 @@ //! //! Provides functions for starting a collator node or a normal full node. +use futures::{channel::mpsc, StreamExt}; use pezcumulus_client_cli::CollatorOptions; use pezcumulus_client_network::{AssumeSybilResistance, RequireSecondedInBlockAnnounce}; use pezcumulus_client_pov_recovery::{PoVRecovery, RecoveryDelayRange, RecoveryHandle}; @@ -27,9 +28,7 @@ pub use pezcumulus_primitives_proof_size_hostfunction::storage_proof_size; use pezcumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain; use pezcumulus_relay_chain_interface::{RelayChainInterface, RelayChainResult}; use pezcumulus_relay_chain_minimal_node::build_minimal_relay_chain_node_with_rpc; -use futures::{channel::mpsc, StreamExt}; use pezkuwi_primitives::{CandidateEvent, CollatorPair, OccupiedCoreAssumption}; -use prometheus::{Histogram, HistogramOpts, Registry}; use pezsc_client_api::{ Backend as BackendT, BlockBackend, BlockchainEvents, Finalizer, ProofProvider, UsageProvider, }; @@ -55,6 +54,7 @@ use pezsp_runtime::{ SaturatedConversion, Saturating, }; use pezsp_trie::proof_size_extension::ProofSizeExt; +use prometheus::{Histogram, HistogramOpts, Registry}; use std::{ sync::Arc, time::{Duration, Instant}, @@ -186,9 +186,11 @@ where sync_service.clone(), ); - task_manager - .spawn_essential_handle() - .spawn("pezcumulus-pov-recovery", None, pov_recovery.run()); + task_manager.spawn_essential_handle().spawn( + "pezcumulus-pov-recovery", + None, + pov_recovery.run(), + ); let teyrchain_informant = teyrchain_informant::( para_id, diff --git a/pezcumulus/client/teyrchain-inherent/src/lib.rs b/pezcumulus/client/teyrchain-inherent/src/lib.rs index 8880b9ed..1fca6553 100644 --- a/pezcumulus/client/teyrchain-inherent/src/lib.rs +++ b/pezcumulus/client/teyrchain-inherent/src/lib.rs @@ -19,6 +19,7 @@ mod mock; use codec::Decode; +pub use mock::{MockValidationDataInherentDataProvider, MockXcmConfig}; use pezcumulus_primitives_core::{ relay_chain::{ self, ApprovedPeerId, Block as RelayBlock, Hash as PHash, Header as RelayHeader, @@ -28,7 +29,6 @@ use pezcumulus_primitives_core::{ }; pub use pezcumulus_primitives_teyrchain_inherent::{TeyrchainInherentData, INHERENT_IDENTIFIER}; use pezcumulus_relay_chain_interface::RelayChainInterface; -pub use mock::{MockValidationDataInherentDataProvider, MockXcmConfig}; use pezsc_network_types::PeerId; const LOG_TARGET: &str = "teyrchain-inherent"; diff --git a/pezcumulus/pezkuwi-omni-node/lib/src/cli.rs b/pezcumulus/pezkuwi-omni-node/lib/src/cli.rs index 9b86243b..5d0b938f 100644 --- a/pezcumulus/pezkuwi-omni-node/lib/src/cli.rs +++ b/pezcumulus/pezkuwi-omni-node/lib/src/cli.rs @@ -30,8 +30,8 @@ use chain_spec_builder::ChainSpecBuilder; use clap::{Command, CommandFactory, FromArgMatches, ValueEnum}; use pezsc_chain_spec::ChainSpec; use pezsc_cli::{ - CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams, NetworkParams, - RpcEndpoint, SharedParams, BizinikiwiCli, + BizinikiwiCli, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams, + NetworkParams, RpcEndpoint, SharedParams, }; use pezsc_service::{config::PrometheusConfig, BasePath}; use pezsc_storage_monitor::StorageMonitorParams; diff --git a/pezcumulus/pezkuwi-omni-node/lib/src/command.rs b/pezcumulus/pezkuwi-omni-node/lib/src/command.rs index d236758c..d13867b7 100644 --- a/pezcumulus/pezkuwi-omni-node/lib/src/command.rs +++ b/pezcumulus/pezkuwi-omni-node/lib/src/command.rs @@ -31,11 +31,11 @@ use crate::{ runtime::BlockNumber, }; use clap::{CommandFactory, FromArgMatches}; +use log::info; #[cfg(feature = "runtime-benchmarks")] use pezcumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions; use pezframe_benchmarking_cli::{BenchmarkCmd, BIZINIKIWI_REFERENCE_HARDWARE}; -use log::info; -use pezsc_cli::{Result, BizinikiwiCli}; +use pezsc_cli::{BizinikiwiCli, Result}; #[cfg(feature = "runtime-benchmarks")] use pezsp_runtime::traits::HashingFor; @@ -138,8 +138,8 @@ where } // If matching on the extra subcommands fails, match on the rest of the node CLI as usual. - let mut cli = - Cli::::from_arg_matches(&matches).map_err(|e| pezsc_cli::Error::Cli(e.into()))?; + let mut cli = Cli::::from_arg_matches(&matches) + .map_err(|e| pezsc_cli::Error::Cli(e.into()))?; cli.chain_spec_loader = Some(cmd_config.chain_spec_loader); #[allow(deprecated)] @@ -273,7 +273,8 @@ where // TODO: change `machine` subcommand to take instead a disk path we want to // benchmark?. let runner = cli.create_runner(cmd)?; - runner.sync_run(|config| cmd.run(&config, BIZINIKIWI_REFERENCE_HARDWARE.clone())) + runner + .sync_run(|config| cmd.run(&config, BIZINIKIWI_REFERENCE_HARDWARE.clone())) }, #[allow(unreachable_patterns)] _ => Err("Benchmarking sub-command unsupported or compilation feature missing. \ diff --git a/pezcumulus/pezkuwi-omni-node/lib/src/common/mod.rs b/pezcumulus/pezkuwi-omni-node/lib/src/common/mod.rs index e30685ff..4fd23614 100644 --- a/pezcumulus/pezkuwi-omni-node/lib/src/common/mod.rs +++ b/pezcumulus/pezkuwi-omni-node/lib/src/common/mod.rs @@ -32,7 +32,6 @@ use crate::cli::AuthoringPolicy; use pezcumulus_primitives_core::{CollectCollationInfo, GetTeyrchainInfo, RelayParentOffsetApi}; use pezsc_client_db::DbHash; use pezsc_offchain::OffchainWorkerApi; -use serde::de::DeserializeOwned; use pezsp_api::{ApiExt, CallApiAt, ConstructRuntimeApi, Metadata}; use pezsp_block_builder::BlockBuilder; use pezsp_runtime::{ @@ -42,6 +41,7 @@ use pezsp_runtime::{ use pezsp_session::SessionKeys; use pezsp_statement_store::runtime_api::ValidateStatement; use pezsp_transaction_pool::runtime_api::TaggedTransactionQueue; +use serde::de::DeserializeOwned; use std::{fmt::Debug, path::PathBuf, str::FromStr}; pub trait NodeBlock: diff --git a/pezcumulus/pezkuwi-omni-node/lib/src/common/rpc.rs b/pezcumulus/pezkuwi-omni-node/lib/src/common/rpc.rs index 5525dce6..04e19e2f 100644 --- a/pezcumulus/pezkuwi-omni-node/lib/src/common/rpc.rs +++ b/pezcumulus/pezkuwi-omni-node/lib/src/common/rpc.rs @@ -22,6 +22,8 @@ use crate::common::{ types::{AccountId, Balance, Nonce, TeyrchainBackend, TeyrchainClient}, ConstructNodeRuntimeApi, }; +use bizinikiwi_frame_rpc_system::{System, SystemApiServer}; +use bizinikiwi_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer}; use pezpallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use pezsc_rpc::{ dev::{Dev, DevApiServer}, @@ -29,8 +31,6 @@ use pezsc_rpc::{ }; use pezsp_runtime::traits::Block as BlockT; use std::{marker::PhantomData, sync::Arc}; -use bizinikiwi_frame_rpc_system::{System, SystemApiServer}; -use bizinikiwi_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer}; /// A type representing all RPC extensions. pub type RpcExtension = jsonrpsee::RpcModule<()>; @@ -63,7 +63,10 @@ where client: Arc>, backend: Arc>, pool: Arc< - pezsc_transaction_pool::TransactionPoolHandle>, + pezsc_transaction_pool::TransactionPoolHandle< + Block, + TeyrchainClient, + >, >, statement_store: Option>, ) -> pezsc_service::error::Result { diff --git a/pezcumulus/pezkuwi-omni-node/lib/src/common/spec.rs b/pezcumulus/pezkuwi-omni-node/lib/src/common/spec.rs index 298c919b..207260df 100644 --- a/pezcumulus/pezkuwi-omni-node/lib/src/common/spec.rs +++ b/pezcumulus/pezkuwi-omni-node/lib/src/common/spec.rs @@ -29,6 +29,8 @@ use crate::{ }, }; use codec::Encode; +use futures::FutureExt; +use log::info; use pezcumulus_client_bootnodes::{start_bootnode_tasks, StartBootnodeTasksParams}; use pezcumulus_client_cli::CollatorOptions; use pezcumulus_client_service::{ @@ -38,10 +40,7 @@ use pezcumulus_client_service::{ }; use pezcumulus_primitives_core::{BlockT, GetTeyrchainInfo, ParaId}; use pezcumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; -use futures::FutureExt; -use log::info; use pezkuwi_primitives::CollatorPair; -use prometheus_endpoint::Registry; use pezsc_client_api::Backend; use pezsc_consensus::DefaultImportQueue; use pezsc_executor::{HeapAllocStrategy, DEFAULT_HEAP_ALLOC_STRATEGY}; @@ -58,6 +57,7 @@ use pezsc_transaction_pool_api::OffchainTransactionPoolFactory; use pezsp_api::{ApiExt, ProvideRuntimeApi}; use pezsp_keystore::KeystorePtr; use pezsp_runtime::traits::AccountIdConversion; +use prometheus_endpoint::Registry; use std::{future::Future, pin::Pin, sync::Arc, time::Duration}; use teyrchains_common::Hash; diff --git a/pezcumulus/pezkuwi-omni-node/lib/src/nodes/aura.rs b/pezcumulus/pezkuwi-omni-node/lib/src/nodes/aura.rs index 7b74635a..4d6fa28f 100644 --- a/pezcumulus/pezkuwi-omni-node/lib/src/nodes/aura.rs +++ b/pezcumulus/pezkuwi-omni-node/lib/src/nodes/aura.rs @@ -31,6 +31,7 @@ use crate::{ }, }; use codec::Encode; +use futures::{prelude::*, FutureExt}; use pezcumulus_client_collator::service::{ CollatorService, ServiceInterface as CollatorServiceInterface, }; @@ -53,9 +54,7 @@ use pezcumulus_primitives_core::{ relay_chain::ValidationCode, CollectCollationInfo, GetTeyrchainInfo, ParaId, }; use pezcumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; -use futures::{prelude::*, FutureExt}; use pezkuwi_primitives::{CollatorPair, UpgradeGoAhead}; -use prometheus_endpoint::Registry; use pezsc_client_api::{Backend, BlockchainEvents}; use pezsc_client_db::DbHash; use pezsc_consensus::{ @@ -76,6 +75,7 @@ use pezsp_runtime::{ app_crypto::AppCrypto, traits::{Block as BlockT, Header as HeaderT, UniqueSaturatedInto}, }; +use prometheus_endpoint::Registry; use std::{marker::PhantomData, sync::Arc, time::Duration}; struct Verifier { @@ -127,8 +127,9 @@ where telemetry_handle: Option, task_manager: &TaskManager, ) -> pezsc_service::error::Result> { - let inherent_data_providers = - move |_, _| async move { Ok(pezsp_timestamp::InherentDataProvider::from_system_time()) }; + let inherent_data_providers = move |_, _| async move { + Ok(pezsp_timestamp::InherentDataProvider::from_system_time()) + }; let registry = config.prometheus_registry(); let spawner = task_manager.spawn_essential_handle(); @@ -229,10 +230,11 @@ where // Since this is a dev node, prevent it from connecting to peers. config.network.default_peers_set.in_peers = 0; config.network.default_peers_set.out_peers = 0; - let net_config = FullNetworkConfiguration::<_, _, pezsc_network::Litep2pNetworkBackend>::new( - &config.network, - None, - ); + let net_config = + FullNetworkConfiguration::<_, _, pezsc_network::Litep2pNetworkBackend>::new( + &config.network, + None, + ); let (network, system_rpc_tx, tx_handler_controller, sync_service) = pezsc_service::build_network(pezsc_service::BuildNetworkParams { @@ -319,12 +321,14 @@ where futures_timer::Delay::new(std::time::Duration::from_millis(block_time)) .await; manual_seal_sink_clone - .try_send(pezsc_consensus_manual_seal::EngineCommand::SealNewBlock { - create_empty: true, - finalize: true, - parent_hash: None, - sender: None, - }) + .try_send( + pezsc_consensus_manual_seal::EngineCommand::SealNewBlock { + create_empty: true, + finalize: true, + parent_hash: None, + sender: None, + }, + ) .unwrap(); } }); diff --git a/pezcumulus/pezkuwi-teyrchain/src/chain_spec/pezkuwichain_teyrchain.rs b/pezcumulus/pezkuwi-teyrchain/src/chain_spec/pezkuwichain_teyrchain.rs index 0a5b7b2f..ad64aa59 100644 --- a/pezcumulus/pezkuwi-teyrchain/src/chain_spec/pezkuwichain_teyrchain.rs +++ b/pezcumulus/pezkuwi-teyrchain/src/chain_spec/pezkuwichain_teyrchain.rs @@ -16,8 +16,8 @@ //! ChainSpecs dedicated to Pezkuwichain teyrchain setups (for testing and example purposes) -use pezcumulus_primitives_core::ParaId; use hex_literal::hex; +use pezcumulus_primitives_core::ParaId; use pezkuwi_omni_node_lib::chain_spec::{Extensions, GenericChainSpec}; use pezkuwichain_teyrchain_runtime::AuraId; use pezsc_chain_spec::ChainType; diff --git a/pezcumulus/pezpallets/ah-ops/src/lib.rs b/pezcumulus/pezpallets/ah-ops/src/lib.rs index 9fa93bcd..20ffe847 100644 --- a/pezcumulus/pezpallets/ah-ops/src/lib.rs +++ b/pezcumulus/pezpallets/ah-ops/src/lib.rs @@ -517,7 +517,10 @@ pub mod pezpallet { acc.consumers = 0; }); // We dont handle sufficients and there should be none - ensure!(pezframe_system::Pezpallet::::sufficients(from) == 0, Error::::InternalError); + ensure!( + pezframe_system::Pezpallet::::sufficients(from) == 0, + Error::::InternalError + ); // Sanity check let total = ::Currency::total_balance(from); diff --git a/pezcumulus/pezpallets/aura-ext/src/test.rs b/pezcumulus/pezpallets/aura-ext/src/test.rs index e98c915d..4a455ccf 100644 --- a/pezcumulus/pezpallets/aura-ext/src/test.rs +++ b/pezcumulus/pezpallets/aura-ext/src/test.rs @@ -22,13 +22,11 @@ use pezcumulus_pezpallet_teyrchain_system::{ }; use pezcumulus_primitives_core::ParaId; use pezframe_support::{ - derive_impl, + derive_impl, parameter_types, pezpallet_prelude::ConstU32, - parameter_types, traits::{ConstBool, EnqueueWithOrigin, ExecuteBlock, Hooks}, BoundedVec, }; -use rstest::rstest; use pezsp_consensus_aura::{sr25519::AuthorityId, Slot}; use pezsp_core::{Blake2Hasher, Get, H256}; use pezsp_io::TestExternalities; @@ -36,6 +34,7 @@ use pezsp_keyring::Sr25519Keyring::*; use pezsp_runtime::{generic::Digest, traits::Block as BlockT}; use pezsp_trie::{proof_size_extension::ProofSizeExt, recorder::Recorder}; use pezsp_version::RuntimeVersion; +use rstest::rstest; use std::cell::RefCell; // Test pezpallet that reads storage and calls storage_proof_size diff --git a/pezcumulus/pezpallets/collator-selection/src/benchmarking.rs b/pezcumulus/pezpallets/collator-selection/src/benchmarking.rs index a67f79cb..978d878a 100644 --- a/pezcumulus/pezpallets/collator-selection/src/benchmarking.rs +++ b/pezcumulus/pezpallets/collator-selection/src/benchmarking.rs @@ -166,7 +166,10 @@ mod benchmarks { // ... and register them. for (who, _) in candidates.iter() { let deposit = CandidacyBond::::get(); - ::Currency::make_free_balance_be(who, deposit * 1000_u32.into()); + ::Currency::make_free_balance_be( + who, + deposit * 1000_u32.into(), + ); CandidateList::::try_mutate(|list| { list.try_push(CandidateInfo { who: who.clone(), deposit }).unwrap(); Ok::<(), BenchmarkError>(()) @@ -242,7 +245,8 @@ mod benchmarks { let bond_amount = if k > 0 { CandidateList::::mutate(|candidates| { for info in candidates.iter_mut().skip(kicked as usize) { - info.deposit = ::Currency::minimum_balance() * 3u32.into(); + info.deposit = + ::Currency::minimum_balance() * 3u32.into(); } }); ::Currency::minimum_balance() * 3u32.into() @@ -297,7 +301,8 @@ mod benchmarks { register_candidates::(c); let caller: T::AccountId = whitelisted_caller(); - let bond: BalanceOf = ::Currency::minimum_balance() * 2u32.into(); + let bond: BalanceOf = + ::Currency::minimum_balance() * 2u32.into(); ::Currency::make_free_balance_be(&caller, bond); >::ensure_can_pay_key_deposit(&caller).unwrap(); @@ -325,7 +330,8 @@ mod benchmarks { register_candidates::(c); let caller: T::AccountId = whitelisted_caller(); - let bond: BalanceOf = ::Currency::minimum_balance() * 10u32.into(); + let bond: BalanceOf = + ::Currency::minimum_balance() * 10u32.into(); ::Currency::make_free_balance_be(&caller, bond); >::ensure_can_pay_key_deposit(&caller).unwrap(); diff --git a/pezcumulus/pezpallets/collator-selection/src/lib.rs b/pezcumulus/pezpallets/collator-selection/src/lib.rs index 05303ed3..d1d64a68 100644 --- a/pezcumulus/pezpallets/collator-selection/src/lib.rs +++ b/pezcumulus/pezpallets/collator-selection/src/lib.rs @@ -20,8 +20,8 @@ //! ## Overview //! //! The Collator Selection pezpallet manages the collators of a teyrchain. **Collation is _not_ a -//! secure activity** and this pezpallet does not implement any game-theoretic mechanisms to meet BFT -//! safety assumptions of the chosen set. +//! secure activity** and this pezpallet does not implement any game-theoretic mechanisms to meet +//! BFT safety assumptions of the chosen set. //! //! ## Terminology //! @@ -142,7 +142,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// Overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The currency mechanism. type Currency: ReservableCurrency; diff --git a/pezcumulus/pezpallets/collator-selection/src/migration.rs b/pezcumulus/pezpallets/collator-selection/src/migration.rs index 99b669d0..05bee59a 100644 --- a/pezcumulus/pezpallets/collator-selection/src/migration.rs +++ b/pezcumulus/pezpallets/collator-selection/src/migration.rs @@ -19,8 +19,8 @@ use super::*; #[cfg(feature = "try-runtime")] use alloc::vec::Vec; -use pezframe_support::traits::{OnRuntimeUpgrade, UncheckedOnRuntimeUpgrade}; use log; +use pezframe_support::traits::{OnRuntimeUpgrade, UncheckedOnRuntimeUpgrade}; /// Migrate to v2. Should have been part of . pub mod v2 { @@ -44,15 +44,26 @@ pub mod v2 { >; #[storage_alias] - pub type Candidates = StorageValue< - Pezpallet, - BoundedVec::AccountId, <::Currency as Currency<::AccountId>>::Balance>, ::MaxCandidates>, - ValueQuery, - >; + pub type Candidates = + StorageValue< + Pezpallet, + BoundedVec< + CandidateInfo< + ::AccountId, + <::Currency as Currency< + ::AccountId, + >>::Balance, + >, + ::MaxCandidates, + >, + ValueQuery, + >; /// Migrate to V2. pub struct UncheckedMigrationToV2(PhantomData); - impl UncheckedOnRuntimeUpgrade for UncheckedMigrationToV2 { + impl UncheckedOnRuntimeUpgrade + for UncheckedMigrationToV2 + { fn on_runtime_upgrade() -> Weight { let mut weight = Weight::zero(); let mut count: u64 = 0; @@ -107,7 +118,9 @@ pub mod v2 { } #[cfg(feature = "try-runtime")] - fn post_upgrade(_number_of_candidates: Vec) -> Result<(), pezsp_runtime::DispatchError> { + fn post_upgrade( + _number_of_candidates: Vec, + ) -> Result<(), pezsp_runtime::DispatchError> { let new_number_of_candidates = Candidates::::get().to_vec().len(); assert_eq!( new_number_of_candidates, 0 as usize, @@ -160,7 +173,9 @@ pub mod v1 { } #[cfg(feature = "try-runtime")] - fn post_upgrade(number_of_invulnerables: Vec) -> Result<(), pezsp_runtime::DispatchError> { + fn post_upgrade( + number_of_invulnerables: Vec, + ) -> Result<(), pezsp_runtime::DispatchError> { let stored_invulnerables = Invulnerables::::get().to_vec(); let mut sorted_invulnerables = stored_invulnerables.clone(); sorted_invulnerables.sort(); diff --git a/pezcumulus/pezpallets/dmp-queue/src/lib.rs b/pezcumulus/pezpallets/dmp-queue/src/lib.rs index c52d29dd..01c05999 100644 --- a/pezcumulus/pezpallets/dmp-queue/src/lib.rs +++ b/pezcumulus/pezpallets/dmp-queue/src/lib.rs @@ -60,7 +60,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type of the runtime. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The sink for all DMP messages that the lazy migration will use. type DmpSink: HandleMessage; diff --git a/pezcumulus/pezpallets/session-benchmarking/src/inner.rs b/pezcumulus/pezpallets/session-benchmarking/src/inner.rs index c7994eb5..e8ede64c 100644 --- a/pezcumulus/pezpallets/session-benchmarking/src/inner.rs +++ b/pezcumulus/pezpallets/session-benchmarking/src/inner.rs @@ -33,7 +33,8 @@ mod benchmarks { fn set_keys() -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); pezframe_system::Pezpallet::::inc_providers(&caller); - let keys = T::Keys::decode(&mut pezsp_runtime::traits::TrailingZeroInput::zeroes()).unwrap(); + let keys = + T::Keys::decode(&mut pezsp_runtime::traits::TrailingZeroInput::zeroes()).unwrap(); let proof: Vec = vec![0, 1, 2, 3]; >::ensure_can_pay_key_deposit(&caller).unwrap(); @@ -47,7 +48,8 @@ mod benchmarks { fn purge_keys() -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); pezframe_system::Pezpallet::::inc_providers(&caller); - let keys = T::Keys::decode(&mut pezsp_runtime::traits::TrailingZeroInput::zeroes()).unwrap(); + let keys = + T::Keys::decode(&mut pezsp_runtime::traits::TrailingZeroInput::zeroes()).unwrap(); let proof: Vec = vec![0, 1, 2, 3]; >::ensure_can_pay_key_deposit(&caller).unwrap(); let _t = pezpallet_session::Pezpallet::::set_keys( diff --git a/pezcumulus/pezpallets/solo-to-para/src/lib.rs b/pezcumulus/pezpallets/solo-to-para/src/lib.rs index b2cadfe6..2d6a9203 100644 --- a/pezcumulus/pezpallets/solo-to-para/src/lib.rs +++ b/pezcumulus/pezpallets/solo-to-para/src/lib.rs @@ -22,8 +22,8 @@ use alloc::vec::Vec; use pezcumulus_pezpallet_teyrchain_system as teyrchain_system; use pezframe_support::pezpallet_prelude::*; use pezframe_system::pezpallet_prelude::*; -pub use pezpallet::*; use pezkuwi_primitives::PersistedValidationData; +pub use pezpallet::*; #[pezframe_support::pezpallet] pub mod pezpallet { diff --git a/pezcumulus/pezpallets/teyrchain-system/src/descendant_validation.rs b/pezcumulus/pezpallets/teyrchain-system/src/descendant_validation.rs index cf9a5515..29d1e928 100644 --- a/pezcumulus/pezpallets/teyrchain-system/src/descendant_validation.rs +++ b/pezcumulus/pezpallets/teyrchain-system/src/descendant_validation.rs @@ -215,7 +215,6 @@ mod tests { use codec::{Decode, Encode}; use pezcumulus_primitives_core::relay_chain; use pezcumulus_test_relay_sproof_builder::RelayStateSproofBuilder; - use rstest::rstest; use pezsp_consensus_babe::{ digests::{CompatibleDigestItem, NextEpochDescriptor, PreDigest, PrimaryPreDigest}, AuthorityId, AuthorityPair, BabeAuthorityWeight, ConsensusLog, BABE_ENGINE_ID, @@ -226,6 +225,7 @@ mod tests { }; use pezsp_keyring::Sr25519Keyring; use pezsp_runtime::{testing::Header as TestHeader, DigestItem}; + use rstest::rstest; const PARA_ID: u32 = 2000; /// Verify a header chain with different lengths and different number of authorities included in diff --git a/pezcumulus/pezpallets/teyrchain-system/src/lib.rs b/pezcumulus/pezpallets/teyrchain-system/src/lib.rs index 84054c51..e4112c79 100644 --- a/pezcumulus/pezpallets/teyrchain-system/src/lib.rs +++ b/pezcumulus/pezpallets/teyrchain-system/src/lib.rs @@ -50,11 +50,11 @@ use pezframe_support::{ use pezframe_system::{ensure_none, ensure_root, pezpallet_prelude::HeaderFor}; use pezkuwi_runtime_teyrchains::{FeeTracker, GetMinFeeFactor}; use pezkuwi_teyrchain_primitives::primitives::RelayChainBlockNumber; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{BlockNumberProvider, Hash}, FixedU128, RuntimeDebug, SaturatedConversion, }; +use scale_info::TypeInfo; use teyrchain_inherent::{ deconstruct_teyrchain_inherent_data, AbridgedInboundDownwardMessages, AbridgedInboundHrmpMessages, BasicTeyrchainInherentData, InboundMessageId, InboundMessagesData, @@ -201,7 +201,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config> { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Something which can be notified when the validation data is set. type OnSystemEvent: OnSystemEvent; @@ -796,8 +797,8 @@ pub mod pezpallet { /// applied. /// /// As soon as the relay chain gives us the go-ahead signal, we will overwrite the - /// [`:code`][pezsp_core::storage::well_known_keys::CODE] which will result the next block process - /// with the new validation code. This concludes the upgrade process. + /// [`:code`][pezsp_core::storage::well_known_keys::CODE] which will result the next block + /// process with the new validation code. This concludes the upgrade process. #[pezpallet::storage] pub type PendingValidationCode = StorageValue<_, Vec, ValueQuery>; @@ -811,7 +812,8 @@ pub mod pezpallet { /// The [`PersistedValidationData`] set for this block. /// - /// This value is expected to be set only once by the [`Pezpallet::set_validation_data`] inherent. + /// This value is expected to be set only once by the [`Pezpallet::set_validation_data`] + /// inherent. #[pezpallet::storage] pub type ValidationData = StorageValue<_, PersistedValidationData>; diff --git a/pezcumulus/pezpallets/teyrchain-system/src/mock.rs b/pezcumulus/pezpallets/teyrchain-system/src/mock.rs index 231f8ccf..5502e05c 100644 --- a/pezcumulus/pezpallets/teyrchain-system/src/mock.rs +++ b/pezcumulus/pezpallets/teyrchain-system/src/mock.rs @@ -224,7 +224,10 @@ pub fn new_test_ext() -> pezsp_io::TestExternalities { HANDLED_DMP_MESSAGES.with(|m| m.borrow_mut().clear()); HANDLED_XCMP_MESSAGES.with(|m| m.borrow_mut().clear()); - pezframe_system::GenesisConfig::::default().build_storage().unwrap().into() + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } #[allow(dead_code)] diff --git a/pezcumulus/pezpallets/teyrchain-system/src/relay_state_snapshot.rs b/pezcumulus/pezpallets/teyrchain-system/src/relay_state_snapshot.rs index 00790773..b6f29f74 100644 --- a/pezcumulus/pezpallets/teyrchain-system/src/relay_state_snapshot.rs +++ b/pezcumulus/pezpallets/teyrchain-system/src/relay_state_snapshot.rs @@ -21,10 +21,10 @@ use codec::{Decode, Encode}; use pezcumulus_primitives_core::{ relay_chain, AbridgedHostConfiguration, AbridgedHrmpChannel, ParaId, }; -use scale_info::TypeInfo; use pezsp_runtime::traits::HashingFor; use pezsp_state_machine::{Backend, TrieBackend, TrieBackendBuilder}; use pezsp_trie::{HashDBT, MemoryDB, StorageProof, EMPTY_PREFIX}; +use scale_info::TypeInfo; /// The capacity of the upward message queue of a teyrchain on the relay chain. // The field order should stay the same as the data can be found in the proof to ensure both are @@ -300,8 +300,10 @@ impl RelayChainStateProof { /// Read relay chain authorities. pub fn read_authorities( &self, - ) -> Result, Error> - { + ) -> Result< + Vec<(pezsp_consensus_babe::AuthorityId, pezsp_consensus_babe::BabeAuthorityWeight)>, + Error, + > { read_entry(&self.trie_backend, &relay_chain::well_known_keys::AUTHORITIES, None) .map_err(Error::Authorities) } diff --git a/pezcumulus/pezpallets/teyrchain-system/src/tests.rs b/pezcumulus/pezpallets/teyrchain-system/src/tests.rs index c7c983b5..72173b0c 100755 --- a/pezcumulus/pezpallets/teyrchain-system/src/tests.rs +++ b/pezcumulus/pezpallets/teyrchain-system/src/tests.rs @@ -21,6 +21,7 @@ use crate::mock::*; use alloc::collections::BTreeMap; use core::num::NonZeroU32; +use hex_literal::hex; use pezcumulus_primitives_core::{ relay_chain::ApprovedPeerId, AbridgedHrmpChannel, ClaimQueueOffset, CoreInfo, CoreSelector, InboundDownwardMessage, InboundHrmpMessage, CUMULUS_CONSENSUS_ID, @@ -30,13 +31,12 @@ use pezcumulus_primitives_teyrchain_inherent::{ }; use pezframe_support::{assert_ok, parameter_types, weights::Weight}; use pezframe_system::RawOrigin; -use hex_literal::hex; -use rand::Rng; -use relay_chain::HrmpChannelId; use pezsp_core::H256; use pezsp_inherents::InherentDataProvider; use pezsp_runtime::DigestItem; use pezsp_trie::StorageProof; +use rand::Rng; +use relay_chain::HrmpChannelId; #[test] #[should_panic] @@ -894,7 +894,10 @@ fn runtime_upgrade_events() { || { let events = System::events(); - assert_eq!(events[0].event, RuntimeEvent::System(pezframe_system::Event::CodeUpdated)); + assert_eq!( + events[0].event, + RuntimeEvent::System(pezframe_system::Event::CodeUpdated) + ); assert_eq!( events[1].event, @@ -1576,7 +1579,9 @@ fn upgrade_version_checks_should_work() { let read_runtime_version = ReadRuntimeVersion(version.encode()); let mut ext = new_test_ext(); - ext.register_extension(pezsp_core::traits::ReadRuntimeVersionExt::new(read_runtime_version)); + ext.register_extension(pezsp_core::traits::ReadRuntimeVersionExt::new( + read_runtime_version, + )); ext.execute_with(|| { System::set_block_number(1); diff --git a/pezcumulus/pezpallets/teyrchain-system/src/teyrchain_inherent.rs b/pezcumulus/pezpallets/teyrchain-system/src/teyrchain_inherent.rs index d818302d..f3e1bbd1 100644 --- a/pezcumulus/pezpallets/teyrchain-system/src/teyrchain_inherent.rs +++ b/pezcumulus/pezpallets/teyrchain-system/src/teyrchain_inherent.rs @@ -29,8 +29,8 @@ use pezframe_support::{ defensive, pezpallet_prelude::{Decode, DecodeWithMemTracking, Encode}, }; -use scale_info::TypeInfo; use pezsp_core::{bounded::BoundedSlice, Get}; +use scale_info::TypeInfo; /// A structure that helps identify a message inside a collection of messages sorted by `sent_at`. /// diff --git a/pezcumulus/pezpallets/teyrchain-system/src/unincluded_segment.rs b/pezcumulus/pezpallets/teyrchain-system/src/unincluded_segment.rs index 0aae65cb..0bbe3015 100644 --- a/pezcumulus/pezpallets/teyrchain-system/src/unincluded_segment.rs +++ b/pezcumulus/pezpallets/teyrchain-system/src/unincluded_segment.rs @@ -25,8 +25,8 @@ use alloc::collections::btree_map::BTreeMap; use codec::{Decode, Encode}; use core::marker::PhantomData; use pezcumulus_primitives_core::{relay_chain, ParaId}; -use scale_info::TypeInfo; use pezsp_runtime::RuntimeDebug; +use scale_info::TypeInfo; /// Constraints on outbound HRMP channel. #[derive(Clone, RuntimeDebug)] diff --git a/pezcumulus/pezpallets/teyrchain-system/src/validate_block/trie_recorder.rs b/pezcumulus/pezpallets/teyrchain-system/src/validate_block/trie_recorder.rs index 3a2d42d6..a875cd0f 100644 --- a/pezcumulus/pezpallets/teyrchain-system/src/validate_block/trie_recorder.rs +++ b/pezcumulus/pezpallets/teyrchain-system/src/validate_block/trie_recorder.rs @@ -144,11 +144,11 @@ unsafe impl Sync for SizeOnlyRecorderProvider {} #[cfg(test)] mod tests { - use rand::Rng; use pezsp_trie::{ cache::{CacheSize, SharedTrieCache}, MemoryDB, ProofSizeProvider, TrieRecorderProvider, }; + use rand::Rng; use trie_db::{Trie, TrieDBBuilder, TrieDBMutBuilder, TrieHash, TrieMut, TrieRecorder}; use trie_standardmap::{Alphabet, StandardMap, ValueMode}; @@ -213,19 +213,23 @@ mod tests { let mut trie_cache_for_reference = local_cache.as_trie_db_cache(root); let mut reference_trie_recorder = reference_recorder.as_trie_recorder(root); let reference_trie = - TrieDBBuilder::>::new(&db, &root) - .with_recorder(&mut reference_trie_recorder) - .with_cache(&mut trie_cache_for_reference) - .build(); + TrieDBBuilder::>::new( + &db, &root, + ) + .with_recorder(&mut reference_trie_recorder) + .with_cache(&mut trie_cache_for_reference) + .build(); let local_cache_for_test = reference_cache.local_cache_untrusted(); let mut trie_cache_for_test = local_cache_for_test.as_trie_db_cache(root); let mut trie_recorder_under_test = recorder_for_test.as_trie_recorder(root); let test_trie = - TrieDBBuilder::>::new(&db, &root) - .with_recorder(&mut trie_recorder_under_test) - .with_cache(&mut trie_cache_for_test) - .build(); + TrieDBBuilder::>::new( + &db, &root, + ) + .with_recorder(&mut trie_recorder_under_test) + .with_cache(&mut trie_cache_for_test) + .build(); // Access random values from the test data for _ in 0..100 { @@ -262,15 +266,19 @@ mod tests { { let mut reference_trie_recorder = reference_recorder.as_trie_recorder(root); let reference_trie = - TrieDBBuilder::>::new(&db, &root) - .with_recorder(&mut reference_trie_recorder) - .build(); + TrieDBBuilder::>::new( + &db, &root, + ) + .with_recorder(&mut reference_trie_recorder) + .build(); let mut trie_recorder_under_test = recorder_for_test.as_trie_recorder(root); let test_trie = - TrieDBBuilder::>::new(&db, &root) - .with_recorder(&mut trie_recorder_under_test) - .build(); + TrieDBBuilder::>::new( + &db, &root, + ) + .with_recorder(&mut trie_recorder_under_test) + .build(); for _ in 0..200 { let index: usize = rng.gen_range(0..test_data.len()); diff --git a/pezcumulus/pezpallets/weight-reclaim/src/benchmarks.rs b/pezcumulus/pezpallets/weight-reclaim/src/benchmarks.rs index c5796ff9..a0507cb7 100644 --- a/pezcumulus/pezpallets/weight-reclaim/src/benchmarks.rs +++ b/pezcumulus/pezpallets/weight-reclaim/src/benchmarks.rs @@ -67,5 +67,9 @@ mod bench { ); } - impl_benchmark_test_suite!(Pezpallet, crate::tests::setup_test_ext_default(), crate::tests::Test); + impl_benchmark_test_suite!( + Pezpallet, + crate::tests::setup_test_ext_default(), + crate::tests::Test + ); } diff --git a/pezcumulus/pezpallets/weight-reclaim/src/lib.rs b/pezcumulus/pezpallets/weight-reclaim/src/lib.rs index 481e0f2e..126c67d5 100644 --- a/pezcumulus/pezpallets/weight-reclaim/src/lib.rs +++ b/pezcumulus/pezpallets/weight-reclaim/src/lib.rs @@ -14,8 +14,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Pezpallet and transaction extensions to reclaim PoV proof size weight after an extrinsic has been -//! applied. +//! Pezpallet and transaction extensions to reclaim PoV proof size weight after an extrinsic has +//! been applied. //! //! This crate provides: //! * [`StorageWeightReclaim`] transaction extension: it must wrap the whole transaction extension @@ -28,19 +28,19 @@ extern crate alloc; #[cfg(not(feature = "std"))] use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode}; -use pezcumulus_primitives_storage_weight_reclaim::get_proof_size; use derive_where::derive_where; +use pezcumulus_primitives_storage_weight_reclaim::get_proof_size; use pezframe_support::{ dispatch::{DispatchInfo, PostDispatchInfo}, pezpallet_prelude::Weight, traits::Defensive, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{DispatchInfoOf, Dispatchable, Implication, PostDispatchInfoOf, TransactionExtension}, transaction_validity::{TransactionSource, TransactionValidityError, ValidTransaction}, DispatchResult, }; +use scale_info::TypeInfo; #[cfg(feature = "runtime-benchmarks")] pub mod benchmarks; @@ -53,8 +53,8 @@ pub use weights::WeightInfo; const LOG_TARGET: &'static str = "runtime::storage_reclaim_pallet"; -/// Pezpallet to use alongside the transaction extension [`StorageWeightReclaim`], the pezpallet provides -/// weight information and benchmarks. +/// Pezpallet to use alongside the transaction extension [`StorageWeightReclaim`], the pezpallet +/// provides weight information and benchmarks. #[pezframe_support::pezpallet] pub mod pezpallet { use super::*; @@ -233,34 +233,37 @@ where let accurate_weight = benchmarked_actual_weight.set_proof_size(measured_proof_size); - let pov_size_missing_from_node = pezframe_system::BlockWeight::::mutate(|current_weight| { - let already_reclaimed = pezframe_system::ExtrinsicWeightReclaimed::::get(); - current_weight.accrue(already_reclaimed, info.class); - current_weight.reduce(info.total_weight(), info.class); - current_weight.accrue(accurate_weight, info.class); + let pov_size_missing_from_node = + pezframe_system::BlockWeight::::mutate(|current_weight| { + let already_reclaimed = pezframe_system::ExtrinsicWeightReclaimed::::get(); + current_weight.accrue(already_reclaimed, info.class); + current_weight.reduce(info.total_weight(), info.class); + current_weight.accrue(accurate_weight, info.class); - // If we encounter a situation where the node-side proof size is already higher than - // what we have in the runtime bookkeeping, we add the difference to the `BlockWeight`. - // This prevents that the proof size grows faster than the runtime proof size. - let extrinsic_len = pezframe_system::AllExtrinsicsLen::::get().unwrap_or(0); - let node_side_pov_size = proof_size_after_dispatch.saturating_add(extrinsic_len.into()); - let block_weight_proof_size = current_weight.total().proof_size(); - let pov_size_missing_from_node = - node_side_pov_size.saturating_sub(block_weight_proof_size); - if pov_size_missing_from_node > 0 { - log::warn!( - target: LOG_TARGET, - "Node-side PoV size higher than runtime proof size weight. node-side: \ - {node_side_pov_size} extrinsic_len: {extrinsic_len} runtime: \ - {block_weight_proof_size}, missing: {pov_size_missing_from_node}. Setting to \ - node-side proof size." - ); - current_weight - .accrue(Weight::from_parts(0, pov_size_missing_from_node), info.class); - } + // If we encounter a situation where the node-side proof size is already higher than + // what we have in the runtime bookkeeping, we add the difference to the + // `BlockWeight`. This prevents that the proof size grows faster than the + // runtime proof size. + let extrinsic_len = pezframe_system::AllExtrinsicsLen::::get().unwrap_or(0); + let node_side_pov_size = + proof_size_after_dispatch.saturating_add(extrinsic_len.into()); + let block_weight_proof_size = current_weight.total().proof_size(); + let pov_size_missing_from_node = + node_side_pov_size.saturating_sub(block_weight_proof_size); + if pov_size_missing_from_node > 0 { + log::warn!( + target: LOG_TARGET, + "Node-side PoV size higher than runtime proof size weight. node-side: \ + {node_side_pov_size} extrinsic_len: {extrinsic_len} runtime: \ + {block_weight_proof_size}, missing: {pov_size_missing_from_node}. Setting to \ + node-side proof size." + ); + current_weight + .accrue(Weight::from_parts(0, pov_size_missing_from_node), info.class); + } - pov_size_missing_from_node - }); + pov_size_missing_from_node + }); // The saturation will happen if the pre-dispatch weight is underestimating the proof // size or if the node-side proof size is higher than expected. diff --git a/pezcumulus/pezpallets/weight-reclaim/src/tests.rs b/pezcumulus/pezpallets/weight-reclaim/src/tests.rs index 5a3ede33..65cc6baa 100644 --- a/pezcumulus/pezpallets/weight-reclaim/src/tests.rs +++ b/pezcumulus/pezpallets/weight-reclaim/src/tests.rs @@ -73,8 +73,10 @@ impl TransactionExtension for MockExtensionWithRefund { pezsp_runtime::impl_tx_ext_default!(RuntimeCall; validate prepare); } -pub type Tx = - crate::StorageWeightReclaim, MockExtensionWithRefund)>; +pub type Tx = crate::StorageWeightReclaim< + Test, + (pezframe_system::CheckWeight, MockExtensionWithRefund), +>; type AccountId = u64; type Extrinsic = generic::UncheckedExtrinsic; type Block = generic::Block, Extrinsic>; @@ -960,7 +962,9 @@ fn test_pov_missing_from_node_reclaim() { // Assert the results. assert_eq!( - pezframe_system::BlockWeight::::get().get(DispatchClass::Normal).proof_size(), + pezframe_system::BlockWeight::::get() + .get(DispatchClass::Normal) + .proof_size(), node_post_dispatch + len, ); assert_eq!( @@ -1027,7 +1031,9 @@ fn test_ref_time_weight_reclaim() { // Assert the results. assert_eq!( - pezframe_system::BlockWeight::::get().get(DispatchClass::Normal).ref_time(), + pezframe_system::BlockWeight::::get() + .get(DispatchClass::Normal) + .ref_time(), block_pre_dispatch + base_extrinsic.ref_time() + bench_post_dispatch_actual + diff --git a/pezcumulus/pezpallets/xcm/src/lib.rs b/pezcumulus/pezpallets/xcm/src/lib.rs index af94e390..b076e44d 100644 --- a/pezcumulus/pezpallets/xcm/src/lib.rs +++ b/pezcumulus/pezpallets/xcm/src/lib.rs @@ -23,8 +23,8 @@ use codec::{Decode, Encode}; use pezcumulus_primitives_core::ParaId; pub use pezpallet::*; -use scale_info::TypeInfo; use pezsp_runtime::{traits::BadOrigin, RuntimeDebug}; +use scale_info::TypeInfo; use xcm::latest::{ExecuteXcm, Outcome}; #[pezframe_support::pezpallet] @@ -40,7 +40,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type XcmExecutor: ExecuteXcm; } diff --git a/pezcumulus/pezpallets/xcmp-queue/src/lib.rs b/pezcumulus/pezpallets/xcmp-queue/src/lib.rs index 87f019be..552ce397 100644 --- a/pezcumulus/pezpallets/xcmp-queue/src/lib.rs +++ b/pezcumulus/pezpallets/xcmp-queue/src/lib.rs @@ -71,12 +71,12 @@ use pezframe_support::{ }, weights::{Weight, WeightMeter}, }; -use pezpallet_message_queue::OnQueueChanged; use pezkuwi_runtime_common::xcm_sender::PriceForMessageDelivery; use pezkuwi_runtime_teyrchains::{FeeTracker, GetMinFeeFactor}; -use scale_info::TypeInfo; +use pezpallet_message_queue::OnQueueChanged; use pezsp_core::MAX_POSSIBLE_ALLOCATION; use pezsp_runtime::{FixedU128, RuntimeDebug, SaturatedConversion, WeakBoundedVec}; +use scale_info::TypeInfo; use xcm::{latest::prelude::*, VersionedLocation, VersionedXcm, WrapVersion, MAX_XCM_DECODE_DEPTH}; use xcm_builder::InspectMessageQueues; use xcm_executor::traits::ConvertOrigin; @@ -115,7 +115,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Information on the available XCMP channels. type ChannelInfo: GetChannelInfo; @@ -125,8 +126,8 @@ pub mod pezpallet { /// Enqueue an inbound horizontal message for later processing. /// - /// This defines the maximal message length via [`crate::MaxXcmpMessageLenOf`]. The pezpallet - /// assumes that this hook will eventually process all the pushed messages. + /// This defines the maximal message length via [`crate::MaxXcmpMessageLenOf`]. The + /// pezpallet assumes that this hook will eventually process all the pushed messages. type XcmpQueue: EnqueueMessage + QueueFootprintQuery>; diff --git a/pezcumulus/pezpallets/xcmp-queue/src/migration.rs b/pezcumulus/pezpallets/xcmp-queue/src/migration.rs index 2f5a9514..d5d823b0 100644 --- a/pezcumulus/pezpallets/xcmp-queue/src/migration.rs +++ b/pezcumulus/pezpallets/xcmp-queue/src/migration.rs @@ -37,7 +37,8 @@ mod v1 { use codec::{Decode, Encode}; #[pezframe_support::storage_alias] - pub(crate) type QueueConfig = StorageValue, QueueConfigData, ValueQuery>; + pub(crate) type QueueConfig = + StorageValue, QueueConfigData, ValueQuery>; #[derive(Encode, Decode, Debug)] pub struct QueueConfigData { @@ -67,7 +68,8 @@ pub mod v2 { use super::*; #[pezframe_support::storage_alias] - pub(crate) type QueueConfig = StorageValue, QueueConfigData, ValueQuery>; + pub(crate) type QueueConfig = + StorageValue, QueueConfigData, ValueQuery>; #[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] pub struct QueueConfigData { diff --git a/pezcumulus/pezpallets/xcmp-queue/src/mock.rs b/pezcumulus/pezpallets/xcmp-queue/src/mock.rs index 2b588c7d..96028cd8 100644 --- a/pezcumulus/pezpallets/xcmp-queue/src/mock.rs +++ b/pezcumulus/pezpallets/xcmp-queue/src/mock.rs @@ -104,7 +104,8 @@ impl pezcumulus_pezpallet_teyrchain_system::Config for Test { type XcmpMessageHandler = XcmpQueue; type ReservedXcmpWeight = (); type CheckAssociatedRelayNumber = AnyRelayNumber; - type ConsensusHook = pezcumulus_pezpallet_teyrchain_system::consensus_hook::ExpectParentIncluded; + type ConsensusHook = + pezcumulus_pezpallet_teyrchain_system::consensus_hook::ExpectParentIncluded; type RelayParentOffset = ConstU32<0>; } @@ -246,7 +247,10 @@ impl Config for Test { } pub fn new_test_ext() -> pezsp_io::TestExternalities { - pezframe_system::GenesisConfig::::default().build_storage().unwrap().into() + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } /// A para that we have an HRMP channel with. diff --git a/pezcumulus/pezpallets/xcmp-queue/src/tests.rs b/pezcumulus/pezpallets/xcmp-queue/src/tests.rs index f9a7b620..6a9f2f27 100644 --- a/pezcumulus/pezpallets/xcmp-queue/src/tests.rs +++ b/pezcumulus/pezpallets/xcmp-queue/src/tests.rs @@ -21,13 +21,13 @@ use std::collections::BTreeMap; use XcmpMessageFormat::*; use codec::Input; +use mock::{new_test_ext, FirstPagePos, RuntimeOrigin as Origin, Test, TeyrchainSystem, XcmpQueue}; use pezcumulus_primitives_core::{ParaId, XcmpMessageHandler}; use pezframe_support::{ assert_err, assert_noop, assert_ok, assert_storage_noop, hypothetically, traits::{BatchFootprint, Hooks}, StorageNoopGuard, }; -use mock::{new_test_ext, FirstPagePos, RuntimeOrigin as Origin, Test, TeyrchainSystem, XcmpQueue}; use pezsp_runtime::traits::{BadOrigin, Zero}; use std::iter::{once, repeat}; use xcm::{MAX_INSTRUCTIONS_TO_DECODE, MAX_XCM_DECODE_DEPTH}; diff --git a/pezcumulus/primitives/core/src/lib.rs b/pezcumulus/primitives/core/src/lib.rs index c5caddbf..93a8f9e4 100644 --- a/pezcumulus/primitives/core/src/lib.rs +++ b/pezcumulus/primitives/core/src/lib.rs @@ -23,8 +23,8 @@ extern crate alloc; use alloc::vec::Vec; use codec::{Compact, Decode, DecodeAll, DecodeWithMemTracking, Encode, MaxEncodedLen}; use pezkuwi_teyrchain_primitives::primitives::HeadData; -use scale_info::TypeInfo; use pezsp_runtime::RuntimeDebug; +use scale_info::TypeInfo; /// The ref time per core in seconds. /// diff --git a/pezcumulus/primitives/storage-weight-reclaim/src/lib.rs b/pezcumulus/primitives/storage-weight-reclaim/src/lib.rs index 23107825..0f58c205 100644 --- a/pezcumulus/primitives/storage-weight-reclaim/src/lib.rs +++ b/pezcumulus/primitives/storage-weight-reclaim/src/lib.rs @@ -28,13 +28,13 @@ use pezframe_support::{ weights::WeightMeter, }; use pezframe_system::Config; -use scale_info::TypeInfo; use pezsp_runtime::{ impl_tx_ext_default, traits::{DispatchInfoOf, Dispatchable, PostDispatchInfoOf, TransactionExtension}, transaction_validity::TransactionValidityError, DispatchResult, }; +use scale_info::TypeInfo; #[cfg(test)] mod tests; diff --git a/pezcumulus/primitives/storage-weight-reclaim/src/tests.rs b/pezcumulus/primitives/storage-weight-reclaim/src/tests.rs index 6c5498ad..e1084d56 100644 --- a/pezcumulus/primitives/storage-weight-reclaim/src/tests.rs +++ b/pezcumulus/primitives/storage-weight-reclaim/src/tests.rs @@ -26,7 +26,9 @@ use pezsp_trie::proof_size_extension::ProofSizeExt; type Test = pezcumulus_test_runtime::Runtime; const CALL: &::RuntimeCall = - &pezcumulus_test_runtime::RuntimeCall::System(pezframe_system::Call::set_heap_pages { pages: 0u64 }); + &pezcumulus_test_runtime::RuntimeCall::System(pezframe_system::Call::set_heap_pages { + pages: 0u64, + }); const ALICE: AccountId32 = AccountId32::new([1u8; 32]); const LEN: usize = 150; diff --git a/pezcumulus/primitives/teyrchain-inherent/src/lib.rs b/pezcumulus/primitives/teyrchain-inherent/src/lib.rs index 50797542..b04dc219 100644 --- a/pezcumulus/primitives/teyrchain-inherent/src/lib.rs +++ b/pezcumulus/primitives/teyrchain-inherent/src/lib.rs @@ -37,8 +37,8 @@ use pezcumulus_primitives_core::{ }, InboundDownwardMessage, InboundHrmpMessage, ParaId, PersistedValidationData, }; -use scale_info::TypeInfo; use pezsp_inherents::InherentIdentifier; +use scale_info::TypeInfo; /// The identifier for the teyrchain inherent. pub const TEYRCHAIN_INHERENT_IDENTIFIER_V0: InherentIdentifier = *b"sysi1337"; diff --git a/pezcumulus/primitives/utility/src/lib.rs b/pezcumulus/primitives/utility/src/lib.rs index 7c753f4c..ffc09fce 100644 --- a/pezcumulus/primitives/utility/src/lib.rs +++ b/pezcumulus/primitives/utility/src/lib.rs @@ -31,8 +31,8 @@ use pezframe_support::{ weights::{Weight, WeightToFee as WeightToFeeT}, CloneNoBound, }; -use pezpallet_asset_conversion::SwapCredit as SwapCreditT; use pezkuwi_runtime_common::xcm_sender::PriceForMessageDelivery; +use pezpallet_asset_conversion::SwapCredit as SwapCreditT; use pezsp_runtime::{ traits::{Saturating, Zero}, SaturatedConversion, diff --git a/pezcumulus/primitives/utility/src/tests/swap_first.rs b/pezcumulus/primitives/utility/src/tests/swap_first.rs index 87b56323..b97fe8e5 100644 --- a/pezcumulus/primitives/utility/src/tests/swap_first.rs +++ b/pezcumulus/primitives/utility/src/tests/swap_first.rs @@ -15,8 +15,8 @@ // limitations under the License. use crate::*; -use pezframe_support::{parameter_types, traits::fungibles::Inspect}; use mock::{setup_pool, AccountId, AssetId, Balance, Fungibles}; +use pezframe_support::{parameter_types, traits::fungibles::Inspect}; use xcm::latest::AssetId as XcmAssetId; use xcm_executor::AssetsInHolding; diff --git a/pezcumulus/test/client/src/lib.rs b/pezcumulus/test/client/src/lib.rs index 982654ad..2d4835d7 100644 --- a/pezcumulus/test/client/src/lib.rs +++ b/pezcumulus/test/client/src/lib.rs @@ -17,6 +17,7 @@ //! A Pezcumulus test client. mod block_builder; +pub use bizinikiwi_test_client::*; pub use block_builder::*; use codec::{Decode, Encode}; pub use pezcumulus_test_runtime as runtime; @@ -24,10 +25,6 @@ use pezcumulus_test_runtime::AuraId; pub use pezkuwi_teyrchain_primitives::primitives::{ BlockData, HeadData, ValidationParams, ValidationResult, }; -use runtime::{ - Balance, Block, BlockHashCount, Runtime, RuntimeCall, Signature, SignedPayload, TxExtension, - UncheckedExtrinsic, VERSION, -}; use pezsc_consensus_aura::{ find_pre_digest, standalone::{seal, slot_author}, @@ -42,9 +39,14 @@ use pezsp_consensus_aura::AuraApi; use pezsp_core::Pair; use pezsp_io::TestExternalities; use pezsp_keystore::testing::MemoryKeystore; -use pezsp_runtime::{generic::Era, traits::Header, BuildStorage, MultiAddress, SaturatedConversion}; +use pezsp_runtime::{ + generic::Era, traits::Header, BuildStorage, MultiAddress, SaturatedConversion, +}; +use runtime::{ + Balance, Block, BlockHashCount, Runtime, RuntimeCall, Signature, SignedPayload, TxExtension, + UncheckedExtrinsic, VERSION, +}; use std::sync::Arc; -pub use bizinikiwi_test_client::*; pub type TeyrchainBlockData = pezcumulus_primitives_core::TeyrchainBlockData; diff --git a/pezcumulus/test/runtime/src/test_pallet.rs b/pezcumulus/test/runtime/src/test_pallet.rs index 800627d9..4e7c87ee 100644 --- a/pezcumulus/test/runtime/src/test_pallet.rs +++ b/pezcumulus/test/runtime/src/test_pallet.rs @@ -32,7 +32,10 @@ pub mod pezpallet { pub struct Pezpallet(_); #[pezpallet::config] - pub trait Config: pezframe_system::Config + pezcumulus_pezpallet_teyrchain_system::Config {} + pub trait Config: + pezframe_system::Config + pezcumulus_pezpallet_teyrchain_system::Config + { + } /// A simple storage map for testing purposes. #[pezpallet::storage] diff --git a/pezcumulus/test/service/benches/transaction_throughput.rs b/pezcumulus/test/service/benches/transaction_throughput.rs index 0c2a0ea1..ed6c8b6d 100644 --- a/pezcumulus/test/service/benches/transaction_throughput.rs +++ b/pezcumulus/test/service/benches/transaction_throughput.rs @@ -17,15 +17,17 @@ // along with this program. If not, see . use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput}; +use futures::{future, StreamExt}; use pezcumulus_client_cli::get_raw_genesis_header; use pezcumulus_test_runtime::{AccountId, BalancesCall, ExistentialDeposit, SudoCall}; -use futures::{future, StreamExt}; use pezsc_transaction_pool_api::{TransactionPool as _, TransactionSource, TransactionStatus}; use pezsp_core::{crypto::Pair, sr25519}; use pezsp_runtime::OpaqueExtrinsic; use pezcumulus_primitives_core::ParaId; -use pezcumulus_test_service::{construct_extrinsic, fetch_nonce, Client, Keyring::*, TransactionPool}; +use pezcumulus_test_service::{ + construct_extrinsic, fetch_nonce, Client, Keyring::*, TransactionPool, +}; use pezkuwi_primitives::HeadData; fn create_accounts(num: usize) -> Vec { diff --git a/pezcumulus/test/service/benches/validate_block_glutton.rs b/pezcumulus/test/service/benches/validate_block_glutton.rs index 94b71cee..519a2d94 100644 --- a/pezcumulus/test/service/benches/validate_block_glutton.rs +++ b/pezcumulus/test/service/benches/validate_block_glutton.rs @@ -18,7 +18,9 @@ use codec::{Decode, Encode}; use core::time::Duration; use criterion::{criterion_group, criterion_main, BatchSize, Criterion}; -use pezcumulus_primitives_core::{relay_chain::AccountId, PersistedValidationData, ValidationParams}; +use pezcumulus_primitives_core::{ + relay_chain::AccountId, PersistedValidationData, ValidationParams, +}; use pezcumulus_test_client::{ generate_extrinsic_with_pair, BlockBuilderAndSupportData, BuildTeyrchainBlockData, Client, InitBlockBuilder, TestClientBuilder, TeyrchainBlockData, ValidationResult, @@ -27,7 +29,9 @@ use pezcumulus_test_relay_sproof_builder::RelayStateSproofBuilder; use pezcumulus_test_runtime::{Block, GluttonCall, Header, SudoCall}; use pezkuwi_primitives::HeadData; use pezsc_client_api::UsageProvider; -use pezsc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy, ImportResult, StateAction}; +use pezsc_consensus::{ + BlockImport, BlockImportParams, ForkChoiceStrategy, ImportResult, StateAction, +}; use pezsc_executor_common::wasm_runtime::WasmModule; use pezsp_api::ProvideRuntimeApi; diff --git a/pezcumulus/test/service/src/bench_utils.rs b/pezcumulus/test/service/src/bench_utils.rs index fe9dd1b8..e116f37f 100644 --- a/pezcumulus/test/service/src/bench_utils.rs +++ b/pezcumulus/test/service/src/bench_utils.rs @@ -200,7 +200,8 @@ pub fn get_wasm_module() -> Box std::result::Result, String> { + fn load_spec( + &self, + id: &str, + ) -> std::result::Result, String> { Ok(match id { "" => { tracing::info!("Using default test service chain spec."); - Box::new(pezcumulus_test_service::get_chain_spec(Some(ParaId::from(2000)))) as Box<_> + Box::new(pezcumulus_test_service::get_chain_spec(Some(ParaId::from(2000)))) + as Box<_> }, "elastic-scaling-mvp" => { tracing::info!("Using elastic-scaling mvp chain spec."); @@ -296,9 +300,9 @@ impl BizinikiwiCli for TestCollatorCli { }, "elastic-scaling" => { tracing::info!("Using elastic-scaling chain spec."); - Box::new(pezcumulus_test_service::get_elastic_scaling_chain_spec(Some(ParaId::from( - 2200, - )))) as Box<_> + Box::new(pezcumulus_test_service::get_elastic_scaling_chain_spec(Some( + ParaId::from(2200), + ))) as Box<_> }, "elastic-scaling-500ms" => { tracing::info!("Using elastic-scaling 500ms chain spec."); @@ -324,9 +328,10 @@ impl BizinikiwiCli for TestCollatorCli { 2500, )))) as Box<_> }, - "relay-parent-offset" => Box::new( - pezcumulus_test_service::get_relay_parent_offset_chain_spec(Some(ParaId::from(2600))), - ) as Box<_>, + "relay-parent-offset" => + Box::new(pezcumulus_test_service::get_relay_parent_offset_chain_spec(Some( + ParaId::from(2600), + ))) as Box<_>, path => { let chain_spec: pezsc_chain_spec::GenericChainSpec = pezsc_chain_spec::GenericChainSpec::from_json_file(path.into())?; @@ -367,7 +372,10 @@ impl BizinikiwiCli for RelayChainCli { 2017 } - fn load_spec(&self, id: &str) -> std::result::Result, String> { + fn load_spec( + &self, + id: &str, + ) -> std::result::Result, String> { ::from_iter([RelayChainCli::executable_name()].iter()) .load_spec(id) } diff --git a/pezcumulus/test/service/src/lib.rs b/pezcumulus/test/service/src/lib.rs index 8df0f89e..168d657e 100644 --- a/pezcumulus/test/service/src/lib.rs +++ b/pezcumulus/test/service/src/lib.rs @@ -34,10 +34,10 @@ use pezcumulus_client_consensus_aura::{ }, ImportQueueParams, }; -use prometheus::Registry; -use runtime::AccountId; use pezsc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; use pezsp_consensus_aura::sr25519::AuthorityPair; +use prometheus::Registry; +use runtime::AccountId; use std::{ collections::HashSet, future::Future, @@ -62,6 +62,9 @@ use pezcumulus_relay_chain_minimal_node::build_minimal_relay_chain_node_with_rpc use pezcumulus_test_runtime::{Hash, NodeBlock as Block, RuntimeApi}; +use bizinikiwi_test_client::{ + BlockchainEventsExt, RpcHandlersExt, RpcTransactionError, RpcTransactionOutput, +}; use pezframe_system_rpc_runtime_api::AccountNonceApi; use pezkuwi_node_subsystem::{errors::RecoveryError, messages::AvailabilityRecoveryMessage}; use pezkuwi_overseer::Handle as OverseerHandle; @@ -90,9 +93,6 @@ use pezsp_keyring::Sr25519Keyring; use pezsp_runtime::{codec::Encode, generic, MultiAddress}; use pezsp_state_machine::BasicExternalities; use std::sync::Arc; -use bizinikiwi_test_client::{ - BlockchainEventsExt, RpcHandlersExt, RpcTransactionError, RpcTransactionOutput, -}; pub use chain_spec::*; pub use pezcumulus_test_runtime as runtime; @@ -103,8 +103,10 @@ const LOG_TARGET: &str = "pezcumulus-test-service"; /// The signature of the announce block fn. pub type AnnounceBlockFn = Arc>) + Send + Sync>; -type HostFunctions = - (pezsp_io::BizinikiwiHostFunctions, pezcumulus_client_service::storage_proof_size::HostFunctions); +type HostFunctions = ( + pezsp_io::BizinikiwiHostFunctions, + pezcumulus_client_service::storage_proof_size::HostFunctions, +); /// The client type being used by the test service. pub type Client = TFullClient>; @@ -215,26 +217,27 @@ pub fn new_partial( ); let slot_duration = pezsc_consensus_aura::slot_duration(&*client)?; - let import_queue = pezcumulus_client_consensus_aura::import_queue::( - ImportQueueParams { - block_import: block_import.clone(), - client: client.clone(), - create_inherent_data_providers: move |_, ()| async move { - let timestamp = pezsp_timestamp::InherentDataProvider::from_system_time(); + let import_queue = + pezcumulus_client_consensus_aura::import_queue::( + ImportQueueParams { + block_import: block_import.clone(), + client: client.clone(), + create_inherent_data_providers: move |_, ()| async move { + let timestamp = pezsp_timestamp::InherentDataProvider::from_system_time(); - let slot = + let slot = pezsp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( *timestamp, slot_duration, ); - Ok((slot, timestamp)) + Ok((slot, timestamp)) + }, + spawner: &task_manager.spawn_essential_handle(), + registry: None, + telemetry: None, }, - spawner: &task_manager.spawn_essential_handle(), - registry: None, - telemetry: None, - }, - )?; + )?; let params = PartialComponents { backend, diff --git a/pezcumulus/test/service/src/main.rs b/pezcumulus/test/service/src/main.rs index e731b742..8b9b41e9 100644 --- a/pezcumulus/test/service/src/main.rs +++ b/pezcumulus/test/service/src/main.rs @@ -21,7 +21,7 @@ use std::sync::Arc; use cli::{AuthoringPolicy, RelayChainCli, Subcommand, TestCollatorCli}; use pezcumulus_primitives_core::relay_chain::CollatorPair; use pezcumulus_test_service::{new_partial, AnnounceBlockFn}; -use pezsc_cli::{CliConfiguration, BizinikiwiCli}; +use pezsc_cli::{BizinikiwiCli, CliConfiguration}; use pezsp_core::Pair; pub fn wrap_announce_block() -> Box AnnounceBlockFn> { diff --git a/pezcumulus/teyrchains/common/src/impls.rs b/pezcumulus/teyrchains/common/src/impls.rs index 71dffef5..cd085724 100644 --- a/pezcumulus/teyrchains/common/src/impls.rs +++ b/pezcumulus/teyrchains/common/src/impls.rs @@ -61,7 +61,8 @@ where /// Fungible implementation of `OnUnbalanced` that deals with the fees by combining tip and fee and /// passing the result on to `ToStakingPot`. pub struct DealWithFees(PhantomData); -impl OnUnbalanced>> for DealWithFees +impl OnUnbalanced>> + for DealWithFees where R: pezpallet_balances::Config + pezpallet_collator_selection::Config, AccountIdOf: From + Into, @@ -76,7 +77,9 @@ where if let Some(tips) = fees_then_tips.next() { tips.merge_into(&mut fees); } - ResolveTo::, pezpallet_balances::Pezpallet>::on_unbalanced(fees) + ResolveTo::, pezpallet_balances::Pezpallet>::on_unbalanced( + fees, + ) } } } @@ -84,7 +87,8 @@ where /// A `HandleCredit` implementation that naively transfers the fees to the block author. /// Will drop and burn the assets in case the transfer fails. pub struct AssetsToBlockAuthor(PhantomData<(R, I)>); -impl HandleCredit, pezpallet_assets::Pezpallet> for AssetsToBlockAuthor +impl HandleCredit, pezpallet_assets::Pezpallet> + for AssetsToBlockAuthor where I: 'static, R: pezpallet_authorship::Config + pezpallet_assets::Config, @@ -135,8 +139,9 @@ impl> ContainsPair for AssetsFrom { } /// Type alias to conveniently refer to the `Currency::Balance` associated type. -pub type BalanceOf = - as Currency<::AccountId>>::Balance; +pub type BalanceOf = as Currency< + ::AccountId, +>>::Balance; /// Implements `OnUnbalanced::on_unbalanced` to teleport slashed assets to relay chain treasury /// account. @@ -201,8 +206,8 @@ mod tests { PalletId, }; use pezframe_system::{limits, EnsureRoot}; - use pezpallet_collator_selection::IdentityCollator; use pezkuwi_primitives::AccountId; + use pezpallet_collator_selection::IdentityCollator; use pezsp_core::H256; use pezsp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, diff --git a/pezcumulus/teyrchains/common/src/xcm_config.rs b/pezcumulus/teyrchains/common/src/xcm_config.rs index 99e3b3ff..7a6ef0eb 100644 --- a/pezcumulus/teyrchains/common/src/xcm_config.rs +++ b/pezcumulus/teyrchains/common/src/xcm_config.rs @@ -59,7 +59,7 @@ where ) -> Result< as Inspect>>::Balance, XcmError, - > { + >{ let amount = WeightToFee::weight_to_fee(&weight); // If the amount gotten is not at least the ED, then make it be the ED of the asset // This is to avoid burning assets and decreasing the supply diff --git a/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-pezkuwichain/src/genesis.rs b/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-pezkuwichain/src/genesis.rs index f9d155ae..451a0ee2 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-pezkuwichain/src/genesis.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-pezkuwichain/src/genesis.rs @@ -17,10 +17,10 @@ use pezsp_core::storage::Storage; // Pezcumulus -use pezcumulus_primitives_core::ParaId; use emulated_integration_tests_common::{ accounts, build_genesis_storage, collators, SAFE_XCM_VERSION, }; +use pezcumulus_primitives_core::ParaId; use teyrchains_common::Balance; pub const PARA_ID: u32 = 1004; diff --git a/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-zagros/src/genesis.rs b/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-zagros/src/genesis.rs index 32519e56..f047f399 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-zagros/src/genesis.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/people/people-zagros/src/genesis.rs @@ -17,10 +17,10 @@ use pezsp_core::storage::Storage; // Pezcumulus -use pezcumulus_primitives_core::ParaId; use emulated_integration_tests_common::{ accounts, build_genesis_storage, collators, SAFE_XCM_VERSION, }; +use pezcumulus_primitives_core::ParaId; use teyrchains_common::Balance; pub const PARA_ID: u32 = 1004; diff --git a/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-pezkuwichain/src/genesis.rs b/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-pezkuwichain/src/genesis.rs index cb48d121..ef7d6fbc 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-pezkuwichain/src/genesis.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-pezkuwichain/src/genesis.rs @@ -49,8 +49,8 @@ pub fn genesis() -> Storage { .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id + acc.clone(), // account id + acc, // validator id pezbridge_hub_pezkuwichain_runtime::SessionKeys { aura }, // session keys ) }) @@ -69,17 +69,18 @@ pub fn genesis() -> Storage { owner: Some(Keyring::Bob.to_account_id()), ..Default::default() }, - xcm_over_bridge_hub_zagros: pezbridge_hub_pezkuwichain_runtime::XcmOverBridgeHubZagrosConfig { - opened_bridges: vec![ - // open AHR -> AHW bridge - ( - Location::new(1, [Teyrchain(1000)]), - Junctions::from([ByGenesis(ZAGROS_GENESIS_HASH).into(), Teyrchain(1000)]), - Some(bp_messages::LegacyLaneId([0, 0, 0, 2])), - ), - ], - ..Default::default() - }, + xcm_over_bridge_hub_zagros: + pezbridge_hub_pezkuwichain_runtime::XcmOverBridgeHubZagrosConfig { + opened_bridges: vec![ + // open AHR -> AHW bridge + ( + Location::new(1, [Teyrchain(1000)]), + Junctions::from([ByGenesis(ZAGROS_GENESIS_HASH).into(), Teyrchain(1000)]), + Some(bp_messages::LegacyLaneId([0, 0, 0, 2])), + ), + ], + ..Default::default() + }, ethereum_system: pezbridge_hub_pezkuwichain_runtime::EthereumSystemConfig { para_id: PARA_ID.into(), asset_hub_para_id: ASSETHUB_PARA_ID.into(), diff --git a/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-zagros/src/genesis.rs b/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-zagros/src/genesis.rs index 0081a0a6..d880887b 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-zagros/src/genesis.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-zagros/src/genesis.rs @@ -49,8 +49,8 @@ pub fn genesis() -> Storage { .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id + acc.clone(), // account id + acc, // validator id pezbridge_hub_zagros_runtime::SessionKeys { aura }, // session keys ) }) @@ -61,14 +61,16 @@ pub fn genesis() -> Storage { safe_xcm_version: Some(SAFE_XCM_VERSION), ..Default::default() }, - bridge_pezkuwichain_grandpa: pezbridge_hub_zagros_runtime::BridgePezkuwichainGrandpaConfig { - owner: Some(Keyring::Bob.to_account_id()), - ..Default::default() - }, - bridge_pezkuwichain_messages: pezbridge_hub_zagros_runtime::BridgePezkuwichainMessagesConfig { - owner: Some(Keyring::Bob.to_account_id()), - ..Default::default() - }, + bridge_pezkuwichain_grandpa: + pezbridge_hub_zagros_runtime::BridgePezkuwichainGrandpaConfig { + owner: Some(Keyring::Bob.to_account_id()), + ..Default::default() + }, + bridge_pezkuwichain_messages: + pezbridge_hub_zagros_runtime::BridgePezkuwichainMessagesConfig { + owner: Some(Keyring::Bob.to_account_id()), + ..Default::default() + }, xcm_over_bridge_hub_pezkuwichain: pezbridge_hub_zagros_runtime::XcmOverBridgeHubPezkuwichainConfig { opened_bridges: vec![ diff --git a/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/testing/penpal/src/genesis.rs b/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/testing/penpal/src/genesis.rs index 826d04f6..144b9039 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/testing/penpal/src/genesis.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/testing/penpal/src/genesis.rs @@ -22,7 +22,9 @@ use pezsp_keyring::Sr25519Keyring as Keyring; use emulated_integration_tests_common::{ accounts, build_genesis_storage, collators, SAFE_XCM_VERSION, }; -use pez_penpal_runtime::xcm_config::{LocalReservableFromAssetHub, RelayLocation, UsdtFromAssetHub}; +use pez_penpal_runtime::xcm_config::{ + LocalReservableFromAssetHub, RelayLocation, UsdtFromAssetHub, +}; use teyrchains_common::{AccountId, Balance}; // Penpal pub const PARA_ID_A: u32 = 2000; @@ -56,8 +58,8 @@ pub fn genesis(para_id: u32) -> Storage { .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id + acc.clone(), // account id + acc, // validator id pez_penpal_runtime::SessionKeys { aura }, // session keys ) }) diff --git a/pezcumulus/teyrchains/integration-tests/emulated/common/src/impls.rs b/pezcumulus/teyrchains/integration-tests/emulated/common/src/impls.rs index 3a68e23d..b7537638 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/common/src/impls.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/common/src/impls.rs @@ -65,7 +65,9 @@ use bp_messages::{ MessageKey, OutboundLaneData, }; pub use bp_xcm_bridge_hub::XcmBridgeHubCall; -use pezpallet_bridge_messages::{Config as BridgeMessagesConfig, LaneIdOf, OutboundLanes, Pezpallet}; +use pezpallet_bridge_messages::{ + Config as BridgeMessagesConfig, LaneIdOf, OutboundLanes, Pezpallet, +}; pub use pezpallet_bridge_messages::{ Instance1 as BridgeMessagesInstance1, Instance2 as BridgeMessagesInstance2, Instance3 as BridgeMessagesInstance3, @@ -112,9 +114,10 @@ where OutboundLanes::::get(lane).unwrap().latest_received_nonce; (latest_received_nonce + 1..=latest_generated_nonce).for_each(|nonce| { - let encoded_payload: Vec = Pezpallet::::outbound_message_data(lane, nonce) - .expect("Bridge message does not exist") - .into(); + let encoded_payload: Vec = + Pezpallet::::outbound_message_data(lane, nonce) + .expect("Bridge message does not exist") + .into(); let payload = Vec::::decode(&mut &encoded_payload[..]) .expect("Decoding XCM message failed"); let message = BridgeMessage { lane_id: LaneIdWrapper(lane).into(), nonce, payload }; diff --git a/pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-system/src/lib.rs b/pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-system/src/lib.rs index 8e8f7ee9..f728fa11 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-system/src/lib.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-system/src/lib.rs @@ -14,17 +14,17 @@ // limitations under the License. pub use asset_hub_pezkuwichain_emulated_chain; -pub use pezbridge_hub_pezkuwichain_emulated_chain; pub use coretime_pezkuwichain_emulated_chain; -pub use pez_penpal_emulated_chain; pub use people_pezkuwichain_emulated_chain; +pub use pez_penpal_emulated_chain; +pub use pezbridge_hub_pezkuwichain_emulated_chain; pub use pezkuwichain_emulated_chain; use asset_hub_pezkuwichain_emulated_chain::AssetHubPezkuwichain; -use pezbridge_hub_pezkuwichain_emulated_chain::BridgeHubPezkuwichain; use coretime_pezkuwichain_emulated_chain::CoretimePezkuwichain; -use pez_penpal_emulated_chain::{PenpalA, PenpalB}; use people_pezkuwichain_emulated_chain::PeoplePezkuwichain; +use pez_penpal_emulated_chain::{PenpalA, PenpalB}; +use pezbridge_hub_pezkuwichain_emulated_chain::BridgeHubPezkuwichain; use pezkuwichain_emulated_chain::Pezkuwichain; // Pezcumulus diff --git a/pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-zagros-system/src/lib.rs b/pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-zagros-system/src/lib.rs index 7ab8dec7..12d8c1c7 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-zagros-system/src/lib.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/networks/pezkuwichain-zagros-system/src/lib.rs @@ -15,17 +15,17 @@ pub use asset_hub_pezkuwichain_emulated_chain; pub use asset_hub_zagros_emulated_chain; +pub use pez_penpal_emulated_chain; pub use pezbridge_hub_pezkuwichain_emulated_chain; pub use pezbridge_hub_zagros_emulated_chain; -pub use pez_penpal_emulated_chain; pub use pezkuwichain_emulated_chain; pub use zagros_emulated_chain; use asset_hub_pezkuwichain_emulated_chain::AssetHubPezkuwichain; use asset_hub_zagros_emulated_chain::AssetHubZagros; +use pez_penpal_emulated_chain::{PenpalA, PenpalB}; use pezbridge_hub_pezkuwichain_emulated_chain::BridgeHubPezkuwichain; use pezbridge_hub_zagros_emulated_chain::BridgeHubZagros; -use pez_penpal_emulated_chain::{PenpalA, PenpalB}; use pezkuwichain_emulated_chain::Pezkuwichain; use zagros_emulated_chain::Zagros; diff --git a/pezcumulus/teyrchains/integration-tests/emulated/networks/zagros-system/src/lib.rs b/pezcumulus/teyrchains/integration-tests/emulated/networks/zagros-system/src/lib.rs index 79fb5963..ec76a338 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/networks/zagros-system/src/lib.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/networks/zagros-system/src/lib.rs @@ -14,19 +14,19 @@ // limitations under the License. pub use asset_hub_zagros_emulated_chain; -pub use pezbridge_hub_zagros_emulated_chain; pub use collectives_zagros_emulated_chain; pub use coretime_zagros_emulated_chain; -pub use pez_penpal_emulated_chain; pub use people_zagros_emulated_chain; +pub use pez_penpal_emulated_chain; +pub use pezbridge_hub_zagros_emulated_chain; pub use zagros_emulated_chain; use asset_hub_zagros_emulated_chain::AssetHubZagros; -use pezbridge_hub_zagros_emulated_chain::BridgeHubZagros; use collectives_zagros_emulated_chain::CollectivesZagros; use coretime_zagros_emulated_chain::CoretimeZagros; -use pez_penpal_emulated_chain::{PenpalA, PenpalB}; use people_zagros_emulated_chain::PeopleZagros; +use pez_penpal_emulated_chain::{PenpalA, PenpalB}; +use pezbridge_hub_zagros_emulated_chain::BridgeHubZagros; use zagros_emulated_chain::Zagros; // Pezcumulus diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-pezkuwichain/src/lib.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-pezkuwichain/src/lib.rs index f9b91e93..ef4c2cbe 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-pezkuwichain/src/lib.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-pezkuwichain/src/lib.rs @@ -39,13 +39,13 @@ mod imports { test_relay_is_trusted_teleporter, test_teyrchain_is_trusted_teleporter, test_teyrchain_is_trusted_teleporter_for_relay, test_xcm_fee_querying_apis_work_for_asset_hub, + xcm_helpers::{ + fee_asset, get_amount_from_versioned_assets, non_fee_asset, xcm_transact_paid_execution, + }, xcm_pez_emulator::{ assert_expected_events, bx, Chain, RelayChain as Relay, Test, TestArgs, TestContext, TestExt, Teyrchain as Para, }, - xcm_helpers::{ - fee_asset, get_amount_from_versioned_assets, non_fee_asset, xcm_transact_paid_execution, - }, PenpalATeleportableAssetLocation, ASSETS_PALLET_ID, RESERVABLE_ASSET_ID, XCM_V3, }; pub(crate) use pezkuwichain_system_emulated_network::{ diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-pezkuwichain/src/tests/treasury.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-pezkuwichain/src/tests/treasury.rs index b32b2e9b..cc3d71d7 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-pezkuwichain/src/tests/treasury.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-pezkuwichain/src/tests/treasury.rs @@ -113,15 +113,16 @@ fn spend_roc_on_asset_hub() { let asset_hub_location: Location = [Teyrchain(1000)].into(); let native_asset = Location::parent(); - let treasury_spend_call = RuntimeCall::Treasury(pezpallet_treasury::Call::::spend { - asset_kind: bx!(VersionedLocatableAsset::from(( - asset_hub_location.clone(), - native_asset.into() - ))), - amount: treasury_spend_balance, - beneficiary: bx!(VersionedLocation::from(alice_location)), - valid_from: None, - }); + let treasury_spend_call = + RuntimeCall::Treasury(pezpallet_treasury::Call::::spend { + asset_kind: bx!(VersionedLocatableAsset::from(( + asset_hub_location.clone(), + native_asset.into() + ))), + amount: treasury_spend_balance, + beneficiary: bx!(VersionedLocation::from(alice_location)), + valid_from: None, + }); assert_ok!(treasury_spend_call.dispatch(treasury_origin)); diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-zagros/src/lib.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-zagros/src/lib.rs index 41ac90f0..b6a4f039 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-zagros/src/lib.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-zagros/src/lib.rs @@ -40,14 +40,14 @@ mod imports { test_relay_is_trusted_teleporter, test_teyrchain_is_trusted_teleporter, test_teyrchain_is_trusted_teleporter_for_relay, test_xcm_fee_querying_apis_work_for_asset_hub, - xcm_pez_emulator::{ - assert_expected_events, bx, Chain, RelayChain as Relay, Test, TestArgs, TestContext, - TestExt, Teyrchain as Para, - }, xcm_helpers::{ fee_asset, find_mq_processed_id, find_xcm_sent_message_id, get_amount_from_versioned_assets, non_fee_asset, xcm_transact_paid_execution, }, + xcm_pez_emulator::{ + assert_expected_events, bx, Chain, RelayChain as Relay, Test, TestArgs, TestContext, + TestExt, Teyrchain as Para, + }, xcm_pez_simulator::helpers::TopicIdTracker, PenpalATeleportableAssetLocation, ASSETS_PALLET_ID, RESERVABLE_ASSET_ID, USDT_ID, XCM_V3, }; @@ -67,12 +67,9 @@ mod imports { genesis::{AssetHubZagrosAssetOwner, ED as ASSET_HUB_ZAGROS_ED}, AssetHubZagrosParaPallet as AssetHubZagrosPallet, }, - pezbridge_hub_zagros_emulated_chain::{ - pezbridge_hub_zagros_runtime::xcm_config::{self as bhw_xcm_config}, - BridgeHubZagrosParaPallet as BridgeHubZagrosPallet, - }, collectives_zagros_emulated_chain::CollectivesZagrosParaPallet as CollectivesZagrosPallet, coretime_zagros_emulated_chain::CoretimeZagrosParaPallet as CoretimeZagrosPallet, + people_zagros_emulated_chain::PeopleZagrosParaPallet as PeopleZagrosPallet, pez_penpal_emulated_chain::{ pez_penpal_runtime::xcm_config::{ CustomizableAssetFromSystemAssetHub as PenpalCustomizableAssetFromSystemAssetHub, @@ -84,7 +81,10 @@ mod imports { PenpalAParaPallet as PenpalAPallet, PenpalAssetOwner, PenpalBParaPallet as PenpalBPallet, }, - people_zagros_emulated_chain::PeopleZagrosParaPallet as PeopleZagrosPallet, + pezbridge_hub_zagros_emulated_chain::{ + pezbridge_hub_zagros_runtime::xcm_config::{self as bhw_xcm_config}, + BridgeHubZagrosParaPallet as BridgeHubZagrosPallet, + }, zagros_emulated_chain::{ genesis::ED as ZAGROS_ED, zagros_runtime::{ diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-zagros/src/tests/reward_pool.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-zagros/src/tests/reward_pool.rs index e2dd2d8a..59e71fb3 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-zagros/src/tests/reward_pool.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-zagros/src/tests/reward_pool.rs @@ -15,7 +15,9 @@ use crate::imports::*; use codec::Encode; -use pezframe_support::{assert_ok, pezsp_runtime::traits::Dispatchable, traits::schedule::DispatchTime}; +use pezframe_support::{ + assert_ok, pezsp_runtime::traits::Dispatchable, traits::schedule::DispatchTime, +}; use xcm_executor::traits::ConvertLocation; #[test] diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/collectives/collectives-zagros/src/lib.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/collectives/collectives-zagros/src/lib.rs index c0f4bc0e..f6fe8d66 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/collectives/collectives-zagros/src/lib.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/collectives/collectives-zagros/src/lib.rs @@ -29,7 +29,6 @@ mod imports { asset_hub_zagros_runtime::xcm_config::LocationToAccountId as AssetHubLocationToAccountId, genesis::ED as ASSET_HUB_ZAGROS_ED, AssetHubZagrosParaPallet as AssetHubZagrosPallet, }, - pezbridge_hub_zagros_emulated_chain::BridgeHubZagrosParaPallet as BridgeHubZagrosPallet, collectives_zagros_emulated_chain::{ collectives_zagros_runtime::{ fellowship as collectives_fellowship, @@ -39,8 +38,9 @@ mod imports { CollectivesZagrosParaPallet as CollectivesZagrosPallet, }, coretime_zagros_emulated_chain::CoretimeZagrosParaPallet as CoretimeZagrosPallet, - pez_penpal_emulated_chain::{PenpalAssetOwner, PenpalBParaPallet as PenpalBPallet}, people_zagros_emulated_chain::PeopleZagrosParaPallet as PeopleZagrosPallet, + pez_penpal_emulated_chain::{PenpalAssetOwner, PenpalBParaPallet as PenpalBPallet}, + pezbridge_hub_zagros_emulated_chain::BridgeHubZagrosParaPallet as BridgeHubZagrosPallet, zagros_emulated_chain::{ genesis::ED as ZAGROS_ED, zagros_runtime::{governance as zagros_governance, OriginCaller as ZagrosOriginCaller}, diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/collectives/collectives-zagros/src/tests/fellowship_treasury.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/collectives/collectives-zagros/src/tests/fellowship_treasury.rs index cbf2e21e..89730087 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/collectives/collectives-zagros/src/tests/fellowship_treasury.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/collectives/collectives-zagros/src/tests/fellowship_treasury.rs @@ -110,15 +110,16 @@ fn fellowship_treasury_spend() { let asset_hub_location: Location = [Teyrchain(1000)].into(); let native_asset = Location::parent(); - let treasury_spend_call = RuntimeCall::Treasury(pezpallet_treasury::Call::::spend { - asset_kind: bx!(VersionedLocatableAsset::from(( - asset_hub_location.clone(), - native_asset.into() - ))), - amount: fellowship_treasury_balance, - beneficiary: bx!(VersionedLocation::from(fellowship_treasury_location)), - valid_from: None, - }); + let treasury_spend_call = + RuntimeCall::Treasury(pezpallet_treasury::Call::::spend { + asset_kind: bx!(VersionedLocatableAsset::from(( + asset_hub_location.clone(), + native_asset.into() + ))), + amount: fellowship_treasury_balance, + beneficiary: bx!(VersionedLocation::from(fellowship_treasury_location)), + valid_from: None, + }); assert_ok!(treasury_spend_call.dispatch(treasury_origin)); @@ -187,8 +188,8 @@ fn fellowship_treasury_spend() { }] .into(); - let fellowship_treasury_spend_call = - RuntimeCall::FellowshipTreasury(pezpallet_treasury::Call::::spend { + let fellowship_treasury_spend_call = RuntimeCall::FellowshipTreasury( + pezpallet_treasury::Call::::spend { asset_kind: bx!(VersionedLocatableAsset::from(( asset_hub_location, native_asset.into() @@ -196,7 +197,8 @@ fn fellowship_treasury_spend() { amount: fellowship_spend_balance, beneficiary: bx!(VersionedLocation::from(alice_location)), valid_from: None, - }); + }, + ); assert_ok!(fellowship_treasury_spend_call.dispatch(fellows_origin)); diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-pezkuwichain/src/tests/coretime_interface.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-pezkuwichain/src/tests/coretime_interface.rs index 315a068c..9b2996d3 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-pezkuwichain/src/tests/coretime_interface.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-pezkuwichain/src/tests/coretime_interface.rs @@ -15,9 +15,9 @@ use crate::imports::*; use pezframe_support::traits::OnInitialize; -use pezpallet_broker::{ConfigRecord, Configuration, CoreAssignment, CoreMask, ScheduleItem}; use pezkuwichain_runtime_constants::system_teyrchain::coretime::TIMESLICE_PERIOD; use pezkuwichain_system_emulated_network::pezkuwichain_emulated_chain::pezkuwichain_runtime::Dmp; +use pezpallet_broker::{ConfigRecord, Configuration, CoreAssignment, CoreMask, ScheduleItem}; use pezsp_runtime::Perbill; #[test] diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-zagros/src/lib.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-zagros/src/lib.rs index 9cdfa36b..68aa4ad0 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-zagros/src/lib.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-zagros/src/lib.rs @@ -30,14 +30,14 @@ mod imports { asset_hub_zagros_emulated_chain::{ genesis::ED as ASSET_HUB_ZAGROS_ED, AssetHubZagrosParaPallet as AssetHubZagrosPallet, }, - pezbridge_hub_zagros_emulated_chain::BridgeHubZagrosParaPallet as BridgeHubZagrosPallet, collectives_zagros_emulated_chain::CollectivesZagrosParaPallet as CollectivesZagrosPallet, coretime_zagros_emulated_chain::{ self, coretime_zagros_runtime::ExistentialDeposit as CoretimeZagrosExistentialDeposit, genesis::ED as CORETIME_ZAGROS_ED, CoretimeZagrosParaPallet as CoretimeZagrosPallet, }, - pez_penpal_emulated_chain::{PenpalAssetOwner, PenpalBParaPallet as PenpalBPallet}, people_zagros_emulated_chain::PeopleZagrosParaPallet as PeopleZagrosPallet, + pez_penpal_emulated_chain::{PenpalAssetOwner, PenpalBParaPallet as PenpalBPallet}, + pezbridge_hub_zagros_emulated_chain::BridgeHubZagrosParaPallet as BridgeHubZagrosPallet, zagros_emulated_chain::{genesis::ED as ZAGROS_ED, ZagrosRelayPallet as ZagrosPallet}, AssetHubZagrosPara as AssetHubZagros, AssetHubZagrosParaReceiver as AssetHubZagrosReceiver, AssetHubZagrosParaSender as AssetHubZagrosSender, BridgeHubZagrosPara as BridgeHubZagros, diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/governance/zagros/src/common.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/governance/zagros/src/common.rs index 6ac241ac..e98e3a38 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/governance/zagros/src/common.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/governance/zagros/src/common.rs @@ -16,8 +16,8 @@ use crate::imports::*; -/// CollectivesZagros dispatches `pezpallet_xcm::send` with `OriginKind:Xcm` to the dest with encoded -/// whitelist call. +/// CollectivesZagros dispatches `pezpallet_xcm::send` with `OriginKind:Xcm` to the dest with +/// encoded whitelist call. #[cfg(test)] pub fn collectives_send_whitelist( dest: Location, diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/governance/zagros/src/lib.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/governance/zagros/src/lib.rs index a5811fad..d31eaf61 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/governance/zagros/src/lib.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/governance/zagros/src/lib.rs @@ -19,11 +19,11 @@ mod imports { pub(crate) use codec::Encode; pub(crate) use emulated_integration_tests_common::{ impls::{assert_expected_events, bx, TestExt}, - xcm_pez_emulator::Chain, xcm_helpers::{ build_xcm_send_authorize_upgrade_call, call_hash_of, dispatch_whitelisted_call_with_preimage, }, + xcm_pez_emulator::Chain, }; pub(crate) use pezframe_support::{assert_err, assert_ok}; pub(crate) use pezsp_runtime::{traits::Dispatchable, DispatchError}; diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros/src/lib.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros/src/lib.rs index 13c981f5..357402a0 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros/src/lib.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros/src/lib.rs @@ -28,10 +28,8 @@ mod imports { pub(crate) use zagros_system_emulated_network::{ self, asset_hub_zagros_emulated_chain::AssetHubZagrosParaPallet as AssetHubZagrosPallet, - pezbridge_hub_zagros_emulated_chain::BridgeHubZagrosParaPallet as BridgeHubZagrosPallet, collectives_zagros_emulated_chain::CollectivesZagrosParaPallet as CollectivesZagrosPallet, coretime_zagros_emulated_chain::CoretimeZagrosParaPallet as CoretimeZagrosPallet, - pez_penpal_emulated_chain::{PenpalAssetOwner, PenpalBParaPallet as PenpalBPallet}, people_zagros_emulated_chain::{ people_zagros_runtime::{ self, xcm_config::XcmConfig as PeopleZagrosXcmConfig, @@ -39,6 +37,8 @@ mod imports { }, PeopleZagrosParaPallet as PeopleZagrosPallet, }, + pez_penpal_emulated_chain::{PenpalAssetOwner, PenpalBParaPallet as PenpalBPallet}, + pezbridge_hub_zagros_emulated_chain::BridgeHubZagrosParaPallet as BridgeHubZagrosPallet, zagros_emulated_chain::{genesis::ED as ZAGROS_ED, ZagrosRelayPallet as ZagrosPallet}, AssetHubZagrosPara as AssetHubZagros, AssetHubZagrosParaReceiver as AssetHubZagrosReceiver, BridgeHubZagrosPara as BridgeHubZagros, CollectivesZagrosPara as CollectivesZagros, diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros/src/tests/governance.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros/src/tests/governance.rs index 455dae14..1160ab22 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros/src/tests/governance.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros/src/tests/governance.rs @@ -16,8 +16,8 @@ use crate::imports::*; use codec::Encode; -use pezframe_support::pezsp_runtime::traits::Dispatchable; use people_zagros_runtime::people::IdentityInfo; +use pezframe_support::pezsp_runtime::traits::Dispatchable; use teyrchains_common::AccountId; use zagros_runtime::{ governance::pezpallet_custom_origins::Origin::GeneralAdmin as GeneralAdminOrigin, Dmp, @@ -260,12 +260,11 @@ fn relay_commands_kill_identity_wrong_origin() { Dmp::make_teyrchain_reachable(1004); - let kill_identity_call = - PeopleCall::Identity(pezpallet_identity::Call::::kill_identity { - target: people_zagros_runtime::MultiAddress::Id(PeopleZagros::account_id_of( - ALICE, - )), - }); + let kill_identity_call = PeopleCall::Identity(pezpallet_identity::Call::< + PeopleRuntime, + >::kill_identity { + target: people_zagros_runtime::MultiAddress::Id(PeopleZagros::account_id_of(ALICE)), + }); let xcm_message = RuntimeCall::XcmPallet(pezpallet_xcm::Call::::send { dest: bx!(VersionedLocation::from(Location::new(0, [Teyrchain(1004)]))), @@ -312,12 +311,13 @@ fn relay_commands_add_remove_username_authority() { Dmp::make_teyrchain_reachable(1004); - let add_username_authority = - PeopleCall::Identity(pezpallet_identity::Call::::add_username_authority { - authority: people_zagros_runtime::MultiAddress::Id(people_zagros_alice.clone()), - suffix: b"suffix1".into(), - allocation: 10, - }); + let add_username_authority = PeopleCall::Identity(pezpallet_identity::Call::< + PeopleRuntime, + >::add_username_authority { + authority: people_zagros_runtime::MultiAddress::Id(people_zagros_alice.clone()), + suffix: b"suffix1".into(), + allocation: 10, + }); let add_authority_xcm_msg = RuntimeCall::XcmPallet(pezpallet_xcm::Call::::send { dest: bx!(VersionedLocation::from(Location::new(0, [Teyrchain(1004)]))), @@ -410,17 +410,18 @@ fn relay_commands_add_remove_username_authority() { suffix: b"suffix1".into(), }); - let remove_authority_xcm_msg = RuntimeCall::XcmPallet(pezpallet_xcm::Call::::send { - dest: bx!(VersionedLocation::from(Location::new(0, [Teyrchain(1004)]))), - message: bx!(VersionedXcm::from(Xcm(vec![ - UnpaidExecution { weight_limit: Unlimited, check_origin: None }, - Transact { - origin_kind, - call: remove_username_authority.encode().into(), - fallback_max_weight: None - } - ]))), - }); + let remove_authority_xcm_msg = + RuntimeCall::XcmPallet(pezpallet_xcm::Call::::send { + dest: bx!(VersionedLocation::from(Location::new(0, [Teyrchain(1004)]))), + message: bx!(VersionedXcm::from(Xcm(vec![ + UnpaidExecution { weight_limit: Unlimited, check_origin: None }, + Transact { + origin_kind, + call: remove_username_authority.encode().into(), + fallback_max_weight: None + } + ]))), + }); assert_ok!(remove_authority_xcm_msg.dispatch(origin)); @@ -476,17 +477,18 @@ fn relay_commands_add_remove_username_authority_wrong_origin() { allocation: 10, }); - let add_authority_xcm_msg = RuntimeCall::XcmPallet(pezpallet_xcm::Call::::send { - dest: bx!(VersionedLocation::from(Location::new(0, [Teyrchain(1004)]))), - message: bx!(VersionedXcm::from(Xcm(vec![ - UnpaidExecution { weight_limit: Unlimited, check_origin: None }, - Transact { - origin_kind, - call: add_username_authority.encode().into(), - fallback_max_weight: None - } - ]))), - }); + let add_authority_xcm_msg = + RuntimeCall::XcmPallet(pezpallet_xcm::Call::::send { + dest: bx!(VersionedLocation::from(Location::new(0, [Teyrchain(1004)]))), + message: bx!(VersionedXcm::from(Xcm(vec![ + UnpaidExecution { weight_limit: Unlimited, check_origin: None }, + Transact { + origin_kind, + call: add_username_authority.encode().into(), + fallback_max_weight: None + } + ]))), + }); assert_ok!(add_authority_xcm_msg.dispatch(origin.clone())); assert_expected_events!( diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros/src/tests/identity.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros/src/tests/identity.rs index de801ece..a9c97dfd 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros/src/tests/identity.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/people/people-zagros/src/tests/identity.rs @@ -18,9 +18,9 @@ use crate::imports::*; use codec::Encode; use emulated_integration_tests_common::accounts::ALICE; +use people_zagros_runtime::people::{IdentityField, IdentityInfo}; use pezframe_support::BoundedVec; use pezpallet_identity::Data; -use people_zagros_runtime::people::{IdentityField, IdentityInfo}; use xcm::latest::AssetTransferFilter; #[test] diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-pezkuwichain/src/lib.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-pezkuwichain/src/lib.rs index d2ecb83b..87fe2708 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-pezkuwichain/src/lib.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-pezkuwichain/src/lib.rs @@ -34,10 +34,10 @@ mod imports { impls::Inspect, test_dry_run_transfer_across_pk_bridge, test_relay_is_trusted_teleporter, test_teyrchain_is_trusted_teleporter, test_teyrchain_is_trusted_teleporter_for_relay, + xcm_helpers::xcm_transact_paid_execution, xcm_pez_emulator::{ assert_expected_events, bx, Chain, RelayChain as Relay, TestExt, Teyrchain as Para, }, - xcm_helpers::xcm_transact_paid_execution, ASSETS_PALLET_ID, USDT_ID, }; pub(crate) use pezkuwichain_zagros_system_emulated_network::{ @@ -52,10 +52,6 @@ mod imports { genesis::{AssetHubZagrosAssetOwner, ED as ASSET_HUB_ZAGROS_ED}, AssetHubZagrosParaPallet as AssetHubZagrosPallet, }, - pezbridge_hub_pezkuwichain_emulated_chain::{ - genesis::ED as BRIDGE_HUB_PEZKUWICHAIN_ED, BridgeHubPezkuwichainExistentialDeposit, - BridgeHubPezkuwichainParaPallet as BridgeHubPezkuwichainPallet, - }, pez_penpal_emulated_chain::{ pez_penpal_runtime::xcm_config::{ CustomizableAssetFromSystemAssetHub as PenpalCustomizableAssetFromSystemAssetHub, @@ -63,6 +59,10 @@ mod imports { }, PenpalAParaPallet as PenpalAPallet, PenpalAssetOwner, }, + pezbridge_hub_pezkuwichain_emulated_chain::{ + genesis::ED as BRIDGE_HUB_PEZKUWICHAIN_ED, BridgeHubPezkuwichainExistentialDeposit, + BridgeHubPezkuwichainParaPallet as BridgeHubPezkuwichainPallet, + }, pezkuwichain_emulated_chain::{ genesis::ED as PEZKUWICHAIN_ED, PezkuwichainRelayPallet as PezkuwichainPallet, }, diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/lib.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/lib.rs index a9ecaae2..431ee97c 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/lib.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/lib.rs @@ -37,10 +37,10 @@ mod imports { impls::Inspect, test_dry_run_transfer_across_pk_bridge, test_relay_is_trusted_teleporter, test_teyrchain_is_trusted_teleporter, test_teyrchain_is_trusted_teleporter_for_relay, + xcm_helpers::xcm_transact_paid_execution, xcm_pez_emulator::{ assert_expected_events, bx, Chain, RelayChain as Relay, TestExt, Teyrchain as Para, }, - xcm_helpers::xcm_transact_paid_execution, ASSETS_PALLET_ID, USDT_ID, }; pub(crate) use pezkuwichain_zagros_system_emulated_network::{ @@ -55,11 +55,6 @@ mod imports { genesis::{AssetHubZagrosAssetOwner, ED as ASSET_HUB_ZAGROS_ED}, AssetHubZagrosParaPallet as AssetHubZagrosPallet, }, - pezbridge_hub_zagros_emulated_chain::{ - pezbridge_hub_zagros_runtime, genesis::ED as BRIDGE_HUB_ZAGROS_ED, - BridgeHubZagrosExistentialDeposit, BridgeHubZagrosParaPallet as BridgeHubZagrosPallet, - BridgeHubZagrosRuntimeOrigin, - }, pez_penpal_emulated_chain::{ self, pez_penpal_runtime::xcm_config::{ @@ -70,6 +65,11 @@ mod imports { PenpalAParaPallet as PenpalAPallet, PenpalAssetOwner, PenpalBParaPallet as PenpalBPallet, }, + pezbridge_hub_zagros_emulated_chain::{ + genesis::ED as BRIDGE_HUB_ZAGROS_ED, pezbridge_hub_zagros_runtime, + BridgeHubZagrosExistentialDeposit, BridgeHubZagrosParaPallet as BridgeHubZagrosPallet, + BridgeHubZagrosRuntimeOrigin, + }, pezkuwichain_emulated_chain::PezkuwichainRelayPallet as PezkuwichainPallet, zagros_emulated_chain::{genesis::ED as ZAGROS_ED, ZagrosRelayPallet as ZagrosPallet}, AssetHubPezkuwichainPara as AssetHubPezkuwichain, diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/aliases.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/aliases.rs index 431baab1..1750fa4f 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/aliases.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/aliases.rs @@ -16,8 +16,8 @@ //! Tests related to XCM aliasing. use crate::imports::*; -use pezbridge_hub_zagros_runtime::xcm_config::XcmConfig; use emulated_integration_tests_common::{macros::AccountId, test_cross_chain_alias}; +use pezbridge_hub_zagros_runtime::xcm_config::XcmConfig; use pezframe_support::traits::ContainsPair; use xcm::latest::Junctions::*; diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge.rs index bf61d425..be6fae8e 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge.rs @@ -32,16 +32,16 @@ use asset_hub_zagros_runtime::xcm_config::{ bridging::to_ethereum::DefaultBridgeHubEthereumBaseFee, UniversalLocation as AssetHubZagrosUniversalLocation, }; -use pezbridge_hub_zagros_runtime::{ - bridge_to_ethereum_config::EthereumGatewayAddress, EthereumBeaconClient, EthereumInboundQueue, -}; use codec::Encode; use emulated_integration_tests_common::{ snowbridge::{SEPOLIA_ID, WETH}, PENPAL_B_ID, RESERVABLE_ASSET_ID, }; -use pezframe_support::traits::fungibles::Mutate; use hex_literal::hex; +use pezbridge_hub_zagros_runtime::{ + bridge_to_ethereum_config::EthereumGatewayAddress, EthereumBeaconClient, EthereumInboundQueue, +}; +use pezframe_support::traits::fungibles::Mutate; use pezkuwichain_zagros_system_emulated_network::{ asset_hub_zagros_emulated_chain::genesis::AssetHubZagrosAssetOwner, pez_penpal_emulated_chain::PARA_ID_B, zagros_emulated_chain::zagros_runtime::Dmp, diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_common.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_common.rs index e5a5662d..e4e57295 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_common.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_common.rs @@ -19,8 +19,8 @@ use emulated_integration_tests_common::{ snowbridge::{SEPOLIA_ID, WETH}, PenpalBTeleportableAssetLocation, }; -use pezframe_support::traits::fungibles::Mutate; use hex_literal::hex; +use pezframe_support::traits::fungibles::Mutate; use pezkuwichain_zagros_system_emulated_network::pez_penpal_emulated_chain::{ pez_penpal_runtime::xcm_config::{CheckingAccount, TELEPORTABLE_ASSET_ID}, PenpalAssetOwner, diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_edge_case.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_edge_case.rs index 7dd53895..6b73d7d8 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_edge_case.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_edge_case.rs @@ -14,8 +14,8 @@ // limitations under the License. use crate::{imports::*, tests::snowbridge_common::*}; -use pezbridge_hub_zagros_runtime::xcm_config::LocationToAccountId; use emulated_integration_tests_common::snowbridge::{SEPOLIA_ID, WETH}; +use pezbridge_hub_zagros_runtime::xcm_config::LocationToAccountId; use pezsnowbridge_core::AssetMetadata; use pezsnowbridge_pezpallet_system::Error; use testnet_teyrchains_constants::zagros::snowbridge::EthereumNetwork; diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_v2_inbound.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_v2_inbound.rs index f0a7ad76..83394b38 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_v2_inbound.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_v2_inbound.rs @@ -21,6 +21,12 @@ use crate::{ }, }; use asset_hub_zagros_runtime::ForeignAssets; +use codec::Encode; +use emulated_integration_tests_common::{ + snowbridge::{SEPOLIA_ID, WETH}, + RESERVABLE_ASSET_ID, +}; +use hex_literal::hex; use pezbridge_hub_zagros_runtime::{ bridge_common_config::BridgeReward, bridge_to_ethereum_config::{ @@ -28,12 +34,6 @@ use pezbridge_hub_zagros_runtime::{ }, EthereumInboundQueueV2, }; -use codec::Encode; -use emulated_integration_tests_common::{ - snowbridge::{SEPOLIA_ID, WETH}, - RESERVABLE_ASSET_ID, -}; -use hex_literal::hex; use pezkuwichain_zagros_system_emulated_network::pez_penpal_emulated_chain::PARA_ID_B; use pezsnowbridge_core::{reward::MessageId, AssetMetadata, TokenIdOf}; use pezsnowbridge_inbound_queue_primitives::v2::{ diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_v2_inbound_to_pezkuwichain.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_v2_inbound_to_pezkuwichain.rs index af93a5d4..ccc8ca2c 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_v2_inbound_to_pezkuwichain.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_v2_inbound_to_pezkuwichain.rs @@ -26,12 +26,12 @@ use crate::{ }, }; use asset_hub_zagros_runtime::ForeignAssets; +use codec::Encode; +use hex_literal::hex; use pezbridge_hub_zagros_runtime::{ bridge_common_config::BridgeReward, bridge_to_ethereum_config::EthereumGatewayAddress, EthereumInboundQueueV2, }; -use codec::Encode; -use hex_literal::hex; use pezsnowbridge_core::TokenIdOf; use pezsnowbridge_inbound_queue_primitives::v2::{ EthereumAsset::{ForeignTokenERC20, NativeTokenERC20}, diff --git a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_v2_rewards.rs b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_v2_rewards.rs index c9844a2e..fde0f5be 100644 --- a/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_v2_rewards.rs +++ b/pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros/src/tests/snowbridge_v2_rewards.rs @@ -14,8 +14,8 @@ // limitations under the License. use crate::tests::snowbridge_common::{eth_location, set_up_eth_and_hez_pool}; -use pezbridge_hub_zagros_runtime::bridge_common_config::{BridgeReward, BridgeRewardBeneficiaries}; use emulated_integration_tests_common::snowbridge::ETHER_MIN_BALANCE; +use pezbridge_hub_zagros_runtime::bridge_common_config::{BridgeReward, BridgeRewardBeneficiaries}; use pezpallet_bridge_relayers::{Error::FailedToPayReward, RewardLedger}; use crate::imports::*; diff --git a/pezcumulus/teyrchains/pezpallets/collective-content/src/lib.rs b/pezcumulus/teyrchains/pezpallets/collective-content/src/lib.rs index 4258d86b..7d0f31ae 100644 --- a/pezcumulus/teyrchains/pezpallets/collective-content/src/lib.rs +++ b/pezcumulus/teyrchains/pezpallets/collective-content/src/lib.rs @@ -15,13 +15,13 @@ //! Managed Collective Content Pezpallet //! -//! The pezpallet provides the functionality to store different types of content. This would typically -//! be used by an on-chain collective, such as the Pezkuwi Alliance or Ambassador Program. +//! The pezpallet provides the functionality to store different types of content. This would +//! typically be used by an on-chain collective, such as the Pezkuwi Alliance or Ambassador Program. //! -//! The pezpallet stores content as an [OpaqueCid], which should correspond to some off-chain hosting -//! service, such as IPFS, and contain any type of data. Each type of content has its own origin -//! from which it can be managed. The origins are configurable in the runtime. Storing content does -//! not require a deposit, as it is expected to be managed by a trusted collective. +//! The pezpallet stores content as an [OpaqueCid], which should correspond to some off-chain +//! hosting service, such as IPFS, and contain any type of data. Each type of content has its own +//! origin from which it can be managed. The origins are configurable in the runtime. Storing +//! content does not require a deposit, as it is expected to be managed by a trusted collective. //! //! Content types: //! diff --git a/pezcumulus/teyrchains/pezpallets/identity-kyc/src/lib.rs b/pezcumulus/teyrchains/pezpallets/identity-kyc/src/lib.rs index 45f09f44..89e1aa9b 100644 --- a/pezcumulus/teyrchains/pezpallets/identity-kyc/src/lib.rs +++ b/pezcumulus/teyrchains/pezpallets/identity-kyc/src/lib.rs @@ -124,7 +124,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type Currency: ReservableCurrency; /// Origin that can revoke citizenship (governance/root) diff --git a/pezcumulus/teyrchains/pezpallets/identity-kyc/src/types.rs b/pezcumulus/teyrchains/pezpallets/identity-kyc/src/types.rs index cd816524..3d75fa62 100644 --- a/pezcumulus/teyrchains/pezpallets/identity-kyc/src/types.rs +++ b/pezcumulus/teyrchains/pezpallets/identity-kyc/src/types.rs @@ -1,7 +1,7 @@ use codec::{Decode, Encode, MaxEncodedLen}; use pezframe_support::pezpallet_prelude::{BoundedVec, Get, RuntimeDebug}; -use scale_info::TypeInfo; use pezsp_core::H256; +use scale_info::TypeInfo; /// Citizenship status levels /// PRIVACY: No personal data stored on-chain, only status and hash diff --git a/pezcumulus/teyrchains/pezpallets/perwerde/src/lib.rs b/pezcumulus/teyrchains/pezpallets/perwerde/src/lib.rs index 41c62766..560de87d 100644 --- a/pezcumulus/teyrchains/pezpallets/perwerde/src/lib.rs +++ b/pezcumulus/teyrchains/pezpallets/perwerde/src/lib.rs @@ -114,7 +114,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type AdminOrigin: EnsureOrigin; type WeightInfo: WeightInfo; diff --git a/pezcumulus/teyrchains/pezpallets/perwerde/src/mock.rs b/pezcumulus/teyrchains/pezpallets/perwerde/src/mock.rs index 9a476417..df1fbf40 100644 --- a/pezcumulus/teyrchains/pezpallets/perwerde/src/mock.rs +++ b/pezcumulus/teyrchains/pezpallets/perwerde/src/mock.rs @@ -140,8 +140,8 @@ impl pezpallet_collective::Config for Test { pub fn new_test_ext() -> pezsp_io::TestExternalities { let t = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); - // `pezpallet-collective`'in genesis'ini de kurmamıza gerek kalmadı çünkü artık testimiz ona baÄŸlı - // deÄŸil. + // `pezpallet-collective`'in genesis'ini de kurmamıza gerek kalmadı çünkü artık testimiz ona + // baÄŸlı deÄŸil. let mut ext = pezsp_io::TestExternalities::new(t); ext.execute_with(|| System::set_block_number(1)); ext diff --git a/pezcumulus/teyrchains/pezpallets/pez-rewards/src/lib.rs b/pezcumulus/teyrchains/pezpallets/pez-rewards/src/lib.rs index 29c78e63..c04f9f8c 100644 --- a/pezcumulus/teyrchains/pezpallets/pez-rewards/src/lib.rs +++ b/pezcumulus/teyrchains/pezpallets/pez-rewards/src/lib.rs @@ -115,8 +115,8 @@ use pezframe_support::{ }; use pezframe_system::pezpallet_prelude::BlockNumberFor; use pezpallet_trust::TrustScoreProvider; -use scale_info::TypeInfo; use pezsp_runtime::traits::{AccountIdConversion, Member, Saturating, Zero}; +use scale_info::TypeInfo; #[pezframe_support::pezpallet] pub mod pezpallet { diff --git a/pezcumulus/teyrchains/pezpallets/pez-treasury/src/lib.rs b/pezcumulus/teyrchains/pezpallets/pez-treasury/src/lib.rs index a05ad4f8..56d429fa 100644 --- a/pezcumulus/teyrchains/pezpallets/pez-treasury/src/lib.rs +++ b/pezcumulus/teyrchains/pezpallets/pez-treasury/src/lib.rs @@ -2,7 +2,8 @@ //! # PEZ Treasury Pezpallet //! -//! A pezpallet for managing the PEZ token distribution and treasury with automated halving mechanics. +//! A pezpallet for managing the PEZ token distribution and treasury with automated halving +//! mechanics. //! //! ## Overview //! @@ -92,8 +93,8 @@ use pezframe_support::{ PalletId, }; use pezframe_system::pezpallet_prelude::BlockNumberFor; -use scale_info::TypeInfo; use pezsp_runtime::traits::{AccountIdConversion, Saturating, Zero}; +use scale_info::TypeInfo; #[pezframe_support::pezpallet] pub mod pezpallet { diff --git a/pezcumulus/teyrchains/pezpallets/pez-treasury/src/migrations.rs b/pezcumulus/teyrchains/pezpallets/pez-treasury/src/migrations.rs index 7b055d4b..3aced03e 100644 --- a/pezcumulus/teyrchains/pezpallets/pez-treasury/src/migrations.rs +++ b/pezcumulus/teyrchains/pezpallets/pez-treasury/src/migrations.rs @@ -91,7 +91,9 @@ pub mod v1 { } #[cfg(feature = "try-runtime")] - fn post_upgrade(state: pezsp_std::vec::Vec) -> Result<(), pezsp_runtime::TryRuntimeError> { + fn post_upgrade( + state: pezsp_std::vec::Vec, + ) -> Result<(), pezsp_runtime::TryRuntimeError> { use codec::Decode; let ( @@ -199,7 +201,9 @@ pub mod v2 { } #[cfg(feature = "try-runtime")] - fn post_upgrade(_state: pezsp_std::vec::Vec) -> Result<(), pezsp_runtime::TryRuntimeError> { + fn post_upgrade( + _state: pezsp_std::vec::Vec, + ) -> Result<(), pezsp_runtime::TryRuntimeError> { log::info!("✅ Post-upgrade check passed for pezpallet-pez-treasury v2"); Ok(()) } diff --git a/pezcumulus/teyrchains/pezpallets/pez-treasury/src/mock.rs b/pezcumulus/teyrchains/pezpallets/pez-treasury/src/mock.rs index f7e5c39e..d62a02e2 100644 --- a/pezcumulus/teyrchains/pezpallets/pez-treasury/src/mock.rs +++ b/pezcumulus/teyrchains/pezpallets/pez-treasury/src/mock.rs @@ -97,8 +97,9 @@ impl pezpallet_assets::Config for Test { type AssetId = u32; type AssetIdParameter = u32; type Currency = Balances; - type CreateOrigin = - pezframe_support::traits::AsEnsureOriginWithArg>; + type CreateOrigin = pezframe_support::traits::AsEnsureOriginWithArg< + pezframe_system::EnsureSigned, + >; type ForceOrigin = pezframe_system::EnsureRoot; type AssetDeposit = AssetDeposit; type AssetAccountDeposit = ConstU128<0>; diff --git a/pezcumulus/teyrchains/pezpallets/ping/src/lib.rs b/pezcumulus/teyrchains/pezpallets/ping/src/lib.rs index ae5f49a2..b27ca83d 100644 --- a/pezcumulus/teyrchains/pezpallets/ping/src/lib.rs +++ b/pezcumulus/teyrchains/pezpallets/ping/src/lib.rs @@ -49,7 +49,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type RuntimeOrigin: From<::RuntimeOrigin> + Into::RuntimeOrigin>>; diff --git a/pezcumulus/teyrchains/pezpallets/referral/src/lib.rs b/pezcumulus/teyrchains/pezpallets/referral/src/lib.rs index 34ea4d42..3d8fd050 100644 --- a/pezcumulus/teyrchains/pezpallets/referral/src/lib.rs +++ b/pezcumulus/teyrchains/pezpallets/referral/src/lib.rs @@ -2,7 +2,8 @@ //! # Referral Pezpallet //! -//! A pezpallet for managing user referrals and tracking network growth through invitation mechanics. +//! A pezpallet for managing user referrals and tracking network growth through invitation +//! mechanics. //! //! ## Overview //! @@ -120,7 +121,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config + pezpallet_identity_kyc::Config + TypeInfo { - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type WeightInfo: weights::WeightInfo; /// Default referrer account - used when no referrer is specified diff --git a/pezcumulus/teyrchains/pezpallets/staking-score/src/lib.rs b/pezcumulus/teyrchains/pezpallets/staking-score/src/lib.rs index 31ff6a57..54b6918e 100644 --- a/pezcumulus/teyrchains/pezpallets/staking-score/src/lib.rs +++ b/pezcumulus/teyrchains/pezpallets/staking-score/src/lib.rs @@ -149,7 +149,8 @@ pub mod pezpallet { // Ensuring BlockNumber is convertible from u32. BlockNumberFor: From, { - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Balance type to be used for staking. /// Adding all required mathematical and comparison properties. type Balance: Member diff --git a/pezcumulus/teyrchains/pezpallets/staking-score/src/mock.rs b/pezcumulus/teyrchains/pezpallets/staking-score/src/mock.rs index 4e9939d7..e63e7423 100644 --- a/pezcumulus/teyrchains/pezpallets/staking-score/src/mock.rs +++ b/pezcumulus/teyrchains/pezpallets/staking-score/src/mock.rs @@ -247,7 +247,8 @@ impl ExtBuilder { } pub fn build(self) -> pezsp_io::TestExternalities { - let mut storage = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); + let mut storage = + pezframe_system::GenesisConfig::::default().build_storage().unwrap(); let mut balances: Vec<(AccountId, Balance)> = vec![ (1, 1_000_000 * UNITS), @@ -287,8 +288,8 @@ impl ExtBuilder { }) .collect(), force_era: pezpallet_staking::Forcing::ForceNew, // Yeni era baÅŸlatmaya zorla - min_nominator_bond: MinNominatorBond::get(), // Tanımlanan minimum deÄŸerleri kullan - min_validator_bond: MinValidatorBond::get(), // Tanımlanan minimum deÄŸerleri kullan + min_nominator_bond: MinNominatorBond::get(), // Tanımlanan minimum deÄŸerleri kullan + min_validator_bond: MinValidatorBond::get(), // Tanımlanan minimum deÄŸerleri kullan ..Default::default() } .assimilate_storage(&mut storage) diff --git a/pezcumulus/teyrchains/pezpallets/tiki/src/lib.rs b/pezcumulus/teyrchains/pezpallets/tiki/src/lib.rs index a0a44b1c..191a9a3c 100644 --- a/pezcumulus/teyrchains/pezpallets/tiki/src/lib.rs +++ b/pezcumulus/teyrchains/pezpallets/tiki/src/lib.rs @@ -105,9 +105,9 @@ pub use pezpallet::*; use alloc::{format, vec::Vec}; use pezframe_support::pezpallet_prelude::{MaybeSerializeDeserialize, Parameter, RuntimeDebug}; +use pezsp_runtime::DispatchError; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; -use pezsp_runtime::DispatchError; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; @@ -133,9 +133,12 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: - pezframe_system::Config + pezpallet_nfts::Config + pezpallet_identity_kyc::Config + pezframe_system::Config + + pezpallet_nfts::Config + + pezpallet_identity_kyc::Config { - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type AdminOrigin: EnsureOrigin; type WeightInfo: weights::WeightInfo; diff --git a/pezcumulus/teyrchains/pezpallets/tiki/src/migrations.rs b/pezcumulus/teyrchains/pezpallets/tiki/src/migrations.rs index 7a7cb90a..017e9999 100644 --- a/pezcumulus/teyrchains/pezpallets/tiki/src/migrations.rs +++ b/pezcumulus/teyrchains/pezpallets/tiki/src/migrations.rs @@ -53,7 +53,10 @@ pub mod v1 { weight } else { - log::info!("👌 pezpallet-tiki migration not needed, current version is {:?}", current); + log::info!( + "👌 pezpallet-tiki migration not needed, current version is {:?}", + current + ); T::DbWeight::get().reads(1) } } @@ -80,7 +83,9 @@ pub mod v1 { } #[cfg(feature = "try-runtime")] - fn post_upgrade(state: pezsp_std::vec::Vec) -> Result<(), pezsp_runtime::TryRuntimeError> { + fn post_upgrade( + state: pezsp_std::vec::Vec, + ) -> Result<(), pezsp_runtime::TryRuntimeError> { use codec::Decode; let (pre_citizen_count, pre_user_tikis_count, pre_tiki_holder_count): (u32, u32, u32) = diff --git a/pezcumulus/teyrchains/pezpallets/token-wrapper/src/benchmarking.rs b/pezcumulus/teyrchains/pezpallets/token-wrapper/src/benchmarking.rs index 0eaef358..d9eaf0d5 100644 --- a/pezcumulus/teyrchains/pezpallets/token-wrapper/src/benchmarking.rs +++ b/pezcumulus/teyrchains/pezpallets/token-wrapper/src/benchmarking.rs @@ -27,8 +27,12 @@ mod benchmarks { T::Currency::make_free_balance_be(&pezpallet_account, funding); // Create asset - let _ = - T::Assets::create(T::WrapperAssetId::get(), pezpallet_account.clone(), true, 1u32.into()); + let _ = T::Assets::create( + T::WrapperAssetId::get(), + pezpallet_account.clone(), + true, + 1u32.into(), + ); #[extrinsic_call] _(RawOrigin::Signed(caller.clone()), amount); @@ -51,8 +55,12 @@ mod benchmarks { T::Currency::make_free_balance_be(&pezpallet_account, funding); // Create asset - let _ = - T::Assets::create(T::WrapperAssetId::get(), pezpallet_account.clone(), true, 1u32.into()); + let _ = T::Assets::create( + T::WrapperAssetId::get(), + pezpallet_account.clone(), + true, + 1u32.into(), + ); // Wrap first let _ = Pezpallet::::wrap(RawOrigin::Signed(caller.clone()).into(), amount); diff --git a/pezcumulus/teyrchains/pezpallets/trust/src/lib.rs b/pezcumulus/teyrchains/pezpallets/trust/src/lib.rs index bbf2303d..8e676ba6 100644 --- a/pezcumulus/teyrchains/pezpallets/trust/src/lib.rs +++ b/pezcumulus/teyrchains/pezpallets/trust/src/lib.rs @@ -153,7 +153,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config + pezpallet_identity_kyc::Config { - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type WeightInfo: WeightInfo; type Score: Member diff --git a/pezcumulus/teyrchains/pezpallets/welati/src/benchmarking.rs b/pezcumulus/teyrchains/pezpallets/welati/src/benchmarking.rs index ce2686c8..e4c84b8b 100644 --- a/pezcumulus/teyrchains/pezpallets/welati/src/benchmarking.rs +++ b/pezcumulus/teyrchains/pezpallets/welati/src/benchmarking.rs @@ -121,8 +121,13 @@ mod benchmarks { let election = ActiveElections::::get(0).unwrap(); pezframe_system::Pezpallet::::set_block_number(election.voting_start); - Pezpallet::::cast_vote(RawOrigin::Signed(voter.clone()).into(), 0, vec![candidate], None) - .unwrap(); + Pezpallet::::cast_vote( + RawOrigin::Signed(voter.clone()).into(), + 0, + vec![candidate], + None, + ) + .unwrap(); // 2. Advance to election end time pezframe_system::Pezpallet::::set_block_number(election.end_block + 1u32.into()); diff --git a/pezcumulus/teyrchains/pezpallets/welati/src/lib.rs b/pezcumulus/teyrchains/pezpallets/welati/src/lib.rs index a5e6afec..80ca0f5d 100644 --- a/pezcumulus/teyrchains/pezpallets/welati/src/lib.rs +++ b/pezcumulus/teyrchains/pezpallets/welati/src/lib.rs @@ -224,7 +224,8 @@ pub mod pezpallet { + pezpallet_identity_kyc::Config + core::fmt::Debug { - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type WeightInfo: crate::WeightInfo; type Randomness: Randomness>; type RuntimeCall: Parameter diff --git a/pezcumulus/teyrchains/pezpallets/welati/src/migrations.rs b/pezcumulus/teyrchains/pezpallets/welati/src/migrations.rs index 6d44a81f..c17de433 100644 --- a/pezcumulus/teyrchains/pezpallets/welati/src/migrations.rs +++ b/pezcumulus/teyrchains/pezpallets/welati/src/migrations.rs @@ -127,7 +127,9 @@ pub mod v1 { } #[cfg(feature = "try-runtime")] - fn post_upgrade(state: pezsp_std::vec::Vec) -> Result<(), pezsp_runtime::TryRuntimeError> { + fn post_upgrade( + state: pezsp_std::vec::Vec, + ) -> Result<(), pezsp_runtime::TryRuntimeError> { use codec::Decode; let ( @@ -339,7 +341,9 @@ pub mod v2 { } #[cfg(feature = "try-runtime")] - fn post_upgrade(_state: pezsp_std::vec::Vec) -> Result<(), pezsp_runtime::TryRuntimeError> { + fn post_upgrade( + _state: pezsp_std::vec::Vec, + ) -> Result<(), pezsp_runtime::TryRuntimeError> { log::info!("✅ Post-upgrade check passed for pezpallet-welati v2"); Ok(()) } diff --git a/pezcumulus/teyrchains/pezpallets/welati/src/types.rs b/pezcumulus/teyrchains/pezpallets/welati/src/types.rs index e27dd9cc..daa131e0 100644 --- a/pezcumulus/teyrchains/pezpallets/welati/src/types.rs +++ b/pezcumulus/teyrchains/pezpallets/welati/src/types.rs @@ -2,9 +2,9 @@ use codec::{Decode, Encode, MaxEncodedLen}; use pezframe_support::pezpallet_prelude::*; use pezframe_system::{pezpallet_prelude::BlockNumberFor, Config as SystemConfig}; use pezpallet_tiki::Tiki; -use scale_info::TypeInfo; use pezsp_runtime::RuntimeDebug; use pezsp_std::prelude::*; +use scale_info::TypeInfo; #[derive(RuntimeDebug, Eq, PartialEq)] pub enum ElectionOutcome { diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/bridge-primitives/src/lib.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/bridge-primitives/src/lib.rs index a0fd5b17..551fb336 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/bridge-primitives/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/bridge-primitives/src/lib.rs @@ -24,10 +24,10 @@ use scale_info::TypeInfo; pub use bp_bridge_hub_pezcumulus::*; use bp_messages::*; +pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall; use pezbp_runtime::{ decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, Chain, ChainId, Teyrchain, }; -pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall; use pezframe_support::{ dispatch::DispatchClass, pezsp_runtime::{MultiAddress, MultiSigner, RuntimeDebug, StateVersion}, diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/genesis_config_presets.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/genesis_config_presets.rs index 0239a56e..5092755c 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/genesis_config_presets.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/genesis_config_presets.rs @@ -25,9 +25,9 @@ use crate::{ *, }; use alloc::{vec, vec::Vec}; +use hex_literal::hex; use pezcumulus_primitives_core::ParaId; use pezframe_support::build_struct_json_patch; -use hex_literal::hex; use pezsp_core::crypto::UncheckedInto; use pezsp_genesis_builder::PresetId; use pezsp_keyring::Sr25519Keyring; diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/lib.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/lib.rs index d782de2d..b308cc1d 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/lib.rs @@ -43,7 +43,9 @@ use assets_common::{ AssetIdForPoolAssets, AssetIdForPoolAssetsConvert, AssetIdForTrustBackedAssetsConvert, }; use bp_asset_hub_pezkuwichain::CreateForeignAssetDeposit; -use pezcumulus_pezpallet_teyrchain_system::{RelayNumberMonotonicallyIncreases, RelaychainDataProvider}; +use pezcumulus_pezpallet_teyrchain_system::{ + RelayNumberMonotonicallyIncreases, RelaychainDataProvider, +}; use pezcumulus_primitives_core::AggregateMessageOrigin; use pezsp_api::impl_runtime_apis; use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata}; @@ -104,8 +106,8 @@ mod tests; pub use pezsp_runtime::BuildStorage; // Pezkuwi imports -use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezkuwi_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; +use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; #[cfg(feature = "runtime-benchmarks")] use xcm::latest::prelude::{ Asset, Assets as XcmAssets, Fungible, Here, InteriorLocation, Junction, Junction::*, Location, @@ -658,8 +660,9 @@ impl InstanceFilter for ProxyType { RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_metadata { .. }) | RuntimeCall::Uniques(pezpallet_uniques::Call::clear_metadata { .. }) | RuntimeCall::Uniques(pezpallet_uniques::Call::clear_attribute { .. }) | - RuntimeCall::Uniques(pezpallet_uniques::Call::clear_collection_metadata { .. }) | - RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_max_supply { .. }) | + RuntimeCall::Uniques( + pezpallet_uniques::Call::clear_collection_metadata { .. } + ) | RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_max_supply { .. }) | RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } ), @@ -1151,7 +1154,8 @@ impl pezpallet_treasury::Config for Runtime { type AssetKind = (); type Beneficiary = AccountId; type BeneficiaryLookup = pezsp_runtime::traits::IdentityLookup; - type Paymaster = pezframe_support::traits::tokens::pay::PayFromAccount; + type Paymaster = + pezframe_support::traits::tokens::pay::PayFromAccount; type BalanceConverter = pezframe_support::traits::tokens::UnityAssetBalanceConversion; type PayoutPeriod = PayoutSpendPeriod; type BlockNumberProvider = pezframe_system::Pezpallet; diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/staking.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/staking.rs index 9ae7faeb..2ed8043b 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/staking.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/staking.rs @@ -17,10 +17,10 @@ use super::*; use pezcumulus_primitives_core::relay_chain::SessionIndex; use pezframe_election_provider_support::{ElectionDataProvider, SequentialPhragmen}; +use pezkuwi_runtime_common::{prod_or_fast, BalanceToU256, U256ToBalance}; use pezpallet_election_provider_multi_block::{self as multi_block, SolutionAccuracyOf}; use pezpallet_staking_async::UseValidatorsMap; use pezpallet_staking_async_rc_client as rc_client; -use pezkuwi_runtime_common::{prod_or_fast, BalanceToU256, U256ToBalance}; use pezsp_runtime::{ transaction_validity::TransactionPriority, FixedPointNumber, FixedU128, SaturatedConversion, }; @@ -139,7 +139,8 @@ impl multi_block::verifier::Config for Runtime { type MaxBackersPerWinner = MaxBackersPerWinner; type MaxBackersPerWinnerFinal = MaxBackersPerWinnerFinal; type SolutionDataProvider = MultiBlockElectionSigned; - type WeightInfo = weights::pezpallet_election_provider_multi_block_verifier::WeightInfo; + type WeightInfo = + weights::pezpallet_election_provider_multi_block_verifier::WeightInfo; } parameter_types! { @@ -178,7 +179,8 @@ impl multi_block::unsigned::Config for Runtime { type OffchainSolver = SequentialPhragmen>; type MinerTxPriority = MinerTxPriority; type OffchainRepeat = OffchainRepeat; - type WeightInfo = weights::pezpallet_election_provider_multi_block_unsigned::WeightInfo; + type WeightInfo = + weights::pezpallet_election_provider_multi_block_unsigned::WeightInfo; } parameter_types! { @@ -288,7 +290,8 @@ impl pezpallet_staking_async::Config for Runtime { type VoterList = VoterList; type TargetList = UseValidatorsMap; type MaxValidatorSet = MaxValidatorSet; - type NominationsQuota = pezpallet_staking_async::FixedNominationsQuota<{ MaxNominations::get() }>; + type NominationsQuota = + pezpallet_staking_async::FixedNominationsQuota<{ MaxNominations::get() }>; type MaxUnlockingChunks = pezframe_support::traits::ConstU32<32>; type HistoryDepth = pezframe_support::traits::ConstU32<84>; type MaxControllersInDeprecationBatch = MaxControllersInDeprecationBatch; diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/tests/mod.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/tests/mod.rs index 5aeb09d8..6407c597 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/tests/mod.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/tests/mod.rs @@ -27,7 +27,8 @@ fn sane_block_weight() { use pezpallet_balances::WeightInfo; let block = RuntimeBlockWeights::get().max_block; let base = RuntimeBlockWeights::get().get(DispatchClass::Normal).base_extrinsic; - let transfer = base + weights::pezpallet_balances::WeightInfo::::transfer_allow_death(); + let transfer = + base + weights::pezpallet_balances::WeightInfo::::transfer_allow_death(); let fit = block.checked_div_per_component(&transfer).unwrap_or_default(); assert!(fit >= 1000, "{} should be at least 1000", fit); @@ -38,7 +39,8 @@ fn sane_block_weight() { fn sane_transfer_fee() { use pezpallet_balances::WeightInfo; let base = RuntimeBlockWeights::get().get(DispatchClass::Normal).base_extrinsic; - let transfer = base + weights::pezpallet_balances::WeightInfo::::transfer_allow_death(); + let transfer = + base + weights::pezpallet_balances::WeightInfo::::transfer_allow_death(); let fee: Balance = fee::WeightToFee::weight_to_fee(&transfer); assert!(fee <= CENTS, "{} MILLICENTS should be at most 1000", fee / MILLICENTS); diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/weights/mod.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/weights/mod.rs index ec5dafae..6694d46f 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/weights/mod.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/weights/mod.rs @@ -15,10 +15,11 @@ // limitations under the License. pub mod block_weights; +pub mod extrinsic_weights; +pub mod paritydb_weights; pub mod pezcumulus_pezpallet_teyrchain_system; pub mod pezcumulus_pezpallet_weight_reclaim; pub mod pezcumulus_pezpallet_xcmp_queue; -pub mod extrinsic_weights; pub mod pezframe_system; pub mod pezframe_system_extensions; pub mod pezpallet_asset_conversion; @@ -49,7 +50,6 @@ pub mod pezpallet_uniques; pub mod pezpallet_utility; pub mod pezpallet_xcm; pub mod pezpallet_xcm_bridge_hub_router; -pub mod paritydb_weights; pub mod rocksdb_weights; pub mod xcm; diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/xcm_config.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/xcm_config.rs index 47de72e4..8179fd49 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/xcm_config.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/src/xcm_config.rs @@ -35,10 +35,10 @@ use pezframe_support::{ }, }; use pezframe_system::EnsureRoot; -use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezkuwi_runtime_common::xcm_sender::ExponentialPrice; use pezkuwi_teyrchain_primitives::primitives::Sibling; use pezkuwichain_runtime_constants::system_teyrchain::ASSET_HUB_ID; +use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezsp_runtime::traits::{AccountIdConversion, TryConvertInto}; use testnet_teyrchains_constants::pezkuwichain::snowbridge::{ EthereumNetwork, INBOUND_QUEUE_PALLET_INDEX, @@ -271,8 +271,8 @@ pub type Barrier = TrailingSetTopicAsId< // If the message is one that immediately attempts to pay for execution, then // allow it. AllowTopLevelPaidExecutionFrom, - // Parent, its pluralities (i.e. governance bodies), relay treasury pezpallet and - // BridgeHub get free execution. + // Parent, its pluralities (i.e. governance bodies), relay treasury pezpallet + // and BridgeHub get free execution. AllowExplicitUnpaidExecutionFrom<( ParentOrParentsPlurality, Equals, diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/tests/tests.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/tests/tests.rs index fab67fbc..74bc7084 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/tests/tests.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/tests/tests.rs @@ -33,6 +33,7 @@ use asset_test_pezutils::{ ExtBuilder, GovernanceOrigin, SlotDurations, }; use codec::{Decode, Encode}; +use hex_literal::hex; use pezframe_support::{ assert_noop, assert_ok, parameter_types, traits::{ @@ -43,7 +44,6 @@ use pezframe_support::{ }, weights::{Weight, WeightToFee as WeightToFeeT}, }; -use hex_literal::hex; use pezsp_consensus_aura::SlotDuration; use pezsp_core::crypto::Ss58Codec; use pezsp_runtime::traits::MaybeEquivalence; diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/bridge-primitives/src/lib.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/bridge-primitives/src/lib.rs index e0999c11..c75fd67a 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/bridge-primitives/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/bridge-primitives/src/lib.rs @@ -21,11 +21,11 @@ extern crate alloc; pub use bp_bridge_hub_pezcumulus::*; use bp_messages::*; +pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall; +use codec::{Decode, Encode}; use pezbp_runtime::{ decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, Chain, ChainId, Teyrchain, }; -pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall; -use codec::{Decode, Encode}; use pezframe_support::{ dispatch::DispatchClass, pezsp_runtime::{MultiAddress, MultiSigner, RuntimeDebug, StateVersion}, diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/genesis_config_presets.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/genesis_config_presets.rs index 96703076..ea25b63a 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/genesis_config_presets.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/genesis_config_presets.rs @@ -20,9 +20,9 @@ use crate::{ *, }; use alloc::{vec, vec::Vec}; +use hex_literal::hex; use pezcumulus_primitives_core::ParaId; use pezframe_support::build_struct_json_patch; -use hex_literal::hex; use pezsp_core::crypto::UncheckedInto; use pezsp_genesis_builder::PresetId; use pezsp_keyring::Sr25519Keyring; diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/governance/mod.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/governance/mod.rs index dbc70848..a859d0f1 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/governance/mod.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/governance/mod.rs @@ -23,11 +23,11 @@ use pezframe_support::{ traits::{tokens::UnityOrOuterConversion, EitherOf, EitherOfDiverse, FromContains}, }; use pezframe_system::EnsureRootWithSuccess; -use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezkuwi_runtime_common::{ impls::{ContainsParts, VersionedLocatableAsset}, prod_or_fast, }; +use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezsp_runtime::{traits::IdentityLookup, Percent}; use teyrchains_common::pay::{LocalPay, VersionedLocatableAccount}; use xcm::latest::BodyId; diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/lib.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/lib.rs index 8132d0f0..7e160984 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/lib.rs @@ -36,7 +36,9 @@ pub mod governance; mod migrations; mod staking; -use governance::{pezpallet_custom_origins, FellowshipAdmin, GeneralAdmin, StakingAdmin, Treasurer}; +use governance::{ + pezpallet_custom_origins, FellowshipAdmin, GeneralAdmin, StakingAdmin, Treasurer, +}; extern crate alloc; @@ -48,7 +50,9 @@ use assets_common::{ }; use bp_asset_hub_zagros::CreateForeignAssetDeposit; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use pezcumulus_pezpallet_teyrchain_system::{RelayNumberMonotonicallyIncreases, RelaychainDataProvider}; +use pezcumulus_pezpallet_teyrchain_system::{ + RelayNumberMonotonicallyIncreases, RelaychainDataProvider, +}; use pezcumulus_primitives_core::{relay_chain::AccountIndex, AggregateMessageOrigin, ParaId}; use pezframe_support::{ construct_runtime, derive_impl, @@ -783,8 +787,9 @@ impl InstanceFilter for ProxyType { RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_metadata { .. }) | RuntimeCall::Uniques(pezpallet_uniques::Call::clear_metadata { .. }) | RuntimeCall::Uniques(pezpallet_uniques::Call::clear_attribute { .. }) | - RuntimeCall::Uniques(pezpallet_uniques::Call::clear_collection_metadata { .. }) | - RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_max_supply { .. }) | + RuntimeCall::Uniques( + pezpallet_uniques::Call::clear_collection_metadata { .. } + ) | RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_max_supply { .. }) | RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } ), @@ -1521,7 +1526,8 @@ impl pezframe_support::traits::OnRuntimeUpgrade for DeleteUndecodableStorage { }, Err(e) => { tracing::error!(target: "bridges::on_runtime_upgrade", error=?e, "Failed to destroy undecodable NFT item"); - return ::DbWeight::get().reads_writes(0, writes); + return ::DbWeight::get() + .reads_writes(0, writes); }, } @@ -1533,7 +1539,8 @@ impl pezframe_support::traits::OnRuntimeUpgrade for DeleteUndecodableStorage { }, Err(e) => { tracing::error!(target: "bridges::on_runtime_upgrade", error=?e, "Failed to destroy undecodable NFT item"); - return ::DbWeight::get().reads_writes(0, writes); + return ::DbWeight::get() + .reads_writes(0, writes); }, } diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/staking.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/staking.rs index d5068983..73a4f26b 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/staking.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/staking.rs @@ -18,10 +18,10 @@ use super::*; use pezcumulus_primitives_core::relay_chain::SessionIndex; use pezframe_election_provider_support::{ElectionDataProvider, SequentialPhragmen}; use pezframe_support::traits::EitherOf; +use pezkuwi_runtime_common::{prod_or_fast, BalanceToU256, U256ToBalance}; use pezpallet_election_provider_multi_block::{self as multi_block, SolutionAccuracyOf}; use pezpallet_staking_async::UseValidatorsMap; use pezpallet_staking_async_rc_client as rc_client; -use pezkuwi_runtime_common::{prod_or_fast, BalanceToU256, U256ToBalance}; use pezsp_runtime::{ transaction_validity::TransactionPriority, FixedPointNumber, FixedU128, SaturatedConversion, }; @@ -140,7 +140,8 @@ impl multi_block::verifier::Config for Runtime { type MaxBackersPerWinner = MaxBackersPerWinner; type MaxBackersPerWinnerFinal = MaxBackersPerWinnerFinal; type SolutionDataProvider = MultiBlockElectionSigned; - type WeightInfo = weights::pezpallet_election_provider_multi_block_verifier::WeightInfo; + type WeightInfo = + weights::pezpallet_election_provider_multi_block_verifier::WeightInfo; } parameter_types! { @@ -179,7 +180,8 @@ impl multi_block::unsigned::Config for Runtime { type OffchainSolver = SequentialPhragmen>; type MinerTxPriority = MinerTxPriority; type OffchainRepeat = OffchainRepeat; - type WeightInfo = weights::pezpallet_election_provider_multi_block_unsigned::WeightInfo; + type WeightInfo = + weights::pezpallet_election_provider_multi_block_unsigned::WeightInfo; } parameter_types! { @@ -289,7 +291,8 @@ impl pezpallet_staking_async::Config for Runtime { type VoterList = VoterList; type TargetList = UseValidatorsMap; type MaxValidatorSet = MaxValidatorSet; - type NominationsQuota = pezpallet_staking_async::FixedNominationsQuota<{ MaxNominations::get() }>; + type NominationsQuota = + pezpallet_staking_async::FixedNominationsQuota<{ MaxNominations::get() }>; type MaxUnlockingChunks = pezframe_support::traits::ConstU32<32>; type HistoryDepth = pezframe_support::traits::ConstU32<84>; type MaxControllersInDeprecationBatch = MaxControllersInDeprecationBatch; diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/weights/mod.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/weights/mod.rs index a7697b52..11653af8 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/weights/mod.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/weights/mod.rs @@ -14,13 +14,14 @@ // limitations under the License. pub mod block_weights; +pub mod extrinsic_weights; +pub mod inmemorydb_weights; +pub mod paritydb_weights; pub mod pezcumulus_pezpallet_teyrchain_system; pub mod pezcumulus_pezpallet_weight_reclaim; pub mod pezcumulus_pezpallet_xcmp_queue; -pub mod extrinsic_weights; pub mod pezframe_system; pub mod pezframe_system_extensions; -pub mod inmemorydb_weights; pub mod pezpallet_ah_ops; pub mod pezpallet_asset_conversion; pub mod pezpallet_asset_conversion_ops; @@ -61,10 +62,9 @@ pub mod pezpallet_vesting; pub mod pezpallet_whitelist; pub mod pezpallet_xcm; pub mod pezpallet_xcm_bridge_hub_router; -pub mod paritydb_weights; -pub mod rocksdb_weights; pub mod pezsnowbridge_pezpallet_system_backend; pub mod pezsnowbridge_pezpallet_system_frontend; +pub mod rocksdb_weights; pub mod xcm; pub use block_weights::constants::BlockExecutionWeight; diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/xcm_config.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/xcm_config.rs index ce0e473d..c67fdffc 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/xcm_config.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/src/xcm_config.rs @@ -38,9 +38,9 @@ use pezframe_support::{ PalletId, }; use pezframe_system::EnsureRoot; -use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezkuwi_runtime_common::xcm_sender::ExponentialPrice; use pezkuwi_teyrchain_primitives::primitives::Sibling; +use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezsnowbridge_outbound_queue_primitives::v2::exporter::PausableExporter; use pezsp_runtime::traits::{AccountIdConversion, TryConvertInto}; use testnet_teyrchains_constants::zagros::locations::AssetHubParaId; @@ -325,8 +325,8 @@ pub type Barrier = TrailingSetTopicAsId< // If the message is one that immediately attempts to pay for execution, then // allow it. AllowTopLevelPaidExecutionFrom, - // Parent, its pluralities (i.e. governance bodies), relay treasury pezpallet and - // sibling teyrchains get free execution. + // Parent, its pluralities (i.e. governance bodies), relay treasury pezpallet + // and sibling teyrchains get free execution. AllowExplicitUnpaidExecutionFrom<( ParentOrParentsPlurality, Equals, diff --git a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/tests/tests.rs b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/tests/tests.rs index 179e9307..b1241fd9 100644 --- a/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/tests/tests.rs +++ b/pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/tests/tests.rs @@ -40,6 +40,7 @@ use asset_test_pezutils::{ }; use assets_common::local_and_foreign_assets::ForeignAssetReserveData; use codec::{Decode, Encode}; +use hex_literal::hex; use pezframe_support::{ assert_err, assert_noop, assert_ok, parameter_types, traits::{ @@ -55,7 +56,6 @@ use pezframe_support::{ }, weights::{Weight, WeightToFee as WeightToFeeT}, }; -use hex_literal::hex; use pezpallet_revive::{ test_utils::builder::{BareInstantiateBuilder, Contract}, Code, @@ -89,8 +89,9 @@ const SOME_ASSET_ADMIN: [u8; 32] = [5u8; 32]; const ERC20_PVM: &[u8] = include_bytes!("../../../../../../bizinikiwi/pezframe/revive/fixtures/erc20/erc20.polkavm"); -const FAKE_ERC20_PVM: &[u8] = - include_bytes!("../../../../../../bizinikiwi/pezframe/revive/fixtures/erc20/fake_erc20.polkavm"); +const FAKE_ERC20_PVM: &[u8] = include_bytes!( + "../../../../../../bizinikiwi/pezframe/revive/fixtures/erc20/fake_erc20.polkavm" +); const EXPENSIVE_ERC20_PVM: &[u8] = include_bytes!( "../../../../../../bizinikiwi/pezframe/revive/fixtures/erc20/expensive_erc20.polkavm" diff --git a/pezcumulus/teyrchains/runtimes/assets/common/src/benchmarks.rs b/pezcumulus/teyrchains/runtimes/assets/common/src/benchmarks.rs index 209851f5..201ebd63 100644 --- a/pezcumulus/teyrchains/runtimes/assets/common/src/benchmarks.rs +++ b/pezcumulus/teyrchains/runtimes/assets/common/src/benchmarks.rs @@ -38,7 +38,8 @@ pub struct AssetPairFactory( PhantomData<(Target, SelfParaId, PalletId, L)>, ); impl, SelfParaId: Get, PalletId: Get, L: TryFrom + Debug> - pezpallet_asset_conversion::BenchmarkHelper for AssetPairFactory + pezpallet_asset_conversion::BenchmarkHelper + for AssetPairFactory where >::Error: Debug, { diff --git a/pezcumulus/teyrchains/runtimes/assets/common/src/fungible_conversion.rs b/pezcumulus/teyrchains/runtimes/assets/common/src/fungible_conversion.rs index 6df48aac..28e2886e 100644 --- a/pezcumulus/teyrchains/runtimes/assets/common/src/fungible_conversion.rs +++ b/pezcumulus/teyrchains/runtimes/assets/common/src/fungible_conversion.rs @@ -137,7 +137,10 @@ where } /// Helper function to convert `Balance` with Location` to `Asset` -pub fn convert_balance, Balance: TryInto>( +pub fn convert_balance< + T: pezframe_support::pezpallet_prelude::Get, + Balance: TryInto, +>( balance: Balance, ) -> Result { match balance.try_into() { diff --git a/pezcumulus/teyrchains/runtimes/assets/common/src/lib.rs b/pezcumulus/teyrchains/runtimes/assets/common/src/lib.rs index a9399a49..44a45c4f 100644 --- a/pezcumulus/teyrchains/runtimes/assets/common/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/assets/common/src/lib.rs @@ -74,8 +74,8 @@ pub type TrustBackedAssetsConvertedConcreteId< pub type UniquesConvertedConcreteId = MatchedConvertedConcreteId< CollectionId, ItemId, - // The asset starts with the uniques pezpallet. The `CollectionId` of the asset is specified as a - // junction within the pezpallet itself. + // The asset starts with the uniques pezpallet. The `CollectionId` of the asset is specified as + // a junction within the pezpallet itself. StartsWith, CollectionIdForUniquesConvert, TryConvertInto, @@ -175,8 +175,8 @@ pub type PoolAssetsConvertedConcreteId = TryConvertInto, >; -/// Adapter implementation for accessing pools (`pezpallet_asset_conversion`) that uses `AssetKind` as -/// a `xcm::v*` which could be different from the `xcm::latest`. +/// Adapter implementation for accessing pools (`pezpallet_asset_conversion`) that uses `AssetKind` +/// as a `xcm::v*` which could be different from the `xcm::latest`. pub struct PoolAdapter(PhantomData); impl< Runtime: pezpallet_asset_conversion::Config, @@ -230,15 +230,17 @@ impl< /// Helper function for filtering pool. pub fn iter_assets_in_pool_with(asset: &L) -> impl Iterator + '_ { - pezpallet_asset_conversion::Pools::::iter_keys().filter_map(|(asset_1, asset_2)| { - if asset_1 == *asset { - Some(asset_2) - } else if asset_2 == *asset { - Some(asset_1) - } else { - None - } - }) + pezpallet_asset_conversion::Pools::::iter_keys().filter_map( + |(asset_1, asset_2)| { + if asset_1 == *asset { + Some(asset_2) + } else if asset_2 == *asset { + Some(asset_1) + } else { + None + } + }, + ) } } diff --git a/pezcumulus/teyrchains/runtimes/assets/test-utils/src/test_cases.rs b/pezcumulus/teyrchains/runtimes/assets/test-utils/src/test_cases.rs index 0f771367..cc472a53 100644 --- a/pezcumulus/teyrchains/runtimes/assets/test-utils/src/test_cases.rs +++ b/pezcumulus/teyrchains/runtimes/assets/test-utils/src/test_cases.rs @@ -883,7 +883,8 @@ pub fn asset_transactor_transfer_with_pallet_assets_instance_works< From + Into, >::AssetIdParameter: From + Into, - >::Balance: From + Into, + >::Balance: + From + Into, ::AccountId: Into<<::RuntimeOrigin as OriginTrait>::AccountId>, <::Lookup as StaticLookup>::Source: @@ -1199,11 +1200,15 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_teyrchain_assets_wor .with_tracing() .build() .execute_with(|| { - assert!(>::asset_ids() - .collect::>() - .is_empty()); + assert!( + >::asset_ids() + .collect::>() + .is_empty() + ); assert_eq!( - >::free_balance(&foreign_creator_as_account_id), + >::free_balance( + &foreign_creator_as_account_id + ), existential_deposit + asset_deposit + metadata_deposit_base + metadata_deposit_per_byte_eta + @@ -1289,9 +1294,11 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_teyrchain_assets_wor assert!(events.any(|e| matches!(e, pezpallet_assets::Event::TeamChanged { .. }))); // check assets after - assert!(!>::asset_ids() - .collect::>() - .is_empty()); + assert!( + !>::asset_ids() + .collect::>() + .is_empty() + ); // check update metadata use pezframe_support::traits::fungibles::roles::Inspect as InspectRoles; @@ -1320,10 +1327,13 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_teyrchain_assets_wor Some(bob_account.clone()) ); assert!( - >::free_balance(&foreign_creator_as_account_id) >= - existential_deposit + buy_execution_fee_amount.into(), + >::free_balance( + &foreign_creator_as_account_id + ) >= existential_deposit + buy_execution_fee_amount.into(), "Free balance: {:?} should be ge {:?}", - >::free_balance(&foreign_creator_as_account_id), + >::free_balance( + &foreign_creator_as_account_id + ), existential_deposit + buy_execution_fee_amount.into() ); assert_metadata::< @@ -1701,9 +1711,10 @@ where assert_eq!(execution_fees, expected_weight_native_fee); // We need some balance to create an asset. - assert_ok!( - pezpallet_balances::Pezpallet::::mint_into(&test_account, 3_000_000_000_000,) - ); + assert_ok!(pezpallet_balances::Pezpallet::::mint_into( + &test_account, + 3_000_000_000_000, + )); // Now we try to use an asset that's not in a pool. let asset_id = 1984u32; // USDT. diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/bridge-primitives/src/lib.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/bridge-primitives/src/lib.rs index 15f5e175..7e4636d8 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/bridge-primitives/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/bridge-primitives/src/lib.rs @@ -21,10 +21,10 @@ pub use bp_bridge_hub_pezcumulus::*; use bp_messages::*; +use codec::{Decode, Encode}; use pezbp_runtime::{ decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, Chain, ChainId, Teyrchain, }; -use codec::{Decode, Encode}; use pezframe_support::{ dispatch::DispatchClass, pezsp_runtime::{MultiAddress, MultiSigner, RuntimeDebug, StateVersion}, diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/bridge_to_bulletin_config.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/bridge_to_bulletin_config.rs index 5261210b..db8c2827 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/bridge_to_bulletin_config.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/bridge_to_bulletin_config.rs @@ -35,12 +35,12 @@ use pezframe_support::{ traits::{Equals, PalletInfoAccess}, }; use pezframe_system::{EnsureNever, EnsureRoot}; +use pezkuwi_teyrchain_primitives::primitives::Sibling; use pezpallet_bridge_messages::LaneIdOf; use pezpallet_bridge_relayers::extension::{ BridgeRelayersTransactionExtension, WithMessagesExtensionConfig, }; use pezpallet_xcm_bridge_hub::XcmAsPlainPayload; -use pezkuwi_teyrchain_primitives::primitives::Sibling; use testnet_teyrchains_constants::pezkuwichain::currency::UNITS as TYR; use xcm::{ latest::prelude::*, @@ -115,7 +115,9 @@ pub type WithPezkuwichainBulletinMessagesInstance = pezpallet_bridge_messages::I impl pezpallet_bridge_messages::Config for Runtime { type RuntimeEvent = RuntimeEvent; type WeightInfo = - weights::pezpallet_bridge_messages_pezkuwichain_to_pezkuwichain_bulletin::WeightInfo; + weights::pezpallet_bridge_messages_pezkuwichain_to_pezkuwichain_bulletin::WeightInfo< + Runtime, + >; type ThisChain = bp_bridge_hub_pezkuwichain::BridgeHubPezkuwichain; type BridgedChain = bp_pezkuwi_bulletin::PezkuwiBulletin; diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/bridge_to_ethereum_config.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/bridge_to_ethereum_config.rs index b3661e70..b47b6800 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/bridge_to_ethereum_config.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/bridge_to_ethereum_config.rs @@ -38,8 +38,8 @@ use crate::xcm_config::RelayNetwork; #[cfg(feature = "runtime-benchmarks")] use benchmark_helpers::DoNothingRouter; use bp_asset_hub_pezkuwichain::CreateForeignAssetDeposit; -use pezframe_support::{parameter_types, weights::ConstantMultiplier}; use hex_literal::hex; +use pezframe_support::{parameter_types, weights::ConstantMultiplier}; use pezpallet_xcm::EnsureXcm; use pezsp_runtime::{ traits::{ConstU32, ConstU8, Keccak256}, @@ -186,7 +186,8 @@ parameter_types! { }; } -pub const SLOTS_PER_EPOCH: u32 = pezsnowbridge_pezpallet_ethereum_client::config::SLOTS_PER_EPOCH as u32; +pub const SLOTS_PER_EPOCH: u32 = + pezsnowbridge_pezpallet_ethereum_client::config::SLOTS_PER_EPOCH as u32; impl pezsnowbridge_pezpallet_ethereum_client::Config for Runtime { type RuntimeEvent = RuntimeEvent; diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/bridge_to_zagros_config.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/bridge_to_zagros_config.rs index 43412341..17aeeeeb 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/bridge_to_zagros_config.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/bridge_to_zagros_config.rs @@ -35,11 +35,11 @@ use pezpallet_xcm_bridge_hub::{BridgeId, XcmAsPlainPayload}; use pezframe_support::{parameter_types, traits::PalletInfoAccess}; use pezframe_system::{EnsureNever, EnsureRoot}; +use pezkuwi_teyrchain_primitives::primitives::Sibling; use pezpallet_bridge_messages::LaneIdOf; use pezpallet_bridge_relayers::extension::{ BridgeRelayersTransactionExtension, WithMessagesExtensionConfig, }; -use pezkuwi_teyrchain_primitives::primitives::Sibling; use testnet_teyrchains_constants::pezkuwichain::currency::UNITS as TYR; use teyrchains_common::xcm_config::{AllSiblingSystemTeyrchains, RelayOrOtherSystemTeyrchains}; use xcm::{ @@ -105,7 +105,8 @@ pezbp_runtime::generate_static_str_provider!(OnBridgeHubPezkuwichainRefundBridge pub type WithBridgeHubZagrosMessagesInstance = pezpallet_bridge_messages::Instance3; impl pezpallet_bridge_messages::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type WeightInfo = weights::pezpallet_bridge_messages_pezkuwichain_to_zagros::WeightInfo; + type WeightInfo = + weights::pezpallet_bridge_messages_pezkuwichain_to_zagros::WeightInfo; type ThisChain = bp_bridge_hub_pezkuwichain::BridgeHubPezkuwichain; type BridgedChain = bp_bridge_hub_zagros::BridgeHubZagros; @@ -120,12 +121,13 @@ impl pezpallet_bridge_messages::Config for type LaneId = LegacyLaneId; type DeliveryPayments = (); - type DeliveryConfirmationPayments = pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< - Runtime, - WithBridgeHubZagrosMessagesInstance, - RelayersForLegacyLaneIdsMessagesInstance, - DeliveryRewardInBalance, - >; + type DeliveryConfirmationPayments = + pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< + Runtime, + WithBridgeHubZagrosMessagesInstance, + RelayersForLegacyLaneIdsMessagesInstance, + DeliveryRewardInBalance, + >; type MessageDispatch = XcmOverBridgeHubZagros; type OnMessagesDelivered = XcmOverBridgeHubZagros; @@ -363,8 +365,8 @@ pub mod migration { mod v1_wrong { use bp_messages::{LaneState, MessageNonce, UnrewardedRelayer}; - use pezbp_runtime::AccountIdOf; use codec::{Decode, Encode}; + use pezbp_runtime::AccountIdOf; use pezpallet_bridge_messages::BridgedChainOf; use pezsp_std::collections::vec_deque::VecDeque; @@ -396,8 +398,8 @@ pub mod migration { /// for Pezkuwichain/Zagros). pub struct FixMessagesV1Migration(pezsp_std::marker::PhantomData<(T, I)>); - impl, I: 'static> pezframe_support::traits::OnRuntimeUpgrade - for FixMessagesV1Migration + impl, I: 'static> + pezframe_support::traits::OnRuntimeUpgrade for FixMessagesV1Migration { fn on_runtime_upgrade() -> Weight { use pezsp_core::Get; diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/lib.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/lib.rs index a160b025..f3069c0a 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/lib.rs @@ -75,11 +75,11 @@ use testnet_teyrchains_constants::pezkuwichain::{ consensus::*, currency::*, fee::WeightToFee, time::*, }; -use pezbp_runtime::HeaderId; use bridge_hub_common::{ message_queue::{NarrowOriginToSibling, ParaIdToSibling}, AggregateMessageOrigin, }; +use pezbp_runtime::HeaderId; pub use pezsp_consensus_aura::sr25519::AuthorityId as AuraId; pub use pezsp_runtime::{MultiAddress, Perbill, Permill}; @@ -501,7 +501,8 @@ impl pezpallet_session::Config for Runtime { // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator; type ShouldEndSession = pezpallet_session::PeriodicSessions, ConstU32>; - type NextSessionRotation = pezpallet_session::PeriodicSessions, ConstU32>; + type NextSessionRotation = + pezpallet_session::PeriodicSessions, ConstU32>; type SessionManager = CollatorSelection; // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/weights/mod.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/weights/mod.rs index a8db8979..978babc8 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/weights/mod.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/weights/mod.rs @@ -23,10 +23,11 @@ use ::pezpallet_bridge_relayers::WeightInfo as _; use ::pezpallet_bridge_teyrchains::WeightInfoExt as TeyrchainsWeightInfoExt; pub mod block_weights; +pub mod extrinsic_weights; +pub mod paritydb_weights; pub mod pezcumulus_pezpallet_teyrchain_system; pub mod pezcumulus_pezpallet_weight_reclaim; pub mod pezcumulus_pezpallet_xcmp_queue; -pub mod extrinsic_weights; pub mod pezframe_system; pub mod pezframe_system_extensions; pub mod pezpallet_balances; @@ -44,12 +45,11 @@ pub mod pezpallet_timestamp; pub mod pezpallet_transaction_payment; pub mod pezpallet_utility; pub mod pezpallet_xcm; -pub mod paritydb_weights; -pub mod rocksdb_weights; pub mod pezsnowbridge_pezpallet_ethereum_client; pub mod pezsnowbridge_pezpallet_inbound_queue; pub mod pezsnowbridge_pezpallet_outbound_queue; pub mod pezsnowbridge_pezpallet_system; +pub mod rocksdb_weights; pub mod xcm; pub use block_weights::constants::BlockExecutionWeight; diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/xcm_config.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/xcm_config.rs index 7f3a3c46..edde86b3 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/xcm_config.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/src/xcm_config.rs @@ -30,10 +30,10 @@ use pezframe_support::{ }, }; use pezframe_system::EnsureRoot; -use pezpallet_collator_selection::StakingPotAccountId; -use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezkuwi_runtime_common::xcm_sender::ExponentialPrice; use pezkuwi_teyrchain_primitives::primitives::Sibling; +use pezpallet_collator_selection::StakingPotAccountId; +use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezsp_runtime::traits::AccountIdConversion; use testnet_teyrchains_constants::pezkuwichain::snowbridge::EthereumNetwork; use teyrchains_common::{ diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/tests/snowbridge.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/tests/snowbridge.rs index 59fcda06..4d899c95 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/tests/snowbridge.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/tests/snowbridge.rs @@ -17,13 +17,13 @@ #![cfg(test)] use bp_pezkuwi_core::Signature; +use codec::{Decode, Encode}; use pezbridge_hub_pezkuwichain_runtime::{ bridge_to_zagros_config::OnBridgeHubPezkuwichainRefundBridgeHubZagrosMessages, xcm_config::XcmConfig, AllPalletsWithoutSystem, BridgeRejectObsoleteHeadersAndMessages, Executive, MessageQueueServiceWeight, Runtime, RuntimeCall, RuntimeEvent, SessionKeys, TxExtension, UncheckedExtrinsic, }; -use codec::{Decode, Encode}; use pezcumulus_primitives_core::XcmError::FailedToTransactAsset; use pezframe_support::parameter_types; use pezsnowbridge_pezpallet_ethereum_client::WeightInfo; @@ -97,7 +97,8 @@ pub fn transfer_token_to_ethereum_insufficient_fund() { fn max_message_queue_service_weight_is_more_than_beacon_extrinsic_weights() { let max_message_queue_weight = MessageQueueServiceWeight::get(); let force_checkpoint = - ::WeightInfo::force_checkpoint(); + ::WeightInfo::force_checkpoint( + ); let submit_checkpoint = ::WeightInfo::submit(); max_message_queue_weight.all_gt(force_checkpoint); @@ -123,9 +124,9 @@ fn ethereum_to_pezkuwi_message_extrinsics_work() { } /// Tests that the digest items are as expected when a Ethereum Outbound message is received. -/// If the MessageQueue pezpallet is configured before (i.e. the MessageQueue pezpallet is listed before -/// the EthereumOutboundQueue in the construct_runtime macro) the EthereumOutboundQueue, this test -/// will fail. +/// If the MessageQueue pezpallet is configured before (i.e. the MessageQueue pezpallet is listed +/// before the EthereumOutboundQueue in the construct_runtime macro) the EthereumOutboundQueue, this +/// test will fail. #[test] pub fn ethereum_outbound_queue_processes_messages_before_message_queue_works() { pezsnowbridge_runtime_test_common::ethereum_outbound_queue_processes_messages_before_message_queue_works::< diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/tests/tests.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/tests/tests.rs index c2a86243..93ae113a 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/tests/tests.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/tests/tests.rs @@ -17,6 +17,8 @@ #![cfg(test)] use bp_pezkuwi_core::Signature; +use codec::{Decode, Encode}; +use hex_literal::hex; use pezbridge_hub_pezkuwichain_runtime::{ bridge_common_config, bridge_to_bulletin_config, bridge_to_zagros_config, xcm_config::{RelayNetwork, TokenLocation, XcmConfig}, @@ -25,9 +27,7 @@ use pezbridge_hub_pezkuwichain_runtime::{ TeyrchainSystem, TransactionPayment, TxExtension, UncheckedExtrinsic, }; use pezbridge_hub_test_utils::{GovernanceOrigin, SlotDurations}; -use codec::{Decode, Encode}; use pezframe_support::{dispatch::GetDispatchInfo, parameter_types, traits::ConstU8}; -use hex_literal::hex; use pezsnowbridge_core::ChannelId; use pezsp_consensus_aura::SlotDuration; use pezsp_core::{crypto::Ss58Codec, H160}; @@ -131,14 +131,14 @@ mod bridge_hub_zagros_tests { BridgeGrandpaZagrosInstance, BridgeTeyrchainZagrosInstance, DeliveryRewardInBalance, RelayersForLegacyLaneIdsMessagesInstance, }; - use pezbridge_hub_pezkuwichain_runtime::{ - bridge_to_ethereum_config::EthereumGatewayAddress, xcm_config::LocationToAccountId, - }; - use pezbridge_hub_test_utils::test_cases::from_teyrchain; use bridge_to_zagros_config::{ BridgeHubZagrosLocation, WithBridgeHubZagrosMessagesInstance, XcmOverBridgeHubZagrosInstance, ZagrosGlobalConsensusNetwork, }; + use pezbridge_hub_pezkuwichain_runtime::{ + bridge_to_ethereum_config::EthereumGatewayAddress, xcm_config::LocationToAccountId, + }; + use pezbridge_hub_test_utils::test_cases::from_teyrchain; use pezcumulus_primitives_core::UpwardMessageSender; // Random para id of sibling chain used in tests. @@ -240,14 +240,20 @@ mod bridge_hub_zagros_tests { bp_bridge_hub_pezkuwichain::BRIDGE_HUB_PEZKUWICHAIN_TEYRCHAIN_ID, Governance::get(), vec![ - (pezsnowbridge_pezpallet_outbound_queue::Nonce::::hashed_key_for::( - channel_id_one, - ) - .to_vec(), 0u64.encode()), - (pezsnowbridge_pezpallet_inbound_queue::Nonce::::hashed_key_for::( - channel_id_one, - ) - .to_vec(), 0u64.encode()), + ( + pezsnowbridge_pezpallet_outbound_queue::Nonce::::hashed_key_for::< + ChannelId, + >(channel_id_one) + .to_vec(), + 0u64.encode(), + ), + ( + pezsnowbridge_pezpallet_inbound_queue::Nonce::::hashed_key_for::< + ChannelId, + >(channel_id_one) + .to_vec(), + 0u64.encode(), + ), ], || { // Outbound @@ -521,16 +527,16 @@ mod bridge_hub_bulletin_tests { use super::*; use bp_messages::LegacyLaneId; use bridge_common_config::BridgeGrandpaPezkuwichainBulletinInstance; - use pezbridge_hub_pezkuwichain_runtime::{ - bridge_common_config::RelayersForLegacyLaneIdsMessagesInstance, - xcm_config::LocationToAccountId, - }; - use pezbridge_hub_test_utils::test_cases::from_grandpa_chain; use bridge_to_bulletin_config::{ PezkuwichainBulletinGlobalConsensusNetwork, PezkuwichainBulletinGlobalConsensusNetworkLocation, WithPezkuwichainBulletinMessagesInstance, XcmOverPezkuwiBulletinInstance, }; + use pezbridge_hub_pezkuwichain_runtime::{ + bridge_common_config::RelayersForLegacyLaneIdsMessagesInstance, + xcm_config::LocationToAccountId, + }; + use pezbridge_hub_test_utils::test_cases::from_grandpa_chain; use pezcumulus_primitives_core::UpwardMessageSender; // Random para id of sibling chain used in tests. diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/bridge-primitives/src/lib.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/bridge-primitives/src/lib.rs index a71b58ee..9060de55 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/bridge-primitives/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/bridge-primitives/src/lib.rs @@ -20,10 +20,10 @@ pub use bp_bridge_hub_pezcumulus::*; use bp_messages::*; +use codec::{Decode, Encode}; use pezbp_runtime::{ decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, Chain, ChainId, Teyrchain, }; -use codec::{Decode, Encode}; use pezframe_support::dispatch::DispatchClass; use pezsp_runtime::{RuntimeDebug, StateVersion}; diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/bridge_to_ethereum_config.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/bridge_to_ethereum_config.rs index f6d8e89d..8bbd92df 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/bridge_to_ethereum_config.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/bridge_to_ethereum_config.rs @@ -24,9 +24,9 @@ use crate::{ }; use bp_asset_hub_zagros::CreateForeignAssetDeposit; use bridge_hub_common::AggregateMessageOrigin; +use hex_literal::hex; use pezframe_support::{parameter_types, traits::Contains, weights::ConstantMultiplier}; use pezframe_system::EnsureRootWithSuccess; -use hex_literal::hex; use pezpallet_xcm::EnsureXcm; use pezsnowbridge_beacon_primitives::{Fork, ForkVersions}; use pezsnowbridge_core::{gwei, meth, AllowSiblingsOnly, PricingParameters, Rewards}; @@ -53,7 +53,8 @@ use xcm::prelude::{GlobalConsensus, InteriorLocation, Location, PalletInstance, use xcm_executor::XcmExecutor; use zagros_runtime_constants::system_teyrchain::ASSET_HUB_ID; -pub const SLOTS_PER_EPOCH: u32 = pezsnowbridge_pezpallet_ethereum_client::config::SLOTS_PER_EPOCH as u32; +pub const SLOTS_PER_EPOCH: u32 = + pezsnowbridge_pezpallet_ethereum_client::config::SLOTS_PER_EPOCH as u32; /// Exports message to the Ethereum Gateway contract. pub type SnowbridgeExporter = EthereumBlobExporter< @@ -194,7 +195,8 @@ impl pezsnowbridge_pezpallet_outbound_queue_v2::Config for Runtime { type WeightToFee = WeightToFee; type Verifier = EthereumBeaconClient; type GatewayAddress = EthereumGatewayAddress; - type WeightInfo = crate::weights::pezsnowbridge_pezpallet_outbound_queue_v2::WeightInfo; + type WeightInfo = + crate::weights::pezsnowbridge_pezpallet_outbound_queue_v2::WeightInfo; type EthereumNetwork = EthereumNetwork; type RewardKind = BridgeReward; type DefaultRewardKind = SnowbridgeReward; @@ -325,8 +327,8 @@ pub mod benchmark_helpers { RuntimeOrigin, System, }; use codec::Encode; - use pezframe_support::assert_ok; use hex_literal::hex; + use pezframe_support::assert_ok; use pezsnowbridge_beacon_primitives::BeaconHeader; use pezsnowbridge_inbound_queue_primitives::EventFixture; use pezsnowbridge_pezpallet_inbound_queue::BenchmarkHelper; @@ -357,7 +359,9 @@ pub mod benchmark_helpers { } } - impl InboundQueueBenchmarkHelperV2 for Runtime { + impl InboundQueueBenchmarkHelperV2 + for Runtime + { fn initialize_storage() -> EventFixture { let message = make_register_token_message_v2(); @@ -370,7 +374,9 @@ pub mod benchmark_helpers { } } - impl OutboundQueueBenchmarkHelperV2 for Runtime { + impl OutboundQueueBenchmarkHelperV2 + for Runtime + { fn initialize_storage(beacon_header: BeaconHeader, block_roots_root: H256) { EthereumBeaconClient::store_finalized_header(beacon_header, block_roots_root).unwrap(); } @@ -440,7 +446,9 @@ pub(crate) mod migrations { >; /// One shot migration for NetworkId::Zagros to NetworkId::ByGenesis(ZAGROS_GENESIS_HASH) - pub struct MigrationForXcmV5(core::marker::PhantomData); + pub struct MigrationForXcmV5( + core::marker::PhantomData, + ); impl pezframe_support::traits::OnRuntimeUpgrade for MigrationForXcmV5 { @@ -451,7 +459,9 @@ pub(crate) mod migrations { weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); Some(xcm::v5::Location::try_from(pre).expect("valid location")) }; - pezsnowbridge_pezpallet_system::ForeignToNativeId::::translate_values(translate_zagros); + pezsnowbridge_pezpallet_system::ForeignToNativeId::::translate_values( + translate_zagros, + ); weight } diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/bridge_to_pezkuwichain_config.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/bridge_to_pezkuwichain_config.rs index 3719753d..7a019a83 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/bridge_to_pezkuwichain_config.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/bridge_to_pezkuwichain_config.rs @@ -34,11 +34,11 @@ use pezframe_support::{ traits::{ConstU32, PalletInfoAccess}, }; use pezframe_system::{EnsureNever, EnsureRoot}; +use pezkuwi_teyrchain_primitives::primitives::Sibling; use pezpallet_bridge_messages::LaneIdOf; use pezpallet_bridge_relayers::extension::{ BridgeRelayersTransactionExtension, WithMessagesExtensionConfig, }; -use pezkuwi_teyrchain_primitives::primitives::Sibling; use testnet_teyrchains_constants::zagros::currency::UNITS as ZGR; use teyrchains_common::xcm_config::{AllSiblingSystemTeyrchains, RelayOrOtherSystemTeyrchains}; use xcm::{ @@ -151,12 +151,13 @@ impl pezpallet_bridge_messages::Config; + type DeliveryConfirmationPayments = + pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< + Runtime, + WithBridgeHubPezkuwichainMessagesInstance, + BridgeRelayersInstance, + DeliveryRewardInBalance, + >; type MessageDispatch = XcmOverBridgeHubPezkuwichain; type OnMessagesDelivered = XcmOverBridgeHubPezkuwichain; @@ -381,8 +382,8 @@ pub mod migration { mod v1_wrong { use bp_messages::{LaneState, MessageNonce, UnrewardedRelayer}; - use pezbp_runtime::AccountIdOf; use codec::{Decode, Encode}; + use pezbp_runtime::AccountIdOf; use pezpallet_bridge_messages::BridgedChainOf; use pezsp_std::collections::vec_deque::VecDeque; @@ -414,8 +415,8 @@ pub mod migration { /// for Pezkuwichain/Zagros). pub struct FixMessagesV1Migration(pezsp_std::marker::PhantomData<(T, I)>); - impl, I: 'static> pezframe_support::traits::OnRuntimeUpgrade - for FixMessagesV1Migration + impl, I: 'static> + pezframe_support::traits::OnRuntimeUpgrade for FixMessagesV1Migration { fn on_runtime_upgrade() -> Weight { use pezsp_core::Get; diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/lib.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/lib.rs index 7a2f6c41..d4194a3e 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/lib.rs @@ -485,7 +485,8 @@ impl pezpallet_session::Config for Runtime { // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator; type ShouldEndSession = pezpallet_session::PeriodicSessions, ConstU32>; - type NextSessionRotation = pezpallet_session::PeriodicSessions, ConstU32>; + type NextSessionRotation = + pezpallet_session::PeriodicSessions, ConstU32>; type SessionManager = CollatorSelection; // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/weights/mod.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/weights/mod.rs index 82851291..d2f50dbd 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/weights/mod.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/weights/mod.rs @@ -23,10 +23,11 @@ use ::pezpallet_bridge_relayers::WeightInfo as _; use ::pezpallet_bridge_teyrchains::WeightInfoExt as TeyrchainsWeightInfoExt; pub mod block_weights; +pub mod extrinsic_weights; +pub mod paritydb_weights; pub mod pezcumulus_pezpallet_teyrchain_system; pub mod pezcumulus_pezpallet_weight_reclaim; pub mod pezcumulus_pezpallet_xcmp_queue; -pub mod extrinsic_weights; pub mod pezframe_system; pub mod pezframe_system_extensions; pub mod pezpallet_balances; @@ -42,7 +43,6 @@ pub mod pezpallet_timestamp; pub mod pezpallet_transaction_payment; pub mod pezpallet_utility; pub mod pezpallet_xcm; -pub mod paritydb_weights; pub mod rocksdb_weights; pub mod xcm; diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/xcm_config.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/xcm_config.rs index 30b42a11..e56730b2 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/xcm_config.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/src/xcm_config.rs @@ -29,10 +29,10 @@ use pezframe_support::{ }, }; use pezframe_system::EnsureRoot; -use pezpallet_collator_selection::StakingPotAccountId; -use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezkuwi_runtime_common::xcm_sender::ExponentialPrice; use pezkuwi_teyrchain_primitives::primitives::Sibling; +use pezpallet_collator_selection::StakingPotAccountId; +use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezsp_runtime::traits::AccountIdConversion; use testnet_teyrchains_constants::zagros::{ locations::AssetHubLocation, snowbridge::EthereumNetwork, @@ -161,8 +161,8 @@ pub type Barrier = TrailingSetTopicAsId< // If the message is one that immediately attempts to pay for execution, then // allow it. AllowTopLevelPaidExecutionFrom, - // Parent, its pluralities (i.e. governance bodies) and relay treasury pezpallet - // get free execution. + // Parent, its pluralities (i.e. governance bodies) and relay treasury + // pezpallet get free execution. AllowExplicitUnpaidExecutionFrom<( ParentOrParentsPlurality, Equals, diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/tests/snowbridge.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/tests/snowbridge.rs index 99597144..8d79b16a 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/tests/snowbridge.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/tests/snowbridge.rs @@ -19,12 +19,12 @@ use bp_asset_hub_zagros::ASSET_HUB_ZAGROS_TEYRCHAIN_ID; use bp_bridge_hub_zagros::BRIDGE_HUB_ZAGROS_TEYRCHAIN_ID; use bp_pezkuwi_core::Signature; +use codec::{Decode, Encode}; use pezbridge_hub_zagros_runtime::{ bridge_to_pezkuwichain_config, xcm_config::XcmConfig, AllPalletsWithoutSystem, BridgeRejectObsoleteHeadersAndMessages, Executive, MessageQueueServiceWeight, Runtime, RuntimeCall, RuntimeEvent, SessionKeys, TxExtension, UncheckedExtrinsic, }; -use codec::{Decode, Encode}; use pezcumulus_primitives_core::XcmError::FailedToTransactAsset; use pezframe_support::parameter_types; use pezsnowbridge_pezpallet_ethereum_client::WeightInfo; @@ -98,7 +98,8 @@ pub fn transfer_token_to_ethereum_insufficient_fund() { fn max_message_queue_service_weight_is_more_than_beacon_extrinsic_weights() { let max_message_queue_weight = MessageQueueServiceWeight::get(); let force_checkpoint = - ::WeightInfo::force_checkpoint(); + ::WeightInfo::force_checkpoint( + ); let submit_checkpoint = ::WeightInfo::submit(); max_message_queue_weight.all_gt(force_checkpoint); @@ -124,9 +125,9 @@ fn ethereum_to_pezkuwi_message_extrinsics_work() { } /// Tests that the digest items are as expected when a Ethereum Outbound message is received. -/// If the MessageQueue pezpallet is configured before (i.e. the MessageQueue pezpallet is listed before -/// the EthereumOutboundQueue in the construct_runtime macro) the EthereumOutboundQueue, this test -/// will fail. +/// If the MessageQueue pezpallet is configured before (i.e. the MessageQueue pezpallet is listed +/// before the EthereumOutboundQueue in the construct_runtime macro) the EthereumOutboundQueue, this +/// test will fail. #[test] pub fn ethereum_outbound_queue_processes_messages_before_message_queue_works() { pezsnowbridge_runtime_test_common::ethereum_outbound_queue_processes_messages_before_message_queue_works::< diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/tests/tests.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/tests/tests.rs index 49bf311f..7d1c4931 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/tests/tests.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/tests/tests.rs @@ -21,6 +21,13 @@ use bp_messages::LegacyLaneId; use bp_pezkuwi_core::Signature; use bp_relayers::{PayRewardFromAccount, RewardsAccountOwner, RewardsAccountParams}; use bridge_common_config::{BridgeRelayersInstance, BridgeReward, RequiredStakeForStakeAndSlash}; +use bridge_to_pezkuwichain_config::{ + BridgeGrandpaPezkuwichainInstance, BridgeHubPezkuwichainLocation, + BridgeTeyrchainPezkuwichainInstance, DeliveryRewardInBalance, + WithBridgeHubPezkuwichainMessagesInstance, XcmOverBridgeHubPezkuwichainInstance, +}; +use codec::{Decode, Encode}; +use hex_literal::hex; use pezbridge_hub_test_utils::{ test_cases::{from_teyrchain, run_test}, GovernanceOrigin, SlotDurations, @@ -36,12 +43,6 @@ use pezbridge_hub_zagros_runtime::{ RuntimeOrigin, SessionKeys, TeyrchainSystem, TransactionPayment, TxExtension, UncheckedExtrinsic, }; -use bridge_to_pezkuwichain_config::{ - BridgeGrandpaPezkuwichainInstance, BridgeHubPezkuwichainLocation, - BridgeTeyrchainPezkuwichainInstance, DeliveryRewardInBalance, - WithBridgeHubPezkuwichainMessagesInstance, XcmOverBridgeHubPezkuwichainInstance, -}; -use codec::{Decode, Encode}; use pezcumulus_primitives_core::UpwardMessageSender; use pezframe_support::{ assert_err, assert_ok, @@ -52,7 +53,6 @@ use pezframe_support::{ ConstU8, }, }; -use hex_literal::hex; use pezsp_consensus_aura::SlotDuration; use pezsp_core::crypto::Ss58Codec; use pezsp_keyring::Sr25519Keyring::{Alice, Bob}; diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/common/src/message_queue.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/common/src/message_queue.rs index 3f8de3b5..50bad1bc 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/common/src/message_queue.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/common/src/message_queue.rs @@ -21,9 +21,9 @@ use pezframe_support::{ weights::WeightMeter, }; use pezpallet_message_queue::OnQueueChanged; -use scale_info::TypeInfo; use pezsnowbridge_core::ChannelId; use pezsp_core::H256; +use scale_info::TypeInfo; use xcm::latest::prelude::{Junction, Location}; /// The aggregate origin of an inbound message. diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_cases/from_teyrchain.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_cases/from_teyrchain.rs index 7d544f4e..c2fa3e1a 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_cases/from_teyrchain.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_cases/from_teyrchain.rs @@ -129,7 +129,8 @@ pub fn relayed_incoming_message_works( + From>, BridgedChainOf: Chain + Teyrchain, >::BridgedChain: - pezbp_runtime::Chain + ChainWithGrandpa, + pezbp_runtime::Chain + + ChainWithGrandpa, { helpers::relayed_incoming_message_works::< RuntimeHelper::Runtime, @@ -264,7 +265,8 @@ pub fn free_relay_extrinsic_works( + From>, BridgedChainOf: Chain + Teyrchain, >::BridgedChain: - pezbp_runtime::Chain + ChainWithGrandpa, + pezbp_runtime::Chain + + ChainWithGrandpa, { // ensure that the runtime allows free header submissions let free_headers_interval = ( + From>, BridgedChainOf: Chain + Teyrchain, >::BridgedChain: - pezbp_runtime::Chain + ChainWithGrandpa, + pezbp_runtime::Chain + + ChainWithGrandpa, { helpers::relayed_incoming_message_works::< RuntimeHelper::Runtime, @@ -560,7 +563,8 @@ where + From>, BridgedChainOf: Chain + Teyrchain, >::BridgedChain: - pezbp_runtime::Chain + ChainWithGrandpa, + pezbp_runtime::Chain + + ChainWithGrandpa, { run_test::(collator_session_key, 1000, vec![], || { // generate bridged relay chain finality, teyrchain heads and message proofs, @@ -630,7 +634,8 @@ where + From>, BridgedChainOf: Chain + Teyrchain, >::BridgedChain: - pezbp_runtime::Chain + ChainWithGrandpa, + pezbp_runtime::Chain + + ChainWithGrandpa, { run_test::(collator_session_key, 1000, vec![], || { // generate bridged relay chain finality, teyrchain heads and message proofs, @@ -694,7 +699,8 @@ where From>, BridgedChainOf: Chain + Teyrchain, >::BridgedChain: - pezbp_runtime::Chain + ChainWithGrandpa, + pezbp_runtime::Chain + + ChainWithGrandpa, { run_test::(collator_session_key, 1000, vec![], || { // generate bridged relay chain finality, teyrchain heads and message proofs, @@ -755,7 +761,8 @@ where From>, BridgedChainOf: Chain + Teyrchain, >::BridgedChain: - pezbp_runtime::Chain + ChainWithGrandpa, + pezbp_runtime::Chain + + ChainWithGrandpa, { run_test::(collator_session_key, 1000, vec![], || { // generate bridged relay chain finality, teyrchain heads and message proofs, diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_cases/helpers.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_cases/helpers.rs index 5c076724..25cad3ed 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_cases/helpers.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_cases/helpers.rs @@ -21,9 +21,9 @@ use crate::test_cases::{bridges_prelude::*, run_test, RuntimeHelper}; use asset_test_pezutils::BasicTeyrchainRuntime; use bp_messages::MessageNonce; use bp_pezkuwi_core::teyrchains::{ParaHash, ParaId}; -use pezbp_runtime::Chain; use codec::Decode; use core::marker::PhantomData; +use pezbp_runtime::Chain; use pezframe_support::{ assert_ok, dispatch::GetDispatchInfo, @@ -93,7 +93,8 @@ where } } -/// Checks that the best teyrchain header hash in the bridge teyrchains pezpallet equals to given one. +/// Checks that the best teyrchain header hash in the bridge teyrchains pezpallet equals to given +/// one. pub struct VerifySubmitTeyrchainHeaderProofOutcome { bridged_para_id: u32, expected_best_hash: ParaHash, @@ -122,8 +123,10 @@ where { fn verify_outcome(&self) { assert_eq!( - pezpallet_bridge_teyrchains::ParasInfo::::get(ParaId(self.bridged_para_id)) - .map(|info| info.best_head_hash.head_hash), + pezpallet_bridge_teyrchains::ParasInfo::::get(ParaId( + self.bridged_para_id + )) + .map(|info| info.best_head_hash.head_hash), Some(self.expected_best_hash), ); } @@ -222,7 +225,10 @@ where Runtime: pezpallet_balances::Config, { fn verify_outcome(&self) { - assert_eq!(pezpallet_balances::Pezpallet::::free_balance(&self.relayer), self.balance,); + assert_eq!( + pezpallet_balances::Pezpallet::::free_balance(&self.relayer), + self.balance, + ); } } @@ -274,7 +280,8 @@ pub fn relayed_incoming_message_works( pezbp_runtime::ChainId, ) -> CallsAndVerifiers, ) where - Runtime: BasicTeyrchainRuntime + pezcumulus_pezpallet_xcmp_queue::Config + BridgeMessagesConfig, + Runtime: + BasicTeyrchainRuntime + pezcumulus_pezpallet_xcmp_queue::Config + BridgeMessagesConfig, AllPalletsWithoutSystem: OnInitialize> + OnFinalize>, MPI: 'static, @@ -307,7 +314,10 @@ pub fn relayed_incoming_message_works( 2, AccountId::from(alice).into(), ); - mock_open_hrmp_channel::>( + mock_open_hrmp_channel::< + Runtime, + pezcumulus_pezpallet_teyrchain_system::Pezpallet, + >( runtime_para_id.into(), sibling_teyrchain_id.into(), included_head, @@ -439,9 +449,11 @@ pub(crate) mod for_pallet_xcm_bridge_hub { buy_execution_fee_amount.into(); let source_account_id = LocationToAccountId::convert_location(&source).expect("valid location"); - let _ = - >::mint_into(&source_account_id, balance_needed) - .expect("mint_into passes"); + let _ = >::mint_into( + &source_account_id, + balance_needed, + ) + .expect("mint_into passes"); Some(buy_execution_fee) } else { None @@ -451,10 +463,11 @@ pub(crate) mod for_pallet_xcm_bridge_hub { bridge_opener(*locations.clone(), maybe_paid_execution); // check opened bridge - let bridge = pezpallet_xcm_bridge_hub::Bridges::::get( - locations.bridge_id(), - ) - .expect("opened bridge"); + let bridge = + pezpallet_xcm_bridge_hub::Bridges::::get( + locations.bridge_id(), + ) + .expect("opened bridge"); // check state assert_ok!( @@ -498,8 +511,8 @@ pub(crate) mod for_pallet_xcm_bridge_hub { .ensure_complete()); } - /// Utility for opening bridge directly inserting data to the `pezpallet_xcm_bridge_hub`'s storage - /// (used only for legacy purposes). + /// Utility for opening bridge directly inserting data to the `pezpallet_xcm_bridge_hub`'s + /// storage (used only for legacy purposes). pub fn open_bridge_with_storage( locations: pezpallet_xcm_bridge_hub::BridgeLocations, lane_id: pezpallet_xcm_bridge_hub::LaneIdOf, @@ -554,9 +567,11 @@ pub(crate) mod for_pallet_xcm_bridge_hub { buy_execution_fee_amount.into(); let source_account_id = LocationToAccountId::convert_location(&expected_source).expect("valid location"); - let _ = - >::mint_into(&source_account_id, balance_needed) - .expect("mint_into passes"); + let _ = >::mint_into( + &source_account_id, + balance_needed, + ) + .expect("mint_into passes"); Some(buy_execution_fee) } else { None diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_cases/mod.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_cases/mod.rs index 6f855cee..fc18f72c 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_cases/mod.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_cases/mod.rs @@ -31,8 +31,8 @@ use bp_messages::{ target_chain::{DispatchMessage, DispatchMessageData, MessageDispatch}, LaneState, MessageKey, MessagesOperatingMode, OutboundLaneData, }; -use pezbp_runtime::BasicOperatingMode; use codec::Encode; +use pezbp_runtime::BasicOperatingMode; use pezframe_support::{ assert_ok, dispatch::GetDispatchInfo, @@ -320,7 +320,9 @@ pub fn handle_export_message_from_system_teyrchain_to_outbound_queue_works< runtime_para_id: u32, sibling_teyrchain_id: u32, unwrap_pallet_bridge_messages_event: Box< - dyn Fn(Vec) -> Option>, + dyn Fn( + Vec, + ) -> Option>, >, export_message_instruction: fn() -> Instruction, existential_deposit: Option, @@ -409,7 +411,9 @@ pub fn handle_export_message_from_system_teyrchain_to_outbound_queue_works< let mut events = >::events() .into_iter() .filter_map(|e| unwrap_pallet_bridge_messages_event(e.event.encode())); - assert!(events.any(|e| matches!(e, pezpallet_bridge_messages::Event::MessageAccepted { .. }))); + assert!( + events.any(|e| matches!(e, pezpallet_bridge_messages::Event::MessageAccepted { .. })) + ); }) } @@ -565,9 +569,8 @@ pub fn message_dispatch_routing_works< let mut events = >::events() .into_iter() .filter_map(|e| unwrap_pezcumulus_pezpallet_xcmp_queue_event(e.event.encode())); - assert!( - events.any(|e| matches!(e, pezcumulus_pezpallet_xcmp_queue::Event::XcmpMessageSent { .. })) - ); + assert!(events + .any(|e| matches!(e, pezcumulus_pezpallet_xcmp_queue::Event::XcmpMessageSent { .. }))); }) } @@ -689,10 +692,13 @@ pub(crate) mod for_pallet_xcm_bridge_hub { { run_test::(collator_session_key, runtime_para_id, vec![], || { // construct expected bridge configuration - let locations = pezpallet_xcm_bridge_hub::Pezpallet::::bridge_locations( - expected_source.clone().into(), - destination.clone().into(), - ).expect("valid bridge locations"); + let locations = pezpallet_xcm_bridge_hub::Pezpallet::< + Runtime, + XcmOverBridgePalletInstance, + >::bridge_locations( + expected_source.clone().into(), destination.clone().into() + ) + .expect("valid bridge locations"); let expected_lane_id = locations.calculate_lane_id(xcm::latest::VERSION).expect("valid laneId"); let lanes_manager = LanesManagerOf::::new(); diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_data/from_grandpa_chain.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_data/from_grandpa_chain.rs index 8af61cbe..c2d0bb3b 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_data/from_grandpa_chain.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_data/from_grandpa_chain.rs @@ -23,9 +23,9 @@ use bp_messages::{ target_chain::FromBridgedChainMessagesProof, ChainWithMessages, LaneState, MessageNonce, UnrewardedRelayersState, }; -use pezbp_runtime::{AccountIdOf, BlockNumberOf, Chain, HeaderOf, UnverifiedStorageProofParams}; use bp_test_utils::make_default_justification; use codec::Encode; +use pezbp_runtime::{AccountIdOf, BlockNumberOf, Chain, HeaderOf, UnverifiedStorageProofParams}; use pezpallet_bridge_grandpa::{BridgedChain, BridgedHeader}; use pezsp_runtime::traits::Header as HeaderT; use xcm::latest::prelude::*; diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_data/from_teyrchain.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_data/from_teyrchain.rs index b8a2adaa..3dc5cb48 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_data/from_teyrchain.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_data/from_teyrchain.rs @@ -26,12 +26,12 @@ use bp_messages::{ target_chain::FromBridgedChainMessagesProof, ChainWithMessages, LaneState, UnrewardedRelayersState, Weight, }; -use pezbp_runtime::{ - AccountIdOf, BlockNumberOf, Chain, HeaderOf, Teyrchain, UnverifiedStorageProofParams, -}; use bp_test_utils::prepare_teyrchain_heads_proof; use bp_teyrchains::{RelayBlockHash, RelayBlockNumber}; use codec::Encode; +use pezbp_runtime::{ + AccountIdOf, BlockNumberOf, Chain, HeaderOf, Teyrchain, UnverifiedStorageProofParams, +}; use pezpallet_bridge_grandpa::BridgedHeader; use pezsp_runtime::traits::Header as HeaderT; use xcm::latest::prelude::*; @@ -82,14 +82,15 @@ where finality_target: Box::new(relay_chain_header), justification: grandpa_justification, }; - let submit_para_head = pezpallet_bridge_teyrchains::Call::::submit_teyrchain_heads { - at_relay_block: ( - relay_chain_header_number.saturated_into(), - relay_chain_header_hash.into(), - ), - teyrchains: teyrchain_heads, - teyrchain_heads_proof: para_heads_proof, - }; + let submit_para_head = + pezpallet_bridge_teyrchains::Call::::submit_teyrchain_heads { + at_relay_block: ( + relay_chain_header_number.saturated_into(), + relay_chain_header_hash.into(), + ), + teyrchains: teyrchain_heads, + teyrchain_heads_proof: para_heads_proof, + }; let submit_message = pezpallet_bridge_messages::Call::::receive_messages_proof { relayer_id_at_bridged_chain: relayer_id_at_bridged_chain.into(), proof: Box::new(message_proof), @@ -119,8 +120,8 @@ where GPI: 'static, PPI: 'static, MPI: 'static, - >::BridgedChain: - pezbp_runtime::Chain + ChainWithGrandpa, + >::BridgedChain: pezbp_runtime::Chain + + ChainWithGrandpa, BridgedChainOf: Chain + Teyrchain, ::RuntimeCall: From> + From> @@ -132,14 +133,15 @@ where finality_target: Box::new(relay_chain_header), justification: grandpa_justification, }; - let submit_para_head = pezpallet_bridge_teyrchains::Call::::submit_teyrchain_heads { - at_relay_block: ( - relay_chain_header_number.saturated_into(), - relay_chain_header_hash.into(), - ), - teyrchains: teyrchain_heads, - teyrchain_heads_proof: para_heads_proof, - }; + let submit_para_head = + pezpallet_bridge_teyrchains::Call::::submit_teyrchain_heads { + at_relay_block: ( + relay_chain_header_number.saturated_into(), + relay_chain_header_hash.into(), + ), + teyrchains: teyrchain_heads, + teyrchain_heads_proof: para_heads_proof, + }; let submit_message_delivery_proof = pezpallet_bridge_messages::Call::::receive_messages_delivery_proof { proof: message_delivery_proof, @@ -216,8 +218,8 @@ pub fn make_complex_relayer_delivery_proofs< FromBridgedChainMessagesProof, ) where - BridgedRelayChain: - pezbp_runtime::Chain + ChainWithGrandpa, + BridgedRelayChain: pezbp_runtime::Chain + + ChainWithGrandpa, BridgedTeyrchain: pezbp_runtime::Chain + Teyrchain, ThisChainWithMessages: ChainWithMessages, LaneId: Copy + Encode, @@ -287,8 +289,8 @@ pub fn make_complex_relayer_confirmation_proofs< FromBridgedChainMessagesDeliveryProof, ) where - BridgedRelayChain: - pezbp_runtime::Chain + ChainWithGrandpa, + BridgedRelayChain: pezbp_runtime::Chain + + ChainWithGrandpa, BridgedTeyrchain: pezbp_runtime::Chain + Teyrchain, ThisChainWithMessages: ChainWithMessages, LaneId: Copy + Encode, @@ -352,8 +354,8 @@ pub fn make_complex_bridged_teyrchain_heads_proof + ChainWithGrandpa, + BridgedRelayChain: pezbp_runtime::Chain + + ChainWithGrandpa, BridgedTeyrchain: pezbp_runtime::Chain + Teyrchain, { let bridged_para_head = ParaHead( diff --git a/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_data/mod.rs b/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_data/mod.rs index 62278259..88e10cfb 100644 --- a/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_data/mod.rs +++ b/pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils/src/test_data/mod.rs @@ -29,8 +29,8 @@ use pezpallet_bridge_grandpa::BridgedHeader; use xcm::latest::prelude::*; use bp_messages::MessageNonce; -use pezbp_runtime::BasicOperatingMode; use bp_test_utils::authority_list; +use pezbp_runtime::BasicOperatingMode; use xcm::GetVersion; use xcm_builder::{BridgeMessage, HaulBlob, HaulBlobError, HaulBlobExporter}; use xcm_executor::traits::{validate_export, ExportXcm}; diff --git a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/ambassador/mod.rs b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/ambassador/mod.rs index 17407816..1455510c 100644 --- a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/ambassador/mod.rs +++ b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/ambassador/mod.rs @@ -33,14 +33,16 @@ mod tracks; use super::*; use crate::xcm_config::{FellowshipAdminBodyId, LocationToAccountId, WndAssetHub}; -use pezframe_support::traits::{EitherOf, MapSuccess, TryMapSuccess}; -use pezframe_system::EnsureRootWithSuccess; pub use origins::pezpallet_origins as pezpallet_ambassador_origins; use origins::pezpallet_origins::{ EnsureAmbassadorsVoice, EnsureAmbassadorsVoiceFrom, EnsureHeadAmbassadorsVoice, Origin, }; +use pezframe_support::traits::{EitherOf, MapSuccess, TryMapSuccess}; +use pezframe_system::EnsureRootWithSuccess; use pezsp_core::ConstU128; -use pezsp_runtime::traits::{CheckedReduceBy, ConstU16, ConvertToValue, Replace, ReplaceWithDefault}; +use pezsp_runtime::traits::{ + CheckedReduceBy, ConstU16, ConvertToValue, Replace, ReplaceWithDefault, +}; use xcm::prelude::*; use xcm_builder::{AliasesIntoAccountId32, PayOverXcm}; @@ -106,7 +108,8 @@ pub type PromoteOrigin = EitherOf< pub type ExchangeOrigin = EitherOf>, Fellows>; impl pezpallet_ranked_collective::Config for Runtime { - type WeightInfo = weights::pezpallet_ranked_collective_ambassador_collective::WeightInfo; + type WeightInfo = + weights::pezpallet_ranked_collective_ambassador_collective::WeightInfo; type RuntimeEvent = RuntimeEvent; type AddOrigin = MapSuccess>; type PromoteOrigin = PromoteOrigin; diff --git a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/fellowship/mod.rs b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/fellowship/mod.rs index a7fe7cd2..66a50b88 100644 --- a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/fellowship/mod.rs +++ b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/fellowship/mod.rs @@ -25,6 +25,10 @@ use crate::{ Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, Scheduler, TeyrchainInfo, ZagrosTreasuryAccount, DAYS, }; +pub use origins::{ + pezpallet_origins as pezpallet_fellowship_origins, Architects, EnsureCanPromoteTo, + EnsureCanRetainAt, EnsureFellowship, Fellows, Masters, Members, ToVoice, +}; use pezcumulus_primitives_core::ParaId; use pezframe_support::{ parameter_types, @@ -35,15 +39,11 @@ use pezframe_support::{ PalletId, }; use pezframe_system::{EnsureRoot, EnsureRootWithSuccess}; -pub use origins::{ - pezpallet_origins as pezpallet_fellowship_origins, Architects, EnsureCanPromoteTo, EnsureCanRetainAt, - EnsureFellowship, Fellows, Masters, Members, ToVoice, -}; -use pezpallet_ranked_collective::EnsureOfRank; -use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezkuwi_runtime_common::impls::{ ContainsParts, LocatableAssetConverter, VersionedLocatableAsset, VersionedLocationConverter, }; +use pezpallet_ranked_collective::EnsureOfRank; +use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezsp_arithmetic::Permill; use pezsp_core::{ConstU128, ConstU32, ConstU8}; use pezsp_runtime::traits::{ConstU16, ConvertToValue, IdentityLookup, Replace, TakeFirst}; @@ -112,10 +112,12 @@ impl pezpallet_referenda::Config for Runtime { pub type FellowshipCollectiveInstance = pezpallet_ranked_collective::Instance1; impl pezpallet_ranked_collective::Config for Runtime { - type WeightInfo = weights::pezpallet_ranked_collective_fellowship_collective::WeightInfo; + type WeightInfo = + weights::pezpallet_ranked_collective_fellowship_collective::WeightInfo; type RuntimeEvent = RuntimeEvent; - // Promotions and the induction of new members are serviced by `FellowshipCore` pezpallet instance. + // Promotions and the induction of new members are serviced by `FellowshipCore` pezpallet + // instance. #[cfg(not(feature = "runtime-benchmarks"))] type AddOrigin = pezframe_system::EnsureNever<()>; #[cfg(feature = "runtime-benchmarks")] diff --git a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/fellowship/tracks.rs b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/fellowship/tracks.rs index e7d7f7c5..ccced50b 100644 --- a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/fellowship/tracks.rs +++ b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/fellowship/tracks.rs @@ -83,16 +83,18 @@ const RETAIN_PREPARE_PERIOD: BlockNumber = 0; const RETAIN_DECISION_PERIOD: BlockNumber = 14 * DAYS; const RETAIN_CONFIRM_PERIOD: BlockNumber = 1 * HOURS; const RETAIN_MIN_ENACTMENT_PERIOD: BlockNumber = 0; -const RETAIN_MIN_APPROVAL: pezpallet_referenda::Curve = pezpallet_referenda::Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(60), - ceil: Perbill::from_percent(100), -}; -const RETAIN_MIN_SUPPORT: pezpallet_referenda::Curve = pezpallet_referenda::Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(10), - ceil: Perbill::from_percent(100), -}; +const RETAIN_MIN_APPROVAL: pezpallet_referenda::Curve = + pezpallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(60), + ceil: Perbill::from_percent(100), + }; +const RETAIN_MIN_SUPPORT: pezpallet_referenda::Curve = + pezpallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(10), + ceil: Perbill::from_percent(100), + }; const PROMOTE_MAX_DECIDING: u32 = 10; const PROMOTE_DECISION_DEPOSIT: Balance = 5 * DOLLARS; @@ -100,16 +102,18 @@ const PROMOTE_PREPARE_PERIOD: BlockNumber = 0; const PROMOTE_DECISION_PERIOD: BlockNumber = 30 * DAYS; const PROMOTE_CONFIRM_PERIOD: BlockNumber = 1 * HOURS; const PROMOTE_MIN_ENACTMENT_PERIOD: BlockNumber = 0; -const PROMOTE_MIN_APPROVAL: pezpallet_referenda::Curve = pezpallet_referenda::Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(60), - ceil: Perbill::from_percent(100), -}; -const PROMOTE_MIN_SUPPORT: pezpallet_referenda::Curve = pezpallet_referenda::Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(10), - ceil: Perbill::from_percent(100), -}; +const PROMOTE_MIN_APPROVAL: pezpallet_referenda::Curve = + pezpallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(60), + ceil: Perbill::from_percent(100), + }; +const PROMOTE_MIN_SUPPORT: pezpallet_referenda::Curve = + pezpallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(10), + ceil: Perbill::from_percent(100), + }; pub struct TracksInfo; impl pezpallet_referenda::TracksInfo for TracksInfo { diff --git a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/impls.rs b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/impls.rs index d4d6edc9..ed9444cc 100644 --- a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/impls.rs +++ b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/impls.rs @@ -31,8 +31,9 @@ type ProposalOf = >::Proposal; type HashOf = ::Hash; /// Type alias to conveniently refer to the `Currency::Balance` associated type. -pub type BalanceOf = - as Currency<::AccountId>>::Balance; +pub type BalanceOf = as Currency< + ::AccountId, +>>::Balance; /// Proposal provider for alliance pezpallet. /// Adapter from collective pezpallet to alliance proposal provider trait. diff --git a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/lib.rs b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/lib.rs index 93772e79..a6a448a1 100644 --- a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/lib.rs @@ -53,9 +53,9 @@ pub use ambassador::pezpallet_ambassador_origins; use alloc::{vec, vec::Vec}; use ambassador::AmbassadorCoreInstance; -use pezcumulus_pezpallet_teyrchain_system::RelayNumberMonotonicallyIncreases; use fellowship::{pezpallet_fellowship_origins, Fellows, FellowshipCoreInstance}; use impls::{AllianceProposalProvider, EqualOrGreatestRootCmp}; +use pezcumulus_pezpallet_teyrchain_system::RelayNumberMonotonicallyIncreases; use pezsp_api::impl_runtime_apis; use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata}; use pezsp_runtime::{ @@ -107,10 +107,10 @@ use xcm_config::{ pub use pezsp_runtime::BuildStorage; // Pezkuwi imports -use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezkuwi_runtime_common::{ impls::VersionedLocatableAsset, BlockHashCount, SlowAdjustingFeeUpdate, }; +use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use xcm::{prelude::*, Version as XcmVersion}; use xcm_runtime_pezapis::{ dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, @@ -512,7 +512,8 @@ impl pezpallet_session::Config for Runtime { // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator; type ShouldEndSession = pezpallet_session::PeriodicSessions, ConstU32>; - type NextSessionRotation = pezpallet_session::PeriodicSessions, ConstU32>; + type NextSessionRotation = + pezpallet_session::PeriodicSessions, ConstU32>; type SessionManager = CollatorSelection; // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; diff --git a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/weights/mod.rs b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/weights/mod.rs index 49a48914..ae7dd065 100644 --- a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/weights/mod.rs +++ b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/weights/mod.rs @@ -14,10 +14,11 @@ // limitations under the License. pub mod block_weights; +pub mod extrinsic_weights; +pub mod paritydb_weights; pub mod pezcumulus_pezpallet_teyrchain_system; pub mod pezcumulus_pezpallet_weight_reclaim; pub mod pezcumulus_pezpallet_xcmp_queue; -pub mod extrinsic_weights; pub mod pezframe_system; pub mod pezframe_system_extensions; pub mod pezpallet_alliance; @@ -45,7 +46,6 @@ pub mod pezpallet_transaction_payment; pub mod pezpallet_treasury; pub mod pezpallet_utility; pub mod pezpallet_xcm; -pub mod paritydb_weights; pub mod rocksdb_weights; pub mod xcm; diff --git a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/xcm_config.rs b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/xcm_config.rs index 291f4f21..dbffe5a5 100644 --- a/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/xcm_config.rs +++ b/pezcumulus/teyrchains/runtimes/collectives/collectives-zagros/src/xcm_config.rs @@ -27,10 +27,10 @@ use pezframe_support::{ }, }; use pezframe_system::EnsureRoot; -use pezpallet_collator_selection::StakingPotAccountId; -use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezkuwi_runtime_common::xcm_sender::ExponentialPrice; use pezkuwi_teyrchain_primitives::primitives::Sibling; +use pezpallet_collator_selection::StakingPotAccountId; +use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use teyrchains_common::xcm_config::{ AliasAccountId32FromSiblingSystemChain, AllSiblingSystemTeyrchains, ConcreteAssetFromSystem, ParentRelayOrSiblingTeyrchains, RelayOrOtherSystemTeyrchains, diff --git a/pezcumulus/teyrchains/runtimes/constants/src/pezkuwichain.rs b/pezcumulus/teyrchains/runtimes/constants/src/pezkuwichain.rs index 78cf4929..8a343c69 100644 --- a/pezcumulus/teyrchains/runtimes/constants/src/pezkuwichain.rs +++ b/pezcumulus/teyrchains/runtimes/constants/src/pezkuwichain.rs @@ -39,8 +39,8 @@ pub mod fee { }, }; use pezkuwi_core_primitives::Balance; - use smallvec::smallvec; pub use pezsp_runtime::Perbill; + use smallvec::smallvec; /// The block saturation level. Fees will be updates based on this value. pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25); diff --git a/pezcumulus/teyrchains/runtimes/constants/src/zagros.rs b/pezcumulus/teyrchains/runtimes/constants/src/zagros.rs index 054923ae..8d5af7ca 100644 --- a/pezcumulus/teyrchains/runtimes/constants/src/zagros.rs +++ b/pezcumulus/teyrchains/runtimes/constants/src/zagros.rs @@ -17,8 +17,8 @@ pub mod account { use pezframe_support::PalletId; - /// Zagros treasury pezpallet id, used to convert into AccountId - in Zagros as a destination for - /// slashed funds. + /// Zagros treasury pezpallet id, used to convert into AccountId - in Zagros as a destination + /// for slashed funds. pub const ZAGROS_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/trsry"); /// Alliance pezpallet ID - used as a temporary place to deposit a slashed imbalance before the /// teleport to the Treasury. @@ -62,8 +62,8 @@ pub mod fee { }, }; use pezkuwi_core_primitives::Balance; - use smallvec::smallvec; pub use pezsp_runtime::Perbill; + use smallvec::smallvec; /// The block saturation level. Fees will be updated based on this value. pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25); diff --git a/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/coretime.rs b/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/coretime.rs index 4148d39f..6ff288f2 100644 --- a/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/coretime.rs +++ b/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/coretime.rs @@ -27,10 +27,10 @@ use pezframe_support::{ }, }; use pezframe_system::Pezpallet as System; +use pezkuwichain_runtime_constants::system_teyrchain::coretime; use pezpallet_broker::{ CoreAssignment, CoreIndex, CoretimeInterface, PartsOf57600, RCBlockNumberOf, TaskId, }; -use pezkuwichain_runtime_constants::system_teyrchain::coretime; use pezsp_runtime::traits::{AccountIdConversion, MaybeConvert}; use teyrchains_common::{AccountId, Balance}; use xcm::latest::prelude::*; diff --git a/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/lib.rs b/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/lib.rs index d887f464..a24ef6b3 100644 --- a/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/lib.rs @@ -55,8 +55,8 @@ use pezframe_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; -use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezkuwi_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; +use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezsp_api::impl_runtime_apis; use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata}; #[cfg(any(feature = "std", test))] @@ -401,7 +401,8 @@ impl pezpallet_session::Config for Runtime { // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator; type ShouldEndSession = pezpallet_session::PeriodicSessions, ConstU32>; - type NextSessionRotation = pezpallet_session::PeriodicSessions, ConstU32>; + type NextSessionRotation = + pezpallet_session::PeriodicSessions, ConstU32>; type SessionManager = CollatorSelection; // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; diff --git a/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/weights/mod.rs b/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/weights/mod.rs index 7f24b9cd..73f8e528 100644 --- a/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/weights/mod.rs +++ b/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/weights/mod.rs @@ -18,10 +18,11 @@ //! Expose the auto generated weight files. pub mod block_weights; +pub mod extrinsic_weights; +pub mod paritydb_weights; pub mod pezcumulus_pezpallet_teyrchain_system; pub mod pezcumulus_pezpallet_weight_reclaim; pub mod pezcumulus_pezpallet_xcmp_queue; -pub mod extrinsic_weights; pub mod pezframe_system; pub mod pezframe_system_extensions; pub mod pezpallet_balances; @@ -35,7 +36,6 @@ pub mod pezpallet_timestamp; pub mod pezpallet_transaction_payment; pub mod pezpallet_utility; pub mod pezpallet_xcm; -pub mod paritydb_weights; pub mod rocksdb_weights; pub mod xcm; diff --git a/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/xcm_config.rs b/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/xcm_config.rs index 4ef33abe..389bc3d4 100644 --- a/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/xcm_config.rs +++ b/pezcumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain/src/xcm_config.rs @@ -20,17 +20,17 @@ use super::{ TransactionByteFee, WeightToFee, XcmpQueue, }; use pezframe_support::{ - pezpallet_prelude::PalletInfoAccess, parameter_types, + pezpallet_prelude::PalletInfoAccess, traits::{ tokens::imbalance::ResolveTo, ConstU32, Contains, Disabled, Equals, Everything, Nothing, }, }; use pezframe_system::EnsureRoot; -use pezpallet_collator_selection::StakingPotAccountId; -use pezpallet_xcm::XcmPassthrough; use pezkuwi_runtime_common::xcm_sender::ExponentialPrice; use pezkuwi_teyrchain_primitives::primitives::Sibling; +use pezpallet_collator_selection::StakingPotAccountId; +use pezpallet_xcm::XcmPassthrough; use pezsp_runtime::traits::AccountIdConversion; use teyrchains_common::{ xcm_config::{ diff --git a/pezcumulus/teyrchains/runtimes/coretime/coretime-zagros/src/lib.rs b/pezcumulus/teyrchains/runtimes/coretime/coretime-zagros/src/lib.rs index 79e9877c..90b544f9 100644 --- a/pezcumulus/teyrchains/runtimes/coretime/coretime-zagros/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/coretime/coretime-zagros/src/lib.rs @@ -55,8 +55,8 @@ use pezframe_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; -use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezkuwi_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; +use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezsp_api::impl_runtime_apis; use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata}; #[cfg(any(feature = "std", test))] @@ -399,7 +399,8 @@ impl pezpallet_session::Config for Runtime { // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator; type ShouldEndSession = pezpallet_session::PeriodicSessions, ConstU32>; - type NextSessionRotation = pezpallet_session::PeriodicSessions, ConstU32>; + type NextSessionRotation = + pezpallet_session::PeriodicSessions, ConstU32>; type SessionManager = CollatorSelection; // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; diff --git a/pezcumulus/teyrchains/runtimes/coretime/coretime-zagros/src/weights/mod.rs b/pezcumulus/teyrchains/runtimes/coretime/coretime-zagros/src/weights/mod.rs index 7f24b9cd..73f8e528 100644 --- a/pezcumulus/teyrchains/runtimes/coretime/coretime-zagros/src/weights/mod.rs +++ b/pezcumulus/teyrchains/runtimes/coretime/coretime-zagros/src/weights/mod.rs @@ -18,10 +18,11 @@ //! Expose the auto generated weight files. pub mod block_weights; +pub mod extrinsic_weights; +pub mod paritydb_weights; pub mod pezcumulus_pezpallet_teyrchain_system; pub mod pezcumulus_pezpallet_weight_reclaim; pub mod pezcumulus_pezpallet_xcmp_queue; -pub mod extrinsic_weights; pub mod pezframe_system; pub mod pezframe_system_extensions; pub mod pezpallet_balances; @@ -35,7 +36,6 @@ pub mod pezpallet_timestamp; pub mod pezpallet_transaction_payment; pub mod pezpallet_utility; pub mod pezpallet_xcm; -pub mod paritydb_weights; pub mod rocksdb_weights; pub mod xcm; diff --git a/pezcumulus/teyrchains/runtimes/coretime/coretime-zagros/src/xcm_config.rs b/pezcumulus/teyrchains/runtimes/coretime/coretime-zagros/src/xcm_config.rs index f2724aa7..117ffde5 100644 --- a/pezcumulus/teyrchains/runtimes/coretime/coretime-zagros/src/xcm_config.rs +++ b/pezcumulus/teyrchains/runtimes/coretime/coretime-zagros/src/xcm_config.rs @@ -20,18 +20,18 @@ use super::{ TeyrchainInfo, TeyrchainSystem, TransactionByteFee, WeightToFee, XcmpQueue, }; use pezframe_support::{ - pezpallet_prelude::PalletInfoAccess, parameter_types, + pezpallet_prelude::PalletInfoAccess, traits::{ fungible::HoldConsideration, tokens::imbalance::ResolveTo, ConstU32, Contains, Equals, Everything, LinearStoragePrice, Nothing, }, }; use pezframe_system::EnsureRoot; -use pezpallet_collator_selection::StakingPotAccountId; -use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezkuwi_runtime_common::xcm_sender::ExponentialPrice; use pezkuwi_teyrchain_primitives::primitives::Sibling; +use pezpallet_collator_selection::StakingPotAccountId; +use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezsp_runtime::traits::AccountIdConversion; use testnet_teyrchains_constants::zagros::locations::AssetHubLocation; use teyrchains_common::{ diff --git a/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/genesis_config_presets.rs b/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/genesis_config_presets.rs index d0d2e5a4..d030f4bf 100644 --- a/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/genesis_config_presets.rs +++ b/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/genesis_config_presets.rs @@ -22,9 +22,9 @@ use crate::*; use alloc::{vec, vec::Vec}; +use hex_literal::hex; use pezcumulus_primitives_core::ParaId; use pezframe_support::build_struct_json_patch; -use hex_literal::hex; use pezsp_core::{crypto::UncheckedInto, H256}; use pezsp_genesis_builder::PresetId; use pezsp_keyring::Sr25519Keyring; diff --git a/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/lib.rs b/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/lib.rs index c83c001f..d8f84725 100644 --- a/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/lib.rs @@ -48,8 +48,8 @@ use pezframe_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; -use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezkuwi_runtime_common::{identity_migrator, BlockHashCount, SlowAdjustingFeeUpdate}; +use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezsp_api::impl_runtime_apis; pub use pezsp_consensus_aura::sr25519::AuthorityId as AuraId; use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata}; @@ -359,7 +359,8 @@ pub type RootOrFellows = EitherOfDiverse< /// Root VEYA Serok (CumhurbaÅŸkanı) yetkisi /// Kullanım: Yüksek düzey yönetim kararları, atamalar -pub type RootOrSerok = EitherOfDiverse, pezpallet_welati::EnsureSerok>; +pub type RootOrSerok = + EitherOfDiverse, pezpallet_welati::EnsureSerok>; /// Root VEYA Parlamento üyesi yetkisi /// Kullanım: Yasama iÅŸlemleri, bütçe onayları @@ -368,7 +369,8 @@ pub type RootOrParliament = /// Root VEYA Divan (Anayasa Mahkemesi) yetkisi /// Kullanım: Anayasal kararlar, vatandaÅŸlık iÅŸlemleri -pub type RootOrDiwan = EitherOfDiverse, pezpallet_welati::EnsureDiwan>; +pub type RootOrDiwan = + EitherOfDiverse, pezpallet_welati::EnsureDiwan>; /// Root VEYA Council (Genel Konsey) yetkisi /// Kullanım: Genel yönetiÅŸim kararları @@ -446,7 +448,8 @@ impl pezpallet_session::Config for Runtime { // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator; type ShouldEndSession = pezpallet_session::PeriodicSessions, ConstU32>; - type NextSessionRotation = pezpallet_session::PeriodicSessions, ConstU32>; + type NextSessionRotation = + pezpallet_session::PeriodicSessions, ConstU32>; type SessionManager = CollatorSelection; // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; diff --git a/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/people.rs b/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/people.rs index 1848e8c6..e65e68a1 100644 --- a/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/people.rs +++ b/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/people.rs @@ -25,11 +25,11 @@ use pezframe_support::{ }; use pezframe_system::EnsureRoot; use pezpallet_identity::{Data, IdentityInformationProvider}; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{AccountIdConversion, ConvertInto, Verify}, RuntimeDebug, }; +use scale_info::TypeInfo; use testnet_teyrchains_constants::pezkuwichain::currency::UNITS; use teyrchains_common::{impls::ToParentTreasury, DAYS, HOURS}; diff --git a/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/weights/mod.rs b/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/weights/mod.rs index 11ec2809..ad89f74c 100644 --- a/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/weights/mod.rs +++ b/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/weights/mod.rs @@ -16,12 +16,14 @@ //! Expose the auto generated weight files. pub mod block_weights; +pub mod extrinsic_weights; +pub mod paritydb_weights; pub mod pezcumulus_pezpallet_teyrchain_system; pub mod pezcumulus_pezpallet_weight_reclaim; pub mod pezcumulus_pezpallet_xcmp_queue; -pub mod extrinsic_weights; pub mod pezframe_system; pub mod pezframe_system_extensions; +pub mod pezkuwi_runtime_common_identity_migrator; pub mod pezpallet_assets; pub mod pezpallet_balances; pub mod pezpallet_collator_selection; @@ -35,8 +37,6 @@ pub mod pezpallet_timestamp; pub mod pezpallet_transaction_payment; pub mod pezpallet_utility; pub mod pezpallet_xcm; -pub mod paritydb_weights; -pub mod pezkuwi_runtime_common_identity_migrator; pub mod rocksdb_weights; pub mod xcm; diff --git a/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/xcm_config.rs b/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/xcm_config.rs index 867d6f98..61efc5fc 100644 --- a/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/xcm_config.rs +++ b/pezcumulus/teyrchains/runtimes/people/people-pezkuwichain/src/xcm_config.rs @@ -25,9 +25,9 @@ use pezframe_support::{ }, }; use pezframe_system::EnsureRoot; +use pezkuwi_teyrchain_primitives::primitives::Sibling; use pezpallet_collator_selection::StakingPotAccountId; use pezpallet_xcm::XcmPassthrough; -use pezkuwi_teyrchain_primitives::primitives::Sibling; use pezsp_runtime::traits::AccountIdConversion; use teyrchains_common::{ xcm_config::{ diff --git a/pezcumulus/teyrchains/runtimes/people/people-zagros/src/lib.rs b/pezcumulus/teyrchains/runtimes/people/people-zagros/src/lib.rs index b834712e..559eec27 100644 --- a/pezcumulus/teyrchains/runtimes/people/people-zagros/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/people/people-zagros/src/lib.rs @@ -45,8 +45,8 @@ use pezframe_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; -use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezkuwi_runtime_common::{identity_migrator, BlockHashCount, SlowAdjustingFeeUpdate}; +use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezsp_api::impl_runtime_apis; pub use pezsp_consensus_aura::sr25519::AuthorityId as AuraId; use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata}; @@ -363,7 +363,8 @@ impl pezpallet_session::Config for Runtime { // we don't have stash and controller, thus we don't need the convert as well. type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator; type ShouldEndSession = pezpallet_session::PeriodicSessions, ConstU32>; - type NextSessionRotation = pezpallet_session::PeriodicSessions, ConstU32>; + type NextSessionRotation = + pezpallet_session::PeriodicSessions, ConstU32>; type SessionManager = CollatorSelection; // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; diff --git a/pezcumulus/teyrchains/runtimes/people/people-zagros/src/people.rs b/pezcumulus/teyrchains/runtimes/people/people-zagros/src/people.rs index 8646dc0d..ff1726b1 100644 --- a/pezcumulus/teyrchains/runtimes/people/people-zagros/src/people.rs +++ b/pezcumulus/teyrchains/runtimes/people/people-zagros/src/people.rs @@ -22,11 +22,11 @@ use pezframe_support::{ RuntimeDebugNoBound, }; use pezpallet_identity::{Data, IdentityInformationProvider}; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{AccountIdConversion, Verify}, RuntimeDebug, }; +use scale_info::TypeInfo; use teyrchains_common::{impls::ToParentTreasury, DAYS}; parameter_types! { diff --git a/pezcumulus/teyrchains/runtimes/people/people-zagros/src/weights/mod.rs b/pezcumulus/teyrchains/runtimes/people/people-zagros/src/weights/mod.rs index 8bb5031a..476d94e7 100644 --- a/pezcumulus/teyrchains/runtimes/people/people-zagros/src/weights/mod.rs +++ b/pezcumulus/teyrchains/runtimes/people/people-zagros/src/weights/mod.rs @@ -16,12 +16,14 @@ //! Expose the auto generated weight files. pub mod block_weights; +pub mod extrinsic_weights; +pub mod paritydb_weights; pub mod pezcumulus_pezpallet_teyrchain_system; pub mod pezcumulus_pezpallet_weight_reclaim; pub mod pezcumulus_pezpallet_xcmp_queue; -pub mod extrinsic_weights; pub mod pezframe_system; pub mod pezframe_system_extensions; +pub mod pezkuwi_runtime_common_identity_migrator; pub mod pezpallet_balances; pub mod pezpallet_collator_selection; pub mod pezpallet_identity; @@ -34,8 +36,6 @@ pub mod pezpallet_timestamp; pub mod pezpallet_transaction_payment; pub mod pezpallet_utility; pub mod pezpallet_xcm; -pub mod paritydb_weights; -pub mod pezkuwi_runtime_common_identity_migrator; pub mod rocksdb_weights; pub mod xcm; diff --git a/pezcumulus/teyrchains/runtimes/people/people-zagros/src/xcm_config.rs b/pezcumulus/teyrchains/runtimes/people/people-zagros/src/xcm_config.rs index d70a48dc..5a85f6df 100644 --- a/pezcumulus/teyrchains/runtimes/people/people-zagros/src/xcm_config.rs +++ b/pezcumulus/teyrchains/runtimes/people/people-zagros/src/xcm_config.rs @@ -27,9 +27,9 @@ use pezframe_support::{ }, }; use pezframe_system::EnsureRoot; +use pezkuwi_teyrchain_primitives::primitives::Sibling; use pezpallet_collator_selection::StakingPotAccountId; use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; -use pezkuwi_teyrchain_primitives::primitives::Sibling; use pezsp_runtime::traits::AccountIdConversion; use testnet_teyrchains_constants::zagros::locations::AssetHubLocation; use teyrchains_common::{ diff --git a/pezcumulus/teyrchains/runtimes/people/people-zagros/tests/tests.rs b/pezcumulus/teyrchains/runtimes/people/people-zagros/tests/tests.rs index 4bf55bd2..682c536e 100644 --- a/pezcumulus/teyrchains/runtimes/people/people-zagros/tests/tests.rs +++ b/pezcumulus/teyrchains/runtimes/people/people-zagros/tests/tests.rs @@ -16,11 +16,11 @@ #![cfg(test)] -use pezframe_support::{assert_err, assert_ok}; use people_zagros_runtime::{ xcm_config::{GovernanceLocation, LocationToAccountId}, Block, Runtime, RuntimeCall, RuntimeOrigin, }; +use pezframe_support::{assert_err, assert_ok}; use pezsp_core::crypto::Ss58Codec; use pezsp_runtime::Either; use testnet_teyrchains_constants::zagros::fee::WeightToFee; diff --git a/pezcumulus/teyrchains/runtimes/test-utils/src/lib.rs b/pezcumulus/teyrchains/runtimes/test-utils/src/lib.rs index f380ee2e..a42eaddb 100644 --- a/pezcumulus/teyrchains/runtimes/test-utils/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/test-utils/src/lib.rs @@ -83,8 +83,8 @@ impl Default - for CollatorSessionKeys +impl + Default for CollatorSessionKeys { fn default() -> Self { Self { items: vec![] } @@ -237,9 +237,12 @@ impl ExtBuilder { .unwrap(); } - pezpallet_balances::GenesisConfig:: { balances: self.balances, ..Default::default() } - .assimilate_storage(&mut t) - .unwrap(); + pezpallet_balances::GenesisConfig:: { + balances: self.balances, + ..Default::default() + } + .assimilate_storage(&mut t) + .unwrap(); pezpallet_collator_selection::GenesisConfig:: { invulnerables: self.collators.clone(), @@ -269,7 +272,9 @@ pub struct RuntimeHelper( /// Utility function that advances the chain to the desired block number. /// If an author is provided, that author information is injected to all the blocks in the meantime. impl< - Runtime: pezframe_system::Config + pezcumulus_pezpallet_teyrchain_system::Config + pezpallet_timestamp::Config, + Runtime: pezframe_system::Config + + pezcumulus_pezpallet_teyrchain_system::Config + + pezpallet_timestamp::Config, AllPalletsWithoutSystem, > RuntimeHelper where @@ -356,14 +361,15 @@ where let (inherent_data, downward_messages, horizontal_messages) = deconstruct_teyrchain_inherent_data(inherent_data); - let _ = pezcumulus_pezpallet_teyrchain_system::Pezpallet::::set_validation_data( - Runtime::RuntimeOrigin::none(), - inherent_data, - InboundMessagesData::new( - downward_messages.into_abridged(&mut usize::MAX.clone()), - horizontal_messages.into_abridged(&mut usize::MAX.clone()), - ), - ); + let _ = + pezcumulus_pezpallet_teyrchain_system::Pezpallet::::set_validation_data( + Runtime::RuntimeOrigin::none(), + inherent_data, + InboundMessagesData::new( + downward_messages.into_abridged(&mut usize::MAX.clone()), + horizontal_messages.into_abridged(&mut usize::MAX.clone()), + ), + ); let _ = pezpallet_timestamp::Pezpallet::::set( Runtime::RuntimeOrigin::none(), 300_u32.into(), diff --git a/pezcumulus/teyrchains/runtimes/testing/penpal/src/lib.rs b/pezcumulus/teyrchains/runtimes/testing/penpal/src/lib.rs index 19258d86..9c4d2f70 100644 --- a/pezcumulus/teyrchains/runtimes/testing/penpal/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/testing/penpal/src/lib.rs @@ -60,9 +60,8 @@ use pezframe_support::{ construct_runtime, derive_impl, dispatch::DispatchClass, genesis_builder_helper::{build_state, get_preset}, - ord_parameter_types, + ord_parameter_types, parameter_types, pezpallet_prelude::Weight, - parameter_types, traits::{ tokens::{fungible, fungibles, imbalance::ResolveAssetTo}, AsEnsureOriginWithArg, ConstBool, ConstU128, ConstU32, ConstU64, ConstU8, Everything, @@ -78,9 +77,8 @@ use pezframe_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, EnsureSigned, EnsureSignedBy, }; -use pezpallet_revive::evm::runtime::EthExtra; use pezkuwi_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; -use smallvec::smallvec; +use pezpallet_revive::evm::runtime::EthExtra; use pezsp_api::impl_runtime_apis; pub use pezsp_consensus_aura::sr25519::AuthorityId as AuraId; use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata}; @@ -91,6 +89,7 @@ use pezsp_runtime::{ ApplyExtrinsicResult, FixedU128, }; pub use pezsp_runtime::{traits::ConvertInto, MultiAddress, Perbill, Permill}; +use smallvec::smallvec; use testnet_teyrchains_constants::zagros::{consensus::*, time::*}; use teyrchains_common::{ impls::{AssetsToBlockAuthor, NonZeroIssuance}, diff --git a/pezcumulus/teyrchains/runtimes/testing/penpal/src/xcm_config.rs b/pezcumulus/teyrchains/runtimes/testing/penpal/src/xcm_config.rs index 80eea0d2..89fe860d 100644 --- a/pezcumulus/teyrchains/runtimes/testing/penpal/src/xcm_config.rs +++ b/pezcumulus/teyrchains/runtimes/testing/penpal/src/xcm_config.rs @@ -53,9 +53,9 @@ use pezframe_support::{ weights::Weight, }; use pezframe_system::EnsureRoot; -use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezkuwi_runtime_common::{impls::ToAuthor, xcm_sender::ExponentialPrice}; use pezkuwi_teyrchain_primitives::primitives::Sibling; +use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough}; use pezsp_runtime::traits::{AccountIdConversion, ConvertInto, Identity, TryConvertInto}; use testnet_teyrchains_constants::zagros::currency::deposit; use teyrchains_common::{ @@ -448,7 +448,12 @@ pub type ForeignAssetFeeAsExistentialDepositMultiplierFeeCharger = AssetFeeAsExistentialDepositMultiplier< Runtime, WeightToFee, - pezpallet_assets::BalanceToAssetBalance, + pezpallet_assets::BalanceToAssetBalance< + Balances, + Runtime, + ConvertInto, + ForeignAssetsInstance, + >, ForeignAssetsInstance, >; diff --git a/pezcumulus/teyrchains/runtimes/testing/pezkuwichain-teyrchain/src/lib.rs b/pezcumulus/teyrchains/runtimes/testing/pezkuwichain-teyrchain/src/lib.rs index c9feb4fc..07e6677b 100644 --- a/pezcumulus/teyrchains/runtimes/testing/pezkuwichain-teyrchain/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/testing/pezkuwichain-teyrchain/src/lib.rs @@ -85,8 +85,8 @@ use xcm_builder::{ use xcm_executor::traits::JustTry; // XCM imports -use pezpallet_xcm::{EnsureXcm, IsMajorityOfBody, XcmPassthrough}; use pezkuwi_teyrchain_primitives::primitives::Sibling; +use pezpallet_xcm::{EnsureXcm, IsMajorityOfBody, XcmPassthrough}; use xcm::latest::{prelude::*, PEZKUWICHAIN_GENESIS_HASH}; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom, @@ -702,7 +702,8 @@ pub struct RemoveCollectiveFlip; impl pezframe_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip { fn on_runtime_upgrade() -> Weight { use pezframe_support::storage::migration; - // Remove the storage value `RandomMaterial` from removed pezpallet `RandomnessCollectiveFlip` + // Remove the storage value `RandomMaterial` from removed pezpallet + // `RandomnessCollectiveFlip` #[allow(deprecated)] migration::remove_storage_prefix(b"RandomnessCollectiveFlip", b"RandomMaterial", b""); ::DbWeight::get().writes(1) diff --git a/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/src/lib.rs b/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/src/lib.rs index aecdbe8a..9a4861f2 100644 --- a/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/src/lib.rs +++ b/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/src/lib.rs @@ -28,8 +28,8 @@ mod xcm_config; use crate::xcm_config::{RelayLocation, XcmOriginToTransactDispatchOrigin}; -use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; pub use pezkuwi_sdk::{pezstaging_teyrchain_info as teyrchain_info, *}; +use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezstaging_xcm_builder as xcm_builder; use pezstaging_xcm_executor as xcm_executor; @@ -586,7 +586,8 @@ pub struct RemoveCollectiveFlip; impl pezframe_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip { fn on_runtime_upgrade() -> Weight { use pezframe_support::storage::migration; - // Remove the storage value `RandomMaterial` from removed pezpallet `RandomnessCollectiveFlip` + // Remove the storage value `RandomMaterial` from removed pezpallet + // `RandomnessCollectiveFlip` #[allow(deprecated)] migration::remove_storage_prefix(b"RandomnessCollectiveFlip", b"RandomMaterial", b""); ::DbWeight::get().writes(1) diff --git a/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/src/xcm_config.rs b/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/src/xcm_config.rs index 7830a508..265fa7f0 100644 --- a/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/src/xcm_config.rs +++ b/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/src/xcm_config.rs @@ -20,7 +20,8 @@ use super::{ }; use pezkuwi_sdk::{ - pezstaging_xcm as xcm, pezstaging_xcm_builder as xcm_builder, pezstaging_xcm_executor as xcm_executor, *, + pezstaging_xcm as xcm, pezstaging_xcm_builder as xcm_builder, + pezstaging_xcm_executor as xcm_executor, *, }; use pezframe_support::{ @@ -29,9 +30,9 @@ use pezframe_support::{ weights::Weight, }; use pezframe_system::EnsureRoot; -use pezpallet_xcm::XcmPassthrough; use pezkuwi_runtime_common::impls::ToAuthor; use pezkuwi_teyrchain_primitives::primitives::Sibling; +use pezpallet_xcm::XcmPassthrough; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom, diff --git a/pezcumulus/xcm/xcm-pez-emulator/src/lib.rs b/pezcumulus/xcm/xcm-pez-emulator/src/lib.rs index 28e0aa01..ee4e0111 100644 --- a/pezcumulus/xcm/xcm-pez-emulator/src/lib.rs +++ b/pezcumulus/xcm/xcm-pez-emulator/src/lib.rs @@ -76,10 +76,10 @@ pub use pezcumulus_primitives_core::{ }; pub use pezcumulus_primitives_teyrchain_inherent::TeyrchainInherentData; pub use pezcumulus_test_relay_sproof_builder::RelayStateSproofBuilder; -pub use pezpallet_aura; -pub use pezpallet_message_queue::{Config as MessageQueueConfig, Pezpallet as MessageQueuePallet}; pub use pezkuwi_primitives; pub use pezkuwi_runtime_teyrchains::inclusion::{AggregateMessageOrigin, UmpQueueId}; +pub use pezpallet_aura; +pub use pezpallet_message_queue::{Config as MessageQueueConfig, Pezpallet as MessageQueuePallet}; pub use teyrchains_common::{AccountId, Balance}; // Pezkuwi diff --git a/pezcumulus/zombienet/zombienet-sdk-helpers/src/lib.rs b/pezcumulus/zombienet/zombienet-sdk-helpers/src/lib.rs index 66153240..f7c020d0 100644 --- a/pezcumulus/zombienet/zombienet-sdk-helpers/src/lib.rs +++ b/pezcumulus/zombienet/zombienet-sdk-helpers/src/lib.rs @@ -3,8 +3,8 @@ use anyhow::anyhow; use codec::{Compact, Decode}; -use pezcumulus_primitives_core::{relay_chain, rpsr_digest::RPSR_CONSENSUS_ID}; use futures::stream::StreamExt; +use pezcumulus_primitives_core::{relay_chain, rpsr_digest::RPSR_CONSENSUS_ID}; use pezkuwi_primitives::{CandidateReceiptV2, Id as ParaId}; use std::{ cmp::max, @@ -18,7 +18,7 @@ use tokio::{ use zombienet_sdk::subxt::{ self, blocks::Block, - config::{polkadot::PolkadotExtrinsicParamsBuilder, bizinikiwi::DigestItem}, + config::{bizinikiwi::DigestItem, polkadot::PolkadotExtrinsicParamsBuilder}, dynamic::Value, events::Events, ext::scale_value::value, diff --git a/pezkuwi/cli/src/command.rs b/pezkuwi/cli/src/command.rs index ea2a2234..f7bdb960 100644 --- a/pezkuwi/cli/src/command.rs +++ b/pezkuwi/cli/src/command.rs @@ -15,22 +15,22 @@ // along with Pezkuwi. If not, see . use crate::cli::{Cli, Subcommand, NODE_VERSION}; -use pezframe_benchmarking_cli::{ - BenchmarkCmd, ExtrinsicFactory, BizinikiwiRemarkBuilder, BIZINIKIWI_REFERENCE_HARDWARE, -}; use futures::future::TryFutureExt; use log::{info, warn}; +use pezframe_benchmarking_cli::{ + BenchmarkCmd, BizinikiwiRemarkBuilder, ExtrinsicFactory, BIZINIKIWI_REFERENCE_HARDWARE, +}; use pezkuwi_service::{ self, benchmarking::{benchmark_inherent_data, TransferKeepAliveBuilder}, HeaderBackend, IdentifyVariant, }; -#[cfg(feature = "pyroscope")] -use pyroscope_pprofrs::{pprof_backend, PprofConfig}; use pezsc_cli::BizinikiwiCli; use pezsc_network_types::PeerId; use pezsp_core::crypto::Ss58AddressFormatRegistry; use pezsp_keyring::Sr25519Keyring; +#[cfg(feature = "pyroscope")] +use pyroscope_pprofrs::{pprof_backend, PprofConfig}; pub use crate::error::Error; #[cfg(feature = "pyroscope")] @@ -125,7 +125,10 @@ impl BizinikiwiCli for Cli { "pezkuwi".into() } - fn load_spec(&self, id: &str) -> std::result::Result, String> { + fn load_spec( + &self, + id: &str, + ) -> std::result::Result, String> { let id = if id == "" { let n = get_exec_name().unwrap_or_default(); ["pezkuwi", "kusama", "zagros", "pezkuwichain", "versi"] @@ -263,7 +266,10 @@ where .then(|| { config.database.path().map(|database_path| { let _ = std::fs::create_dir_all(&database_path); - pezsc_sysinfo::gather_hwbench(Some(database_path), &BIZINIKIWI_REFERENCE_HARDWARE) + pezsc_sysinfo::gather_hwbench( + Some(database_path), + &BIZINIKIWI_REFERENCE_HARDWARE, + ) }) }) .flatten(); diff --git a/pezkuwi/core-primitives/src/lib.rs b/pezkuwi/core-primitives/src/lib.rs index 58ccec81..10572c46 100644 --- a/pezkuwi/core-primitives/src/lib.rs +++ b/pezkuwi/core-primitives/src/lib.rs @@ -23,12 +23,12 @@ extern crate alloc; use codec::{Decode, DecodeWithMemTracking, Encode}; -use scale_info::TypeInfo; use pezsp_runtime::{ generic, traits::{IdentifyAccount, Verify}, MultiSignature, }; +use scale_info::TypeInfo; pub use pezsp_runtime::traits::{BlakeTwo256, Hash as HashT}; diff --git a/pezkuwi/node/collation-generation/src/lib.rs b/pezkuwi/node/collation-generation/src/lib.rs index 3b59dd04..de04dfae 100644 --- a/pezkuwi/node/collation-generation/src/lib.rs +++ b/pezkuwi/node/collation-generation/src/lib.rs @@ -34,10 +34,6 @@ use codec::Encode; use error::{Error, Result}; use futures::{channel::oneshot, future::FutureExt, select}; -use pezkuwi_pez_node_primitives::{ - AvailableData, Collation, CollationGenerationConfig, CollationSecondedSignal, PoV, - SubmitCollationParams, -}; use pezkuwi_node_subsystem::{ messages::{CollationGenerationMessage, CollatorProtocolMessage, RuntimeApiMessage}, overseer, ActiveLeavesUpdate, FromOrchestra, OverseerSignal, SpawnedSubsystem, @@ -47,6 +43,10 @@ use pezkuwi_node_subsystem_util::{ request_claim_queue, request_persisted_validation_data, request_session_index_for_child, request_validation_code_hash, request_validators, runtime::ClaimQueueSnapshot, }; +use pezkuwi_pez_node_primitives::{ + AvailableData, Collation, CollationGenerationConfig, CollationSecondedSignal, PoV, + SubmitCollationParams, +}; use pezkuwi_primitives::{ transpose_claim_queue, CandidateCommitments, CandidateDescriptorV2, CommittedCandidateReceiptV2, CoreIndex, Hash, Id as ParaId, OccupiedCoreAssumption, diff --git a/pezkuwi/node/collation-generation/src/tests.rs b/pezkuwi/node/collation-generation/src/tests.rs index 09f54c60..f6a8c694 100644 --- a/pezkuwi/node/collation-generation/src/tests.rs +++ b/pezkuwi/node/collation-generation/src/tests.rs @@ -17,23 +17,23 @@ use super::*; use assert_matches::assert_matches; use futures::{self, Future, StreamExt}; -use pezkuwi_pez_node_primitives::{ - BlockData, Collation, CollationResult, CollatorFn, MaybeCompressedPoV, PoV, -}; use pezkuwi_node_subsystem::{ messages::{AllMessages, RuntimeApiMessage, RuntimeApiRequest}, ActivatedLeaf, }; use pezkuwi_node_subsystem_test_helpers::TestSubsystemContextHandle; use pezkuwi_node_subsystem_util::TimeoutExt; +use pezkuwi_pez_node_primitives::{ + BlockData, Collation, CollationResult, CollatorFn, MaybeCompressedPoV, PoV, +}; use pezkuwi_primitives::{ CandidateDescriptorVersion, CandidateReceiptV2, ClaimQueueOffset, CollatorPair, CoreSelector, PersistedValidationData, UMPSignal, UMP_SEPARATOR, }; use pezkuwi_primitives_test_helpers::dummy_head_data; -use rstest::rstest; use pezsp_core::Pair; use pezsp_keyring::sr25519::Keyring as Sr25519Keyring; +use rstest::rstest; use std::{ collections::{BTreeMap, VecDeque}, sync::Mutex, diff --git a/pezkuwi/node/core/approval-voting-parallel/src/lib.rs b/pezkuwi/node/core/approval-voting-parallel/src/lib.rs index ead03532..28d60823 100644 --- a/pezkuwi/node/core/approval-voting-parallel/src/lib.rs +++ b/pezkuwi/node/core/approval-voting-parallel/src/lib.rs @@ -28,10 +28,6 @@ use pezkuwi_node_metrics::metered::{ UnboundedMeteredSender, }; -use pezkuwi_pez_node_primitives::{ - approval::time::{Clock, SystemClock}, - DISPUTE_WINDOW, -}; use pezkuwi_node_subsystem::{ messages::{ApprovalDistributionMessage, ApprovalVotingMessage, ApprovalVotingParallelMessage}, overseer, FromOrchestra, SpawnedSubsystem, SubsystemError, SubsystemResult, @@ -42,6 +38,10 @@ use pezkuwi_node_subsystem_util::{ runtime::{Config as RuntimeInfoConfig, RuntimeInfo}, }; use pezkuwi_overseer::{OverseerSignal, Priority, SubsystemSender, TimeoutExt}; +use pezkuwi_pez_node_primitives::{ + approval::time::{Clock, SystemClock}, + DISPUTE_WINDOW, +}; use pezkuwi_primitives::{CandidateIndex, Hash, ValidatorIndex, ValidatorSignature}; use rand::SeedableRng; diff --git a/pezkuwi/node/core/approval-voting-parallel/src/tests.rs b/pezkuwi/node/core/approval-voting-parallel/src/tests.rs index bab7e38e..d7e58dc0 100644 --- a/pezkuwi/node/core/approval-voting-parallel/src/tests.rs +++ b/pezkuwi/node/core/approval-voting-parallel/src/tests.rs @@ -32,6 +32,12 @@ use futures::{channel::oneshot, future, stream::PollNext, StreamExt}; use itertools::Itertools; use pezkuwi_node_core_approval_voting::{ApprovalVotingWorkProvider, Config}; use pezkuwi_node_network_protocol::{peer_set::ValidationVersion, ObservedRole, PeerId, View}; +use pezkuwi_node_subsystem::{ + messages::{ApprovalDistributionMessage, ApprovalVotingMessage, ApprovalVotingParallelMessage}, + FromOrchestra, +}; +use pezkuwi_node_subsystem_test_helpers::{mock::new_leaf, TestSubsystemContext}; +use pezkuwi_overseer::{ActiveLeavesUpdate, OverseerSignal, SpawnGlue, TimeoutExt}; use pezkuwi_pez_node_primitives::approval::{ time::SystemClock, v1::RELAY_VRF_MODULO_CONTEXT, @@ -40,12 +46,6 @@ use pezkuwi_pez_node_primitives::approval::{ IndirectSignedApprovalVoteV2, }, }; -use pezkuwi_node_subsystem::{ - messages::{ApprovalDistributionMessage, ApprovalVotingMessage, ApprovalVotingParallelMessage}, - FromOrchestra, -}; -use pezkuwi_node_subsystem_test_helpers::{mock::new_leaf, TestSubsystemContext}; -use pezkuwi_overseer::{ActiveLeavesUpdate, OverseerSignal, SpawnGlue, TimeoutExt}; use pezkuwi_primitives::{CandidateHash, CoreIndex, Hash, ValidatorIndex}; use pezsc_keystore::{Keystore, LocalKeystore}; use pezsp_consensus::SyncOracle; diff --git a/pezkuwi/node/core/approval-voting/src/approval_db/v2/migration_helpers.rs b/pezkuwi/node/core/approval-voting/src/approval_db/v2/migration_helpers.rs index 37421764..83c9c50f 100644 --- a/pezkuwi/node/core/approval-voting/src/approval_db/v2/migration_helpers.rs +++ b/pezkuwi/node/core/approval-voting/src/approval_db/v2/migration_helpers.rs @@ -24,8 +24,8 @@ use crate::{ backend::Backend, }; -use pezkuwi_pez_node_primitives::approval::v1::AssignmentCertKind; use pezkuwi_node_subsystem_util::database::Database; +use pezkuwi_pez_node_primitives::approval::v1::AssignmentCertKind; use pezsp_application_crypto::pezsp_core::H256; use std::{collections::HashSet, sync::Arc}; diff --git a/pezkuwi/node/core/approval-voting/src/approval_db/v2/mod.rs b/pezkuwi/node/core/approval-voting/src/approval_db/v2/mod.rs index ac1b3ce2..b9e9747e 100644 --- a/pezkuwi/node/core/approval-voting/src/approval_db/v2/mod.rs +++ b/pezkuwi/node/core/approval-voting/src/approval_db/v2/mod.rs @@ -17,9 +17,9 @@ //! Version 2 of the DB schema. use codec::{Decode, Encode}; -use pezkuwi_pez_node_primitives::approval::{v1::DelayTranche, v2::AssignmentCertV2}; use pezkuwi_node_subsystem::{SubsystemError, SubsystemResult}; use pezkuwi_node_subsystem_util::database::{DBTransaction, Database}; +use pezkuwi_pez_node_primitives::approval::{v1::DelayTranche, v2::AssignmentCertV2}; use pezkuwi_primitives::{ BlockNumber, CandidateHash, CandidateIndex, CandidateReceiptV2 as CandidateReceipt, CoreIndex, GroupIndex, Hash, SessionIndex, ValidatorIndex, ValidatorSignature, diff --git a/pezkuwi/node/core/approval-voting/src/approval_db/v3/migration_helpers.rs b/pezkuwi/node/core/approval-voting/src/approval_db/v3/migration_helpers.rs index 1f7c54a0..9225d228 100644 --- a/pezkuwi/node/core/approval-voting/src/approval_db/v3/migration_helpers.rs +++ b/pezkuwi/node/core/approval-voting/src/approval_db/v3/migration_helpers.rs @@ -24,8 +24,8 @@ use crate::{ }, backend::{Backend, V2ReadBackend}, }; -use pezkuwi_pez_node_primitives::approval::v1::AssignmentCertKind; use pezkuwi_node_subsystem_util::database::Database; +use pezkuwi_pez_node_primitives::approval::v1::AssignmentCertKind; use pezsp_application_crypto::pezsp_core::H256; use std::{collections::HashSet, sync::Arc}; diff --git a/pezkuwi/node/core/approval-voting/src/approval_db/v3/mod.rs b/pezkuwi/node/core/approval-voting/src/approval_db/v3/mod.rs index ea1187dd..4f1b0069 100644 --- a/pezkuwi/node/core/approval-voting/src/approval_db/v3/mod.rs +++ b/pezkuwi/node/core/approval-voting/src/approval_db/v3/mod.rs @@ -20,10 +20,10 @@ //! and adds a new field `pending_signatures` for `BlockEntry` use codec::{Decode, Encode}; -use pezkuwi_pez_node_primitives::approval::v2::CandidateBitfield; use pezkuwi_node_subsystem::SubsystemResult; use pezkuwi_node_subsystem_util::database::{DBTransaction, Database}; use pezkuwi_overseer::SubsystemError; +use pezkuwi_pez_node_primitives::approval::v2::CandidateBitfield; use pezkuwi_primitives::{ BlockNumber, CandidateHash, CandidateIndex, CandidateReceiptV2 as CandidateReceipt, CoreIndex, GroupIndex, Hash, SessionIndex, ValidatorIndex, ValidatorSignature, diff --git a/pezkuwi/node/core/approval-voting/src/criteria.rs b/pezkuwi/node/core/approval-voting/src/criteria.rs index 30bc78f6..2517cc2d 100644 --- a/pezkuwi/node/core/approval-voting/src/criteria.rs +++ b/pezkuwi/node/core/approval-voting/src/criteria.rs @@ -32,10 +32,10 @@ use pezkuwi_pez_node_primitives::approval::{ use pezkuwi_primitives::{ AssignmentPair, CandidateHash, CoreIndex, GroupIndex, IndexedVec, ValidatorIndex, }; -use rand::{seq::SliceRandom, SeedableRng}; -use rand_chacha::ChaCha20Rng; use pezsc_keystore::LocalKeystore; use pezsp_application_crypto::ByteArray; +use rand::{seq::SliceRandom, SeedableRng}; +use rand_chacha::ChaCha20Rng; use merlin::Transcript; use schnorrkel::vrf::VRFInOut; @@ -262,7 +262,8 @@ pub fn compute_assignments( Ok(Some(pair)) => Some((ValidatorIndex(i as _), pair)), Ok(None) => None, Err(pezsc_keystore::Error::Unavailable) => None, - Err(pezsc_keystore::Error::Io(e)) if e.kind() == std::io::ErrorKind::NotFound => None, + Err(pezsc_keystore::Error::Io(e)) if e.kind() == std::io::ErrorKind::NotFound => + None, Err(e) => { gum::warn!(target: LOG_TARGET, "Encountered keystore error: {:?}", e); None diff --git a/pezkuwi/node/core/approval-voting/src/import.rs b/pezkuwi/node/core/approval-voting/src/import.rs index 6cfdf3b2..64b3dd5e 100644 --- a/pezkuwi/node/core/approval-voting/src/import.rs +++ b/pezkuwi/node/core/approval-voting/src/import.rs @@ -28,13 +28,6 @@ //! //! We maintain a rolling window of session indices. This starts as empty -use pezkuwi_pez_node_primitives::{ - approval::{ - self as approval_types, - v1::{BlockApprovalMeta, RelayVRFStory}, - }, - MAX_FINALITY_LAG, -}; use pezkuwi_node_subsystem::{ messages::{ ApprovalDistributionMessage, ChainApiMessage, ChainSelectionMessage, RuntimeApiMessage, @@ -44,6 +37,13 @@ use pezkuwi_node_subsystem::{ }; use pezkuwi_node_subsystem_util::{determine_new_blocks, runtime::RuntimeInfo}; use pezkuwi_overseer::SubsystemSender; +use pezkuwi_pez_node_primitives::{ + approval::{ + self as approval_types, + v1::{BlockApprovalMeta, RelayVRFStory}, + }, + MAX_FINALITY_LAG, +}; use pezkuwi_primitives::{ node_features, BlockNumber, CandidateEvent, CandidateHash, CandidateReceiptV2 as CandidateReceipt, ConsensusLog, CoreIndex, GroupIndex, Hash, Header, @@ -612,22 +612,21 @@ pub(crate) mod tests { }; use approval_types::time::Clock; use assert_matches::assert_matches; - use pezkuwi_pez_node_primitives::{ - approval::v1::{VrfSignature, VrfTranscript}, - DISPUTE_WINDOW, - }; use pezkuwi_node_subsystem::{ messages::{AllMessages, ApprovalVotingMessage}, SubsystemContext, }; use pezkuwi_node_subsystem_test_helpers::make_subsystem_context; use pezkuwi_node_subsystem_util::database::Database; + use pezkuwi_pez_node_primitives::{ + approval::v1::{VrfSignature, VrfTranscript}, + DISPUTE_WINDOW, + }; use pezkuwi_primitives::{ node_features::FeatureIndex, ExecutorParams, Id as ParaId, IndexedVec, MutateDescriptorV2, NodeFeatures, SessionInfo, ValidatorId, ValidatorIndex, }; use pezkuwi_primitives_test_helpers::{dummy_candidate_receipt_v2, dummy_hash}; - use schnellru::{ByLength, LruMap}; pub(crate) use pezsp_consensus_babe::{ digests::{CompatibleDigestItem, PreDigest, SecondaryVRFPreDigest}, AllowedSlots, BabeEpochConfiguration, Epoch as BabeEpoch, @@ -635,6 +634,7 @@ pub(crate) mod tests { use pezsp_core::{crypto::VrfSecret, testing::TaskExecutor}; use pezsp_keyring::sr25519::Keyring as Sr25519Keyring; pub(crate) use pezsp_runtime::{Digest, DigestItem}; + use schnellru::{ByLength, LruMap}; use std::{pin::Pin, sync::Arc}; use crate::{approval_db::common::Config as DatabaseConfig, criteria, BlockEntry}; @@ -710,8 +710,10 @@ pub(crate) mod tests { _relay_vrf_story: pezkuwi_pez_node_primitives::approval::v1::RelayVRFStory, _assignment: &pezkuwi_pez_node_primitives::approval::v2::AssignmentCertV2, _backing_groups: Vec, - ) -> Result - { + ) -> Result< + pezkuwi_pez_node_primitives::approval::v1::DelayTranche, + criteria::InvalidAssignment, + > { Ok(0) } } diff --git a/pezkuwi/node/core/approval-voting/src/lib.rs b/pezkuwi/node/core/approval-voting/src/lib.rs index abd18cff..6bd53da5 100644 --- a/pezkuwi/node/core/approval-voting/src/lib.rs +++ b/pezkuwi/node/core/approval-voting/src/lib.rs @@ -22,16 +22,6 @@ //! been sufficiently approved to finalize. use futures_timer::Delay; -use pezkuwi_pez_node_primitives::{ - approval::{ - v1::{BlockApprovalMeta, DelayTranche}, - v2::{ - AssignmentCertKindV2, BitfieldError, CandidateBitfield, CoreBitfield, - IndirectAssignmentCertV2, IndirectSignedApprovalVoteV2, - }, - }, - ValidationResult, DISPUTE_WINDOW, -}; use pezkuwi_node_subsystem::{ errors::RecoveryError, messages::{ @@ -52,6 +42,16 @@ use pezkuwi_node_subsystem_util::{ runtime::{Config as RuntimeInfoConfig, ExtendedSessionInfo, RuntimeInfo}, TimeoutExt, }; +use pezkuwi_pez_node_primitives::{ + approval::{ + v1::{BlockApprovalMeta, DelayTranche}, + v2::{ + AssignmentCertKindV2, BitfieldError, CandidateBitfield, CoreBitfield, + IndirectAssignmentCertV2, IndirectSignedApprovalVoteV2, + }, + }, + ValidationResult, DISPUTE_WINDOW, +}; use pezkuwi_primitives::{ ApprovalVoteMultipleCandidates, ApprovalVotingParams, BlockNumber, CandidateHash, CandidateIndex, CandidateReceiptV2 as CandidateReceipt, CoreIndex, ExecutorParams, GroupIndex, diff --git a/pezkuwi/node/core/approval-voting/src/tests.rs b/pezkuwi/node/core/approval-voting/src/tests.rs index 8e430131..508873e5 100644 --- a/pezkuwi/node/core/approval-voting/src/tests.rs +++ b/pezkuwi/node/core/approval-voting/src/tests.rs @@ -22,6 +22,15 @@ use overseer::prometheus::{ prometheus::{IntCounter, IntCounterVec}, Histogram, HistogramOpts, HistogramVec, Opts, }; +use pezkuwi_node_subsystem::{ + messages::{ + AllMessages, ApprovalVotingMessage, AssignmentCheckResult, AvailabilityRecoveryMessage, + }, + ActiveLeavesUpdate, SubsystemContext, +}; +use pezkuwi_node_subsystem_test_helpers as test_helpers; +use pezkuwi_node_subsystem_util::TimeoutExt; +use pezkuwi_overseer::SpawnGlue; use pezkuwi_pez_node_primitives::{ approval::{ v1::{ @@ -32,15 +41,6 @@ use pezkuwi_pez_node_primitives::{ }, AvailableData, BlockData, PoV, }; -use pezkuwi_node_subsystem::{ - messages::{ - AllMessages, ApprovalVotingMessage, AssignmentCheckResult, AvailabilityRecoveryMessage, - }, - ActiveLeavesUpdate, SubsystemContext, -}; -use pezkuwi_node_subsystem_test_helpers as test_helpers; -use pezkuwi_node_subsystem_util::TimeoutExt; -use pezkuwi_overseer::SpawnGlue; use pezkuwi_primitives::{ ApprovalVote, CandidateCommitments, CandidateEvent, CoreIndex, DisputeStatement, GroupIndex, Header, Id as ParaId, IndexedVec, MutateDescriptorV2, NodeFeatures, ValidDisputeStatementKind, @@ -259,7 +259,8 @@ where _relay_vrf_story: pezkuwi_pez_node_primitives::approval::v1::RelayVRFStory, _assignment: &pezkuwi_pez_node_primitives::approval::v2::AssignmentCertV2, _backing_groups: Vec, - ) -> Result { + ) -> Result + { self.1(validator_index) } } diff --git a/pezkuwi/node/core/av-store/src/lib.rs b/pezkuwi/node/core/av-store/src/lib.rs index 454610c0..b5c62d82 100644 --- a/pezkuwi/node/core/av-store/src/lib.rs +++ b/pezkuwi/node/core/av-store/src/lib.rs @@ -39,13 +39,13 @@ use pezkuwi_node_subsystem_util::database::{DBTransaction, Database}; use pezsp_consensus::SyncOracle; use bitvec::{order::Lsb0 as BitOrderLsb0, vec::BitVec}; -use pezkuwi_pez_node_primitives::{AvailableData, ErasureChunk}; use pezkuwi_node_subsystem::{ errors::{ChainApiError, RuntimeApiError}, messages::{AvailabilityStoreMessage, ChainApiMessage, StoreAvailableDataError}, overseer, ActiveLeavesUpdate, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError, }; use pezkuwi_node_subsystem_util as util; +use pezkuwi_pez_node_primitives::{AvailableData, ErasureChunk}; use pezkuwi_primitives::{ BlockNumber, CandidateEvent, CandidateHash, CandidateReceiptV2 as CandidateReceipt, ChunkIndex, CoreIndex, Hash, Header, NodeFeatures, ValidatorIndex, diff --git a/pezkuwi/node/core/av-store/src/tests.rs b/pezkuwi/node/core/av-store/src/tests.rs index 96026154..ef7af022 100644 --- a/pezkuwi/node/core/av-store/src/tests.rs +++ b/pezkuwi/node/core/av-store/src/tests.rs @@ -22,7 +22,6 @@ use util::availability_chunks::availability_chunk_index; use self::test_helpers::mock::new_leaf; use parking_lot::Mutex; -use pezkuwi_pez_node_primitives::{AvailableData, BlockData, PoV, Proof}; use pezkuwi_node_subsystem::{ errors::RuntimeApiError, messages::{AllMessages, RuntimeApiMessage, RuntimeApiRequest}, @@ -30,6 +29,7 @@ use pezkuwi_node_subsystem::{ }; use pezkuwi_node_subsystem_test_helpers as test_helpers; use pezkuwi_node_subsystem_util::{database::Database, TimeoutExt}; +use pezkuwi_pez_node_primitives::{AvailableData, BlockData, PoV, Proof}; use pezkuwi_primitives::{ node_features, CandidateHash, CandidateReceiptV2 as CandidateReceipt, CoreIndex, GroupIndex, HeadData, Header, PersistedValidationData, ValidatorId, diff --git a/pezkuwi/node/core/backing/src/lib.rs b/pezkuwi/node/core/backing/src/lib.rs index acadd0b0..d6b4ead7 100644 --- a/pezkuwi/node/core/backing/src/lib.rs +++ b/pezkuwi/node/core/backing/src/lib.rs @@ -80,10 +80,6 @@ use futures::{ use schnellru::{ByLength, LruMap}; use error::{Error, FatalResult}; -use pezkuwi_pez_node_primitives::{ - AvailableData, InvalidCandidate, PoV, SignedFullStatementWithPVD, StatementWithPVD, - ValidationResult, -}; use pezkuwi_node_subsystem::{ messages::{ AvailabilityDistributionMessage, AvailabilityStoreMessage, CanSecondRequest, @@ -105,6 +101,10 @@ use pezkuwi_node_subsystem_util::{ runtime::{self, ClaimQueueSnapshot}, Validator, }; +use pezkuwi_pez_node_primitives::{ + AvailableData, InvalidCandidate, PoV, SignedFullStatementWithPVD, StatementWithPVD, + ValidationResult, +}; use pezkuwi_primitives::{ BackedCandidate, CandidateCommitments, CandidateHash, CandidateReceiptV2 as CandidateReceipt, CommittedCandidateReceiptV2 as CommittedCandidateReceipt, CoreIndex, ExecutorParams, diff --git a/pezkuwi/node/core/backing/src/tests/mod.rs b/pezkuwi/node/core/backing/src/tests/mod.rs index 29673775..c5183b95 100644 --- a/pezkuwi/node/core/backing/src/tests/mod.rs +++ b/pezkuwi/node/core/backing/src/tests/mod.rs @@ -17,7 +17,6 @@ use super::*; use assert_matches::assert_matches; use futures::{future, Future}; -use pezkuwi_pez_node_primitives::{BlockData, InvalidCandidate, SignedFullStatement, Statement}; use pezkuwi_node_subsystem::{ messages::{ AllMessages, ChainApiMessage, CollatorProtocolMessage, HypotheticalMembership, PvfExecKind, @@ -26,6 +25,7 @@ use pezkuwi_node_subsystem::{ ActivatedLeaf, ActiveLeavesUpdate, FromOrchestra, OverseerSignal, TimeoutExt, }; use pezkuwi_node_subsystem_test_helpers::mock::new_leaf; +use pezkuwi_pez_node_primitives::{BlockData, InvalidCandidate, SignedFullStatement, Statement}; use pezkuwi_primitives::{ BlockNumber, CoreState, GroupRotationInfo, HeadData, Header, MutateDescriptorV2, OccupiedCore, PersistedValidationData, ScheduledCore, SessionIndex, LEGACY_MIN_BACKING_VOTES, diff --git a/pezkuwi/node/core/candidate-validation/src/lib.rs b/pezkuwi/node/core/candidate-validation/src/lib.rs index 583ff1f3..7982b8df 100644 --- a/pezkuwi/node/core/candidate-validation/src/lib.rs +++ b/pezkuwi/node/core/candidate-validation/src/lib.rs @@ -27,7 +27,6 @@ use pezkuwi_node_core_pvf::{ InternalValidationError, InvalidCandidate as WasmInvalidCandidate, PossiblyInvalidError, PrepareError, PrepareJobKind, PvfPrepData, ValidationError, ValidationHost, }; -use pezkuwi_pez_node_primitives::{InvalidCandidate, PoV, ValidationResult}; use pezkuwi_node_subsystem::{ errors::RuntimeApiError, messages::{ @@ -42,6 +41,7 @@ use pezkuwi_node_subsystem_util::{ runtime::{fetch_scheduling_lookahead, ClaimQueueSnapshot}, }; use pezkuwi_overseer::{ActivatedLeaf, ActiveLeavesUpdate}; +use pezkuwi_pez_node_primitives::{InvalidCandidate, PoV, ValidationResult}; use pezkuwi_primitives::{ executor_params::{ DEFAULT_APPROVAL_EXECUTION_TIMEOUT, DEFAULT_BACKING_EXECUTION_TIMEOUT, diff --git a/pezkuwi/node/core/candidate-validation/src/tests.rs b/pezkuwi/node/core/candidate-validation/src/tests.rs index 7a1905cc..14042d00 100644 --- a/pezkuwi/node/core/candidate-validation/src/tests.rs +++ b/pezkuwi/node/core/candidate-validation/src/tests.rs @@ -24,11 +24,11 @@ use crate::PvfExecKind; use assert_matches::assert_matches; use futures::executor; use pezkuwi_node_core_pvf::PrepareError; -use pezkuwi_pez_node_primitives::BlockData; use pezkuwi_node_subsystem::messages::AllMessages; use pezkuwi_node_subsystem_test_helpers::{make_subsystem_context, TestSubsystemContextHandle}; use pezkuwi_node_subsystem_util::reexports::SubsystemContext; use pezkuwi_overseer::ActivatedLeaf; +use pezkuwi_pez_node_primitives::BlockData; use pezkuwi_primitives::{ CandidateDescriptorV2, CandidateDescriptorVersion, ClaimQueueOffset, CommittedCandidateReceiptError, CoreIndex, CoreSelector, GroupIndex, HeadData, Id as ParaId, @@ -39,10 +39,10 @@ use pezkuwi_primitives_test_helpers::{ dummy_collator, dummy_collator_signature, dummy_hash, make_valid_candidate_descriptor, make_valid_candidate_descriptor_v2, CandidateDescriptor, }; -use rstest::rstest; use pezsp_core::{sr25519::Public, testing::TaskExecutor}; use pezsp_keyring::Sr25519Keyring; use pezsp_keystore::{testing::MemoryKeystore, Keystore}; +use rstest::rstest; const VALIDATION_CODE_BOMB_LIMIT: u32 = 30 * 1024 * 1024; @@ -1341,10 +1341,12 @@ fn compressed_code_works() { let head_data = HeadData(vec![1, 1, 1]); let raw_code = vec![2u8; 16]; - let validation_code = - pezsp_maybe_compressed_blob::compress_strongly(&raw_code, VALIDATION_CODE_BOMB_LIMIT as usize) - .map(ValidationCode) - .unwrap(); + let validation_code = pezsp_maybe_compressed_blob::compress_strongly( + &raw_code, + VALIDATION_CODE_BOMB_LIMIT as usize, + ) + .map(ValidationCode) + .unwrap(); let descriptor = make_valid_candidate_descriptor( ParaId::from(1_u32), diff --git a/pezkuwi/node/core/chain-api/src/tests.rs b/pezkuwi/node/core/chain-api/src/tests.rs index cca5a057..50c54ebc 100644 --- a/pezkuwi/node/core/chain-api/src/tests.rs +++ b/pezkuwi/node/core/chain-api/src/tests.rs @@ -20,9 +20,9 @@ use codec::Encode; use futures::{channel::oneshot, future::BoxFuture}; use std::collections::BTreeMap; -use pezkuwi_pez_node_primitives::BlockWeight; use pezkuwi_node_subsystem_test_helpers::{make_subsystem_context, TestSubsystemContextHandle}; use pezkuwi_node_subsystem_types::ChainApiBackend; +use pezkuwi_pez_node_primitives::BlockWeight; use pezkuwi_primitives::{Block, BlockNumber, Hash, Header}; use pezsp_blockchain::Info as BlockInfo; use pezsp_core::testing::TaskExecutor; diff --git a/pezkuwi/node/core/chain-selection/src/lib.rs b/pezkuwi/node/core/chain-selection/src/lib.rs index 87609291..f6feb4f9 100644 --- a/pezkuwi/node/core/chain-selection/src/lib.rs +++ b/pezkuwi/node/core/chain-selection/src/lib.rs @@ -16,7 +16,6 @@ //! Implements the Chain Selection Subsystem. -use pezkuwi_pez_node_primitives::BlockWeight; use pezkuwi_node_subsystem::{ errors::ChainApiError, messages::{ChainApiMessage, ChainSelectionMessage}, @@ -24,6 +23,7 @@ use pezkuwi_node_subsystem::{ FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError, }; use pezkuwi_node_subsystem_util::database::Database; +use pezkuwi_pez_node_primitives::BlockWeight; use pezkuwi_primitives::{BlockNumber, ConsensusLog, Hash, Header}; use codec::Error as CodecError; diff --git a/pezkuwi/node/core/chain-selection/src/tree.rs b/pezkuwi/node/core/chain-selection/src/tree.rs index 095424f9..d091de56 100644 --- a/pezkuwi/node/core/chain-selection/src/tree.rs +++ b/pezkuwi/node/core/chain-selection/src/tree.rs @@ -23,8 +23,8 @@ //! Each direct descendant of the finalized block acts as its own sub-tree, //! and as the finalized block advances, orphaned sub-trees are entirely pruned. -use pezkuwi_pez_node_primitives::BlockWeight; use pezkuwi_node_subsystem::ChainApiError; +use pezkuwi_pez_node_primitives::BlockWeight; use pezkuwi_primitives::{BlockNumber, Hash}; use std::collections::HashMap; diff --git a/pezkuwi/node/core/dispute-coordinator/src/db/v1.rs b/pezkuwi/node/core/dispute-coordinator/src/db/v1.rs index ce7ad2c4..9331d657 100644 --- a/pezkuwi/node/core/dispute-coordinator/src/db/v1.rs +++ b/pezkuwi/node/core/dispute-coordinator/src/db/v1.rs @@ -22,8 +22,8 @@ //! the dispute data in the database. Any breaking changes here will still //! require a db migration (check `node/service/src/teyrchains_db/upgrade.rs`). -use pezkuwi_pez_node_primitives::DisputeStatus; use pezkuwi_node_subsystem_util::database::{DBTransaction, Database}; +use pezkuwi_pez_node_primitives::DisputeStatus; use pezkuwi_primitives::{ CandidateHash, CandidateReceiptV2 as CandidateReceipt, Hash, InvalidDisputeStatementKind, SessionIndex, ValidDisputeStatementKind, ValidatorIndex, ValidatorSignature, diff --git a/pezkuwi/node/core/dispute-coordinator/src/import.rs b/pezkuwi/node/core/dispute-coordinator/src/import.rs index 9e775873..6e341ef7 100644 --- a/pezkuwi/node/core/dispute-coordinator/src/import.rs +++ b/pezkuwi/node/core/dispute-coordinator/src/import.rs @@ -28,11 +28,11 @@ use std::collections::{BTreeMap, HashMap, HashSet}; +use pezkuwi_node_subsystem::overseer; +use pezkuwi_node_subsystem_util::{runtime::RuntimeInfo, ControlledValidatorIndices}; use pezkuwi_pez_node_primitives::{ disputes::ValidCandidateVotes, CandidateVotes, DisputeStatus, SignedDisputeStatement, Timestamp, }; -use pezkuwi_node_subsystem::overseer; -use pezkuwi_node_subsystem_util::{runtime::RuntimeInfo, ControlledValidatorIndices}; use pezkuwi_primitives::{ CandidateHash, CandidateReceiptV2 as CandidateReceipt, DisputeStatement, ExecutorParams, Hash, IndexedVec, SessionIndex, SessionInfo, ValidDisputeStatementKind, ValidatorId, ValidatorIndex, diff --git a/pezkuwi/node/core/dispute-coordinator/src/initialized.rs b/pezkuwi/node/core/dispute-coordinator/src/initialized.rs index b37f764a..8f164ff4 100644 --- a/pezkuwi/node/core/dispute-coordinator/src/initialized.rs +++ b/pezkuwi/node/core/dispute-coordinator/src/initialized.rs @@ -28,10 +28,6 @@ use futures::{ use pezsc_keystore::LocalKeystore; -use pezkuwi_pez_node_primitives::{ - disputes::ValidCandidateVotes, CandidateVotes, DisputeStatus, SignedDisputeStatement, - Timestamp, DISPUTE_WINDOW, -}; use pezkuwi_node_subsystem::{ messages::{ ApprovalVotingParallelMessage, BlockDescription, ChainSelectionMessage, @@ -43,6 +39,10 @@ use pezkuwi_node_subsystem_util::{ runtime::{self, key_ownership_proof, submit_report_dispute_lost, RuntimeInfo}, ControlledValidatorIndices, }; +use pezkuwi_pez_node_primitives::{ + disputes::ValidCandidateVotes, CandidateVotes, DisputeStatus, SignedDisputeStatement, + Timestamp, DISPUTE_WINDOW, +}; use pezkuwi_primitives::{ slashing, BlockNumber, CandidateHash, CandidateReceiptV2 as CandidateReceipt, CompactStatement, DisputeStatement, DisputeStatementSet, Hash, ScrapedOnChainVotes, SessionIndex, diff --git a/pezkuwi/node/core/dispute-coordinator/src/lib.rs b/pezkuwi/node/core/dispute-coordinator/src/lib.rs index f1d3cbeb..5f7cb3fb 100644 --- a/pezkuwi/node/core/dispute-coordinator/src/lib.rs +++ b/pezkuwi/node/core/dispute-coordinator/src/lib.rs @@ -33,10 +33,6 @@ use futures::FutureExt; use gum::CandidateHash; use pezsc_keystore::LocalKeystore; -use pezkuwi_pez_node_primitives::{ - CandidateVotes, DisputeMessage, DisputeMessageCheckError, SignedDisputeStatement, - DISPUTE_WINDOW, -}; use pezkuwi_node_subsystem::{ messages::DisputeDistributionMessage, overseer, ActivatedLeaf, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError, @@ -46,6 +42,10 @@ use pezkuwi_node_subsystem_util::{ runtime::{Config as RuntimeInfoConfig, RuntimeInfo}, ControlledValidatorIndices, }; +use pezkuwi_pez_node_primitives::{ + CandidateVotes, DisputeMessage, DisputeMessageCheckError, SignedDisputeStatement, + DISPUTE_WINDOW, +}; use pezkuwi_primitives::{ DisputeStatement, ScrapedOnChainVotes, SessionIndex, SessionInfo, ValidatorIndex, }; diff --git a/pezkuwi/node/core/dispute-coordinator/src/participation/mod.rs b/pezkuwi/node/core/dispute-coordinator/src/participation/mod.rs index 29e0f7c5..e177cec4 100644 --- a/pezkuwi/node/core/dispute-coordinator/src/participation/mod.rs +++ b/pezkuwi/node/core/dispute-coordinator/src/participation/mod.rs @@ -25,12 +25,12 @@ use futures::{ #[cfg(test)] use futures_timer::Delay; -use pezkuwi_pez_node_primitives::ValidationResult; use pezkuwi_node_subsystem::{ messages::{AvailabilityRecoveryMessage, CandidateValidationMessage, PvfExecKind}, overseer, ActiveLeavesUpdate, RecoveryError, }; use pezkuwi_node_subsystem_util::runtime::get_validation_code_by_hash; +use pezkuwi_pez_node_primitives::ValidationResult; use pezkuwi_primitives::{ BlockNumber, CandidateHash, CandidateReceiptV2 as CandidateReceipt, Hash, SessionIndex, }; diff --git a/pezkuwi/node/core/dispute-coordinator/src/participation/tests.rs b/pezkuwi/node/core/dispute-coordinator/src/participation/tests.rs index b3be262a..334ab536 100644 --- a/pezkuwi/node/core/dispute-coordinator/src/participation/tests.rs +++ b/pezkuwi/node/core/dispute-coordinator/src/participation/tests.rs @@ -23,7 +23,6 @@ use pezsp_core::testing::TaskExecutor; use super::*; use codec::Encode; -use pezkuwi_pez_node_primitives::{AvailableData, BlockData, InvalidCandidate, PoV}; use pezkuwi_node_subsystem::{ messages::{ AllMessages, ChainApiMessage, DisputeCoordinatorMessage, PvfExecKind, RuntimeApiMessage, @@ -34,6 +33,7 @@ use pezkuwi_node_subsystem::{ use pezkuwi_node_subsystem_test_helpers::{ make_subsystem_context, mock::new_leaf, TestSubsystemContext, TestSubsystemContextHandle, }; +use pezkuwi_pez_node_primitives::{AvailableData, BlockData, InvalidCandidate, PoV}; use pezkuwi_primitives::{ BlakeTwo256, CandidateCommitments, HashT, Header, PersistedValidationData, ValidationCode, }; diff --git a/pezkuwi/node/core/dispute-coordinator/src/scraping/mod.rs b/pezkuwi/node/core/dispute-coordinator/src/scraping/mod.rs index 67db5479..e108924b 100644 --- a/pezkuwi/node/core/dispute-coordinator/src/scraping/mod.rs +++ b/pezkuwi/node/core/dispute-coordinator/src/scraping/mod.rs @@ -19,7 +19,6 @@ use std::collections::{btree_map::Entry, BTreeMap, HashSet}; use futures::channel::oneshot; use schnellru::{ByLength, LruMap}; -use pezkuwi_pez_node_primitives::{DISPUTE_CANDIDATE_LIFETIME_AFTER_FINALIZATION, MAX_FINALITY_LAG}; use pezkuwi_node_subsystem::{ messages::ChainApiMessage, overseer, ActivatedLeaf, ActiveLeavesUpdate, ChainApiError, RuntimeApiError, SubsystemSender, @@ -27,6 +26,9 @@ use pezkuwi_node_subsystem::{ use pezkuwi_node_subsystem_util::runtime::{ self, get_candidate_events, get_on_chain_votes, get_unapplied_slashes, }; +use pezkuwi_pez_node_primitives::{ + DISPUTE_CANDIDATE_LIFETIME_AFTER_FINALIZATION, MAX_FINALITY_LAG, +}; use pezkuwi_primitives::{ slashing::PendingSlashes, BlockNumber, CandidateEvent, CandidateHash, CandidateReceiptV2 as CandidateReceipt, Hash, ScrapedOnChainVotes, SessionIndex, diff --git a/pezkuwi/node/core/dispute-coordinator/src/scraping/tests.rs b/pezkuwi/node/core/dispute-coordinator/src/scraping/tests.rs index 80eb6497..a6c7be5f 100644 --- a/pezkuwi/node/core/dispute-coordinator/src/scraping/tests.rs +++ b/pezkuwi/node/core/dispute-coordinator/src/scraping/tests.rs @@ -22,7 +22,6 @@ use codec::Encode; use futures::future::join; use pezsp_core::testing::TaskExecutor; -use pezkuwi_pez_node_primitives::DISPUTE_CANDIDATE_LIFETIME_AFTER_FINALIZATION; use pezkuwi_node_subsystem::{ messages::{ AllMessages, ChainApiMessage, DisputeCoordinatorMessage, RuntimeApiMessage, @@ -35,6 +34,7 @@ use pezkuwi_node_subsystem_test_helpers::{ TestSubsystemSender, }; use pezkuwi_node_subsystem_util::{reexports::SubsystemContext, TimeoutExt}; +use pezkuwi_pez_node_primitives::DISPUTE_CANDIDATE_LIFETIME_AFTER_FINALIZATION; use pezkuwi_primitives::{ BlakeTwo256, BlockNumber, CandidateEvent, CandidateReceiptV2 as CandidateReceipt, CoreIndex, GroupIndex, Hash, HashT, HeadData, Id as ParaId, diff --git a/pezkuwi/node/core/dispute-coordinator/src/tests.rs b/pezkuwi/node/core/dispute-coordinator/src/tests.rs index 897a2a3f..af20cf30 100644 --- a/pezkuwi/node/core/dispute-coordinator/src/tests.rs +++ b/pezkuwi/node/core/dispute-coordinator/src/tests.rs @@ -31,10 +31,6 @@ use futures::{ use pezkuwi_node_subsystem_util::database::Database; -use pezkuwi_pez_node_primitives::{ - DisputeMessage, DisputeStatus, SignedDisputeStatement, SignedFullStatement, Statement, - DISPUTE_WINDOW, -}; use pezkuwi_node_subsystem::{ messages::{ ApprovalVotingParallelMessage, ChainApiMessage, ChainSelectionMessage, @@ -43,6 +39,10 @@ use pezkuwi_node_subsystem::{ overseer::FromOrchestra, OverseerSignal, }; +use pezkuwi_pez_node_primitives::{ + DisputeMessage, DisputeStatus, SignedDisputeStatement, SignedFullStatement, Statement, + DISPUTE_WINDOW, +}; use pezkuwi_node_subsystem_util::TimeoutExt; use pezsc_keystore::LocalKeystore; @@ -51,7 +51,6 @@ use pezsp_core::{sr25519::Pair, testing::TaskExecutor, Pair as PairT}; use pezsp_keyring::Sr25519Keyring; use pezsp_keystore::{Keystore, KeystorePtr}; -use pezkuwi_pez_node_primitives::{Timestamp, ACTIVE_DURATION_SECS}; use pezkuwi_node_subsystem::{ messages::{AllMessages, BlockDescription, RuntimeApiMessage, RuntimeApiRequest}, ActiveLeavesUpdate, @@ -59,6 +58,7 @@ use pezkuwi_node_subsystem::{ use pezkuwi_node_subsystem_test_helpers::{ make_buffered_subsystem_context, mock::new_leaf, TestSubsystemContextHandle, }; +use pezkuwi_pez_node_primitives::{Timestamp, ACTIVE_DURATION_SECS}; use pezkuwi_primitives::{ ApprovalVote, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash, CandidateReceiptV2 as CandidateReceipt, CoreIndex, DisputeStatement, ExecutorParams, diff --git a/pezkuwi/node/core/provisioner/src/disputes/mod.rs b/pezkuwi/node/core/provisioner/src/disputes/mod.rs index 5377b79b..d660b3fd 100644 --- a/pezkuwi/node/core/provisioner/src/disputes/mod.rs +++ b/pezkuwi/node/core/provisioner/src/disputes/mod.rs @@ -19,8 +19,8 @@ use crate::LOG_TARGET; use futures::channel::oneshot; -use pezkuwi_pez_node_primitives::CandidateVotes; use pezkuwi_node_subsystem::{messages::DisputeCoordinatorMessage, overseer}; +use pezkuwi_pez_node_primitives::CandidateVotes; use pezkuwi_primitives::{CandidateHash, SessionIndex}; /// Request the relevant dispute statements for a set of disputes identified by `CandidateHash` and diff --git a/pezkuwi/node/core/provisioner/src/disputes/prioritized_selection/mod.rs b/pezkuwi/node/core/provisioner/src/disputes/prioritized_selection/mod.rs index 018a5c65..d9ae0412 100644 --- a/pezkuwi/node/core/provisioner/src/disputes/prioritized_selection/mod.rs +++ b/pezkuwi/node/core/provisioner/src/disputes/prioritized_selection/mod.rs @@ -20,12 +20,12 @@ use crate::{error::GetOnchainDisputesError, metrics, LOG_TARGET}; use futures::channel::oneshot; -use pezkuwi_pez_node_primitives::{dispute_is_inactive, CandidateVotes, DisputeStatus, Timestamp}; use pezkuwi_node_subsystem::{ errors::RuntimeApiError, messages::{DisputeCoordinatorMessage, RuntimeApiMessage, RuntimeApiRequest}, overseer, ActivatedLeaf, }; +use pezkuwi_pez_node_primitives::{dispute_is_inactive, CandidateVotes, DisputeStatus, Timestamp}; use pezkuwi_primitives::{ supermajority_threshold, CandidateHash, DisputeState, DisputeStatement, DisputeStatementSet, Hash, MultiDisputeStatementSet, SessionIndex, ValidDisputeStatementKind, ValidatorIndex, diff --git a/pezkuwi/node/core/provisioner/src/disputes/prioritized_selection/tests.rs b/pezkuwi/node/core/provisioner/src/disputes/prioritized_selection/tests.rs index 237f3ee8..d9672152 100644 --- a/pezkuwi/node/core/provisioner/src/disputes/prioritized_selection/tests.rs +++ b/pezkuwi/node/core/provisioner/src/disputes/prioritized_selection/tests.rs @@ -20,11 +20,11 @@ use super::super::{ }; use bitvec::prelude::*; use futures::channel::mpsc; -use pezkuwi_pez_node_primitives::{CandidateVotes, DisputeStatus, ACTIVE_DURATION_SECS}; use pezkuwi_node_subsystem::messages::{ AllMessages, DisputeCoordinatorMessage, RuntimeApiMessage, RuntimeApiRequest, }; use pezkuwi_node_subsystem_test_helpers::{mock::new_leaf, TestSubsystemSender}; +use pezkuwi_pez_node_primitives::{CandidateVotes, DisputeStatus, ACTIVE_DURATION_SECS}; use pezkuwi_primitives::{ CandidateHash, CandidateReceiptV2 as CandidateReceipt, DisputeState, InvalidDisputeStatementKind, SessionIndex, ValidDisputeStatementKind, ValidatorSignature, diff --git a/pezkuwi/node/core/pvf/common/src/executor_interface.rs b/pezkuwi/node/core/pvf/common/src/executor_interface.rs index 9d65997a..c09537ee 100644 --- a/pezkuwi/node/core/pvf/common/src/executor_interface.rs +++ b/pezkuwi/node/core/pvf/common/src/executor_interface.rs @@ -271,7 +271,11 @@ impl pezsp_externalities::Externalities for ValidationExternalities { panic!("storage_root: unsupported feature for teyrchain validation") } - fn child_storage_root(&mut self, _: &ChildInfo, _: pezsp_core::storage::StateVersion) -> Vec { + fn child_storage_root( + &mut self, + _: &ChildInfo, + _: pezsp_core::storage::StateVersion, + ) -> Vec { panic!("child_storage_root: unsupported feature for teyrchain validation") } diff --git a/pezkuwi/node/core/pvf/execute-worker/src/lib.rs b/pezkuwi/node/core/pvf/execute-worker/src/lib.rs index a2bc129f..f3513482 100644 --- a/pezkuwi/node/core/pvf/execute-worker/src/lib.rs +++ b/pezkuwi/node/core/pvf/execute-worker/src/lib.rs @@ -217,22 +217,24 @@ pub fn worker_entrypoint( let compiled_artifact_blob = Arc::new(compiled_artifact_blob); - let raw_block_data = - match pezsp_maybe_compressed_blob::decompress(&pov.block_data.0, POV_BOMB_LIMIT) { - Ok(data) => data, - Err(_) => { - send_result::( - &mut stream, - Ok(WorkerResponse { - job_response: JobResponse::PoVDecompressionFailure, - duration: Duration::ZERO, - pov_size: 0, - }), - worker_info, - )?; - continue; - }, - }; + let raw_block_data = match pezsp_maybe_compressed_blob::decompress( + &pov.block_data.0, + POV_BOMB_LIMIT, + ) { + Ok(data) => data, + Err(_) => { + send_result::( + &mut stream, + Ok(WorkerResponse { + job_response: JobResponse::PoVDecompressionFailure, + duration: Duration::ZERO, + pov_size: 0, + }), + worker_info, + )?; + continue; + }, + }; let pov_size = raw_block_data.len() as u32; diff --git a/pezkuwi/node/core/pvf/src/execute/queue.rs b/pezkuwi/node/core/pvf/src/execute/queue.rs index d429c201..1148f06f 100644 --- a/pezkuwi/node/core/pvf/src/execute/queue.rs +++ b/pezkuwi/node/core/pvf/src/execute/queue.rs @@ -34,8 +34,8 @@ use pezkuwi_node_core_pvf_common::{ execute::{JobResponse, WorkerError, WorkerResponse}, SecurityStatus, }; -use pezkuwi_pez_node_primitives::PoV; use pezkuwi_node_subsystem::{messages::PvfExecKind, ActiveLeavesUpdate}; +use pezkuwi_pez_node_primitives::PoV; use pezkuwi_primitives::{ExecutorParams, ExecutorParamsHash, Hash, PersistedValidationData}; use slotmap::HopSlotMap; use std::{ @@ -908,8 +908,8 @@ impl Unscheduled { #[cfg(test)] mod tests { - use pezkuwi_pez_node_primitives::BlockData; use pezkuwi_node_subsystem_test_helpers::mock::new_leaf; + use pezkuwi_pez_node_primitives::BlockData; use pezsp_core::H256; use super::*; diff --git a/pezkuwi/node/core/pvf/src/host.rs b/pezkuwi/node/core/pvf/src/host.rs index 810663d6..8adeeac2 100644 --- a/pezkuwi/node/core/pvf/src/host.rs +++ b/pezkuwi/node/core/pvf/src/host.rs @@ -38,10 +38,10 @@ use pezkuwi_node_core_pvf_common::{ prepare::PrepareSuccess, pvf::PvfPrepData, }; -use pezkuwi_pez_node_primitives::PoV; use pezkuwi_node_subsystem::{ messages::PvfExecKind, ActiveLeavesUpdate, SubsystemError, SubsystemResult, }; +use pezkuwi_pez_node_primitives::PoV; use pezkuwi_primitives::{Hash, PersistedValidationData}; use pezkuwi_teyrchain_primitives::primitives::ValidationResult; use std::{ diff --git a/pezkuwi/node/core/pvf/tests/it/main.rs b/pezkuwi/node/core/pvf/tests/it/main.rs index b34bd0ed..bbbfae57 100644 --- a/pezkuwi/node/core/pvf/tests/it/main.rs +++ b/pezkuwi/node/core/pvf/tests/it/main.rs @@ -25,8 +25,8 @@ use pezkuwi_node_core_pvf::{ ValidationHost, JOB_TIMEOUT_WALL_CLOCK_FACTOR, }; use pezkuwi_node_core_pvf_common::{compute_checksum, ArtifactChecksum}; -use pezkuwi_pez_node_primitives::{PoV, POV_BOMB_LIMIT}; use pezkuwi_node_subsystem::messages::PvfExecKind; +use pezkuwi_pez_node_primitives::{PoV, POV_BOMB_LIMIT}; use pezkuwi_primitives::{ ExecutorParam, ExecutorParams, Hash, PersistedValidationData, PvfExecKind as RuntimePvfExecKind, }; diff --git a/pezkuwi/node/core/pvf/tests/it/process.rs b/pezkuwi/node/core/pvf/tests/it/process.rs index 344b300a..546c5b04 100644 --- a/pezkuwi/node/core/pvf/tests/it/process.rs +++ b/pezkuwi/node/core/pvf/tests/it/process.rs @@ -28,9 +28,9 @@ use pezkuwi_primitives::PersistedValidationData; use pezkuwi_teyrchain_primitives::primitives::{ BlockData as GenericBlockData, HeadData as GenericHeadData, }; +use pezsp_core::H256; use procfs::process; use rusty_fork::rusty_fork_test; -use pezsp_core::H256; use std::{future::Future, sync::Arc, time::Duration}; use test_teyrchain_adder::{hash_state, BlockData, HeadData}; diff --git a/pezkuwi/node/core/runtime-api/src/cache.rs b/pezkuwi/node/core/runtime-api/src/cache.rs index d334a248..42dd3d98 100644 --- a/pezkuwi/node/core/runtime-api/src/cache.rs +++ b/pezkuwi/node/core/runtime-api/src/cache.rs @@ -16,8 +16,8 @@ use std::collections::{btree_map::BTreeMap, VecDeque}; -use schnellru::{ByLength, LruMap}; use pezsp_consensus_babe::Epoch; +use schnellru::{ByLength, LruMap}; use pezkuwi_primitives::{ async_backing::{self, Constraints}, diff --git a/pezkuwi/node/core/runtime-api/src/tests.rs b/pezkuwi/node/core/runtime-api/src/tests.rs index ec627102..85a15a9e 100644 --- a/pezkuwi/node/core/runtime-api/src/tests.rs +++ b/pezkuwi/node/core/runtime-api/src/tests.rs @@ -16,9 +16,9 @@ use super::*; -use pezkuwi_pez_node_primitives::{BabeAllowedSlots, BabeEpoch, BabeEpochConfiguration}; use pezkuwi_node_subsystem::SpawnGlue; use pezkuwi_node_subsystem_test_helpers::make_subsystem_context; +use pezkuwi_pez_node_primitives::{BabeAllowedSlots, BabeEpoch, BabeEpochConfiguration}; use pezkuwi_primitives::{ async_backing, async_backing::Constraints, slashing, ApprovalVotingParams, AuthorityDiscoveryId, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash, diff --git a/pezkuwi/node/malus/src/variants/suggest_garbage_candidate.rs b/pezkuwi/node/malus/src/variants/suggest_garbage_candidate.rs index 93b59646..db89e74c 100644 --- a/pezkuwi/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/pezkuwi/node/malus/src/variants/suggest_garbage_candidate.rs @@ -30,8 +30,8 @@ use pezkuwi_cli::{ }, validator_overseer_builder, Cli, }; -use pezkuwi_pez_node_primitives::{AvailableData, BlockData, PoV}; use pezkuwi_node_subsystem_types::{ChainApiBackend, RuntimeApiSubsystemClient}; +use pezkuwi_pez_node_primitives::{AvailableData, BlockData, PoV}; use pezkuwi_primitives::{CandidateDescriptorV2, CandidateReceiptV2, CoreIndex}; use pezkuwi_node_subsystem_util::request_validators; diff --git a/pezkuwi/node/metrics/src/runtime/mod.rs b/pezkuwi/node/metrics/src/runtime/mod.rs index 864d2cd2..b84f9ef5 100644 --- a/pezkuwi/node/metrics/src/runtime/mod.rs +++ b/pezkuwi/node/metrics/src/runtime/mod.rs @@ -213,7 +213,8 @@ impl RuntimeMetricsProvider { } /// Returns the custom profiling closure that we'll apply to the `LoggerBuilder`. -pub fn logger_hook() -> impl FnOnce(&mut pezsc_cli::LoggerBuilder, &pezsc_service::Configuration) -> () { +pub fn logger_hook( +) -> impl FnOnce(&mut pezsc_cli::LoggerBuilder, &pezsc_service::Configuration) -> () { |logger_builder, config| { if config.prometheus_registry().is_none() { return; diff --git a/pezkuwi/node/network/approval-distribution/src/lib.rs b/pezkuwi/node/network/approval-distribution/src/lib.rs index f9fa99d6..9fbef49a 100644 --- a/pezkuwi/node/network/approval-distribution/src/lib.rs +++ b/pezkuwi/node/network/approval-distribution/src/lib.rs @@ -33,18 +33,6 @@ use pezkuwi_node_network_protocol::{ peer_set::MAX_NOTIFICATION_SIZE, v3 as protocol_v3, PeerId, UnifiedReputationChange as Rep, ValidationProtocols, View, }; -use pezkuwi_pez_node_primitives::{ - approval::{ - criteria::{AssignmentCriteria, InvalidAssignment}, - time::{Clock, ClockExt, SystemClock, TICK_TOO_FAR_IN_FUTURE}, - v1::{BlockApprovalMeta, DelayTranche, RelayVRFStory}, - v2::{ - AsBitIndex, AssignmentCertKindV2, CandidateBitfield, IndirectAssignmentCertV2, - IndirectSignedApprovalVoteV2, - }, - }, - DISPUTE_WINDOW, -}; use pezkuwi_node_subsystem::{ messages::{ ApprovalDistributionMessage, ApprovalVotingMessage, CheckedIndirectAssignment, @@ -57,6 +45,18 @@ use pezkuwi_node_subsystem_util::{ reputation::{ReputationAggregator, REPUTATION_CHANGE_INTERVAL}, runtime::{Config as RuntimeInfoConfig, ExtendedSessionInfo, RuntimeInfo}, }; +use pezkuwi_pez_node_primitives::{ + approval::{ + criteria::{AssignmentCriteria, InvalidAssignment}, + time::{Clock, ClockExt, SystemClock, TICK_TOO_FAR_IN_FUTURE}, + v1::{BlockApprovalMeta, DelayTranche, RelayVRFStory}, + v2::{ + AsBitIndex, AssignmentCertKindV2, CandidateBitfield, IndirectAssignmentCertV2, + IndirectSignedApprovalVoteV2, + }, + }, + DISPUTE_WINDOW, +}; use pezkuwi_primitives::{ BlockNumber, CandidateHash, CandidateIndex, CoreIndex, DisputeStatement, GroupIndex, Hash, SessionIndex, Slot, ValidDisputeStatementKind, ValidatorIndex, ValidatorSignature, diff --git a/pezkuwi/node/network/approval-distribution/src/tests.rs b/pezkuwi/node/network/approval-distribution/src/tests.rs index ff63c4c4..43fe2977 100644 --- a/pezkuwi/node/network/approval-distribution/src/tests.rs +++ b/pezkuwi/node/network/approval-distribution/src/tests.rs @@ -23,6 +23,10 @@ use pezkuwi_node_network_protocol::{ peer_set::ValidationVersion, view, ObservedRole, }; +use pezkuwi_node_subsystem::messages::{ + network_bridge_event, AllMessages, ReportPeerMessage, RuntimeApiRequest, +}; +use pezkuwi_node_subsystem_util::{reputation::add_reputation, TimeoutExt as _}; use pezkuwi_pez_node_primitives::approval::{ criteria, v1::{VrfPreOutput, VrfProof, VrfSignature}, @@ -31,20 +35,16 @@ use pezkuwi_pez_node_primitives::approval::{ RELAY_VRF_MODULO_CONTEXT, }, }; -use pezkuwi_node_subsystem::messages::{ - network_bridge_event, AllMessages, ReportPeerMessage, RuntimeApiRequest, -}; -use pezkuwi_node_subsystem_util::{reputation::add_reputation, TimeoutExt as _}; use pezkuwi_primitives::{ ApprovalVoteMultipleCandidates, AuthorityDiscoveryId, BlakeTwo256, CoreIndex, ExecutorParams, HashT, NodeFeatures, SessionInfo, ValidatorId, }; use pezkuwi_primitives_test_helpers::dummy_signature; -use rand::SeedableRng; use pezsc_keystore::{Keystore, LocalKeystore}; use pezsp_application_crypto::AppCrypto; use pezsp_authority_discovery::AuthorityPair as AuthorityDiscoveryPair; use pezsp_core::crypto::Pair as PairT; +use rand::SeedableRng; use std::time::Duration; type VirtualOverseer = pezkuwi_node_subsystem_test_helpers::TestSubsystemContextHandle; @@ -456,8 +456,10 @@ fn signature_for( } struct MockAssignmentCriteria { - tranche: - Result, + tranche: Result< + pezkuwi_pez_node_primitives::approval::v1::DelayTranche, + criteria::InvalidAssignment, + >, } impl AssignmentCriteria for MockAssignmentCriteria { @@ -484,7 +486,8 @@ impl AssignmentCriteria for MockAssignmentCriteria { _relay_vrf_story: pezkuwi_pez_node_primitives::approval::v1::RelayVRFStory, _assignment: &pezkuwi_pez_node_primitives::approval::v2::AssignmentCertV2, _backing_groups: Vec, - ) -> Result { + ) -> Result + { self.tranche } } diff --git a/pezkuwi/node/network/availability-distribution/src/pov_requester/mod.rs b/pezkuwi/node/network/availability-distribution/src/pov_requester/mod.rs index efed3431..f066eb81 100644 --- a/pezkuwi/node/network/availability-distribution/src/pov_requester/mod.rs +++ b/pezkuwi/node/network/availability-distribution/src/pov_requester/mod.rs @@ -23,12 +23,12 @@ use pezkuwi_node_network_protocol::request_response::{ v1::{PoVFetchingRequest, PoVFetchingResponse}, OutgoingRequest, Recipient, }; -use pezkuwi_pez_node_primitives::PoV; use pezkuwi_node_subsystem::{ messages::{IfDisconnected, NetworkBridgeTxMessage}, overseer, }; use pezkuwi_node_subsystem_util::runtime::RuntimeInfo; +use pezkuwi_pez_node_primitives::PoV; use pezkuwi_primitives::{AuthorityDiscoveryId, CandidateHash, Hash, Id as ParaId, ValidatorIndex}; use crate::{ @@ -128,11 +128,11 @@ mod tests { use pezsc_network::ProtocolName; use pezsp_core::testing::TaskExecutor; - use pezkuwi_pez_node_primitives::BlockData; use pezkuwi_node_subsystem::messages::{ AllMessages, AvailabilityDistributionMessage, RuntimeApiMessage, RuntimeApiRequest, }; use pezkuwi_node_subsystem_test_helpers as test_helpers; + use pezkuwi_pez_node_primitives::BlockData; use pezkuwi_primitives::{CandidateHash, ExecutorParams, Hash, NodeFeatures, ValidatorIndex}; use test_helpers::mock::make_ferdie_keystore; diff --git a/pezkuwi/node/network/availability-distribution/src/requester/fetch_task/mod.rs b/pezkuwi/node/network/availability-distribution/src/requester/fetch_task/mod.rs index 277d0fef..63434761 100644 --- a/pezkuwi/node/network/availability-distribution/src/requester/fetch_task/mod.rs +++ b/pezkuwi/node/network/availability-distribution/src/requester/fetch_task/mod.rs @@ -29,11 +29,11 @@ use pezkuwi_node_network_protocol::request_response::{ v1::{self, ChunkResponse}, v2, }; -use pezkuwi_pez_node_primitives::ErasureChunk; use pezkuwi_node_subsystem::{ messages::{AvailabilityStoreMessage, IfDisconnected, NetworkBridgeTxMessage}, overseer, }; +use pezkuwi_pez_node_primitives::ErasureChunk; use pezkuwi_primitives::{ AuthorityDiscoveryId, BlakeTwo256, CandidateHash, ChunkIndex, GroupIndex, Hash, HashT, OccupiedCore, SessionIndex, diff --git a/pezkuwi/node/network/availability-distribution/src/requester/fetch_task/tests.rs b/pezkuwi/node/network/availability-distribution/src/requester/fetch_task/tests.rs index 320c7498..2309063b 100644 --- a/pezkuwi/node/network/availability-distribution/src/requester/fetch_task/tests.rs +++ b/pezkuwi/node/network/availability-distribution/src/requester/fetch_task/tests.rs @@ -33,8 +33,8 @@ use pezkuwi_node_network_protocol::request_response::{ v1::{self, ChunkResponse}, Protocol, Recipient, ReqProtocolNames, }; -use pezkuwi_pez_node_primitives::{BlockData, PoV, Proof}; use pezkuwi_node_subsystem::messages::AllMessages; +use pezkuwi_pez_node_primitives::{BlockData, PoV, Proof}; use pezkuwi_primitives::{CandidateHash, ChunkIndex, ValidatorIndex}; use super::*; diff --git a/pezkuwi/node/network/availability-distribution/src/requester/tests.rs b/pezkuwi/node/network/availability-distribution/src/requester/tests.rs index bc8d29b6..fdc647a0 100644 --- a/pezkuwi/node/network/availability-distribution/src/requester/tests.rs +++ b/pezkuwi/node/network/availability-distribution/src/requester/tests.rs @@ -18,8 +18,8 @@ use futures::FutureExt; use std::future::Future; use pezkuwi_node_network_protocol::request_response::ReqProtocolNames; -use pezkuwi_pez_node_primitives::{BlockData, ErasureChunk, PoV}; use pezkuwi_node_subsystem_util::runtime::RuntimeInfo; +use pezkuwi_pez_node_primitives::{BlockData, ErasureChunk, PoV}; use pezkuwi_primitives::{ BlockNumber, ChunkIndex, CoreState, ExecutorParams, GroupIndex, Hash, Id as ParaId, ScheduledCore, SessionIndex, SessionInfo, diff --git a/pezkuwi/node/network/availability-distribution/src/responder.rs b/pezkuwi/node/network/availability-distribution/src/responder.rs index 474f538a..01e674d2 100644 --- a/pezkuwi/node/network/availability-distribution/src/responder.rs +++ b/pezkuwi/node/network/availability-distribution/src/responder.rs @@ -26,8 +26,8 @@ use pezkuwi_node_network_protocol::{ request_response::{v1, v2, IncomingRequest, IncomingRequestReceiver, IsRequest}, UnifiedReputationChange as Rep, }; -use pezkuwi_pez_node_primitives::{AvailableData, ErasureChunk}; use pezkuwi_node_subsystem::{messages::AvailabilityStoreMessage, SubsystemSender}; +use pezkuwi_pez_node_primitives::{AvailableData, ErasureChunk}; use pezkuwi_primitives::{CandidateHash, ValidatorIndex}; use crate::{ diff --git a/pezkuwi/node/network/availability-distribution/src/tests/state.rs b/pezkuwi/node/network/availability-distribution/src/tests/state.rs index c05d78b5..03c529fb 100644 --- a/pezkuwi/node/network/availability-distribution/src/tests/state.rs +++ b/pezkuwi/node/network/availability-distribution/src/tests/state.rs @@ -37,7 +37,6 @@ use pezsp_keystore::KeystorePtr; use pezkuwi_node_network_protocol::request_response::{ v1, v2, IncomingRequest, OutgoingRequest, Protocol, ReqProtocolNames, Requests, }; -use pezkuwi_pez_node_primitives::ErasureChunk; use pezkuwi_node_subsystem::{ messages::{ AllMessages, AvailabilityDistributionMessage, AvailabilityStoreMessage, ChainApiMessage, @@ -46,6 +45,7 @@ use pezkuwi_node_subsystem::{ ActiveLeavesUpdate, FromOrchestra, OverseerSignal, }; use pezkuwi_node_subsystem_test_helpers as test_helpers; +use pezkuwi_pez_node_primitives::ErasureChunk; use pezkuwi_primitives::{ CandidateHash, ChunkIndex, CoreIndex, CoreState, ExecutorParams, GroupIndex, Hash, Id as ParaId, NodeFeatures, ScheduledCore, SessionInfo, ValidatorIndex, diff --git a/pezkuwi/node/network/availability-recovery/src/lib.rs b/pezkuwi/node/network/availability-recovery/src/lib.rs index 941679f9..1273e16a 100644 --- a/pezkuwi/node/network/availability-recovery/src/lib.rs +++ b/pezkuwi/node/network/availability-recovery/src/lib.rs @@ -54,7 +54,6 @@ use pezkuwi_node_network_protocol::{ }, UnifiedReputationChange as Rep, }; -use pezkuwi_pez_node_primitives::AvailableData; use pezkuwi_node_subsystem::{ errors::RecoveryError, messages::{AvailabilityRecoveryMessage, AvailabilityStoreMessage}, @@ -65,6 +64,7 @@ use pezkuwi_node_subsystem_util::{ availability_chunks::availability_chunk_indices, runtime::{ExtendedSessionInfo, RuntimeInfo}, }; +use pezkuwi_pez_node_primitives::AvailableData; use pezkuwi_primitives::{ node_features, BlockNumber, CandidateHash, CandidateReceiptV2 as CandidateReceipt, ChunkIndex, CoreIndex, GroupIndex, Hash, SessionIndex, ValidatorIndex, diff --git a/pezkuwi/node/network/availability-recovery/src/task/mod.rs b/pezkuwi/node/network/availability-recovery/src/task/mod.rs index ce0e141a..6db43730 100644 --- a/pezkuwi/node/network/availability-recovery/src/task/mod.rs +++ b/pezkuwi/node/network/availability-recovery/src/task/mod.rs @@ -31,8 +31,8 @@ pub use self::strategy::{REGULAR_CHUNKS_REQ_RETRY_LIMIT, SYSTEMATIC_CHUNKS_REQ_R use crate::{metrics::Metrics, ErasureTask, PostRecoveryCheck, LOG_TARGET}; use codec::Encode; -use pezkuwi_pez_node_primitives::AvailableData; use pezkuwi_node_subsystem::{messages::AvailabilityStoreMessage, overseer, RecoveryError}; +use pezkuwi_pez_node_primitives::AvailableData; use pezkuwi_primitives::{AuthorityDiscoveryId, CandidateHash, Hash}; use pezsc_network::ProtocolName; diff --git a/pezkuwi/node/network/availability-recovery/src/task/strategy/chunks.rs b/pezkuwi/node/network/availability-recovery/src/task/strategy/chunks.rs index da145a54..47e14471 100644 --- a/pezkuwi/node/network/availability-recovery/src/task/strategy/chunks.rs +++ b/pezkuwi/node/network/availability-recovery/src/task/strategy/chunks.rs @@ -26,8 +26,8 @@ use crate::{ ErasureTask, RecoveryStrategy, LOG_TARGET, }; -use pezkuwi_pez_node_primitives::AvailableData; use pezkuwi_node_subsystem::{overseer, RecoveryError}; +use pezkuwi_pez_node_primitives::AvailableData; use pezkuwi_primitives::ValidatorIndex; use futures::{channel::oneshot, SinkExt}; diff --git a/pezkuwi/node/network/availability-recovery/src/task/strategy/full.rs b/pezkuwi/node/network/availability-recovery/src/task/strategy/full.rs index 5582cca9..fd1f5697 100644 --- a/pezkuwi/node/network/availability-recovery/src/task/strategy/full.rs +++ b/pezkuwi/node/network/availability-recovery/src/task/strategy/full.rs @@ -22,8 +22,8 @@ use crate::{ use pezkuwi_node_network_protocol::request_response::{ self as req_res, outgoing::RequestError, OutgoingRequest, Recipient, Requests, }; -use pezkuwi_pez_node_primitives::AvailableData; use pezkuwi_node_subsystem::{messages::NetworkBridgeTxMessage, overseer, RecoveryError}; +use pezkuwi_pez_node_primitives::AvailableData; use pezkuwi_primitives::ValidatorIndex; use pezsc_network::{IfDisconnected, OutboundFailure, RequestFailure}; diff --git a/pezkuwi/node/network/availability-recovery/src/task/strategy/mod.rs b/pezkuwi/node/network/availability-recovery/src/task/strategy/mod.rs index 48b0a01c..71056203 100644 --- a/pezkuwi/node/network/availability-recovery/src/task/strategy/mod.rs +++ b/pezkuwi/node/network/availability-recovery/src/task/strategy/mod.rs @@ -37,11 +37,11 @@ use pezkuwi_node_network_protocol::request_response::CHUNK_REQUEST_TIMEOUT; use pezkuwi_node_network_protocol::request_response::{ self as req_res, outgoing::RequestError, OutgoingRequest, Recipient, Requests, }; -use pezkuwi_pez_node_primitives::{AvailableData, ErasureChunk}; use pezkuwi_node_subsystem::{ messages::{AvailabilityStoreMessage, NetworkBridgeTxMessage}, overseer, RecoveryError, }; +use pezkuwi_pez_node_primitives::{AvailableData, ErasureChunk}; use pezkuwi_primitives::{AuthorityDiscoveryId, BlakeTwo256, ChunkIndex, HashT, ValidatorIndex}; use pezsc_network::{IfDisconnected, OutboundFailure, ProtocolName, RequestFailure}; use std::{ @@ -645,11 +645,11 @@ mod tests { }; use pezkuwi_erasure_coding::{recovery_threshold, systematic_recovery_threshold}; use pezkuwi_node_network_protocol::request_response::Protocol; - use pezkuwi_pez_node_primitives::{BlockData, PoV}; use pezkuwi_node_subsystem::{AllMessages, TimeoutExt}; use pezkuwi_node_subsystem_test_helpers::{ derive_erasure_chunks_with_proofs_and_root, sender_receiver, TestSubsystemSender, }; + use pezkuwi_pez_node_primitives::{BlockData, PoV}; use pezkuwi_primitives::{CandidateHash, HeadData, PersistedValidationData}; use pezkuwi_primitives_test_helpers::dummy_hash; use pezsp_keyring::Sr25519Keyring; diff --git a/pezkuwi/node/network/availability-recovery/src/task/strategy/systematic.rs b/pezkuwi/node/network/availability-recovery/src/task/strategy/systematic.rs index 8c94809f..c2bcc3ac 100644 --- a/pezkuwi/node/network/availability-recovery/src/task/strategy/systematic.rs +++ b/pezkuwi/node/network/availability-recovery/src/task/strategy/systematic.rs @@ -26,8 +26,8 @@ use crate::{ LOG_TARGET, }; -use pezkuwi_pez_node_primitives::AvailableData; use pezkuwi_node_subsystem::{overseer, RecoveryError}; +use pezkuwi_pez_node_primitives::AvailableData; use pezkuwi_primitives::{ChunkIndex, ValidatorIndex}; use std::collections::VecDeque; diff --git a/pezkuwi/node/network/availability-recovery/src/tests.rs b/pezkuwi/node/network/availability-recovery/src/tests.rs index 116772ca..64ffa390 100644 --- a/pezkuwi/node/network/availability-recovery/src/tests.rs +++ b/pezkuwi/node/network/availability-recovery/src/tests.rs @@ -31,7 +31,6 @@ use pezkuwi_node_network_protocol::request_response::{ IncomingRequest, Protocol, Recipient, ReqProtocolNames, Requests, }; -use pezkuwi_pez_node_primitives::{BlockData, ErasureChunk, PoV, Proof}; use pezkuwi_node_subsystem::messages::{ AllMessages, NetworkBridgeTxMessage, RuntimeApiMessage, RuntimeApiRequest, }; @@ -40,6 +39,7 @@ use pezkuwi_node_subsystem_test_helpers::{ TestSubsystemContextHandle, }; use pezkuwi_node_subsystem_util::TimeoutExt; +use pezkuwi_pez_node_primitives::{BlockData, ErasureChunk, PoV, Proof}; use pezkuwi_primitives::{ node_features, AuthorityDiscoveryId, Block, ExecutorParams, Hash, HeadData, IndexedVec, MutateDescriptorV2, NodeFeatures, PersistedValidationData, SessionInfo, ValidatorId, diff --git a/pezkuwi/node/network/bitfield-distribution/src/tests.rs b/pezkuwi/node/network/bitfield-distribution/src/tests.rs index d1c46f7c..3bd9ae48 100644 --- a/pezkuwi/node/network/bitfield-distribution/src/tests.rs +++ b/pezkuwi/node/network/bitfield-distribution/src/tests.rs @@ -29,12 +29,12 @@ use pezkuwi_node_subsystem::messages::ReportPeerMessage; use pezkuwi_node_subsystem_test_helpers::make_subsystem_context; use pezkuwi_node_subsystem_util::TimeoutExt; use pezkuwi_primitives::{AvailabilityBitfield, Signed, ValidatorIndex}; -use rand_chacha::ChaCha12Rng; use pezsp_application_crypto::AppCrypto; use pezsp_authority_discovery::AuthorityPair as AuthorityDiscoveryPair; use pezsp_core::Pair as PairT; use pezsp_keyring::Sr25519Keyring; use pezsp_keystore::{testing::MemoryKeystore, Keystore, KeystorePtr}; +use rand_chacha::ChaCha12Rng; use std::{sync::Arc, time::Duration}; diff --git a/pezkuwi/node/network/collator-protocol/src/collator_side/error.rs b/pezkuwi/node/network/collator-protocol/src/collator_side/error.rs index 17103778..bdde6198 100644 --- a/pezkuwi/node/network/collator-protocol/src/collator_side/error.rs +++ b/pezkuwi/node/network/collator-protocol/src/collator_side/error.rs @@ -15,9 +15,9 @@ // along with Pezkuwi. If not, see . use pezkuwi_node_network_protocol::request_response::incoming; -use pezkuwi_pez_node_primitives::UncheckedSignedFullStatement; use pezkuwi_node_subsystem::{errors::SubsystemError, RuntimeApiError}; use pezkuwi_node_subsystem_util::{backing_implicit_view, runtime}; +use pezkuwi_pez_node_primitives::UncheckedSignedFullStatement; use crate::LOG_TARGET; diff --git a/pezkuwi/node/network/collator-protocol/src/collator_side/mod.rs b/pezkuwi/node/network/collator-protocol/src/collator_side/mod.rs index f5801727..0a7376f8 100644 --- a/pezkuwi/node/network/collator-protocol/src/collator_side/mod.rs +++ b/pezkuwi/node/network/collator-protocol/src/collator_side/mod.rs @@ -24,8 +24,8 @@ use futures::{ channel::oneshot, future::Fuse, pin_mut, select, stream::FuturesUnordered, FutureExt, StreamExt, }; use metrics::{CollationStats, CollationTracker}; -use schnellru::{ByLength, LruMap}; use pezsp_core::Pair; +use schnellru::{ByLength, LruMap}; use pezkuwi_node_network_protocol::{ self as net_protocol, @@ -37,7 +37,6 @@ use pezkuwi_node_network_protocol::{ v1 as protocol_v1, v2 as protocol_v2, CollationProtocols, OurView, PeerId, UnifiedReputationChange as Rep, View, }; -use pezkuwi_pez_node_primitives::{CollationSecondedSignal, PoV, Statement}; use pezkuwi_node_subsystem::{ messages::{ ChainApiMessage, CollatorProtocolMessage, NetworkBridgeEvent, NetworkBridgeTxMessage, @@ -53,6 +52,7 @@ use pezkuwi_node_subsystem_util::{ }, TimeoutExt, }; +use pezkuwi_pez_node_primitives::{CollationSecondedSignal, PoV, Statement}; use pezkuwi_primitives::{ AuthorityDiscoveryId, BlockNumber, CandidateEvent, CandidateHash, CandidateReceiptV2 as CandidateReceipt, CollatorPair, CoreIndex, Hash, HeadData, Id as ParaId, diff --git a/pezkuwi/node/network/collator-protocol/src/collator_side/tests/mod.rs b/pezkuwi/node/network/collator-protocol/src/collator_side/tests/mod.rs index 9d6c4493..b9d5284a 100644 --- a/pezkuwi/node/network/collator-protocol/src/collator_side/tests/mod.rs +++ b/pezkuwi/node/network/collator-protocol/src/collator_side/tests/mod.rs @@ -41,13 +41,13 @@ use pezkuwi_node_network_protocol::{ }, view, ObservedRole, }; -use pezkuwi_pez_node_primitives::BlockData; use pezkuwi_node_subsystem::{ messages::{AllMessages, ReportPeerMessage, RuntimeApiMessage, RuntimeApiRequest}, ActivatedLeaf, ActiveLeavesUpdate, }; use pezkuwi_node_subsystem_test_helpers as test_helpers; use pezkuwi_node_subsystem_util::{reputation::add_reputation, TimeoutExt}; +use pezkuwi_pez_node_primitives::BlockData; use pezkuwi_primitives::{ AuthorityDiscoveryId, Block, CollatorPair, ExecutorParams, GroupIndex, GroupRotationInfo, IndexedVec, NodeFeatures, SessionIndex, SessionInfo, ValidatorId, ValidatorIndex, diff --git a/pezkuwi/node/network/collator-protocol/src/validator_side/collation.rs b/pezkuwi/node/network/collator-protocol/src/validator_side/collation.rs index 1537c9d4..fe422fbe 100644 --- a/pezkuwi/node/network/collator-protocol/src/validator_side/collation.rs +++ b/pezkuwi/node/network/collator-protocol/src/validator_side/collation.rs @@ -47,8 +47,8 @@ use pezkuwi_node_network_protocol::{ request_response::{outgoing::RequestError, v1 as request_v1, OutgoingResult}, PeerId, }; -use pezkuwi_pez_node_primitives::PoV; use pezkuwi_node_subsystem_util::metrics::prometheus::prometheus::HistogramTimer; +use pezkuwi_pez_node_primitives::PoV; use pezkuwi_primitives::{ CandidateHash, CandidateReceiptV2 as CandidateReceipt, CollatorId, Hash, HeadData, Id as ParaId, PersistedValidationData, diff --git a/pezkuwi/node/network/collator-protocol/src/validator_side/mod.rs b/pezkuwi/node/network/collator-protocol/src/validator_side/mod.rs index 7cd6fb55..b4fa8347 100644 --- a/pezkuwi/node/network/collator-protocol/src/validator_side/mod.rs +++ b/pezkuwi/node/network/collator-protocol/src/validator_side/mod.rs @@ -37,7 +37,6 @@ use pezkuwi_node_network_protocol::{ v1 as protocol_v1, v2 as protocol_v2, CollationProtocols, OurView, PeerId, UnifiedReputationChange as Rep, View, }; -use pezkuwi_pez_node_primitives::{SignedFullStatement, Statement}; use pezkuwi_node_subsystem::{ messages::{ CanSecondRequest, CandidateBackingMessage, CollatorProtocolMessage, IfDisconnected, @@ -51,6 +50,7 @@ use pezkuwi_node_subsystem_util::{ reputation::{ReputationAggregator, REPUTATION_CHANGE_INTERVAL}, request_claim_queue, request_node_features, request_session_index_for_child, }; +use pezkuwi_pez_node_primitives::{SignedFullStatement, Statement}; use pezkuwi_primitives::{ node_features, CandidateDescriptorV2, CandidateDescriptorVersion, CandidateHash, CollatorId, CoreIndex, Hash, HeadData, Id as ParaId, OccupiedCoreAssumption, PersistedValidationData, @@ -874,9 +874,9 @@ async fn process_incoming_peer_message( protocol_v2::CollatorProtocolMessage, >, ) { + use pezsp_runtime::traits::AppVerify; use protocol_v1::CollatorProtocolMessage as V1; use protocol_v2::CollatorProtocolMessage as V2; - use pezsp_runtime::traits::AppVerify; match msg { CollationProtocols::V1(V1::Declare(collator_id, para_id, signature)) | diff --git a/pezkuwi/node/network/collator-protocol/src/validator_side/tests/mod.rs b/pezkuwi/node/network/collator-protocol/src/validator_side/tests/mod.rs index a63d9a78..f90cd3b2 100644 --- a/pezkuwi/node/network/collator-protocol/src/validator_side/tests/mod.rs +++ b/pezkuwi/node/network/collator-protocol/src/validator_side/tests/mod.rs @@ -34,12 +34,12 @@ use pezkuwi_node_network_protocol::{ request_response::{Requests, ResponseSender}, ObservedRole, }; -use pezkuwi_pez_node_primitives::{BlockData, PoV}; use pezkuwi_node_subsystem::messages::{ AllMessages, ReportPeerMessage, RuntimeApiMessage, RuntimeApiRequest, }; use pezkuwi_node_subsystem_test_helpers as test_helpers; use pezkuwi_node_subsystem_util::{reputation::add_reputation, TimeoutExt}; +use pezkuwi_pez_node_primitives::{BlockData, PoV}; use pezkuwi_primitives::{ node_features, CandidateReceiptV2 as CandidateReceipt, CollatorPair, CoreIndex, GroupRotationInfo, HeadData, NodeFeatures, PersistedValidationData, ValidatorId, diff --git a/pezkuwi/node/network/dispute-distribution/src/lib.rs b/pezkuwi/node/network/dispute-distribution/src/lib.rs index 1457c4b8..9af53be3 100644 --- a/pezkuwi/node/network/dispute-distribution/src/lib.rs +++ b/pezkuwi/node/network/dispute-distribution/src/lib.rs @@ -33,12 +33,12 @@ use pezkuwi_node_subsystem_util::nesting_sender::NestingSender; use pezsp_keystore::KeystorePtr; use pezkuwi_node_network_protocol::request_response::{incoming::IncomingRequestReceiver, v1}; -use pezkuwi_pez_node_primitives::DISPUTE_WINDOW; use pezkuwi_node_subsystem::{ messages::DisputeDistributionMessage, overseer, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError, }; use pezkuwi_node_subsystem_util::{runtime, runtime::RuntimeInfo}; +use pezkuwi_pez_node_primitives::DISPUTE_WINDOW; /// ## The sender [`DisputeSender`] /// diff --git a/pezkuwi/node/network/dispute-distribution/src/receiver/mod.rs b/pezkuwi/node/network/dispute-distribution/src/receiver/mod.rs index 84336b82..ca08d62c 100644 --- a/pezkuwi/node/network/dispute-distribution/src/receiver/mod.rs +++ b/pezkuwi/node/network/dispute-distribution/src/receiver/mod.rs @@ -38,12 +38,12 @@ use pezkuwi_node_network_protocol::{ }, PeerId, UnifiedReputationChange as Rep, }; -use pezkuwi_pez_node_primitives::DISPUTE_WINDOW; use pezkuwi_node_subsystem::{ messages::{DisputeCoordinatorMessage, ImportStatementsResult}, overseer, }; use pezkuwi_node_subsystem_util::{runtime, runtime::RuntimeInfo}; +use pezkuwi_pez_node_primitives::DISPUTE_WINDOW; use crate::{ metrics::{FAILED, SUCCEEDED}, diff --git a/pezkuwi/node/network/dispute-distribution/src/sender/error.rs b/pezkuwi/node/network/dispute-distribution/src/sender/error.rs index c0ea4de3..0829117f 100644 --- a/pezkuwi/node/network/dispute-distribution/src/sender/error.rs +++ b/pezkuwi/node/network/dispute-distribution/src/sender/error.rs @@ -17,9 +17,9 @@ //! Error handling related code and Error/Result definitions. -use pezkuwi_pez_node_primitives::disputes::DisputeMessageCheckError; use pezkuwi_node_subsystem::SubsystemError; use pezkuwi_node_subsystem_util::runtime; +use pezkuwi_pez_node_primitives::disputes::DisputeMessageCheckError; #[allow(missing_docs)] #[fatality::fatality(splitable)] diff --git a/pezkuwi/node/network/dispute-distribution/src/sender/mod.rs b/pezkuwi/node/network/dispute-distribution/src/sender/mod.rs index 57db520d..a1c8b27e 100644 --- a/pezkuwi/node/network/dispute-distribution/src/sender/mod.rs +++ b/pezkuwi/node/network/dispute-distribution/src/sender/mod.rs @@ -26,11 +26,11 @@ use futures::{channel::oneshot, future::poll_fn, Future}; use futures_timer::Delay; use indexmap::{map::Entry, IndexMap}; use pezkuwi_node_network_protocol::request_response::v1::DisputeRequest; -use pezkuwi_pez_node_primitives::{DisputeMessage, DisputeStatus}; use pezkuwi_node_subsystem::{ messages::DisputeCoordinatorMessage, overseer, ActiveLeavesUpdate, SubsystemSender, }; use pezkuwi_node_subsystem_util::{nesting_sender::NestingSender, runtime::RuntimeInfo}; +use pezkuwi_pez_node_primitives::{DisputeMessage, DisputeStatus}; use pezkuwi_primitives::{CandidateHash, Hash, SessionIndex}; /// For each ongoing dispute we have a `SendTask` which takes care of it. diff --git a/pezkuwi/node/network/dispute-distribution/src/tests/mod.rs b/pezkuwi/node/network/dispute-distribution/src/tests/mod.rs index 6dab0d7d..1a687f9f 100644 --- a/pezkuwi/node/network/dispute-distribution/src/tests/mod.rs +++ b/pezkuwi/node/network/dispute-distribution/src/tests/mod.rs @@ -44,7 +44,6 @@ use pezkuwi_node_network_protocol::{ request_response::{v1::DisputeResponse, Recipient, Requests}, IfDisconnected, }; -use pezkuwi_pez_node_primitives::DisputeStatus; use pezkuwi_node_subsystem::{ messages::{ AllMessages, DisputeCoordinatorMessage, DisputeDistributionMessage, ImportStatementsResult, @@ -56,6 +55,7 @@ use pezkuwi_node_subsystem_test_helpers::{ mock::{make_ferdie_keystore, new_leaf}, subsystem_test_harness, TestSubsystemContextHandle, }; +use pezkuwi_pez_node_primitives::DisputeStatus; use pezkuwi_primitives::{ AuthorityDiscoveryId, Block, CandidateHash, CandidateReceiptV2 as CandidateReceipt, ExecutorParams, Hash, NodeFeatures, SessionIndex, SessionInfo, @@ -591,8 +591,11 @@ async fn send_network_dispute_request( message: DisputeRequest, ) -> oneshot::Receiver { let (pending_response, rx_response) = oneshot::channel(); - let req = - pezsc_network::config::IncomingRequest { peer, payload: message.encode(), pending_response }; + let req = pezsc_network::config::IncomingRequest { + peer, + payload: message.encode(), + pending_response, + }; req_tx.send(req).await.unwrap(); rx_response } diff --git a/pezkuwi/node/network/statement-distribution/src/v2/mod.rs b/pezkuwi/node/network/statement-distribution/src/v2/mod.rs index 06859af9..5efcfeb8 100644 --- a/pezkuwi/node/network/statement-distribution/src/v2/mod.rs +++ b/pezkuwi/node/network/statement-distribution/src/v2/mod.rs @@ -31,9 +31,6 @@ use pezkuwi_node_network_protocol::{ v3::{self as protocol_v3, StatementFilter}, IfDisconnected, PeerId, UnifiedReputationChange as Rep, ValidationProtocols, View, }; -use pezkuwi_pez_node_primitives::{ - SignedFullStatementWithPVD, StatementWithPVD as FullStatementWithPVD, -}; use pezkuwi_node_subsystem::{ messages::{ network_bridge_event::NewGossipTopology, CandidateBackingMessage, HypotheticalCandidate, @@ -46,6 +43,9 @@ use pezkuwi_node_subsystem_util::{ backing_implicit_view::View as ImplicitView, reputation::ReputationAggregator, request_min_backing_votes, request_node_features, runtime::ClaimQueueSnapshot, }; +use pezkuwi_pez_node_primitives::{ + SignedFullStatementWithPVD, StatementWithPVD as FullStatementWithPVD, +}; use pezkuwi_primitives::{ node_features::FeatureIndex, transpose_claim_queue, AuthorityDiscoveryId, CandidateDescriptorVersion, CandidateHash, CompactStatement, CoreIndex, GroupIndex, diff --git a/pezkuwi/node/network/statement-distribution/src/v2/tests/mod.rs b/pezkuwi/node/network/statement-distribution/src/v2/tests/mod.rs index e52c31dd..eb7a9826 100644 --- a/pezkuwi/node/network/statement-distribution/src/v2/tests/mod.rs +++ b/pezkuwi/node/network/statement-distribution/src/v2/tests/mod.rs @@ -24,7 +24,6 @@ use pezkuwi_node_network_protocol::{ v3::{BackedCandidateAcknowledgement, BackedCandidateManifest}, view, ObservedRole, }; -use pezkuwi_pez_node_primitives::{Statement, StatementWithPVD}; use pezkuwi_node_subsystem::messages::{ network_bridge_event::NewGossipTopology, AllMessages, ChainApiMessage, HypotheticalCandidate, HypotheticalMembership, NetworkBridgeEvent, ProspectiveTeyrchainsMessage, ReportPeerMessage, @@ -32,6 +31,7 @@ use pezkuwi_node_subsystem::messages::{ }; use pezkuwi_node_subsystem_test_helpers as test_helpers; use pezkuwi_node_subsystem_util::TimeoutExt; +use pezkuwi_pez_node_primitives::{Statement, StatementWithPVD}; use pezkuwi_primitives::{ AssignmentPair, Block, BlockNumber, CommittedCandidateReceiptV2 as CommittedCandidateReceipt, GroupRotationInfo, HeadData, Header, IndexedVec, NodeFeatures, PersistedValidationData, diff --git a/pezkuwi/node/overseer/examples/minimal-example.rs b/pezkuwi/node/overseer/examples/minimal-example.rs index 891e8c07..b3bc9b52 100644 --- a/pezkuwi/node/overseer/examples/minimal-example.rs +++ b/pezkuwi/node/overseer/examples/minimal-example.rs @@ -23,7 +23,6 @@ use futures_timer::Delay; use orchestra::async_trait; use std::time::Duration; -use pezkuwi_pez_node_primitives::{BlockData, PoV}; use pezkuwi_node_subsystem_types::messages::{CandidateValidationMessage, PvfExecKind}; use pezkuwi_overseer::{ self as overseer, @@ -31,6 +30,7 @@ use pezkuwi_overseer::{ gen::{FromOrchestra, SpawnedSubsystem}, HeadSupportsTeyrchains, SubsystemError, }; +use pezkuwi_pez_node_primitives::{BlockData, PoV}; use pezkuwi_primitives::{CandidateReceiptV2 as CandidateReceipt, Hash, PersistedValidationData}; use pezkuwi_primitives_test_helpers::{ dummy_candidate_descriptor_v2, dummy_hash, dummy_validation_code, diff --git a/pezkuwi/node/overseer/src/tests.rs b/pezkuwi/node/overseer/src/tests.rs index 0a567bf3..c4ab1763 100644 --- a/pezkuwi/node/overseer/src/tests.rs +++ b/pezkuwi/node/overseer/src/tests.rs @@ -21,14 +21,14 @@ use std::{collections::HashMap, sync::atomic, task::Poll}; use pezkuwi_node_network_protocol::{ peer_set::ValidationVersion, ObservedRole, PeerId, UnifiedReputationChange, }; -use pezkuwi_pez_node_primitives::{ - BlockData, CollationGenerationConfig, CollationResult, DisputeMessage, InvalidDisputeVote, PoV, - UncheckedDisputeMessage, ValidDisputeVote, -}; use pezkuwi_node_subsystem_test_helpers::mock::{dummy_unpin_handle, new_leaf}; use pezkuwi_node_subsystem_types::messages::{ NetworkBridgeEvent, PvfExecKind, ReportPeerMessage, RuntimeApiRequest, }; +use pezkuwi_pez_node_primitives::{ + BlockData, CollationGenerationConfig, CollationResult, DisputeMessage, InvalidDisputeVote, PoV, + UncheckedDisputeMessage, ValidDisputeVote, +}; use pezkuwi_primitives::{ CandidateHash, CandidateReceiptV2, CollatorPair, Id as ParaId, InvalidDisputeStatementKind, PersistedValidationData, SessionIndex, ValidDisputeStatementKind, ValidatorIndex, diff --git a/pezkuwi/node/service/src/benchmarking.rs b/pezkuwi/node/service/src/benchmarking.rs index d5700c63..44d70657 100644 --- a/pezkuwi/node/service/src/benchmarking.rs +++ b/pezkuwi/node/service/src/benchmarking.rs @@ -155,10 +155,9 @@ fn zagros_sign_call( pezframe_system::CheckSpecVersion::::new(), pezframe_system::CheckTxVersion::::new(), pezframe_system::CheckGenesis::::new(), - pezframe_system::CheckMortality::::from(pezsp_runtime::generic::Era::mortal( - period, - current_block, - )), + pezframe_system::CheckMortality::::from( + pezsp_runtime::generic::Era::mortal(period, current_block), + ), pezframe_system::CheckNonce::::from(nonce), pezframe_system::CheckWeight::::new(), pezpallet_transaction_payment::ChargeTransactionPayment::::from(0), @@ -214,10 +213,9 @@ fn pezkuwichain_sign_call( pezframe_system::CheckSpecVersion::::new(), pezframe_system::CheckTxVersion::::new(), pezframe_system::CheckGenesis::::new(), - pezframe_system::CheckMortality::::from(pezsp_runtime::generic::Era::mortal( - period, - current_block, - )), + pezframe_system::CheckMortality::::from( + pezsp_runtime::generic::Era::mortal(period, current_block), + ), pezframe_system::CheckNonce::::from(nonce), pezframe_system::CheckWeight::::new(), pezpallet_transaction_payment::ChargeTransactionPayment::::from(0), diff --git a/pezkuwi/node/service/src/builder/mod.rs b/pezkuwi/node/service/src/builder/mod.rs index b2dc3726..e55b68c3 100644 --- a/pezkuwi/node/service/src/builder/mod.rs +++ b/pezkuwi/node/service/src/builder/mod.rs @@ -29,9 +29,8 @@ use crate::{ teyrchains_db, workers, Chain, Error, FullBackend, FullClient, IdentifyVariant, IsTeyrchainNode, GRANDPA_JUSTIFICATION_PERIOD, KEEP_FINALIZED_FOR_LIVE_NETWORKS, }; -use pezframe_benchmarking_cli::BIZINIKIWI_REFERENCE_HARDWARE; use gum::info; -use pezmmr_gadget::MmrGadget; +use pezframe_benchmarking_cli::BIZINIKIWI_REFERENCE_HARDWARE; use pezkuwi_availability_recovery::FETCH_CHUNKS_THRESHOLD; use pezkuwi_node_core_approval_voting::Config as ApprovalVotingConfig; use pezkuwi_node_core_av_store::Config as AvailabilityConfig; @@ -47,6 +46,7 @@ use pezkuwi_node_network_protocol::{ use pezkuwi_node_subsystem_types::DefaultSubsystemClient; use pezkuwi_overseer::{Handle, OverseerConnector}; use pezkuwi_primitives::Block; +use pezmmr_gadget::MmrGadget; use pezsc_client_api::Backend; use pezsc_network::config::FullNetworkConfiguration; use pezsc_network_sync::WarpSyncConfig; @@ -237,7 +237,8 @@ where // the block authoring backoff is disabled by default on production networks None } else { - let mut backoff = pezsc_consensus_slots::BackoffAuthoringOnFinalizedHeadLagging::default(); + let mut backoff = + pezsc_consensus_slots::BackoffAuthoringOnFinalizedHeadLagging::default(); if config.chain_spec.is_pezkuwichain() || config.chain_spec.is_versi() || diff --git a/pezkuwi/node/service/src/builder/partial.rs b/pezkuwi/node/service/src/builder/partial.rs index e38aa74d..e3d8db89 100644 --- a/pezkuwi/node/service/src/builder/partial.rs +++ b/pezkuwi/node/service/src/builder/partial.rs @@ -25,7 +25,9 @@ use crate::{ use pezkuwi_primitives::Block; use pezsc_consensus_grandpa::FinalityProofProvider as GrandpaFinalityProofProvider; use pezsc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; -use pezsc_service::{Configuration, Error as BizinikiwiServiceError, KeystoreContainer, TaskManager}; +use pezsc_service::{ + Configuration, Error as BizinikiwiServiceError, KeystoreContainer, TaskManager, +}; use pezsc_telemetry::{Telemetry, TelemetryWorker, TelemetryWorkerHandle}; use pezsc_transaction_pool_api::OffchainTransactionPoolFactory; use pezsp_consensus::SelectChain; diff --git a/pezkuwi/node/service/src/fake_runtime_api.rs b/pezkuwi/node/service/src/fake_runtime_api.rs index 17200345..38b8574f 100644 --- a/pezkuwi/node/service/src/fake_runtime_api.rs +++ b/pezkuwi/node/service/src/fake_runtime_api.rs @@ -19,7 +19,6 @@ //! These are used to provide a type that implements these runtime APIs without requiring to import //! the native runtimes. -use pezpallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use pezkuwi_primitives::{ runtime_api, slashing, AccountId, AuthorityDiscoveryId, Balance, Block, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash, @@ -29,6 +28,7 @@ use pezkuwi_primitives::{ ScrapedOnChainVotes, SessionIndex, SessionInfo, ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature, }; +use pezpallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use pezsp_consensus_beefy::ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature}; use pezsp_consensus_grandpa::AuthorityId as GrandpaId; diff --git a/pezkuwi/node/service/src/lib.rs b/pezkuwi/node/service/src/lib.rs index fc2bbdfc..ac18deec 100644 --- a/pezkuwi/node/service/src/lib.rs +++ b/pezkuwi/node/service/src/lib.rs @@ -61,17 +61,17 @@ use pezkuwi_overseer::SpawnGlue; pub use { pezkuwi_overseer::{Handle, Overseer, OverseerConnector, OverseerHandle}, pezkuwi_primitives::runtime_api::TeyrchainHost, - relay_chain_selection::SelectRelayChain, pezsc_client_api::AuxStore, pezsp_authority_discovery::AuthorityDiscoveryApi, pezsp_blockchain::{HeaderBackend, HeaderMetadata}, pezsp_consensus_babe::BabeApi, + relay_chain_selection::SelectRelayChain, }; use std::{path::PathBuf, sync::Arc}; -use prometheus_endpoint::Registry; use pezsc_service::SpawnTaskHandle; +use prometheus_endpoint::Registry; pub use chain_spec::{GenericChainSpec, PezkuwichainChainSpec, ZagrosChainSpec}; pub use pezkuwi_primitives::{Block, BlockId, BlockNumber, CollatorPair, Hash, Id as ParaId}; @@ -105,7 +105,10 @@ pub type FullBackend = pezsc_service::TFullBackend; pub type FullClient = pezsc_service::TFullClient< Block, RuntimeApi, - WasmExecutor<(pezsp_io::BizinikiwiHostFunctions, pezframe_benchmarking::benchmarking::HostFunctions)>, + WasmExecutor<( + pezsp_io::BizinikiwiHostFunctions, + pezframe_benchmarking::benchmarking::HostFunctions, + )>, >; /// The minimum period of blocks on which justifications will be @@ -399,8 +402,9 @@ macro_rules! chain_ops { // use the longest chain selection, since there is no overseer available let chain_selection = LongestChain::new(basics.backend.clone()); - let pezsc_service::PartialComponents { client, backend, import_queue, task_manager, .. } = - new_partial::>(&mut config, basics, chain_selection)?; + let pezsc_service::PartialComponents { + client, backend, import_queue, task_manager, .. + } = new_partial::>(&mut config, basics, chain_selection)?; Ok((client, backend, import_queue, task_manager)) }}; } @@ -409,8 +413,10 @@ macro_rules! chain_ops { #[cfg(feature = "full-node")] pub fn new_chain_ops( config: &mut Configuration, -) -> Result<(Arc, Arc, pezsc_consensus::BasicQueue, TaskManager), Error> -{ +) -> Result< + (Arc, Arc, pezsc_consensus::BasicQueue, TaskManager), + Error, +> { config.keystore = pezsc_service::config::KeystoreConfig::InMemory; if config.chain_spec.is_pezkuwichain() || config.chain_spec.is_versi() { diff --git a/pezkuwi/node/service/src/relay_chain_selection.rs b/pezkuwi/node/service/src/relay_chain_selection.rs index 90d320a1..155eaf4a 100644 --- a/pezkuwi/node/service/src/relay_chain_selection.rs +++ b/pezkuwi/node/service/src/relay_chain_selection.rs @@ -37,13 +37,13 @@ use super::{HeaderProvider, HeaderProviderProvider}; use futures::channel::oneshot; -use pezkuwi_pez_node_primitives::MAX_FINALITY_LAG as PRIMITIVES_MAX_FINALITY_LAG; use pezkuwi_node_subsystem::messages::{ ApprovalVotingParallelMessage, ChainSelectionMessage, DisputeCoordinatorMessage, HighestApprovedAncestorBlock, }; use pezkuwi_node_subsystem_util::metrics::{self, prometheus}; use pezkuwi_overseer::{AllMessages, Handle, PriorityLevel}; +use pezkuwi_pez_node_primitives::MAX_FINALITY_LAG as PRIMITIVES_MAX_FINALITY_LAG; use pezkuwi_primitives::{Block as PezkuwiBlock, BlockNumber, Hash, Header as PezkuwiHeader}; use pezsp_consensus::{Error as ConsensusError, SelectChain}; use std::sync::Arc; diff --git a/pezkuwi/node/service/src/tests.rs b/pezkuwi/node/service/src/tests.rs index 2a19e2d9..c55ba3e6 100644 --- a/pezkuwi/node/service/src/tests.rs +++ b/pezkuwi/node/service/src/tests.rs @@ -17,10 +17,10 @@ use super::{relay_chain_selection::*, *}; use futures::channel::oneshot::Receiver; -use pezkuwi_pez_node_primitives::approval::v2::VrfSignature; use pezkuwi_node_subsystem::messages::{AllMessages, BlockDescription}; use pezkuwi_node_subsystem_util::TimeoutExt; use pezkuwi_overseer::{HighPriority, PriorityLevel}; +use pezkuwi_pez_node_primitives::approval::v2::VrfSignature; use pezkuwi_test_client::Sr25519Keyring; use pezsp_consensus_babe::{ digests::{CompatibleDigestItem, PreDigest, SecondaryVRFPreDigest}, diff --git a/pezkuwi/node/subsystem-bench/src/lib/approval/helpers.rs b/pezkuwi/node/subsystem-bench/src/lib/approval/helpers.rs index df66c1f2..8b7035a5 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/approval/helpers.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/approval/helpers.rs @@ -20,7 +20,6 @@ use pezkuwi_node_network_protocol::{ grid_topology::{SessionGridTopology, TopologyPeerInfo}, View, }; -use pezkuwi_pez_node_primitives::approval::time::{Clock, SystemClock, Tick}; use pezkuwi_node_subsystem::messages::{ ApprovalDistributionMessage, ApprovalVotingParallelMessage, }; @@ -28,13 +27,12 @@ use pezkuwi_node_subsystem_types::messages::{ network_bridge_event::NewGossipTopology, NetworkBridgeEvent, }; use pezkuwi_overseer::AllMessages; +use pezkuwi_pez_node_primitives::approval::time::{Clock, SystemClock, Tick}; use pezkuwi_primitives::{ BlockNumber, CandidateEvent, CandidateReceiptV2, CoreIndex, GroupIndex, Hash, Header, Id as ParaId, MutateDescriptorV2, Slot, ValidatorIndex, }; use pezkuwi_primitives_test_helpers::dummy_candidate_receipt_v2_bad_sig; -use rand::{seq::SliceRandom, SeedableRng}; -use rand_chacha::ChaCha20Rng; use pezsc_network_types::PeerId; use pezsp_consensus_babe::{ digests::{CompatibleDigestItem, PreDigest, SecondaryVRFPreDigest}, @@ -43,6 +41,8 @@ use pezsp_consensus_babe::{ use pezsp_core::crypto::VrfSecret; use pezsp_keyring::sr25519::Keyring as Sr25519Keyring; use pezsp_runtime::{Digest, DigestItem}; +use rand::{seq::SliceRandom, SeedableRng}; +use rand_chacha::ChaCha20Rng; use std::sync::{atomic::AtomicU64, Arc}; /// A fake system clock used for driving the approval voting and make diff --git a/pezkuwi/node/subsystem-bench/src/lib/approval/message_generator.rs b/pezkuwi/node/subsystem-bench/src/lib/approval/message_generator.rs index 3e1d1ddf..b010e9c1 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/approval/message_generator.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/approval/message_generator.rs @@ -43,17 +43,17 @@ use pezkuwi_primitives::{ ApprovalVoteMultipleCandidates, CandidateEvent, CandidateHash, CandidateIndex, CoreIndex, Hash, SessionInfo, Slot, ValidatorId, ValidatorIndex, ASSIGNMENT_KEY_TYPE_ID, }; -use rand::{seq::SliceRandom, RngCore, SeedableRng}; -use rand_chacha::ChaCha20Rng; -use rand_distr::{Distribution, Normal}; use pezsc_keystore::LocalKeystore; use pezsc_network_types::PeerId; use pezsc_service::SpawnTaskHandle; -use sha1::Digest; use pezsp_application_crypto::AppCrypto; use pezsp_consensus_babe::SlotDuration; use pezsp_keystore::Keystore; use pezsp_timestamp::Timestamp; +use rand::{seq::SliceRandom, RngCore, SeedableRng}; +use rand_chacha::ChaCha20Rng; +use rand_distr::{Distribution, Normal}; +use sha1::Digest; use std::{ cmp::max, collections::{BTreeMap, HashSet}, diff --git a/pezkuwi/node/subsystem-bench/src/lib/approval/mock_chain_selection.rs b/pezkuwi/node/subsystem-bench/src/lib/approval/mock_chain_selection.rs index b08130e0..ed667b85 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/approval/mock_chain_selection.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/approval/mock_chain_selection.rs @@ -16,9 +16,11 @@ use crate::approval::{ApprovalTestState, PastSystemClock, LOG_TARGET, SLOT_DURATION_MILLIS}; use futures::FutureExt; -use pezkuwi_pez_node_primitives::approval::time::{slot_number_to_tick, Clock, TICK_DURATION_MILLIS}; use pezkuwi_node_subsystem::{overseer, SpawnedSubsystem, SubsystemError}; use pezkuwi_node_subsystem_types::messages::ChainSelectionMessage; +use pezkuwi_pez_node_primitives::approval::time::{ + slot_number_to_tick, Clock, TICK_DURATION_MILLIS, +}; /// Mock ChainSelection subsystem used to answer request made by the approval-voting subsystem, /// during benchmark. All the necessary information to answer the requests is stored in the `state` diff --git a/pezkuwi/node/subsystem-bench/src/lib/approval/mod.rs b/pezkuwi/node/subsystem-bench/src/lib/approval/mod.rs index 5faeb3b3..4a9f5589 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/approval/mod.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/approval/mod.rs @@ -58,25 +58,25 @@ use pezkuwi_node_core_approval_voting::{ ApprovalVotingSubsystem, Config as ApprovalVotingConfig, RealAssignmentCriteria, }; use pezkuwi_node_network_protocol::v3 as protocol_v3; -use pezkuwi_pez_node_primitives::approval::{self, v1::RelayVRFStory}; use pezkuwi_node_subsystem::{ messages::{ApprovalDistributionMessage, ApprovalVotingMessage, ApprovalVotingParallelMessage}, overseer, AllMessages, Overseer, OverseerConnector, SpawnGlue, }; use pezkuwi_node_subsystem_test_helpers::mock::new_block_import_info; use pezkuwi_overseer::Handle as OverseerHandleReal; +use pezkuwi_pez_node_primitives::approval::{self, v1::RelayVRFStory}; use pezkuwi_primitives::{ BlockNumber, CandidateEvent, CandidateIndex, CandidateReceiptV2 as CandidateReceipt, Hash, Header, Slot, ValidatorId, ValidatorIndex, ASSIGNMENT_KEY_TYPE_ID, }; -use prometheus::Registry; use pezsc_keystore::LocalKeystore; use pezsc_service::SpawnTaskHandle; -use serde::{Deserialize, Serialize}; use pezsp_application_crypto::AppCrypto; use pezsp_consensus_babe::Epoch as BabeEpoch; use pezsp_core::H256; use pezsp_keystore::Keystore; +use prometheus::Registry; +use serde::{Deserialize, Serialize}; use std::{ cmp::max, collections::{HashMap, HashSet}, diff --git a/pezkuwi/node/subsystem-bench/src/lib/availability/test_state.rs b/pezkuwi/node/subsystem-bench/src/lib/availability/test_state.rs index 69e1d000..c151be04 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/availability/test_state.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/availability/test_state.rs @@ -27,12 +27,12 @@ use pezkuwi_node_network_protocol::{ request_response::{v2::ChunkFetchingRequest, ReqProtocolNames}, ValidationProtocols, VersionedValidationProtocol, }; -use pezkuwi_pez_node_primitives::{AvailableData, BlockData, ErasureChunk, PoV}; use pezkuwi_node_subsystem_test_helpers::{ derive_erasure_chunks_with_proofs_and_root, mock::new_block_import_info, }; use pezkuwi_node_subsystem_util::availability_chunks::availability_chunk_indices; use pezkuwi_overseer::BlockInfo; +use pezkuwi_pez_node_primitives::{AvailableData, BlockData, ErasureChunk, PoV}; use pezkuwi_primitives::{ AvailabilityBitfield, BlockNumber, CandidateHash, CandidateReceiptV2 as CandidateReceipt, ChunkIndex, CoreIndex, Hash, HeadData, Header, PersistedValidationData, Signed, SigningContext, diff --git a/pezkuwi/node/subsystem-bench/src/lib/configuration.rs b/pezkuwi/node/subsystem-bench/src/lib/configuration.rs index 123a2671..3ea9f561 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/configuration.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/configuration.rs @@ -20,13 +20,13 @@ use crate::keyring::Keyring; use itertools::Itertools; use pezkuwi_node_network_protocol::authority_discovery::AuthorityDiscovery; use pezkuwi_primitives::{AssignmentId, AuthorityDiscoveryId, ValidatorId, ValidatorPair}; -use rand::thread_rng; -use rand_distr::{Distribution, Normal, Uniform}; use pezsc_network::Multiaddr; use pezsc_network_types::PeerId; -use serde::{Deserialize, Serialize}; use pezsp_consensus_babe::AuthorityId; use pezsp_core::Pair; +use rand::thread_rng; +use rand_distr::{Distribution, Normal, Uniform}; +use serde::{Deserialize, Serialize}; use std::collections::{HashMap, HashSet}; /// Peer networking latency configuration. diff --git a/pezkuwi/node/subsystem-bench/src/lib/disputes/mod.rs b/pezkuwi/node/subsystem-bench/src/lib/disputes/mod.rs index ad41a27d..fca8eaca 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/disputes/mod.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/disputes/mod.rs @@ -59,9 +59,9 @@ use pezkuwi_primitives::{AuthorityDiscoveryId, Block, Hash, ValidatorId}; use pezsc_keystore::LocalKeystore; use pezsc_network::request_responses::IncomingRequest as RawIncomingRequest; use pezsc_service::SpawnTaskHandle; -use serde::{Deserialize, Serialize}; use pezsp_keystore::Keystore; use pezsp_runtime::RuntimeAppPublic; +use serde::{Deserialize, Serialize}; use std::{sync::Arc, time::Instant}; pub use test_state::TestState; diff --git a/pezkuwi/node/subsystem-bench/src/lib/disputes/test_state.rs b/pezkuwi/node/subsystem-bench/src/lib/disputes/test_state.rs index c91b46de..f9f9e1f7 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/disputes/test_state.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/disputes/test_state.rs @@ -24,11 +24,11 @@ use pezkuwi_node_network_protocol::request_response::{ v1::{DisputeRequest, DisputeResponse}, ProtocolName, Requests, }; +use pezkuwi_node_subsystem_test_helpers::mock::new_block_import_info; +use pezkuwi_overseer::BlockInfo; use pezkuwi_pez_node_primitives::{ InvalidDisputeVote, SignedDisputeStatement, UncheckedDisputeMessage, ValidDisputeVote, }; -use pezkuwi_node_subsystem_test_helpers::mock::new_block_import_info; -use pezkuwi_overseer::BlockInfo; use pezkuwi_primitives::{ AuthorityDiscoveryId, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash, CandidateReceiptV2, CoreIndex, GroupIndex, Hash, HeadData, Header, InvalidDisputeStatementKind, diff --git a/pezkuwi/node/subsystem-bench/src/lib/mock/av_store.rs b/pezkuwi/node/subsystem-bench/src/lib/mock/av_store.rs index e81c3406..341760bc 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/mock/av_store.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/mock/av_store.rs @@ -23,11 +23,11 @@ use pezkuwi_node_network_protocol::request_response::{ v1::AvailableDataFetchingResponse, v2::ChunkFetchingResponse, Protocol, ReqProtocolNames, Requests, }; -use pezkuwi_pez_node_primitives::{AvailableData, ErasureChunk}; use pezkuwi_node_subsystem::{ messages::AvailabilityStoreMessage, overseer, SpawnedSubsystem, SubsystemError, }; use pezkuwi_node_subsystem_types::OverseerSignal; +use pezkuwi_pez_node_primitives::{AvailableData, ErasureChunk}; use pezkuwi_primitives::{CandidateHash, ChunkIndex, CoreIndex, ValidatorIndex}; use std::collections::HashMap; diff --git a/pezkuwi/node/subsystem-bench/src/lib/mock/availability_recovery.rs b/pezkuwi/node/subsystem-bench/src/lib/mock/availability_recovery.rs index 1e9655fc..518ff06a 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/mock/availability_recovery.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/mock/availability_recovery.rs @@ -19,11 +19,11 @@ use std::sync::Arc; use futures::FutureExt; -use pezkuwi_pez_node_primitives::{AvailableData, BlockData, PoV}; use pezkuwi_node_subsystem::{ messages::AvailabilityRecoveryMessage, overseer, SpawnedSubsystem, SubsystemError, }; use pezkuwi_node_subsystem_types::OverseerSignal; +use pezkuwi_pez_node_primitives::{AvailableData, BlockData, PoV}; use pezkuwi_primitives::{Hash, HeadData, PersistedValidationData}; const LOG_TARGET: &str = "subsystem-bench::availability-recovery-mock"; diff --git a/pezkuwi/node/subsystem-bench/src/lib/mock/candidate_backing.rs b/pezkuwi/node/subsystem-bench/src/lib/mock/candidate_backing.rs index b1ff9272..c7bd18b7 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/mock/candidate_backing.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/mock/candidate_backing.rs @@ -18,11 +18,11 @@ use crate::{configuration::TestConfiguration, NODE_UNDER_TEST}; use futures::FutureExt; -use pezkuwi_pez_node_primitives::{SignedFullStatementWithPVD, Statement, StatementWithPVD}; use pezkuwi_node_subsystem::{ messages::CandidateBackingMessage, overseer, SpawnedSubsystem, SubsystemError, }; use pezkuwi_node_subsystem_types::OverseerSignal; +use pezkuwi_pez_node_primitives::{SignedFullStatementWithPVD, Statement, StatementWithPVD}; use pezkuwi_primitives::{ CandidateHash, Hash, PersistedValidationData, SigningContext, ValidatorIndex, ValidatorPair, }; diff --git a/pezkuwi/node/subsystem-bench/src/lib/mock/candidate_validation.rs b/pezkuwi/node/subsystem-bench/src/lib/mock/candidate_validation.rs index 7f6b3278..ea7458fd 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/mock/candidate_validation.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/mock/candidate_validation.rs @@ -18,11 +18,11 @@ //! is responding with candidate valid for every request. use futures::FutureExt; -use pezkuwi_pez_node_primitives::ValidationResult; use pezkuwi_node_subsystem::{ messages::CandidateValidationMessage, overseer, SpawnedSubsystem, SubsystemError, }; use pezkuwi_node_subsystem_types::OverseerSignal; +use pezkuwi_pez_node_primitives::ValidationResult; use pezkuwi_primitives::{CandidateCommitments, Hash, HeadData, PersistedValidationData}; const LOG_TARGET: &str = "subsystem-bench::candidate-validation-mock"; diff --git a/pezkuwi/node/subsystem-bench/src/lib/network.rs b/pezkuwi/node/subsystem-bench/src/lib/network.rs index a369deaa..e70bc829 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/network.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/network.rs @@ -64,14 +64,14 @@ use pezkuwi_node_subsystem_util::metrics::prometheus::{ }; use pezkuwi_overseer::AllMessages; use pezkuwi_primitives::AuthorityDiscoveryId; -use prometheus_endpoint::U64; -use rand::{seq::SliceRandom, thread_rng}; use pezsc_network::{ request_responses::{IncomingRequest, OutgoingResponse}, RequestFailure, }; use pezsc_network_types::PeerId; use pezsc_service::SpawnTaskHandle; +use prometheus_endpoint::U64; +use rand::{seq::SliceRandom, thread_rng}; use std::{ collections::HashMap, sync::Arc, diff --git a/pezkuwi/node/subsystem-bench/src/lib/statement/test_state.rs b/pezkuwi/node/subsystem-bench/src/lib/statement/test_state.rs index 698d0150..6c9f2e74 100644 --- a/pezkuwi/node/subsystem-bench/src/lib/statement/test_state.rs +++ b/pezkuwi/node/subsystem-bench/src/lib/statement/test_state.rs @@ -35,11 +35,11 @@ use pezkuwi_node_network_protocol::{ }, ValidationProtocols, }; -use pezkuwi_pez_node_primitives::{AvailableData, BlockData, PoV}; use pezkuwi_node_subsystem_test_helpers::{ derive_erasure_chunks_with_proofs_and_root, mock::new_block_import_info, }; use pezkuwi_overseer::BlockInfo; +use pezkuwi_pez_node_primitives::{AvailableData, BlockData, PoV}; use pezkuwi_primitives::MutateDescriptorV2; diff --git a/pezkuwi/node/subsystem-test-helpers/src/lib.rs b/pezkuwi/node/subsystem-test-helpers/src/lib.rs index 9eee6cea..3b2bf7d2 100644 --- a/pezkuwi/node/subsystem-test-helpers/src/lib.rs +++ b/pezkuwi/node/subsystem-test-helpers/src/lib.rs @@ -19,12 +19,12 @@ #![warn(missing_docs)] use pezkuwi_erasure_coding::{branches, obtain_chunks_v1 as obtain_chunks}; -use pezkuwi_pez_node_primitives::{AvailableData, ErasureChunk, Proof}; use pezkuwi_node_subsystem::{ messages::AllMessages, overseer, FromOrchestra, OverseerSignal, SpawnGlue, SpawnedSubsystem, SubsystemError, SubsystemResult, TrySendError, }; use pezkuwi_node_subsystem_util::TimeoutExt; +use pezkuwi_pez_node_primitives::{AvailableData, ErasureChunk, Proof}; use pezkuwi_primitives::{ChunkIndex, Hash}; use futures::{channel::mpsc, poll, prelude::*}; diff --git a/pezkuwi/node/subsystem-util/src/controlled_validator_indices.rs b/pezkuwi/node/subsystem-util/src/controlled_validator_indices.rs index addeab08..acce14e0 100644 --- a/pezkuwi/node/subsystem-util/src/controlled_validator_indices.rs +++ b/pezkuwi/node/subsystem-util/src/controlled_validator_indices.rs @@ -17,8 +17,8 @@ //! `ControlledValidatorIndices` implementation. use pezkuwi_primitives::{IndexedVec, SessionIndex, ValidatorId, ValidatorIndex}; -use schnellru::{ByLength, LruMap}; use pezsp_keystore::KeystorePtr; +use schnellru::{ByLength, LruMap}; /// Keeps track of the validator indices controlled by the local validator in a given session. For /// better performance, the values for each session are cached. diff --git a/pezkuwi/node/subsystem-util/src/lib.rs b/pezkuwi/node/subsystem-util/src/lib.rs index bf1a7c0b..5afc82e8 100644 --- a/pezkuwi/node/subsystem-util/src/lib.rs +++ b/pezkuwi/node/subsystem-util/src/lib.rs @@ -49,10 +49,10 @@ use pezkuwi_primitives::{ SessionInfo, Signed, SigningContext, ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature, }; -pub use rand; use pezsp_application_crypto::AppCrypto; use pezsp_core::ByteArray; use pezsp_keystore::{Error as KeystoreError, KeystorePtr}; +pub use rand; use std::{ collections::{BTreeMap, VecDeque}, time::Duration, diff --git a/pezkuwi/node/test/client/src/lib.rs b/pezkuwi/node/test/client/src/lib.rs index 62eb9756..8b6ebdf3 100644 --- a/pezkuwi/node/test/client/src/lib.rs +++ b/pezkuwi/node/test/client/src/lib.rs @@ -24,18 +24,21 @@ use pezkuwi_primitives::Block; use pezsp_runtime::BuildStorage; use std::sync::Arc; +pub use bizinikiwi_test_client::*; pub use block_builder::*; pub use pezkuwi_test_runtime as runtime; pub use pezkuwi_test_service::{ construct_extrinsic, construct_transfer_extrinsic, Client, FullBackend, }; -pub use bizinikiwi_test_client::*; /// Test client executor. pub type Executor = client::LocalCallExecutor< Block, FullBackend, - WasmExecutor<(pezsp_io::BizinikiwiHostFunctions, pezframe_benchmarking::benchmarking::HostFunctions)>, + WasmExecutor<( + pezsp_io::BizinikiwiHostFunctions, + pezframe_benchmarking::benchmarking::HostFunctions, + )>, >; /// Test client builder for Pezkuwi. diff --git a/pezkuwi/node/test/service/src/chain_spec.rs b/pezkuwi/node/test/service/src/chain_spec.rs index ab990982..9ca82aa9 100644 --- a/pezkuwi/node/test/service/src/chain_spec.rs +++ b/pezkuwi/node/test/service/src/chain_spec.rs @@ -16,13 +16,13 @@ //! Chain specifications for the test runtime. -use pezpallet_staking::Forcing; use pezkuwi_primitives::{ node_features, AccountId, AssignmentId, NodeFeatures, SchedulerParams, ValidatorId, MAX_CODE_SIZE, MAX_POV_SIZE, }; use pezkuwi_service::chain_spec::Extensions; use pezkuwi_test_runtime::BABE_GENESIS_EPOCH_CONFIG; +use pezpallet_staking::Forcing; use pezsc_chain_spec::{ChainSpec, ChainType}; use pezsc_consensus_grandpa::AuthorityId as GrandpaId; use pezsp_authority_discovery::AuthorityId as AuthorityDiscoveryId; diff --git a/pezkuwi/node/test/service/src/lib.rs b/pezkuwi/node/test/service/src/lib.rs index cb34d24b..361a848d 100644 --- a/pezkuwi/node/test/service/src/lib.rs +++ b/pezkuwi/node/test/service/src/lib.rs @@ -22,9 +22,9 @@ pub mod chain_spec; pub use chain_spec::*; use futures::{future::Future, stream::StreamExt}; -use pezkuwi_pez_node_primitives::{CollationGenerationConfig, CollatorFn}; use pezkuwi_node_subsystem::messages::{CollationGenerationMessage, CollatorProtocolMessage}; use pezkuwi_overseer::Handle; +use pezkuwi_pez_node_primitives::{CollationGenerationConfig, CollatorFn}; use pezkuwi_primitives::{Balance, CollatorPair, HeadData, Id as ParaId, ValidationCode}; use pezkuwi_runtime_common::BlockHashCount; use pezkuwi_runtime_teyrchains::paras::{ParaGenesisArgs, ParaKind}; @@ -34,6 +34,9 @@ use pezkuwi_test_runtime::{ UncheckedExtrinsic, VERSION, }; +use bizinikiwi_test_client::{ + BlockchainEventsExt, RpcHandlersExt, RpcTransactionError, RpcTransactionOutput, +}; use pezsc_chain_spec::ChainSpec; use pezsc_client_api::BlockchainEvents; use pezsc_network::{ @@ -60,9 +63,6 @@ use std::{ path::PathBuf, sync::Arc, }; -use bizinikiwi_test_client::{ - BlockchainEventsExt, RpcHandlersExt, RpcTransactionError, RpcTransactionOutput, -}; /// The client type being used by the test service. pub type Client = FullClient; @@ -477,11 +477,12 @@ pub fn construct_transfer_extrinsic( dest: pezsp_keyring::Sr25519Keyring, value: Balance, ) -> UncheckedExtrinsic { - let function = - pezkuwi_test_runtime::RuntimeCall::Balances(pezpallet_balances::Call::transfer_allow_death { + let function = pezkuwi_test_runtime::RuntimeCall::Balances( + pezpallet_balances::Call::transfer_allow_death { dest: MultiSigner::from(dest.public()).into_account().into(), value, - }); + }, + ); construct_extrinsic(client, function, origin, 0) } diff --git a/pezkuwi/node/test/service/tests/call-function.rs b/pezkuwi/node/test/service/tests/call-function.rs index c02d7c8a..24ef499e 100644 --- a/pezkuwi/node/test/service/tests/call-function.rs +++ b/pezkuwi/node/test/service/tests/call-function.rs @@ -24,11 +24,12 @@ async fn call_function_actually_work() { let alice = run_validator_node(alice_config, None).await; - let function = - pezkuwi_test_runtime::RuntimeCall::Balances(pezpallet_balances::Call::transfer_allow_death { + let function = pezkuwi_test_runtime::RuntimeCall::Balances( + pezpallet_balances::Call::transfer_allow_death { dest: Charlie.to_account_id().into(), value: 1, - }); + }, + ); let output = alice.send_extrinsic(function, Bob).await.unwrap(); let res = output.result; diff --git a/pezkuwi/pezpallets/validator-pool/src/types.rs b/pezkuwi/pezpallets/validator-pool/src/types.rs index f5c17f32..d603b0d6 100644 --- a/pezkuwi/pezpallets/validator-pool/src/types.rs +++ b/pezkuwi/pezpallets/validator-pool/src/types.rs @@ -3,8 +3,8 @@ extern crate alloc; use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use pezframe_support::{traits::ConstU32, BoundedVec}; -use scale_info::TypeInfo; use pezsp_runtime::RuntimeDebug; +use scale_info::TypeInfo; /// Types of validators in the pool #[derive( diff --git a/pezkuwi/primitives/src/v9/async_backing.rs b/pezkuwi/primitives/src/v9/async_backing.rs index 44bac276..832df670 100644 --- a/pezkuwi/primitives/src/v9/async_backing.rs +++ b/pezkuwi/primitives/src/v9/async_backing.rs @@ -20,8 +20,8 @@ use super::*; use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode}; -use scale_info::TypeInfo; use pezsp_core::RuntimeDebug; +use scale_info::TypeInfo; use crate::CandidateDescriptorV2; diff --git a/pezkuwi/primitives/src/v9/mod.rs b/pezkuwi/primitives/src/v9/mod.rs index d510b6da..72bfe25d 100644 --- a/pezkuwi/primitives/src/v9/mod.rs +++ b/pezkuwi/primitives/src/v9/mod.rs @@ -39,9 +39,9 @@ use pezsp_arithmetic::{ }; use bounded_collections::BoundedVec; -use serde::{Deserialize, Serialize}; use pezsp_core::{ConstU32, RuntimeDebug}; use pezsp_inherents::InherentIdentifier; +use serde::{Deserialize, Serialize}; // ========== // PUBLIC RE-EXPORTS diff --git a/pezkuwi/primitives/test-helpers/src/lib.rs b/pezkuwi/primitives/test-helpers/src/lib.rs index 5007dd08..aaca9ce4 100644 --- a/pezkuwi/primitives/test-helpers/src/lib.rs +++ b/pezkuwi/primitives/test-helpers/src/lib.rs @@ -29,11 +29,11 @@ use pezkuwi_primitives::{ Id, Id as ParaId, InternalVersion, MutateDescriptorV2, PersistedValidationData, SessionIndex, ValidationCode, ValidationCodeHash, ValidatorId, }; -pub use rand; -use scale_info::TypeInfo; use pezsp_application_crypto::{sr25519, ByteArray}; use pezsp_keyring::Sr25519Keyring; use pezsp_runtime::{generic::Digest, traits::BlakeTwo256}; +pub use rand; +use scale_info::TypeInfo; const MAX_POV_SIZE: u32 = 1_000_000; diff --git a/pezkuwi/rpc/src/lib.rs b/pezkuwi/rpc/src/lib.rs index d7e09174..ff714b3b 100644 --- a/pezkuwi/rpc/src/lib.rs +++ b/pezkuwi/rpc/src/lib.rs @@ -112,7 +112,11 @@ where + Sync + 'static, C::Api: bizinikiwi_frame_rpc_system::AccountNonceApi, - C::Api: pezmmr_rpc::MmrRuntimeApi::Hash, BlockNumber>, + C::Api: pezmmr_rpc::MmrRuntimeApi< + Block, + ::Hash, + BlockNumber, + >, C::Api: pezpallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: BabeApi, C::Api: BlockBuilder, @@ -123,14 +127,14 @@ where AuthorityId: AuthorityIdBound, ::Signature: Send + Sync, { + use bizinikiwi_frame_rpc_system::{System, SystemApiServer}; + use bizinikiwi_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer}; use pezmmr_rpc::{Mmr, MmrApiServer}; use pezpallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use pezsc_consensus_babe_rpc::{Babe, BabeApiServer}; use pezsc_consensus_beefy_rpc::{Beefy, BeefyApiServer}; use pezsc_consensus_grandpa_rpc::{Grandpa, GrandpaApiServer}; use pezsc_sync_state_rpc::{SyncState, SyncStateApiServer}; - use bizinikiwi_frame_rpc_system::{System, SystemApiServer}; - use bizinikiwi_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer}; let mut io = RpcModule::new(()); let BabeDeps { babe_worker_handle, keystore } = babe; diff --git a/pezkuwi/runtime/common/src/assigned_slots/benchmarking.rs b/pezkuwi/runtime/common/src/assigned_slots/benchmarking.rs index 2ce516b3..f182de63 100644 --- a/pezkuwi/runtime/common/src/assigned_slots/benchmarking.rs +++ b/pezkuwi/runtime/common/src/assigned_slots/benchmarking.rs @@ -60,8 +60,10 @@ mod benchmarks { let para_id = ParaId::from(1_u32); let caller = RawOrigin::Root; - let _ = - AssignedSlots::::set_max_permanent_slots(pezframe_system::Origin::::Root.into(), 10); + let _ = AssignedSlots::::set_max_permanent_slots( + pezframe_system::Origin::::Root.into(), + 10, + ); register_teyrchain::(para_id); let counter = PermanentSlotCount::::get(); @@ -87,8 +89,10 @@ mod benchmarks { let para_id = ParaId::from(2_u32); let caller = RawOrigin::Root; - let _ = - AssignedSlots::::set_max_temporary_slots(pezframe_system::Origin::::Root.into(), 10); + let _ = AssignedSlots::::set_max_temporary_slots( + pezframe_system::Origin::::Root.into(), + 10, + ); register_teyrchain::(para_id); let current_lease_period: BlockNumberFor = @@ -116,8 +120,10 @@ mod benchmarks { let para_id = ParaId::from(3_u32); let caller = RawOrigin::Root; - let _ = - AssignedSlots::::set_max_temporary_slots(pezframe_system::Origin::::Root.into(), 10); + let _ = AssignedSlots::::set_max_temporary_slots( + pezframe_system::Origin::::Root.into(), + 10, + ); register_teyrchain::(para_id); let _ = AssignedSlots::::assign_temp_teyrchain_slot( diff --git a/pezkuwi/runtime/common/src/assigned_slots/mod.rs b/pezkuwi/runtime/common/src/assigned_slots/mod.rs index 97213cbe..0e442fd0 100644 --- a/pezkuwi/runtime/common/src/assigned_slots/mod.rs +++ b/pezkuwi/runtime/common/src/assigned_slots/mod.rs @@ -34,14 +34,14 @@ use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use pezframe_support::{pezpallet_prelude::*, traits::Currency}; use pezframe_system::pezpallet_prelude::*; -pub use pezpallet::*; use pezkuwi_primitives::Id as ParaId; use pezkuwi_runtime_teyrchains::{ configuration, paras::{self}, }; -use scale_info::TypeInfo; +pub use pezpallet::*; use pezsp_runtime::traits::{One, Saturating, Zero}; +use scale_info::TypeInfo; const LOG_TARGET: &str = "runtime::assigned_slots"; @@ -121,7 +121,8 @@ pub mod pezpallet { pub trait Config: configuration::Config + paras::Config + slots::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Origin for assigning slots. type AssignSlotOrigin: EnsureOrigin<::RuntimeOrigin>; @@ -637,13 +638,13 @@ mod tests { use crate::{assigned_slots, mock::TestRegistrar, slots}; use pezframe_support::{assert_noop, assert_ok, derive_impl, parameter_types}; use pezframe_system::EnsureRoot; - use pezpallet_balances; use pezkuwi_primitives::BlockNumber; use pezkuwi_primitives_test_helpers::{dummy_head_data, dummy_validation_code}; use pezkuwi_runtime_teyrchains::{ configuration as teyrchains_configuration, paras as teyrchains_paras, shared as teyrchains_shared, }; + use pezpallet_balances; use pezsp_core::H256; use pezsp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, diff --git a/pezkuwi/runtime/common/src/auctions/mock.rs b/pezkuwi/runtime/common/src/auctions/mock.rs index bd73bea4..88df49c5 100644 --- a/pezkuwi/runtime/common/src/auctions/mock.rs +++ b/pezkuwi/runtime/common/src/auctions/mock.rs @@ -23,9 +23,9 @@ use pezframe_support::{ assert_ok, derive_impl, ord_parameter_types, parameter_types, traits::EitherOfDiverse, }; use pezframe_system::{EnsureRoot, EnsureSignedBy}; -use pezpallet_balances; use pezkuwi_primitives::{BlockNumber, Id as ParaId}; use pezkuwi_primitives_test_helpers::{dummy_head_data, dummy_validation_code}; +use pezpallet_balances; use pezsp_core::H256; use pezsp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, diff --git a/pezkuwi/runtime/common/src/auctions/mod.rs b/pezkuwi/runtime/common/src/auctions/mod.rs index 9ca73709..0ff77dbb 100644 --- a/pezkuwi/runtime/common/src/auctions/mod.rs +++ b/pezkuwi/runtime/common/src/auctions/mod.rs @@ -32,8 +32,8 @@ use pezframe_support::{ weights::Weight, }; use pezframe_system::pezpallet_prelude::BlockNumberFor; -pub use pezpallet::*; use pezkuwi_primitives::Id as ParaId; +pub use pezpallet::*; use pezsp_runtime::traits::{CheckedSub, One, Saturating, Zero}; type CurrencyOf = <::Leaser as Leaser>>::Currency; @@ -91,7 +91,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The type representing the leasing system. type Leaser: Leaser< diff --git a/pezkuwi/runtime/common/src/auctions/tests.rs b/pezkuwi/runtime/common/src/auctions/tests.rs index b1530717..4666b553 100644 --- a/pezkuwi/runtime/common/src/auctions/tests.rs +++ b/pezkuwi/runtime/common/src/auctions/tests.rs @@ -20,9 +20,9 @@ use super::*; use crate::{auctions::mock::*, mock::TestRegistrar}; use pezframe_support::{assert_noop, assert_ok, assert_storage_noop}; -use pezpallet_balances; use pezkuwi_primitives::Id as ParaId; use pezkuwi_primitives_test_helpers::{dummy_hash, dummy_head_data, dummy_validation_code}; +use pezpallet_balances; use pezsp_core::H256; use pezsp_runtime::DispatchError::BadOrigin; diff --git a/pezkuwi/runtime/common/src/claims/benchmarking.rs b/pezkuwi/runtime/common/src/claims/benchmarking.rs index 2fdc0673..7980cb6e 100644 --- a/pezkuwi/runtime/common/src/claims/benchmarking.rs +++ b/pezkuwi/runtime/common/src/claims/benchmarking.rs @@ -25,11 +25,11 @@ use pezframe_support::{ traits::UnfilteredDispatchable, }; use pezframe_system::RawOrigin; -use secp_utils::*; use pezsp_runtime::{ traits::{DispatchTransaction, ValidateUnsigned}, DispatchResult, }; +use secp_utils::*; const SEED: u32 = 0; diff --git a/pezkuwi/runtime/common/src/claims/mock.rs b/pezkuwi/runtime/common/src/claims/mock.rs index d9169595..c61909e8 100644 --- a/pezkuwi/runtime/common/src/claims/mock.rs +++ b/pezkuwi/runtime/common/src/claims/mock.rs @@ -23,7 +23,9 @@ use secp_utils::*; // The testing primitives are very useful for avoiding having to work with signatures // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use crate::claims; -use pezframe_support::{derive_impl, ord_parameter_types, parameter_types, traits::WithdrawReasons}; +use pezframe_support::{ + derive_impl, ord_parameter_types, parameter_types, traits::WithdrawReasons, +}; use pezpallet_balances; use pezsp_runtime::{traits::Identity, BuildStorage}; diff --git a/pezkuwi/runtime/common/src/claims/mod.rs b/pezkuwi/runtime/common/src/claims/mod.rs index 7816b700..7531c411 100644 --- a/pezkuwi/runtime/common/src/claims/mod.rs +++ b/pezkuwi/runtime/common/src/claims/mod.rs @@ -27,10 +27,8 @@ use pezframe_support::{ weights::Weight, DefaultNoBound, }; -pub use pezpallet::*; use pezkuwi_primitives::ValidityError; -use scale_info::TypeInfo; -use serde::{self, Deserialize, Deserializer, Serialize, Serializer}; +pub use pezpallet::*; use pezsp_io::{crypto::secp256k1_ecdsa_recover, hashing::keccak_256}; use pezsp_runtime::{ impl_tx_ext_default, @@ -44,6 +42,8 @@ use pezsp_runtime::{ }, RuntimeDebug, }; +use scale_info::TypeInfo; +use serde::{self, Deserialize, Deserializer, Serialize, Serializer}; type CurrencyOf = <::VestingSchedule as VestingSchedule< ::AccountId, @@ -209,7 +209,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type VestingSchedule: VestingSchedule>; #[pezpallet::constant] type Prefix: Get<&'static [u8]>; diff --git a/pezkuwi/runtime/common/src/claims/tests.rs b/pezkuwi/runtime/common/src/claims/tests.rs index 09e91467..83c51dca 100644 --- a/pezkuwi/runtime/common/src/claims/tests.rs +++ b/pezkuwi/runtime/common/src/claims/tests.rs @@ -21,8 +21,8 @@ use super::*; use crate::{claims, claims::mock::*}; use claims::Call as ClaimsCall; use hex_literal::hex; -use secp_utils::*; use pezsp_runtime::transaction_validity::TransactionSource::External; +use secp_utils::*; use codec::Encode; // The testing primitives are very useful for avoiding having to work with signatures diff --git a/pezkuwi/runtime/common/src/crowdloan/migration.rs b/pezkuwi/runtime/common/src/crowdloan/migration.rs index d956d524..0ad94704 100644 --- a/pezkuwi/runtime/common/src/crowdloan/migration.rs +++ b/pezkuwi/runtime/common/src/crowdloan/migration.rs @@ -29,8 +29,9 @@ impl OnRuntimeUpgrade for MigrateToTrackInactiveV2 { if on_chain_version == 1 { let mut translated = 0u64; for item in Funds::::iter_values() { - let b = - CurrencyOf::::total_balance(&Pezpallet::::fund_account_id(item.fund_index)); + let b = CurrencyOf::::total_balance(&Pezpallet::::fund_account_id( + item.fund_index, + )); CurrencyOf::::deactivate(b); translated.saturating_inc(); } diff --git a/pezkuwi/runtime/common/src/crowdloan/mod.rs b/pezkuwi/runtime/common/src/crowdloan/mod.rs index e4536b78..074f364c 100644 --- a/pezkuwi/runtime/common/src/crowdloan/mod.rs +++ b/pezkuwi/runtime/common/src/crowdloan/mod.rs @@ -69,15 +69,15 @@ use pezframe_support::{ Identity, PalletId, }; use pezframe_system::pezpallet_prelude::BlockNumberFor; -pub use pezpallet::*; use pezkuwi_primitives::Id as ParaId; -use scale_info::TypeInfo; +pub use pezpallet::*; use pezsp_runtime::{ traits::{ AccountIdConversion, CheckedAdd, Hash, IdentifyAccount, One, Saturating, Verify, Zero, }, MultiSignature, MultiSigner, RuntimeDebug, }; +use scale_info::TypeInfo; type CurrencyOf = <::Auctioneer as Auctioneer>>::Currency; type LeasePeriodOf = <::Auctioneer as Auctioneer>>::LeasePeriod; @@ -187,7 +187,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// `PalletId` for the crowdloan pezpallet. An appropriate value could be /// `PalletId(*b"py/cfund")` @@ -552,7 +553,10 @@ pub mod pezpallet { /// Remove a fund after the retirement period has ended and all funds have been returned. #[pezpallet::call_index(4)] #[pezpallet::weight(T::WeightInfo::dissolve())] - pub fn dissolve(origin: OriginFor, #[pezpallet::compact] index: ParaId) -> DispatchResult { + pub fn dissolve( + origin: OriginFor, + #[pezpallet::compact] index: ParaId, + ) -> DispatchResult { let who = ensure_signed(origin)?; let fund = Funds::::get(index).ok_or(Error::::InvalidParaId)?; diff --git a/pezkuwi/runtime/common/src/elections.rs b/pezkuwi/runtime/common/src/elections.rs index 988cac5a..d99b6e77 100644 --- a/pezkuwi/runtime/common/src/elections.rs +++ b/pezkuwi/runtime/common/src/elections.rs @@ -45,9 +45,10 @@ macro_rules! impl_elections_weights { }; } -/// The numbers configured here could always be more than the the maximum limits of staking pezpallet -/// to ensure election snapshot will not run out of memory. For now, we set them to smaller values -/// since the staking is bounded and the weight pipeline takes hours for this single pezpallet. +/// The numbers configured here could always be more than the the maximum limits of staking +/// pezpallet to ensure election snapshot will not run out of memory. For now, we set them to +/// smaller values since the staking is bounded and the weight pipeline takes hours for this single +/// pezpallet. pub struct BenchmarkConfig; impl pezpallet_election_provider_multi_phase::BenchmarkingConfig for BenchmarkConfig { const VOTERS: [u32; 2] = [1000, 2000]; diff --git a/pezkuwi/runtime/common/src/identity_migrator.rs b/pezkuwi/runtime/common/src/identity_migrator.rs index 34aa9699..cf40f805 100644 --- a/pezkuwi/runtime/common/src/identity_migrator.rs +++ b/pezkuwi/runtime/common/src/identity_migrator.rs @@ -22,8 +22,8 @@ //! - Avoid cluttering the source pezpallet with new dispatchables that are unrelated to its //! functionality and only used for migration. //! -//! After the migration is complete, the pezpallet may be removed from both chains' runtimes as well as -//! the `pezkuwi-runtime-common` crate. +//! After the migration is complete, the pezpallet may be removed from both chains' runtimes as well +//! as the `pezkuwi-runtime-common` crate. use pezframe_support::{dispatch::DispatchResult, traits::Currency, weights::Weight}; pub use pezpallet::*; @@ -79,7 +79,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config + pezpallet_identity::Config { /// Overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The origin that can reap identities. Expected to be `EnsureSigned` on the /// source chain such that anyone can all this function. @@ -119,7 +120,8 @@ pub mod pezpallet { // - number of registrars (required to calculate weight) // - byte size of `IdentityInfo` (required to calculate remote deposit) // - number of sub accounts (required to calculate both weight and remote deposit) - let (registrars, bytes, subs) = pezpallet_identity::Pezpallet::::reap_identity(&who)?; + let (registrars, bytes, subs) = + pezpallet_identity::Pezpallet::::reap_identity(&who)?; T::ReapIdentityHandler::on_reap_identity(&who, bytes, subs)?; Self::deposit_event(Event::IdentityReaped { who }); let post = PostDispatchInfo { @@ -137,7 +139,8 @@ pub mod pezpallet { #[pezpallet::weight(::WeightInfo::poke_deposit())] pub fn poke_deposit(origin: OriginFor, who: T::AccountId) -> DispatchResultWithPostInfo { ensure_root(origin)?; - let (id_deposit, subs_deposit) = pezpallet_identity::Pezpallet::::poke_deposit(&who)?; + let (id_deposit, subs_deposit) = + pezpallet_identity::Pezpallet::::poke_deposit(&who)?; Self::deposit_event(Event::DepositUpdated { who, identity: id_deposit, diff --git a/pezkuwi/runtime/common/src/impls.rs b/pezkuwi/runtime/common/src/impls.rs index 63bd55a2..464af851 100644 --- a/pezkuwi/runtime/common/src/impls.rs +++ b/pezkuwi/runtime/common/src/impls.rs @@ -22,8 +22,8 @@ use pezframe_support::traits::{ tokens::imbalance::ResolveTo, Contains, ContainsPair, Imbalance, OnUnbalanced, }; -use pezpallet_treasury::TreasuryAccountId; use pezkuwi_primitives::Balance; +use pezpallet_treasury::TreasuryAccountId; use pezsp_runtime::{traits::TryConvert, Perquintill, RuntimeDebug}; use xcm::VersionedLocation; @@ -61,7 +61,9 @@ where // for tips, if any, 100% to author tips.merge_into(&mut split.1); } - ResolveTo::, pezpallet_balances::Pezpallet>::on_unbalanced(split.0); + ResolveTo::, pezpallet_balances::Pezpallet>::on_unbalanced( + split.0, + ); as OnUnbalanced<_>>::on_unbalanced(split.1); } } diff --git a/pezkuwi/runtime/common/src/integration_tests.rs b/pezkuwi/runtime/common/src/integration_tests.rs index 1dc4aea5..5383c558 100644 --- a/pezkuwi/runtime/common/src/integration_tests.rs +++ b/pezkuwi/runtime/common/src/integration_tests.rs @@ -34,7 +34,6 @@ use pezframe_support::{ }; use pezframe_support_test::TestRandomness; use pezframe_system::EnsureRoot; -use pezpallet_identity::{self, legacy::IdentityInfo}; use pezkuwi_primitives::{ BlockNumber, HeadData, Id as ParaId, SessionIndex, ValidationCode, LOWEST_PUBLIC_ID, MAX_CODE_SIZE, @@ -42,6 +41,7 @@ use pezkuwi_primitives::{ use pezkuwi_runtime_teyrchains::{ configuration, dmp, origin, paras, shared, Origin as ParaOrigin, ParaLifecycle, }; +use pezpallet_identity::{self, legacy::IdentityInfo}; use pezsp_core::{ConstUint, H256}; use pezsp_io::TestExternalities; use pezsp_keyring::Sr25519Keyring; diff --git a/pezkuwi/runtime/common/src/lib.rs b/pezkuwi/runtime/common/src/lib.rs index b97e23d8..77310ad1 100644 --- a/pezkuwi/runtime/common/src/lib.rs +++ b/pezkuwi/runtime/common/src/lib.rs @@ -124,11 +124,11 @@ macro_rules! impl_runtime_weights { ($runtime:ident) => { use pezframe_support::{dispatch::DispatchClass, weights::Weight}; use pezframe_system::limits; - use pezpallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; pub use pezkuwi_runtime_common::{ impl_elections_weights, AVERAGE_ON_INITIALIZE_RATIO, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, }; + use pezpallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; use pezsp_runtime::{FixedPointNumber, Perquintill}; // Implement the weight types of the elections module. diff --git a/pezkuwi/runtime/common/src/paras_registrar/mod.rs b/pezkuwi/runtime/common/src/paras_registrar/mod.rs index 7d5040f8..fa4b5066 100644 --- a/pezkuwi/runtime/common/src/paras_registrar/mod.rs +++ b/pezkuwi/runtime/common/src/paras_registrar/mod.rs @@ -37,13 +37,13 @@ use pezkuwi_runtime_teyrchains::{ use crate::traits::{OnSwap, Registrar}; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -pub use pezpallet::*; use pezkuwi_runtime_teyrchains::paras::{OnNewHead, ParaKind}; -use scale_info::TypeInfo; +pub use pezpallet::*; use pezsp_runtime::{ traits::{CheckedSub, Saturating}, RuntimeDebug, }; +use scale_info::TypeInfo; #[derive( Encode, @@ -131,7 +131,8 @@ pub mod pezpallet { pub trait Config: configuration::Config + paras::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The aggregated origin type must support the `teyrchains` origin. We require that we can /// infallibly convert between this origin and the system origin, but in reality, they're @@ -383,8 +384,8 @@ pub mod pezpallet { /// /// This function will reserve a new Para Id to be owned/managed by the origin account. /// The origin account is able to register head data and validation code using `register` to - /// create an on-demand teyrchain. Using the Slots pezpallet, an on-demand teyrchain can then - /// be upgraded to a lease holding teyrchain. + /// create an on-demand teyrchain. Using the Slots pezpallet, an on-demand teyrchain can + /// then be upgraded to a lease holding teyrchain. /// /// ## Arguments /// - `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new diff --git a/pezkuwi/runtime/common/src/paras_registrar/tests.rs b/pezkuwi/runtime/common/src/paras_registrar/tests.rs index 8957c700..eee1159d 100644 --- a/pezkuwi/runtime/common/src/paras_registrar/tests.rs +++ b/pezkuwi/runtime/common/src/paras_registrar/tests.rs @@ -23,8 +23,8 @@ use crate::{ traits::Registrar as RegistrarTrait, }; use pezframe_support::{assert_noop, assert_ok}; -use pezpallet_balances::Error as BalancesError; use pezkuwi_primitives::SessionIndex; +use pezpallet_balances::Error as BalancesError; use pezsp_runtime::traits::BadOrigin; #[test] diff --git a/pezkuwi/runtime/common/src/paras_sudo_wrapper.rs b/pezkuwi/runtime/common/src/paras_sudo_wrapper.rs index 5ceb9ea5..babd4765 100644 --- a/pezkuwi/runtime/common/src/paras_sudo_wrapper.rs +++ b/pezkuwi/runtime/common/src/paras_sudo_wrapper.rs @@ -20,13 +20,13 @@ use alloc::boxed::Box; use codec::Encode; use pezframe_support::pezpallet_prelude::*; use pezframe_system::pezpallet_prelude::*; -pub use pezpallet::*; use pezkuwi_primitives::Id as ParaId; use pezkuwi_runtime_teyrchains::{ configuration, dmp, hrmp, paras::{self, AssignCoretime, ParaGenesisArgs, ParaKind}, ParaLifecycle, }; +pub use pezpallet::*; #[pezframe_support::pezpallet] pub mod pezpallet { @@ -155,11 +155,12 @@ pub mod pezpallet { ensure_root(origin)?; ensure!(paras::Pezpallet::::is_valid_para(id), Error::::ParaDoesntExist); let config = configuration::ActiveConfig::::get(); - dmp::Pezpallet::::queue_downward_message(&config, id, xcm.encode()).map_err(|e| match e - { - dmp::QueueDownwardMessageError::ExceedsMaxMessageSize => - Error::::ExceedsMaxMessageSize.into(), - dmp::QueueDownwardMessageError::Unroutable => Error::::Unroutable.into(), + dmp::Pezpallet::::queue_downward_message(&config, id, xcm.encode()).map_err(|e| { + match e { + dmp::QueueDownwardMessageError::ExceedsMaxMessageSize => + Error::::ExceedsMaxMessageSize.into(), + dmp::QueueDownwardMessageError::Unroutable => Error::::Unroutable.into(), + } }) } diff --git a/pezkuwi/runtime/common/src/purchase/mod.rs b/pezkuwi/runtime/common/src/purchase/mod.rs index c1eea583..5001e93e 100644 --- a/pezkuwi/runtime/common/src/purchase/mod.rs +++ b/pezkuwi/runtime/common/src/purchase/mod.rs @@ -24,12 +24,12 @@ use pezframe_support::{ }; use pezframe_system::pezpallet_prelude::*; pub use pezpallet::*; -use scale_info::TypeInfo; use pezsp_core::sr25519; use pezsp_runtime::{ traits::{CheckedAdd, Saturating, Verify, Zero}, AnySignature, DispatchError, DispatchResult, Permill, RuntimeDebug, }; +use scale_info::TypeInfo; type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; @@ -101,7 +101,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Balances Pezpallet type Currency: Currency; diff --git a/pezkuwi/runtime/common/src/slots/mod.rs b/pezkuwi/runtime/common/src/slots/mod.rs index 0a7d0824..25a17eed 100644 --- a/pezkuwi/runtime/common/src/slots/mod.rs +++ b/pezkuwi/runtime/common/src/slots/mod.rs @@ -19,8 +19,8 @@ //! teyrchains and parathreads to be swapped. //! //! This doesn't handle the mechanics of determining which para ID actually ends up with a teyrchain -//! lease. This must handled by a separately, through the trait interface that this pezpallet provides -//! or the root dispatchables. +//! lease. This must handled by a separately, through the trait interface that this pezpallet +//! provides or the root dispatchables. pub mod migration; @@ -32,8 +32,8 @@ use pezframe_support::{ weights::Weight, }; use pezframe_system::pezpallet_prelude::*; -pub use pezpallet::*; use pezkuwi_primitives::Id as ParaId; +pub use pezpallet::*; use pezsp_runtime::traits::{CheckedConversion, CheckedSub, Saturating, Zero}; type BalanceOf = @@ -75,7 +75,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The currency type used for bidding. type Currency: ReservableCurrency; @@ -506,9 +507,9 @@ mod tests { use crate::{mock::TestRegistrar, slots}; use pezframe_support::{assert_noop, assert_ok, derive_impl, parameter_types}; use pezframe_system::EnsureRoot; - use pezpallet_balances; use pezkuwi_primitives::BlockNumber; use pezkuwi_primitives_test_helpers::{dummy_head_data, dummy_validation_code}; + use pezpallet_balances; use pezsp_core::H256; use pezsp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, diff --git a/pezkuwi/runtime/common/src/try_runtime.rs b/pezkuwi/runtime/common/src/try_runtime.rs index df9f1be6..70b8bf3d 100644 --- a/pezkuwi/runtime/common/src/try_runtime.rs +++ b/pezkuwi/runtime/common/src/try_runtime.rs @@ -26,7 +26,9 @@ use pezpallet_staking::*; /// register all inactive nominators for fast-unstake, and progress until they have all been /// processed. -pub fn migrate_all_inactive_nominators() +pub fn migrate_all_inactive_nominators< + T: pezpallet_fast_unstake::Config + pezpallet_staking::Config, +>() where ::RuntimeEvent: TryInto>, { diff --git a/pezkuwi/runtime/pezkuwichain/constants/src/lib.rs b/pezkuwi/runtime/pezkuwichain/constants/src/lib.rs index 9c47014e..705e484f 100644 --- a/pezkuwi/runtime/pezkuwichain/constants/src/lib.rs +++ b/pezkuwi/runtime/pezkuwichain/constants/src/lib.rs @@ -68,8 +68,8 @@ pub mod fee { WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }; use pezkuwi_primitives::Balance; - use smallvec::smallvec; pub use pezsp_runtime::Perbill; + use smallvec::smallvec; /// The block saturation level. Fees will be updates based on this value. pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25); diff --git a/pezkuwi/runtime/pezkuwichain/src/lib.rs b/pezkuwi/runtime/pezkuwichain/src/lib.rs index 52f78004..d6066c9f 100644 --- a/pezkuwi/runtime/pezkuwichain/src/lib.rs +++ b/pezkuwi/runtime/pezkuwichain/src/lib.rs @@ -41,7 +41,6 @@ use alloc::{ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::cmp::Ordering; use pezframe_support::dynamic_params::{dynamic_pallet_params, dynamic_params}; -use pezpallet_balances::WeightInfo; use pezkuwi_primitives::{ async_backing::Constraints, slashing, AccountId, AccountIndex, ApprovalVotingParams, Balance, BlockNumber, CandidateEvent, CandidateHash, @@ -77,13 +76,14 @@ use pezkuwi_runtime_teyrchains::{ shared as teyrchains_shared, }; use pezkuwichain_runtime_constants::system_teyrchain::{coretime::TIMESLICE_PERIOD, BROKER_ID}; -use scale_info::TypeInfo; +use pezpallet_balances::WeightInfo; use pezsp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use pezsp_consensus_beefy::{ ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature}, mmr::{BeefyDataProvider, MmrLeafVersion}, }; use pezsp_genesis_builder::PresetId; +use scale_info::TypeInfo; use pezframe_support::{ construct_runtime, derive_impl, diff --git a/pezkuwi/runtime/pezkuwichain/src/validator_manager.rs b/pezkuwi/runtime/pezkuwichain/src/validator_manager.rs index 69dc7aa4..719ff670 100644 --- a/pezkuwi/runtime/pezkuwichain/src/validator_manager.rs +++ b/pezkuwi/runtime/pezkuwichain/src/validator_manager.rs @@ -38,7 +38,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config + pezpallet_session::Config { /// The overreaching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// Privileged origin that can add or remove validators. type PrivilegedOrigin: EnsureOrigin<::RuntimeOrigin>; diff --git a/pezkuwi/runtime/pezkuwichain/src/weights/mod.rs b/pezkuwi/runtime/pezkuwichain/src/weights/mod.rs index 9dca273c..fa14e93d 100644 --- a/pezkuwi/runtime/pezkuwichain/src/weights/mod.rs +++ b/pezkuwi/runtime/pezkuwichain/src/weights/mod.rs @@ -17,6 +17,21 @@ pub mod pezframe_system; pub mod pezframe_system_extensions; +pub mod pezkuwi_runtime_common_assigned_slots; +pub mod pezkuwi_runtime_common_auctions; +pub mod pezkuwi_runtime_common_claims; +pub mod pezkuwi_runtime_common_crowdloan; +pub mod pezkuwi_runtime_common_paras_registrar; +pub mod pezkuwi_runtime_common_slots; +pub mod pezkuwi_runtime_teyrchains_configuration; +pub mod pezkuwi_runtime_teyrchains_coretime; +pub mod pezkuwi_runtime_teyrchains_disputes; +pub mod pezkuwi_runtime_teyrchains_hrmp; +pub mod pezkuwi_runtime_teyrchains_inclusion; +pub mod pezkuwi_runtime_teyrchains_initializer; +pub mod pezkuwi_runtime_teyrchains_on_demand; +pub mod pezkuwi_runtime_teyrchains_paras; +pub mod pezkuwi_runtime_teyrchains_paras_inherent; pub mod pezpallet_balances_balances; pub mod pezpallet_beefy_mmr; pub mod pezpallet_conviction_voting; @@ -39,19 +54,4 @@ pub mod pezpallet_utility; pub mod pezpallet_vesting; pub mod pezpallet_whitelist; pub mod pezpallet_xcm; -pub mod pezkuwi_runtime_common_assigned_slots; -pub mod pezkuwi_runtime_common_auctions; -pub mod pezkuwi_runtime_common_claims; -pub mod pezkuwi_runtime_common_crowdloan; -pub mod pezkuwi_runtime_common_paras_registrar; -pub mod pezkuwi_runtime_common_slots; -pub mod pezkuwi_runtime_teyrchains_configuration; -pub mod pezkuwi_runtime_teyrchains_coretime; -pub mod pezkuwi_runtime_teyrchains_disputes; -pub mod pezkuwi_runtime_teyrchains_hrmp; -pub mod pezkuwi_runtime_teyrchains_inclusion; -pub mod pezkuwi_runtime_teyrchains_initializer; -pub mod pezkuwi_runtime_teyrchains_on_demand; -pub mod pezkuwi_runtime_teyrchains_paras; -pub mod pezkuwi_runtime_teyrchains_paras_inherent; pub mod xcm; diff --git a/pezkuwi/runtime/test-runtime/constants/src/lib.rs b/pezkuwi/runtime/test-runtime/constants/src/lib.rs index 14cdb8f0..de58e38e 100644 --- a/pezkuwi/runtime/test-runtime/constants/src/lib.rs +++ b/pezkuwi/runtime/test-runtime/constants/src/lib.rs @@ -56,8 +56,8 @@ pub mod fee { WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }; use pezkuwi_primitives::Balance; - use smallvec::smallvec; pub use pezsp_runtime::Perbill; + use smallvec::smallvec; /// The block saturation level. Fees will be updates based on this value. pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25); diff --git a/pezkuwi/runtime/test-runtime/src/lib.rs b/pezkuwi/runtime/test-runtime/src/lib.rs index 10ff8af1..6d1857b5 100644 --- a/pezkuwi/runtime/test-runtime/src/lib.rs +++ b/pezkuwi/runtime/test-runtime/src/lib.rs @@ -55,10 +55,6 @@ use pezframe_support::{ traits::{KeyOwnerProofSystem, WithdrawReasons}, PalletId, }; -use pezpallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; -use pezpallet_session::historical as session_historical; -use pezpallet_timestamp::Now; -use pezpallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use pezkuwi_primitives::{ async_backing::Constraints, slashing, AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CandidateHash, CommittedCandidateReceiptV2 as CommittedCandidateReceipt, @@ -73,6 +69,10 @@ use pezkuwi_runtime_common::{ SlowAdjustingFeeUpdate, }; use pezkuwi_runtime_teyrchains::reward_points::RewardValidatorsWithEraPoints; +use pezpallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; +use pezpallet_session::historical as session_historical; +use pezpallet_timestamp::Now; +use pezpallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use pezsp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use pezsp_consensus_beefy::ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature}; use pezsp_core::{ConstBool, ConstU32, ConstUint, Get, OpaqueMetadata}; @@ -93,12 +93,12 @@ use pezsp_version::NativeVersion; use pezsp_version::RuntimeVersion; use xcm::latest::{Assets, InteriorLocation, Location, SendError, SendResult, SendXcm, XcmHash}; +pub use paras_sudo_wrapper::Call as ParasSudoWrapperCall; pub use pezpallet_balances::Call as BalancesCall; #[cfg(feature = "std")] pub use pezpallet_staking::StakerStatus; pub use pezpallet_sudo::Call as SudoCall; pub use pezpallet_timestamp::Call as TimestampCall; -pub use paras_sudo_wrapper::Call as ParasSudoWrapperCall; #[cfg(any(feature = "std", test))] pub use pezsp_runtime::BuildStorage; pub use teyrchains_paras::Call as ParasCall; @@ -719,7 +719,8 @@ pub mod pezpallet_test_notifier { #[pezpallet::config] pub trait Config: pezframe_system::Config + pezpallet_xcm::Config { #[allow(deprecated)] - type RuntimeEvent: IsType<::RuntimeEvent> + From>; + type RuntimeEvent: IsType<::RuntimeEvent> + + From>; type RuntimeOrigin: IsType<::RuntimeOrigin> + Into::RuntimeOrigin>>; type RuntimeCall: IsType<::RuntimeCall> + From>; diff --git a/pezkuwi/runtime/teyrchains/src/assigner_coretime/mod.rs b/pezkuwi/runtime/teyrchains/src/assigner_coretime/mod.rs index c9154132..53246c8e 100644 --- a/pezkuwi/runtime/teyrchains/src/assigner_coretime/mod.rs +++ b/pezkuwi/runtime/teyrchains/src/assigner_coretime/mod.rs @@ -37,8 +37,8 @@ use crate::{ use alloc::{vec, vec::Vec}; use pezframe_support::{defensive, pezpallet_prelude::*}; use pezframe_system::pezpallet_prelude::*; -use pezpallet_broker::CoreAssignment; use pezkuwi_primitives::CoreIndex; +use pezpallet_broker::CoreAssignment; use pezsp_runtime::traits::{One, Saturating}; pub use pezpallet::*; @@ -282,7 +282,8 @@ impl AssignmentProvider> for Pezpallet { match a_type { CoreAssignment::Idle => None, - CoreAssignment::Pool => on_demand::Pezpallet::::pop_assignment_for_core(core_idx), + CoreAssignment::Pool => + on_demand::Pezpallet::::pop_assignment_for_core(core_idx), CoreAssignment::Task(para_id) => Some(Assignment::Bulk((*para_id).into())), } }) @@ -473,7 +474,8 @@ impl AssignCoretime for Pezpallet { configuration::Pezpallet::::force_set_active_config(config); let begin = current_block + One::one(); - let assignment = vec![(pezpallet_broker::CoreAssignment::Task(id.into()), PartsOf57600::FULL)]; + let assignment = + vec![(pezpallet_broker::CoreAssignment::Task(id.into()), PartsOf57600::FULL)]; Pezpallet::::assign_core(CoreIndex(core), begin, assignment, None) } } diff --git a/pezkuwi/runtime/teyrchains/src/assigner_coretime/tests.rs b/pezkuwi/runtime/teyrchains/src/assigner_coretime/tests.rs index 14b764da..216edefa 100644 --- a/pezkuwi/runtime/teyrchains/src/assigner_coretime/tests.rs +++ b/pezkuwi/runtime/teyrchains/src/assigner_coretime/tests.rs @@ -27,8 +27,8 @@ use crate::{ scheduler::common::Assignment, }; use pezframe_support::{assert_noop, assert_ok, pezpallet_prelude::*}; -use pezpallet_broker::TaskId; use pezkuwi_primitives::{BlockNumber, Id as ParaId, SessionIndex, ValidationCode}; +use pezpallet_broker::TaskId; fn schedule_blank_para(id: ParaId, parakind: ParaKind) { let validation_code: ValidationCode = vec![1, 2, 3].into(); diff --git a/pezkuwi/runtime/teyrchains/src/builder.rs b/pezkuwi/runtime/teyrchains/src/builder.rs index 23485285..a92adb78 100644 --- a/pezkuwi/runtime/teyrchains/src/builder.rs +++ b/pezkuwi/runtime/teyrchains/src/builder.rs @@ -54,8 +54,8 @@ fn mock_validation_code() -> ValidationCode { /// Grab an account, seeded by a name and index. /// -/// This is directly from pezframe-benchmarking. Copy/pasted so we can use it when not compiling with -/// "features = runtime-benchmarks". +/// This is directly from pezframe-benchmarking. Copy/pasted so we can use it when not compiling +/// with "features = runtime-benchmarks". fn account(name: &'static str, index: u32, seed: u32) -> AccountId { let entropy = (name, index, seed).using_encoded(pezsp_io::hashing::blake2_256); AccountId::decode(&mut TrailingZeroInput::new(&entropy[..])) @@ -505,7 +505,11 @@ impl BenchBuilder { let header = Self::header(block_number); pezframe_system::Pezpallet::::reset_events(); - pezframe_system::Pezpallet::::initialize(&header.number(), &header.hash(), header.digest()); + pezframe_system::Pezpallet::::initialize( + &header.number(), + &header.hash(), + header.digest(), + ); initializer::Pezpallet::::on_initialize(*header.number()); assert_eq!(shared::CurrentSessionIndex::::get(), target_session); diff --git a/pezkuwi/runtime/teyrchains/src/configuration.rs b/pezkuwi/runtime/teyrchains/src/configuration.rs index ec9089f5..52af1f5d 100644 --- a/pezkuwi/runtime/teyrchains/src/configuration.rs +++ b/pezkuwi/runtime/teyrchains/src/configuration.rs @@ -41,8 +41,8 @@ mod benchmarking; pub mod migration; -pub use pezpallet::*; use pezkuwi_primitives::SchedulerParams; +pub use pezpallet::*; const LOG_TARGET: &str = "runtime::configuration"; diff --git a/pezkuwi/runtime/teyrchains/src/coretime/migration.rs b/pezkuwi/runtime/teyrchains/src/coretime/migration.rs index 4b1a2eeb..e87ed157 100644 --- a/pezkuwi/runtime/teyrchains/src/coretime/migration.rs +++ b/pezkuwi/runtime/teyrchains/src/coretime/migration.rs @@ -36,9 +36,9 @@ mod v_coretime { weights::Weight, }; use pezframe_system::pezpallet_prelude::BlockNumberFor; - use pezpallet_broker::{CoreAssignment, CoreMask, ScheduleItem}; use pezkuwi_primitives::{CoreIndex, Id as ParaId}; use pezkuwi_teyrchain_primitives::primitives::IsSystem; + use pezpallet_broker::{CoreAssignment, CoreMask, ScheduleItem}; use pezsp_arithmetic::traits::SaturatedConversion; use pezsp_core::Get; use pezsp_runtime::BoundedVec; @@ -74,7 +74,8 @@ mod v_coretime { // storage data. But both pallets are introduced at the same time, so this is fine. let name_hash = assigner_coretime::Pezpallet::::name_hash(); let mut next_key = name_hash.to_vec(); - let storage_version_key = StorageVersion::storage_key::>(); + let storage_version_key = + StorageVersion::storage_key::>(); loop { match pezsp_io::storage::next_key(&next_key) { diff --git a/pezkuwi/runtime/teyrchains/src/coretime/mod.rs b/pezkuwi/runtime/teyrchains/src/coretime/mod.rs index 7b0026c2..192ba03f 100644 --- a/pezkuwi/runtime/teyrchains/src/coretime/mod.rs +++ b/pezkuwi/runtime/teyrchains/src/coretime/mod.rs @@ -25,9 +25,9 @@ use pezframe_support::{ traits::{defensive_prelude::*, Currency}, }; use pezframe_system::pezpallet_prelude::*; +use pezkuwi_primitives::{Balance, BlockNumber, CoreIndex, Id as ParaId}; pub use pezpallet::*; use pezpallet_broker::{CoreAssignment, CoreIndex as BrokerCoreIndex}; -use pezkuwi_primitives::{Balance, BlockNumber, CoreIndex, Id as ParaId}; use pezsp_arithmetic::traits::SaturatedConversion; use pezsp_runtime::traits::TryConvert; use xcm::prelude::*; @@ -115,11 +115,14 @@ pub mod pezpallet { pub struct Pezpallet(_); #[pezpallet::config] - pub trait Config: pezframe_system::Config + assigner_coretime::Config + on_demand::Config { + pub trait Config: + pezframe_system::Config + assigner_coretime::Config + on_demand::Config + { type RuntimeOrigin: From<::RuntimeOrigin> + Into::RuntimeOrigin>>; #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The ParaId of the coretime chain. #[pezpallet::constant] type BrokerId: Get; @@ -216,8 +219,8 @@ pub mod pezpallet { /// -`begin`: The starting blockheight of the instruction. /// -`assignment`: How the blockspace should be utilised. /// -`end_hint`: An optional hint as to when this particular set of instructions will end. - // The broker pezpallet's `CoreIndex` definition is `u16` but on the relay chain it's `struct - // CoreIndex(u32)` + // The broker pezpallet's `CoreIndex` definition is `u16` but on the relay chain it's + // `struct CoreIndex(u32)` #[pezpallet::call_index(4)] #[pezpallet::weight(::WeightInfo::assign_core(assignment.len() as u32))] pub fn assign_core( @@ -352,16 +355,16 @@ fn do_notify_revenue(when: BlockNumber, raw_revenue: Balance) -> Resu let dummy_xcm_context = XcmContext { origin: None, message_id: [0; 32], topic: None }; if raw_revenue > 0 { - let on_demand_pot = - T::AccountToLocation::try_convert(&>::account_id()).map_err( - |err| { - log::error!( - target: LOG_TARGET, - "Failed to convert on-demand pot account to XCM location: {err:?}", - ); - XcmError::InvalidLocation - }, - )?; + let on_demand_pot = T::AccountToLocation::try_convert( + &>::account_id(), + ) + .map_err(|err| { + log::error!( + target: LOG_TARGET, + "Failed to convert on-demand pot account to XCM location: {err:?}", + ); + XcmError::InvalidLocation + })?; let withdrawn = T::AssetTransactor::withdraw_asset(&asset, &on_demand_pot, None)?; diff --git a/pezkuwi/runtime/teyrchains/src/disputes.rs b/pezkuwi/runtime/teyrchains/src/disputes.rs index 5fef7552..397ba4a9 100644 --- a/pezkuwi/runtime/teyrchains/src/disputes.rs +++ b/pezkuwi/runtime/teyrchains/src/disputes.rs @@ -33,11 +33,11 @@ use pezkuwi_primitives::{ ValidDisputeStatementKind, ValidatorId, ValidatorIndex, ValidatorSignature, }; use pezkuwi_runtime_metrics::get_current_time; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{AppVerify, One, Saturating, Zero}, DispatchError, RuntimeDebug, SaturatedConversion, }; +use scale_info::TypeInfo; #[cfg(test)] #[allow(unused_imports)] @@ -372,9 +372,12 @@ pub mod pezpallet { use pezframe_support::pezpallet_prelude::*; #[pezpallet::config] - pub trait Config: pezframe_system::Config + configuration::Config + session_info::Config { + pub trait Config: + pezframe_system::Config + configuration::Config + session_info::Config + { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type RewardValidators: RewardValidators; type SlashingHandler: SlashingHandler>; diff --git a/pezkuwi/runtime/teyrchains/src/disputes/slashing.rs b/pezkuwi/runtime/teyrchains/src/disputes/slashing.rs index 9fab4b1a..630f2ae4 100644 --- a/pezkuwi/runtime/teyrchains/src/disputes/slashing.rs +++ b/pezkuwi/runtime/teyrchains/src/disputes/slashing.rs @@ -67,7 +67,6 @@ use pezkuwi_primitives::{ slashing::{DisputeProof, DisputesTimeSlot, PendingSlashes}, CandidateHash, DisputeOffenceKind, SessionIndex, ValidatorId, ValidatorIndex, }; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::Convert, transaction_validity::{ @@ -78,6 +77,7 @@ use pezsp_runtime::{ }; use pezsp_session::{GetSessionNumber, GetValidatorCount}; use pezsp_staking::offence::{Kind, Offence, OffenceError, ReportOffence}; +use scale_info::TypeInfo; const LOG_TARGET: &str = "runtime::teyrchains::slashing"; diff --git a/pezkuwi/runtime/teyrchains/src/disputes/slashing/benchmarking.rs b/pezkuwi/runtime/teyrchains/src/disputes/slashing/benchmarking.rs index 741b1902..5561f9ba 100644 --- a/pezkuwi/runtime/teyrchains/src/disputes/slashing/benchmarking.rs +++ b/pezkuwi/runtime/teyrchains/src/disputes/slashing/benchmarking.rs @@ -21,8 +21,8 @@ use codec::Decode; use pezframe_benchmarking::v2::*; use pezframe_support::traits::{OnFinalize, OnInitialize}; use pezframe_system::{pezpallet_prelude::BlockNumberFor, RawOrigin}; -use pezpallet_staking::testing_utils::create_validators; use pezkuwi_primitives::{Hash, TEYRCHAIN_KEY_TYPE_ID}; +use pezpallet_staking::testing_utils::create_validators; use pezsp_runtime::traits::{One, OpaqueKeys, StaticLookup}; use pezsp_session::MembershipProof; @@ -77,8 +77,12 @@ where whitelist_account!(controller); pezpallet_session::Pezpallet::::ensure_can_pay_key_deposit(&controller).unwrap(); - pezpallet_session::Pezpallet::::set_keys(RawOrigin::Signed(controller).into(), keys, proof) - .expect("session::set_keys should work"); + pezpallet_session::Pezpallet::::set_keys( + RawOrigin::Signed(controller).into(), + keys, + proof, + ) + .expect("session::set_keys should work"); } pezpallet_session::Pezpallet::::on_initialize(BlockNumberFor::::one()); diff --git a/pezkuwi/runtime/teyrchains/src/dmp.rs b/pezkuwi/runtime/teyrchains/src/dmp.rs index bc523c9b..7b40c217 100644 --- a/pezkuwi/runtime/teyrchains/src/dmp.rs +++ b/pezkuwi/runtime/teyrchains/src/dmp.rs @@ -83,8 +83,8 @@ impl From for SendError { } } -/// An error returned by [`Pezpallet::check_processed_downward_messages`] that indicates an acceptance -/// check didn't pass. +/// An error returned by [`Pezpallet::check_processed_downward_messages`] that indicates an +/// acceptance check didn't pass. pub(crate) enum ProcessedDownwardMessagesAcceptanceErr { /// If there are pending messages then `processed_downward_messages` should be at least 1, AdvancementRule, @@ -219,8 +219,10 @@ impl Pezpallet { let serialized_len = msg.len(); Self::can_queue_downward_message(config, ¶, &msg)?; - let inbound = - InboundDownwardMessage { msg, sent_at: pezframe_system::Pezpallet::::block_number() }; + let inbound = InboundDownwardMessage { + msg, + sent_at: pezframe_system::Pezpallet::::block_number(), + }; // obtain the new link in the MQC and update the head. DownwardMessageQueueHeads::::mutate(para, |head| { diff --git a/pezkuwi/runtime/teyrchains/src/dmp/tests.rs b/pezkuwi/runtime/teyrchains/src/dmp/tests.rs index 470f8c32..9c7cd910 100644 --- a/pezkuwi/runtime/teyrchains/src/dmp/tests.rs +++ b/pezkuwi/runtime/teyrchains/src/dmp/tests.rs @@ -20,8 +20,8 @@ use crate::{ mock::{new_test_ext, Dmp, MockGenesisConfig, Paras, System, Test}, }; use codec::Encode; -use pezframe_support::assert_ok; use hex_literal::hex; +use pezframe_support::assert_ok; use pezkuwi_primitives::BlockNumber; use pezsp_arithmetic::traits::Saturating; diff --git a/pezkuwi/runtime/teyrchains/src/hrmp.rs b/pezkuwi/runtime/teyrchains/src/hrmp.rs index bb605b2f..9e650695 100644 --- a/pezkuwi/runtime/teyrchains/src/hrmp.rs +++ b/pezkuwi/runtime/teyrchains/src/hrmp.rs @@ -32,11 +32,11 @@ use pezkuwi_primitives::{ SessionIndex, }; use pezkuwi_teyrchain_primitives::primitives::{HorizontalMessages, IsSystem}; -use scale_info::TypeInfo; use pezsp_runtime::{ traits::{AccountIdConversion, BlakeTwo256, Hash as HashT, UniqueSaturatedInto, Zero}, ArithmeticError, }; +use scale_info::TypeInfo; pub use pezpallet::*; @@ -173,8 +173,8 @@ pub(crate) enum HrmpWatermarkAcceptanceErr { LandsOnBlockWithNoMessages { new_watermark: BlockNumber }, } -/// An error returned by [`Pezpallet::check_outbound_hrmp`] that indicates an acceptance criteria check -/// didn't pass. +/// An error returned by [`Pezpallet::check_outbound_hrmp`] that indicates an acceptance criteria +/// check didn't pass. pub(crate) enum OutboundHrmpAcceptanceErr { MoreMessagesThanPermitted { sent: u32, permitted: u32 }, NotSorted { idx: u32 }, @@ -260,7 +260,8 @@ pub mod pezpallet { { /// The outer event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type RuntimeOrigin: From + From<::RuntimeOrigin> diff --git a/pezkuwi/runtime/teyrchains/src/hrmp/benchmarking.rs b/pezkuwi/runtime/teyrchains/src/hrmp/benchmarking.rs index f51204be..d8f0374b 100644 --- a/pezkuwi/runtime/teyrchains/src/hrmp/benchmarking.rs +++ b/pezkuwi/runtime/teyrchains/src/hrmp/benchmarking.rs @@ -19,7 +19,7 @@ use crate::{ configuration::Pezpallet as Configuration, hrmp::{Pezpallet as Hrmp, *}, - paras::{Pezpallet as Paras, ParaKind, TeyrchainsCache}, + paras::{ParaKind, Pezpallet as Paras, TeyrchainsCache}, shared::Pezpallet as Shared, }; use pezframe_benchmarking::{v2::*, whitelisted_caller}; diff --git a/pezkuwi/runtime/teyrchains/src/inclusion/benchmarking.rs b/pezkuwi/runtime/teyrchains/src/inclusion/benchmarking.rs index cfd16e6d..46ecb584 100644 --- a/pezkuwi/runtime/teyrchains/src/inclusion/benchmarking.rs +++ b/pezkuwi/runtime/teyrchains/src/inclusion/benchmarking.rs @@ -16,11 +16,11 @@ use bitvec::{bitvec, prelude::Lsb0}; use pezframe_benchmarking::v2::*; -use pezpallet_message_queue as mq; use pezkuwi_primitives::{ CandidateCommitments, CommittedCandidateReceiptV2 as CommittedCandidateReceipt, HrmpChannelId, OutboundHrmpMessage, SessionIndex, }; +use pezpallet_message_queue as mq; use super::*; use crate::{ diff --git a/pezkuwi/runtime/teyrchains/src/inclusion/migration.rs b/pezkuwi/runtime/teyrchains/src/inclusion/migration.rs index a439bef0..f3e0e0a4 100644 --- a/pezkuwi/runtime/teyrchains/src/inclusion/migration.rs +++ b/pezkuwi/runtime/teyrchains/src/inclusion/migration.rs @@ -70,8 +70,8 @@ mod v1 { PendingAvailabilityCommitments as V0PendingAvailabilityCommitments, }; use crate::inclusion::{ - CandidatePendingAvailability as V1CandidatePendingAvailability, Config, Pezpallet, - PendingAvailability as V1PendingAvailability, + CandidatePendingAvailability as V1CandidatePendingAvailability, Config, + PendingAvailability as V1PendingAvailability, Pezpallet, }; use alloc::{collections::vec_deque::VecDeque, vec::Vec}; use pezframe_support::{traits::UncheckedOnRuntimeUpgrade, weights::Weight}; diff --git a/pezkuwi/runtime/teyrchains/src/inclusion/mod.rs b/pezkuwi/runtime/teyrchains/src/inclusion/mod.rs index 7dfbc78e..08c860f8 100644 --- a/pezkuwi/runtime/teyrchains/src/inclusion/mod.rs +++ b/pezkuwi/runtime/teyrchains/src/inclusion/mod.rs @@ -42,7 +42,6 @@ use pezframe_support::{ BoundedSlice, }; use pezframe_system::pezpallet_prelude::*; -use pezpallet_message_queue::OnQueueChanged; use pezkuwi_primitives::{ effective_minimum_backing_votes, skip_ump_signals, supermajority_threshold, well_known_keys, BackedCandidate, CandidateCommitments, CandidateDescriptorV2 as CandidateDescriptor, @@ -51,8 +50,9 @@ use pezkuwi_primitives::{ Id as ParaId, SignedAvailabilityBitfields, SigningContext, UpwardMessage, ValidatorId, ValidatorIndex, ValidityAttestation, }; -use scale_info::TypeInfo; +use pezpallet_message_queue::OnQueueChanged; use pezsp_runtime::{traits::One, DispatchError, SaturatedConversion, Saturating}; +use scale_info::TypeInfo; pub use pezpallet::*; @@ -289,7 +289,8 @@ pub mod pezpallet { + scheduler::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type DisputesHandler: disputes::DisputesHandler>; type RewardValidators: RewardValidators; diff --git a/pezkuwi/runtime/teyrchains/src/initializer.rs b/pezkuwi/runtime/teyrchains/src/initializer.rs index 88c6a9cc..4e7a323f 100644 --- a/pezkuwi/runtime/teyrchains/src/initializer.rs +++ b/pezkuwi/runtime/teyrchains/src/initializer.rs @@ -312,8 +312,8 @@ impl Pezpallet { } } - // Allow to trigger `on_new_session` in tests, this is needed as long as `pezpallet_session` is not - // implemented in mock. + // Allow to trigger `on_new_session` in tests, this is needed as long as `pezpallet_session` is + // not implemented in mock. #[cfg(any(test, feature = "runtime-benchmarks"))] pub(crate) fn test_trigger_on_new_session<'a, I: 'a>( changed: bool, diff --git a/pezkuwi/runtime/teyrchains/src/mock.rs b/pezkuwi/runtime/teyrchains/src/mock.rs index a583ec80..112f7baf 100644 --- a/pezkuwi/runtime/teyrchains/src/mock.rs +++ b/pezkuwi/runtime/teyrchains/src/mock.rs @@ -761,7 +761,9 @@ pub(crate) fn deregister_teyrchain(id: ParaId) { /// Calls `schedule_para_cleanup` in a new storage transactions, since it assumes rollback on error. pub(crate) fn try_deregister_teyrchain(id: ParaId) -> crate::DispatchResult { - pezframe_support::storage::transactional::with_storage_layer(|| Paras::schedule_para_cleanup(id)) + pezframe_support::storage::transactional::with_storage_layer(|| { + Paras::schedule_para_cleanup(id) + }) } pub(crate) fn set_disabled_validators(disabled: Vec) { diff --git a/pezkuwi/runtime/teyrchains/src/on_demand/benchmarking.rs b/pezkuwi/runtime/teyrchains/src/on_demand/benchmarking.rs index afdb84ee..30fccf89 100644 --- a/pezkuwi/runtime/teyrchains/src/on_demand/benchmarking.rs +++ b/pezkuwi/runtime/teyrchains/src/on_demand/benchmarking.rs @@ -21,7 +21,7 @@ use super::{Pezpallet, *}; use crate::{ configuration::{HostConfiguration, Pezpallet as ConfigurationPallet}, - paras::{Pezpallet as ParasPallet, ParaGenesisArgs, ParaKind, TeyrchainsCache}, + paras::{ParaGenesisArgs, ParaKind, Pezpallet as ParasPallet, TeyrchainsCache}, shared::Pezpallet as ParasShared, }; diff --git a/pezkuwi/runtime/teyrchains/src/on_demand/mod.rs b/pezkuwi/runtime/teyrchains/src/on_demand/mod.rs index 64d13c67..39ca1d79 100644 --- a/pezkuwi/runtime/teyrchains/src/on_demand/mod.rs +++ b/pezkuwi/runtime/teyrchains/src/on_demand/mod.rs @@ -118,7 +118,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config + configuration::Config + paras::Config { /// The runtime's definition of an event. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// The runtime's definition of a Currency. type Currency: Currency; @@ -490,8 +491,8 @@ where existence_requirement, )?; - // Consume the negative imbalance and deposit it into the pezpallet account. Make - // sure the account preserves even without the existential deposit. + // Consume the negative imbalance and deposit it into the pezpallet account. + // Make sure the account preserves even without the existential deposit. let pot = Self::account_id(); if !System::::account_exists(&pot) { System::::inc_providers(&pot); @@ -759,7 +760,8 @@ where amount } - /// Account of the pezpallet pot, where the funds from instantaneous coretime sale are accumulated. + /// Account of the pezpallet pot, where the funds from instantaneous coretime sale are + /// accumulated. pub fn account_id() -> T::AccountId { T::PalletId::get().into_account_truncating() } @@ -786,7 +788,11 @@ where pub fn populate_queue(para_id: ParaId, num: u32) { QueueStatus::::mutate(|queue_status| { for _ in 0..num { - Pezpallet::::add_on_demand_order(queue_status, para_id, QueuePushDirection::Back); + Pezpallet::::add_on_demand_order( + queue_status, + para_id, + QueuePushDirection::Back, + ); } }); } diff --git a/pezkuwi/runtime/teyrchains/src/on_demand/tests.rs b/pezkuwi/runtime/teyrchains/src/on_demand/tests.rs index 78fd0d2d..d3981403 100644 --- a/pezkuwi/runtime/teyrchains/src/on_demand/tests.rs +++ b/pezkuwi/runtime/teyrchains/src/on_demand/tests.rs @@ -32,8 +32,8 @@ use crate::{ }; use core::cmp::{Ord, Ordering}; use pezframe_support::{assert_noop, assert_ok}; -use pezpallet_balances::Error as BalancesError; use pezkuwi_primitives::{BlockNumber, SessionIndex, ValidationCode, ON_DEMAND_MAX_QUEUE_MAX_SIZE}; +use pezpallet_balances::Error as BalancesError; use pezsp_runtime::traits::BadOrigin; fn schedule_blank_para(id: ParaId, parakind: ParaKind) { diff --git a/pezkuwi/runtime/teyrchains/src/paras/benchmarking.rs b/pezkuwi/runtime/teyrchains/src/paras/benchmarking.rs index bcb597ec..8155e230 100644 --- a/pezkuwi/runtime/teyrchains/src/paras/benchmarking.rs +++ b/pezkuwi/runtime/teyrchains/src/paras/benchmarking.rs @@ -198,8 +198,11 @@ mod benchmarks { #[block] { - let _ = - Pezpallet::::include_pvf_check_statement(RawOrigin::None.into(), stmt, signature); + let _ = Pezpallet::::include_pvf_check_statement( + RawOrigin::None.into(), + stmt, + signature, + ); } } @@ -210,8 +213,11 @@ mod benchmarks { #[block] { - let _ = - Pezpallet::::include_pvf_check_statement(RawOrigin::None.into(), stmt, signature); + let _ = Pezpallet::::include_pvf_check_statement( + RawOrigin::None.into(), + stmt, + signature, + ); } } @@ -222,8 +228,11 @@ mod benchmarks { #[block] { - let _ = - Pezpallet::::include_pvf_check_statement(RawOrigin::None.into(), stmt, signature); + let _ = Pezpallet::::include_pvf_check_statement( + RawOrigin::None.into(), + stmt, + signature, + ); } } @@ -234,8 +243,11 @@ mod benchmarks { #[block] { - let _ = - Pezpallet::::include_pvf_check_statement(RawOrigin::None.into(), stmt, signature); + let _ = Pezpallet::::include_pvf_check_statement( + RawOrigin::None.into(), + stmt, + signature, + ); } } @@ -246,8 +258,11 @@ mod benchmarks { #[block] { - let _ = - Pezpallet::::include_pvf_check_statement(RawOrigin::None.into(), stmt, signature); + let _ = Pezpallet::::include_pvf_check_statement( + RawOrigin::None.into(), + stmt, + signature, + ); } } @@ -257,7 +272,8 @@ mod benchmarks { let old_code_hash = ValidationCode(vec![0]).hash(); CurrentCodeHash::::insert(¶_id, old_code_hash); pezframe_system::Pezpallet::::set_block_number(10u32.into()); - let inclusion = pezframe_system::Pezpallet::::block_number().saturating_add(10u32.into()); + let inclusion = + pezframe_system::Pezpallet::::block_number().saturating_add(10u32.into()); let config = HostConfiguration::>::default(); Pezpallet::::schedule_code_upgrade( para_id, @@ -297,7 +313,8 @@ mod benchmarks { Event::CodeAuthorized { para_id, code_hash: new_code_hash, - expire_at: pezframe_system::Pezpallet::::block_number().saturating_add(valid_period), + expire_at: pezframe_system::Pezpallet::::block_number() + .saturating_add(valid_period), } .into(), ); @@ -307,8 +324,8 @@ mod benchmarks { fn apply_authorized_force_set_current_code(c: Linear) { let code = ValidationCode(vec![0; c as usize]); let para_id = ParaId::from(1000); - let expire_at = - pezframe_system::Pezpallet::::block_number().saturating_add(BlockNumberFor::::from(c)); + let expire_at = pezframe_system::Pezpallet::::block_number() + .saturating_add(BlockNumberFor::::from(c)); AuthorizedCodeHash::::insert( ¶_id, AuthorizedCodeHashAndExpiry::from((code.hash(), expire_at)), diff --git a/pezkuwi/runtime/teyrchains/src/paras/mod.rs b/pezkuwi/runtime/teyrchains/src/paras/mod.rs index c5c5b6c3..6559375f 100644 --- a/pezkuwi/runtime/teyrchains/src/paras/mod.rs +++ b/pezkuwi/runtime/teyrchains/src/paras/mod.rs @@ -127,12 +127,12 @@ use pezkuwi_primitives::{ ConsensusLog, HeadData, Id as ParaId, PvfCheckStatement, SessionIndex, UpgradeGoAhead, UpgradeRestriction, ValidationCode, ValidationCodeHash, ValidatorSignature, MIN_CODE_SIZE, }; -use scale_info::{Type, TypeInfo}; use pezsp_core::RuntimeDebug; use pezsp_runtime::{ traits::{AppVerify, One, Saturating}, DispatchResult, SaturatedConversion, }; +use scale_info::{Type, TypeInfo}; use serde::{Deserialize, Serialize}; @@ -664,7 +664,8 @@ pub mod pezpallet { + pezframe_system::offchain::CreateBare> { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; #[pezpallet::constant] type UnsignedPriority: Get; @@ -706,8 +707,9 @@ pub mod pezpallet { /// The origin that can authorize [`Pezpallet::authorize_force_set_current_code_hash`]. /// - /// In the end this allows [`Pezpallet::apply_authorized_force_set_current_code`] to force set - /// the current code without paying any fee. So, the origin should be chosen with care. + /// In the end this allows [`Pezpallet::apply_authorized_force_set_current_code`] to force + /// set the current code without paying any fee. So, the origin should be chosen with + /// care. type AuthorizeCurrentCodeOrigin: EnsureOriginWithArg; } @@ -2420,7 +2422,11 @@ impl Pezpallet { fn do_force_set_current_code_update(para: ParaId, new_code: ValidationCode) { let new_code_hash = new_code.hash(); Self::increase_code_ref(&new_code_hash, &new_code); - Self::set_current_code(para, new_code_hash, pezframe_system::Pezpallet::::block_number()); + Self::set_current_code( + para, + new_code_hash, + pezframe_system::Pezpallet::::block_number(), + ); Self::deposit_event(Event::CurrentCodeUpdated(para)); } diff --git a/pezkuwi/runtime/teyrchains/src/paras_inherent/mod.rs b/pezkuwi/runtime/teyrchains/src/paras_inherent/mod.rs index 82e57958..3337c035 100644 --- a/pezkuwi/runtime/teyrchains/src/paras_inherent/mod.rs +++ b/pezkuwi/runtime/teyrchains/src/paras_inherent/mod.rs @@ -47,7 +47,6 @@ use pezframe_support::{ }; use pezframe_system::pezpallet_prelude::*; -use pezpallet_babe::{self, ParentBlockRandomness}; use pezkuwi_primitives::{ effective_minimum_backing_votes, node_features::FeatureIndex, BackedCandidate, CandidateDescriptorVersion, CandidateHash, CandidateReceiptV2 as CandidateReceipt, @@ -57,9 +56,10 @@ use pezkuwi_primitives::{ UncheckedSignedAvailabilityBitfield, UncheckedSignedAvailabilityBitfields, ValidatorId, ValidatorIndex, ValidityAttestation, TEYRCHAINS_INHERENT_IDENTIFIER, }; +use pezpallet_babe::{self, ParentBlockRandomness}; +use pezsp_runtime::traits::{Header as HeaderT, One}; use rand::{seq::SliceRandom, SeedableRng}; use scale_info::TypeInfo; -use pezsp_runtime::traits::{Header as HeaderT, One}; mod misc; mod weights; @@ -1372,11 +1372,13 @@ fn filter_unchained_candidates)> = BTreeMap::new(); for para_id in candidates.keys() { - let Some(latest_head_data) = inclusion::Pezpallet::::para_latest_head_data(¶_id) else { + let Some(latest_head_data) = inclusion::Pezpallet::::para_latest_head_data(¶_id) + else { defensive!("Latest included head data for paraid {:?} is None", para_id); continue; }; - let Some(latest_relay_parent) = inclusion::Pezpallet::::para_most_recent_context(¶_id) + let Some(latest_relay_parent) = + inclusion::Pezpallet::::para_most_recent_context(¶_id) else { defensive!("Latest relay parent for paraid {:?} is None", para_id); continue; diff --git a/pezkuwi/runtime/teyrchains/src/paras_inherent/tests.rs b/pezkuwi/runtime/teyrchains/src/paras_inherent/tests.rs index ae31ce17..ff3b71f6 100644 --- a/pezkuwi/runtime/teyrchains/src/paras_inherent/tests.rs +++ b/pezkuwi/runtime/teyrchains/src/paras_inherent/tests.rs @@ -63,10 +63,10 @@ mod enter { MutateDescriptorV2, UMPSignal, UncheckedSigned, }; use pezkuwi_primitives_test_helpers::CandidateDescriptor; - use pretty_assertions::assert_eq; - use rstest::rstest; use pezsp_core::ByteArray; use pezsp_runtime::Perbill; + use pretty_assertions::assert_eq; + use rstest::rstest; struct TestConfig { dispute_statements: BTreeMap, @@ -2040,7 +2040,8 @@ mod enter { // * 5 v2 candidate descriptors. assert_eq!(inherent_data.backed_candidates.len(), 5); - Pezpallet::::enter(pezframe_system::RawOrigin::None.into(), inherent_data).unwrap(); + Pezpallet::::enter(pezframe_system::RawOrigin::None.into(), inherent_data) + .unwrap(); }); } @@ -2099,7 +2100,8 @@ mod enter { // * 5 v2 candidate descriptors. assert_eq!(inherent_data.backed_candidates.len(), 5); - Pezpallet::::enter(pezframe_system::RawOrigin::None.into(), inherent_data).unwrap(); + Pezpallet::::enter(pezframe_system::RawOrigin::None.into(), inherent_data) + .unwrap(); }); } @@ -2264,7 +2266,8 @@ mod enter { expected_inherent_data ); - Pezpallet::::enter(pezframe_system::RawOrigin::None.into(), inherent_data).unwrap_err(); + Pezpallet::::enter(pezframe_system::RawOrigin::None.into(), inherent_data) + .unwrap_err(); }); } @@ -2374,8 +2377,8 @@ mod sanitizers { AvailabilityBitfield, GroupIndex, Hash, Id as ParaId, SignedAvailabilityBitfield, ValidatorIndex, }; - use rstest::rstest; use pezsp_core::crypto::UncheckedFrom; + use rstest::rstest; use crate::mock::Test; use pezkuwi_primitives::TEYRCHAIN_KEY_TYPE_ID; @@ -2644,8 +2647,8 @@ mod sanitizers { fn get_test_data_one_core_per_para(backing_kind: BackingKind) -> TestData { const RELAY_PARENT_NUM: u32 = 3; - // Add the relay parent to `shared` pezpallet. Otherwise some code (e.g. filtering backing - // votes) won't behave correctly + // Add the relay parent to `shared` pezpallet. Otherwise some code (e.g. filtering + // backing votes) won't behave correctly shared::Pezpallet::::add_allowed_relay_parent( default_header().hash(), Default::default(), @@ -2967,8 +2970,8 @@ mod sanitizers { ), ])); - // Add the relay parent to `shared` pezpallet. Otherwise some code (e.g. filtering backing - // votes) won't behave correctly + // Add the relay parent to `shared` pezpallet. Otherwise some code (e.g. filtering + // backing votes) won't behave correctly shared::Pezpallet::::add_allowed_relay_parent( relay_parent, Default::default(), @@ -2984,7 +2987,10 @@ mod sanitizers { // Set the on-chain included head data and current code hash. for id in 1..=8u32 { - paras::Pezpallet::::set_current_head(ParaId::from(id), HeadData(vec![id as u8])); + paras::Pezpallet::::set_current_head( + ParaId::from(id), + HeadData(vec![id as u8]), + ); paras::Pezpallet::::force_set_current_code( RuntimeOrigin::root(), ParaId::from(id), @@ -3508,7 +3514,10 @@ mod sanitizers { // Set the on-chain included head data and current code hash. for id in 1..=4u32 { - paras::Pezpallet::::set_current_head(ParaId::from(id), HeadData(vec![id as u8])); + paras::Pezpallet::::set_current_head( + ParaId::from(id), + HeadData(vec![id as u8]), + ); paras::Pezpallet::::force_set_current_code( RuntimeOrigin::root(), ParaId::from(id), @@ -3878,8 +3887,8 @@ mod sanitizers { } .hash(); - // Add the relay parent to `shared` pezpallet. Otherwise some code (e.g. filtering backing - // votes) won't behave correctly + // Add the relay parent to `shared` pezpallet. Otherwise some code (e.g. filtering + // backing votes) won't behave correctly shared::Pezpallet::::add_allowed_relay_parent( prev_relay_parent, Default::default(), @@ -3990,7 +3999,10 @@ mod sanitizers { // Set the on-chain included head data and current code hash. for id in 1..=2u32 { - paras::Pezpallet::::set_current_head(ParaId::from(id), HeadData(vec![id as u8])); + paras::Pezpallet::::set_current_head( + ParaId::from(id), + HeadData(vec![id as u8]), + ); paras::Pezpallet::::force_set_current_code( RuntimeOrigin::root(), ParaId::from(id), diff --git a/pezkuwi/runtime/teyrchains/src/runtime_api_impl/v13.rs b/pezkuwi/runtime/teyrchains/src/runtime_api_impl/v13.rs index af76f864..a1a26552 100644 --- a/pezkuwi/runtime/teyrchains/src/runtime_api_impl/v13.rs +++ b/pezkuwi/runtime/teyrchains/src/runtime_api_impl/v13.rs @@ -127,8 +127,9 @@ fn current_relay_parent( use codec::Decode as _; let state_version = pezframe_system::Pezpallet::::runtime_version().state_version(); let relay_parent_number = pezframe_system::Pezpallet::::block_number(); - let relay_parent_storage_root = T::Hash::decode(&mut &pezsp_io::storage::root(state_version)[..]) - .expect("storage root must decode to the Hash type; qed"); + let relay_parent_storage_root = + T::Hash::decode(&mut &pezsp_io::storage::root(state_version)[..]) + .expect("storage root must decode to the Hash type; qed"); (relay_parent_number, relay_parent_storage_root) } @@ -148,7 +149,8 @@ where }, OccupiedCoreAssumption::TimedOut => build(), OccupiedCoreAssumption::Free => - if !>::candidates_pending_availability(para_id).is_empty() { + if !>::candidates_pending_availability(para_id).is_empty() + { None } else { build() @@ -238,8 +240,10 @@ pub fn relevant_authority_ids::current_authorities().to_vec(); - authority_ids.extend(pezpallet_authority_discovery::Pezpallet::::next_authorities().to_vec()); + let mut authority_ids = + pezpallet_authority_discovery::Pezpallet::::current_authorities().to_vec(); + authority_ids + .extend(pezpallet_authority_discovery::Pezpallet::::next_authorities().to_vec()); // Due to disputes, we'd like to remain connected to authorities of the previous few sessions. // For this, we don't need anyone other than the validators actively participating in consensus. @@ -261,7 +265,9 @@ pub fn validation_code( para_id: ParaId, assumption: OccupiedCoreAssumption, ) -> Option { - with_assumption::(para_id, assumption, || paras::Pezpallet::::current_code(¶_id)) + with_assumption::(para_id, assumption, || { + paras::Pezpallet::::current_code(¶_id) + }) } /// Implementation for the `candidate_pending_availability` function of the runtime API. diff --git a/pezkuwi/runtime/teyrchains/src/scheduler/common.rs b/pezkuwi/runtime/teyrchains/src/scheduler/common.rs index 9b082e2f..b511e0d8 100644 --- a/pezkuwi/runtime/teyrchains/src/scheduler/common.rs +++ b/pezkuwi/runtime/teyrchains/src/scheduler/common.rs @@ -16,11 +16,11 @@ //! Common traits and types used by the scheduler and assignment providers. -use scale_info::TypeInfo; use pezsp_runtime::{ codec::{Decode, Encode}, RuntimeDebug, }; +use scale_info::TypeInfo; use pezkuwi_primitives::{CoreIndex, Id as ParaId}; diff --git a/pezkuwi/runtime/teyrchains/src/scheduler/migration.rs b/pezkuwi/runtime/teyrchains/src/scheduler/migration.rs index 1247aac2..d203c261 100644 --- a/pezkuwi/runtime/teyrchains/src/scheduler/migration.rs +++ b/pezkuwi/runtime/teyrchains/src/scheduler/migration.rs @@ -38,7 +38,8 @@ mod v0 { use pezkuwi_primitives::{CollatorId, Id}; #[storage_alias] - pub(super) type Scheduled = StorageValue, Vec, ValueQuery>; + pub(super) type Scheduled = + StorageValue, Vec, ValueQuery>; #[derive(Clone, Encode, Decode)] #[cfg_attr(feature = "std", derive(PartialEq))] diff --git a/pezkuwi/runtime/teyrchains/src/shared/migration.rs b/pezkuwi/runtime/teyrchains/src/shared/migration.rs index ffdbe7d7..d4bec268 100644 --- a/pezkuwi/runtime/teyrchains/src/shared/migration.rs +++ b/pezkuwi/runtime/teyrchains/src/shared/migration.rs @@ -30,7 +30,10 @@ pub mod v0 { #[storage_alias] pub(crate) type AllowedRelayParents = StorageValue< Pezpallet, - super::v0::AllowedRelayParentsTracker<::Hash, BlockNumberFor>, + super::v0::AllowedRelayParentsTracker< + ::Hash, + BlockNumberFor, + >, ValueQuery, >; diff --git a/pezkuwi/runtime/teyrchains/src/ump_tests.rs b/pezkuwi/runtime/teyrchains/src/ump_tests.rs index b5b8733d..8743c427 100644 --- a/pezkuwi/runtime/teyrchains/src/ump_tests.rs +++ b/pezkuwi/runtime/teyrchains/src/ump_tests.rs @@ -209,7 +209,10 @@ mod check_upward_messages { fn queue_size_exceeded_error() { new_test_ext(GenesisConfigBuilder::large_queue_count().build()).execute_with(|| { let limit = configuration::ActiveConfig::::get().max_upward_queue_size as u64; - assert_eq!(pezpallet_message_queue::ItemHeader::::max_encoded_len(), 5); + assert_eq!( + pezpallet_message_queue::ItemHeader::::max_encoded_len(), + 5 + ); assert!( configuration::ActiveConfig::::get().max_upward_queue_size < crate::inclusion::MaxUmpMessageLenOf::::get(), diff --git a/pezkuwi/runtime/zagros/constants/src/lib.rs b/pezkuwi/runtime/zagros/constants/src/lib.rs index f094483a..f1c6e716 100644 --- a/pezkuwi/runtime/zagros/constants/src/lib.rs +++ b/pezkuwi/runtime/zagros/constants/src/lib.rs @@ -63,8 +63,8 @@ pub mod fee { WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }; use pezkuwi_primitives::Balance; - use smallvec::smallvec; pub use pezsp_runtime::Perbill; + use smallvec::smallvec; /// The block saturation level. Fees will be updates based on this value. pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25); diff --git a/pezkuwi/runtime/zagros/src/genesis_config_presets.rs b/pezkuwi/runtime/zagros/src/genesis_config_presets.rs index 79999df0..4e356862 100644 --- a/pezkuwi/runtime/zagros/src/genesis_config_presets.rs +++ b/pezkuwi/runtime/zagros/src/genesis_config_presets.rs @@ -24,8 +24,8 @@ use crate::{ use alloc::format; use alloc::{vec, vec::Vec}; use pezframe_support::build_struct_json_patch; -use pezpallet_staking::{Forcing, StakerStatus}; use pezkuwi_primitives::{AccountId, AssignmentId, SchedulerParams, ValidatorId}; +use pezpallet_staking::{Forcing, StakerStatus}; use pezsp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use pezsp_consensus_babe::AuthorityId as BabeId; use pezsp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId; diff --git a/pezkuwi/runtime/zagros/src/lib.rs b/pezkuwi/runtime/zagros/src/lib.rs index f31c2c27..09278a7c 100644 --- a/pezkuwi/runtime/zagros/src/lib.rs +++ b/pezkuwi/runtime/zagros/src/lib.rs @@ -28,7 +28,9 @@ use alloc::{ vec::Vec, }; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use pezframe_election_provider_support::{bounds::ElectionBoundsBuilder, onchain, SequentialPhragmen}; +use pezframe_election_provider_support::{ + bounds::ElectionBoundsBuilder, onchain, SequentialPhragmen, +}; use pezframe_support::{ derive_impl, dynamic_params::{dynamic_pallet_params, dynamic_params}, @@ -44,15 +46,6 @@ use pezframe_support::{ PalletId, }; use pezframe_system::{EnsureRoot, EnsureSigned}; -use pezpallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; -use pezpallet_identity::legacy::IdentityInfo; -use pezpallet_nomination_pools::PoolId; -use pezpallet_session::historical as session_historical; -use pezpallet_staking::UseValidatorsMap; -use pezpallet_staking_async_ah_client as ah_client; -use pezpallet_staking_async_rc_client as rc_client; -use pezpallet_transaction_payment::{FeeDetails, FungibleAdapter, RuntimeDispatchInfo}; -use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezkuwi_primitives::{ async_backing::Constraints, slashing, AccountId, AccountIndex, ApprovalVotingParams, Balance, BlockNumber, CandidateEvent, CandidateHash, @@ -91,7 +84,15 @@ use pezkuwi_runtime_teyrchains::{ scheduler as teyrchains_scheduler, session_info as teyrchains_session_info, shared as teyrchains_shared, }; -use scale_info::TypeInfo; +use pezpallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; +use pezpallet_identity::legacy::IdentityInfo; +use pezpallet_nomination_pools::PoolId; +use pezpallet_session::historical as session_historical; +use pezpallet_staking::UseValidatorsMap; +use pezpallet_staking_async_ah_client as ah_client; +use pezpallet_staking_async_rc_client as rc_client; +use pezpallet_transaction_payment::{FeeDetails, FungibleAdapter, RuntimeDispatchInfo}; +use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezsp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use pezsp_consensus_beefy::{ ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature}, @@ -113,6 +114,7 @@ use pezsp_staking::{EraIndex, SessionIndex}; #[cfg(any(feature = "std", test))] use pezsp_version::NativeVersion; use pezsp_version::RuntimeVersion; +use scale_info::TypeInfo; use xcm::{ latest::prelude::*, Version as XcmVersion, VersionedAsset, VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm, @@ -148,8 +150,8 @@ use impls::ToTeyrchainIdentityReaper; // Governance and configurations. pub mod governance; use governance::{ - pezpallet_custom_origins, AuctionAdmin, FellowshipAdmin, GeneralAdmin, LeaseAdmin, StakingAdmin, - Treasurer, TreasurySpender, + pezpallet_custom_origins, AuctionAdmin, FellowshipAdmin, GeneralAdmin, LeaseAdmin, + StakingAdmin, Treasurer, TreasurySpender, }; use xcm_config::XcmConfig; @@ -193,10 +195,10 @@ pub fn native_version() -> NativeVersion { NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } } -/// A type to identify calls to the Identity pezpallet. These will be filtered to prevent invocation, -/// locking the state of the pezpallet and preventing further updates to identities and sub-identities. -/// The locked state will be the genesis state of a new system chain and then removed from the Relay -/// Chain. +/// A type to identify calls to the Identity pezpallet. These will be filtered to prevent +/// invocation, locking the state of the pezpallet and preventing further updates to identities and +/// sub-identities. The locked state will be the genesis state of a new system chain and then +/// removed from the Relay Chain. pub struct IsIdentityCall; impl Contains for IsIdentityCall { fn contains(c: &RuntimeCall) -> bool { diff --git a/pezkuwi/runtime/zagros/src/weights/mod.rs b/pezkuwi/runtime/zagros/src/weights/mod.rs index eef7c24e..1ade7139 100644 --- a/pezkuwi/runtime/zagros/src/weights/mod.rs +++ b/pezkuwi/runtime/zagros/src/weights/mod.rs @@ -18,6 +18,22 @@ pub mod pezframe_election_provider_support; pub mod pezframe_system; pub mod pezframe_system_extensions; +pub mod pezkuwi_runtime_common_assigned_slots; +pub mod pezkuwi_runtime_common_auctions; +pub mod pezkuwi_runtime_common_crowdloan; +pub mod pezkuwi_runtime_common_identity_migrator; +pub mod pezkuwi_runtime_common_paras_registrar; +pub mod pezkuwi_runtime_common_slots; +pub mod pezkuwi_runtime_teyrchains_configuration; +pub mod pezkuwi_runtime_teyrchains_coretime; +pub mod pezkuwi_runtime_teyrchains_disputes; +pub mod pezkuwi_runtime_teyrchains_disputes_slashing; +pub mod pezkuwi_runtime_teyrchains_hrmp; +pub mod pezkuwi_runtime_teyrchains_inclusion; +pub mod pezkuwi_runtime_teyrchains_initializer; +pub mod pezkuwi_runtime_teyrchains_on_demand; +pub mod pezkuwi_runtime_teyrchains_paras; +pub mod pezkuwi_runtime_teyrchains_paras_inherent; pub mod pezpallet_asset_rate; pub mod pezpallet_bags_list; pub mod pezpallet_balances; @@ -49,20 +65,4 @@ pub mod pezpallet_verify_signature; pub mod pezpallet_vesting; pub mod pezpallet_whitelist; pub mod pezpallet_xcm; -pub mod pezkuwi_runtime_common_assigned_slots; -pub mod pezkuwi_runtime_common_auctions; -pub mod pezkuwi_runtime_common_crowdloan; -pub mod pezkuwi_runtime_common_identity_migrator; -pub mod pezkuwi_runtime_common_paras_registrar; -pub mod pezkuwi_runtime_common_slots; -pub mod pezkuwi_runtime_teyrchains_configuration; -pub mod pezkuwi_runtime_teyrchains_coretime; -pub mod pezkuwi_runtime_teyrchains_disputes; -pub mod pezkuwi_runtime_teyrchains_disputes_slashing; -pub mod pezkuwi_runtime_teyrchains_hrmp; -pub mod pezkuwi_runtime_teyrchains_inclusion; -pub mod pezkuwi_runtime_teyrchains_initializer; -pub mod pezkuwi_runtime_teyrchains_on_demand; -pub mod pezkuwi_runtime_teyrchains_paras; -pub mod pezkuwi_runtime_teyrchains_paras_inherent; pub mod xcm; diff --git a/pezkuwi/runtime/zagros/src/xcm_config.rs b/pezkuwi/runtime/zagros/src/xcm_config.rs index a0a2fdaf..85380521 100644 --- a/pezkuwi/runtime/zagros/src/xcm_config.rs +++ b/pezkuwi/runtime/zagros/src/xcm_config.rs @@ -27,11 +27,11 @@ use pezframe_support::{ traits::{Contains, Disabled, Equals, Everything, Nothing}, }; use pezframe_system::EnsureRoot; -use pezpallet_xcm::XcmPassthrough; use pezkuwi_runtime_common::{ xcm_sender::{ChildTeyrchainRouter, ExponentialPrice}, ToAuthor, }; +use pezpallet_xcm::XcmPassthrough; use pezsp_core::ConstU32; use xcm::latest::{prelude::*, ZAGROS_GENESIS_HASH}; use xcm_builder::{ diff --git a/pezkuwi/tests/common.rs b/pezkuwi/tests/common.rs index a1d09ca3..23282602 100644 --- a/pezkuwi/tests/common.rs +++ b/pezkuwi/tests/common.rs @@ -14,13 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Pezkuwi. If not, see . +use bizinikiwi_rpc_client::{ws_client, ChainApi}; use pezkuwi_core_primitives::{Block, Hash, Header}; use std::{ future::Future, io::{BufRead, BufReader, Read}, time::Duration, }; -use bizinikiwi_rpc_client::{ws_client, ChainApi}; /// Run the given `future` and panic if the `timeout` is hit. pub async fn run_with_timeout(timeout: Duration, future: impl Future) { diff --git a/pezkuwi/teyrchain/src/primitives.rs b/pezkuwi/teyrchain/src/primitives.rs index 47834f52..975ad3dc 100644 --- a/pezkuwi/teyrchain/src/primitives.rs +++ b/pezkuwi/teyrchain/src/primitives.rs @@ -21,11 +21,11 @@ use alloc::vec::Vec; use bounded_collections::{BoundedVec, ConstU32}; use codec::{CompactAs, Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; -use serde::{Deserialize, Serialize}; use pezsp_core::{bytes, RuntimeDebug, TypeId}; use pezsp_runtime::traits::Hash as _; use pezsp_weights::Weight; +use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; use pezkuwi_core_primitives::{Hash, OutboundHrmpMessage}; diff --git a/pezkuwi/teyrchain/test-teyrchains/adder/collator/src/cli.rs b/pezkuwi/teyrchain/test-teyrchains/adder/collator/src/cli.rs index b63cb548..fcb9c9d0 100644 --- a/pezkuwi/teyrchain/test-teyrchains/adder/collator/src/cli.rs +++ b/pezkuwi/teyrchain/test-teyrchains/adder/collator/src/cli.rs @@ -100,7 +100,10 @@ impl BizinikiwiCli for Cli { "adder-collator".into() } - fn load_spec(&self, id: &str) -> std::result::Result, String> { + fn load_spec( + &self, + id: &str, + ) -> std::result::Result, String> { let id = if id.is_empty() { "pezkuwichain" } else { id }; Ok(match id { "pezkuwichain-staging" => diff --git a/pezkuwi/teyrchain/test-teyrchains/adder/collator/src/main.rs b/pezkuwi/teyrchain/test-teyrchains/adder/collator/src/main.rs index a2842401..8828cfde 100644 --- a/pezkuwi/teyrchain/test-teyrchains/adder/collator/src/main.rs +++ b/pezkuwi/teyrchain/test-teyrchains/adder/collator/src/main.rs @@ -17,10 +17,10 @@ //! Collator for the adder test teyrchain. use pezkuwi_cli::{Error, Result}; -use pezkuwi_pez_node_primitives::CollationGenerationConfig; use pezkuwi_node_subsystem::messages::{CollationGenerationMessage, CollatorProtocolMessage}; +use pezkuwi_pez_node_primitives::CollationGenerationConfig; use pezkuwi_primitives::Id as ParaId; -use pezsc_cli::{Error as BizinikiwiCliError, BizinikiwiCli}; +use pezsc_cli::{BizinikiwiCli, Error as BizinikiwiCliError}; use pezsp_core::hexdisplay::HexDisplay; use std::{ collections::HashSet, diff --git a/pezkuwi/teyrchain/test-teyrchains/undying/collator/src/cli.rs b/pezkuwi/teyrchain/test-teyrchains/undying/collator/src/cli.rs index 5d0fb085..4fc243f0 100644 --- a/pezkuwi/teyrchain/test-teyrchains/undying/collator/src/cli.rs +++ b/pezkuwi/teyrchain/test-teyrchains/undying/collator/src/cli.rs @@ -139,7 +139,10 @@ impl BizinikiwiCli for Cli { "undying-collator".into() } - fn load_spec(&self, id: &str) -> std::result::Result, String> { + fn load_spec( + &self, + id: &str, + ) -> std::result::Result, String> { let id = if id.is_empty() { "pezkuwichain" } else { id }; Ok(match id { "pezkuwichain-staging" => diff --git a/pezkuwi/teyrchain/test-teyrchains/undying/collator/src/lib.rs b/pezkuwi/teyrchain/test-teyrchains/undying/collator/src/lib.rs index dc20a969..23bd0eed 100644 --- a/pezkuwi/teyrchain/test-teyrchains/undying/collator/src/lib.rs +++ b/pezkuwi/teyrchain/test-teyrchains/undying/collator/src/lib.rs @@ -20,11 +20,11 @@ use codec::{Decode, Encode}; use futures::{channel::oneshot, StreamExt}; use futures_timer::Delay; use pezkuwi_cli::ProvideRuntimeApi; +use pezkuwi_node_subsystem::messages::CollatorProtocolMessage; use pezkuwi_pez_node_primitives::{ maybe_compress_pov, AvailableData, Collation, CollationResult, CollationSecondedSignal, CollatorFn, MaybeCompressedPoV, PoV, Statement, UpwardMessages, }; -use pezkuwi_node_subsystem::messages::CollatorProtocolMessage; use pezkuwi_primitives::{ CandidateCommitments, CandidateDescriptorV2, CandidateReceiptV2, ClaimQueueOffset, CollatorId, CollatorPair, CoreIndex, Hash, Id as ParaId, OccupiedCoreAssumption, diff --git a/pezkuwi/teyrchain/test-teyrchains/undying/collator/src/main.rs b/pezkuwi/teyrchain/test-teyrchains/undying/collator/src/main.rs index 0e51d55a..f590520e 100644 --- a/pezkuwi/teyrchain/test-teyrchains/undying/collator/src/main.rs +++ b/pezkuwi/teyrchain/test-teyrchains/undying/collator/src/main.rs @@ -17,10 +17,10 @@ //! Collator for the `Undying` test teyrchain. use pezkuwi_cli::{Error, Result}; -use pezkuwi_pez_node_primitives::CollationGenerationConfig; use pezkuwi_node_subsystem::messages::{CollationGenerationMessage, CollatorProtocolMessage}; +use pezkuwi_pez_node_primitives::CollationGenerationConfig; use pezkuwi_primitives::Id as ParaId; -use pezsc_cli::{Error as BizinikiwiCliError, BizinikiwiCli}; +use pezsc_cli::{BizinikiwiCli, Error as BizinikiwiCliError}; use pezsp_core::hexdisplay::HexDisplay; use std::{ collections::HashSet, diff --git a/pezkuwi/xcm/docs/src/fundamentals.rs b/pezkuwi/xcm/docs/src/fundamentals.rs index 726a1cdb..f1555989 100644 --- a/pezkuwi/xcm/docs/src/fundamentals.rs +++ b/pezkuwi/xcm/docs/src/fundamentals.rs @@ -47,8 +47,8 @@ //! configurable. //! - [`Builder`](xcm_builder): A collection of types used to configure the executor. //! - [`XCM Pezpallet`](pezpallet_xcm): A FRAME pezpallet for interacting with the executor. -//! - [`Simulator`](xcm_pez_simulator): A playground to tinker with different XCM programs and executor -//! configurations. +//! - [`Simulator`](xcm_pez_simulator): A playground to tinker with different XCM programs and +//! executor configurations. //! //! XCM programs are composed of Instructions, which reference Locations and Assets. //! diff --git a/pezkuwi/xcm/pezpallet-xcm/precompiles/src/lib.rs b/pezkuwi/xcm/pezpallet-xcm/precompiles/src/lib.rs index c055c7b2..65a33776 100644 --- a/pezkuwi/xcm/pezpallet-xcm/precompiles/src/lib.rs +++ b/pezkuwi/xcm/pezpallet-xcm/precompiles/src/lib.rs @@ -142,7 +142,8 @@ where }; // Adjust gas using actual weight or fallback to initially charged weight - let actual_weight = pezframe_support::dispatch::extract_actual_weight(&result, &pre); + let actual_weight = + pezframe_support::dispatch::extract_actual_weight(&result, &pre); env.adjust_gas(charged_amount, actual_weight); result.map(|_| Vec::new()).map_err(|error| { diff --git a/pezkuwi/xcm/pezpallet-xcm/precompiles/src/mock.rs b/pezkuwi/xcm/pezpallet-xcm/precompiles/src/mock.rs index 05789f15..1f7ed2ab 100644 --- a/pezkuwi/xcm/pezpallet-xcm/precompiles/src/mock.rs +++ b/pezkuwi/xcm/pezpallet-xcm/precompiles/src/mock.rs @@ -329,9 +329,13 @@ pub fn new_test_ext_with_balances_and_xcm_version( .assimilate_storage(&mut t) .unwrap(); - pezpallet_xcm::GenesisConfig:: { safe_xcm_version, supported_version, ..Default::default() } - .assimilate_storage(&mut t) - .unwrap(); + pezpallet_xcm::GenesisConfig:: { + safe_xcm_version, + supported_version, + ..Default::default() + } + .assimilate_storage(&mut t) + .unwrap(); pezpallet_revive::GenesisConfig:: { mapped_accounts: vec![ALICE], ..Default::default() } .assimilate_storage(&mut t) diff --git a/pezkuwi/xcm/pezpallet-xcm/precompiles/src/tests.rs b/pezkuwi/xcm/pezpallet-xcm/precompiles/src/tests.rs index 77b0e523..33289276 100644 --- a/pezkuwi/xcm/pezpallet-xcm/precompiles/src/tests.rs +++ b/pezkuwi/xcm/pezpallet-xcm/precompiles/src/tests.rs @@ -21,6 +21,7 @@ use crate::{ VersionedLocation, VersionedXcm, }; use pezframe_support::traits::Currency; +use pezkuwi_teyrchain_primitives::primitives::Id as ParaId; use pezpallet_revive::{ precompiles::{ alloy::{ @@ -31,7 +32,6 @@ use pezpallet_revive::{ }, ExecConfig, U256, }; -use pezkuwi_teyrchain_primitives::primitives::Id as ParaId; use pezsp_runtime::traits::AccountIdConversion; use xcm::{prelude::*, v3, v4}; diff --git a/pezkuwi/xcm/pezpallet-xcm/src/lib.rs b/pezkuwi/xcm/pezpallet-xcm/src/lib.rs index 4c2ee4d2..1857dbfe 100644 --- a/pezkuwi/xcm/pezpallet-xcm/src/lib.rs +++ b/pezkuwi/xcm/pezpallet-xcm/src/lib.rs @@ -48,7 +48,6 @@ use pezframe_support::{ }; use pezframe_system::pezpallet_prelude::{BlockNumberFor, *}; pub use pezpallet::*; -use scale_info::TypeInfo; use pezsp_core::H256; use pezsp_runtime::{ traits::{ @@ -57,6 +56,7 @@ use pezsp_runtime::{ }, Either, RuntimeDebug, SaturatedConversion, }; +use scale_info::TypeInfo; use storage::{with_transaction, TransactionOutcome}; use xcm::{latest::QueryResponseInfo, prelude::*}; use xcm_builder::{ @@ -255,7 +255,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// A lockable currency. // TODO: We should really use a trait which can handle multiple currencies. @@ -1722,7 +1723,8 @@ pub mod pezpallet { if let Some(expiry) = expires { ensure!( expiry > - pezframe_system::Pezpallet::::current_block_number().saturated_into::(), + pezframe_system::Pezpallet::::current_block_number() + .saturated_into::(), Error::::ExpiresInPast ); } @@ -1970,7 +1972,10 @@ impl QueryHandler for Pezpallet { let response = response.into(); Queries::::insert( id, - QueryStatus::Ready { response, at: pezframe_system::Pezpallet::::current_block_number() }, + QueryStatus::Ready { + response, + at: pezframe_system::Pezpallet::::current_block_number(), + }, ); } } @@ -3068,7 +3073,10 @@ impl Pezpallet { origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion, - ) -> Result::RuntimeEvent>, XcmDryRunApiError> + ) -> Result< + CallDryRunEffects<::RuntimeEvent>, + XcmDryRunApiError, + > where Runtime: crate::Config, Router: InspectMessageQueues, @@ -3456,7 +3464,8 @@ impl Pezpallet { aliaser .expiry .map(|expiry| { - pezframe_system::Pezpallet::::current_block_number().saturated_into::() < + pezframe_system::Pezpallet::::current_block_number() + .saturated_into::() < expiry }) .unwrap_or(true) @@ -3492,10 +3501,10 @@ impl Pezpallet { /// - `message`: The message whose outcome should be reported. /// - `responder`: The origin from which a response should be expected. /// - `notify`: A dispatchable function which will be called once the outcome of `message` is - /// known. It may be a dispatchable in any pezpallet of the local chain, but other than the usual - /// origin, it must accept exactly two arguments: `query_id: QueryId` and `outcome: Response`, - /// and in that order. It should expect that the origin is `Origin::Response` and will contain - /// the responder's location. + /// known. It may be a dispatchable in any pezpallet of the local chain, but other than the + /// usual origin, it must accept exactly two arguments: `query_id: QueryId` and `outcome: + /// Response`, and in that order. It should expect that the origin is `Origin::Response` and + /// will contain the responder's location. /// - `timeout`: The block number after which it is permissible for `notify` not to be called /// even if a response is received. /// @@ -4120,7 +4129,8 @@ impl OnResponse for Pezpallet { let dispatch_origin = Origin::Response(origin.clone()).into(); match call.dispatch(dispatch_origin) { Ok(post_info) => { - let e = Event::Notified { query_id, pezpallet_index, call_index }; + let e = + Event::Notified { query_id, pezpallet_index, call_index }; Self::deposit_event(e); post_info.actual_weight }, diff --git a/pezkuwi/xcm/pezpallet-xcm/src/migration.rs b/pezkuwi/xcm/pezpallet-xcm/src/migration.rs index 3c1fd4b3..e6a506b6 100644 --- a/pezkuwi/xcm/pezpallet-xcm/src/migration.rs +++ b/pezkuwi/xcm/pezpallet-xcm/src/migration.rs @@ -455,9 +455,9 @@ pub mod v1 { >; } -/// When adding a new XCM version, we need to run this migration for `pezpallet_xcm` to ensure that all -/// previously stored data with pez_subkey prefix `XCM_VERSION-1` (and below) are migrated to the -/// `XCM_VERSION`. +/// When adding a new XCM version, we need to run this migration for `pezpallet_xcm` to ensure that +/// all previously stored data with pez_subkey prefix `XCM_VERSION-1` (and below) are migrated to +/// the `XCM_VERSION`. /// /// NOTE: This migration can be permanently added to the runtime migrations. pub struct MigrateToLatestXcmVersion(core::marker::PhantomData); diff --git a/pezkuwi/xcm/pezpallet-xcm/src/mock.rs b/pezkuwi/xcm/pezpallet-xcm/src/mock.rs index 9d6acebd..321bb9b8 100644 --- a/pezkuwi/xcm/pezpallet-xcm/src/mock.rs +++ b/pezkuwi/xcm/pezpallet-xcm/src/mock.rs @@ -68,7 +68,8 @@ pub mod pezpallet_test_notifier { #[pezpallet::config] pub trait Config: pezframe_system::Config + crate::Config { #[allow(deprecated)] - type RuntimeEvent: IsType<::RuntimeEvent> + From>; + type RuntimeEvent: IsType<::RuntimeEvent> + + From>; type RuntimeOrigin: IsType<::RuntimeOrigin> + Into::RuntimeOrigin>>; type RuntimeCall: IsType<::RuntimeCall> + From>; @@ -741,9 +742,13 @@ pub(crate) fn new_test_ext_with_balances_and_xcm_version( .assimilate_storage(&mut t) .unwrap(); - pezpallet_xcm::GenesisConfig:: { safe_xcm_version, supported_version, ..Default::default() } - .assimilate_storage(&mut t) - .unwrap(); + pezpallet_xcm::GenesisConfig:: { + safe_xcm_version, + supported_version, + ..Default::default() + } + .assimilate_storage(&mut t) + .unwrap(); let mut ext = pezsp_io::TestExternalities::new(t); ext.execute_with(|| System::set_block_number(1)); diff --git a/pezkuwi/xcm/src/v3/mod.rs b/pezkuwi/xcm/src/v3/mod.rs index 31ac4212..e3574b3b 100644 --- a/pezkuwi/xcm/src/v3/mod.rs +++ b/pezkuwi/xcm/src/v3/mod.rs @@ -407,9 +407,9 @@ impl From for Option { #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] pub enum OriginKind { /// Origin should just be the native dispatch origin representation for the sender in the - /// local runtime framework. For Pezcumulus/Frame chains this is the `Teyrchain` or `Relay` origin - /// if coming from a chain, though there may be others if the `MultiLocation` XCM origin has a - /// primary/native dispatch origin form. + /// local runtime framework. For Pezcumulus/Frame chains this is the `Teyrchain` or `Relay` + /// origin if coming from a chain, though there may be others if the `MultiLocation` XCM + /// origin has a primary/native dispatch origin form. Native, /// Origin should just be the standard account-based origin with the sovereign account of @@ -421,8 +421,8 @@ pub enum OriginKind { Superuser, /// Origin should be interpreted as an XCM native origin and the `MultiLocation` should be - /// encoded directly in the dispatch origin unchanged. For Pezcumulus/Frame chains, this will be - /// the `pezpallet_xcm::Origin::Xcm` type. + /// encoded directly in the dispatch origin unchanged. For Pezcumulus/Frame chains, this will + /// be the `pezpallet_xcm::Origin::Xcm` type. Xcm, } @@ -938,8 +938,8 @@ pub enum Instruction { /// Ensure that a particular pezpallet with a particular version exists. /// - /// - `index: Compact`: The index which identifies the pezpallet. An error if no pezpallet exists at - /// this index. + /// - `index: Compact`: The index which identifies the pezpallet. An error if no pezpallet + /// exists at this index. /// - `name: Vec`: Name which must be equal to the name of the pezpallet. /// - `module_name: Vec`: Module name which must be equal to the name of the module in /// which the pezpallet exists. diff --git a/pezkuwi/xcm/src/v3/multilocation.rs b/pezkuwi/xcm/src/v3/multilocation.rs index 5183c62a..3184d670 100644 --- a/pezkuwi/xcm/src/v3/multilocation.rs +++ b/pezkuwi/xcm/src/v3/multilocation.rs @@ -32,8 +32,8 @@ use scale_info::TypeInfo; /// - A (normal, layer-1) block chain, e.g. the Bitcoin mainnet or a teyrchain. /// - A layer-0 super-chain, e.g. the Pezkuwi Relay chain. /// - A layer-2 smart contract, e.g. an ERC-20 on Ethereum. -/// - A logical functional component of a chain, e.g. a single instance of a pezpallet on a Frame-based -/// Bizinikiwi chain. +/// - A logical functional component of a chain, e.g. a single instance of a pezpallet on a +/// Frame-based Bizinikiwi chain. /// - An account. /// /// A `MultiLocation` is a *relative identifier*, meaning that it can only be used to define the diff --git a/pezkuwi/xcm/src/v4/location.rs b/pezkuwi/xcm/src/v4/location.rs index 7748484e..8805190c 100644 --- a/pezkuwi/xcm/src/v4/location.rs +++ b/pezkuwi/xcm/src/v4/location.rs @@ -32,8 +32,8 @@ use scale_info::TypeInfo; /// - A (normal, layer-1) block chain, e.g. the Bitcoin mainnet or a teyrchain. /// - A layer-0 super-chain, e.g. the Pezkuwi Relay chain. /// - A layer-2 smart contract, e.g. an ERC-20 on Ethereum. -/// - A logical functional component of a chain, e.g. a single instance of a pezpallet on a Frame-based -/// Bizinikiwi chain. +/// - A logical functional component of a chain, e.g. a single instance of a pezpallet on a +/// Frame-based Bizinikiwi chain. /// - An account. /// /// A `Location` is a *relative identifier*, meaning that it can only be used to define the diff --git a/pezkuwi/xcm/src/v4/mod.rs b/pezkuwi/xcm/src/v4/mod.rs index 82fc21e8..84290f61 100644 --- a/pezkuwi/xcm/src/v4/mod.rs +++ b/pezkuwi/xcm/src/v4/mod.rs @@ -899,8 +899,8 @@ pub enum Instruction { /// Ensure that a particular pezpallet with a particular version exists. /// - /// - `index: Compact`: The index which identifies the pezpallet. An error if no pezpallet exists at - /// this index. + /// - `index: Compact`: The index which identifies the pezpallet. An error if no pezpallet + /// exists at this index. /// - `name: Vec`: Name which must be equal to the name of the pezpallet. /// - `module_name: Vec`: Module name which must be equal to the name of the module in /// which the pezpallet exists. diff --git a/pezkuwi/xcm/src/v5/location.rs b/pezkuwi/xcm/src/v5/location.rs index 964541b1..5e025fe4 100644 --- a/pezkuwi/xcm/src/v5/location.rs +++ b/pezkuwi/xcm/src/v5/location.rs @@ -32,8 +32,8 @@ use scale_info::TypeInfo; /// - A (normal, layer-1) block chain, e.g. the Bitcoin mainnet or a teyrchain. /// - A layer-0 super-chain, e.g. the Pezkuwi Relay chain. /// - A layer-2 smart contract, e.g. an ERC-20 on Ethereum. -/// - A logical functional component of a chain, e.g. a single instance of a pezpallet on a Frame-based -/// Bizinikiwi chain. +/// - A logical functional component of a chain, e.g. a single instance of a pezpallet on a +/// Frame-based Bizinikiwi chain. /// - An account. /// /// A `Location` is a *relative identifier*, meaning that it can only be used to define the diff --git a/pezkuwi/xcm/src/v5/mod.rs b/pezkuwi/xcm/src/v5/mod.rs index 926fd10f..d8025371 100644 --- a/pezkuwi/xcm/src/v5/mod.rs +++ b/pezkuwi/xcm/src/v5/mod.rs @@ -857,8 +857,8 @@ pub enum Instruction { /// Ensure that a particular pezpallet with a particular version exists. /// - /// - `index: Compact`: The index which identifies the pezpallet. An error if no pezpallet exists at - /// this index. + /// - `index: Compact`: The index which identifies the pezpallet. An error if no pezpallet + /// exists at this index. /// - `name: Vec`: Name which must be equal to the name of the pezpallet. /// - `module_name: Vec`: Module name which must be equal to the name of the module in /// which the pezpallet exists. diff --git a/pezkuwi/xcm/xcm-builder/src/asset_exchange/single_asset_adapter/mock.rs b/pezkuwi/xcm/xcm-builder/src/asset_exchange/single_asset_adapter/mock.rs index 28b7ef90..5c45dc60 100644 --- a/pezkuwi/xcm/xcm-builder/src/asset_exchange/single_asset_adapter/mock.rs +++ b/pezkuwi/xcm/xcm-builder/src/asset_exchange/single_asset_adapter/mock.rs @@ -269,8 +269,8 @@ impl ConvertLocation for AccountIndex64Aliases { /// `Convert` implementation to convert from some a `Signed` (system) `Origin` into an /// `AccountIndex64`. /// -/// Typically used when configuring `pezpallet-xcm` in tests to allow `u64` accounts to dispatch an XCM -/// from an `AccountIndex64` origin. +/// Typically used when configuring `pezpallet-xcm` in tests to allow `u64` accounts to dispatch an +/// XCM from an `AccountIndex64` origin. pub struct SignedToAccountIndex64( PhantomData<(RuntimeOrigin, AccountId, Network)>, ); diff --git a/pezkuwi/xcm/xcm-builder/src/location_conversion.rs b/pezkuwi/xcm/xcm-builder/src/location_conversion.rs index 0de3170b..e55f68fd 100644 --- a/pezkuwi/xcm/xcm-builder/src/location_conversion.rs +++ b/pezkuwi/xcm/xcm-builder/src/location_conversion.rs @@ -58,7 +58,8 @@ pub struct DescribePalletTerminal; impl DescribeLocation for DescribePalletTerminal { fn describe_location(l: &Location) -> Option> { match l.unpack() { - (0, [PalletInstance(i)]) => Some((b"Pezpallet", Compact::::from(*i as u32)).encode()), + (0, [PalletInstance(i)]) => + Some((b"Pezpallet", Compact::::from(*i as u32)).encode()), _ => return None, } } diff --git a/pezkuwi/xcm/xcm-builder/src/origin_conversion.rs b/pezkuwi/xcm/xcm-builder/src/origin_conversion.rs index 8b97cac7..fa1eea86 100644 --- a/pezkuwi/xcm/xcm-builder/src/origin_conversion.rs +++ b/pezkuwi/xcm/xcm-builder/src/origin_conversion.rs @@ -290,8 +290,8 @@ where /// `Convert` implementation to convert from some an origin which implements `Backing` into a /// corresponding `Plurality` `Location`. /// -/// Typically used when configuring `pezpallet-xcm` for allowing a collective's Origin to dispatch an -/// XCM from a `Plurality` origin. +/// Typically used when configuring `pezpallet-xcm` for allowing a collective's Origin to dispatch +/// an XCM from a `Plurality` origin. pub struct BackingToPlurality( PhantomData<(RuntimeOrigin, COrigin, Body)>, ); diff --git a/pezkuwi/xcm/xcm-builder/src/process_xcm_message.rs b/pezkuwi/xcm/xcm-builder/src/process_xcm_message.rs index 7dd1a907..4a78348c 100644 --- a/pezkuwi/xcm/xcm-builder/src/process_xcm_message.rs +++ b/pezkuwi/xcm/xcm-builder/src/process_xcm_message.rs @@ -22,8 +22,8 @@ use pezframe_support::{ dispatch::GetDispatchInfo, traits::{ProcessMessage, ProcessMessageError}, }; -use scale_info::TypeInfo; use pezsp_weights::{Weight, WeightMeter}; +use scale_info::TypeInfo; use xcm::{prelude::*, MAX_XCM_DECODE_DEPTH}; const LOG_TARGET: &str = "xcm::process-message"; diff --git a/pezkuwi/xcm/xcm-builder/src/tests/pay/mock.rs b/pezkuwi/xcm/xcm-builder/src/tests/pay/mock.rs index 5b816050..9efea479 100644 --- a/pezkuwi/xcm/xcm-builder/src/tests/pay/mock.rs +++ b/pezkuwi/xcm/xcm-builder/src/tests/pay/mock.rs @@ -145,7 +145,9 @@ pub struct AssetKind { } pub struct LocatableAssetKindConverter; -impl pezsp_runtime::traits::TryConvert for LocatableAssetKindConverter { +impl pezsp_runtime::traits::TryConvert + for LocatableAssetKindConverter +{ fn try_convert(value: AssetKind) -> Result { Ok(LocatableAssetId { asset_id: value.asset_id, location: value.destination }) } diff --git a/pezkuwi/xcm/xcm-builder/tests/mock/mod.rs b/pezkuwi/xcm/xcm-builder/tests/mock/mod.rs index 49f6fae8..fcf897b1 100644 --- a/pezkuwi/xcm/xcm-builder/tests/mock/mod.rs +++ b/pezkuwi/xcm/xcm-builder/tests/mock/mod.rs @@ -21,8 +21,8 @@ use pezframe_support::{ weights::Weight, }; use pezframe_system::EnsureRoot; -use primitive_types::H256; use pezsp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage}; +use primitive_types::H256; use pezkuwi_runtime_teyrchains::{configuration, origin, shared}; use pezkuwi_teyrchain_primitives::primitives::Id as ParaId; @@ -245,7 +245,9 @@ construct_runtime!( } ); -pub fn kusama_like_with_balances(balances: Vec<(AccountId, Balance)>) -> pezsp_io::TestExternalities { +pub fn kusama_like_with_balances( + balances: Vec<(AccountId, Balance)>, +) -> pezsp_io::TestExternalities { let mut t = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); pezpallet_balances::GenesisConfig:: { balances, ..Default::default() } diff --git a/pezkuwi/xcm/xcm-executor/integration-tests/src/lib.rs b/pezkuwi/xcm/xcm-executor/integration-tests/src/lib.rs index b8cd594d..620c5e95 100644 --- a/pezkuwi/xcm/xcm-executor/integration-tests/src/lib.rs +++ b/pezkuwi/xcm/xcm-executor/integration-tests/src/lib.rs @@ -128,7 +128,8 @@ fn transact_recursion_limit_works() { let mut block_builder = client.init_pezkuwi_block_builder(); - let execute = construct_extrinsic(&client, call.unwrap(), pezsp_keyring::Sr25519Keyring::Alice, 0); + let execute = + construct_extrinsic(&client, call.unwrap(), pezsp_keyring::Sr25519Keyring::Alice, 0); block_builder.push_pezkuwi_extrinsic(execute).expect("pushes extrinsic"); @@ -168,9 +169,9 @@ fn transact_recursion_limit_works() { #[test] fn query_response_fires() { + use pezkuwi_test_runtime::RuntimeEvent::TestNotifier; use pezpallet_test_notifier::Event::*; use pezpallet_xcm::QueryStatus; - use pezkuwi_test_runtime::RuntimeEvent::TestNotifier; pezsp_tracing::try_init_simple(); let client = TestClientBuilder::new().build(); @@ -251,8 +252,8 @@ fn query_response_fires() { #[test] fn query_response_elicits_handler() { - use pezpallet_test_notifier::Event::*; use pezkuwi_test_runtime::RuntimeEvent::TestNotifier; + use pezpallet_test_notifier::Event::*; pezsp_tracing::try_init_simple(); let client = TestClientBuilder::new().build(); diff --git a/pezkuwi/xcm/xcm-executor/src/traits/asset_transfer.rs b/pezkuwi/xcm/xcm-executor/src/traits/asset_transfer.rs index a04c3b80..3a31166f 100644 --- a/pezkuwi/xcm/xcm-executor/src/traits/asset_transfer.rs +++ b/pezkuwi/xcm/xcm-executor/src/traits/asset_transfer.rs @@ -16,8 +16,8 @@ use crate::traits::TransactAsset; use pezframe_support::traits::ContainsPair; -use scale_info::TypeInfo; use pezsp_runtime::codec::{Decode, DecodeWithMemTracking, Encode}; +use scale_info::TypeInfo; use xcm::prelude::*; /// Errors related to determining asset transfer support. diff --git a/pezkuwi/xcm/xcm-executor/src/traits/mod.rs b/pezkuwi/xcm/xcm-executor/src/traits/mod.rs index 2521e7a5..745e6ad5 100644 --- a/pezkuwi/xcm/xcm-executor/src/traits/mod.rs +++ b/pezkuwi/xcm/xcm-executor/src/traits/mod.rs @@ -55,9 +55,9 @@ mod record_xcm; mod weight; pub use event_emitter::EventEmitter; -pub use record_xcm::RecordXcm; #[deprecated = "Use `pezsp_runtime::traits::` instead"] pub use pezsp_runtime::traits::{Identity, TryConvertInto as JustTry}; +pub use record_xcm::RecordXcm; pub use weight::{WeightBounds, WeightTrader}; pub mod prelude { diff --git a/pezkuwi/xcm/xcm-executor/src/traits/on_response.rs b/pezkuwi/xcm/xcm-executor/src/traits/on_response.rs index e2021dc3..cc3ecff7 100644 --- a/pezkuwi/xcm/xcm-executor/src/traits/on_response.rs +++ b/pezkuwi/xcm/xcm-executor/src/traits/on_response.rs @@ -17,7 +17,7 @@ use crate::{Junctions::Here, Xcm}; use codec::{Decode, Encode}; use core::{fmt::Debug, result}; -use pezframe_support::{pezpallet_prelude::Get, parameter_types}; +use pezframe_support::{parameter_types, pezpallet_prelude::Get}; use pezsp_arithmetic::traits::Zero; use xcm::latest::{ Error as XcmError, InteriorLocation, Location, QueryId, Response, Result as XcmResult, Weight, diff --git a/pezkuwi/xcm/xcm-pez-simulator/example/src/lib.rs b/pezkuwi/xcm/xcm-pez-simulator/example/src/lib.rs index a509b479..7241da3c 100644 --- a/pezkuwi/xcm/xcm-pez-simulator/example/src/lib.rs +++ b/pezkuwi/xcm/xcm-pez-simulator/example/src/lib.rs @@ -84,12 +84,18 @@ pub fn child_account_id(para: u32) -> relay_chain::AccountId { relay_chain::location_converter::LocationConverter::convert_location(&location.into()).unwrap() } -pub fn child_account_account_id(para: u32, who: pezsp_runtime::AccountId32) -> relay_chain::AccountId { +pub fn child_account_account_id( + para: u32, + who: pezsp_runtime::AccountId32, +) -> relay_chain::AccountId { let location = (Teyrchain(para), AccountId32 { network: None, id: who.into() }); relay_chain::location_converter::LocationConverter::convert_location(&location.into()).unwrap() } -pub fn sibling_account_account_id(para: u32, who: pezsp_runtime::AccountId32) -> teyrchain::AccountId { +pub fn sibling_account_account_id( + para: u32, + who: pezsp_runtime::AccountId32, +) -> teyrchain::AccountId { let location = (Parent, Teyrchain(para), AccountId32 { network: None, id: who.into() }); teyrchain::location_converter::LocationConverter::convert_location(&location.into()).unwrap() } diff --git a/pezkuwi/xcm/xcm-pez-simulator/example/src/tests.rs b/pezkuwi/xcm/xcm-pez-simulator/example/src/tests.rs index 0a37da62..89255be5 100644 --- a/pezkuwi/xcm/xcm-pez-simulator/example/src/tests.rs +++ b/pezkuwi/xcm/xcm-pez-simulator/example/src/tests.rs @@ -92,7 +92,10 @@ fn ump() { }); Relay::execute_with(|| { - assert!(system_contains_event!(relay_chain, System(pezframe_system::Event::Remarked { .. }))); + assert!(system_contains_event!( + relay_chain, + System(pezframe_system::Event::Remarked { .. }) + )); }); } @@ -190,8 +193,10 @@ fn reserve_transfer_with_error() { assert!(log_capture.contains("XCM validate_send failed")); // Verify that XcmPallet::Attempted was NOT emitted (rollback happened) - let xcm_attempted_emitted = - system_contains_event!(relay_chain, XcmPallet(pezpallet_xcm::Event::Attempted { .. })); + let xcm_attempted_emitted = system_contains_event!( + relay_chain, + XcmPallet(pezpallet_xcm::Event::Attempted { .. }) + ); assert!( !xcm_attempted_emitted, "Expected no XcmPallet::Attempted event due to rollback, but it was emitted" diff --git a/pezkuwi/xcm/xcm-pez-simulator/fuzzer/src/teyrchain.rs b/pezkuwi/xcm/xcm-pez-simulator/fuzzer/src/teyrchain.rs index c267ae6b..5e576a9e 100644 --- a/pezkuwi/xcm/xcm-pez-simulator/fuzzer/src/teyrchain.rs +++ b/pezkuwi/xcm/xcm-pez-simulator/fuzzer/src/teyrchain.rs @@ -30,11 +30,11 @@ use pezsp_runtime::{ MultiAddress, MultiSignature, }; -use pezpallet_xcm::XcmPassthrough; use pezkuwi_core_primitives::BlockNumber as RelayBlockNumber; use pezkuwi_teyrchain_primitives::primitives::{ DmpMessageHandler, Id as ParaId, Sibling, XcmpMessageFormat, XcmpMessageHandler, }; +use pezpallet_xcm::XcmPassthrough; use xcm::{latest::prelude::*, VersionedXcm}; use xcm_builder::{ AccountId32Aliases, AllowUnpaidExecutionFrom, EnsureXcmOrigin, FixedRateOfFungible, @@ -158,7 +158,8 @@ pub mod mock_msg_queue { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type XcmExecutor: ExecuteXcm; } diff --git a/pezkuwi/xcm/xcm-pez-simulator/src/mock_message_queue.rs b/pezkuwi/xcm/xcm-pez-simulator/src/mock_message_queue.rs index 89fec4bb..048d4820 100644 --- a/pezkuwi/xcm/xcm-pez-simulator/src/mock_message_queue.rs +++ b/pezkuwi/xcm/xcm-pez-simulator/src/mock_message_queue.rs @@ -36,7 +36,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; type XcmExecutor: ExecuteXcm; } diff --git a/pezkuwi/xcm/xcm-runtime-pezapis/tests/conversions.rs b/pezkuwi/xcm/xcm-runtime-pezapis/tests/conversions.rs index da83d082..cbbb9dae 100644 --- a/pezkuwi/xcm/xcm-runtime-pezapis/tests/conversions.rs +++ b/pezkuwi/xcm/xcm-runtime-pezapis/tests/conversions.rs @@ -16,6 +16,7 @@ mod mock; +use mock::*; use pezframe_support::{ assert_err, assert_ok, pezsp_runtime::{ @@ -24,7 +25,6 @@ use pezframe_support::{ AccountId32, MultiSignature, }, }; -use mock::*; use pezsp_api::ProvideRuntimeApi; use xcm::prelude::*; use xcm_runtime_pezapis::conversions::{ diff --git a/pezkuwi/xcm/xcm-runtime-pezapis/tests/fee_estimation.rs b/pezkuwi/xcm/xcm-runtime-pezapis/tests/fee_estimation.rs index f3eae2e7..4c7f1618 100644 --- a/pezkuwi/xcm/xcm-runtime-pezapis/tests/fee_estimation.rs +++ b/pezkuwi/xcm/xcm-runtime-pezapis/tests/fee_estimation.rs @@ -425,7 +425,10 @@ fn dry_run_xcm_common(xcm_version: XcmVersion) { account: 2100, free_balance: 520 }), - RuntimeEvent::Balances(pezpallet_balances::Event::Minted { who: 2100, amount: 520 }), + RuntimeEvent::Balances(pezpallet_balances::Event::Minted { + who: 2100, + amount: 520 + }), RuntimeEvent::XcmPallet(pezpallet_xcm::Event::Sent { origin: (who,).into(), destination: (Parent, Teyrchain(2100)).into(), diff --git a/pezkuwi/xcm/xcm-runtime-pezapis/tests/mock.rs b/pezkuwi/xcm/xcm-runtime-pezapis/tests/mock.rs index d3859d4b..a0d96683 100644 --- a/pezkuwi/xcm/xcm-runtime-pezapis/tests/mock.rs +++ b/pezkuwi/xcm/xcm-runtime-pezapis/tests/mock.rs @@ -43,13 +43,13 @@ use xcm_executor::{ XcmExecutor, }; +use xcm_pez_simulator::helpers::derive_topic_id; use xcm_runtime_pezapis::{ conversions::{Error as LocationToAccountApiError, LocationToAccountApi}, dry_run::{CallDryRunEffects, DryRunApi, Error as XcmDryRunApiError, XcmDryRunEffects}, fees::{Error as XcmPaymentApiError, XcmPaymentApi}, trusted_query::{Error as TrustedQueryApiError, TrustedQueryApi}, }; -use xcm_pez_simulator::helpers::derive_topic_id; construct_runtime! { pub enum TestRuntime { @@ -468,8 +468,12 @@ impl pezpallet_xcm::Config for TestRuntime { } #[allow(dead_code)] -pub fn new_test_ext_with_balances(balances: Vec<(AccountId, Balance)>) -> pezsp_io::TestExternalities { - let mut t = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); +pub fn new_test_ext_with_balances( + balances: Vec<(AccountId, Balance)>, +) -> pezsp_io::TestExternalities { + let mut t = pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap(); pezpallet_balances::GenesisConfig:: { balances, ..Default::default() } .assimilate_storage(&mut t) @@ -485,7 +489,9 @@ pub fn new_test_ext_with_balances_and_assets( balances: Vec<(AccountId, Balance)>, assets: Vec<(AssetIdForAssetsPallet, AccountId, Balance)>, ) -> pezsp_io::TestExternalities { - let mut t = pezframe_system::GenesisConfig::::default().build_storage().unwrap(); + let mut t = pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap(); pezpallet_balances::GenesisConfig:: { balances, ..Default::default() } .assimilate_storage(&mut t) diff --git a/pezkuwi/xcm/xcm-runtime-pezapis/tests/trusted_query.rs b/pezkuwi/xcm/xcm-runtime-pezapis/tests/trusted_query.rs index 1d6dd221..15e358a3 100644 --- a/pezkuwi/xcm/xcm-runtime-pezapis/tests/trusted_query.rs +++ b/pezkuwi/xcm/xcm-runtime-pezapis/tests/trusted_query.rs @@ -20,8 +20,8 @@ mod mock; -use pezframe_support::pezsp_runtime::testing::H256; use mock::*; +use pezframe_support::pezsp_runtime::testing::H256; use pezsp_api::ProvideRuntimeApi; use xcm::{prelude::*, v3}; use xcm_runtime_pezapis::trusted_query::{Error, TrustedQueryApi}; diff --git a/pezkuwi/zombienet-sdk-tests/tests/teyrchains/weights.rs b/pezkuwi/zombienet-sdk-tests/tests/teyrchains/weights.rs index 6a7453c9..c86c0c0d 100644 --- a/pezkuwi/zombienet-sdk-tests/tests/teyrchains/weights.rs +++ b/pezkuwi/zombienet-sdk-tests/tests/teyrchains/weights.rs @@ -15,8 +15,8 @@ use asset_hub_zagros_runtime::Runtime as AHWRuntime; use ethabi::Token; use futures::{stream::FuturesUnordered, StreamExt}; use pezpallet_revive::AddressMapper; -use rand::Rng; use pezsp_core::{H160, H256}; +use rand::Rng; use std::str::FromStr; use zombienet_sdk::{ subxt::{ @@ -272,7 +272,8 @@ async fn instantiate_contract( // We need a nonce before instantiating the contract let account_id = caller.public_key().0.into(); - let caller_h160 = ::AddressMapper::to_address(&account_id); + let caller_h160 = + ::AddressMapper::to_address(&account_id); log::info!("H160 Account: {:?}", caller_h160); let caller_revive_nonce = client .runtime_api() diff --git a/templates/minimal/node/src/command.rs b/templates/minimal/node/src/command.rs index b9684c66..0d03a269 100644 --- a/templates/minimal/node/src/command.rs +++ b/templates/minimal/node/src/command.rs @@ -123,12 +123,17 @@ pub fn run() -> pezsc_cli::Result<()> { let runner = cli.create_runner(&cli.run)?; runner.run_node_until_exit(|config| async move { match config.network.network_backend { - pezsc_network::config::NetworkBackendType::Libp2p => - service::new_full::>(config, cli.consensus) - .map_err(pezsc_cli::Error::Service), + pezsc_network::config::NetworkBackendType::Libp2p => service::new_full::< + pezsc_network::NetworkWorker<_, _>, + >( + config, cli.consensus + ) + .map_err(pezsc_cli::Error::Service), pezsc_network::config::NetworkBackendType::Litep2p => service::new_full::< pezsc_network::Litep2pNetworkBackend, - >(config, cli.consensus) + >( + config, cli.consensus + ) .map_err(pezsc_cli::Error::Service), } }) diff --git a/templates/minimal/runtime/src/lib.rs b/templates/minimal/runtime/src/lib.rs index 87cb5d0b..5e5d2a65 100644 --- a/templates/minimal/runtime/src/lib.rs +++ b/templates/minimal/runtime/src/lib.rs @@ -26,7 +26,6 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); extern crate alloc; use alloc::vec::Vec; -use pezpallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use pezkuwi_sdk::{ pezkuwi_sdk_frame::{ self as frame, @@ -35,6 +34,7 @@ use pezkuwi_sdk::{ }, *, }; +use pezpallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; /// Provides getters for genesis configuration presets. pub mod genesis_config_presets { @@ -180,7 +180,8 @@ impl pezframe_system::Config for Runtime { type Block = Block; type Version = Version; // Use the account data from the balances pezpallet - type AccountData = pezpallet_balances::AccountData<::Balance>; + type AccountData = + pezpallet_balances::AccountData<::Balance>; } // Implements the types required for the balances pezpallet. @@ -213,8 +214,13 @@ impl pezpallet_minimal_template::Config for Runtime {} type Block = frame::runtime::types_common::BlockOf; type Header = HeaderFor; -type RuntimeExecutive = - Executive, Runtime, AllPalletsWithSystem>; +type RuntimeExecutive = Executive< + Runtime, + Block, + pezframe_system::ChainContext, + Runtime, + AllPalletsWithSystem, +>; impl_runtime_apis! { impl apis::Core for Runtime { diff --git a/templates/solochain/node/src/benchmarking.rs b/templates/solochain/node/src/benchmarking.rs index 35baedaa..8d9c44c0 100644 --- a/templates/solochain/node/src/benchmarking.rs +++ b/templates/solochain/node/src/benchmarking.rs @@ -4,14 +4,14 @@ use crate::service::FullClient; -use runtime::{AccountId, Balance, BalancesCall, SystemCall}; +use pez_solochain_template_runtime as runtime; use pezsc_cli::Result; use pezsc_client_api::BlockBackend; -use pez_solochain_template_runtime as runtime; use pezsp_core::{Encode, Pair}; use pezsp_inherents::{InherentData, InherentDataProvider}; use pezsp_keyring::Sr25519Keyring; use pezsp_runtime::{OpaqueExtrinsic, SaturatedConversion}; +use runtime::{AccountId, Balance, BalancesCall, SystemCall}; use std::{sync::Arc, time::Duration}; diff --git a/templates/solochain/node/src/chain_spec.rs b/templates/solochain/node/src/chain_spec.rs index ceffec95..de215247 100644 --- a/templates/solochain/node/src/chain_spec.rs +++ b/templates/solochain/node/src/chain_spec.rs @@ -1,5 +1,5 @@ -use pezsc_service::ChainType; use pez_solochain_template_runtime::WASM_BINARY; +use pezsc_service::ChainType; /// Specialized `ChainSpec`. This is a specialization of the general Bizinikiwi ChainSpec type. pub type ChainSpec = pezsc_service::GenericChainSpec; diff --git a/templates/solochain/node/src/command.rs b/templates/solochain/node/src/command.rs index 8df8dc1b..54fe8c31 100644 --- a/templates/solochain/node/src/command.rs +++ b/templates/solochain/node/src/command.rs @@ -4,10 +4,10 @@ use crate::{ cli::{Cli, Subcommand}, service, }; +use pez_solochain_template_runtime::{Block, EXISTENTIAL_DEPOSIT}; use pezframe_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, BIZINIKIWI_REFERENCE_HARDWARE}; use pezsc_cli::BizinikiwiCli; use pezsc_service::PartialComponents; -use pez_solochain_template_runtime::{Block, EXISTENTIAL_DEPOSIT}; use pezsp_keyring::Sr25519Keyring; impl BizinikiwiCli for Cli { diff --git a/templates/solochain/node/src/rpc.rs b/templates/solochain/node/src/rpc.rs index ca03fd15..7d3ec332 100644 --- a/templates/solochain/node/src/rpc.rs +++ b/templates/solochain/node/src/rpc.rs @@ -8,8 +8,8 @@ use std::sync::Arc; use jsonrpsee::RpcModule; -use pezsc_transaction_pool_api::TransactionPool; use pez_solochain_template_runtime::{opaque::Block, AccountId, Balance, Nonce}; +use pezsc_transaction_pool_api::TransactionPool; use pezsp_api::ProvideRuntimeApi; use pezsp_block_builder::BlockBuilder; use pezsp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; @@ -35,8 +35,8 @@ where C::Api: BlockBuilder, P: TransactionPool + 'static, { - use pezpallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use bizinikiwi_frame_rpc_system::{System, SystemApiServer}; + use pezpallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; let mut module = RpcModule::new(()); let FullDeps { client, pool } = deps; diff --git a/templates/solochain/node/src/service.rs b/templates/solochain/node/src/service.rs index 8716b9ea..3f3b6184 100644 --- a/templates/solochain/node/src/service.rs +++ b/templates/solochain/node/src/service.rs @@ -1,13 +1,13 @@ //! Service and ServiceFactory implementation. Specialized wrapper over bizinikiwi service. use futures::FutureExt; +use pez_solochain_template_runtime::{self, apis::RuntimeApi, opaque::Block}; use pezsc_client_api::{Backend, BlockBackend}; use pezsc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; use pezsc_consensus_grandpa::SharedVoterState; use pezsc_service::{error::Error as ServiceError, Configuration, TaskManager, WarpSyncConfig}; use pezsc_telemetry::{Telemetry, TelemetryWorker}; use pezsc_transaction_pool_api::OffchainTransactionPoolFactory; -use pez_solochain_template_runtime::{self, apis::RuntimeApi, opaque::Block}; use pezsp_consensus_aura::sr25519::AuthorityPair as AuraPair; use std::{sync::Arc, time::Duration}; @@ -30,7 +30,12 @@ pub type Service = pezsc_service::PartialComponents< pezsc_consensus::DefaultImportQueue, pezsc_transaction_pool::TransactionPoolHandle, ( - pezsc_consensus_grandpa::GrandpaBlockImport, + pezsc_consensus_grandpa::GrandpaBlockImport< + FullBackend, + Block, + FullClient, + FullSelectChain, + >, pezsc_consensus_grandpa::LinkHalf, Option, ), @@ -48,7 +53,8 @@ pub fn new_partial(config: &Configuration) -> Result { }) .transpose()?; - let executor = pezsc_service::new_wasm_executor::(&config.executor); + let executor = + pezsc_service::new_wasm_executor::(&config.executor); let (client, backend, keystore_container, task_manager) = pezsc_service::new_full_parts::( config, diff --git a/templates/solochain/pezpallets/template/src/lib.rs b/templates/solochain/pezpallets/template/src/lib.rs index 37584281..068f9897 100644 --- a/templates/solochain/pezpallets/template/src/lib.rs +++ b/templates/solochain/pezpallets/template/src/lib.rs @@ -2,7 +2,8 @@ //! //! A pezpallet with minimal functionality to help developers understand the essential components of //! writing a FRAME pezpallet. It is typically used in beginner tutorials or in Bizinikiwi template -//! nodes as a starting point for creating a new pezpallet and **not meant to be used in production**. +//! nodes as a starting point for creating a new pezpallet and **not meant to be used in +//! production**. //! //! ## Overview //! @@ -14,8 +15,9 @@ //! upon success //! - another dispatchable function that causes a custom error to be thrown //! -//! Each pezpallet section is annotated with an attribute using the `#[pezpallet::...]` procedural macro. -//! This macro generates the necessary code for a pezpallet to be aggregated into a FRAME runtime. +//! Each pezpallet section is annotated with an attribute using the `#[pezpallet::...]` procedural +//! macro. This macro generates the necessary code for a pezpallet to be aggregated into a FRAME +//! runtime. //! //! Learn more about FRAME macros [here](https://docs.pezkuwichain.io/reference/frame-macros/). //! @@ -25,12 +27,12 @@ //! //! - A **configuration trait** that defines the types and parameters which the pezpallet depends on //! (denoted by the `#[pezpallet::config]` attribute). See: [`Config`]. -//! - A **means to store pezpallet-specific data** (denoted by the `#[pezpallet::storage]` attribute). -//! See: [`storage_types`]. +//! - A **means to store pezpallet-specific data** (denoted by the `#[pezpallet::storage]` +//! attribute). See: [`storage_types`]. //! - A **declaration of the events** this pezpallet emits (denoted by the `#[pezpallet::event]` //! attribute). See: [`Event`]. -//! - A **declaration of the errors** that this pezpallet can throw (denoted by the `#[pezpallet::error]` -//! attribute). See: [`Error`]. +//! - A **declaration of the errors** that this pezpallet can throw (denoted by the +//! `#[pezpallet::error]` attribute). See: [`Error`]. //! - A **set of dispatchable functions** that define the pezpallet's functionality (denoted by the //! `#[pezpallet::call]` attribute). See: [`dispatchables`]. //! @@ -52,15 +54,16 @@ mod mock; #[cfg(test)] mod tests; -// Every callable function or "dispatchable" a pezpallet exposes must have weight values that correctly -// estimate a dispatchable's execution time. The benchmarking module is used to calculate weights -// for each dispatchable and generates this pezpallet's weight.rs file. Learn more about benchmarking here: https://docs.pezkuwichain.io/test/benchmark/ +// Every callable function or "dispatchable" a pezpallet exposes must have weight values that +// correctly estimate a dispatchable's execution time. The benchmarking module is used to calculate +// weights for each dispatchable and generates this pezpallet's weight.rs file. Learn more about benchmarking here: https://docs.pezkuwichain.io/test/benchmark/ #[cfg(feature = "runtime-benchmarks")] mod benchmarking; pub mod weights; pub use weights::*; -// All pezpallet logic is defined in its own module and must be annotated by the `pezpallet` attribute. +// All pezpallet logic is defined in its own module and must be annotated by the `pezpallet` +// attribute. #[pezframe_support::pezpallet] pub mod pezpallet { // Import various useful types required by all FRAME pallets. @@ -82,7 +85,8 @@ pub mod pezpallet { pub trait Config: pezframe_system::Config { /// The overarching runtime event type. #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// A type representing the weights required by the dispatchables of this pezpallet. type WeightInfo: WeightInfo; } @@ -97,13 +101,14 @@ pub mod pezpallet { /// Events that functions in this pezpallet can emit. /// /// Events are a simple means of indicating to the outside world (such as dApps, chain explorers - /// or other users) that some notable update in the runtime has occurred. In a FRAME pezpallet, the - /// documentation for each event field and its parameters is added to a node's metadata so it - /// can be used by external interfaces or tools. + /// or other users) that some notable update in the runtime has occurred. In a FRAME pezpallet, + /// the documentation for each event field and its parameters is added to a node's metadata so + /// it can be used by external interfaces or tools. /// - /// The `generate_deposit` macro generates a function on `Pezpallet` called `deposit_event` which - /// will convert the event type of your pezpallet into `RuntimeEvent` (declared in the pezpallet's - /// [`Config`] trait) and deposit it using [`pezframe_system::Pezpallet::deposit_event`]. + /// The `generate_deposit` macro generates a function on `Pezpallet` called `deposit_event` + /// which will convert the event type of your pezpallet into `RuntimeEvent` (declared in the + /// pezpallet's [`Config`] trait) and deposit it using + /// [`pezframe_system::Pezpallet::deposit_event`]. #[pezpallet::event] #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { diff --git a/templates/solochain/pezpallets/template/src/mock.rs b/templates/solochain/pezpallets/template/src/mock.rs index 19a24980..dca50448 100644 --- a/templates/solochain/pezpallets/template/src/mock.rs +++ b/templates/solochain/pezpallets/template/src/mock.rs @@ -42,5 +42,8 @@ impl pezpallet_template::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> pezsp_io::TestExternalities { - pezframe_system::GenesisConfig::::default().build_storage().unwrap().into() + pezframe_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } diff --git a/templates/solochain/runtime/src/genesis_config_presets.rs b/templates/solochain/runtime/src/genesis_config_presets.rs index 9365a382..18006f01 100644 --- a/templates/solochain/runtime/src/genesis_config_presets.rs +++ b/templates/solochain/runtime/src/genesis_config_presets.rs @@ -18,11 +18,11 @@ use crate::{AccountId, BalancesConfig, RuntimeGenesisConfig, SudoConfig}; use alloc::{vec, vec::Vec}; use pezframe_support::build_struct_json_patch; -use serde_json::Value; use pezsp_consensus_aura::sr25519::AuthorityId as AuraId; use pezsp_consensus_grandpa::AuthorityId as GrandpaId; use pezsp_genesis_builder::{self, PresetId}; use pezsp_keyring::Sr25519Keyring; +use serde_json::Value; // Returns the genesis config presets populated with given parameters. fn testnet_genesis( diff --git a/templates/teyrchain/node/src/command.rs b/templates/teyrchain/node/src/command.rs index 4cd56c7f..6c80238d 100644 --- a/templates/teyrchain/node/src/command.rs +++ b/templates/teyrchain/node/src/command.rs @@ -1,11 +1,11 @@ use pezkuwi_sdk::*; +use log::info; use pezcumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions; use pezframe_benchmarking_cli::{BenchmarkCmd, BIZINIKIWI_REFERENCE_HARDWARE}; -use log::info; use pezsc_cli::{ - ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams, - NetworkParams, Result, RpcEndpoint, SharedParams, BizinikiwiCli, + BizinikiwiCli, ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, + KeystoreParams, NetworkParams, Result, RpcEndpoint, SharedParams, }; use pezsc_service::config::{BasePath, PrometheusConfig}; use teyrchain_template_runtime::Block; @@ -56,7 +56,10 @@ impl BizinikiwiCli for Cli { 2020 } - fn load_spec(&self, id: &str) -> std::result::Result, String> { + fn load_spec( + &self, + id: &str, + ) -> std::result::Result, String> { load_spec(id) } } @@ -92,7 +95,10 @@ impl BizinikiwiCli for RelayChainCli { 2020 } - fn load_spec(&self, id: &str) -> std::result::Result, String> { + fn load_spec( + &self, + id: &str, + ) -> std::result::Result, String> { pezkuwi_cli::Cli::from_iter([RelayChainCli::executable_name()].iter()).load_spec(id) } } @@ -212,8 +218,8 @@ pub fn run() -> Result<()> { cmd.run(config, partials.client.clone(), db, storage, shared_cache) }), - BenchmarkCmd::Machine(cmd) => - runner.sync_run(|config| cmd.run(&config, BIZINIKIWI_REFERENCE_HARDWARE.clone())), + BenchmarkCmd::Machine(cmd) => runner + .sync_run(|config| cmd.run(&config, BIZINIKIWI_REFERENCE_HARDWARE.clone())), // NOTE: this allows the Client to leniently implement // new benchmark commands without requiring a companion MR. #[allow(unreachable_patterns)] @@ -330,7 +336,10 @@ impl CliConfiguration for RelayChainCli { self.base.base.role(is_dev) } - fn transaction_pool(&self, is_dev: bool) -> Result { + fn transaction_pool( + &self, + is_dev: bool, + ) -> Result { self.base.base.transaction_pool(is_dev) } diff --git a/templates/teyrchain/node/src/rpc.rs b/templates/teyrchain/node/src/rpc.rs index 0506fc45..9f459a7c 100644 --- a/templates/teyrchain/node/src/rpc.rs +++ b/templates/teyrchain/node/src/rpc.rs @@ -43,8 +43,8 @@ where C::Api: BlockBuilder, P: TransactionPool + Sync + Send + 'static, { - use pezpallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use bizinikiwi_frame_rpc_system::{System, SystemApiServer}; + use pezpallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; let mut module = RpcExtension::new(()); let FullDeps { client, pool } = deps; diff --git a/templates/teyrchain/node/src/service.rs b/templates/teyrchain/node/src/service.rs index 53e92826..1d8f23c8 100644 --- a/templates/teyrchain/node/src/service.rs +++ b/templates/teyrchain/node/src/service.rs @@ -34,7 +34,6 @@ use pezcumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; // Bizinikiwi Imports use pezframe_benchmarking_cli::BIZINIKIWI_REFERENCE_HARDWARE; use pezkuwi_sdk::pezsc_network::PeerId; -use prometheus_endpoint::Registry; use pezsc_client_api::Backend; use pezsc_consensus::ImportQueue; use pezsc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; @@ -44,6 +43,7 @@ use pezsc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWork use pezsc_transaction_pool_api::OffchainTransactionPoolFactory; use pezsp_api::ProvideRuntimeApi; use pezsp_keystore::KeystorePtr; +use prometheus_endpoint::Registry; #[docify::export(wasm_executor)] type TeyrchainExecutor = WasmExecutor; @@ -223,9 +223,10 @@ fn start_consensus( reinitialize: false, max_pov_percentage: None, }; - let fut = aura::run::( - params, - ); + let fut = + aura::run::( + params, + ); task_manager.spawn_essential_handle().spawn("aura", None, fut); Ok(()) diff --git a/templates/teyrchain/pezpallets/template/src/lib.rs b/templates/teyrchain/pezpallets/template/src/lib.rs index b02275b7..36792871 100644 --- a/templates/teyrchain/pezpallets/template/src/lib.rs +++ b/templates/teyrchain/pezpallets/template/src/lib.rs @@ -14,8 +14,9 @@ //! upon success //! - another dispatchable function that causes a custom error to be thrown //! -//! Each pezpallet section is annotated with an attribute using the `#[pezpallet::...]` procedural macro. -//! This macro generates the necessary code for a pezpallet to be aggregated into a FRAME runtime. +//! Each pezpallet section is annotated with an attribute using the `#[pezpallet::...]` procedural +//! macro. This macro generates the necessary code for a pezpallet to be aggregated into a FRAME +//! runtime. //! //! To get started with pezpallet development, consider using this tutorial: //! @@ -34,12 +35,12 @@ //! //! - A **configuration trait** that defines the types and parameters which the pezpallet depends on //! (denoted by the `#[pezpallet::config]` attribute). See: [`Config`]. -//! - A **means to store pezpallet-specific data** (denoted by the `#[pezpallet::storage]` attribute). -//! See: [`storage_types`]. +//! - A **means to store pezpallet-specific data** (denoted by the `#[pezpallet::storage]` +//! attribute). See: [`storage_types`]. //! - A **declaration of the events** this pezpallet emits (denoted by the `#[pezpallet::event]` //! attribute). See: [`Event`]. -//! - A **declaration of the errors** that this pezpallet can throw (denoted by the `#[pezpallet::error]` -//! attribute). See: [`Error`]. +//! - A **declaration of the errors** that this pezpallet can throw (denoted by the +//! `#[pezpallet::error]` attribute). See: [`Error`]. //! - A **set of dispatchable functions** that define the pezpallet's functionality (denoted by the //! `#[pezpallet::call]` attribute). See: [`dispatchables`]. //! @@ -74,7 +75,8 @@ pub mod pezpallet { #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] - type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type RuntimeEvent: From> + + IsType<::RuntimeEvent>; /// A type representing the weights required by the dispatchables of this pezpallet. type WeightInfo: crate::weights::WeightInfo; diff --git a/templates/teyrchain/runtime/src/configs/mod.rs b/templates/teyrchain/runtime/src/configs/mod.rs index f0efac2c..e1929efc 100644 --- a/templates/teyrchain/runtime/src/configs/mod.rs +++ b/templates/teyrchain/runtime/src/configs/mod.rs @@ -46,10 +46,10 @@ use pezframe_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; -use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezkuwi_runtime_common::{ xcm_sender::ExponentialPrice, BlockHashCount, SlowAdjustingFeeUpdate, }; +use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody}; use pezsp_consensus_aura::sr25519::AuthorityId as AuraId; use pezsp_runtime::Perbill; use pezsp_version::RuntimeVersion; diff --git a/templates/teyrchain/runtime/src/configs/xcm_config.rs b/templates/teyrchain/runtime/src/configs/xcm_config.rs index 47ba55be..333a2cce 100644 --- a/templates/teyrchain/runtime/src/configs/xcm_config.rs +++ b/templates/teyrchain/runtime/src/configs/xcm_config.rs @@ -5,7 +5,8 @@ use crate::{ }; use pezkuwi_sdk::{ - pezstaging_xcm as xcm, pezstaging_xcm_builder as xcm_builder, pezstaging_xcm_executor as xcm_executor, *, + pezstaging_xcm as xcm, pezstaging_xcm_builder as xcm_builder, + pezstaging_xcm_executor as xcm_executor, *, }; use pezframe_support::{ @@ -14,13 +15,13 @@ use pezframe_support::{ weights::Weight, }; use pezframe_system::EnsureRoot; -use pezpallet_xcm::XcmPassthrough; use pezkuwi_runtime_common::impls::ToAuthor; use pezkuwi_sdk::{ pezkuwi_sdk_frame::traits::Disabled, pezstaging_xcm_builder::{DenyRecursively, DenyThenTry}, }; use pezkuwi_teyrchain_primitives::primitives::Sibling; +use pezpallet_xcm::XcmPassthrough; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom, diff --git a/templates/teyrchain/runtime/src/genesis_config_presets.rs b/templates/teyrchain/runtime/src/genesis_config_presets.rs index d073e69f..ed8e4cdd 100644 --- a/templates/teyrchain/runtime/src/genesis_config_presets.rs +++ b/templates/teyrchain/runtime/src/genesis_config_presets.rs @@ -9,9 +9,9 @@ use pezkuwi_sdk::{pezstaging_xcm as xcm, *}; use pezcumulus_primitives_core::ParaId; use pezframe_support::build_struct_json_patch; -use serde_json::Value; use pezsp_genesis_builder::PresetId; use pezsp_keyring::Sr25519Keyring; +use serde_json::Value; use teyrchains_common::AuraId; /// The default XCM version to set in genesis config. diff --git a/templates/teyrchain/runtime/src/lib.rs b/templates/teyrchain/runtime/src/lib.rs index 4067b94f..a20b0e10 100644 --- a/templates/teyrchain/runtime/src/lib.rs +++ b/templates/teyrchain/runtime/src/lib.rs @@ -29,11 +29,11 @@ use pezsp_runtime::{ use pezsp_version::NativeVersion; use pezsp_version::RuntimeVersion; +pub use genesis_config_presets::TEYRCHAIN_ID; use pezframe_support::weights::{ constants::WEIGHT_REF_TIME_PER_SECOND, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }; -pub use genesis_config_presets::TEYRCHAIN_ID; pub use pezsp_consensus_aura::sr25519::AuthorityId as AuraId; pub use pezsp_runtime::{MultiAddress, Perbill, Permill}; diff --git a/umbrella/Cargo.toml b/umbrella/Cargo.toml index 9ed34a85..8fec8389 100644 --- a/umbrella/Cargo.toml +++ b/umbrella/Cargo.toml @@ -1,1207 +1,1134 @@ [package] name = "pezkuwi-sdk" -version = "1.11.0" description = "Pezkuwi SDK umbrella crate." license = "Apache-2.0" -documentation = "https://docs.rs/pezkuwi-sdk" [features] default = ["std"] std = [ - "asset-test-pezutils?/std", - "assets-common?/std", - "binary-merkle-tree?/std", - "bp-header-pez-chain?/std", - "bp-messages?/std", - "bp-pezkuwi-core?/std", - "bp-relayers?/std", - "pezbp-runtime?/std", - "bp-test-utils?/std", - "bp-teyrchains?/std", - "bp-xcm-bridge-hub-router?/std", - "bp-xcm-bridge-hub?/std", - "bridge-hub-common?/std", - "pezbridge-hub-test-utils?/std", - "pezbridge-runtime-common?/std", - "pezcumulus-pezpallet-aura-ext?/std", - "pezcumulus-pezpallet-dmp-queue?/std", - "pezcumulus-pezpallet-session-benchmarking?/std", - "pezcumulus-pezpallet-solo-to-para?/std", - "pezcumulus-pezpallet-teyrchain-system-proc-macro?/std", - "pezcumulus-pezpallet-teyrchain-system?/std", - "pezcumulus-pezpallet-weight-reclaim?/std", - "pezcumulus-pezpallet-xcm?/std", - "pezcumulus-pezpallet-xcmp-queue?/std", - "pezcumulus-ping?/std", - "pezcumulus-primitives-aura?/std", - "pezcumulus-primitives-core?/std", - "pezcumulus-primitives-proof-size-hostfunction?/std", - "pezcumulus-primitives-storage-weight-reclaim?/std", - "pezcumulus-primitives-teyrchain-inherent?/std", - "pezcumulus-primitives-timestamp?/std", - "pezcumulus-primitives-utility?/std", - "pezcumulus-test-relay-sproof-builder?/std", - "pezframe-benchmarking-pezpallet-pov?/std", - "pezframe-benchmarking?/std", - "pezframe-election-provider-support?/std", - "pezframe-executive?/std", - "pezframe-metadata-hash-extension?/std", - "pezframe-support-procedural?/std", - "pezframe-support?/std", - "pezframe-system-benchmarking?/std", - "pezframe-system-rpc-runtime-api?/std", - "pezframe-system?/std", - "pezframe-try-runtime?/std", - "pezpallet-alliance?/std", - "pezpallet-asset-conversion-ops?/std", - "pezpallet-asset-conversion-tx-payment?/std", - "pezpallet-asset-conversion?/std", - "pezpallet-asset-rate?/std", - "pezpallet-asset-rewards?/std", - "pezpallet-asset-tx-payment?/std", - "pezpallet-assets-freezer?/std", - "pezpallet-assets-holder?/std", - "pezpallet-assets-precompiles?/std", - "pezpallet-assets?/std", - "pezpallet-atomic-swap?/std", - "pezpallet-aura?/std", - "pezpallet-authority-discovery?/std", - "pezpallet-authorship?/std", - "pezpallet-babe?/std", - "pezpallet-bags-list?/std", - "pezpallet-balances?/std", - "pezpallet-beefy-mmr?/std", - "pezpallet-beefy?/std", - "pezpallet-bounties?/std", - "pezpallet-bridge-grandpa?/std", - "pezpallet-bridge-messages?/std", - "pezpallet-bridge-relayers?/std", - "pezpallet-bridge-teyrchains?/std", - "pezpallet-broker?/std", - "pezpallet-child-bounties?/std", - "pezpallet-collator-selection?/std", - "pezpallet-collective-content?/std", - "pezpallet-collective?/std", - "pezpallet-contracts-mock-network?/std", - "pezpallet-contracts?/std", - "pezpallet-conviction-voting?/std", - "pezpallet-core-fellowship?/std", - "pezpallet-delegated-staking?/std", - "pezpallet-democracy?/std", - "pezpallet-derivatives?/std", - "pezpallet-dev-mode?/std", - "pezpallet-dummy-dim?/std", - "pezpallet-election-provider-multi-block?/std", - "pezpallet-election-provider-multi-phase?/std", - "pezpallet-election-provider-support-benchmarking?/std", - "pezpallet-elections-phragmen?/std", - "pezpallet-fast-unstake?/std", - "pezpallet-glutton?/std", - "pezpallet-grandpa?/std", - "pezpallet-identity?/std", - "pezpallet-im-online?/std", - "pezpallet-indices?/std", - "pezpallet-insecure-randomness-collective-flip?/std", - "pezpallet-lottery?/std", - "pezpallet-membership?/std", - "pezpallet-message-queue?/std", - "pezpallet-meta-tx?/std", - "pezpallet-migrations?/std", - "pezpallet-mixnet?/std", - "pezpallet-mmr?/std", - "pezpallet-multi-asset-bounties?/std", - "pezpallet-multisig?/std", - "pezpallet-nft-fractionalization?/std", - "pezpallet-nfts-runtime-api?/std", - "pezpallet-nfts?/std", - "pezpallet-nis?/std", - "pezpallet-node-authorization?/std", - "pezpallet-nomination-pools-benchmarking?/std", - "pezpallet-nomination-pools-runtime-api?/std", - "pezpallet-nomination-pools?/std", - "pezpallet-offences-benchmarking?/std", - "pezpallet-offences?/std", - "pezpallet-oracle-runtime-api?/std", - "pezpallet-oracle?/std", - "pezpallet-origin-restriction?/std", - "pezpallet-paged-list?/std", - "pezpallet-parameters?/std", - "pezpallet-people?/std", - "pezpallet-preimage?/std", - "pezpallet-proxy?/std", - "pezpallet-ranked-collective?/std", - "pezpallet-recovery?/std", - "pezpallet-referenda?/std", - "pezpallet-remark?/std", - "pezpallet-revive?/std", - "pezpallet-root-offences?/std", - "pezpallet-root-testing?/std", - "pezpallet-safe-mode?/std", - "pezpallet-salary?/std", - "pezpallet-scheduler?/std", - "pezpallet-scored-pool?/std", - "pezpallet-session-benchmarking?/std", - "pezpallet-session?/std", - "pezpallet-skip-feeless-payment?/std", - "pezpallet-society?/std", - "pezpallet-staking-async-ah-client?/std", - "pezpallet-staking-async-rc-client?/std", - "pezpallet-staking-async-reward-fn?/std", - "pezpallet-staking-async-runtime-api?/std", - "pezpallet-staking-async?/std", - "pezpallet-staking-reward-fn?/std", - "pezpallet-staking-runtime-api?/std", - "pezpallet-staking?/std", - "pezpallet-state-trie-migration?/std", - "pezpallet-statement?/std", - "pezpallet-sudo?/std", - "pezpallet-timestamp?/std", - "pezpallet-tips?/std", - "pezpallet-transaction-payment-rpc-runtime-api?/std", - "pezpallet-transaction-payment?/std", - "pezpallet-transaction-storage?/std", - "pezpallet-treasury?/std", - "pezpallet-tx-pause?/std", - "pezpallet-uniques?/std", - "pezpallet-utility?/std", - "pezpallet-verify-signature?/std", - "pezpallet-vesting?/std", - "pezpallet-whitelist?/std", - "pezpallet-xcm-benchmarks?/std", - "pezpallet-xcm-bridge-hub-router?/std", - "pezpallet-xcm-bridge-hub?/std", - "pezpallet-xcm-precompiles?/std", - "pezpallet-xcm?/std", - "pezkuwi-core-primitives?/std", - "pezkuwi-primitives?/std", - "pezkuwi-runtime-common?/std", - "pezkuwi-runtime-metrics?/std", - "pezkuwi-runtime-teyrchains?/std", - "pezkuwi-sdk-frame?/std", - "pezkuwi-teyrchain-primitives?/std", - "pezsc-executor?/std", - "pez-slot-range-helper?/std", - "pezsp-api-proc-macro?/std", - "pezsp-api?/std", - "pezsp-application-crypto?/std", - "pezsp-arithmetic?/std", - "pezsp-authority-discovery?/std", - "pezsp-block-builder?/std", - "pezsp-consensus-aura?/std", - "pezsp-consensus-babe?/std", - "pezsp-consensus-beefy?/std", - "pezsp-consensus-grandpa?/std", - "pezsp-consensus-pow?/std", - "pezsp-consensus-slots?/std", - "pezsp-core-hashing?/std", - "pezsp-core?/std", - "pezsp-crypto-ec-utils?/std", - "pezsp-crypto-hashing?/std", - "pezsp-debug-derive?/std", - "pezsp-externalities?/std", - "pezsp-genesis-builder?/std", - "pezsp-inherents?/std", - "pezsp-io?/std", - "pezsp-keyring?/std", - "pezsp-keystore?/std", - "pezsp-metadata-ir?/std", - "pezsp-mixnet?/std", - "pezsp-mmr-primitives?/std", - "pezsp-npos-elections?/std", - "pezsp-offchain?/std", - "pezsp-runtime-interface?/std", - "pezsp-runtime?/std", - "pezsp-session?/std", - "pezsp-staking?/std", - "pezsp-state-machine?/std", - "pezsp-statement-store?/std", - "pezsp-std?/std", - "pezsp-storage?/std", - "pezsp-timestamp?/std", - "pezsp-tracing?/std", - "pezsp-transaction-pool?/std", - "pezsp-transaction-storage-proof?/std", - "pezsp-trie?/std", - "pezsp-version?/std", - "pezsp-wasm-interface?/std", - "pezsp-weights?/std", - "pezstaging-teyrchain-info?/std", - "pezstaging-xcm-builder?/std", - "pezstaging-xcm-executor?/std", - "pezstaging-xcm?/std", - "bizinikiwi-bip39?/std", - "testnet-teyrchains-constants?/std", - "teyrchains-common?/std", - "teyrchains-runtimes-test-utils?/std", - "xcm-runtime-pezapis?/std", + "asset-test-pezutils?/std", + "assets-common?/std", + "binary-merkle-tree?/std", + "bizinikiwi-bip39?/std", + "bp-header-pez-chain?/std", + "bp-messages?/std", + "bp-pezkuwi-core?/std", + "bp-relayers?/std", + "bp-test-utils?/std", + "bp-teyrchains?/std", + "bp-xcm-bridge-hub-router?/std", + "bp-xcm-bridge-hub?/std", + "bridge-hub-common?/std", + "pez-slot-range-helper?/std", + "pezbp-runtime?/std", + "pezbridge-hub-test-utils?/std", + "pezbridge-runtime-common?/std", + "pezcumulus-pezpallet-aura-ext?/std", + "pezcumulus-pezpallet-dmp-queue?/std", + "pezcumulus-pezpallet-session-benchmarking?/std", + "pezcumulus-pezpallet-solo-to-para?/std", + "pezcumulus-pezpallet-teyrchain-system-proc-macro?/std", + "pezcumulus-pezpallet-teyrchain-system?/std", + "pezcumulus-pezpallet-weight-reclaim?/std", + "pezcumulus-pezpallet-xcm?/std", + "pezcumulus-pezpallet-xcmp-queue?/std", + "pezcumulus-ping?/std", + "pezcumulus-primitives-aura?/std", + "pezcumulus-primitives-core?/std", + "pezcumulus-primitives-proof-size-hostfunction?/std", + "pezcumulus-primitives-storage-weight-reclaim?/std", + "pezcumulus-primitives-teyrchain-inherent?/std", + "pezcumulus-primitives-timestamp?/std", + "pezcumulus-primitives-utility?/std", + "pezframe-benchmarking-pezpallet-pov?/std", + "pezframe-benchmarking?/std", + "pezframe-election-provider-support?/std", + "pezframe-executive?/std", + "pezframe-metadata-hash-extension?/std", + "pezframe-support-procedural?/std", + "pezframe-support?/std", + "pezframe-system-benchmarking?/std", + "pezframe-system-rpc-runtime-api?/std", + "pezframe-system?/std", + "pezkuwi-core-primitives?/std", + "pezkuwi-primitives?/std", + "pezkuwi-runtime-common?/std", + "pezkuwi-runtime-metrics?/std", + "pezkuwi-runtime-teyrchains?/std", + "pezkuwi-sdk-frame?/std", + "pezkuwi-teyrchain-primitives?/std", + "pezpallet-alliance?/std", + "pezpallet-asset-conversion-ops?/std", + "pezpallet-asset-conversion-tx-payment?/std", + "pezpallet-asset-conversion?/std", + "pezpallet-asset-rate?/std", + "pezpallet-asset-rewards?/std", + "pezpallet-asset-tx-payment?/std", + "pezpallet-assets-freezer?/std", + "pezpallet-assets-holder?/std", + "pezpallet-assets-precompiles?/std", + "pezpallet-assets?/std", + "pezpallet-atomic-swap?/std", + "pezpallet-aura?/std", + "pezpallet-authority-discovery?/std", + "pezpallet-authorship?/std", + "pezpallet-babe?/std", + "pezpallet-bags-list?/std", + "pezpallet-balances?/std", + "pezpallet-beefy-mmr?/std", + "pezpallet-beefy?/std", + "pezpallet-bounties?/std", + "pezpallet-bridge-grandpa?/std", + "pezpallet-bridge-messages?/std", + "pezpallet-bridge-relayers?/std", + "pezpallet-bridge-teyrchains?/std", + "pezpallet-broker?/std", + "pezpallet-child-bounties?/std", + "pezpallet-collator-selection?/std", + "pezpallet-collective-content?/std", + "pezpallet-collective?/std", + "pezpallet-contracts-mock-network?/std", + "pezpallet-contracts?/std", + "pezpallet-conviction-voting?/std", + "pezpallet-core-fellowship?/std", + "pezpallet-delegated-staking?/std", + "pezpallet-democracy?/std", + "pezpallet-derivatives?/std", + "pezpallet-dummy-dim?/std", + "pezpallet-election-provider-multi-block?/std", + "pezpallet-election-provider-multi-phase?/std", + "pezpallet-election-provider-support-benchmarking?/std", + "pezpallet-elections-phragmen?/std", + "pezpallet-fast-unstake?/std", + "pezpallet-glutton?/std", + "pezpallet-grandpa?/std", + "pezpallet-identity?/std", + "pezpallet-im-online?/std", + "pezpallet-indices?/std", + "pezpallet-insecure-randomness-collective-flip?/std", + "pezpallet-lottery?/std", + "pezpallet-membership?/std", + "pezpallet-message-queue?/std", + "pezpallet-meta-tx?/std", + "pezpallet-migrations?/std", + "pezpallet-mixnet?/std", + "pezpallet-mmr?/std", + "pezpallet-multi-asset-bounties?/std", + "pezpallet-multisig?/std", + "pezpallet-nft-fractionalization?/std", + "pezpallet-nfts-runtime-api?/std", + "pezpallet-nfts?/std", + "pezpallet-nis?/std", + "pezpallet-node-authorization?/std", + "pezpallet-nomination-pools-benchmarking?/std", + "pezpallet-nomination-pools-runtime-api?/std", + "pezpallet-nomination-pools?/std", + "pezpallet-offences-benchmarking?/std", + "pezpallet-offences?/std", + "pezpallet-oracle-runtime-api?/std", + "pezpallet-oracle?/std", + "pezpallet-origin-restriction?/std", + "pezpallet-paged-list?/std", + "pezpallet-parameters?/std", + "pezpallet-people?/std", + "pezpallet-preimage?/std", + "pezpallet-proxy?/std", + "pezpallet-ranked-collective?/std", + "pezpallet-recovery?/std", + "pezpallet-referenda?/std", + "pezpallet-remark?/std", + "pezpallet-revive?/std", + "pezpallet-root-offences?/std", + "pezpallet-safe-mode?/std", + "pezpallet-salary?/std", + "pezpallet-scheduler?/std", + "pezpallet-scored-pool?/std", + "pezpallet-session-benchmarking?/std", + "pezpallet-session?/std", + "pezpallet-skip-feeless-payment?/std", + "pezpallet-society?/std", + "pezpallet-staking-async-ah-client?/std", + "pezpallet-staking-async-rc-client?/std", + "pezpallet-staking-async-reward-fn?/std", + "pezpallet-staking-async-runtime-api?/std", + "pezpallet-staking-async?/std", + "pezpallet-staking-reward-fn?/std", + "pezpallet-staking-runtime-api?/std", + "pezpallet-staking?/std", + "pezpallet-state-trie-migration?/std", + "pezpallet-statement?/std", + "pezpallet-sudo?/std", + "pezpallet-timestamp?/std", + "pezpallet-tips?/std", + "pezpallet-transaction-payment-rpc-runtime-api?/std", + "pezpallet-transaction-payment?/std", + "pezpallet-transaction-storage?/std", + "pezpallet-treasury?/std", + "pezpallet-tx-pause?/std", + "pezpallet-uniques?/std", + "pezpallet-utility?/std", + "pezpallet-verify-signature?/std", + "pezpallet-vesting?/std", + "pezpallet-whitelist?/std", + "pezpallet-xcm-bridge-hub-router?/std", + "pezpallet-xcm-bridge-hub?/std", + "pezpallet-xcm-precompiles?/std", + "pezpallet-xcm?/std", + "pezsc-executor?/std", + "pezsp-api-proc-macro?/std", + "pezsp-api?/std", + "pezsp-application-crypto?/std", + "pezsp-arithmetic?/std", + "pezsp-authority-discovery?/std", + "pezsp-block-builder?/std", + "pezsp-consensus-aura?/std", + "pezsp-consensus-babe?/std", + "pezsp-consensus-beefy?/std", + "pezsp-consensus-grandpa?/std", + "pezsp-consensus-pow?/std", + "pezsp-consensus-slots?/std", + "pezsp-core-hashing?/std", + "pezsp-core?/std", + "pezsp-crypto-ec-utils?/std", + "pezsp-crypto-hashing?/std", + "pezsp-debug-derive?/std", + "pezsp-externalities?/std", + "pezsp-genesis-builder?/std", + "pezsp-inherents?/std", + "pezsp-io?/std", + "pezsp-keyring?/std", + "pezsp-keystore?/std", + "pezsp-metadata-ir?/std", + "pezsp-mixnet?/std", + "pezsp-mmr-primitives?/std", + "pezsp-npos-elections?/std", + "pezsp-offchain?/std", + "pezsp-runtime-interface?/std", + "pezsp-session?/std", + "pezsp-staking?/std", + "pezsp-state-machine?/std", + "pezsp-statement-store?/std", + "pezsp-std?/std", + "pezsp-storage?/std", + "pezsp-timestamp?/std", + "pezsp-tracing?/std", + "pezsp-transaction-pool?/std", + "pezsp-transaction-storage-proof?/std", + "pezsp-trie?/std", + "pezsp-version?/std", + "pezsp-wasm-interface?/std", + "pezsp-weights?/std", + "pezstaging-teyrchain-info?/std", + "pezstaging-xcm-builder?/std", + "pezstaging-xcm-executor?/std", + "pezstaging-xcm?/std", + "testnet-teyrchains-constants?/std", + "teyrchains-common?/std", + "teyrchains-runtimes-test-utils?/std", + "xcm-runtime-pezapis?/std", ] runtime-benchmarks = [ - "asset-test-pezutils?/runtime-benchmarks", - "assets-common?/runtime-benchmarks", - "binary-merkle-tree?/runtime-benchmarks", - "bp-header-pez-chain?/runtime-benchmarks", - "bp-messages?/runtime-benchmarks", - "bp-pezkuwi-core?/runtime-benchmarks", - "bp-relayers?/runtime-benchmarks", - "pezbp-runtime?/runtime-benchmarks", - "bp-test-utils?/runtime-benchmarks", - "bp-teyrchains?/runtime-benchmarks", - "bp-xcm-bridge-hub-router?/runtime-benchmarks", - "bp-xcm-bridge-hub?/runtime-benchmarks", - "bridge-hub-common?/runtime-benchmarks", - "pezbridge-hub-test-utils?/runtime-benchmarks", - "pezbridge-runtime-common?/runtime-benchmarks", - "pezcumulus-client-bootnodes?/runtime-benchmarks", - "pezcumulus-client-cli?/runtime-benchmarks", - "pezcumulus-client-collator?/runtime-benchmarks", - "pezcumulus-client-consensus-aura?/runtime-benchmarks", - "pezcumulus-client-consensus-common?/runtime-benchmarks", - "pezcumulus-client-consensus-proposer?/runtime-benchmarks", - "pezcumulus-client-consensus-relay-chain?/runtime-benchmarks", - "pezcumulus-client-network?/runtime-benchmarks", - "pezcumulus-client-pov-recovery?/runtime-benchmarks", - "pezcumulus-client-service?/runtime-benchmarks", - "pezcumulus-client-teyrchain-inherent?/runtime-benchmarks", - "pezcumulus-pezpallet-aura-ext?/runtime-benchmarks", - "pezcumulus-pezpallet-dmp-queue?/runtime-benchmarks", - "pezcumulus-pezpallet-session-benchmarking?/runtime-benchmarks", - "pezcumulus-pezpallet-solo-to-para?/runtime-benchmarks", - "pezcumulus-pezpallet-teyrchain-system?/runtime-benchmarks", - "pezcumulus-pezpallet-weight-reclaim?/runtime-benchmarks", - "pezcumulus-pezpallet-xcm?/runtime-benchmarks", - "pezcumulus-pezpallet-xcmp-queue?/runtime-benchmarks", - "pezcumulus-ping?/runtime-benchmarks", - "pezcumulus-primitives-aura?/runtime-benchmarks", - "pezcumulus-primitives-core?/runtime-benchmarks", - "pezcumulus-primitives-proof-size-hostfunction?/runtime-benchmarks", - "pezcumulus-primitives-storage-weight-reclaim?/runtime-benchmarks", - "pezcumulus-primitives-teyrchain-inherent?/runtime-benchmarks", - "pezcumulus-primitives-timestamp?/runtime-benchmarks", - "pezcumulus-primitives-utility?/runtime-benchmarks", - "pezcumulus-relay-chain-inprocess-interface?/runtime-benchmarks", - "pezcumulus-relay-chain-interface?/runtime-benchmarks", - "pezcumulus-relay-chain-minimal-node?/runtime-benchmarks", - "pezcumulus-relay-chain-rpc-interface?/runtime-benchmarks", - "pezcumulus-relay-chain-streams?/runtime-benchmarks", - "pezcumulus-test-relay-sproof-builder?/runtime-benchmarks", - "emulated-integration-tests-common?/runtime-benchmarks", - "pezframe-benchmarking-cli?/runtime-benchmarks", - "pezframe-benchmarking-pezpallet-pov?/runtime-benchmarks", - "pezframe-benchmarking/runtime-benchmarks", - "pezframe-election-provider-solution-type?/runtime-benchmarks", - "pezframe-election-provider-support?/runtime-benchmarks", - "pezframe-executive?/runtime-benchmarks", - "pezframe-metadata-hash-extension?/runtime-benchmarks", - "frame-remote-externalities?/runtime-benchmarks", - "pezframe-support-procedural?/runtime-benchmarks", - "pezframe-support?/runtime-benchmarks", - "pezframe-system-benchmarking?/runtime-benchmarks", - "pezframe-system-rpc-runtime-api?/runtime-benchmarks", - "pezframe-system?/runtime-benchmarks", - "pezframe-try-runtime?/runtime-benchmarks", - "pez-generate-bags?/runtime-benchmarks", - "pezmmr-gadget?/runtime-benchmarks", - "pezmmr-rpc?/runtime-benchmarks", - "pezpallet-alliance?/runtime-benchmarks", - "pezpallet-asset-conversion-ops?/runtime-benchmarks", - "pezpallet-asset-conversion-tx-payment?/runtime-benchmarks", - "pezpallet-asset-conversion?/runtime-benchmarks", - "pezpallet-asset-rate?/runtime-benchmarks", - "pezpallet-asset-rewards?/runtime-benchmarks", - "pezpallet-asset-tx-payment?/runtime-benchmarks", - "pezpallet-assets-freezer?/runtime-benchmarks", - "pezpallet-assets-holder?/runtime-benchmarks", - "pezpallet-assets-precompiles?/runtime-benchmarks", - "pezpallet-assets?/runtime-benchmarks", - "pezpallet-atomic-swap?/runtime-benchmarks", - "pezpallet-aura?/runtime-benchmarks", - "pezpallet-authority-discovery?/runtime-benchmarks", - "pezpallet-authorship?/runtime-benchmarks", - "pezpallet-babe?/runtime-benchmarks", - "pezpallet-bags-list?/runtime-benchmarks", - "pezpallet-balances?/runtime-benchmarks", - "pezpallet-beefy-mmr?/runtime-benchmarks", - "pezpallet-beefy?/runtime-benchmarks", - "pezpallet-bounties?/runtime-benchmarks", - "pezpallet-bridge-grandpa?/runtime-benchmarks", - "pezpallet-bridge-messages?/runtime-benchmarks", - "pezpallet-bridge-relayers?/runtime-benchmarks", - "pezpallet-bridge-teyrchains?/runtime-benchmarks", - "pezpallet-broker?/runtime-benchmarks", - "pezpallet-child-bounties?/runtime-benchmarks", - "pezpallet-collator-selection?/runtime-benchmarks", - "pezpallet-collective-content?/runtime-benchmarks", - "pezpallet-collective?/runtime-benchmarks", - "pezpallet-contracts-mock-network?/runtime-benchmarks", - "pezpallet-contracts?/runtime-benchmarks", - "pezpallet-conviction-voting?/runtime-benchmarks", - "pezpallet-core-fellowship?/runtime-benchmarks", - "pezpallet-delegated-staking?/runtime-benchmarks", - "pezpallet-democracy?/runtime-benchmarks", - "pezpallet-derivatives?/runtime-benchmarks", - "pezpallet-dev-mode?/runtime-benchmarks", - "pezpallet-dummy-dim?/runtime-benchmarks", - "pezpallet-election-provider-multi-block?/runtime-benchmarks", - "pezpallet-election-provider-multi-phase?/runtime-benchmarks", - "pezpallet-election-provider-support-benchmarking?/runtime-benchmarks", - "pezpallet-elections-phragmen?/runtime-benchmarks", - "pezpallet-fast-unstake?/runtime-benchmarks", - "pezpallet-glutton?/runtime-benchmarks", - "pezpallet-grandpa?/runtime-benchmarks", - "pezpallet-identity?/runtime-benchmarks", - "pezpallet-im-online?/runtime-benchmarks", - "pezpallet-indices?/runtime-benchmarks", - "pezpallet-insecure-randomness-collective-flip?/runtime-benchmarks", - "pezpallet-lottery?/runtime-benchmarks", - "pezpallet-membership?/runtime-benchmarks", - "pezpallet-message-queue?/runtime-benchmarks", - "pezpallet-meta-tx?/runtime-benchmarks", - "pezpallet-migrations?/runtime-benchmarks", - "pezpallet-mixnet?/runtime-benchmarks", - "pezpallet-mmr?/runtime-benchmarks", - "pezpallet-multi-asset-bounties?/runtime-benchmarks", - "pezpallet-multisig?/runtime-benchmarks", - "pezpallet-nft-fractionalization?/runtime-benchmarks", - "pezpallet-nfts-runtime-api?/runtime-benchmarks", - "pezpallet-nfts?/runtime-benchmarks", - "pezpallet-nis?/runtime-benchmarks", - "pezpallet-node-authorization?/runtime-benchmarks", - "pezpallet-nomination-pools-benchmarking?/runtime-benchmarks", - "pezpallet-nomination-pools-runtime-api?/runtime-benchmarks", - "pezpallet-nomination-pools?/runtime-benchmarks", - "pezpallet-offences-benchmarking?/runtime-benchmarks", - "pezpallet-offences?/runtime-benchmarks", - "pezpallet-oracle-runtime-api?/runtime-benchmarks", - "pezpallet-oracle?/runtime-benchmarks", - "pezpallet-origin-restriction?/runtime-benchmarks", - "pezpallet-paged-list?/runtime-benchmarks", - "pezpallet-parameters?/runtime-benchmarks", - "pezpallet-people?/runtime-benchmarks", - "pezpallet-preimage?/runtime-benchmarks", - "pezpallet-proxy?/runtime-benchmarks", - "pezpallet-ranked-collective?/runtime-benchmarks", - "pezpallet-recovery?/runtime-benchmarks", - "pezpallet-referenda?/runtime-benchmarks", - "pezpallet-remark?/runtime-benchmarks", - "pezpallet-revive?/runtime-benchmarks", - "pezpallet-root-offences?/runtime-benchmarks", - "pezpallet-root-testing?/runtime-benchmarks", - "pezpallet-safe-mode?/runtime-benchmarks", - "pezpallet-salary?/runtime-benchmarks", - "pezpallet-scheduler?/runtime-benchmarks", - "pezpallet-scored-pool?/runtime-benchmarks", - "pezpallet-session-benchmarking?/runtime-benchmarks", - "pezpallet-session?/runtime-benchmarks", - "pezpallet-skip-feeless-payment?/runtime-benchmarks", - "pezpallet-society?/runtime-benchmarks", - "pezpallet-staking-async-ah-client?/runtime-benchmarks", - "pezpallet-staking-async-rc-client?/runtime-benchmarks", - "pezpallet-staking-async-runtime-api?/runtime-benchmarks", - "pezpallet-staking-async?/runtime-benchmarks", - "pezpallet-staking-reward-curve?/runtime-benchmarks", - "pezpallet-staking-runtime-api?/runtime-benchmarks", - "pezpallet-staking?/runtime-benchmarks", - "pezpallet-state-trie-migration?/runtime-benchmarks", - "pezpallet-statement?/runtime-benchmarks", - "pezpallet-sudo?/runtime-benchmarks", - "pezpallet-timestamp?/runtime-benchmarks", - "pezpallet-tips?/runtime-benchmarks", - "pezpallet-transaction-payment-rpc-runtime-api?/runtime-benchmarks", - "pezpallet-transaction-payment-rpc?/runtime-benchmarks", - "pezpallet-transaction-payment?/runtime-benchmarks", - "pezpallet-transaction-storage?/runtime-benchmarks", - "pezpallet-treasury?/runtime-benchmarks", - "pezpallet-tx-pause?/runtime-benchmarks", - "pezpallet-uniques?/runtime-benchmarks", - "pezpallet-utility?/runtime-benchmarks", - "pezpallet-verify-signature?/runtime-benchmarks", - "pezpallet-vesting?/runtime-benchmarks", - "pezpallet-whitelist?/runtime-benchmarks", - "pezpallet-xcm-benchmarks?/runtime-benchmarks", - "pezpallet-xcm-bridge-hub-router?/runtime-benchmarks", - "pezpallet-xcm-bridge-hub?/runtime-benchmarks", - "pezpallet-xcm-precompiles?/runtime-benchmarks", - "pezpallet-xcm?/runtime-benchmarks", - "pezkuwi-approval-distribution?/runtime-benchmarks", - "pezkuwi-availability-bitfield-distribution?/runtime-benchmarks", - "pezkuwi-availability-distribution?/runtime-benchmarks", - "pezkuwi-availability-recovery?/runtime-benchmarks", - "pezkuwi-cli?/runtime-benchmarks", - "pezkuwi-collator-protocol?/runtime-benchmarks", - "pezkuwi-core-primitives?/runtime-benchmarks", - "pezkuwi-dispute-distribution?/runtime-benchmarks", - "pezkuwi-erasure-coding?/runtime-benchmarks", - "pezkuwi-gossip-support?/runtime-benchmarks", - "pezkuwi-network-bridge?/runtime-benchmarks", - "pezkuwi-node-collation-generation?/runtime-benchmarks", - "pezkuwi-node-core-approval-voting-parallel?/runtime-benchmarks", - "pezkuwi-node-core-approval-voting?/runtime-benchmarks", - "pezkuwi-node-core-av-store?/runtime-benchmarks", - "pezkuwi-node-core-backing?/runtime-benchmarks", - "pezkuwi-node-core-bitfield-signing?/runtime-benchmarks", - "pezkuwi-node-core-candidate-validation?/runtime-benchmarks", - "pezkuwi-node-core-chain-api?/runtime-benchmarks", - "pezkuwi-node-core-chain-selection?/runtime-benchmarks", - "pezkuwi-node-core-dispute-coordinator?/runtime-benchmarks", - "pezkuwi-node-core-prospective-teyrchains?/runtime-benchmarks", - "pezkuwi-node-core-provisioner?/runtime-benchmarks", - "pezkuwi-node-core-pvf-checker?/runtime-benchmarks", - "pezkuwi-node-core-pvf-common?/runtime-benchmarks", - "pezkuwi-node-core-pvf-execute-worker?/runtime-benchmarks", - "pezkuwi-node-core-pvf-prepare-worker?/runtime-benchmarks", - "pezkuwi-node-core-pvf?/runtime-benchmarks", - "pezkuwi-node-core-runtime-api?/runtime-benchmarks", - "pezkuwi-node-core-teyrchains-inherent?/runtime-benchmarks", - "pezkuwi-node-metrics?/runtime-benchmarks", - "pezkuwi-node-network-protocol?/runtime-benchmarks", - "pezkuwi-pez-node-primitives?/runtime-benchmarks", - "pezkuwi-node-subsystem-types?/runtime-benchmarks", - "pezkuwi-node-subsystem-util?/runtime-benchmarks", - "pezkuwi-node-subsystem?/runtime-benchmarks", - "pezkuwi-omni-node-lib?/runtime-benchmarks", - "pezkuwi-overseer?/runtime-benchmarks", - "pezkuwi-primitives-test-helpers?/runtime-benchmarks", - "pezkuwi-primitives?/runtime-benchmarks", - "pezkuwi-rpc?/runtime-benchmarks", - "pezkuwi-runtime-common?/runtime-benchmarks", - "pezkuwi-runtime-metrics?/runtime-benchmarks", - "pezkuwi-runtime-teyrchains?/runtime-benchmarks", - "pezkuwi-sdk-frame?/runtime-benchmarks", - "pezkuwi-service?/runtime-benchmarks", - "pezkuwi-statement-distribution?/runtime-benchmarks", - "pezkuwi-statement-table?/runtime-benchmarks", - "pezkuwi-teyrchain-primitives?/runtime-benchmarks", - "pezsc-authority-discovery?/runtime-benchmarks", - "pezsc-basic-authorship?/runtime-benchmarks", - "pezsc-block-builder?/runtime-benchmarks", - "pezsc-chain-spec?/runtime-benchmarks", - "pezsc-cli?/runtime-benchmarks", - "pezsc-client-api?/runtime-benchmarks", - "pezsc-client-db?/runtime-benchmarks", - "pezsc-consensus-aura?/runtime-benchmarks", - "pezsc-consensus-babe-rpc?/runtime-benchmarks", - "pezsc-consensus-babe?/runtime-benchmarks", - "pezsc-consensus-beefy-rpc?/runtime-benchmarks", - "pezsc-consensus-beefy?/runtime-benchmarks", - "pezsc-consensus-epochs?/runtime-benchmarks", - "pezsc-consensus-grandpa-rpc?/runtime-benchmarks", - "pezsc-consensus-grandpa?/runtime-benchmarks", - "pezsc-consensus-manual-seal?/runtime-benchmarks", - "pezsc-consensus-pow?/runtime-benchmarks", - "pezsc-consensus-slots?/runtime-benchmarks", - "pezsc-consensus?/runtime-benchmarks", - "pezsc-executor-wasmtime?/runtime-benchmarks", - "pezsc-executor?/runtime-benchmarks", - "pezsc-informant?/runtime-benchmarks", - "pezsc-mixnet?/runtime-benchmarks", - "pezsc-network-common?/runtime-benchmarks", - "pezsc-network-gossip?/runtime-benchmarks", - "pezsc-network-light?/runtime-benchmarks", - "pezsc-network-statement?/runtime-benchmarks", - "pezsc-network-sync?/runtime-benchmarks", - "pezsc-network-transactions?/runtime-benchmarks", - "pezsc-network?/runtime-benchmarks", - "pezsc-offchain?/runtime-benchmarks", - "pezsc-rpc-api?/runtime-benchmarks", - "pezsc-rpc-server?/runtime-benchmarks", - "pezsc-rpc-spec-v2?/runtime-benchmarks", - "pezsc-rpc?/runtime-benchmarks", - "pezsc-runtime-utilities?/runtime-benchmarks", - "pezsc-service?/runtime-benchmarks", - "pezsc-statement-store?/runtime-benchmarks", - "pezsc-sync-state-rpc?/runtime-benchmarks", - "pezsc-sysinfo?/runtime-benchmarks", - "pezsc-tracing?/runtime-benchmarks", - "pezsc-transaction-pool-api?/runtime-benchmarks", - "pezsc-transaction-pool?/runtime-benchmarks", - "pez-slot-range-helper?/runtime-benchmarks", - "pezsp-api?/runtime-benchmarks", - "pezsp-authority-discovery?/runtime-benchmarks", - "pezsp-block-builder?/runtime-benchmarks", - "pezsp-blockchain?/runtime-benchmarks", - "pezsp-consensus-aura?/runtime-benchmarks", - "pezsp-consensus-babe?/runtime-benchmarks", - "pezsp-consensus-beefy?/runtime-benchmarks", - "pezsp-consensus-grandpa?/runtime-benchmarks", - "pezsp-consensus-pow?/runtime-benchmarks", - "pezsp-consensus-slots?/runtime-benchmarks", - "pezsp-consensus?/runtime-benchmarks", - "pezsp-genesis-builder?/runtime-benchmarks", - "pezsp-inherents?/runtime-benchmarks", - "pezsp-io?/runtime-benchmarks", - "pezsp-keyring?/runtime-benchmarks", - "pezsp-mixnet?/runtime-benchmarks", - "pezsp-mmr-primitives?/runtime-benchmarks", - "pezsp-npos-elections?/runtime-benchmarks", - "pezsp-offchain?/runtime-benchmarks", - "pezsp-runtime-interface?/runtime-benchmarks", - "pezsp-runtime?/runtime-benchmarks", - "pezsp-session?/runtime-benchmarks", - "pezsp-staking?/runtime-benchmarks", - "pezsp-state-machine?/runtime-benchmarks", - "pezsp-statement-store?/runtime-benchmarks", - "pezsp-timestamp?/runtime-benchmarks", - "pezsp-transaction-pool?/runtime-benchmarks", - "pezsp-transaction-storage-proof?/runtime-benchmarks", - "pezsp-trie?/runtime-benchmarks", - "pezsp-version-proc-macro?/runtime-benchmarks", - "pezsp-version?/runtime-benchmarks", - "pezstaging-chain-spec-builder?/runtime-benchmarks", - "pezstaging-node-inspect?/runtime-benchmarks", - "pezstaging-teyrchain-info?/runtime-benchmarks", - "pezstaging-xcm-builder?/runtime-benchmarks", - "pezstaging-xcm-executor?/runtime-benchmarks", - "pezstaging-xcm?/runtime-benchmarks", - "pez-subkey?/runtime-benchmarks", - "bizinikiwi-frame-rpc-support?/runtime-benchmarks", - "bizinikiwi-frame-rpc-system?/runtime-benchmarks", - "bizinikiwi-rpc-client?/runtime-benchmarks", - "bizinikiwi-state-trie-migration-rpc?/runtime-benchmarks", - "bizinikiwi-wasm-builder?/runtime-benchmarks", - "testnet-teyrchains-constants?/runtime-benchmarks", - "teyrchains-common?/runtime-benchmarks", - "teyrchains-runtimes-test-utils?/runtime-benchmarks", - "pez-tracing-gum?/runtime-benchmarks", - "xcm-pez-emulator?/runtime-benchmarks", - "xcm-pez-procedural?/runtime-benchmarks", - "xcm-runtime-pezapis?/runtime-benchmarks", - "xcm-pez-simulator?/runtime-benchmarks", + "asset-test-pezutils?/runtime-benchmarks", + "assets-common?/runtime-benchmarks", + "binary-merkle-tree?/runtime-benchmarks", + "bizinikiwi-frame-rpc-support?/runtime-benchmarks", + "bizinikiwi-frame-rpc-system?/runtime-benchmarks", + "bizinikiwi-rpc-client?/runtime-benchmarks", + "bizinikiwi-state-trie-migration-rpc?/runtime-benchmarks", + "bizinikiwi-wasm-builder?/runtime-benchmarks", + "bp-header-pez-chain?/runtime-benchmarks", + "bp-messages?/runtime-benchmarks", + "bp-pezkuwi-core?/runtime-benchmarks", + "bp-relayers?/runtime-benchmarks", + "bp-test-utils?/runtime-benchmarks", + "bp-teyrchains?/runtime-benchmarks", + "bp-xcm-bridge-hub-router?/runtime-benchmarks", + "bp-xcm-bridge-hub?/runtime-benchmarks", + "bridge-hub-common?/runtime-benchmarks", + "frame-remote-externalities?/runtime-benchmarks", + "pez-generate-bags?/runtime-benchmarks", + "pez-slot-range-helper?/runtime-benchmarks", + "pez-subkey?/runtime-benchmarks", + "pez-tracing-gum?/runtime-benchmarks", + "pezbp-runtime?/runtime-benchmarks", + "pezbridge-hub-test-utils?/runtime-benchmarks", + "pezbridge-runtime-common?/runtime-benchmarks", + "pezcumulus-client-bootnodes?/runtime-benchmarks", + "pezcumulus-client-cli?/runtime-benchmarks", + "pezcumulus-client-collator?/runtime-benchmarks", + "pezcumulus-client-consensus-aura?/runtime-benchmarks", + "pezcumulus-client-consensus-common?/runtime-benchmarks", + "pezcumulus-client-consensus-proposer?/runtime-benchmarks", + "pezcumulus-client-consensus-relay-chain?/runtime-benchmarks", + "pezcumulus-client-network?/runtime-benchmarks", + "pezcumulus-client-pov-recovery?/runtime-benchmarks", + "pezcumulus-client-service?/runtime-benchmarks", + "pezcumulus-client-teyrchain-inherent?/runtime-benchmarks", + "pezcumulus-pezpallet-aura-ext?/runtime-benchmarks", + "pezcumulus-pezpallet-dmp-queue?/runtime-benchmarks", + "pezcumulus-pezpallet-session-benchmarking?/runtime-benchmarks", + "pezcumulus-pezpallet-solo-to-para?/runtime-benchmarks", + "pezcumulus-pezpallet-teyrchain-system?/runtime-benchmarks", + "pezcumulus-pezpallet-weight-reclaim?/runtime-benchmarks", + "pezcumulus-pezpallet-xcm?/runtime-benchmarks", + "pezcumulus-pezpallet-xcmp-queue?/runtime-benchmarks", + "pezcumulus-ping?/runtime-benchmarks", + "pezcumulus-primitives-aura?/runtime-benchmarks", + "pezcumulus-primitives-core?/runtime-benchmarks", + "pezcumulus-primitives-proof-size-hostfunction?/runtime-benchmarks", + "pezcumulus-primitives-storage-weight-reclaim?/runtime-benchmarks", + "pezcumulus-primitives-teyrchain-inherent?/runtime-benchmarks", + "pezcumulus-primitives-timestamp?/runtime-benchmarks", + "pezcumulus-primitives-utility?/runtime-benchmarks", + "pezcumulus-relay-chain-inprocess-interface?/runtime-benchmarks", + "pezcumulus-relay-chain-interface?/runtime-benchmarks", + "pezcumulus-relay-chain-minimal-node?/runtime-benchmarks", + "pezcumulus-relay-chain-rpc-interface?/runtime-benchmarks", + "pezcumulus-relay-chain-streams?/runtime-benchmarks", + "pezframe-benchmarking-cli?/runtime-benchmarks", + "pezframe-benchmarking-pezpallet-pov?/runtime-benchmarks", + "pezframe-benchmarking?/runtime-benchmarks", + "pezframe-election-provider-solution-type?/runtime-benchmarks", + "pezframe-election-provider-support?/runtime-benchmarks", + "pezframe-executive?/runtime-benchmarks", + "pezframe-metadata-hash-extension?/runtime-benchmarks", + "pezframe-support-procedural?/runtime-benchmarks", + "pezframe-support?/runtime-benchmarks", + "pezframe-system-benchmarking?/runtime-benchmarks", + "pezframe-system-rpc-runtime-api?/runtime-benchmarks", + "pezframe-system?/runtime-benchmarks", + "pezkuwi-approval-distribution?/runtime-benchmarks", + "pezkuwi-availability-bitfield-distribution?/runtime-benchmarks", + "pezkuwi-availability-distribution?/runtime-benchmarks", + "pezkuwi-availability-recovery?/runtime-benchmarks", + "pezkuwi-cli?/runtime-benchmarks", + "pezkuwi-collator-protocol?/runtime-benchmarks", + "pezkuwi-core-primitives?/runtime-benchmarks", + "pezkuwi-dispute-distribution?/runtime-benchmarks", + "pezkuwi-erasure-coding?/runtime-benchmarks", + "pezkuwi-gossip-support?/runtime-benchmarks", + "pezkuwi-network-bridge?/runtime-benchmarks", + "pezkuwi-node-collation-generation?/runtime-benchmarks", + "pezkuwi-node-core-approval-voting-parallel?/runtime-benchmarks", + "pezkuwi-node-core-approval-voting?/runtime-benchmarks", + "pezkuwi-node-core-av-store?/runtime-benchmarks", + "pezkuwi-node-core-backing?/runtime-benchmarks", + "pezkuwi-node-core-bitfield-signing?/runtime-benchmarks", + "pezkuwi-node-core-candidate-validation?/runtime-benchmarks", + "pezkuwi-node-core-chain-api?/runtime-benchmarks", + "pezkuwi-node-core-chain-selection?/runtime-benchmarks", + "pezkuwi-node-core-dispute-coordinator?/runtime-benchmarks", + "pezkuwi-node-core-prospective-teyrchains?/runtime-benchmarks", + "pezkuwi-node-core-provisioner?/runtime-benchmarks", + "pezkuwi-node-core-pvf-checker?/runtime-benchmarks", + "pezkuwi-node-core-pvf-common?/runtime-benchmarks", + "pezkuwi-node-core-pvf-execute-worker?/runtime-benchmarks", + "pezkuwi-node-core-pvf-prepare-worker?/runtime-benchmarks", + "pezkuwi-node-core-pvf?/runtime-benchmarks", + "pezkuwi-node-core-runtime-api?/runtime-benchmarks", + "pezkuwi-node-core-teyrchains-inherent?/runtime-benchmarks", + "pezkuwi-node-metrics?/runtime-benchmarks", + "pezkuwi-node-network-protocol?/runtime-benchmarks", + "pezkuwi-node-subsystem-types?/runtime-benchmarks", + "pezkuwi-node-subsystem-util?/runtime-benchmarks", + "pezkuwi-node-subsystem?/runtime-benchmarks", + "pezkuwi-omni-node-lib?/runtime-benchmarks", + "pezkuwi-overseer?/runtime-benchmarks", + "pezkuwi-pez-node-primitives?/runtime-benchmarks", + "pezkuwi-primitives-test-helpers?/runtime-benchmarks", + "pezkuwi-primitives?/runtime-benchmarks", + "pezkuwi-rpc?/runtime-benchmarks", + "pezkuwi-runtime-common?/runtime-benchmarks", + "pezkuwi-runtime-metrics?/runtime-benchmarks", + "pezkuwi-runtime-teyrchains?/runtime-benchmarks", + "pezkuwi-sdk-frame?/runtime-benchmarks", + "pezkuwi-service?/runtime-benchmarks", + "pezkuwi-statement-distribution?/runtime-benchmarks", + "pezkuwi-statement-table?/runtime-benchmarks", + "pezkuwi-teyrchain-primitives?/runtime-benchmarks", + "pezmmr-gadget?/runtime-benchmarks", + "pezmmr-rpc?/runtime-benchmarks", + "pezpallet-alliance?/runtime-benchmarks", + "pezpallet-asset-conversion-ops?/runtime-benchmarks", + "pezpallet-asset-conversion-tx-payment?/runtime-benchmarks", + "pezpallet-asset-conversion?/runtime-benchmarks", + "pezpallet-asset-rate?/runtime-benchmarks", + "pezpallet-asset-rewards?/runtime-benchmarks", + "pezpallet-asset-tx-payment?/runtime-benchmarks", + "pezpallet-assets-freezer?/runtime-benchmarks", + "pezpallet-assets-holder?/runtime-benchmarks", + "pezpallet-assets-precompiles?/runtime-benchmarks", + "pezpallet-assets?/runtime-benchmarks", + "pezpallet-atomic-swap?/runtime-benchmarks", + "pezpallet-aura?/runtime-benchmarks", + "pezpallet-authority-discovery?/runtime-benchmarks", + "pezpallet-authorship?/runtime-benchmarks", + "pezpallet-babe?/runtime-benchmarks", + "pezpallet-bags-list?/runtime-benchmarks", + "pezpallet-balances?/runtime-benchmarks", + "pezpallet-beefy-mmr?/runtime-benchmarks", + "pezpallet-beefy?/runtime-benchmarks", + "pezpallet-bounties?/runtime-benchmarks", + "pezpallet-bridge-grandpa?/runtime-benchmarks", + "pezpallet-bridge-messages?/runtime-benchmarks", + "pezpallet-bridge-relayers?/runtime-benchmarks", + "pezpallet-bridge-teyrchains?/runtime-benchmarks", + "pezpallet-broker?/runtime-benchmarks", + "pezpallet-child-bounties?/runtime-benchmarks", + "pezpallet-collator-selection?/runtime-benchmarks", + "pezpallet-collective-content?/runtime-benchmarks", + "pezpallet-collective?/runtime-benchmarks", + "pezpallet-contracts-mock-network?/runtime-benchmarks", + "pezpallet-contracts?/runtime-benchmarks", + "pezpallet-conviction-voting?/runtime-benchmarks", + "pezpallet-core-fellowship?/runtime-benchmarks", + "pezpallet-delegated-staking?/runtime-benchmarks", + "pezpallet-democracy?/runtime-benchmarks", + "pezpallet-derivatives?/runtime-benchmarks", + "pezpallet-dummy-dim?/runtime-benchmarks", + "pezpallet-election-provider-multi-block?/runtime-benchmarks", + "pezpallet-election-provider-multi-phase?/runtime-benchmarks", + "pezpallet-election-provider-support-benchmarking?/runtime-benchmarks", + "pezpallet-elections-phragmen?/runtime-benchmarks", + "pezpallet-fast-unstake?/runtime-benchmarks", + "pezpallet-glutton?/runtime-benchmarks", + "pezpallet-grandpa?/runtime-benchmarks", + "pezpallet-identity?/runtime-benchmarks", + "pezpallet-im-online?/runtime-benchmarks", + "pezpallet-indices?/runtime-benchmarks", + "pezpallet-insecure-randomness-collective-flip?/runtime-benchmarks", + "pezpallet-lottery?/runtime-benchmarks", + "pezpallet-membership?/runtime-benchmarks", + "pezpallet-message-queue?/runtime-benchmarks", + "pezpallet-meta-tx?/runtime-benchmarks", + "pezpallet-migrations?/runtime-benchmarks", + "pezpallet-mixnet?/runtime-benchmarks", + "pezpallet-mmr?/runtime-benchmarks", + "pezpallet-multi-asset-bounties?/runtime-benchmarks", + "pezpallet-multisig?/runtime-benchmarks", + "pezpallet-nft-fractionalization?/runtime-benchmarks", + "pezpallet-nfts-runtime-api?/runtime-benchmarks", + "pezpallet-nfts?/runtime-benchmarks", + "pezpallet-nis?/runtime-benchmarks", + "pezpallet-node-authorization?/runtime-benchmarks", + "pezpallet-nomination-pools-benchmarking?/runtime-benchmarks", + "pezpallet-nomination-pools-runtime-api?/runtime-benchmarks", + "pezpallet-nomination-pools?/runtime-benchmarks", + "pezpallet-offences-benchmarking?/runtime-benchmarks", + "pezpallet-offences?/runtime-benchmarks", + "pezpallet-oracle-runtime-api?/runtime-benchmarks", + "pezpallet-oracle?/runtime-benchmarks", + "pezpallet-origin-restriction?/runtime-benchmarks", + "pezpallet-paged-list?/runtime-benchmarks", + "pezpallet-parameters?/runtime-benchmarks", + "pezpallet-people?/runtime-benchmarks", + "pezpallet-preimage?/runtime-benchmarks", + "pezpallet-proxy?/runtime-benchmarks", + "pezpallet-ranked-collective?/runtime-benchmarks", + "pezpallet-recovery?/runtime-benchmarks", + "pezpallet-referenda?/runtime-benchmarks", + "pezpallet-remark?/runtime-benchmarks", + "pezpallet-revive?/runtime-benchmarks", + "pezpallet-root-offences?/runtime-benchmarks", + "pezpallet-safe-mode?/runtime-benchmarks", + "pezpallet-salary?/runtime-benchmarks", + "pezpallet-scheduler?/runtime-benchmarks", + "pezpallet-scored-pool?/runtime-benchmarks", + "pezpallet-session-benchmarking?/runtime-benchmarks", + "pezpallet-session?/runtime-benchmarks", + "pezpallet-skip-feeless-payment?/runtime-benchmarks", + "pezpallet-society?/runtime-benchmarks", + "pezpallet-staking-async-ah-client?/runtime-benchmarks", + "pezpallet-staking-async-rc-client?/runtime-benchmarks", + "pezpallet-staking-async-runtime-api?/runtime-benchmarks", + "pezpallet-staking-async?/runtime-benchmarks", + "pezpallet-staking-reward-curve?/runtime-benchmarks", + "pezpallet-staking-runtime-api?/runtime-benchmarks", + "pezpallet-staking?/runtime-benchmarks", + "pezpallet-state-trie-migration?/runtime-benchmarks", + "pezpallet-statement?/runtime-benchmarks", + "pezpallet-sudo?/runtime-benchmarks", + "pezpallet-timestamp?/runtime-benchmarks", + "pezpallet-tips?/runtime-benchmarks", + "pezpallet-transaction-payment-rpc-runtime-api?/runtime-benchmarks", + "pezpallet-transaction-payment-rpc?/runtime-benchmarks", + "pezpallet-transaction-payment?/runtime-benchmarks", + "pezpallet-transaction-storage?/runtime-benchmarks", + "pezpallet-treasury?/runtime-benchmarks", + "pezpallet-tx-pause?/runtime-benchmarks", + "pezpallet-uniques?/runtime-benchmarks", + "pezpallet-utility?/runtime-benchmarks", + "pezpallet-verify-signature?/runtime-benchmarks", + "pezpallet-vesting?/runtime-benchmarks", + "pezpallet-whitelist?/runtime-benchmarks", + "pezpallet-xcm-bridge-hub-router?/runtime-benchmarks", + "pezpallet-xcm-bridge-hub?/runtime-benchmarks", + "pezpallet-xcm-precompiles?/runtime-benchmarks", + "pezpallet-xcm?/runtime-benchmarks", + "pezsc-authority-discovery?/runtime-benchmarks", + "pezsc-basic-authorship?/runtime-benchmarks", + "pezsc-block-builder?/runtime-benchmarks", + "pezsc-chain-spec?/runtime-benchmarks", + "pezsc-cli?/runtime-benchmarks", + "pezsc-client-api?/runtime-benchmarks", + "pezsc-client-db?/runtime-benchmarks", + "pezsc-consensus-aura?/runtime-benchmarks", + "pezsc-consensus-babe-rpc?/runtime-benchmarks", + "pezsc-consensus-babe?/runtime-benchmarks", + "pezsc-consensus-beefy-rpc?/runtime-benchmarks", + "pezsc-consensus-beefy?/runtime-benchmarks", + "pezsc-consensus-epochs?/runtime-benchmarks", + "pezsc-consensus-grandpa-rpc?/runtime-benchmarks", + "pezsc-consensus-grandpa?/runtime-benchmarks", + "pezsc-consensus-manual-seal?/runtime-benchmarks", + "pezsc-consensus-pow?/runtime-benchmarks", + "pezsc-consensus-slots?/runtime-benchmarks", + "pezsc-consensus?/runtime-benchmarks", + "pezsc-executor-wasmtime?/runtime-benchmarks", + "pezsc-executor?/runtime-benchmarks", + "pezsc-informant?/runtime-benchmarks", + "pezsc-mixnet?/runtime-benchmarks", + "pezsc-network-common?/runtime-benchmarks", + "pezsc-network-gossip?/runtime-benchmarks", + "pezsc-network-light?/runtime-benchmarks", + "pezsc-network-statement?/runtime-benchmarks", + "pezsc-network-sync?/runtime-benchmarks", + "pezsc-network-transactions?/runtime-benchmarks", + "pezsc-network?/runtime-benchmarks", + "pezsc-offchain?/runtime-benchmarks", + "pezsc-rpc-api?/runtime-benchmarks", + "pezsc-rpc-server?/runtime-benchmarks", + "pezsc-rpc-spec-v2?/runtime-benchmarks", + "pezsc-rpc?/runtime-benchmarks", + "pezsc-runtime-utilities?/runtime-benchmarks", + "pezsc-service?/runtime-benchmarks", + "pezsc-statement-store?/runtime-benchmarks", + "pezsc-sync-state-rpc?/runtime-benchmarks", + "pezsc-sysinfo?/runtime-benchmarks", + "pezsc-tracing?/runtime-benchmarks", + "pezsc-transaction-pool-api?/runtime-benchmarks", + "pezsc-transaction-pool?/runtime-benchmarks", + "pezsp-api?/runtime-benchmarks", + "pezsp-authority-discovery?/runtime-benchmarks", + "pezsp-block-builder?/runtime-benchmarks", + "pezsp-blockchain?/runtime-benchmarks", + "pezsp-consensus-aura?/runtime-benchmarks", + "pezsp-consensus-babe?/runtime-benchmarks", + "pezsp-consensus-beefy?/runtime-benchmarks", + "pezsp-consensus-grandpa?/runtime-benchmarks", + "pezsp-consensus-pow?/runtime-benchmarks", + "pezsp-consensus-slots?/runtime-benchmarks", + "pezsp-consensus?/runtime-benchmarks", + "pezsp-genesis-builder?/runtime-benchmarks", + "pezsp-inherents?/runtime-benchmarks", + "pezsp-io?/runtime-benchmarks", + "pezsp-keyring?/runtime-benchmarks", + "pezsp-mixnet?/runtime-benchmarks", + "pezsp-mmr-primitives?/runtime-benchmarks", + "pezsp-npos-elections?/runtime-benchmarks", + "pezsp-offchain?/runtime-benchmarks", + "pezsp-runtime-interface?/runtime-benchmarks", + "pezsp-session?/runtime-benchmarks", + "pezsp-staking?/runtime-benchmarks", + "pezsp-state-machine?/runtime-benchmarks", + "pezsp-statement-store?/runtime-benchmarks", + "pezsp-timestamp?/runtime-benchmarks", + "pezsp-transaction-pool?/runtime-benchmarks", + "pezsp-transaction-storage-proof?/runtime-benchmarks", + "pezsp-trie?/runtime-benchmarks", + "pezsp-version-proc-macro?/runtime-benchmarks", + "pezsp-version?/runtime-benchmarks", + "pezstaging-chain-spec-builder?/runtime-benchmarks", + "pezstaging-node-inspect?/runtime-benchmarks", + "pezstaging-teyrchain-info?/runtime-benchmarks", + "pezstaging-xcm-builder?/runtime-benchmarks", + "pezstaging-xcm-executor?/runtime-benchmarks", + "pezstaging-xcm?/runtime-benchmarks", + "testnet-teyrchains-constants?/runtime-benchmarks", + "teyrchains-common?/runtime-benchmarks", + "teyrchains-runtimes-test-utils?/runtime-benchmarks", + "xcm-pez-emulator?/runtime-benchmarks", + "xcm-pez-procedural?/runtime-benchmarks", + "xcm-pez-simulator?/runtime-benchmarks", + "xcm-runtime-pezapis?/runtime-benchmarks", ] try-runtime = [ - "asset-test-pezutils?/try-runtime", - "assets-common?/try-runtime", - "pezcumulus-pezpallet-aura-ext?/try-runtime", - "pezcumulus-pezpallet-dmp-queue?/try-runtime", - "pezcumulus-pezpallet-solo-to-para?/try-runtime", - "pezcumulus-pezpallet-teyrchain-system?/try-runtime", - "pezcumulus-pezpallet-weight-reclaim?/try-runtime", - "pezcumulus-pezpallet-xcm?/try-runtime", - "pezcumulus-pezpallet-xcmp-queue?/try-runtime", - "pezcumulus-ping?/try-runtime", - "pezframe-benchmarking-pezpallet-pov?/try-runtime", - "pezframe-election-provider-support?/try-runtime", - "pezframe-executive?/try-runtime", - "pezframe-support?/try-runtime", - "pezframe-system?/try-runtime", - "pezframe-try-runtime/try-runtime", - "pezpallet-alliance?/try-runtime", - "pezpallet-asset-conversion-ops?/try-runtime", - "pezpallet-asset-conversion-tx-payment?/try-runtime", - "pezpallet-asset-conversion?/try-runtime", - "pezpallet-asset-rate?/try-runtime", - "pezpallet-asset-rewards?/try-runtime", - "pezpallet-asset-tx-payment?/try-runtime", - "pezpallet-assets-freezer?/try-runtime", - "pezpallet-assets-holder?/try-runtime", - "pezpallet-assets-precompiles?/try-runtime", - "pezpallet-assets?/try-runtime", - "pezpallet-atomic-swap?/try-runtime", - "pezpallet-aura?/try-runtime", - "pezpallet-authority-discovery?/try-runtime", - "pezpallet-authorship?/try-runtime", - "pezpallet-babe?/try-runtime", - "pezpallet-bags-list?/try-runtime", - "pezpallet-balances?/try-runtime", - "pezpallet-beefy-mmr?/try-runtime", - "pezpallet-beefy?/try-runtime", - "pezpallet-bounties?/try-runtime", - "pezpallet-bridge-grandpa?/try-runtime", - "pezpallet-bridge-messages?/try-runtime", - "pezpallet-bridge-relayers?/try-runtime", - "pezpallet-bridge-teyrchains?/try-runtime", - "pezpallet-broker?/try-runtime", - "pezpallet-child-bounties?/try-runtime", - "pezpallet-collator-selection?/try-runtime", - "pezpallet-collective-content?/try-runtime", - "pezpallet-collective?/try-runtime", - "pezpallet-contracts?/try-runtime", - "pezpallet-conviction-voting?/try-runtime", - "pezpallet-core-fellowship?/try-runtime", - "pezpallet-delegated-staking?/try-runtime", - "pezpallet-democracy?/try-runtime", - "pezpallet-derivatives?/try-runtime", - "pezpallet-dev-mode?/try-runtime", - "pezpallet-dummy-dim?/try-runtime", - "pezpallet-election-provider-multi-block?/try-runtime", - "pezpallet-election-provider-multi-phase?/try-runtime", - "pezpallet-elections-phragmen?/try-runtime", - "pezpallet-fast-unstake?/try-runtime", - "pezpallet-glutton?/try-runtime", - "pezpallet-grandpa?/try-runtime", - "pezpallet-identity?/try-runtime", - "pezpallet-im-online?/try-runtime", - "pezpallet-indices?/try-runtime", - "pezpallet-insecure-randomness-collective-flip?/try-runtime", - "pezpallet-lottery?/try-runtime", - "pezpallet-membership?/try-runtime", - "pezpallet-message-queue?/try-runtime", - "pezpallet-meta-tx?/try-runtime", - "pezpallet-migrations?/try-runtime", - "pezpallet-mixnet?/try-runtime", - "pezpallet-mmr?/try-runtime", - "pezpallet-multi-asset-bounties?/try-runtime", - "pezpallet-multisig?/try-runtime", - "pezpallet-nft-fractionalization?/try-runtime", - "pezpallet-nfts?/try-runtime", - "pezpallet-nis?/try-runtime", - "pezpallet-node-authorization?/try-runtime", - "pezpallet-nomination-pools?/try-runtime", - "pezpallet-offences?/try-runtime", - "pezpallet-oracle?/try-runtime", - "pezpallet-origin-restriction?/try-runtime", - "pezpallet-paged-list?/try-runtime", - "pezpallet-parameters?/try-runtime", - "pezpallet-people?/try-runtime", - "pezpallet-preimage?/try-runtime", - "pezpallet-proxy?/try-runtime", - "pezpallet-ranked-collective?/try-runtime", - "pezpallet-recovery?/try-runtime", - "pezpallet-referenda?/try-runtime", - "pezpallet-remark?/try-runtime", - "pezpallet-revive?/try-runtime", - "pezpallet-root-offences?/try-runtime", - "pezpallet-root-testing?/try-runtime", - "pezpallet-safe-mode?/try-runtime", - "pezpallet-salary?/try-runtime", - "pezpallet-scheduler?/try-runtime", - "pezpallet-scored-pool?/try-runtime", - "pezpallet-session?/try-runtime", - "pezpallet-skip-feeless-payment?/try-runtime", - "pezpallet-society?/try-runtime", - "pezpallet-staking-async-ah-client?/try-runtime", - "pezpallet-staking-async-rc-client?/try-runtime", - "pezpallet-staking-async?/try-runtime", - "pezpallet-staking?/try-runtime", - "pezpallet-state-trie-migration?/try-runtime", - "pezpallet-statement?/try-runtime", - "pezpallet-sudo?/try-runtime", - "pezpallet-timestamp?/try-runtime", - "pezpallet-tips?/try-runtime", - "pezpallet-transaction-payment?/try-runtime", - "pezpallet-transaction-storage?/try-runtime", - "pezpallet-treasury?/try-runtime", - "pezpallet-tx-pause?/try-runtime", - "pezpallet-uniques?/try-runtime", - "pezpallet-utility?/try-runtime", - "pezpallet-verify-signature?/try-runtime", - "pezpallet-vesting?/try-runtime", - "pezpallet-whitelist?/try-runtime", - "pezpallet-xcm-bridge-hub-router?/try-runtime", - "pezpallet-xcm-bridge-hub?/try-runtime", - "pezpallet-xcm-precompiles?/try-runtime", - "pezpallet-xcm?/try-runtime", - "pezkuwi-cli?/try-runtime", - "pezkuwi-omni-node-lib?/try-runtime", - "pezkuwi-runtime-common?/try-runtime", - "pezkuwi-runtime-teyrchains?/try-runtime", - "pezkuwi-sdk-frame?/try-runtime", - "pezkuwi-service?/try-runtime", - "pezsp-runtime?/try-runtime", - "pezstaging-teyrchain-info?/try-runtime", - "teyrchains-common?/try-runtime", + "asset-test-pezutils?/try-runtime", + "assets-common?/try-runtime", + "pezcumulus-pezpallet-aura-ext?/try-runtime", + "pezcumulus-pezpallet-dmp-queue?/try-runtime", + "pezcumulus-pezpallet-solo-to-para?/try-runtime", + "pezcumulus-pezpallet-teyrchain-system?/try-runtime", + "pezcumulus-pezpallet-weight-reclaim?/try-runtime", + "pezcumulus-pezpallet-xcm?/try-runtime", + "pezcumulus-pezpallet-xcmp-queue?/try-runtime", + "pezcumulus-ping?/try-runtime", + "pezframe-benchmarking-pezpallet-pov?/try-runtime", + "pezframe-election-provider-support?/try-runtime", + "pezframe-executive?/try-runtime", + "pezframe-support?/try-runtime", + "pezframe-system?/try-runtime", + "pezkuwi-cli?/try-runtime", + "pezkuwi-omni-node-lib?/try-runtime", + "pezkuwi-runtime-common?/try-runtime", + "pezkuwi-runtime-teyrchains?/try-runtime", + "pezkuwi-sdk-frame?/try-runtime", + "pezkuwi-service?/try-runtime", + "pezpallet-alliance?/try-runtime", + "pezpallet-asset-conversion-ops?/try-runtime", + "pezpallet-asset-conversion-tx-payment?/try-runtime", + "pezpallet-asset-conversion?/try-runtime", + "pezpallet-asset-rate?/try-runtime", + "pezpallet-asset-rewards?/try-runtime", + "pezpallet-asset-tx-payment?/try-runtime", + "pezpallet-assets-freezer?/try-runtime", + "pezpallet-assets-holder?/try-runtime", + "pezpallet-assets-precompiles?/try-runtime", + "pezpallet-assets?/try-runtime", + "pezpallet-atomic-swap?/try-runtime", + "pezpallet-aura?/try-runtime", + "pezpallet-authority-discovery?/try-runtime", + "pezpallet-authorship?/try-runtime", + "pezpallet-babe?/try-runtime", + "pezpallet-bags-list?/try-runtime", + "pezpallet-balances?/try-runtime", + "pezpallet-beefy-mmr?/try-runtime", + "pezpallet-beefy?/try-runtime", + "pezpallet-bounties?/try-runtime", + "pezpallet-bridge-grandpa?/try-runtime", + "pezpallet-bridge-messages?/try-runtime", + "pezpallet-bridge-relayers?/try-runtime", + "pezpallet-bridge-teyrchains?/try-runtime", + "pezpallet-broker?/try-runtime", + "pezpallet-child-bounties?/try-runtime", + "pezpallet-collator-selection?/try-runtime", + "pezpallet-collective-content?/try-runtime", + "pezpallet-collective?/try-runtime", + "pezpallet-contracts?/try-runtime", + "pezpallet-conviction-voting?/try-runtime", + "pezpallet-core-fellowship?/try-runtime", + "pezpallet-delegated-staking?/try-runtime", + "pezpallet-democracy?/try-runtime", + "pezpallet-derivatives?/try-runtime", + "pezpallet-dummy-dim?/try-runtime", + "pezpallet-election-provider-multi-block?/try-runtime", + "pezpallet-election-provider-multi-phase?/try-runtime", + "pezpallet-elections-phragmen?/try-runtime", + "pezpallet-fast-unstake?/try-runtime", + "pezpallet-glutton?/try-runtime", + "pezpallet-grandpa?/try-runtime", + "pezpallet-identity?/try-runtime", + "pezpallet-im-online?/try-runtime", + "pezpallet-indices?/try-runtime", + "pezpallet-insecure-randomness-collective-flip?/try-runtime", + "pezpallet-lottery?/try-runtime", + "pezpallet-membership?/try-runtime", + "pezpallet-message-queue?/try-runtime", + "pezpallet-meta-tx?/try-runtime", + "pezpallet-migrations?/try-runtime", + "pezpallet-mixnet?/try-runtime", + "pezpallet-mmr?/try-runtime", + "pezpallet-multi-asset-bounties?/try-runtime", + "pezpallet-multisig?/try-runtime", + "pezpallet-nft-fractionalization?/try-runtime", + "pezpallet-nfts?/try-runtime", + "pezpallet-nis?/try-runtime", + "pezpallet-node-authorization?/try-runtime", + "pezpallet-nomination-pools?/try-runtime", + "pezpallet-offences?/try-runtime", + "pezpallet-oracle?/try-runtime", + "pezpallet-origin-restriction?/try-runtime", + "pezpallet-paged-list?/try-runtime", + "pezpallet-parameters?/try-runtime", + "pezpallet-people?/try-runtime", + "pezpallet-preimage?/try-runtime", + "pezpallet-proxy?/try-runtime", + "pezpallet-ranked-collective?/try-runtime", + "pezpallet-recovery?/try-runtime", + "pezpallet-referenda?/try-runtime", + "pezpallet-remark?/try-runtime", + "pezpallet-revive?/try-runtime", + "pezpallet-root-offences?/try-runtime", + "pezpallet-safe-mode?/try-runtime", + "pezpallet-salary?/try-runtime", + "pezpallet-scheduler?/try-runtime", + "pezpallet-scored-pool?/try-runtime", + "pezpallet-session?/try-runtime", + "pezpallet-skip-feeless-payment?/try-runtime", + "pezpallet-society?/try-runtime", + "pezpallet-staking-async-ah-client?/try-runtime", + "pezpallet-staking-async-rc-client?/try-runtime", + "pezpallet-staking-async?/try-runtime", + "pezpallet-staking?/try-runtime", + "pezpallet-state-trie-migration?/try-runtime", + "pezpallet-statement?/try-runtime", + "pezpallet-sudo?/try-runtime", + "pezpallet-timestamp?/try-runtime", + "pezpallet-tips?/try-runtime", + "pezpallet-transaction-payment?/try-runtime", + "pezpallet-transaction-storage?/try-runtime", + "pezpallet-treasury?/try-runtime", + "pezpallet-tx-pause?/try-runtime", + "pezpallet-uniques?/try-runtime", + "pezpallet-utility?/try-runtime", + "pezpallet-verify-signature?/try-runtime", + "pezpallet-vesting?/try-runtime", + "pezpallet-whitelist?/try-runtime", + "pezpallet-xcm-bridge-hub-router?/try-runtime", + "pezpallet-xcm-bridge-hub?/try-runtime", + "pezpallet-xcm-precompiles?/try-runtime", + "pezpallet-xcm?/try-runtime", + "pezstaging-teyrchain-info?/try-runtime", + "teyrchains-common?/try-runtime", ] serde = [ - "bp-pezkuwi-core?/serde", - "pezframe-benchmarking?/serde", - "pezpallet-asset-tx-payment?/serde", - "pezpallet-beefy-mmr?/serde", - "pezpallet-beefy?/serde", - "pezpallet-contracts?/serde", - "pezpallet-conviction-voting?/serde", - "pezpallet-democracy?/serde", - "pezpallet-message-queue?/serde", - "pezpallet-meta-tx?/serde", - "pezpallet-offences?/serde", - "pezpallet-parameters?/serde", - "pezpallet-referenda?/serde", - "pezpallet-remark?/serde", - "pezpallet-state-trie-migration?/serde", - "pezpallet-tips?/serde", - "pezpallet-transaction-payment?/serde", - "pezpallet-transaction-storage?/serde", - "pezpallet-treasury?/serde", - "pezpallet-xcm?/serde", - "pezsp-application-crypto?/serde", - "pezsp-arithmetic?/serde", - "pezsp-authority-discovery?/serde", - "pezsp-consensus-aura?/serde", - "pezsp-consensus-babe?/serde", - "pezsp-consensus-beefy?/serde", - "pezsp-consensus-grandpa?/serde", - "pezsp-consensus-slots?/serde", - "pezsp-core?/serde", - "pezsp-mmr-primitives?/serde", - "pezsp-npos-elections?/serde", - "pezsp-runtime?/serde", - "pezsp-staking?/serde", - "pezsp-statement-store?/serde", - "pezsp-storage?/serde", - "pezsp-version?/serde", - "pezsp-weights?/serde", + "bp-pezkuwi-core?/serde", + "pezframe-benchmarking?/serde", + "pezpallet-asset-tx-payment?/serde", + "pezpallet-beefy-mmr?/serde", + "pezpallet-beefy?/serde", + "pezpallet-contracts?/serde", + "pezpallet-conviction-voting?/serde", + "pezpallet-democracy?/serde", + "pezpallet-message-queue?/serde", + "pezpallet-meta-tx?/serde", + "pezpallet-offences?/serde", + "pezpallet-parameters?/serde", + "pezpallet-referenda?/serde", + "pezpallet-remark?/serde", + "pezpallet-state-trie-migration?/serde", + "pezpallet-tips?/serde", + "pezpallet-transaction-payment?/serde", + "pezpallet-transaction-storage?/serde", + "pezpallet-treasury?/serde", + "pezpallet-xcm?/serde", + "pezsp-application-crypto?/serde", + "pezsp-arithmetic?/serde", + "pezsp-authority-discovery?/serde", + "pezsp-consensus-aura?/serde", + "pezsp-consensus-babe?/serde", + "pezsp-consensus-beefy?/serde", + "pezsp-consensus-grandpa?/serde", + "pezsp-consensus-slots?/serde", + "pezsp-core?/serde", + "pezsp-mmr-primitives?/serde", + "pezsp-npos-elections?/serde", + "pezsp-staking?/serde", + "pezsp-statement-store?/serde", + "pezsp-storage?/serde", + "pezsp-version?/serde", + "pezsp-weights?/serde", ] experimental = [ - "pezframe-support-procedural?/experimental", - "pezframe-support?/experimental", - "pezframe-system?/experimental", - "pezkuwi-sdk-frame?/experimental", + "pezframe-support-procedural?/experimental", + "pezframe-support?/experimental", + "pezframe-system?/experimental", + "pezkuwi-sdk-frame?/experimental", ] with-tracing = [ - "pezframe-executive?/with-tracing", - "pezsp-io?/with-tracing", - "pezsp-tracing?/with-tracing", + "pezframe-executive?/with-tracing", + "pezsp-io?/with-tracing", + "pezsp-tracing?/with-tracing", ] runtime-full = [ - "assets-common", - "binary-merkle-tree", - "bp-header-pez-chain", - "bp-messages", - "bp-pezkuwi-core", - "bp-relayers", - "pezbp-runtime", - "bp-test-utils", - "bp-teyrchains", - "bp-xcm-bridge-hub", - "bp-xcm-bridge-hub-router", - "bridge-hub-common", - "pezbridge-runtime-common", - "pezcumulus-pezpallet-aura-ext", - "pezcumulus-pezpallet-dmp-queue", - "pezcumulus-pezpallet-session-benchmarking", - "pezcumulus-pezpallet-solo-to-para", - "pezcumulus-pezpallet-teyrchain-system", - "pezcumulus-pezpallet-teyrchain-system-proc-macro", - "pezcumulus-pezpallet-weight-reclaim", - "pezcumulus-pezpallet-xcm", - "pezcumulus-pezpallet-xcmp-queue", - "pezcumulus-ping", - "pezcumulus-primitives-aura", - "pezcumulus-primitives-core", - "pezcumulus-primitives-proof-size-hostfunction", - "pezcumulus-primitives-storage-weight-reclaim", - "pezcumulus-primitives-teyrchain-inherent", - "pezcumulus-primitives-timestamp", - "pezcumulus-primitives-utility", - "pez-ethereum-standards", - "pezframe-benchmarking", - "pezframe-benchmarking-pezpallet-pov", - "pezframe-election-provider-solution-type", - "pezframe-election-provider-support", - "pezframe-executive", - "pezframe-metadata-hash-extension", - "pezframe-support", - "pezframe-support-procedural", - "pezframe-support-procedural-tools-derive", - "pezframe-system", - "pezframe-system-benchmarking", - "pezframe-system-rpc-runtime-api", - "pezframe-try-runtime", - "pezpallet-alliance", - "pezpallet-asset-conversion", - "pezpallet-asset-conversion-ops", - "pezpallet-asset-conversion-tx-payment", - "pezpallet-asset-rate", - "pezpallet-asset-rewards", - "pezpallet-asset-tx-payment", - "pezpallet-assets", - "pezpallet-assets-freezer", - "pezpallet-assets-holder", - "pezpallet-assets-precompiles", - "pezpallet-atomic-swap", - "pezpallet-aura", - "pezpallet-authority-discovery", - "pezpallet-authorship", - "pezpallet-babe", - "pezpallet-bags-list", - "pezpallet-balances", - "pezpallet-beefy", - "pezpallet-beefy-mmr", - "pezpallet-bounties", - "pezpallet-bridge-grandpa", - "pezpallet-bridge-messages", - "pezpallet-bridge-relayers", - "pezpallet-bridge-teyrchains", - "pezpallet-broker", - "pezpallet-child-bounties", - "pezpallet-collator-selection", - "pezpallet-collective", - "pezpallet-collective-content", - "pezpallet-contracts", - "pezpallet-contracts-proc-macro", - "pezpallet-contracts-uapi", - "pezpallet-conviction-voting", - "pezpallet-core-fellowship", - "pezpallet-delegated-staking", - "pezpallet-democracy", - "pezpallet-derivatives", - "pezpallet-dev-mode", - "pezpallet-dummy-dim", - "pezpallet-election-provider-multi-block", - "pezpallet-election-provider-multi-phase", - "pezpallet-election-provider-support-benchmarking", - "pezpallet-elections-phragmen", - "pezpallet-fast-unstake", - "pezpallet-glutton", - "pezpallet-grandpa", - "pezpallet-identity", - "pezpallet-im-online", - "pezpallet-indices", - "pezpallet-insecure-randomness-collective-flip", - "pezpallet-lottery", - "pezpallet-membership", - "pezpallet-message-queue", - "pezpallet-meta-tx", - "pezpallet-migrations", - "pezpallet-mixnet", - "pezpallet-mmr", - "pezpallet-multi-asset-bounties", - "pezpallet-multisig", - "pezpallet-nft-fractionalization", - "pezpallet-nfts", - "pezpallet-nfts-runtime-api", - "pezpallet-nis", - "pezpallet-node-authorization", - "pezpallet-nomination-pools", - "pezpallet-nomination-pools-benchmarking", - "pezpallet-nomination-pools-runtime-api", - "pezpallet-offences", - "pezpallet-offences-benchmarking", - "pezpallet-oracle", - "pezpallet-oracle-runtime-api", - "pezpallet-origin-restriction", - "pezpallet-paged-list", - "pezpallet-parameters", - "pezpallet-people", - "pezpallet-preimage", - "pezpallet-proxy", - "pezpallet-ranked-collective", - "pezpallet-recovery", - "pezpallet-referenda", - "pezpallet-remark", - "pezpallet-revive", - "pezpallet-revive-proc-macro", - "pezpallet-revive-uapi", - "pezpallet-root-offences", - "pezpallet-root-testing", - "pezpallet-safe-mode", - "pezpallet-salary", - "pezpallet-scheduler", - "pezpallet-scored-pool", - "pezpallet-session", - "pezpallet-session-benchmarking", - "pezpallet-skip-feeless-payment", - "pezpallet-society", - "pezpallet-staking", - "pezpallet-staking-async", - "pezpallet-staking-async-ah-client", - "pezpallet-staking-async-rc-client", - "pezpallet-staking-async-reward-fn", - "pezpallet-staking-async-runtime-api", - "pezpallet-staking-reward-curve", - "pezpallet-staking-reward-fn", - "pezpallet-staking-runtime-api", - "pezpallet-state-trie-migration", - "pezpallet-statement", - "pezpallet-sudo", - "pezpallet-timestamp", - "pezpallet-tips", - "pezpallet-transaction-payment", - "pezpallet-transaction-payment-rpc-runtime-api", - "pezpallet-transaction-storage", - "pezpallet-treasury", - "pezpallet-tx-pause", - "pezpallet-uniques", - "pezpallet-utility", - "pezpallet-verify-signature", - "pezpallet-vesting", - "pezpallet-whitelist", - "pezpallet-xcm", - "pezpallet-xcm-benchmarks", - "pezpallet-xcm-bridge-hub", - "pezpallet-xcm-bridge-hub-router", - "pezpallet-xcm-precompiles", - "pezkuwi-core-primitives", - "pezkuwi-primitives", - "pezkuwi-runtime-common", - "pezkuwi-runtime-metrics", - "pezkuwi-runtime-teyrchains", - "pezkuwi-sdk-frame", - "pezkuwi-teyrchain-primitives", - "pezsc-chain-spec-derive", - "pezsc-tracing-proc-macro", - "pez-slot-range-helper", - "pezsp-api", - "pezsp-api-proc-macro", - "pezsp-application-crypto", - "pezsp-arithmetic", - "pezsp-authority-discovery", - "pezsp-block-builder", - "pezsp-consensus-aura", - "pezsp-consensus-babe", - "pezsp-consensus-beefy", - "pezsp-consensus-grandpa", - "pezsp-consensus-pow", - "pezsp-consensus-slots", - "pezsp-core", - "pezsp-crypto-ec-utils", - "pezsp-crypto-hashing", - "pezsp-crypto-hashing-proc-macro", - "pezsp-debug-derive", - "pezsp-externalities", - "pezsp-genesis-builder", - "pezsp-inherents", - "pezsp-io", - "pezsp-keyring", - "pezsp-keystore", - "pezsp-metadata-ir", - "pezsp-mixnet", - "pezsp-mmr-primitives", - "pezsp-npos-elections", - "pezsp-offchain", - "pezsp-runtime", - "pezsp-runtime-interface", - "pezsp-runtime-interface-proc-macro", - "pezsp-session", - "pezsp-staking", - "pezsp-state-machine", - "pezsp-statement-store", - "pezsp-std", - "pezsp-storage", - "pezsp-timestamp", - "pezsp-tracing", - "pezsp-transaction-pool", - "pezsp-transaction-storage-proof", - "pezsp-trie", - "pezsp-version", - "pezsp-version-proc-macro", - "pezsp-wasm-interface", - "pezsp-weights", - "pezstaging-teyrchain-info", - "pezstaging-xcm", - "pezstaging-xcm-builder", - "pezstaging-xcm-executor", - "bizinikiwi-bip39", - "testnet-teyrchains-constants", - "teyrchains-common", - "pez-tracing-gum-proc-macro", - "xcm-pez-procedural", - "xcm-runtime-pezapis", + "assets-common", + "binary-merkle-tree", + "bizinikiwi-bip39", + "bp-header-pez-chain", + "bp-messages", + "bp-pezkuwi-core", + "bp-relayers", + "bp-test-utils", + "bp-teyrchains", + "bp-xcm-bridge-hub", + "bp-xcm-bridge-hub-router", + "bridge-hub-common", + "pez-ethereum-standards", + "pez-slot-range-helper", + "pez-tracing-gum-proc-macro", + "pezbp-runtime", + "pezbridge-runtime-common", + "pezcumulus-pezpallet-aura-ext", + "pezcumulus-pezpallet-dmp-queue", + "pezcumulus-pezpallet-session-benchmarking", + "pezcumulus-pezpallet-solo-to-para", + "pezcumulus-pezpallet-teyrchain-system", + "pezcumulus-pezpallet-teyrchain-system-proc-macro", + "pezcumulus-pezpallet-weight-reclaim", + "pezcumulus-pezpallet-xcm", + "pezcumulus-pezpallet-xcmp-queue", + "pezcumulus-ping", + "pezcumulus-primitives-aura", + "pezcumulus-primitives-core", + "pezcumulus-primitives-proof-size-hostfunction", + "pezcumulus-primitives-storage-weight-reclaim", + "pezcumulus-primitives-teyrchain-inherent", + "pezcumulus-primitives-timestamp", + "pezcumulus-primitives-utility", + "pezframe-benchmarking", + "pezframe-benchmarking-pezpallet-pov", + "pezframe-election-provider-solution-type", + "pezframe-election-provider-support", + "pezframe-executive", + "pezframe-metadata-hash-extension", + "pezframe-support", + "pezframe-support-procedural", + "pezframe-support-procedural-tools-derive", + "pezframe-system", + "pezframe-system-benchmarking", + "pezframe-system-rpc-runtime-api", + "pezkuwi-core-primitives", + "pezkuwi-primitives", + "pezkuwi-runtime-common", + "pezkuwi-runtime-metrics", + "pezkuwi-runtime-teyrchains", + "pezkuwi-sdk-frame", + "pezkuwi-teyrchain-primitives", + "pezpallet-alliance", + "pezpallet-asset-conversion", + "pezpallet-asset-conversion-ops", + "pezpallet-asset-conversion-tx-payment", + "pezpallet-asset-rate", + "pezpallet-asset-rewards", + "pezpallet-asset-tx-payment", + "pezpallet-assets", + "pezpallet-assets-freezer", + "pezpallet-assets-holder", + "pezpallet-assets-precompiles", + "pezpallet-atomic-swap", + "pezpallet-aura", + "pezpallet-authority-discovery", + "pezpallet-authorship", + "pezpallet-babe", + "pezpallet-bags-list", + "pezpallet-balances", + "pezpallet-beefy", + "pezpallet-beefy-mmr", + "pezpallet-bounties", + "pezpallet-bridge-grandpa", + "pezpallet-bridge-messages", + "pezpallet-bridge-relayers", + "pezpallet-bridge-teyrchains", + "pezpallet-broker", + "pezpallet-child-bounties", + "pezpallet-collator-selection", + "pezpallet-collective", + "pezpallet-collective-content", + "pezpallet-contracts", + "pezpallet-contracts-proc-macro", + "pezpallet-contracts-uapi", + "pezpallet-conviction-voting", + "pezpallet-core-fellowship", + "pezpallet-delegated-staking", + "pezpallet-democracy", + "pezpallet-derivatives", + "pezpallet-dummy-dim", + "pezpallet-election-provider-multi-block", + "pezpallet-election-provider-multi-phase", + "pezpallet-election-provider-support-benchmarking", + "pezpallet-elections-phragmen", + "pezpallet-fast-unstake", + "pezpallet-glutton", + "pezpallet-grandpa", + "pezpallet-identity", + "pezpallet-im-online", + "pezpallet-indices", + "pezpallet-insecure-randomness-collective-flip", + "pezpallet-lottery", + "pezpallet-membership", + "pezpallet-message-queue", + "pezpallet-meta-tx", + "pezpallet-migrations", + "pezpallet-mixnet", + "pezpallet-mmr", + "pezpallet-multi-asset-bounties", + "pezpallet-multisig", + "pezpallet-nft-fractionalization", + "pezpallet-nfts", + "pezpallet-nfts-runtime-api", + "pezpallet-nis", + "pezpallet-node-authorization", + "pezpallet-nomination-pools", + "pezpallet-nomination-pools-benchmarking", + "pezpallet-nomination-pools-runtime-api", + "pezpallet-offences", + "pezpallet-offences-benchmarking", + "pezpallet-oracle", + "pezpallet-oracle-runtime-api", + "pezpallet-origin-restriction", + "pezpallet-paged-list", + "pezpallet-parameters", + "pezpallet-people", + "pezpallet-preimage", + "pezpallet-proxy", + "pezpallet-ranked-collective", + "pezpallet-recovery", + "pezpallet-referenda", + "pezpallet-remark", + "pezpallet-revive", + "pezpallet-revive-proc-macro", + "pezpallet-revive-uapi", + "pezpallet-root-offences", + "pezpallet-safe-mode", + "pezpallet-salary", + "pezpallet-scheduler", + "pezpallet-scored-pool", + "pezpallet-session", + "pezpallet-session-benchmarking", + "pezpallet-skip-feeless-payment", + "pezpallet-society", + "pezpallet-staking", + "pezpallet-staking-async", + "pezpallet-staking-async-ah-client", + "pezpallet-staking-async-rc-client", + "pezpallet-staking-async-reward-fn", + "pezpallet-staking-async-runtime-api", + "pezpallet-staking-reward-curve", + "pezpallet-staking-reward-fn", + "pezpallet-staking-runtime-api", + "pezpallet-state-trie-migration", + "pezpallet-statement", + "pezpallet-sudo", + "pezpallet-timestamp", + "pezpallet-tips", + "pezpallet-transaction-payment", + "pezpallet-transaction-payment-rpc-runtime-api", + "pezpallet-transaction-storage", + "pezpallet-treasury", + "pezpallet-tx-pause", + "pezpallet-uniques", + "pezpallet-utility", + "pezpallet-verify-signature", + "pezpallet-vesting", + "pezpallet-whitelist", + "pezpallet-xcm", + "pezpallet-xcm-bridge-hub", + "pezpallet-xcm-bridge-hub-router", + "pezpallet-xcm-precompiles", + "pezsc-chain-spec-derive", + "pezsc-tracing-proc-macro", + "pezsp-api", + "pezsp-api-proc-macro", + "pezsp-application-crypto", + "pezsp-arithmetic", + "pezsp-authority-discovery", + "pezsp-block-builder", + "pezsp-consensus-aura", + "pezsp-consensus-babe", + "pezsp-consensus-beefy", + "pezsp-consensus-grandpa", + "pezsp-consensus-pow", + "pezsp-consensus-slots", + "pezsp-core", + "pezsp-crypto-ec-utils", + "pezsp-crypto-hashing", + "pezsp-crypto-hashing-proc-macro", + "pezsp-debug-derive", + "pezsp-externalities", + "pezsp-genesis-builder", + "pezsp-inherents", + "pezsp-io", + "pezsp-keyring", + "pezsp-keystore", + "pezsp-metadata-ir", + "pezsp-mixnet", + "pezsp-mmr-primitives", + "pezsp-npos-elections", + "pezsp-offchain", + "pezsp-runtime-interface", + "pezsp-runtime-interface-proc-macro", + "pezsp-session", + "pezsp-staking", + "pezsp-state-machine", + "pezsp-statement-store", + "pezsp-std", + "pezsp-storage", + "pezsp-timestamp", + "pezsp-tracing", + "pezsp-transaction-pool", + "pezsp-transaction-storage-proof", + "pezsp-trie", + "pezsp-version", + "pezsp-version-proc-macro", + "pezsp-wasm-interface", + "pezsp-weights", + "pezstaging-teyrchain-info", + "pezstaging-xcm", + "pezstaging-xcm-builder", + "pezstaging-xcm-executor", + "testnet-teyrchains-constants", + "teyrchains-common", + "xcm-pez-procedural", + "xcm-runtime-pezapis", ] runtime = [ - "pezframe-benchmarking", - "pezframe-benchmarking-pezpallet-pov", - "pezframe-election-provider-solution-type", - "pezframe-election-provider-support", - "pezframe-executive", - "pezframe-metadata-hash-extension", - "pezframe-support", - "pezframe-support-procedural", - "pezframe-support-procedural-tools-derive", - "pezframe-system", - "pezframe-system-benchmarking", - "pezframe-system-rpc-runtime-api", - "pezframe-try-runtime", - "pezkuwi-sdk-frame", - "pezkuwi-sdk-frame?/runtime", - "pezsp-api", - "pezsp-api-proc-macro", - "pezsp-application-crypto", - "pezsp-arithmetic", - "pezsp-authority-discovery", - "pezsp-block-builder", - "pezsp-consensus-aura", - "pezsp-consensus-babe", - "pezsp-consensus-beefy", - "pezsp-consensus-grandpa", - "pezsp-consensus-pow", - "pezsp-consensus-slots", - "pezsp-core", - "pezsp-crypto-ec-utils", - "pezsp-crypto-hashing", - "pezsp-crypto-hashing-proc-macro", - "pezsp-debug-derive", - "pezsp-externalities", - "pezsp-genesis-builder", - "pezsp-inherents", - "pezsp-io", - "pezsp-keyring", - "pezsp-keystore", - "pezsp-metadata-ir", - "pezsp-mixnet", - "pezsp-mmr-primitives", - "pezsp-npos-elections", - "pezsp-offchain", - "pezsp-runtime", - "pezsp-runtime-interface", - "pezsp-runtime-interface-proc-macro", - "pezsp-session", - "pezsp-staking", - "pezsp-state-machine", - "pezsp-statement-store", - "pezsp-std", - "pezsp-storage", - "pezsp-timestamp", - "pezsp-tracing", - "pezsp-transaction-pool", - "pezsp-transaction-storage-proof", - "pezsp-trie", - "pezsp-version", - "pezsp-version-proc-macro", - "pezsp-wasm-interface", - "pezsp-weights", + "pezframe-benchmarking", + "pezframe-benchmarking-pezpallet-pov", + "pezframe-election-provider-solution-type", + "pezframe-election-provider-support", + "pezframe-executive", + "pezframe-metadata-hash-extension", + "pezframe-support", + "pezframe-support-procedural", + "pezframe-support-procedural-tools-derive", + "pezframe-system", + "pezframe-system-benchmarking", + "pezframe-system-rpc-runtime-api", + "pezkuwi-sdk-frame", + "pezkuwi-sdk-frame?/runtime", ] node = [ - "asset-test-pezutils", - "pezbridge-hub-test-utils", - "pezcumulus-client-bootnodes", - "pezcumulus-client-cli", - "pezcumulus-client-collator", - "pezcumulus-client-consensus-aura", - "pezcumulus-client-consensus-common", - "pezcumulus-client-consensus-proposer", - "pezcumulus-client-consensus-relay-chain", - "pezcumulus-client-network", - "pezcumulus-client-pov-recovery", - "pezcumulus-client-service", - "pezcumulus-client-teyrchain-inherent", - "pezcumulus-relay-chain-inprocess-interface", - "pezcumulus-relay-chain-interface", - "pezcumulus-relay-chain-minimal-node", - "pezcumulus-relay-chain-rpc-interface", - "pezcumulus-relay-chain-streams", - "pezcumulus-test-relay-sproof-builder", - "emulated-integration-tests-common", - "pez-fork-tree", - "pezframe-benchmarking-cli", - "frame-remote-externalities", - "pezframe-support-procedural-tools", - "pez-generate-bags", - "pezmmr-gadget", - "pezmmr-rpc", - "pezpallet-contracts-mock-network", - "pezpallet-transaction-payment-rpc", - "pezkuwi-approval-distribution", - "pezkuwi-availability-bitfield-distribution", - "pezkuwi-availability-distribution", - "pezkuwi-availability-recovery", - "pezkuwi-cli", - "pezkuwi-collator-protocol", - "pezkuwi-dispute-distribution", - "pezkuwi-erasure-coding", - "pezkuwi-gossip-support", - "pezkuwi-network-bridge", - "pezkuwi-node-collation-generation", - "pezkuwi-node-core-approval-voting", - "pezkuwi-node-core-approval-voting-parallel", - "pezkuwi-node-core-av-store", - "pezkuwi-node-core-backing", - "pezkuwi-node-core-bitfield-signing", - "pezkuwi-node-core-candidate-validation", - "pezkuwi-node-core-chain-api", - "pezkuwi-node-core-chain-selection", - "pezkuwi-node-core-dispute-coordinator", - "pezkuwi-node-core-prospective-teyrchains", - "pezkuwi-node-core-provisioner", - "pezkuwi-node-core-pvf", - "pezkuwi-node-core-pvf-checker", - "pezkuwi-node-core-pvf-common", - "pezkuwi-node-core-pvf-execute-worker", - "pezkuwi-node-core-pvf-prepare-worker", - "pezkuwi-node-core-runtime-api", - "pezkuwi-node-core-teyrchains-inherent", - "pezkuwi-node-metrics", - "pezkuwi-node-network-protocol", - "pezkuwi-pez-node-primitives", - "pezkuwi-node-subsystem", - "pezkuwi-node-subsystem-types", - "pezkuwi-node-subsystem-util", - "pezkuwi-omni-node-lib", - "pezkuwi-overseer", - "pezkuwi-primitives-test-helpers", - "pezkuwi-rpc", - "pezkuwi-service", - "pezkuwi-statement-distribution", - "pezkuwi-statement-table", - "pezsc-allocator", - "pezsc-authority-discovery", - "pezsc-basic-authorship", - "pezsc-block-builder", - "pezsc-chain-spec", - "pezsc-cli", - "pezsc-client-api", - "pezsc-client-db", - "pezsc-consensus", - "pezsc-consensus-aura", - "pezsc-consensus-babe", - "pezsc-consensus-babe-rpc", - "pezsc-consensus-beefy", - "pezsc-consensus-beefy-rpc", - "pezsc-consensus-epochs", - "pezsc-consensus-grandpa", - "pezsc-consensus-grandpa-rpc", - "pezsc-consensus-manual-seal", - "pezsc-consensus-pow", - "pezsc-consensus-slots", - "pezsc-executor", - "pezsc-executor-common", - "pezsc-executor-polkavm", - "pezsc-executor-wasmtime", - "pezsc-informant", - "pezsc-keystore", - "pezsc-mixnet", - "pezsc-network", - "pezsc-network-common", - "pezsc-network-gossip", - "pezsc-network-light", - "pezsc-network-statement", - "pezsc-network-sync", - "pezsc-network-transactions", - "pezsc-network-types", - "pezsc-offchain", - "pezsc-proposer-metrics", - "pezsc-rpc", - "pezsc-rpc-api", - "pezsc-rpc-server", - "pezsc-rpc-spec-v2", - "pezsc-runtime-utilities", - "pezsc-service", - "pezsc-state-db", - "pezsc-statement-store", - "pezsc-storage-monitor", - "pezsc-sync-state-rpc", - "pezsc-sysinfo", - "pezsc-telemetry", - "pezsc-tracing", - "pezsc-transaction-pool", - "pezsc-transaction-pool-api", - "pezsc-utils", - "pezsp-blockchain", - "pezsp-consensus", - "pezsp-core-hashing", - "pezsp-core-hashing-proc-macro", - "pezsp-database", - "pezsp-maybe-compressed-blob", - "pezsp-panic-handler", - "pezsp-rpc", - "pezstaging-chain-spec-builder", - "pezstaging-node-inspect", - "pezstaging-tracking-allocator", - "std", - "pez-subkey", - "bizinikiwi-build-script-utils", - "bizinikiwi-frame-rpc-support", - "bizinikiwi-frame-rpc-system", - "bizinikiwi-prometheus-endpoint", - "bizinikiwi-rpc-client", - "bizinikiwi-state-trie-migration-rpc", - "bizinikiwi-wasm-builder", - "teyrchains-runtimes-test-utils", - "pez-tracing-gum", - "xcm-pez-emulator", - "xcm-pez-simulator", + "asset-test-pezutils", + "bizinikiwi-build-script-utils", + "bizinikiwi-frame-rpc-support", + "bizinikiwi-frame-rpc-system", + "bizinikiwi-prometheus-endpoint", + "bizinikiwi-rpc-client", + "bizinikiwi-state-trie-migration-rpc", + "bizinikiwi-txtesttool", + "bizinikiwi-wasm-builder", + "frame-remote-externalities", + "pez-fork-tree", + "pez-generate-bags", + "pez-subkey", + "pez-tracing-gum", + "pezbridge-hub-test-utils", + "pezcumulus-client-bootnodes", + "pezcumulus-client-cli", + "pezcumulus-client-collator", + "pezcumulus-client-consensus-aura", + "pezcumulus-client-consensus-common", + "pezcumulus-client-consensus-proposer", + "pezcumulus-client-consensus-relay-chain", + "pezcumulus-client-network", + "pezcumulus-client-pov-recovery", + "pezcumulus-client-service", + "pezcumulus-client-teyrchain-inherent", + "pezcumulus-relay-chain-inprocess-interface", + "pezcumulus-relay-chain-interface", + "pezcumulus-relay-chain-minimal-node", + "pezcumulus-relay-chain-rpc-interface", + "pezcumulus-relay-chain-streams", + "pezframe-benchmarking-cli", + "pezframe-support-procedural-tools", + "pezkuwi-approval-distribution", + "pezkuwi-availability-bitfield-distribution", + "pezkuwi-availability-distribution", + "pezkuwi-availability-recovery", + "pezkuwi-cli", + "pezkuwi-collator-protocol", + "pezkuwi-dispute-distribution", + "pezkuwi-erasure-coding", + "pezkuwi-gossip-support", + "pezkuwi-network-bridge", + "pezkuwi-node-collation-generation", + "pezkuwi-node-core-approval-voting", + "pezkuwi-node-core-approval-voting-parallel", + "pezkuwi-node-core-av-store", + "pezkuwi-node-core-backing", + "pezkuwi-node-core-bitfield-signing", + "pezkuwi-node-core-candidate-validation", + "pezkuwi-node-core-chain-api", + "pezkuwi-node-core-chain-selection", + "pezkuwi-node-core-dispute-coordinator", + "pezkuwi-node-core-prospective-teyrchains", + "pezkuwi-node-core-provisioner", + "pezkuwi-node-core-pvf", + "pezkuwi-node-core-pvf-checker", + "pezkuwi-node-core-pvf-common", + "pezkuwi-node-core-pvf-execute-worker", + "pezkuwi-node-core-pvf-prepare-worker", + "pezkuwi-node-core-runtime-api", + "pezkuwi-node-core-teyrchains-inherent", + "pezkuwi-node-metrics", + "pezkuwi-node-network-protocol", + "pezkuwi-node-subsystem", + "pezkuwi-node-subsystem-types", + "pezkuwi-node-subsystem-util", + "pezkuwi-omni-node-lib", + "pezkuwi-overseer", + "pezkuwi-pez-node-primitives", + "pezkuwi-primitives-test-helpers", + "pezkuwi-rpc", + "pezkuwi-service", + "pezkuwi-statement-distribution", + "pezkuwi-statement-table", + "pezmmr-gadget", + "pezmmr-rpc", + "pezpallet-contracts-mock-network", + "pezpallet-transaction-payment-rpc", + "pezsc-allocator", + "pezsc-authority-discovery", + "pezsc-basic-authorship", + "pezsc-block-builder", + "pezsc-chain-spec", + "pezsc-cli", + "pezsc-client-api", + "pezsc-client-db", + "pezsc-consensus", + "pezsc-consensus-aura", + "pezsc-consensus-babe", + "pezsc-consensus-babe-rpc", + "pezsc-consensus-beefy", + "pezsc-consensus-beefy-rpc", + "pezsc-consensus-epochs", + "pezsc-consensus-grandpa", + "pezsc-consensus-grandpa-rpc", + "pezsc-consensus-manual-seal", + "pezsc-consensus-pow", + "pezsc-consensus-slots", + "pezsc-executor", + "pezsc-executor-common", + "pezsc-executor-polkavm", + "pezsc-executor-wasmtime", + "pezsc-informant", + "pezsc-keystore", + "pezsc-mixnet", + "pezsc-network", + "pezsc-network-common", + "pezsc-network-gossip", + "pezsc-network-light", + "pezsc-network-statement", + "pezsc-network-sync", + "pezsc-network-transactions", + "pezsc-network-types", + "pezsc-offchain", + "pezsc-proposer-metrics", + "pezsc-rpc", + "pezsc-rpc-api", + "pezsc-rpc-server", + "pezsc-rpc-spec-v2", + "pezsc-runtime-utilities", + "pezsc-service", + "pezsc-state-db", + "pezsc-statement-store", + "pezsc-storage-monitor", + "pezsc-sync-state-rpc", + "pezsc-sysinfo", + "pezsc-telemetry", + "pezsc-tracing", + "pezsc-transaction-pool", + "pezsc-transaction-pool-api", + "pezsc-utils", + "pezsp-blockchain", + "pezsp-consensus", + "pezsp-core-hashing", + "pezsp-core-hashing-proc-macro", + "pezsp-database", + "pezsp-maybe-compressed-blob", + "pezsp-panic-handler", + "pezsp-rpc", + "pezstaging-chain-spec-builder", + "pezstaging-node-inspect", + "pezstaging-tracking-allocator", + "std", + "teyrchains-runtimes-test-utils", + "xcm-pez-emulator", + "xcm-pez-simulator", ] tuples-96 = [ - "pezframe-support-procedural?/tuples-96", - "pezframe-support?/tuples-96", + "pezframe-support-procedural?/tuples-96", + "pezframe-support?/tuples-96", ] [package.edition] @@ -1226,6 +1153,11 @@ default-features = false optional = true path = "../bizinikiwi/utils/binary-merkle-tree" +[dependencies.bizinikiwi-bip39] +default-features = false +optional = true +path = "../bizinikiwi/utils/bizinikiwi-bip39" + [dependencies.bp-header-pez-chain] default-features = false optional = true @@ -1246,11 +1178,6 @@ default-features = false optional = true path = "../pezbridges/primitives/relayers" -[dependencies.pezbp-runtime] -default-features = false -optional = true -path = "../pezbridges/primitives/runtime" - [dependencies.bp-test-utils] default-features = false optional = true @@ -1276,6 +1203,26 @@ default-features = false optional = true path = "../pezcumulus/teyrchains/runtimes/bridge-hubs/common" +[dependencies.pez-ethereum-standards] +default-features = false +optional = true +path = "../bizinikiwi/primitives/pez-ethereum-standards" + +[dependencies.pez-slot-range-helper] +default-features = false +optional = true +path = "../pezkuwi/runtime/common/pez-slot-range-helper" + +[dependencies.pez-tracing-gum-proc-macro] +default-features = false +optional = true +path = "../pezkuwi/node/gum/proc-macro" + +[dependencies.pezbp-runtime] +default-features = false +optional = true +path = "../pezbridges/primitives/runtime" + [dependencies.pezbridge-runtime-common] default-features = false optional = true @@ -1366,11 +1313,6 @@ default-features = false optional = true path = "../pezcumulus/primitives/utility" -[dependencies.pez-ethereum-standards] -default-features = false -optional = true -path = "../bizinikiwi/primitives/pez-ethereum-standards" - [dependencies.pezframe-benchmarking] default-features = false optional = true @@ -1431,10 +1373,40 @@ default-features = false optional = true path = "../bizinikiwi/pezframe/system/rpc/runtime-api" -[dependencies.pezframe-try-runtime] +[dependencies.pezkuwi-core-primitives] default-features = false optional = true -path = "../bizinikiwi/pezframe/try-runtime" +path = "../pezkuwi/core-primitives" + +[dependencies.pezkuwi-primitives] +default-features = false +optional = true +path = "../pezkuwi/primitives" + +[dependencies.pezkuwi-runtime-common] +default-features = false +optional = true +path = "../pezkuwi/runtime/common" + +[dependencies.pezkuwi-runtime-metrics] +default-features = false +optional = true +path = "../pezkuwi/runtime/metrics" + +[dependencies.pezkuwi-runtime-teyrchains] +default-features = false +optional = true +path = "../pezkuwi/runtime/teyrchains" + +[dependencies.pezkuwi-sdk-frame] +default-features = false +optional = true +path = "../bizinikiwi/pezframe" + +[dependencies.pezkuwi-teyrchain-primitives] +default-features = false +optional = true +path = "../pezkuwi/teyrchain" [dependencies.pezpallet-alliance] default-features = false @@ -1626,11 +1598,6 @@ default-features = false optional = true path = "../bizinikiwi/pezframe/derivatives" -[dependencies.pezpallet-dev-mode] -default-features = false -optional = true -path = "../bizinikiwi/pezframe/examples/dev-mode" - [dependencies.pezpallet-dummy-dim] default-features = false optional = true @@ -1866,11 +1833,6 @@ default-features = false optional = true path = "../bizinikiwi/pezframe/root-offences" -[dependencies.pezpallet-root-testing] -default-features = false -optional = true -path = "../bizinikiwi/pezframe/root-testing" - [dependencies.pezpallet-safe-mode] default-features = false optional = true @@ -2036,11 +1998,6 @@ default-features = false optional = true path = "../pezkuwi/xcm/pezpallet-xcm" -[dependencies.pezpallet-xcm-benchmarks] -default-features = false -optional = true -path = "../pezkuwi/xcm/pezpallet-xcm-benchmarks" - [dependencies.pezpallet-xcm-bridge-hub] default-features = false optional = true @@ -2056,41 +2013,6 @@ default-features = false optional = true path = "../pezkuwi/xcm/pezpallet-xcm/precompiles" -[dependencies.pezkuwi-core-primitives] -default-features = false -optional = true -path = "../pezkuwi/core-primitives" - -[dependencies.pezkuwi-primitives] -default-features = false -optional = true -path = "../pezkuwi/primitives" - -[dependencies.pezkuwi-runtime-common] -default-features = false -optional = true -path = "../pezkuwi/runtime/common" - -[dependencies.pezkuwi-runtime-metrics] -default-features = false -optional = true -path = "../pezkuwi/runtime/metrics" - -[dependencies.pezkuwi-runtime-teyrchains] -default-features = false -optional = true -path = "../pezkuwi/runtime/teyrchains" - -[dependencies.pezkuwi-sdk-frame] -default-features = false -optional = true -path = "../bizinikiwi/pezframe" - -[dependencies.pezkuwi-teyrchain-primitives] -default-features = false -optional = true -path = "../pezkuwi/teyrchain" - [dependencies.pezsc-chain-spec-derive] default-features = false optional = true @@ -2101,11 +2023,6 @@ default-features = false optional = true path = "../bizinikiwi/client/tracing/proc-macro" -[dependencies.pez-slot-range-helper] -default-features = false -optional = true -path = "../pezkuwi/runtime/common/pez-slot-range-helper" - [dependencies.pezsp-api] default-features = false optional = true @@ -2246,11 +2163,6 @@ default-features = false optional = true path = "../bizinikiwi/primitives/offchain" -[dependencies.pezsp-runtime] -default-features = false -optional = true -path = "../bizinikiwi/primitives/runtime" - [dependencies.pezsp-runtime-interface] default-features = false optional = true @@ -2356,11 +2268,6 @@ default-features = false optional = true path = "../pezkuwi/xcm/xcm-executor" -[dependencies.bizinikiwi-bip39] -default-features = false -optional = true -path = "../bizinikiwi/utils/bizinikiwi-bip39" - [dependencies.testnet-teyrchains-constants] default-features = false optional = true @@ -2371,11 +2278,6 @@ default-features = false optional = true path = "../pezcumulus/teyrchains/common" -[dependencies.pez-tracing-gum-proc-macro] -default-features = false -optional = true -path = "../pezkuwi/node/gum/proc-macro" - [dependencies.xcm-pez-procedural] default-features = false optional = true @@ -2391,6 +2293,71 @@ default-features = false optional = true path = "../pezcumulus/teyrchains/runtimes/assets/test-utils" +[dependencies.bizinikiwi-build-script-utils] +default-features = false +optional = true +path = "../bizinikiwi/utils/build-script-utils" + +[dependencies.bizinikiwi-frame-rpc-support] +default-features = false +optional = true +path = "../bizinikiwi/utils/pezframe/rpc/support" + +[dependencies.bizinikiwi-frame-rpc-system] +default-features = false +optional = true +path = "../bizinikiwi/utils/pezframe/rpc/system" + +[dependencies.bizinikiwi-prometheus-endpoint] +default-features = false +optional = true +path = "../bizinikiwi/utils/prometheus" + +[dependencies.bizinikiwi-rpc-client] +default-features = false +optional = true +path = "../bizinikiwi/utils/pezframe/rpc/client" + +[dependencies.bizinikiwi-state-trie-migration-rpc] +default-features = false +optional = true +path = "../bizinikiwi/utils/pezframe/rpc/state-trie-migration-rpc" + +[dependencies.bizinikiwi-txtesttool] +default-features = false +optional = true +path = "../bizinikiwi/utils/txtesttool" + +[dependencies.bizinikiwi-wasm-builder] +default-features = false +optional = true +path = "../bizinikiwi/utils/wasm-builder" + +[dependencies.frame-remote-externalities] +default-features = false +optional = true +path = "../bizinikiwi/utils/pezframe/remote-externalities" + +[dependencies.pez-fork-tree] +default-features = false +optional = true +path = "../bizinikiwi/utils/pez-fork-tree" + +[dependencies.pez-generate-bags] +default-features = false +optional = true +path = "../bizinikiwi/utils/pezframe/pez-generate-bags" + +[dependencies.pez-subkey] +default-features = false +optional = true +path = "../bizinikiwi/bin/utils/pez-subkey" + +[dependencies.pez-tracing-gum] +default-features = false +optional = true +path = "../pezkuwi/node/gum" + [dependencies.pezbridge-hub-test-utils] default-features = false optional = true @@ -2476,61 +2443,16 @@ default-features = false optional = true path = "../pezcumulus/client/relay-chain-streams" -[dependencies.pezcumulus-test-relay-sproof-builder] -default-features = false -optional = true -path = "../pezcumulus/test/relay-sproof-builder" - -[dependencies.emulated-integration-tests-common] -default-features = false -optional = true -path = "../pezcumulus/teyrchains/integration-tests/emulated/common" - -[dependencies.pez-fork-tree] -default-features = false -optional = true -path = "../bizinikiwi/utils/pez-fork-tree" - [dependencies.pezframe-benchmarking-cli] default-features = false optional = true path = "../bizinikiwi/utils/pezframe/benchmarking-cli" -[dependencies.frame-remote-externalities] -default-features = false -optional = true -path = "../bizinikiwi/utils/pezframe/remote-externalities" - [dependencies.pezframe-support-procedural-tools] default-features = false optional = true path = "../bizinikiwi/pezframe/support/procedural/tools" -[dependencies.pez-generate-bags] -default-features = false -optional = true -path = "../bizinikiwi/utils/pezframe/pez-generate-bags" - -[dependencies.pezmmr-gadget] -default-features = false -optional = true -path = "../bizinikiwi/client/merkle-mountain-range" - -[dependencies.pezmmr-rpc] -default-features = false -optional = true -path = "../bizinikiwi/client/merkle-mountain-range/rpc" - -[dependencies.pezpallet-contracts-mock-network] -default-features = false -optional = true -path = "../bizinikiwi/pezframe/contracts/mock-network" - -[dependencies.pezpallet-transaction-payment-rpc] -default-features = false -optional = true -path = "../bizinikiwi/pezframe/transaction-payment/rpc" - [dependencies.pezkuwi-approval-distribution] default-features = false optional = true @@ -2686,11 +2608,6 @@ default-features = false optional = true path = "../pezkuwi/node/network/protocol" -[dependencies.pezkuwi-pez-node-primitives] -default-features = false -optional = true -path = "../pezkuwi/node/primitives" - [dependencies.pezkuwi-node-subsystem] default-features = false optional = true @@ -2716,6 +2633,11 @@ default-features = false optional = true path = "../pezkuwi/node/overseer" +[dependencies.pezkuwi-pez-node-primitives] +default-features = false +optional = true +path = "../pezkuwi/node/primitives" + [dependencies.pezkuwi-primitives-test-helpers] default-features = false optional = true @@ -2741,6 +2663,26 @@ default-features = false optional = true path = "../pezkuwi/statement-table" +[dependencies.pezmmr-gadget] +default-features = false +optional = true +path = "../bizinikiwi/client/merkle-mountain-range" + +[dependencies.pezmmr-rpc] +default-features = false +optional = true +path = "../bizinikiwi/client/merkle-mountain-range/rpc" + +[dependencies.pezpallet-contracts-mock-network] +default-features = false +optional = true +path = "../bizinikiwi/pezframe/contracts/mock-network" + +[dependencies.pezpallet-transaction-payment-rpc] +default-features = false +optional = true +path = "../bizinikiwi/pezframe/transaction-payment/rpc" + [dependencies.pezsc-allocator] default-features = false optional = true @@ -3061,56 +3003,11 @@ default-features = false optional = true path = "../pezkuwi/node/tracking-allocator" -[dependencies.pez-subkey] -default-features = false -optional = true -path = "../bizinikiwi/bin/utils/pez-subkey" - -[dependencies.bizinikiwi-build-script-utils] -default-features = false -optional = true -path = "../bizinikiwi/utils/build-script-utils" - -[dependencies.bizinikiwi-frame-rpc-support] -default-features = false -optional = true -path = "../bizinikiwi/utils/pezframe/rpc/support" - -[dependencies.bizinikiwi-frame-rpc-system] -default-features = false -optional = true -path = "../bizinikiwi/utils/pezframe/rpc/system" - -[dependencies.bizinikiwi-prometheus-endpoint] -default-features = false -optional = true -path = "../bizinikiwi/utils/prometheus" - -[dependencies.bizinikiwi-rpc-client] -default-features = false -optional = true -path = "../bizinikiwi/utils/pezframe/rpc/client" - -[dependencies.bizinikiwi-state-trie-migration-rpc] -default-features = false -optional = true -path = "../bizinikiwi/utils/pezframe/rpc/state-trie-migration-rpc" - -[dependencies.bizinikiwi-wasm-builder] -default-features = false -optional = true -path = "../bizinikiwi/utils/wasm-builder" - [dependencies.teyrchains-runtimes-test-utils] default-features = false optional = true path = "../pezcumulus/teyrchains/runtimes/test-utils" -[dependencies.pez-tracing-gum] -default-features = false -optional = true -path = "../pezkuwi/node/gum" - [dependencies.xcm-pez-emulator] default-features = false optional = true diff --git a/umbrella/src/lib.rs b/umbrella/src/lib.rs index 096f1b14..f2722679 100644 --- a/umbrella/src/lib.rs +++ b/umbrella/src/lib.rs @@ -23,6 +23,43 @@ pub use assets_common; #[cfg(feature = "binary-merkle-tree")] pub use binary_merkle_tree; +/// Converting BIP39 entropy to valid Bizinikiwi (sr25519) SecretKeys. +#[cfg(feature = "bizinikiwi-bip39")] +pub use bizinikiwi_bip39; + +/// Crate with utility functions for `build.rs` scripts. +#[cfg(feature = "bizinikiwi-build-script-utils")] +pub use bizinikiwi_build_script_utils; + +/// Bizinikiwi RPC for FRAME's support. +#[cfg(feature = "bizinikiwi-frame-rpc-support")] +pub use bizinikiwi_frame_rpc_support; + +/// FRAME's system exposed over Bizinikiwi RPC. +#[cfg(feature = "bizinikiwi-frame-rpc-system")] +pub use bizinikiwi_frame_rpc_system; + +/// Endpoint to expose Prometheus metrics. +#[cfg(feature = "bizinikiwi-prometheus-endpoint")] +pub use bizinikiwi_prometheus_endpoint; + +/// Shared JSON-RPC client. +#[cfg(feature = "bizinikiwi-rpc-client")] +pub use bizinikiwi_rpc_client; + +/// Node-specific RPC methods for interaction with state trie migration. +#[cfg(feature = "bizinikiwi-state-trie-migration-rpc")] +pub use bizinikiwi_state_trie_migration_rpc; + +/// Bizinikiwi utility: A library and CLI tool for sending transactions to Pezkuwi blockchain, +/// enabling developers to test and monitor transaction scenarios. +#[cfg(feature = "bizinikiwi-txtesttool")] +pub use bizinikiwi_txtesttool; + +/// Utility for building WASM binaries. +#[cfg(feature = "bizinikiwi-wasm-builder")] +pub use bizinikiwi_wasm_builder; + /// A common interface for describing what a bridge pezpallet should be able to do. #[cfg(feature = "bp-header-pez-chain")] pub use bp_header_pez_chain; @@ -39,10 +76,6 @@ pub use bp_pezkuwi_core; #[cfg(feature = "bp-relayers")] pub use bp_relayers; -/// Primitives that may be used at (bridges) runtime level. -#[cfg(feature = "pezbp-runtime")] -pub use pezbp_runtime; - /// Utilities for testing bizinikiwi-based runtime bridge code. #[cfg(feature = "bp-test-utils")] pub use bp_test_utils; @@ -63,6 +96,46 @@ pub use bp_xcm_bridge_hub_router; #[cfg(feature = "bridge-hub-common")] pub use bridge_hub_common; +/// An externalities provided environment that can load itself from remote nodes or cached +/// files. +#[cfg(feature = "frame-remote-externalities")] +pub use frame_remote_externalities; + +/// Interfaces for Ethereum standards. +#[cfg(feature = "pez-ethereum-standards")] +pub use pez_ethereum_standards; + +/// Utility library for managing tree-like ordered data with logic for pruning the tree while +/// finalizing nodes. +#[cfg(feature = "pez-fork-tree")] +pub use pez_fork_tree; + +/// Bag threshold generation script for pezpallet-bag-list. +#[cfg(feature = "pez-generate-bags")] +pub use pez_generate_bags; + +/// Helper crate for generating slot ranges for the Pezkuwi runtime. +#[cfg(feature = "pez-slot-range-helper")] +pub use pez_slot_range_helper; + +/// Generate and restore keys for Bizinikiwi based chains such as Pezkuwi, Kusama and a growing +/// number of teyrchains and Bizinikiwi based projects. +#[cfg(feature = "pez-subkey")] +pub use pez_subkey; + +/// Stick logs together with the TraceID as provided by tempo. +#[cfg(feature = "pez-tracing-gum")] +pub use pez_tracing_gum; + +/// Generate an overseer including builder pattern and message wrapper from a single annotated +/// struct definition. +#[cfg(feature = "pez-tracing-gum-proc-macro")] +pub use pez_tracing_gum_proc_macro; + +/// Primitives that may be used at (bridges) runtime level. +#[cfg(feature = "pezbp-runtime")] +pub use pezbp_runtime; + /// Utils for BridgeHub testing. #[cfg(feature = "pezbridge-hub-test-utils")] pub use pezbridge_hub_test_utils; @@ -145,15 +218,15 @@ pub use pezcumulus_pezpallet_teyrchain_system_proc_macro; #[cfg(feature = "pezcumulus-pezpallet-weight-reclaim")] pub use pezcumulus_pezpallet_weight_reclaim; -/// Pezpallet for stuff specific to teyrchains' usage of XCM. +/// Pallet for stuff specific to teyrchains' usage of XCM. #[cfg(feature = "pezcumulus-pezpallet-xcm")] pub use pezcumulus_pezpallet_xcm; -/// Pezpallet to queue outbound and inbound XCMP messages. +/// Pallet to queue outbound and inbound XCMP messages. #[cfg(feature = "pezcumulus-pezpallet-xcmp-queue")] pub use pezcumulus_pezpallet_xcmp_queue; -/// Ping Pezpallet for Pezcumulus XCM/UMP testing. +/// Ping Pallet for Pezcumulus XCM/UMP testing. #[cfg(feature = "pezcumulus-ping")] pub use pezcumulus_ping; @@ -206,23 +279,6 @@ pub use pezcumulus_relay_chain_rpc_interface; #[cfg(feature = "pezcumulus-relay-chain-streams")] pub use pezcumulus_relay_chain_streams; -/// Mocked relay state proof builder for testing Pezcumulus. -#[cfg(feature = "pezcumulus-test-relay-sproof-builder")] -pub use pezcumulus_test_relay_sproof_builder; - -/// Common resources for integration testing with xcm-pez-emulator. -#[cfg(feature = "emulated-integration-tests-common")] -pub use emulated_integration_tests_common; - -/// Interfaces for Ethereum standards. -#[cfg(feature = "pez-ethereum-standards")] -pub use pez_ethereum_standards; - -/// Utility library for managing tree-like ordered data with logic for pruning the tree while -/// finalizing nodes. -#[cfg(feature = "pez-fork-tree")] -pub use pez_fork_tree; - /// Macro for benchmarking a FRAME runtime. #[cfg(feature = "pezframe-benchmarking")] pub use pezframe_benchmarking; @@ -231,7 +287,7 @@ pub use pezframe_benchmarking; #[cfg(feature = "pezframe-benchmarking-cli")] pub use pezframe_benchmarking_cli; -/// Pezpallet for testing FRAME PoV benchmarking. +/// Pallet for testing FRAME PoV benchmarking. #[cfg(feature = "pezframe-benchmarking-pezpallet-pov")] pub use pezframe_benchmarking_pezpallet_pov; @@ -251,11 +307,6 @@ pub use pezframe_executive; #[cfg(feature = "pezframe-metadata-hash-extension")] pub use pezframe_metadata_hash_extension; -/// An externalities provided environment that can load itself from remote nodes or cached -/// files. -#[cfg(feature = "frame-remote-externalities")] -pub use frame_remote_externalities; - /// Support code for the runtime. #[cfg(feature = "pezframe-support")] pub use pezframe_support; @@ -284,533 +335,6 @@ pub use pezframe_system_benchmarking; #[cfg(feature = "pezframe-system-rpc-runtime-api")] pub use pezframe_system_rpc_runtime_api; -/// Supporting types for try-runtime, testing and dry-running commands. -#[cfg(feature = "pezframe-try-runtime")] -pub use pezframe_try_runtime; - -/// Bag threshold generation script for pezpallet-bag-list. -#[cfg(feature = "pez-generate-bags")] -pub use pez_generate_bags; - -/// MMR Client gadget for bizinikiwi. -#[cfg(feature = "pezmmr-gadget")] -pub use pezmmr_gadget; - -/// Node-specific RPC methods for interaction with Merkle Mountain Range pezpallet. -#[cfg(feature = "pezmmr-rpc")] -pub use pezmmr_rpc; - -/// The Alliance pezpallet provides a collective for standard-setting industry collaboration. -#[cfg(feature = "pezpallet-alliance")] -pub use pezpallet_alliance; - -/// FRAME asset conversion pezpallet. -#[cfg(feature = "pezpallet-asset-conversion")] -pub use pezpallet_asset_conversion; - -/// FRAME asset conversion pezpallet's operations suite. -#[cfg(feature = "pezpallet-asset-conversion-ops")] -pub use pezpallet_asset_conversion_ops; - -/// Pezpallet to manage transaction payments in assets by converting them to native assets. -#[cfg(feature = "pezpallet-asset-conversion-tx-payment")] -pub use pezpallet_asset_conversion_tx_payment; - -/// Whitelist non-native assets for treasury spending and provide conversion to native balance. -#[cfg(feature = "pezpallet-asset-rate")] -pub use pezpallet_asset_rate; - -/// FRAME asset rewards pezpallet. -#[cfg(feature = "pezpallet-asset-rewards")] -pub use pezpallet_asset_rewards; - -/// pezpallet to manage transaction payments in assets. -#[cfg(feature = "pezpallet-asset-tx-payment")] -pub use pezpallet_asset_tx_payment; - -/// FRAME asset management pezpallet. -#[cfg(feature = "pezpallet-assets")] -pub use pezpallet_assets; - -/// Provides freezing features to `pezpallet-assets`. -#[cfg(feature = "pezpallet-assets-freezer")] -pub use pezpallet_assets_freezer; - -/// Provides holding features to `pezpallet-assets`. -#[cfg(feature = "pezpallet-assets-holder")] -pub use pezpallet_assets_holder; - -/// Provides precompiles for `pezpallet-assets`. -#[cfg(feature = "pezpallet-assets-precompiles")] -pub use pezpallet_assets_precompiles; - -/// FRAME atomic swap pezpallet. -#[cfg(feature = "pezpallet-atomic-swap")] -pub use pezpallet_atomic_swap; - -/// FRAME AURA consensus pezpallet. -#[cfg(feature = "pezpallet-aura")] -pub use pezpallet_aura; - -/// FRAME pezpallet for authority discovery. -#[cfg(feature = "pezpallet-authority-discovery")] -pub use pezpallet_authority_discovery; - -/// Block and Uncle Author tracking for the FRAME. -#[cfg(feature = "pezpallet-authorship")] -pub use pezpallet_authorship; - -/// Consensus extension module for BABE consensus. Collects on-chain randomness from VRF -/// outputs and manages epoch transitions. -#[cfg(feature = "pezpallet-babe")] -pub use pezpallet_babe; - -/// FRAME pezpallet bags list. -#[cfg(feature = "pezpallet-bags-list")] -pub use pezpallet_bags_list; - -/// FRAME pezpallet to manage balances. -#[cfg(feature = "pezpallet-balances")] -pub use pezpallet_balances; - -/// BEEFY FRAME pezpallet. -#[cfg(feature = "pezpallet-beefy")] -pub use pezpallet_beefy; - -/// BEEFY + MMR runtime utilities. -#[cfg(feature = "pezpallet-beefy-mmr")] -pub use pezpallet_beefy_mmr; - -/// FRAME pezpallet to manage bounties. -#[cfg(feature = "pezpallet-bounties")] -pub use pezpallet_bounties; - -/// Module implementing GRANDPA on-chain light client used for bridging consensus of -/// bizinikiwi-based chains. -#[cfg(feature = "pezpallet-bridge-grandpa")] -pub use pezpallet_bridge_grandpa; - -/// Module that allows bridged chains to exchange messages using lane concept. -#[cfg(feature = "pezpallet-bridge-messages")] -pub use pezpallet_bridge_messages; - -/// Module used to store relayer rewards and coordinate relayers set. -#[cfg(feature = "pezpallet-bridge-relayers")] -pub use pezpallet_bridge_relayers; - -/// Module that allows bridged relay chains to exchange information on their teyrchains' heads. -#[cfg(feature = "pezpallet-bridge-teyrchains")] -pub use pezpallet_bridge_teyrchains; - -/// Brokerage tool for managing Pezkuwi Core scheduling. -#[cfg(feature = "pezpallet-broker")] -pub use pezpallet_broker; - -/// FRAME pezpallet to manage child bounties. -#[cfg(feature = "pezpallet-child-bounties")] -pub use pezpallet_child_bounties; - -/// Simple pezpallet to select collators for a teyrchain. -#[cfg(feature = "pezpallet-collator-selection")] -pub use pezpallet_collator_selection; - -/// Collective system: Members of a set of account IDs can make their collective feelings known -/// through dispatched calls from one of two specialized origins. -#[cfg(feature = "pezpallet-collective")] -pub use pezpallet_collective; - -/// Managed content. -#[cfg(feature = "pezpallet-collective-content")] -pub use pezpallet_collective_content; - -/// FRAME pezpallet for WASM contracts. -#[cfg(feature = "pezpallet-contracts")] -pub use pezpallet_contracts; - -/// A mock network for testing pezpallet-contracts. -#[cfg(feature = "pezpallet-contracts-mock-network")] -pub use pezpallet_contracts_mock_network; - -/// Procedural macros used in pezpallet_contracts. -#[cfg(feature = "pezpallet-contracts-proc-macro")] -pub use pezpallet_contracts_proc_macro; - -/// Exposes all the host functions that a contract can import. -#[cfg(feature = "pezpallet-contracts-uapi")] -pub use pezpallet_contracts_uapi; - -/// FRAME pezpallet for conviction voting in referenda. -#[cfg(feature = "pezpallet-conviction-voting")] -pub use pezpallet_conviction_voting; - -/// Logic as per the description of The Fellowship for core Pezkuwi technology. -#[cfg(feature = "pezpallet-core-fellowship")] -pub use pezpallet_core_fellowship; - -/// FRAME delegated staking pezpallet. -#[cfg(feature = "pezpallet-delegated-staking")] -pub use pezpallet_delegated_staking; - -/// FRAME pezpallet for democracy. -#[cfg(feature = "pezpallet-democracy")] -pub use pezpallet_democracy; - -/// FRAME derivatives pezpallet. -#[cfg(feature = "pezpallet-derivatives")] -pub use pezpallet_derivatives; - -/// FRAME example pezpallet. -#[cfg(feature = "pezpallet-dev-mode")] -pub use pezpallet_dev_mode; - -/// Dummy DIM Pezpallet. -#[cfg(feature = "pezpallet-dummy-dim")] -pub use pezpallet_dummy_dim; - -/// PEZPALLET multi phase+block election providers. -#[cfg(feature = "pezpallet-election-provider-multi-block")] -pub use pezpallet_election_provider_multi_block; - -/// PEZPALLET two phase election providers. -#[cfg(feature = "pezpallet-election-provider-multi-phase")] -pub use pezpallet_election_provider_multi_phase; - -/// Benchmarking for election provider support onchain config trait. -#[cfg(feature = "pezpallet-election-provider-support-benchmarking")] -pub use pezpallet_election_provider_support_benchmarking; - -/// FRAME pezpallet based on seq-Phragmén election method. -#[cfg(feature = "pezpallet-elections-phragmen")] -pub use pezpallet_elections_phragmen; - -/// FRAME fast unstake pezpallet. -#[cfg(feature = "pezpallet-fast-unstake")] -pub use pezpallet_fast_unstake; - -/// FRAME pezpallet for pushing a chain to its weight limits. -#[cfg(feature = "pezpallet-glutton")] -pub use pezpallet_glutton; - -/// FRAME pezpallet for GRANDPA finality gadget. -#[cfg(feature = "pezpallet-grandpa")] -pub use pezpallet_grandpa; - -/// FRAME identity management pezpallet. -#[cfg(feature = "pezpallet-identity")] -pub use pezpallet_identity; - -/// FRAME's I'm online pezpallet. -#[cfg(feature = "pezpallet-im-online")] -pub use pezpallet_im_online; - -/// FRAME indices management pezpallet. -#[cfg(feature = "pezpallet-indices")] -pub use pezpallet_indices; - -/// Insecure do not use in production: FRAME randomness collective flip pezpallet. -#[cfg(feature = "pezpallet-insecure-randomness-collective-flip")] -pub use pezpallet_insecure_randomness_collective_flip; - -/// FRAME Participation Lottery Pezpallet. -#[cfg(feature = "pezpallet-lottery")] -pub use pezpallet_lottery; - -/// FRAME membership management pezpallet. -#[cfg(feature = "pezpallet-membership")] -pub use pezpallet_membership; - -/// FRAME pezpallet to queue and process messages. -#[cfg(feature = "pezpallet-message-queue")] -pub use pezpallet_message_queue; - -/// FRAME pezpallet enabling meta transactions. -#[cfg(feature = "pezpallet-meta-tx")] -pub use pezpallet_meta_tx; - -/// FRAME pezpallet to execute multi-block migrations. -#[cfg(feature = "pezpallet-migrations")] -pub use pezpallet_migrations; - -/// FRAME's mixnet pezpallet. -#[cfg(feature = "pezpallet-mixnet")] -pub use pezpallet_mixnet; - -/// FRAME Merkle Mountain Range pezpallet. -#[cfg(feature = "pezpallet-mmr")] -pub use pezpallet_mmr; - -/// FRAME pezpallet to manage multi-asset and cross-chain bounties. -#[cfg(feature = "pezpallet-multi-asset-bounties")] -pub use pezpallet_multi_asset_bounties; - -/// FRAME multi-signature dispatch pezpallet. -#[cfg(feature = "pezpallet-multisig")] -pub use pezpallet_multisig; - -/// FRAME pezpallet to convert non-fungible to fungible tokens. -#[cfg(feature = "pezpallet-nft-fractionalization")] -pub use pezpallet_nft_fractionalization; - -/// FRAME NFTs pezpallet. -#[cfg(feature = "pezpallet-nfts")] -pub use pezpallet_nfts; - -/// Runtime API for the FRAME NFTs pezpallet. -#[cfg(feature = "pezpallet-nfts-runtime-api")] -pub use pezpallet_nfts_runtime_api; - -/// FRAME pezpallet for rewarding account freezing. -#[cfg(feature = "pezpallet-nis")] -pub use pezpallet_nis; - -/// FRAME pezpallet for node authorization. -#[cfg(feature = "pezpallet-node-authorization")] -pub use pezpallet_node_authorization; - -/// FRAME nomination pools pezpallet. -#[cfg(feature = "pezpallet-nomination-pools")] -pub use pezpallet_nomination_pools; - -/// FRAME nomination pools pezpallet benchmarking. -#[cfg(feature = "pezpallet-nomination-pools-benchmarking")] -pub use pezpallet_nomination_pools_benchmarking; - -/// Runtime API for nomination-pools FRAME pezpallet. -#[cfg(feature = "pezpallet-nomination-pools-runtime-api")] -pub use pezpallet_nomination_pools_runtime_api; - -/// FRAME offences pezpallet. -#[cfg(feature = "pezpallet-offences")] -pub use pezpallet_offences; - -/// FRAME offences pezpallet benchmarking. -#[cfg(feature = "pezpallet-offences-benchmarking")] -pub use pezpallet_offences_benchmarking; - -/// FRAME oracle pezpallet for off-chain data. -#[cfg(feature = "pezpallet-oracle")] -pub use pezpallet_oracle; - -/// Runtime API for the oracle pezpallet. -#[cfg(feature = "pezpallet-oracle-runtime-api")] -pub use pezpallet_oracle_runtime_api; - -/// Pezpallet to give some execution allowance for some origins. -#[cfg(feature = "pezpallet-origin-restriction")] -pub use pezpallet_origin_restriction; - -/// FRAME pezpallet that provides a paged list data structure. -#[cfg(feature = "pezpallet-paged-list")] -pub use pezpallet_paged_list; - -/// Pezpallet to store and configure parameters. -#[cfg(feature = "pezpallet-parameters")] -pub use pezpallet_parameters; - -/// Personhood-tracking pezpallet. -#[cfg(feature = "pezpallet-people")] -pub use pezpallet_people; - -/// FRAME pezpallet for storing preimages of hashes. -#[cfg(feature = "pezpallet-preimage")] -pub use pezpallet_preimage; - -/// FRAME proxying pezpallet. -#[cfg(feature = "pezpallet-proxy")] -pub use pezpallet_proxy; - -/// Ranked collective system: Members of a set of account IDs can make their collective -/// feelings known through dispatched calls from one of two specialized origins. -#[cfg(feature = "pezpallet-ranked-collective")] -pub use pezpallet_ranked_collective; - -/// FRAME account recovery pezpallet. -#[cfg(feature = "pezpallet-recovery")] -pub use pezpallet_recovery; - -/// FRAME pezpallet for inclusive on-chain decisions. -#[cfg(feature = "pezpallet-referenda")] -pub use pezpallet_referenda; - -/// Remark storage pezpallet. -#[cfg(feature = "pezpallet-remark")] -pub use pezpallet_remark; - -/// FRAME pezpallet for PolkaVM contracts. -#[cfg(feature = "pezpallet-revive")] -pub use pezpallet_revive; - -/// Procedural macros used in pezpallet_revive. -#[cfg(feature = "pezpallet-revive-proc-macro")] -pub use pezpallet_revive_proc_macro; - -/// Exposes all the host functions that a contract can import. -#[cfg(feature = "pezpallet-revive-uapi")] -pub use pezpallet_revive_uapi; - -/// FRAME root offences pezpallet. -#[cfg(feature = "pezpallet-root-offences")] -pub use pezpallet_root_offences; - -/// FRAME root testing pezpallet. -#[cfg(feature = "pezpallet-root-testing")] -pub use pezpallet_root_testing; - -/// FRAME safe-mode pezpallet. -#[cfg(feature = "pezpallet-safe-mode")] -pub use pezpallet_safe_mode; - -/// Paymaster. -#[cfg(feature = "pezpallet-salary")] -pub use pezpallet_salary; - -/// FRAME Scheduler pezpallet. -#[cfg(feature = "pezpallet-scheduler")] -pub use pezpallet_scheduler; - -/// FRAME pezpallet for scored pools. -#[cfg(feature = "pezpallet-scored-pool")] -pub use pezpallet_scored_pool; - -/// FRAME sessions pezpallet. -#[cfg(feature = "pezpallet-session")] -pub use pezpallet_session; - -/// FRAME sessions pezpallet benchmarking. -#[cfg(feature = "pezpallet-session-benchmarking")] -pub use pezpallet_session_benchmarking; - -/// Pezpallet to skip payments for calls annotated with `feeless_if` if the respective conditions -/// are satisfied. -#[cfg(feature = "pezpallet-skip-feeless-payment")] -pub use pezpallet_skip_feeless_payment; - -/// FRAME society pezpallet. -#[cfg(feature = "pezpallet-society")] -pub use pezpallet_society; - -/// FRAME pezpallet staking. -#[cfg(feature = "pezpallet-staking")] -pub use pezpallet_staking; - -/// FRAME pezpallet staking async. -#[cfg(feature = "pezpallet-staking-async")] -pub use pezpallet_staking_async; - -/// Pezpallet handling the communication with staking-rc-client. It's role is to glue the staking -/// pezpallet (on AssetHub chain) and session pezpallet (on Relay Chain) in a transparent way. -#[cfg(feature = "pezpallet-staking-async-ah-client")] -pub use pezpallet_staking_async_ah_client; - -/// Pezpallet handling the communication with staking-ah-client. It's role is to glue the staking -/// pezpallet (on AssetHub chain) and session pezpallet (on Relay Chain) in a transparent way. -#[cfg(feature = "pezpallet-staking-async-rc-client")] -pub use pezpallet_staking_async_rc_client; - -/// Reward function for FRAME staking pezpallet. -#[cfg(feature = "pezpallet-staking-async-reward-fn")] -pub use pezpallet_staking_async_reward_fn; - -/// RPC runtime API for transaction payment FRAME pezpallet. -#[cfg(feature = "pezpallet-staking-async-runtime-api")] -pub use pezpallet_staking_async_runtime_api; - -/// Reward Curve for FRAME staking pezpallet. -#[cfg(feature = "pezpallet-staking-reward-curve")] -pub use pezpallet_staking_reward_curve; - -/// Reward function for FRAME staking pezpallet. -#[cfg(feature = "pezpallet-staking-reward-fn")] -pub use pezpallet_staking_reward_fn; - -/// RPC runtime API for transaction payment FRAME pezpallet. -#[cfg(feature = "pezpallet-staking-runtime-api")] -pub use pezpallet_staking_runtime_api; - -/// FRAME pezpallet migration of trie. -#[cfg(feature = "pezpallet-state-trie-migration")] -pub use pezpallet_state_trie_migration; - -/// FRAME pezpallet for statement store. -#[cfg(feature = "pezpallet-statement")] -pub use pezpallet_statement; - -/// FRAME pezpallet for sudo. -#[cfg(feature = "pezpallet-sudo")] -pub use pezpallet_sudo; - -/// FRAME Timestamp Module. -#[cfg(feature = "pezpallet-timestamp")] -pub use pezpallet_timestamp; - -/// FRAME pezpallet to manage tips. -#[cfg(feature = "pezpallet-tips")] -pub use pezpallet_tips; - -/// FRAME pezpallet to manage transaction payments. -#[cfg(feature = "pezpallet-transaction-payment")] -pub use pezpallet_transaction_payment; - -/// RPC interface for the transaction payment pezpallet. -#[cfg(feature = "pezpallet-transaction-payment-rpc")] -pub use pezpallet_transaction_payment_rpc; - -/// RPC runtime API for transaction payment FRAME pezpallet. -#[cfg(feature = "pezpallet-transaction-payment-rpc-runtime-api")] -pub use pezpallet_transaction_payment_rpc_runtime_api; - -/// Storage chain pezpallet. -#[cfg(feature = "pezpallet-transaction-storage")] -pub use pezpallet_transaction_storage; - -/// FRAME pezpallet to manage treasury. -#[cfg(feature = "pezpallet-treasury")] -pub use pezpallet_treasury; - -/// FRAME transaction pause pezpallet. -#[cfg(feature = "pezpallet-tx-pause")] -pub use pezpallet_tx_pause; - -/// FRAME NFT asset management pezpallet. -#[cfg(feature = "pezpallet-uniques")] -pub use pezpallet_uniques; - -/// FRAME utilities pezpallet. -#[cfg(feature = "pezpallet-utility")] -pub use pezpallet_utility; - -/// FRAME verify signature pezpallet. -#[cfg(feature = "pezpallet-verify-signature")] -pub use pezpallet_verify_signature; - -/// FRAME pezpallet for manage vesting. -#[cfg(feature = "pezpallet-vesting")] -pub use pezpallet_vesting; - -/// FRAME pezpallet for whitelisting calls, and dispatching from a specific origin. -#[cfg(feature = "pezpallet-whitelist")] -pub use pezpallet_whitelist; - -/// A pezpallet for handling XCM programs. -#[cfg(feature = "pezpallet-xcm")] -pub use pezpallet_xcm; - -/// Benchmarks for the XCM pezpallet. -#[cfg(feature = "pezpallet-xcm-benchmarks")] -pub use pezpallet_xcm_benchmarks; - -/// Module that adds dynamic bridges/lanes support to XCM infrastructure at the bridge hub. -#[cfg(feature = "pezpallet-xcm-bridge-hub")] -pub use pezpallet_xcm_bridge_hub; - -/// Bridge hub interface for sibling/parent chains with dynamic fees support. -#[cfg(feature = "pezpallet-xcm-bridge-hub-router")] -pub use pezpallet_xcm_bridge_hub_router; - -/// Provides precompiles for `pezpallet-xcm`. -#[cfg(feature = "pezpallet-xcm-precompiles")] -pub use pezpallet_xcm_precompiles; - /// Pezkuwi Approval Distribution subsystem for the distribution of assignments and approvals /// for approval checks on candidates over the network. #[cfg(feature = "pezkuwi-approval-distribution")] @@ -955,10 +479,6 @@ pub use pezkuwi_node_metrics; #[cfg(feature = "pezkuwi-node-network-protocol")] pub use pezkuwi_node_network_protocol; -/// Primitives types for the Node-side. -#[cfg(feature = "pezkuwi-pez-node-primitives")] -pub use pezkuwi_pez_node_primitives; - /// Subsystem traits and message definitions and the generated overseer. #[cfg(feature = "pezkuwi-node-subsystem")] pub use pezkuwi_node_subsystem; @@ -979,6 +499,10 @@ pub use pezkuwi_omni_node_lib; #[cfg(feature = "pezkuwi-overseer")] pub use pezkuwi_overseer; +/// Primitives types for the Node-side. +#[cfg(feature = "pezkuwi-pez-node-primitives")] +pub use pezkuwi_pez_node_primitives; + /// Shared primitives used by Pezkuwi runtime. #[cfg(feature = "pezkuwi-primitives")] pub use pezkuwi_primitives; @@ -1023,454 +547,953 @@ pub use pezkuwi_statement_table; #[cfg(feature = "pezkuwi-teyrchain-primitives")] pub use pezkuwi_teyrchain_primitives; +/// MMR Client gadget for bizinikiwi. +#[cfg(feature = "pezmmr-gadget")] +pub use pezmmr_gadget; + +/// Node-specific RPC methods for interaction with Merkle Mountain Range pezpallet. +#[cfg(feature = "pezmmr-rpc")] +pub use pezmmr_rpc; + +/// The Alliance pezpallet provides a collective for standard-setting industry collaboration. +#[cfg(feature = "pezpallet-alliance")] +pub use pezpallet_alliance; + +/// FRAME asset conversion pezpallet. +#[cfg(feature = "pezpallet-asset-conversion")] +pub use pezpallet_asset_conversion; + +/// FRAME asset conversion pezpallet's operations suite. +#[cfg(feature = "pezpallet-asset-conversion-ops")] +pub use pezpallet_asset_conversion_ops; + +/// Pallet to manage transaction payments in assets by converting them to native assets. +#[cfg(feature = "pezpallet-asset-conversion-tx-payment")] +pub use pezpallet_asset_conversion_tx_payment; + +/// Whitelist non-native assets for treasury spending and provide conversion to native balance. +#[cfg(feature = "pezpallet-asset-rate")] +pub use pezpallet_asset_rate; + +/// FRAME asset rewards pezpallet. +#[cfg(feature = "pezpallet-asset-rewards")] +pub use pezpallet_asset_rewards; + +/// pezpallet to manage transaction payments in assets. +#[cfg(feature = "pezpallet-asset-tx-payment")] +pub use pezpallet_asset_tx_payment; + +/// FRAME asset management pezpallet. +#[cfg(feature = "pezpallet-assets")] +pub use pezpallet_assets; + +/// Provides freezing features to `pezpallet-assets`. +#[cfg(feature = "pezpallet-assets-freezer")] +pub use pezpallet_assets_freezer; + +/// Provides holding features to `pezpallet-assets`. +#[cfg(feature = "pezpallet-assets-holder")] +pub use pezpallet_assets_holder; + +/// Provides precompiles for `pezpallet-assets`. +#[cfg(feature = "pezpallet-assets-precompiles")] +pub use pezpallet_assets_precompiles; + +/// FRAME atomic swap pezpallet. +#[cfg(feature = "pezpallet-atomic-swap")] +pub use pezpallet_atomic_swap; + +/// FRAME AURA consensus pezpallet. +#[cfg(feature = "pezpallet-aura")] +pub use pezpallet_aura; + +/// FRAME pezpallet for authority discovery. +#[cfg(feature = "pezpallet-authority-discovery")] +pub use pezpallet_authority_discovery; + +/// Block and Uncle Author tracking for the FRAME. +#[cfg(feature = "pezpallet-authorship")] +pub use pezpallet_authorship; + +/// Consensus extension module for BABE consensus. Collects on-chain randomness from VRF +/// outputs and manages epoch transitions. +#[cfg(feature = "pezpallet-babe")] +pub use pezpallet_babe; + +/// FRAME pezpallet bags list. +#[cfg(feature = "pezpallet-bags-list")] +pub use pezpallet_bags_list; + +/// FRAME pezpallet to manage balances. +#[cfg(feature = "pezpallet-balances")] +pub use pezpallet_balances; + +/// BEEFY FRAME pezpallet. +#[cfg(feature = "pezpallet-beefy")] +pub use pezpallet_beefy; + +/// BEEFY + MMR runtime utilities. +#[cfg(feature = "pezpallet-beefy-mmr")] +pub use pezpallet_beefy_mmr; + +/// FRAME pezpallet to manage bounties. +#[cfg(feature = "pezpallet-bounties")] +pub use pezpallet_bounties; + +/// Module implementing GRANDPA on-chain light client used for bridging consensus of +/// bizinikiwi-based chains. +#[cfg(feature = "pezpallet-bridge-grandpa")] +pub use pezpallet_bridge_grandpa; + +/// Module that allows bridged chains to exchange messages using lane concept. +#[cfg(feature = "pezpallet-bridge-messages")] +pub use pezpallet_bridge_messages; + +/// Module used to store relayer rewards and coordinate relayers set. +#[cfg(feature = "pezpallet-bridge-relayers")] +pub use pezpallet_bridge_relayers; + +/// Module that allows bridged relay chains to exchange information on their teyrchains' heads. +#[cfg(feature = "pezpallet-bridge-teyrchains")] +pub use pezpallet_bridge_teyrchains; + +/// Brokerage tool for managing Pezkuwi Core scheduling. +#[cfg(feature = "pezpallet-broker")] +pub use pezpallet_broker; + +/// FRAME pezpallet to manage child bounties. +#[cfg(feature = "pezpallet-child-bounties")] +pub use pezpallet_child_bounties; + +/// Simple pezpallet to select collators for a teyrchain. +#[cfg(feature = "pezpallet-collator-selection")] +pub use pezpallet_collator_selection; + +/// Collective system: Members of a set of account IDs can make their collective feelings known +/// through dispatched calls from one of two specialized origins. +#[cfg(feature = "pezpallet-collective")] +pub use pezpallet_collective; + +/// Managed content. +#[cfg(feature = "pezpallet-collective-content")] +pub use pezpallet_collective_content; + +/// FRAME pezpallet for WASM contracts. +#[cfg(feature = "pezpallet-contracts")] +pub use pezpallet_contracts; + +/// A mock network for testing pezpallet-contracts. +#[cfg(feature = "pezpallet-contracts-mock-network")] +pub use pezpallet_contracts_mock_network; + +/// Procedural macros used in pallet_contracts. +#[cfg(feature = "pezpallet-contracts-proc-macro")] +pub use pezpallet_contracts_proc_macro; + +/// Exposes all the host functions that a contract can import. +#[cfg(feature = "pezpallet-contracts-uapi")] +pub use pezpallet_contracts_uapi; + +/// FRAME pezpallet for conviction voting in referenda. +#[cfg(feature = "pezpallet-conviction-voting")] +pub use pezpallet_conviction_voting; + +/// Logic as per the description of The Fellowship for core Pezkuwi technology. +#[cfg(feature = "pezpallet-core-fellowship")] +pub use pezpallet_core_fellowship; + +/// FRAME delegated staking pezpallet. +#[cfg(feature = "pezpallet-delegated-staking")] +pub use pezpallet_delegated_staking; + +/// FRAME pezpallet for democracy. +#[cfg(feature = "pezpallet-democracy")] +pub use pezpallet_democracy; + +/// FRAME derivatives pezpallet. +#[cfg(feature = "pezpallet-derivatives")] +pub use pezpallet_derivatives; + +/// Dummy DIM Pallet. +#[cfg(feature = "pezpallet-dummy-dim")] +pub use pezpallet_dummy_dim; + +/// PALLET multi phase+block election providers. +#[cfg(feature = "pezpallet-election-provider-multi-block")] +pub use pezpallet_election_provider_multi_block; + +/// PALLET two phase election providers. +#[cfg(feature = "pezpallet-election-provider-multi-phase")] +pub use pezpallet_election_provider_multi_phase; + +/// Benchmarking for election provider support onchain config trait. +#[cfg(feature = "pezpallet-election-provider-support-benchmarking")] +pub use pezpallet_election_provider_support_benchmarking; + +/// FRAME pezpallet based on seq-Phragmén election method. +#[cfg(feature = "pezpallet-elections-phragmen")] +pub use pezpallet_elections_phragmen; + +/// FRAME fast unstake pezpallet. +#[cfg(feature = "pezpallet-fast-unstake")] +pub use pezpallet_fast_unstake; + +/// FRAME pezpallet for pushing a chain to its weight limits. +#[cfg(feature = "pezpallet-glutton")] +pub use pezpallet_glutton; + +/// FRAME pezpallet for GRANDPA finality gadget. +#[cfg(feature = "pezpallet-grandpa")] +pub use pezpallet_grandpa; + +/// FRAME identity management pezpallet. +#[cfg(feature = "pezpallet-identity")] +pub use pezpallet_identity; + +/// FRAME's I'm online pezpallet. +#[cfg(feature = "pezpallet-im-online")] +pub use pezpallet_im_online; + +/// FRAME indices management pezpallet. +#[cfg(feature = "pezpallet-indices")] +pub use pezpallet_indices; + +/// Insecure do not use in production: FRAME randomness collective flip pezpallet. +#[cfg(feature = "pezpallet-insecure-randomness-collective-flip")] +pub use pezpallet_insecure_randomness_collective_flip; + +/// FRAME Participation Lottery Pallet. +#[cfg(feature = "pezpallet-lottery")] +pub use pezpallet_lottery; + +/// FRAME membership management pezpallet. +#[cfg(feature = "pezpallet-membership")] +pub use pezpallet_membership; + +/// FRAME pezpallet to queue and process messages. +#[cfg(feature = "pezpallet-message-queue")] +pub use pezpallet_message_queue; + +/// FRAME pezpallet enabling meta transactions. +#[cfg(feature = "pezpallet-meta-tx")] +pub use pezpallet_meta_tx; + +/// FRAME pezpallet to execute multi-block migrations. +#[cfg(feature = "pezpallet-migrations")] +pub use pezpallet_migrations; + +/// FRAME's mixnet pezpallet. +#[cfg(feature = "pezpallet-mixnet")] +pub use pezpallet_mixnet; + +/// FRAME Merkle Mountain Range pezpallet. +#[cfg(feature = "pezpallet-mmr")] +pub use pezpallet_mmr; + +/// FRAME pezpallet to manage multi-asset and cross-chain bounties. +#[cfg(feature = "pezpallet-multi-asset-bounties")] +pub use pezpallet_multi_asset_bounties; + +/// FRAME multi-signature dispatch pezpallet. +#[cfg(feature = "pezpallet-multisig")] +pub use pezpallet_multisig; + +/// FRAME pezpallet to convert non-fungible to fungible tokens. +#[cfg(feature = "pezpallet-nft-fractionalization")] +pub use pezpallet_nft_fractionalization; + +/// FRAME NFTs pezpallet. +#[cfg(feature = "pezpallet-nfts")] +pub use pezpallet_nfts; + +/// Runtime API for the FRAME NFTs pezpallet. +#[cfg(feature = "pezpallet-nfts-runtime-api")] +pub use pezpallet_nfts_runtime_api; + +/// FRAME pezpallet for rewarding account freezing. +#[cfg(feature = "pezpallet-nis")] +pub use pezpallet_nis; + +/// FRAME pezpallet for node authorization. +#[cfg(feature = "pezpallet-node-authorization")] +pub use pezpallet_node_authorization; + +/// FRAME nomination pools pezpallet. +#[cfg(feature = "pezpallet-nomination-pools")] +pub use pezpallet_nomination_pools; + +/// FRAME nomination pools pezpallet benchmarking. +#[cfg(feature = "pezpallet-nomination-pools-benchmarking")] +pub use pezpallet_nomination_pools_benchmarking; + +/// Runtime API for nomination-pools FRAME pezpallet. +#[cfg(feature = "pezpallet-nomination-pools-runtime-api")] +pub use pezpallet_nomination_pools_runtime_api; + +/// FRAME offences pezpallet. +#[cfg(feature = "pezpallet-offences")] +pub use pezpallet_offences; + +/// FRAME offences pezpallet benchmarking. +#[cfg(feature = "pezpallet-offences-benchmarking")] +pub use pezpallet_offences_benchmarking; + +/// FRAME oracle pezpallet for off-chain data. +#[cfg(feature = "pezpallet-oracle")] +pub use pezpallet_oracle; + +/// Runtime API for the oracle pezpallet. +#[cfg(feature = "pezpallet-oracle-runtime-api")] +pub use pezpallet_oracle_runtime_api; + +/// Pallet to give some execution allowance for some origins. +#[cfg(feature = "pezpallet-origin-restriction")] +pub use pezpallet_origin_restriction; + +/// FRAME pezpallet that provides a paged list data structure. +#[cfg(feature = "pezpallet-paged-list")] +pub use pezpallet_paged_list; + +/// Pallet to store and configure parameters. +#[cfg(feature = "pezpallet-parameters")] +pub use pezpallet_parameters; + +/// Personhood-tracking pezpallet. +#[cfg(feature = "pezpallet-people")] +pub use pezpallet_people; + +/// FRAME pezpallet for storing preimages of hashes. +#[cfg(feature = "pezpallet-preimage")] +pub use pezpallet_preimage; + +/// FRAME proxying pezpallet. +#[cfg(feature = "pezpallet-proxy")] +pub use pezpallet_proxy; + +/// Ranked collective system: Members of a set of account IDs can make their collective +/// feelings known through dispatched calls from one of two specialized origins. +#[cfg(feature = "pezpallet-ranked-collective")] +pub use pezpallet_ranked_collective; + +/// FRAME account recovery pezpallet. +#[cfg(feature = "pezpallet-recovery")] +pub use pezpallet_recovery; + +/// FRAME pezpallet for inclusive on-chain decisions. +#[cfg(feature = "pezpallet-referenda")] +pub use pezpallet_referenda; + +/// Remark storage pezpallet. +#[cfg(feature = "pezpallet-remark")] +pub use pezpallet_remark; + +/// FRAME pezpallet for PolkaVM contracts. +#[cfg(feature = "pezpallet-revive")] +pub use pezpallet_revive; + +/// Procedural macros used in pallet_revive. +#[cfg(feature = "pezpallet-revive-proc-macro")] +pub use pezpallet_revive_proc_macro; + +/// Exposes all the host functions that a contract can import. +#[cfg(feature = "pezpallet-revive-uapi")] +pub use pezpallet_revive_uapi; + +/// FRAME root offences pezpallet. +#[cfg(feature = "pezpallet-root-offences")] +pub use pezpallet_root_offences; + +/// FRAME safe-mode pezpallet. +#[cfg(feature = "pezpallet-safe-mode")] +pub use pezpallet_safe_mode; + +/// Paymaster. +#[cfg(feature = "pezpallet-salary")] +pub use pezpallet_salary; + +/// FRAME Scheduler pezpallet. +#[cfg(feature = "pezpallet-scheduler")] +pub use pezpallet_scheduler; + +/// FRAME pezpallet for scored pools. +#[cfg(feature = "pezpallet-scored-pool")] +pub use pezpallet_scored_pool; + +/// FRAME sessions pezpallet. +#[cfg(feature = "pezpallet-session")] +pub use pezpallet_session; + +/// FRAME sessions pezpallet benchmarking. +#[cfg(feature = "pezpallet-session-benchmarking")] +pub use pezpallet_session_benchmarking; + +/// Pallet to skip payments for calls annotated with `feeless_if` if the respective conditions +/// are satisfied. +#[cfg(feature = "pezpallet-skip-feeless-payment")] +pub use pezpallet_skip_feeless_payment; + +/// FRAME society pezpallet. +#[cfg(feature = "pezpallet-society")] +pub use pezpallet_society; + +/// FRAME pezpallet staking. +#[cfg(feature = "pezpallet-staking")] +pub use pezpallet_staking; + +/// FRAME pezpallet staking async. +#[cfg(feature = "pezpallet-staking-async")] +pub use pezpallet_staking_async; + +/// Pallet handling the communication with staking-rc-client. It's role is to glue the staking +/// pezpallet (on AssetHub chain) and session pezpallet (on Relay Chain) in a transparent way. +#[cfg(feature = "pezpallet-staking-async-ah-client")] +pub use pezpallet_staking_async_ah_client; + +/// Pallet handling the communication with staking-ah-client. It's role is to glue the staking +/// pezpallet (on AssetHub chain) and session pezpallet (on Relay Chain) in a transparent way. +#[cfg(feature = "pezpallet-staking-async-rc-client")] +pub use pezpallet_staking_async_rc_client; + +/// Reward function for FRAME staking pezpallet. +#[cfg(feature = "pezpallet-staking-async-reward-fn")] +pub use pezpallet_staking_async_reward_fn; + +/// RPC runtime API for transaction payment FRAME pezpallet. +#[cfg(feature = "pezpallet-staking-async-runtime-api")] +pub use pezpallet_staking_async_runtime_api; + +/// Reward Curve for FRAME staking pezpallet. +#[cfg(feature = "pezpallet-staking-reward-curve")] +pub use pezpallet_staking_reward_curve; + +/// Reward function for FRAME staking pezpallet. +#[cfg(feature = "pezpallet-staking-reward-fn")] +pub use pezpallet_staking_reward_fn; + +/// RPC runtime API for transaction payment FRAME pezpallet. +#[cfg(feature = "pezpallet-staking-runtime-api")] +pub use pezpallet_staking_runtime_api; + +/// FRAME pezpallet migration of trie. +#[cfg(feature = "pezpallet-state-trie-migration")] +pub use pezpallet_state_trie_migration; + +/// FRAME pezpallet for statement store. +#[cfg(feature = "pezpallet-statement")] +pub use pezpallet_statement; + +/// FRAME pezpallet for sudo. +#[cfg(feature = "pezpallet-sudo")] +pub use pezpallet_sudo; + +/// FRAME Timestamp Module. +#[cfg(feature = "pezpallet-timestamp")] +pub use pezpallet_timestamp; + +/// FRAME pezpallet to manage tips. +#[cfg(feature = "pezpallet-tips")] +pub use pezpallet_tips; + +/// FRAME pezpallet to manage transaction payments. +#[cfg(feature = "pezpallet-transaction-payment")] +pub use pezpallet_transaction_payment; + +/// RPC interface for the transaction payment pezpallet. +#[cfg(feature = "pezpallet-transaction-payment-rpc")] +pub use pezpallet_transaction_payment_rpc; + +/// RPC runtime API for transaction payment FRAME pezpallet. +#[cfg(feature = "pezpallet-transaction-payment-rpc-runtime-api")] +pub use pezpallet_transaction_payment_rpc_runtime_api; + +/// Storage chain pezpallet. +#[cfg(feature = "pezpallet-transaction-storage")] +pub use pezpallet_transaction_storage; + +/// FRAME pezpallet to manage treasury. +#[cfg(feature = "pezpallet-treasury")] +pub use pezpallet_treasury; + +/// FRAME transaction pause pezpallet. +#[cfg(feature = "pezpallet-tx-pause")] +pub use pezpallet_tx_pause; + +/// FRAME NFT asset management pezpallet. +#[cfg(feature = "pezpallet-uniques")] +pub use pezpallet_uniques; + +/// FRAME utilities pezpallet. +#[cfg(feature = "pezpallet-utility")] +pub use pezpallet_utility; + +/// FRAME verify signature pezpallet. +#[cfg(feature = "pezpallet-verify-signature")] +pub use pezpallet_verify_signature; + +/// FRAME pezpallet for manage vesting. +#[cfg(feature = "pezpallet-vesting")] +pub use pezpallet_vesting; + +/// FRAME pezpallet for whitelisting calls, and dispatching from a specific origin. +#[cfg(feature = "pezpallet-whitelist")] +pub use pezpallet_whitelist; + +/// A pezpallet for handling XCM programs. +#[cfg(feature = "pezpallet-xcm")] +pub use pezpallet_xcm; + +/// Module that adds dynamic bridges/lanes support to XCM infrastructure at the bridge hub. +#[cfg(feature = "pezpallet-xcm-bridge-hub")] +pub use pezpallet_xcm_bridge_hub; + +/// Bridge hub interface for sibling/parent chains with dynamic fees support. +#[cfg(feature = "pezpallet-xcm-bridge-hub-router")] +pub use pezpallet_xcm_bridge_hub_router; + +/// Provides precompiles for `pezpallet-xcm`. +#[cfg(feature = "pezpallet-xcm-precompiles")] +pub use pezpallet_xcm_precompiles; + /// Collection of allocator implementations. -#[cfg(feature = "sc-allocator")] +#[cfg(feature = "pezsc-allocator")] pub use pezsc_allocator; /// Bizinikiwi authority discovery. -#[cfg(feature = "sc-authority-discovery")] +#[cfg(feature = "pezsc-authority-discovery")] pub use pezsc_authority_discovery; /// Basic implementation of block-authoring logic. -#[cfg(feature = "sc-basic-authorship")] +#[cfg(feature = "pezsc-basic-authorship")] pub use pezsc_basic_authorship; /// Bizinikiwi block builder. -#[cfg(feature = "sc-block-builder")] +#[cfg(feature = "pezsc-block-builder")] pub use pezsc_block_builder; /// Bizinikiwi chain configurations. -#[cfg(feature = "sc-chain-spec")] +#[cfg(feature = "pezsc-chain-spec")] pub use pezsc_chain_spec; /// Macros to derive chain spec extension traits implementation. -#[cfg(feature = "sc-chain-spec-derive")] +#[cfg(feature = "pezsc-chain-spec-derive")] pub use pezsc_chain_spec_derive; /// Bizinikiwi CLI interface. -#[cfg(feature = "sc-cli")] +#[cfg(feature = "pezsc-cli")] pub use pezsc_cli; /// Bizinikiwi client interfaces. -#[cfg(feature = "sc-client-api")] +#[cfg(feature = "pezsc-client-api")] pub use pezsc_client_api; /// Client backend that uses RocksDB database as storage. -#[cfg(feature = "sc-client-db")] +#[cfg(feature = "pezsc-client-db")] pub use pezsc_client_db; /// Collection of common consensus specific implementations for Bizinikiwi (client). -#[cfg(feature = "sc-consensus")] +#[cfg(feature = "pezsc-consensus")] pub use pezsc_consensus; /// Aura consensus algorithm for bizinikiwi. -#[cfg(feature = "sc-consensus-aura")] +#[cfg(feature = "pezsc-consensus-aura")] pub use pezsc_consensus_aura; /// BABE consensus algorithm for bizinikiwi. -#[cfg(feature = "sc-consensus-babe")] +#[cfg(feature = "pezsc-consensus-babe")] pub use pezsc_consensus_babe; /// RPC extensions for the BABE consensus algorithm. -#[cfg(feature = "sc-consensus-babe-rpc")] +#[cfg(feature = "pezsc-consensus-babe-rpc")] pub use pezsc_consensus_babe_rpc; /// BEEFY Client gadget for bizinikiwi. -#[cfg(feature = "sc-consensus-beefy")] +#[cfg(feature = "pezsc-consensus-beefy")] pub use pezsc_consensus_beefy; /// RPC for the BEEFY Client gadget for bizinikiwi. -#[cfg(feature = "sc-consensus-beefy-rpc")] +#[cfg(feature = "pezsc-consensus-beefy-rpc")] pub use pezsc_consensus_beefy_rpc; /// Generic epochs-based utilities for consensus. -#[cfg(feature = "sc-consensus-epochs")] +#[cfg(feature = "pezsc-consensus-epochs")] pub use pezsc_consensus_epochs; /// Integration of the GRANDPA finality gadget into bizinikiwi. -#[cfg(feature = "sc-consensus-grandpa")] +#[cfg(feature = "pezsc-consensus-grandpa")] pub use pezsc_consensus_grandpa; /// RPC extensions for the GRANDPA finality gadget. -#[cfg(feature = "sc-consensus-grandpa-rpc")] +#[cfg(feature = "pezsc-consensus-grandpa-rpc")] pub use pezsc_consensus_grandpa_rpc; /// Manual sealing engine for Bizinikiwi. -#[cfg(feature = "sc-consensus-manual-seal")] +#[cfg(feature = "pezsc-consensus-manual-seal")] pub use pezsc_consensus_manual_seal; /// PoW consensus algorithm for bizinikiwi. -#[cfg(feature = "sc-consensus-pow")] +#[cfg(feature = "pezsc-consensus-pow")] pub use pezsc_consensus_pow; /// Generic slots-based utilities for consensus. -#[cfg(feature = "sc-consensus-slots")] +#[cfg(feature = "pezsc-consensus-slots")] pub use pezsc_consensus_slots; /// A crate that provides means of executing/dispatching calls into the runtime. -#[cfg(feature = "sc-executor")] +#[cfg(feature = "pezsc-executor")] pub use pezsc_executor; /// A set of common definitions that are needed for defining execution engines. -#[cfg(feature = "sc-executor-common")] +#[cfg(feature = "pezsc-executor-common")] pub use pezsc_executor_common; /// PolkaVM executor for Bizinikiwi. -#[cfg(feature = "sc-executor-polkavm")] +#[cfg(feature = "pezsc-executor-polkavm")] pub use pezsc_executor_polkavm; /// Defines a `WasmRuntime` that uses the Wasmtime JIT to execute. -#[cfg(feature = "sc-executor-wasmtime")] +#[cfg(feature = "pezsc-executor-wasmtime")] pub use pezsc_executor_wasmtime; /// Bizinikiwi informant. -#[cfg(feature = "sc-informant")] +#[cfg(feature = "pezsc-informant")] pub use pezsc_informant; /// Keystore (and session key management) for ed25519 based chains like Pezkuwi. -#[cfg(feature = "sc-keystore")] +#[cfg(feature = "pezsc-keystore")] pub use pezsc_keystore; /// Bizinikiwi mixnet service. -#[cfg(feature = "sc-mixnet")] +#[cfg(feature = "pezsc-mixnet")] pub use pezsc_mixnet; /// Bizinikiwi network protocol. -#[cfg(feature = "sc-network")] +#[cfg(feature = "pezsc-network")] pub use pezsc_network; /// Bizinikiwi network common. -#[cfg(feature = "sc-network-common")] +#[cfg(feature = "pezsc-network-common")] pub use pezsc_network_common; /// Gossiping for the Bizinikiwi network protocol. -#[cfg(feature = "sc-network-gossip")] +#[cfg(feature = "pezsc-network-gossip")] pub use pezsc_network_gossip; /// Bizinikiwi light network protocol. -#[cfg(feature = "sc-network-light")] +#[cfg(feature = "pezsc-network-light")] pub use pezsc_network_light; /// Bizinikiwi statement protocol. -#[cfg(feature = "sc-network-statement")] +#[cfg(feature = "pezsc-network-statement")] pub use pezsc_network_statement; /// Bizinikiwi sync network protocol. -#[cfg(feature = "sc-network-sync")] +#[cfg(feature = "pezsc-network-sync")] pub use pezsc_network_sync; /// Bizinikiwi transaction protocol. -#[cfg(feature = "sc-network-transactions")] +#[cfg(feature = "pezsc-network-transactions")] pub use pezsc_network_transactions; /// Bizinikiwi network types. -#[cfg(feature = "sc-network-types")] +#[cfg(feature = "pezsc-network-types")] pub use pezsc_network_types; /// Bizinikiwi offchain workers. -#[cfg(feature = "sc-offchain")] +#[cfg(feature = "pezsc-offchain")] pub use pezsc_offchain; /// Basic metrics for block production. -#[cfg(feature = "sc-proposer-metrics")] +#[cfg(feature = "pezsc-proposer-metrics")] pub use pezsc_proposer_metrics; /// Bizinikiwi Client RPC. -#[cfg(feature = "sc-rpc")] +#[cfg(feature = "pezsc-rpc")] pub use pezsc_rpc; /// Bizinikiwi RPC interfaces. -#[cfg(feature = "sc-rpc-api")] +#[cfg(feature = "pezsc-rpc-api")] pub use pezsc_rpc_api; /// Bizinikiwi RPC servers. -#[cfg(feature = "sc-rpc-server")] +#[cfg(feature = "pezsc-rpc-server")] pub use pezsc_rpc_server; /// Bizinikiwi RPC interface v2. -#[cfg(feature = "sc-rpc-spec-v2")] +#[cfg(feature = "pezsc-rpc-spec-v2")] pub use pezsc_rpc_spec_v2; /// Bizinikiwi client utilities for frame runtime functions calls. -#[cfg(feature = "sc-runtime-utilities")] +#[cfg(feature = "pezsc-runtime-utilities")] pub use pezsc_runtime_utilities; /// Bizinikiwi service. Starts a thread that spins up the network, client, and extrinsic pool. /// Manages communication between them. -#[cfg(feature = "sc-service")] +#[cfg(feature = "pezsc-service")] pub use pezsc_service; /// State database maintenance. Handles canonicalization and pruning in the database. -#[cfg(feature = "sc-state-db")] +#[cfg(feature = "pezsc-state-db")] pub use pezsc_state_db; /// Bizinikiwi statement store. -#[cfg(feature = "sc-statement-store")] +#[cfg(feature = "pezsc-statement-store")] pub use pezsc_statement_store; /// Storage monitor service for bizinikiwi. -#[cfg(feature = "sc-storage-monitor")] +#[cfg(feature = "pezsc-storage-monitor")] pub use pezsc_storage_monitor; /// A RPC handler to create sync states for light clients. -#[cfg(feature = "sc-sync-state-rpc")] +#[cfg(feature = "pezsc-sync-state-rpc")] pub use pezsc_sync_state_rpc; /// A crate that provides basic hardware and software telemetry information. -#[cfg(feature = "sc-sysinfo")] +#[cfg(feature = "pezsc-sysinfo")] pub use pezsc_sysinfo; /// Telemetry utils. -#[cfg(feature = "sc-telemetry")] +#[cfg(feature = "pezsc-telemetry")] pub use pezsc_telemetry; /// Instrumentation implementation for bizinikiwi. -#[cfg(feature = "sc-tracing")] +#[cfg(feature = "pezsc-tracing")] pub use pezsc_tracing; /// Helper macros for Bizinikiwi's client CLI. -#[cfg(feature = "sc-tracing-proc-macro")] +#[cfg(feature = "pezsc-tracing-proc-macro")] pub use pezsc_tracing_proc_macro; /// Bizinikiwi transaction pool implementation. -#[cfg(feature = "sc-transaction-pool")] +#[cfg(feature = "pezsc-transaction-pool")] pub use pezsc_transaction_pool; /// Transaction pool client facing API. -#[cfg(feature = "sc-transaction-pool-api")] +#[cfg(feature = "pezsc-transaction-pool-api")] pub use pezsc_transaction_pool_api; /// I/O for Bizinikiwi runtimes. -#[cfg(feature = "sc-utils")] +#[cfg(feature = "pezsc-utils")] pub use pezsc_utils; -/// Helper crate for generating slot ranges for the Pezkuwi runtime. -#[cfg(feature = "pez-slot-range-helper")] -pub use pez_slot_range_helper; - /// Bizinikiwi runtime api primitives. -#[cfg(feature = "sp-api")] +#[cfg(feature = "pezsp-api")] pub use pezsp_api; /// Macros for declaring and implementing runtime apis. -#[cfg(feature = "sp-api-proc-macro")] +#[cfg(feature = "pezsp-api-proc-macro")] pub use pezsp_api_proc_macro; /// Provides facilities for generating application specific crypto wrapper types. -#[cfg(feature = "sp-application-crypto")] +#[cfg(feature = "pezsp-application-crypto")] pub use pezsp_application_crypto; /// Minimal fixed point arithmetic primitives and types for runtime. -#[cfg(feature = "sp-arithmetic")] +#[cfg(feature = "pezsp-arithmetic")] pub use pezsp_arithmetic; /// Authority discovery primitives. -#[cfg(feature = "sp-authority-discovery")] +#[cfg(feature = "pezsp-authority-discovery")] pub use pezsp_authority_discovery; /// The block builder runtime api. -#[cfg(feature = "sp-block-builder")] +#[cfg(feature = "pezsp-block-builder")] pub use pezsp_block_builder; /// Bizinikiwi blockchain traits and primitives. -#[cfg(feature = "sp-blockchain")] +#[cfg(feature = "pezsp-blockchain")] pub use pezsp_blockchain; /// Common utilities for building and using consensus engines in bizinikiwi. -#[cfg(feature = "sp-consensus")] +#[cfg(feature = "pezsp-consensus")] pub use pezsp_consensus; /// Primitives for Aura consensus. -#[cfg(feature = "sp-consensus-aura")] +#[cfg(feature = "pezsp-consensus-aura")] pub use pezsp_consensus_aura; /// Primitives for BABE consensus. -#[cfg(feature = "sp-consensus-babe")] +#[cfg(feature = "pezsp-consensus-babe")] pub use pezsp_consensus_babe; /// Primitives for BEEFY protocol. -#[cfg(feature = "sp-consensus-beefy")] +#[cfg(feature = "pezsp-consensus-beefy")] pub use pezsp_consensus_beefy; /// Primitives for GRANDPA integration, suitable for WASM compilation. -#[cfg(feature = "sp-consensus-grandpa")] +#[cfg(feature = "pezsp-consensus-grandpa")] pub use pezsp_consensus_grandpa; /// Primitives for Aura consensus. -#[cfg(feature = "sp-consensus-pow")] +#[cfg(feature = "pezsp-consensus-pow")] pub use pezsp_consensus_pow; /// Primitives for slots-based consensus. -#[cfg(feature = "sp-consensus-slots")] +#[cfg(feature = "pezsp-consensus-slots")] pub use pezsp_consensus_slots; /// Shareable Bizinikiwi types. -#[cfg(feature = "sp-core")] +#[cfg(feature = "pezsp-core")] pub use pezsp_core; -/// Hashing primitives (deprecated: use sp-crypto-hashing for new applications). -#[cfg(feature = "sp-core-hashing")] +/// Hashing primitives (deprecated: use pezsp-crypto-hashing for new applications). +#[cfg(feature = "pezsp-core-hashing")] pub use pezsp_core_hashing; /// Procedural macros for calculating static hashes (deprecated in favor of -/// `sp-crypto-hashing-proc-macro`). -#[cfg(feature = "sp-core-hashing-proc-macro")] +/// `pezsp-crypto-hashing-proc-macro`). +#[cfg(feature = "pezsp-core-hashing-proc-macro")] pub use pezsp_core_hashing_proc_macro; /// Host functions for common Arkworks elliptic curve operations. -#[cfg(feature = "sp-crypto-ec-utils")] +#[cfg(feature = "pezsp-crypto-ec-utils")] pub use pezsp_crypto_ec_utils; /// Hashing primitives. -#[cfg(feature = "sp-crypto-hashing")] +#[cfg(feature = "pezsp-crypto-hashing")] pub use pezsp_crypto_hashing; /// Procedural macros for calculating static hashes. -#[cfg(feature = "sp-crypto-hashing-proc-macro")] +#[cfg(feature = "pezsp-crypto-hashing-proc-macro")] pub use pezsp_crypto_hashing_proc_macro; /// Bizinikiwi database trait. -#[cfg(feature = "sp-database")] +#[cfg(feature = "pezsp-database")] pub use pezsp_database; /// Macros to derive runtime debug implementation. -#[cfg(feature = "sp-debug-derive")] +#[cfg(feature = "pezsp-debug-derive")] pub use pezsp_debug_derive; /// Bizinikiwi externalities abstraction. -#[cfg(feature = "sp-externalities")] +#[cfg(feature = "pezsp-externalities")] pub use pezsp_externalities; /// Bizinikiwi RuntimeGenesisConfig builder API. -#[cfg(feature = "sp-genesis-builder")] +#[cfg(feature = "pezsp-genesis-builder")] pub use pezsp_genesis_builder; /// Provides types and traits for creating and checking inherents. -#[cfg(feature = "sp-inherents")] +#[cfg(feature = "pezsp-inherents")] pub use pezsp_inherents; /// I/O for Bizinikiwi runtimes. -#[cfg(feature = "sp-io")] +#[cfg(feature = "pezsp-io")] pub use pezsp_io; /// Keyring support code for the runtime. A set of test accounts. -#[cfg(feature = "sp-keyring")] +#[cfg(feature = "pezsp-keyring")] pub use pezsp_keyring; /// Keystore primitives. -#[cfg(feature = "sp-keystore")] +#[cfg(feature = "pezsp-keystore")] pub use pezsp_keystore; /// Handling of blobs, usually Wasm code, which may be compressed. -#[cfg(feature = "sp-maybe-compressed-blob")] +#[cfg(feature = "pezsp-maybe-compressed-blob")] pub use pezsp_maybe_compressed_blob; /// Intermediate representation of the runtime metadata. -#[cfg(feature = "sp-metadata-ir")] +#[cfg(feature = "pezsp-metadata-ir")] pub use pezsp_metadata_ir; /// Bizinikiwi mixnet types and runtime interface. -#[cfg(feature = "sp-mixnet")] +#[cfg(feature = "pezsp-mixnet")] pub use pezsp_mixnet; /// Merkle Mountain Range primitives. -#[cfg(feature = "sp-mmr-primitives")] +#[cfg(feature = "pezsp-mmr-primitives")] pub use pezsp_mmr_primitives; /// NPoS election algorithm primitives. -#[cfg(feature = "sp-npos-elections")] +#[cfg(feature = "pezsp-npos-elections")] pub use pezsp_npos_elections; /// Bizinikiwi offchain workers primitives. -#[cfg(feature = "sp-offchain")] +#[cfg(feature = "pezsp-offchain")] pub use pezsp_offchain; /// Custom panic hook with bug report link. -#[cfg(feature = "sp-panic-handler")] +#[cfg(feature = "pezsp-panic-handler")] pub use pezsp_panic_handler; /// Bizinikiwi RPC primitives and utilities. -#[cfg(feature = "sp-rpc")] +#[cfg(feature = "pezsp-rpc")] pub use pezsp_rpc; -/// Runtime Modules shared primitive types. -#[cfg(feature = "sp-runtime")] -pub use pezsp_runtime; - /// Bizinikiwi runtime interface. -#[cfg(feature = "sp-runtime-interface")] +#[cfg(feature = "pezsp-runtime-interface")] pub use pezsp_runtime_interface; -/// This crate provides procedural macros for usage within the context of the Bizinikiwi runtime -/// interface. -#[cfg(feature = "sp-runtime-interface-proc-macro")] +/// This crate provides procedural macros for usage within the context of the Bizinikiwi +/// runtime interface. +#[cfg(feature = "pezsp-runtime-interface-proc-macro")] pub use pezsp_runtime_interface_proc_macro; /// Primitives for sessions. -#[cfg(feature = "sp-session")] +#[cfg(feature = "pezsp-session")] pub use pezsp_session; /// A crate which contains primitives that are useful for implementation that uses staking /// approaches in general. Definitions related to sessions, slashing, etc go here. -#[cfg(feature = "sp-staking")] +#[cfg(feature = "pezsp-staking")] pub use pezsp_staking; /// Bizinikiwi State Machine. -#[cfg(feature = "sp-state-machine")] +#[cfg(feature = "pezsp-state-machine")] pub use pezsp_state_machine; /// A crate which contains primitives related to the statement store. -#[cfg(feature = "sp-statement-store")] +#[cfg(feature = "pezsp-statement-store")] pub use pezsp_statement_store; -/// Lowest-abstraction level for the Bizinikiwi runtime: just exports useful primitives from std -/// or client/alloc to be used with any code that depends on the runtime. -#[cfg(feature = "sp-std")] +/// Lowest-abstraction level for the Bizinikiwi runtime: just exports useful primitives from +/// std or client/alloc to be used with any code that depends on the runtime. +#[cfg(feature = "pezsp-std")] pub use pezsp_std; /// Storage related primitives. -#[cfg(feature = "sp-storage")] +#[cfg(feature = "pezsp-storage")] pub use pezsp_storage; /// Bizinikiwi core types and inherents for timestamps. -#[cfg(feature = "sp-timestamp")] +#[cfg(feature = "pezsp-timestamp")] pub use pezsp_timestamp; /// Instrumentation primitives and macros for Bizinikiwi. -#[cfg(feature = "sp-tracing")] +#[cfg(feature = "pezsp-tracing")] pub use pezsp_tracing; /// Transaction pool runtime facing API. -#[cfg(feature = "sp-transaction-pool")] +#[cfg(feature = "pezsp-transaction-pool")] pub use pezsp_transaction_pool; /// Transaction storage proof primitives. -#[cfg(feature = "sp-transaction-storage-proof")] +#[cfg(feature = "pezsp-transaction-storage-proof")] pub use pezsp_transaction_storage_proof; /// Patricia trie stuff using a parity-scale-codec node format. -#[cfg(feature = "sp-trie")] +#[cfg(feature = "pezsp-trie")] pub use pezsp_trie; /// Version module for the Bizinikiwi runtime; Provides a function that returns the runtime /// version. -#[cfg(feature = "sp-version")] +#[cfg(feature = "pezsp-version")] pub use pezsp_version; /// Macro for defining a runtime version. -#[cfg(feature = "sp-version-proc-macro")] +#[cfg(feature = "pezsp-version-proc-macro")] pub use pezsp_version_proc_macro; /// Types and traits for interfacing between the host and the wasm runtime. -#[cfg(feature = "sp-wasm-interface")] +#[cfg(feature = "pezsp-wasm-interface")] pub use pezsp_wasm_interface; /// Types and traits for interfacing between the host and the wasm runtime. -#[cfg(feature = "sp-weights")] +#[cfg(feature = "pezsp-weights")] pub use pezsp_weights; /// Utility for building chain-specification files for Bizinikiwi-based runtimes based on -/// `sp-genesis-builder`. +/// `pezsp-genesis-builder`. #[cfg(feature = "pezstaging-chain-spec-builder")] pub use pezstaging_chain_spec_builder; @@ -1478,7 +1501,7 @@ pub use pezstaging_chain_spec_builder; #[cfg(feature = "pezstaging-node-inspect")] pub use pezstaging_node_inspect; -/// Pezpallet to store the teyrchain ID. +/// Pallet to store the teyrchain ID. #[cfg(feature = "pezstaging-teyrchain-info")] pub use pezstaging_teyrchain_info; @@ -1498,43 +1521,6 @@ pub use pezstaging_xcm_builder; #[cfg(feature = "pezstaging-xcm-executor")] pub use pezstaging_xcm_executor; -/// Generate and restore keys for Bizinikiwi based chains such as Pezkuwi, Kusama and a growing -/// number of teyrchains and Bizinikiwi based projects. -#[cfg(feature = "pez_subkey")] -pub use pez_subkey; - -/// Converting BIP39 entropy to valid Bizinikiwi (sr25519) SecretKeys. -#[cfg(feature = "bizinikiwi-bip39")] -pub use bizinikiwi_bip39; - -/// Crate with utility functions for `build.rs` scripts. -#[cfg(feature = "bizinikiwi-build-script-utils")] -pub use bizinikiwi_build_script_utils; - -/// Bizinikiwi RPC for FRAME's support. -#[cfg(feature = "bizinikiwi-frame-rpc-support")] -pub use bizinikiwi_frame_rpc_support; - -/// FRAME's system exposed over Bizinikiwi RPC. -#[cfg(feature = "bizinikiwi-frame-rpc-system")] -pub use bizinikiwi_frame_rpc_system; - -/// Endpoint to expose Prometheus metrics. -#[cfg(feature = "bizinikiwi-prometheus-endpoint")] -pub use bizinikiwi_prometheus_endpoint; - -/// Shared JSON-RPC client. -#[cfg(feature = "bizinikiwi-rpc-client")] -pub use bizinikiwi_rpc_client; - -/// Node-specific RPC methods for interaction with state trie migration. -#[cfg(feature = "bizinikiwi-state-trie-migration-rpc")] -pub use bizinikiwi_state_trie_migration_rpc; - -/// Utility for building WASM binaries. -#[cfg(feature = "bizinikiwi-wasm-builder")] -pub use bizinikiwi_wasm_builder; - /// Common constants for Testnet Teyrchains runtimes. #[cfg(feature = "testnet-teyrchains-constants")] pub use testnet_teyrchains_constants; @@ -1547,15 +1533,6 @@ pub use teyrchains_common; #[cfg(feature = "teyrchains-runtimes-test-utils")] pub use teyrchains_runtimes_test_utils; -/// Stick logs together with the TraceID as provided by tempo. -#[cfg(feature = "pez-tracing-gum")] -pub use pez_tracing_gum; - -/// Generate an overseer including builder pattern and message wrapper from a single annotated -/// struct definition. -#[cfg(feature = "pez-tracing-gum-proc-macro")] -pub use pez_tracing_gum_proc_macro; - /// Test kit to emulate XCM program execution. #[cfg(feature = "xcm-pez-emulator")] pub use xcm_pez_emulator; @@ -1564,10 +1541,10 @@ pub use xcm_pez_emulator; #[cfg(feature = "xcm-pez-procedural")] pub use xcm_pez_procedural; -/// XCM runtime APIs. -#[cfg(feature = "xcm-runtime-pezapis")] -pub use xcm_runtime_pezapis; - /// Test kit to simulate cross-chain message passing and XCM execution. #[cfg(feature = "xcm-pez-simulator")] pub use xcm_pez_simulator; + +/// XCM runtime APIs. +#[cfg(feature = "xcm-runtime-pezapis")] +pub use xcm_runtime_pezapis; diff --git a/vendor/ss58-registry/Cargo.toml b/vendor/ss58-registry/Cargo.toml index b1e6c801..fce0e0eb 100644 --- a/vendor/ss58-registry/Cargo.toml +++ b/vendor/ss58-registry/Cargo.toml @@ -11,7 +11,11 @@ repository.workspace = true [features] default = ["std"] -std = ["num-format"] +std = [ + "num-format", + "serde/std", + "serde_json/std" +] [dependencies] num-format = { version = "0.4.3", optional = true }