├── .dockerignore ├── .editorconfig ├── .gitignore ├── .gitlab-ci.yml ├── .maintain ├── build-only-wasm.sh ├── docs-index-tpl.ejs ├── frame-weight-template.hbs ├── getgoing.sh ├── init.sh ├── local-docker-test-network │ ├── docker-compose.yml │ ├── grafana │ │ └── provisioning │ │ │ ├── dashboards │ │ │ └── dashboards.yml │ │ │ └── datasources │ │ │ └── datasource.yml │ └── prometheus │ │ └── prometheus.yml ├── rename-crates-for-2.0.sh ├── runtime-dep.py ├── rustdocs-release.sh ├── update-copyright.sh ├── update-deps.sh └── update-rust-stable.sh ├── Cargo.lock ├── Cargo.toml ├── HEADER-APACHE2 ├── HEADER-GPL3 ├── LICENSE-APACHE2 ├── LICENSE-GPL3 ├── README.md ├── bin ├── node-template │ ├── .editorconfig │ ├── LICENSE │ ├── README.md │ ├── docker-compose.yml │ ├── docs │ │ └── rust-setup.md │ ├── node │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ ├── benchmarking.rs │ │ │ ├── chain_spec.rs │ │ │ ├── cli.rs │ │ │ ├── command.rs │ │ │ ├── main.rs │ │ │ ├── rpc.rs │ │ │ └── service.rs │ ├── pallets │ │ ├── tdstest │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ │ ├── benchmarking.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── mock.rs │ │ │ │ └── tests.rs │ │ └── template │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ ├── benchmarking.rs │ │ │ ├── lib.rs │ │ │ ├── mock.rs │ │ │ └── tests.rs │ ├── runtime │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ └── lib.rs │ ├── scripts │ │ ├── docker_run.sh │ │ └── init.sh │ └── shell.nix ├── node │ ├── bench │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── common.rs │ │ │ ├── construct.rs │ │ │ ├── core.rs │ │ │ ├── generator.rs │ │ │ ├── import.rs │ │ │ ├── main.rs │ │ │ ├── simple_trie.rs │ │ │ ├── state_sizes.rs │ │ │ ├── tempdb.rs │ │ │ ├── trie.rs │ │ │ └── txpool.rs │ ├── cli │ │ ├── Cargo.toml │ │ ├── benches │ │ │ ├── block_production.rs │ │ │ └── transaction_pool.rs │ │ ├── bin │ │ │ └── main.rs │ │ ├── build.rs │ │ ├── doc │ │ │ └── shell-completion.adoc │ │ ├── res │ │ │ └── flaming-fir.json │ │ ├── src │ │ │ ├── benchmarking.rs │ │ │ ├── chain_spec.rs │ │ │ ├── cli.rs │ │ │ ├── command.rs │ │ │ ├── lib.rs │ │ │ └── service.rs │ │ └── tests │ │ │ ├── benchmark_block_works.rs │ │ │ ├── benchmark_extrinsic_works.rs │ │ │ ├── benchmark_machine_works.rs │ │ │ ├── benchmark_overhead_works.rs │ │ │ ├── benchmark_pallet_works.rs │ │ │ ├── benchmark_storage_works.rs │ │ │ ├── build_spec_works.rs │ │ │ ├── check_block_works.rs │ │ │ ├── common.rs │ │ │ ├── export_import_flow.rs │ │ │ ├── inspect_works.rs │ │ │ ├── purge_chain_works.rs │ │ │ ├── remember_state_pruning_works.rs │ │ │ ├── running_the_node_and_interrupt.rs │ │ │ ├── telemetry.rs │ │ │ ├── temp_base_path_works.rs │ │ │ ├── version.rs │ │ │ └── websocket_server.rs │ ├── executor │ │ ├── Cargo.toml │ │ ├── benches │ │ │ └── bench.rs │ │ ├── src │ │ │ └── lib.rs │ │ └── tests │ │ │ ├── basic.rs │ │ │ ├── common.rs │ │ │ ├── fees.rs │ │ │ └── submit_transaction.rs │ ├── inspect │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── cli.rs │ │ │ ├── command.rs │ │ │ └── lib.rs │ ├── primitives │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── rpc │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── runtime │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ ├── constants.rs │ │ │ ├── impls.rs │ │ │ ├── lib.rs │ │ │ └── voter_bags.rs │ └── testing │ │ ├── Cargo.toml │ │ └── src │ │ ├── bench.rs │ │ ├── client.rs │ │ ├── genesis.rs │ │ ├── keyring.rs │ │ └── lib.rs └── utils │ ├── chain-spec-builder │ ├── Cargo.toml │ ├── README.md │ ├── build.rs │ └── src │ │ └── main.rs │ └── subkey │ ├── Cargo.toml │ ├── README.md │ ├── SECURITY.md │ └── src │ ├── lib.rs │ └── main.rs ├── client ├── allocator │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── error.rs │ │ ├── freeing_bump.rs │ │ └── lib.rs ├── api │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── backend.rs │ │ ├── call_executor.rs │ │ ├── client.rs │ │ ├── execution_extensions.rs │ │ ├── in_mem.rs │ │ ├── leaves.rs │ │ ├── lib.rs │ │ ├── notifications.rs │ │ ├── notifications │ │ ├── registry.rs │ │ └── tests.rs │ │ └── proof_provider.rs ├── authority-discovery │ ├── Cargo.toml │ ├── README.md │ ├── build.rs │ └── src │ │ ├── error.rs │ │ ├── interval.rs │ │ ├── lib.rs │ │ ├── service.rs │ │ ├── tests.rs │ │ ├── worker.rs │ │ └── worker │ │ ├── addr_cache.rs │ │ ├── schema │ │ ├── dht-v1.proto │ │ ├── dht-v2.proto │ │ └── tests.rs │ │ └── tests.rs ├── basic-authorship │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── basic_authorship.rs │ │ └── lib.rs ├── beefy │ ├── Cargo.toml │ ├── README.md │ ├── rpc │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── lib.rs │ │ │ └── notification.rs │ └── src │ │ ├── aux_schema.rs │ │ ├── communication │ │ ├── gossip.rs │ │ ├── mod.rs │ │ ├── notification.rs │ │ ├── peers.rs │ │ └── request_response │ │ │ ├── incoming_requests_handler.rs │ │ │ ├── mod.rs │ │ │ └── outgoing_requests_engine.rs │ │ ├── error.rs │ │ ├── import.rs │ │ ├── justification.rs │ │ ├── keystore.rs │ │ ├── lib.rs │ │ ├── metrics.rs │ │ ├── round.rs │ │ ├── tests.rs │ │ └── worker.rs ├── block-builder │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── chain-spec │ ├── Cargo.toml │ ├── README.md │ ├── derive │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── impls.rs │ │ │ └── lib.rs │ ├── res │ │ ├── chain_spec.json │ │ └── chain_spec2.json │ └── src │ │ ├── chain_spec.rs │ │ ├── extension.rs │ │ └── lib.rs ├── cli │ ├── Cargo.toml │ ├── README.adoc │ ├── README.md │ └── src │ │ ├── arg_enums.rs │ │ ├── commands │ │ ├── build_spec_cmd.rs │ │ ├── chain_info_cmd.rs │ │ ├── check_block_cmd.rs │ │ ├── export_blocks_cmd.rs │ │ ├── export_state_cmd.rs │ │ ├── generate.rs │ │ ├── generate_node_key.rs │ │ ├── import_blocks_cmd.rs │ │ ├── insert_key.rs │ │ ├── inspect_key.rs │ │ ├── inspect_node_key.rs │ │ ├── key.rs │ │ ├── mod.rs │ │ ├── purge_chain_cmd.rs │ │ ├── revert_cmd.rs │ │ ├── run_cmd.rs │ │ ├── sign.rs │ │ ├── utils.rs │ │ ├── vanity.rs │ │ └── verify.rs │ │ ├── config.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── params │ │ ├── database_params.rs │ │ ├── import_params.rs │ │ ├── keystore_params.rs │ │ ├── mod.rs │ │ ├── network_params.rs │ │ ├── node_key_params.rs │ │ ├── offchain_worker_params.rs │ │ ├── pruning_params.rs │ │ ├── shared_params.rs │ │ └── transaction_pool_params.rs │ │ └── runner.rs ├── consensus │ ├── aura │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── import_queue.rs │ │ │ └── lib.rs │ ├── babe │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── rpc │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── src │ │ │ ├── authorship.rs │ │ │ ├── aux_schema.rs │ │ │ ├── lib.rs │ │ │ ├── migration.rs │ │ │ ├── tests.rs │ │ │ └── verification.rs │ ├── common │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── block_import.rs │ │ │ ├── import_queue.rs │ │ │ ├── import_queue │ │ │ ├── basic_queue.rs │ │ │ ├── buffered_link.rs │ │ │ └── mock.rs │ │ │ ├── lib.rs │ │ │ ├── longest_chain.rs │ │ │ ├── metrics.rs │ │ │ └── shared_data.rs │ ├── epochs │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── lib.rs │ │ │ └── migration.rs │ ├── manual-seal │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── consensus.rs │ │ │ ├── consensus │ │ │ ├── aura.rs │ │ │ ├── babe.rs │ │ │ └── timestamp.rs │ │ │ ├── error.rs │ │ │ ├── finalize_block.rs │ │ │ ├── lib.rs │ │ │ ├── rpc.rs │ │ │ └── seal_block.rs │ ├── pow │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── lib.rs │ │ │ └── worker.rs │ ├── slots │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── src │ │ │ ├── aux_schema.rs │ │ │ ├── lib.rs │ │ │ └── slots.rs │ └── uncles │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ └── lib.rs ├── db │ ├── Cargo.toml │ ├── README.md │ ├── benches │ │ └── state_access.rs │ └── src │ │ ├── bench.rs │ │ ├── children.rs │ │ ├── lib.rs │ │ ├── offchain.rs │ │ ├── parity_db.rs │ │ ├── record_stats_state.rs │ │ ├── stats.rs │ │ ├── storage_cache.rs │ │ ├── upgrade.rs │ │ └── utils.rs ├── executor │ ├── Cargo.toml │ ├── README.md │ ├── benches │ │ ├── bench.rs │ │ └── kusama_runtime.wasm │ ├── common │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ ├── runtime_blob │ │ │ ├── data_segments_snapshot.rs │ │ │ ├── globals_snapshot.rs │ │ │ ├── mod.rs │ │ │ └── runtime_blob.rs │ │ │ ├── util.rs │ │ │ └── wasm_runtime.rs │ ├── runtime-test │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ └── lib.rs │ ├── src │ │ ├── integration_tests │ │ │ ├── linux.rs │ │ │ ├── linux │ │ │ │ └── smaps.rs │ │ │ └── mod.rs │ │ ├── lib.rs │ │ ├── native_executor.rs │ │ └── wasm_runtime.rs │ ├── wasmi │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── lib.rs │ └── wasmtime │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── src │ │ ├── host.rs │ │ ├── imports.rs │ │ ├── instance_wrapper.rs │ │ ├── lib.rs │ │ ├── runtime.rs │ │ ├── test-guard-page-skip.wat │ │ ├── tests.rs │ │ └── util.rs ├── finality-grandpa │ ├── Cargo.toml │ ├── README.md │ ├── rpc │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── error.rs │ │ │ ├── finality.rs │ │ │ ├── lib.rs │ │ │ ├── notification.rs │ │ │ └── report.rs │ └── src │ │ ├── authorities.rs │ │ ├── aux_schema.rs │ │ ├── communication │ │ ├── gossip.rs │ │ ├── mod.rs │ │ ├── periodic.rs │ │ └── tests.rs │ │ ├── environment.rs │ │ ├── finality_proof.rs │ │ ├── import.rs │ │ ├── justification.rs │ │ ├── lib.rs │ │ ├── notification.rs │ │ ├── observer.rs │ │ ├── tests.rs │ │ ├── until_imported.rs │ │ ├── voting_rule.rs │ │ └── warp_proof.rs ├── informant │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── display.rs │ │ └── lib.rs ├── keystore │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── local.rs ├── merkle-mountain-range │ ├── Cargo.toml │ ├── rpc │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── aux_schema.rs │ │ ├── lib.rs │ │ ├── offchain_mmr.rs │ │ └── test_utils.rs ├── network-gossip │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── bridge.rs │ │ ├── lib.rs │ │ ├── state_machine.rs │ │ └── validator.rs ├── network │ ├── Cargo.toml │ ├── README.md │ ├── bitswap │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ ├── lib.rs │ │ │ ├── schema.rs │ │ │ └── schema │ │ │ └── bitswap.v1.2.0.proto │ ├── common │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── config.rs │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ ├── message.rs │ │ │ ├── protocol.rs │ │ │ ├── protocol │ │ │ ├── event.rs │ │ │ └── role.rs │ │ │ ├── request_responses.rs │ │ │ ├── service.rs │ │ │ ├── service │ │ │ └── signature.rs │ │ │ ├── sync.rs │ │ │ ├── sync │ │ │ ├── message.rs │ │ │ ├── metrics.rs │ │ │ └── warp.rs │ │ │ └── utils.rs │ ├── light │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ ├── lib.rs │ │ │ ├── light_client_requests.rs │ │ │ ├── light_client_requests │ │ │ └── handler.rs │ │ │ ├── schema.rs │ │ │ └── schema │ │ │ └── light.v1.proto │ ├── src │ │ ├── behaviour.rs │ │ ├── config.rs │ │ ├── discovery.rs │ │ ├── lib.rs │ │ ├── network_state.rs │ │ ├── peer_info.rs │ │ ├── protocol.rs │ │ ├── protocol │ │ │ ├── message.rs │ │ │ ├── notifications.rs │ │ │ └── notifications │ │ │ │ ├── behaviour.rs │ │ │ │ ├── handler.rs │ │ │ │ ├── tests.rs │ │ │ │ ├── upgrade.rs │ │ │ │ └── upgrade │ │ │ │ ├── collec.rs │ │ │ │ └── notifications.rs │ │ ├── request_responses.rs │ │ ├── service.rs │ │ ├── service │ │ │ ├── metrics.rs │ │ │ ├── out_events.rs │ │ │ └── tests │ │ │ │ ├── chain_sync.rs │ │ │ │ ├── mod.rs │ │ │ │ └── service.rs │ │ └── transport.rs │ ├── sync │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ ├── block_request_handler.rs │ │ │ ├── blocks.rs │ │ │ ├── extra_requests.rs │ │ │ ├── lib.rs │ │ │ ├── mock.rs │ │ │ ├── schema.rs │ │ │ ├── schema │ │ │ └── api.v1.proto │ │ │ ├── service │ │ │ ├── chain_sync.rs │ │ │ ├── mock.rs │ │ │ ├── mod.rs │ │ │ └── network.rs │ │ │ ├── state.rs │ │ │ ├── state_request_handler.rs │ │ │ ├── tests.rs │ │ │ ├── warp.rs │ │ │ └── warp_request_handler.rs │ ├── test │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── block_import.rs │ │ │ ├── lib.rs │ │ │ └── sync.rs │ └── transactions │ │ ├── Cargo.toml │ │ └── src │ │ ├── config.rs │ │ └── lib.rs ├── offchain │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── api.rs │ │ ├── api │ │ ├── http.rs │ │ ├── ipfs.rs │ │ └── timestamp.rs │ │ └── lib.rs ├── peerset │ ├── Cargo.toml │ ├── README.md │ ├── src │ │ ├── lib.rs │ │ └── peersstate.rs │ └── tests │ │ └── fuzz.rs ├── proposer-metrics │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── rpc-api │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── author │ │ ├── error.rs │ │ ├── hash.rs │ │ └── mod.rs │ │ ├── chain │ │ ├── error.rs │ │ └── mod.rs │ │ ├── child_state │ │ └── mod.rs │ │ ├── dev │ │ ├── error.rs │ │ └── mod.rs │ │ ├── lib.rs │ │ ├── offchain │ │ ├── error.rs │ │ └── mod.rs │ │ ├── policy.rs │ │ ├── state │ │ ├── error.rs │ │ ├── helpers.rs │ │ └── mod.rs │ │ └── system │ │ ├── error.rs │ │ ├── helpers.rs │ │ └── mod.rs ├── rpc-servers │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── middleware.rs ├── rpc-spec-v2 │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── chain_head │ │ ├── api.rs │ │ ├── chain_head.rs │ │ ├── error.rs │ │ ├── event.rs │ │ ├── mod.rs │ │ ├── subscription.rs │ │ └── tests.rs │ │ ├── chain_spec │ │ ├── api.rs │ │ ├── chain_spec.rs │ │ ├── mod.rs │ │ └── tests.rs │ │ ├── lib.rs │ │ └── transaction │ │ ├── api.rs │ │ ├── error.rs │ │ ├── event.rs │ │ ├── mod.rs │ │ └── transaction.rs ├── rpc │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── author │ │ ├── mod.rs │ │ └── tests.rs │ │ ├── chain │ │ ├── chain_full.rs │ │ ├── mod.rs │ │ └── tests.rs │ │ ├── dev │ │ ├── mod.rs │ │ └── tests.rs │ │ ├── lib.rs │ │ ├── offchain │ │ ├── mod.rs │ │ └── tests.rs │ │ ├── state │ │ ├── mod.rs │ │ ├── state_full.rs │ │ └── tests.rs │ │ ├── system │ │ ├── mod.rs │ │ └── tests.rs │ │ └── testing.rs ├── service │ ├── Cargo.toml │ ├── README.md │ ├── src │ │ ├── builder.rs │ │ ├── chain_ops │ │ │ ├── check_block.rs │ │ │ ├── export_blocks.rs │ │ │ ├── export_raw_state.rs │ │ │ ├── import_blocks.rs │ │ │ ├── mod.rs │ │ │ └── revert_chain.rs │ │ ├── client │ │ │ ├── block_rules.rs │ │ │ ├── call_executor.rs │ │ │ ├── client.rs │ │ │ ├── genesis.rs │ │ │ ├── mod.rs │ │ │ ├── wasm_override.rs │ │ │ └── wasm_substitutes.rs │ │ ├── config.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── metrics.rs │ │ └── task_manager │ │ │ ├── mod.rs │ │ │ ├── prometheus_future.rs │ │ │ └── tests.rs │ └── test │ │ ├── Cargo.toml │ │ └── src │ │ ├── client │ │ ├── db.rs │ │ └── mod.rs │ │ └── lib.rs ├── state-db │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ ├── noncanonical.rs │ │ ├── pruning.rs │ │ └── test.rs ├── sync-state-rpc │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sysinfo │ ├── Cargo.toml │ ├── README.md │ ├── build.rs │ └── src │ │ ├── lib.rs │ │ ├── sysinfo.rs │ │ └── sysinfo_linux.rs ├── telemetry │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── endpoints.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── node.rs │ │ └── transport.rs ├── tracing │ ├── Cargo.toml │ ├── README.md │ ├── benches │ │ └── bench.rs │ ├── proc-macro │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── block │ │ └── mod.rs │ │ ├── lib.rs │ │ └── logging │ │ ├── directives.rs │ │ ├── event_format.rs │ │ ├── fast_local_time.rs │ │ ├── layers │ │ ├── mod.rs │ │ └── prefix_layer.rs │ │ ├── mod.rs │ │ └── stderr_writer.rs ├── transaction-pool │ ├── Cargo.toml │ ├── README.md │ ├── api │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── error.rs │ │ │ └── lib.rs │ ├── benches │ │ └── basics.rs │ ├── src │ │ ├── api.rs │ │ ├── enactment_state.rs │ │ ├── error.rs │ │ ├── graph │ │ │ ├── base_pool.rs │ │ │ ├── future.rs │ │ │ ├── listener.rs │ │ │ ├── mod.rs │ │ │ ├── pool.rs │ │ │ ├── ready.rs │ │ │ ├── rotator.rs │ │ │ ├── tracked_map.rs │ │ │ ├── validated_pool.rs │ │ │ └── watcher.rs │ │ ├── lib.rs │ │ ├── metrics.rs │ │ ├── revalidation.rs │ │ └── tests.rs │ └── tests │ │ └── pool.rs └── utils │ ├── Cargo.toml │ ├── README.md │ └── src │ ├── id_sequence.rs │ ├── lib.rs │ ├── metrics.rs │ ├── mpsc.rs │ ├── notification.rs │ ├── notification │ ├── registry.rs │ └── tests.rs │ ├── pubsub.rs │ ├── pubsub │ ├── tests.rs │ └── tests │ │ ├── normal_operation.rs │ │ └── panicking_registry.rs │ └── status_sinks.rs ├── docker ├── README.md ├── build.sh └── substrate_builder.Dockerfile ├── docs ├── CHANGELOG.md ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.adoc ├── IPFS.md ├── PULL_REQUEST_TEMPLATE.md ├── README.adoc ├── SECURITY.md ├── STYLE_GUIDE.md ├── Structure.adoc ├── Upgrade.md ├── Upgrading-2.0-to-3.0.md ├── media │ └── sub.gif ├── node-template-release.md └── rustdocs-release.md ├── frame ├── alliance │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── migration.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ ├── types.rs │ │ └── weights.rs ├── assets │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── extra_mutator.rs │ │ ├── functions.rs │ │ ├── impl_fungibles.rs │ │ ├── impl_stored_map.rs │ │ ├── lib.rs │ │ ├── migration.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ ├── types.rs │ │ └── weights.rs ├── atomic-swap │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── tests.rs ├── aura │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ ├── migrations.rs │ │ ├── mock.rs │ │ └── tests.rs ├── authority-discovery │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── authorship │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── babe │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── default_weights.rs │ │ ├── equivocation.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── randomness.rs │ │ └── tests.rs ├── bags-list │ ├── Cargo.toml │ ├── fuzzer │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ ├── remote-tests │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── lib.rs │ │ │ ├── migration.rs │ │ │ ├── snapshot.rs │ │ │ └── try_state.rs │ └── src │ │ ├── benchmarks.rs │ │ ├── lib.rs │ │ ├── list │ │ ├── mod.rs │ │ └── tests.rs │ │ ├── migrations.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── balances │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── migration.rs │ │ ├── tests.rs │ │ ├── tests_composite.rs │ │ ├── tests_local.rs │ │ ├── tests_reentrancy.rs │ │ └── weights.rs ├── beefy-mmr │ ├── Cargo.toml │ ├── primitives │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── beefy │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── benchmarking │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── analysis.rs │ │ ├── baseline.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ ├── tests_instance.rs │ │ ├── utils.rs │ │ └── weights.rs ├── bounties │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── migrations │ │ ├── mod.rs │ │ └── v4.rs │ │ ├── tests.rs │ │ └── weights.rs ├── child-bounties │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ └── weights.rs ├── collective │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── migrations │ │ ├── mod.rs │ │ └── v4.rs │ │ ├── tests.rs │ │ └── weights.rs ├── contracts │ ├── CHANGELOG.md │ ├── Cargo.toml │ ├── README.md │ ├── benchmarks │ │ ├── README.md │ │ ├── ink_erc20.json │ │ ├── ink_erc20.wasm │ │ ├── ink_erc20_test.wasm │ │ ├── solang_erc20.json │ │ └── solang_erc20.wasm │ ├── fixtures │ │ ├── account_reentrance_count_call.wat │ │ ├── call_return_code.wat │ │ ├── call_runtime.wat │ │ ├── call_with_limit.wat │ │ ├── caller_contract.wat │ │ ├── chain_extension.wat │ │ ├── chain_extension_temp_storage.wat │ │ ├── create_storage_and_call.wat │ │ ├── crypto_hashes.wat │ │ ├── debug_message_invalid_utf8.wat │ │ ├── debug_message_logging_disabled.wat │ │ ├── debug_message_works.wat │ │ ├── delegate_call.wat │ │ ├── delegate_call_lib.wat │ │ ├── delegate_call_simple.wat │ │ ├── destroy_and_transfer.wat │ │ ├── drain.wat │ │ ├── dummy.wat │ │ ├── ecdsa_recover.wat │ │ ├── event_and_return_on_deploy.wat │ │ ├── event_size.wat │ │ ├── float_instruction.wat │ │ ├── instantiate_return_code.wat │ │ ├── invalid_contract.wat │ │ ├── invalid_module.wat │ │ ├── multi_store.wat │ │ ├── new_set_code_hash_contract.wat │ │ ├── ok_trap_revert.wat │ │ ├── reentrance_count_call.wat │ │ ├── reentrance_count_delegated_call.wat │ │ ├── return_with_data.wat │ │ ├── run_out_of_gas.wat │ │ ├── self_destruct.wat │ │ ├── self_destructing_constructor.wat │ │ ├── set_code_hash.wat │ │ ├── set_empty_storage.wat │ │ ├── storage_size.wat │ │ ├── store.wat │ │ └── transfer_return_code.wat │ ├── primitives │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── lib.rs │ ├── proc-macro │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── benchmarking │ │ ├── code.rs │ │ ├── mod.rs │ │ └── sandbox.rs │ │ ├── chain_extension.rs │ │ ├── exec.rs │ │ ├── gas.rs │ │ ├── lib.rs │ │ ├── migration.rs │ │ ├── schedule.rs │ │ ├── storage.rs │ │ ├── storage │ │ └── meter.rs │ │ ├── tests.rs │ │ ├── wasm │ │ ├── code_cache.rs │ │ ├── mod.rs │ │ ├── prepare.rs │ │ └── runtime.rs │ │ └── weights.rs ├── conviction-voting │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── conviction.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ ├── types.rs │ │ ├── vote.rs │ │ └── weights.rs ├── democracy │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── conviction.rs │ │ ├── lib.rs │ │ ├── migrations.rs │ │ ├── tests.rs │ │ ├── tests │ │ ├── cancellation.rs │ │ ├── decoders.rs │ │ ├── delegation.rs │ │ ├── external_proposing.rs │ │ ├── fast_tracking.rs │ │ ├── lock_voting.rs │ │ ├── public_proposals.rs │ │ ├── scheduling.rs │ │ └── voting.rs │ │ ├── types.rs │ │ ├── vote.rs │ │ ├── vote_threshold.rs │ │ └── weights.rs ├── election-provider-multi-phase │ ├── Cargo.toml │ └── src │ │ ├── benchmarking.rs │ │ ├── helpers.rs │ │ ├── lib.rs │ │ ├── migrations.rs │ │ ├── mock.rs │ │ ├── signed.rs │ │ ├── unsigned.rs │ │ └── weights.rs ├── election-provider-support │ ├── Cargo.toml │ ├── benchmarking │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── solution-type │ │ ├── Cargo.toml │ │ ├── fuzzer │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── compact.rs │ │ ├── src │ │ │ ├── codec.rs │ │ │ ├── from_assignment_helpers.rs │ │ │ ├── index_assignment.rs │ │ │ ├── lib.rs │ │ │ └── single_page.rs │ │ └── tests │ │ │ └── ui │ │ │ └── fail │ │ │ ├── missing_accuracy.rs │ │ │ ├── missing_accuracy.stderr │ │ │ ├── missing_size_bound.rs │ │ │ ├── missing_size_bound.stderr │ │ │ ├── missing_target.rs │ │ │ ├── missing_target.stderr │ │ │ ├── missing_voter.rs │ │ │ ├── missing_voter.stderr │ │ │ ├── no_annotations.rs │ │ │ ├── no_annotations.stderr │ │ │ ├── swap_voter_target.rs │ │ │ ├── swap_voter_target.stderr │ │ │ ├── wrong_attribute.rs │ │ │ └── wrong_attribute.stderr │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── onchain.rs │ │ ├── tests.rs │ │ ├── traits.rs │ │ └── weights.rs ├── elections-phragmen │ ├── CHANGELOG.md │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── migrations │ │ ├── mod.rs │ │ ├── v3.rs │ │ ├── v4.rs │ │ └── v5.rs │ │ └── weights.rs ├── examples │ ├── basic │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── benchmarking.rs │ │ │ ├── lib.rs │ │ │ ├── tests.rs │ │ │ └── weights.rs │ └── offchain-worker │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ ├── lib.rs │ │ └── tests.rs ├── executive │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── fast-unstake │ ├── Cargo.toml │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── migrations.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ ├── types.rs │ │ └── weights.rs ├── grandpa │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── default_weights.rs │ │ ├── equivocation.rs │ │ ├── lib.rs │ │ ├── migrations.rs │ │ ├── migrations │ │ └── v4.rs │ │ ├── mock.rs │ │ └── tests.rs ├── identity │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ ├── types.rs │ │ └── weights.rs ├── im-online │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── indices │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── lottery │ ├── Cargo.toml │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── membership │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ ├── migrations │ │ ├── mod.rs │ │ └── v4.rs │ │ └── weights.rs ├── merkle-mountain-range │ ├── Cargo.toml │ └── src │ │ ├── benchmarking.rs │ │ ├── default_weights.rs │ │ ├── lib.rs │ │ ├── mmr │ │ ├── mmr.rs │ │ ├── mod.rs │ │ └── storage.rs │ │ ├── mock.rs │ │ └── tests.rs ├── message-queue │ ├── Cargo.toml │ └── src │ │ ├── benchmarking.rs │ │ ├── integration_test.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── mock_helpers.rs │ │ ├── tests.rs │ │ └── weights.rs ├── multisig │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── migrations.rs │ │ ├── tests.rs │ │ └── weights.rs ├── nfts │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── common_functions.rs │ │ ├── features │ │ ├── approvals.rs │ │ ├── atomic_swap.rs │ │ ├── attributes.rs │ │ ├── buy_sell.rs │ │ ├── create_delete_collection.rs │ │ ├── create_delete_item.rs │ │ ├── lock.rs │ │ ├── metadata.rs │ │ ├── mod.rs │ │ ├── roles.rs │ │ ├── settings.rs │ │ └── transfer.rs │ │ ├── impl_nonfungibles.rs │ │ ├── lib.rs │ │ ├── macros.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ ├── types.rs │ │ └── weights.rs ├── nicks │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── nis │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── node-authorization │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── nomination-pools │ ├── Cargo.toml │ ├── benchmarking │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── lib.rs │ │ │ └── mock.rs │ ├── fuzzer │ │ ├── Cargo.toml │ │ └── src │ │ │ └── call.rs │ ├── runtime-api │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── lib.rs │ ├── src │ │ ├── lib.rs │ │ ├── migration.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs │ └── test-staking │ │ ├── Cargo.toml │ │ └── src │ │ ├── lib.rs │ │ └── mock.rs ├── offences │ ├── Cargo.toml │ ├── README.md │ ├── benchmarking │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── lib.rs │ │ │ └── mock.rs │ └── src │ │ ├── lib.rs │ │ ├── migration.rs │ │ ├── mock.rs │ │ └── tests.rs ├── preimage │ ├── Cargo.toml │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── migration.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── proxy │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ └── weights.rs ├── randomness-collective-flip │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── ranked-collective │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ └── weights.rs ├── recovery │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── referenda │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── branch.rs │ │ ├── lib.rs │ │ ├── migration.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ ├── types.rs │ │ └── weights.rs ├── remark │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── root-offences │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── root-testing │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── scheduler │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── migration.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── scored-pool │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── session │ ├── Cargo.toml │ ├── README.md │ ├── benchmarking │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── lib.rs │ │ │ └── mock.rs │ └── src │ │ ├── historical │ │ ├── mod.rs │ │ ├── offchain.rs │ │ ├── onchain.rs │ │ └── shared.rs │ │ ├── lib.rs │ │ ├── migrations │ │ ├── mod.rs │ │ └── v1.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── society │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── staking │ ├── Cargo.toml │ ├── README.md │ ├── reward-curve │ │ ├── Cargo.toml │ │ ├── src │ │ │ ├── lib.rs │ │ │ └── log.rs │ │ └── tests │ │ │ └── test.rs │ ├── reward-fn │ │ ├── Cargo.toml │ │ ├── src │ │ │ └── lib.rs │ │ └── tests │ │ │ └── test.rs │ └── src │ │ ├── benchmarking.rs │ │ ├── inflation.rs │ │ ├── lib.rs │ │ ├── migrations.rs │ │ ├── mock.rs │ │ ├── pallet │ │ ├── impls.rs │ │ └── mod.rs │ │ ├── slashing.rs │ │ ├── testing_utils.rs │ │ ├── tests.rs │ │ └── weights.rs ├── state-trie-migration │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── weights.rs ├── sudo │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── extension.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── support │ ├── Cargo.toml │ ├── README.md │ ├── procedural │ │ ├── Cargo.toml │ │ ├── src │ │ │ ├── clone_no_bound.rs │ │ │ ├── construct_runtime │ │ │ │ ├── expand │ │ │ │ │ ├── call.rs │ │ │ │ │ ├── config.rs │ │ │ │ │ ├── event.rs │ │ │ │ │ ├── inherent.rs │ │ │ │ │ ├── metadata.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── origin.rs │ │ │ │ │ └── unsigned.rs │ │ │ │ ├── mod.rs │ │ │ │ └── parse.rs │ │ │ ├── crate_version.rs │ │ │ ├── debug_no_bound.rs │ │ │ ├── default_no_bound.rs │ │ │ ├── dummy_part_checker.rs │ │ │ ├── key_prefix.rs │ │ │ ├── lib.rs │ │ │ ├── match_and_insert.rs │ │ │ ├── pallet │ │ │ │ ├── expand │ │ │ │ │ ├── call.rs │ │ │ │ │ ├── config.rs │ │ │ │ │ ├── constants.rs │ │ │ │ │ ├── error.rs │ │ │ │ │ ├── event.rs │ │ │ │ │ ├── genesis_build.rs │ │ │ │ │ ├── genesis_config.rs │ │ │ │ │ ├── hooks.rs │ │ │ │ │ ├── inherent.rs │ │ │ │ │ ├── instances.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── origin.rs │ │ │ │ │ ├── pallet_struct.rs │ │ │ │ │ ├── storage.rs │ │ │ │ │ ├── store_trait.rs │ │ │ │ │ ├── tt_default_parts.rs │ │ │ │ │ ├── type_value.rs │ │ │ │ │ └── validate_unsigned.rs │ │ │ │ ├── mod.rs │ │ │ │ └── parse │ │ │ │ │ ├── call.rs │ │ │ │ │ ├── config.rs │ │ │ │ │ ├── error.rs │ │ │ │ │ ├── event.rs │ │ │ │ │ ├── extra_constants.rs │ │ │ │ │ ├── genesis_build.rs │ │ │ │ │ ├── genesis_config.rs │ │ │ │ │ ├── helper.rs │ │ │ │ │ ├── hooks.rs │ │ │ │ │ ├── inherent.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── origin.rs │ │ │ │ │ ├── pallet_struct.rs │ │ │ │ │ ├── storage.rs │ │ │ │ │ ├── type_value.rs │ │ │ │ │ └── validate_unsigned.rs │ │ │ ├── pallet_error.rs │ │ │ ├── partial_eq_no_bound.rs │ │ │ ├── storage │ │ │ │ ├── genesis_config │ │ │ │ │ ├── builder_def.rs │ │ │ │ │ ├── genesis_config_def.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── getters.rs │ │ │ │ ├── instance_trait.rs │ │ │ │ ├── metadata.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── parse.rs │ │ │ │ ├── print_pallet_upgrade.rs │ │ │ │ ├── storage_info.rs │ │ │ │ ├── storage_struct.rs │ │ │ │ └── store_trait.rs │ │ │ ├── storage_alias.rs │ │ │ ├── transactional.rs │ │ │ └── tt_macro.rs │ │ └── tools │ │ │ ├── Cargo.toml │ │ │ ├── derive │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── lib.rs │ │ │ └── src │ │ │ ├── lib.rs │ │ │ └── syn_ext.rs │ ├── src │ │ ├── crypto.rs │ │ ├── crypto │ │ │ └── ecdsa.rs │ │ ├── dispatch.rs │ │ ├── error.rs │ │ ├── event.rs │ │ ├── hash.rs │ │ ├── inherent.rs │ │ ├── instances.rs │ │ ├── lib.rs │ │ ├── migrations.rs │ │ ├── storage │ │ │ ├── bounded_btree_map.rs │ │ │ ├── bounded_btree_set.rs │ │ │ ├── bounded_vec.rs │ │ │ ├── child.rs │ │ │ ├── generator │ │ │ │ ├── double_map.rs │ │ │ │ ├── map.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── nmap.rs │ │ │ │ └── value.rs │ │ │ ├── hashed.rs │ │ │ ├── migration.rs │ │ │ ├── mod.rs │ │ │ ├── storage_noop_guard.rs │ │ │ ├── stream_iter.rs │ │ │ ├── transactional.rs │ │ │ ├── types │ │ │ │ ├── counted_map.rs │ │ │ │ ├── double_map.rs │ │ │ │ ├── key.rs │ │ │ │ ├── map.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── nmap.rs │ │ │ │ └── value.rs │ │ │ ├── unhashed.rs │ │ │ └── weak_bounded_vec.rs │ │ ├── traits.rs │ │ ├── traits │ │ │ ├── dispatch.rs │ │ │ ├── error.rs │ │ │ ├── filter.rs │ │ │ ├── hooks.rs │ │ │ ├── members.rs │ │ │ ├── messages.rs │ │ │ ├── metadata.rs │ │ │ ├── misc.rs │ │ │ ├── preimages.rs │ │ │ ├── randomness.rs │ │ │ ├── schedule.rs │ │ │ ├── storage.rs │ │ │ ├── stored_map.rs │ │ │ ├── tokens.rs │ │ │ ├── tokens │ │ │ │ ├── currency.rs │ │ │ │ ├── currency │ │ │ │ │ ├── lockable.rs │ │ │ │ │ └── reservable.rs │ │ │ │ ├── fungible.rs │ │ │ │ ├── fungible │ │ │ │ │ ├── balanced.rs │ │ │ │ │ └── imbalance.rs │ │ │ │ ├── fungibles.rs │ │ │ │ ├── fungibles │ │ │ │ │ ├── approvals.rs │ │ │ │ │ ├── balanced.rs │ │ │ │ │ ├── enumerable.rs │ │ │ │ │ ├── imbalance.rs │ │ │ │ │ ├── metadata.rs │ │ │ │ │ └── roles.rs │ │ │ │ ├── imbalance.rs │ │ │ │ ├── imbalance │ │ │ │ │ ├── on_unbalanced.rs │ │ │ │ │ ├── signed_imbalance.rs │ │ │ │ │ └── split_two_ways.rs │ │ │ │ ├── misc.rs │ │ │ │ ├── nonfungible.rs │ │ │ │ ├── nonfungible_v2.rs │ │ │ │ ├── nonfungibles.rs │ │ │ │ └── nonfungibles_v2.rs │ │ │ ├── try_runtime.rs │ │ │ ├── validation.rs │ │ │ └── voting.rs │ │ ├── weights.rs │ │ └── weights │ │ │ ├── block_weights.rs │ │ │ ├── extrinsic_weights.rs │ │ │ ├── paritydb_weights.rs │ │ │ └── rocksdb_weights.rs │ └── test │ │ ├── Cargo.toml │ │ ├── compile_pass │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ │ ├── pallet │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ │ ├── src │ │ ├── lib.rs │ │ └── pallet_version.rs │ │ └── tests │ │ ├── construct_runtime.rs │ │ ├── construct_runtime_ui.rs │ │ ├── construct_runtime_ui │ │ ├── abundant_where_param.rs │ │ ├── abundant_where_param.stderr │ │ ├── both_use_and_excluded_parts.rs │ │ ├── both_use_and_excluded_parts.stderr │ │ ├── conflicting_index.rs │ │ ├── conflicting_index.stderr │ │ ├── conflicting_index_2.rs │ │ ├── conflicting_index_2.stderr │ │ ├── conflicting_module_name.rs │ │ ├── conflicting_module_name.stderr │ │ ├── double_module_parts.rs │ │ ├── double_module_parts.stderr │ │ ├── duplicate_exclude.rs │ │ ├── duplicate_exclude.stderr │ │ ├── empty_pallet_path.rs │ │ ├── empty_pallet_path.stderr │ │ ├── exclude_missspell.rs │ │ ├── exclude_missspell.stderr │ │ ├── exclude_undefined_part.rs │ │ ├── exclude_undefined_part.stderr │ │ ├── feature_gated_system_pallet.rs │ │ ├── feature_gated_system_pallet.stderr │ │ ├── generics_in_invalid_module.rs │ │ ├── generics_in_invalid_module.stderr │ │ ├── invalid_meta_literal.rs │ │ ├── invalid_meta_literal.stderr │ │ ├── invalid_module_details.rs │ │ ├── invalid_module_details.stderr │ │ ├── invalid_module_details_keyword.rs │ │ ├── invalid_module_details_keyword.stderr │ │ ├── invalid_module_entry.rs │ │ ├── invalid_module_entry.stderr │ │ ├── invalid_token_after_module.rs │ │ ├── invalid_token_after_module.stderr │ │ ├── invalid_token_after_name.rs │ │ ├── invalid_token_after_name.stderr │ │ ├── invalid_where_param.rs │ │ ├── invalid_where_param.stderr │ │ ├── missing_event_generic_on_module_with_instance.rs │ │ ├── missing_event_generic_on_module_with_instance.stderr │ │ ├── missing_module_instance.rs │ │ ├── missing_module_instance.stderr │ │ ├── missing_origin_generic_on_module_with_instance.rs │ │ ├── missing_origin_generic_on_module_with_instance.stderr │ │ ├── missing_system_module.rs │ │ ├── missing_system_module.stderr │ │ ├── missing_where_block.rs │ │ ├── missing_where_block.stderr │ │ ├── missing_where_param.rs │ │ ├── missing_where_param.stderr │ │ ├── more_than_256_modules.rs │ │ ├── more_than_256_modules.stderr │ │ ├── no_comma_after_where.rs │ │ ├── no_comma_after_where.stderr │ │ ├── no_std_genesis_config.rs │ │ ├── no_std_genesis_config.stderr │ │ ├── old_unsupported_pallet_decl.rs │ │ ├── old_unsupported_pallet_decl.stderr │ │ ├── pallet_error_too_large.rs │ │ ├── pallet_error_too_large.stderr │ │ ├── undefined_call_part.rs │ │ ├── undefined_call_part.stderr │ │ ├── undefined_event_part.rs │ │ ├── undefined_event_part.stderr │ │ ├── undefined_genesis_config_part.rs │ │ ├── undefined_genesis_config_part.stderr │ │ ├── undefined_inherent_part.rs │ │ ├── undefined_inherent_part.stderr │ │ ├── undefined_origin_part.rs │ │ ├── undefined_origin_part.stderr │ │ ├── undefined_validate_unsigned_part.rs │ │ ├── undefined_validate_unsigned_part.stderr │ │ ├── unsupported_meta_structure.rs │ │ ├── unsupported_meta_structure.stderr │ │ ├── unsupported_pallet_attr.rs │ │ ├── unsupported_pallet_attr.stderr │ │ ├── use_undefined_part.rs │ │ └── use_undefined_part.stderr │ │ ├── decl_module_ui.rs │ │ ├── decl_module_ui │ │ ├── reserved_keyword_two_times_integrity_test.rs │ │ ├── reserved_keyword_two_times_integrity_test.stderr │ │ ├── reserved_keyword_two_times_on_initialize.rs │ │ └── reserved_keyword_two_times_on_initialize.stderr │ │ ├── decl_storage.rs │ │ ├── decl_storage_ui.rs │ │ ├── decl_storage_ui │ │ ├── config_duplicate.rs │ │ ├── config_duplicate.stderr │ │ ├── config_get_duplicate.rs │ │ ├── config_get_duplicate.stderr │ │ ├── get_duplicate.rs │ │ └── get_duplicate.stderr │ │ ├── derive_no_bound.rs │ │ ├── derive_no_bound_ui.rs │ │ ├── derive_no_bound_ui │ │ ├── clone.rs │ │ ├── clone.stderr │ │ ├── debug.rs │ │ ├── debug.stderr │ │ ├── default.rs │ │ ├── default.stderr │ │ ├── default_empty_enum.rs │ │ ├── default_empty_enum.stderr │ │ ├── default_no_attribute.rs │ │ ├── default_no_attribute.stderr │ │ ├── default_too_many_attributes.rs │ │ ├── default_too_many_attributes.stderr │ │ ├── default_union.rs │ │ ├── default_union.stderr │ │ ├── eq.rs │ │ ├── eq.stderr │ │ ├── partial_eq.rs │ │ └── partial_eq.stderr │ │ ├── final_keys.rs │ │ ├── genesisconfig.rs │ │ ├── instance.rs │ │ ├── issue2219.rs │ │ ├── origin.rs │ │ ├── pallet.rs │ │ ├── pallet_compatibility.rs │ │ ├── pallet_compatibility_instance.rs │ │ ├── pallet_instance.rs │ │ ├── pallet_ui.rs │ │ ├── pallet_ui │ │ ├── attr_non_empty.rs │ │ ├── attr_non_empty.stderr │ │ ├── call_argument_invalid_bound.rs │ │ ├── call_argument_invalid_bound.stderr │ │ ├── call_argument_invalid_bound_2.rs │ │ ├── call_argument_invalid_bound_2.stderr │ │ ├── call_argument_invalid_bound_3.rs │ │ ├── call_argument_invalid_bound_3.stderr │ │ ├── call_conflicting_indices.rs │ │ ├── call_conflicting_indices.stderr │ │ ├── call_index_has_suffix.rs │ │ ├── call_index_has_suffix.stderr │ │ ├── call_invalid_attr.rs │ │ ├── call_invalid_attr.stderr │ │ ├── call_invalid_const.rs │ │ ├── call_invalid_const.stderr │ │ ├── call_invalid_index.rs │ │ ├── call_invalid_index.stderr │ │ ├── call_invalid_origin_type.rs │ │ ├── call_invalid_origin_type.stderr │ │ ├── call_invalid_return.rs │ │ ├── call_invalid_return.stderr │ │ ├── call_invalid_vis.rs │ │ ├── call_invalid_vis.stderr │ │ ├── call_invalid_vis_2.rs │ │ ├── call_invalid_vis_2.stderr │ │ ├── call_missing_index.rs │ │ ├── call_missing_index.stderr │ │ ├── call_missing_weight.rs │ │ ├── call_missing_weight.stderr │ │ ├── call_multiple_call_index.rs │ │ ├── call_multiple_call_index.stderr │ │ ├── call_no_origin.rs │ │ ├── call_no_origin.stderr │ │ ├── call_no_return.rs │ │ ├── call_no_return.stderr │ │ ├── dev_mode_without_arg.rs │ │ ├── dev_mode_without_arg.stderr │ │ ├── dev_mode_without_arg_max_encoded_len.rs │ │ ├── dev_mode_without_arg_max_encoded_len.stderr │ │ ├── duplicate_call_attr.rs │ │ ├── duplicate_call_attr.stderr │ │ ├── duplicate_storage_prefix.rs │ │ ├── duplicate_storage_prefix.stderr │ │ ├── duplicate_store_attr.rs │ │ ├── duplicate_store_attr.stderr │ │ ├── error_does_not_derive_pallet_error.rs │ │ ├── error_does_not_derive_pallet_error.stderr │ │ ├── error_where_clause.rs │ │ ├── error_where_clause.stderr │ │ ├── error_wrong_item.rs │ │ ├── error_wrong_item.stderr │ │ ├── error_wrong_item_name.rs │ │ ├── error_wrong_item_name.stderr │ │ ├── event_field_not_member.rs │ │ ├── event_field_not_member.stderr │ │ ├── event_not_in_trait.rs │ │ ├── event_not_in_trait.stderr │ │ ├── event_type_invalid_bound.rs │ │ ├── event_type_invalid_bound.stderr │ │ ├── event_type_invalid_bound_2.rs │ │ ├── event_type_invalid_bound_2.stderr │ │ ├── event_wrong_item.rs │ │ ├── event_wrong_item.stderr │ │ ├── event_wrong_item_name.rs │ │ ├── event_wrong_item_name.stderr │ │ ├── genesis_default_not_satisfied.rs │ │ ├── genesis_default_not_satisfied.stderr │ │ ├── genesis_inconsistent_build_config.rs │ │ ├── genesis_inconsistent_build_config.stderr │ │ ├── genesis_invalid_generic.rs │ │ ├── genesis_invalid_generic.stderr │ │ ├── genesis_wrong_name.rs │ │ ├── genesis_wrong_name.stderr │ │ ├── hooks_invalid_item.rs │ │ ├── hooks_invalid_item.stderr │ │ ├── inconsistent_instance_1.rs │ │ ├── inconsistent_instance_1.stderr │ │ ├── inconsistent_instance_2.rs │ │ ├── inconsistent_instance_2.stderr │ │ ├── inherent_check_inner_span.rs │ │ ├── inherent_check_inner_span.stderr │ │ ├── inherent_invalid_item.rs │ │ ├── inherent_invalid_item.stderr │ │ ├── mod_not_inlined.rs │ │ ├── mod_not_inlined.stderr │ │ ├── pallet_invalid_arg.rs │ │ ├── pallet_invalid_arg.stderr │ │ ├── pass │ │ │ ├── dev_mode_valid.rs │ │ │ ├── error_nested_types.rs │ │ │ └── trait_constant_valid_bounds.rs │ │ ├── storage_ensure_span_are_ok_on_wrong_gen.rs │ │ ├── storage_ensure_span_are_ok_on_wrong_gen.stderr │ │ ├── storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs │ │ ├── storage_ensure_span_are_ok_on_wrong_gen_unnamed.stderr │ │ ├── storage_incomplete_item.rs │ │ ├── storage_incomplete_item.stderr │ │ ├── storage_info_unsatisfied.rs │ │ ├── storage_info_unsatisfied.stderr │ │ ├── storage_info_unsatisfied_nmap.rs │ │ ├── storage_info_unsatisfied_nmap.stderr │ │ ├── storage_invalid_attribute.rs │ │ ├── storage_invalid_attribute.stderr │ │ ├── storage_invalid_first_generic.rs │ │ ├── storage_invalid_first_generic.stderr │ │ ├── storage_invalid_rename_value.rs │ │ ├── storage_invalid_rename_value.stderr │ │ ├── storage_multiple_getters.rs │ │ ├── storage_multiple_getters.stderr │ │ ├── storage_multiple_renames.rs │ │ ├── storage_multiple_renames.stderr │ │ ├── storage_not_storage_type.rs │ │ ├── storage_not_storage_type.stderr │ │ ├── storage_result_query_missing_generics.rs │ │ ├── storage_result_query_missing_generics.stderr │ │ ├── storage_result_query_multiple_type_args.rs │ │ ├── storage_result_query_multiple_type_args.stderr │ │ ├── storage_result_query_no_defined_pallet_error.rs │ │ ├── storage_result_query_no_defined_pallet_error.stderr │ │ ├── storage_result_query_parenthesized_generics.rs │ │ ├── storage_result_query_parenthesized_generics.stderr │ │ ├── storage_result_query_wrong_generic_kind.rs │ │ ├── storage_result_query_wrong_generic_kind.stderr │ │ ├── storage_value_duplicate_named_generic.rs │ │ ├── storage_value_duplicate_named_generic.stderr │ │ ├── storage_value_generic_named_and_unnamed.rs │ │ ├── storage_value_generic_named_and_unnamed.stderr │ │ ├── storage_value_no_generic.rs │ │ ├── storage_value_no_generic.stderr │ │ ├── storage_value_unexpected_named_generic.rs │ │ ├── storage_value_unexpected_named_generic.stderr │ │ ├── storage_wrong_item.rs │ │ ├── storage_wrong_item.stderr │ │ ├── store_trait_leak_private.rs │ │ ├── store_trait_leak_private.stderr │ │ ├── trait_constant_invalid_bound.rs │ │ ├── trait_constant_invalid_bound.stderr │ │ ├── trait_constant_invalid_bound_lifetime.rs │ │ ├── trait_constant_invalid_bound_lifetime.stderr │ │ ├── trait_invalid_item.rs │ │ ├── trait_invalid_item.stderr │ │ ├── trait_no_supertrait.rs │ │ ├── trait_no_supertrait.stderr │ │ ├── type_value_error_in_block.rs │ │ ├── type_value_error_in_block.stderr │ │ ├── type_value_forgotten_where_clause.rs │ │ ├── type_value_forgotten_where_clause.stderr │ │ ├── type_value_invalid_item.rs │ │ ├── type_value_invalid_item.stderr │ │ ├── type_value_no_return.rs │ │ ├── type_value_no_return.stderr │ │ ├── weight_argument_has_suffix.rs │ │ └── weight_argument_has_suffix.stderr │ │ ├── pallet_with_name_trait_is_valid.rs │ │ ├── storage_alias_ui.rs │ │ ├── storage_alias_ui │ │ ├── checks_for_valid_storage_type.rs │ │ ├── checks_for_valid_storage_type.stderr │ │ ├── forbid_underscore_as_prefix.rs │ │ ├── forbid_underscore_as_prefix.stderr │ │ ├── prefix_must_be_an_ident.rs │ │ └── prefix_must_be_an_ident.stderr │ │ ├── storage_layers.rs │ │ ├── storage_transaction.rs │ │ └── system.rs ├── system │ ├── Cargo.toml │ ├── README.md │ ├── benches │ │ └── bench.rs │ ├── benchmarking │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── lib.rs │ │ │ └── mock.rs │ ├── rpc │ │ └── runtime-api │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── extensions │ │ ├── check_genesis.rs │ │ ├── check_mortality.rs │ │ ├── check_non_zero_sender.rs │ │ ├── check_nonce.rs │ │ ├── check_spec_version.rs │ │ ├── check_tx_version.rs │ │ ├── check_weight.rs │ │ └── mod.rs │ │ ├── lib.rs │ │ ├── limits.rs │ │ ├── migrations │ │ └── mod.rs │ │ ├── mock.rs │ │ ├── mocking.rs │ │ ├── offchain.rs │ │ ├── tests.rs │ │ └── weights.rs ├── tds-ipfs-core │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── storage.rs │ │ ├── tests.rs │ │ └── types.rs ├── tds-ipfs │ ├── Cargo.toml │ ├── README.md │ ├── rpc │ │ ├── Cargo.toml │ │ ├── runtime-api │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── timestamp │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── tips │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── migrations │ │ ├── mod.rs │ │ └── v4.rs │ │ ├── tests.rs │ │ └── weights.rs ├── transaction-payment │ ├── Cargo.toml │ ├── README.md │ ├── asset-tx-payment │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── lib.rs │ │ │ ├── payment.rs │ │ │ └── tests.rs │ ├── rpc │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── runtime-api │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── lib.rs │ │ ├── payment.rs │ │ └── types.rs ├── transaction-storage │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── treasury │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ └── weights.rs ├── try-runtime │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── uniques │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── functions.rs │ │ ├── impl_nonfungibles.rs │ │ ├── lib.rs │ │ ├── migration.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ ├── types.rs │ │ └── weights.rs ├── utility │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ └── weights.rs ├── vesting │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── migrations.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ ├── vesting_info.rs │ │ └── weights.rs └── whitelist │ ├── Cargo.toml │ └── src │ ├── benchmarking.rs │ ├── lib.rs │ ├── mock.rs │ ├── tests.rs │ └── weights.rs ├── primitives ├── api │ ├── Cargo.toml │ ├── README.md │ ├── proc-macro │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── common.rs │ │ │ ├── decl_runtime_apis.rs │ │ │ ├── impl_runtime_apis.rs │ │ │ ├── lib.rs │ │ │ ├── mock_impl_runtime_apis.rs │ │ │ └── utils.rs │ ├── src │ │ └── lib.rs │ └── test │ │ ├── Cargo.toml │ │ ├── benches │ │ └── bench.rs │ │ └── tests │ │ ├── decl_and_impl.rs │ │ ├── runtime_calls.rs │ │ ├── trybuild.rs │ │ └── ui │ │ ├── adding_self_parameter.rs │ │ ├── adding_self_parameter.stderr │ │ ├── changed_in_no_default_method.rs │ │ ├── changed_in_no_default_method.stderr │ │ ├── changed_in_unknown_version.rs │ │ ├── changed_in_unknown_version.stderr │ │ ├── declaring_old_block.rs │ │ ├── declaring_old_block.stderr │ │ ├── declaring_own_block_with_different_name.rs │ │ ├── declaring_own_block_with_different_name.stderr │ │ ├── empty_impl_runtime_apis_call.rs │ │ ├── empty_impl_runtime_apis_call.stderr │ │ ├── impl_incorrect_method_signature.rs │ │ ├── impl_incorrect_method_signature.stderr │ │ ├── impl_missing_version.rs │ │ ├── impl_missing_version.stderr │ │ ├── impl_two_traits_with_same_name.rs │ │ ├── impl_two_traits_with_same_name.stderr │ │ ├── invalid_api_version_1.rs │ │ ├── invalid_api_version_1.stderr │ │ ├── invalid_api_version_2.rs │ │ ├── invalid_api_version_2.stderr │ │ ├── invalid_api_version_3.rs │ │ ├── invalid_api_version_3.stderr │ │ ├── invalid_api_version_4.rs │ │ ├── invalid_api_version_4.stderr │ │ ├── method_ver_lower_than_trait_ver.rs │ │ ├── method_ver_lower_than_trait_ver.stderr │ │ ├── missing_block_generic_parameter.rs │ │ ├── missing_block_generic_parameter.stderr │ │ ├── missing_path_for_trait.rs │ │ ├── missing_path_for_trait.stderr │ │ ├── missing_versioned_method.rs │ │ ├── missing_versioned_method.stderr │ │ ├── missing_versioned_method_multiple_vers.rs │ │ ├── missing_versioned_method_multiple_vers.stderr │ │ ├── mock_advanced_block_id_by_value.rs │ │ ├── mock_advanced_block_id_by_value.stderr │ │ ├── mock_advanced_missing_blockid.rs │ │ ├── mock_advanced_missing_blockid.stderr │ │ ├── mock_only_one_block_type.rs │ │ ├── mock_only_one_block_type.stderr │ │ ├── mock_only_one_self_type.rs │ │ ├── mock_only_one_self_type.stderr │ │ ├── mock_only_self_reference.rs │ │ ├── mock_only_self_reference.stderr │ │ ├── no_default_implementation.rs │ │ ├── no_default_implementation.stderr │ │ ├── positive_cases │ │ └── default_impls.rs │ │ ├── type_reference_in_impl_runtime_apis_call.rs │ │ └── type_reference_in_impl_runtime_apis_call.stderr ├── application-crypto │ ├── Cargo.toml │ ├── README.md │ ├── src │ │ ├── ecdsa.rs │ │ ├── ed25519.rs │ │ ├── lib.rs │ │ ├── sr25519.rs │ │ └── traits.rs │ └── test │ │ ├── Cargo.toml │ │ └── src │ │ ├── ecdsa.rs │ │ ├── ed25519.rs │ │ ├── lib.rs │ │ └── sr25519.rs ├── arithmetic │ ├── Cargo.toml │ ├── README.md │ ├── benches │ │ └── bench.rs │ ├── fuzzer │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── biguint.rs │ │ │ ├── fixed_point.rs │ │ │ ├── multiply_by_rational_with_rounding.rs │ │ │ ├── normalize.rs │ │ │ └── per_thing_rational.rs │ └── src │ │ ├── biguint.rs │ │ ├── fixed_point.rs │ │ ├── helpers_128bit.rs │ │ ├── lib.rs │ │ ├── per_things.rs │ │ ├── rational.rs │ │ └── traits.rs ├── authority-discovery │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── authorship │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── beefy │ ├── Cargo.toml │ ├── src │ │ ├── commitment.rs │ │ ├── lib.rs │ │ ├── mmr.rs │ │ ├── payload.rs │ │ └── witness.rs │ └── test-res │ │ └── large-raw-commitment ├── block-builder │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── blockchain │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── backend.rs │ │ ├── error.rs │ │ ├── header_metadata.rs │ │ └── lib.rs ├── consensus │ ├── aura │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── digests.rs │ │ │ ├── inherents.rs │ │ │ └── lib.rs │ ├── babe │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── digests.rs │ │ │ ├── inherents.rs │ │ │ └── lib.rs │ ├── common │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── block_validation.rs │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ └── select_chain.rs │ ├── pow │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── lib.rs │ ├── slots │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── lib.rs │ └── vrf │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ ├── lib.rs │ │ └── schnorrkel.rs ├── core │ ├── Cargo.toml │ ├── benches │ │ └── bench.rs │ ├── hashing │ │ ├── Cargo.toml │ │ ├── proc-macro │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── impls.rs │ │ │ │ └── lib.rs │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── bounded.rs │ │ ├── bounded │ │ ├── bounded_btree_map.rs │ │ ├── bounded_btree_set.rs │ │ ├── bounded_vec.rs │ │ └── weak_bounded_vec.rs │ │ ├── crypto.rs │ │ ├── defer.rs │ │ ├── ecdsa.rs │ │ ├── ed25519.rs │ │ ├── hash.rs │ │ ├── hasher.rs │ │ ├── hashing.rs │ │ ├── hexdisplay.rs │ │ ├── lib.rs │ │ ├── offchain │ │ ├── mod.rs │ │ ├── storage.rs │ │ └── testing.rs │ │ ├── sr25519.rs │ │ ├── testing.rs │ │ ├── traits.rs │ │ └── uint.rs ├── database │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── error.rs │ │ ├── kvdb.rs │ │ ├── lib.rs │ │ └── mem.rs ├── debug-derive │ ├── Cargo.toml │ ├── src │ │ ├── impls.rs │ │ └── lib.rs │ └── tests │ │ └── tests.rs ├── externalities │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── extensions.rs │ │ ├── lib.rs │ │ └── scope_limited.rs ├── finality-grandpa │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── inherents │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── client_side.rs │ │ └── lib.rs ├── io │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── batch_verifier.rs │ │ └── lib.rs ├── keyring │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── ed25519.rs │ │ ├── lib.rs │ │ └── sr25519.rs ├── keystore │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── testing.rs │ │ └── vrf.rs ├── maybe-compressed-blob │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── merkle-mountain-range │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── utils.rs ├── npos-elections │ ├── Cargo.toml │ ├── README.md │ ├── fuzzer │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── common.rs │ │ │ ├── phragmen_balancing.rs │ │ │ ├── phragmen_pjr.rs │ │ │ ├── phragmms_balancing.rs │ │ │ └── reduce.rs │ └── src │ │ ├── assignments.rs │ │ ├── balancing.rs │ │ ├── helpers.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── node.rs │ │ ├── phragmen.rs │ │ ├── phragmms.rs │ │ ├── pjr.rs │ │ ├── reduce.rs │ │ ├── tests.rs │ │ └── traits.rs ├── offchain │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── panic-handler │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── rpc │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ ├── list.rs │ │ ├── number.rs │ │ └── tracing.rs ├── runtime-interface │ ├── Cargo.toml │ ├── README.md │ ├── proc-macro │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── lib.rs │ │ │ ├── pass_by │ │ │ ├── codec.rs │ │ │ ├── enum_.rs │ │ │ ├── inner.rs │ │ │ └── mod.rs │ │ │ ├── runtime_interface │ │ │ ├── bare_function_interface.rs │ │ │ ├── host_function_interface.rs │ │ │ ├── mod.rs │ │ │ └── trait_decl_impl.rs │ │ │ └── utils.rs │ ├── src │ │ ├── host.rs │ │ ├── impls.rs │ │ ├── lib.rs │ │ ├── pass_by.rs │ │ ├── util.rs │ │ └── wasm.rs │ ├── test-wasm-deprecated │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ └── lib.rs │ ├── test-wasm │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ └── lib.rs │ ├── test │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── tests │ │ ├── ui.rs │ │ └── ui │ │ ├── no_duplicate_versions.rs │ │ ├── no_duplicate_versions.stderr │ │ ├── no_gaps_in_versions.rs │ │ ├── no_gaps_in_versions.stderr │ │ ├── no_generic_parameters_method.rs │ │ ├── no_generic_parameters_method.stderr │ │ ├── no_generic_parameters_trait.rs │ │ ├── no_generic_parameters_trait.stderr │ │ ├── no_method_implementation.rs │ │ ├── no_method_implementation.stderr │ │ ├── pass_by_enum_with_struct.rs │ │ ├── pass_by_enum_with_struct.stderr │ │ ├── pass_by_enum_with_value_variant.rs │ │ ├── pass_by_enum_with_value_variant.stderr │ │ ├── pass_by_inner_with_two_fields.rs │ │ ├── pass_by_inner_with_two_fields.stderr │ │ ├── take_self_by_value.rs │ │ └── take_self_by_value.stderr ├── runtime │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── curve.rs │ │ ├── generic │ │ ├── block.rs │ │ ├── checked_extrinsic.rs │ │ ├── digest.rs │ │ ├── era.rs │ │ ├── header.rs │ │ ├── mod.rs │ │ ├── tests.rs │ │ └── unchecked_extrinsic.rs │ │ ├── legacy.rs │ │ ├── legacy │ │ └── byte_sized_error.rs │ │ ├── lib.rs │ │ ├── multiaddress.rs │ │ ├── offchain │ │ ├── http.rs │ │ ├── ipfs.rs │ │ ├── mod.rs │ │ ├── storage.rs │ │ └── storage_lock.rs │ │ ├── runtime_logger.rs │ │ ├── runtime_string.rs │ │ ├── testing.rs │ │ ├── traits.rs │ │ └── transaction_validity.rs ├── serializer │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── session │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── staking │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── offence.rs ├── state-machine │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── backend.rs │ │ ├── basic.rs │ │ ├── error.rs │ │ ├── ext.rs │ │ ├── in_memory_backend.rs │ │ ├── lib.rs │ │ ├── overlayed_changes │ │ ├── changeset.rs │ │ ├── mod.rs │ │ └── offchain.rs │ │ ├── read_only.rs │ │ ├── stats.rs │ │ ├── testing.rs │ │ ├── trie_backend.rs │ │ └── trie_backend_essence.rs ├── std │ ├── Cargo.toml │ ├── README.md │ ├── src │ │ └── lib.rs │ ├── with_std.rs │ └── without_std.rs ├── storage │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── test-primitives │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── timestamp │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── tracing │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── types.rs ├── transaction-pool │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── runtime_api.rs ├── transaction-storage-proof │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── trie │ ├── Cargo.toml │ ├── README.md │ ├── benches │ │ └── bench.rs │ ├── src │ │ ├── cache │ │ │ ├── mod.rs │ │ │ └── shared_cache.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── node_codec.rs │ │ ├── node_header.rs │ │ ├── recorder.rs │ │ ├── storage_proof.rs │ │ ├── trie_codec.rs │ │ └── trie_stream.rs │ └── test-res │ │ ├── invalid-delta-order │ │ ├── proof │ │ ├── storage_root │ │ └── valid-delta-order ├── version │ ├── Cargo.toml │ ├── README.md │ ├── proc-macro │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── decl_runtime_version.rs │ │ │ └── lib.rs │ └── src │ │ ├── embed.rs │ │ └── lib.rs ├── wasm-interface │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── wasmi_impl.rs └── weights │ ├── Cargo.toml │ └── src │ ├── lib.rs │ ├── weight_meter.rs │ └── weight_v2.rs ├── rustfmt.toml ├── scripts ├── ci │ ├── common │ │ └── lib.sh │ ├── deny.toml │ ├── docker │ │ ├── subkey.Dockerfile │ │ └── substrate.Dockerfile │ ├── github │ │ ├── check_labels.sh │ │ └── generate_changelog.sh │ ├── gitlab │ │ ├── check-each-crate.sh │ │ ├── check_runtime.sh │ │ ├── check_signed.sh │ │ ├── crate-publishing-pipeline.yml │ │ ├── default-pipeline.yml │ │ ├── ensure-deps.sh │ │ ├── pipeline │ │ │ ├── build.yml │ │ │ ├── check.yml │ │ │ ├── publish.yml │ │ │ ├── test.yml │ │ │ └── zombienet.yml │ │ ├── publish_draft_release.sh │ │ └── skip_if_draft.sh │ ├── monitoring │ │ ├── alerting-rules │ │ │ ├── alerting-rule-tests.yaml │ │ │ └── alerting-rules.yaml │ │ └── grafana-dashboards │ │ │ ├── README_dashboard.md │ │ │ ├── substrate-networking.json │ │ │ └── substrate-service-tasks.json │ ├── node-template-release.sh │ └── node-template-release │ │ ├── Cargo.toml │ │ └── src │ │ └── main.rs └── run_all_benchmarks.sh ├── test-utils ├── Cargo.toml ├── client │ ├── Cargo.toml │ └── src │ │ ├── client_ext.rs │ │ └── lib.rs ├── derive │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── runtime │ ├── Cargo.toml │ ├── build.rs │ ├── client │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── block_builder_ext.rs │ │ │ ├── lib.rs │ │ │ └── trait_tests.rs │ ├── src │ │ ├── genesismap.rs │ │ ├── lib.rs │ │ └── system.rs │ └── transaction-pool │ │ ├── Cargo.toml │ │ └── src │ │ └── lib.rs ├── src │ └── lib.rs ├── test-crate │ ├── Cargo.toml │ └── src │ │ └── main.rs └── tests │ ├── basic.rs │ ├── ui.rs │ └── ui │ ├── too-many-func-parameters.rs │ └── too-many-func-parameters.stderr ├── utils ├── build-script-utils │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── git.rs │ │ ├── lib.rs │ │ └── version.rs ├── fork-tree │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── frame │ ├── benchmarking-cli │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── src │ │ │ ├── block │ │ │ ├── README.md │ │ │ ├── bench.rs │ │ │ ├── cmd.rs │ │ │ └── mod.rs │ │ │ ├── extrinsic │ │ │ ├── bench.rs │ │ │ ├── cmd.rs │ │ │ ├── extrinsic_factory.rs │ │ │ └── mod.rs │ │ │ ├── lib.rs │ │ │ ├── machine │ │ │ ├── README.md │ │ │ ├── hardware.rs │ │ │ ├── mod.rs │ │ │ └── reference_hardware.json │ │ │ ├── overhead │ │ │ ├── README.md │ │ │ ├── cmd.rs │ │ │ ├── mod.rs │ │ │ ├── template.rs │ │ │ └── weights.hbs │ │ │ ├── pallet │ │ │ ├── README.md │ │ │ ├── command.rs │ │ │ ├── mod.rs │ │ │ ├── template.hbs │ │ │ └── writer.rs │ │ │ ├── shared │ │ │ ├── README.md │ │ │ ├── mod.rs │ │ │ ├── record.rs │ │ │ ├── stats.rs │ │ │ └── weight_params.rs │ │ │ └── storage │ │ │ ├── README.md │ │ │ ├── cmd.rs │ │ │ ├── mod.rs │ │ │ ├── read.rs │ │ │ ├── template.rs │ │ │ ├── weights.hbs │ │ │ └── write.rs │ ├── frame-utilities-cli │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── lib.rs │ │ │ └── pallet_id.rs │ ├── generate-bags │ │ ├── Cargo.toml │ │ ├── node-runtime │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ └── src │ │ │ └── lib.rs │ ├── remote-externalities │ │ ├── Cargo.toml │ │ ├── src │ │ │ └── lib.rs │ │ └── test_data │ │ │ └── proxy_test │ ├── rpc │ │ ├── client │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── lib.rs │ │ ├── state-trie-migration-rpc │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ │ └── lib.rs │ │ ├── support │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── system │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ └── lib.rs │ └── try-runtime │ │ └── cli │ │ ├── Cargo.toml │ │ └── src │ │ ├── commands │ │ ├── create_snapshot.rs │ │ ├── execute_block.rs │ │ ├── follow_chain.rs │ │ ├── mod.rs │ │ ├── offchain_worker.rs │ │ └── on_runtime_upgrade.rs │ │ ├── lib.rs │ │ └── parse.rs ├── prometheus │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── sourced.rs ├── rust-ipfs │ ├── .cargo-ok │ ├── CHANGELOG.md │ ├── CODE_OF_CONDUCT.md │ ├── CONTRIBUTING.md │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── archived │ │ ├── CONTRIBUTING.md │ │ ├── README.md │ │ ├── benches │ │ │ └── hashed-map-cid.rs │ │ ├── conformance │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── patches │ │ │ │ ├── add.patch │ │ │ │ ├── await_subprocess.patch │ │ │ │ ├── bootstrap.patch │ │ │ │ └── find_provs.patch │ │ │ ├── rust.sh │ │ │ ├── setup.sh │ │ │ └── test │ │ │ │ └── index.js │ │ └── http │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ ├── build.rs │ │ │ └── src │ │ │ ├── config.rs │ │ │ ├── keys.proto │ │ │ ├── lib.rs │ │ │ ├── main.rs │ │ │ ├── v0.rs │ │ │ └── v0 │ │ │ ├── bitswap.rs │ │ │ ├── block.rs │ │ │ ├── block │ │ │ └── options.rs │ │ │ ├── bootstrap.rs │ │ │ ├── dag.rs │ │ │ ├── dht.rs │ │ │ ├── id.rs │ │ │ ├── ipns.rs │ │ │ ├── pin.rs │ │ │ ├── pin │ │ │ └── add.rs │ │ │ ├── pubsub.rs │ │ │ ├── refs.rs │ │ │ ├── refs │ │ │ ├── format.rs │ │ │ └── options.rs │ │ │ ├── root_files.rs │ │ │ ├── root_files │ │ │ ├── add.rs │ │ │ └── tar_helper.rs │ │ │ ├── support.rs │ │ │ ├── support │ │ │ ├── body.rs │ │ │ ├── option_parsing.rs │ │ │ ├── serdesupport.rs │ │ │ ├── stream.rs │ │ │ └── timeout.rs │ │ │ ├── swarm.rs │ │ │ └── version.rs │ ├── bitswap │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ ├── behaviour.rs │ │ │ ├── bitswap_pb.proto │ │ │ ├── block.rs │ │ │ ├── error.rs │ │ │ ├── ledger.rs │ │ │ ├── lib.rs │ │ │ ├── prefix.rs │ │ │ └── protocol.rs │ ├── build.rs │ ├── examples │ │ ├── dag_creation.rs │ │ ├── fetch_and_cat.rs │ │ ├── local-node.rs │ │ ├── pubsub.rs │ │ ├── swarm_events.rs │ │ ├── unixfs-add.rs │ │ ├── unixfs-cat-readme.rs │ │ └── unixfs_get.rs │ ├── src │ │ ├── config.rs │ │ ├── dag.rs │ │ ├── error.rs │ │ ├── ipns │ │ │ ├── dnslink.rs │ │ │ ├── ipns_pb.proto │ │ │ └── mod.rs │ │ ├── lib.rs │ │ ├── p2p │ │ │ ├── addr.rs │ │ │ ├── behaviour.rs │ │ │ ├── gossipsub.rs │ │ │ ├── mod.rs │ │ │ ├── stream.rs │ │ │ ├── swarm.rs │ │ │ └── transport.rs │ │ ├── path.rs │ │ ├── refs.rs │ │ ├── repo │ │ │ ├── common_tests.rs │ │ │ ├── fs.rs │ │ │ ├── fs │ │ │ │ ├── blocks.rs │ │ │ │ ├── paths.rs │ │ │ │ └── pinstore.rs │ │ │ ├── kv.rs │ │ │ ├── mem.rs │ │ │ └── mod.rs │ │ ├── subscription.rs │ │ ├── task.rs │ │ └── unixfs │ │ │ ├── add.rs │ │ │ ├── cat.rs │ │ │ ├── get.rs │ │ │ └── mod.rs │ ├── tests │ │ ├── bitswap.rs │ │ ├── block_exchange.rs │ │ ├── common │ │ │ ├── interop.rs │ │ │ └── mod.rs │ │ ├── common_tests.rs │ │ ├── connectivity.rs │ │ ├── kademlia.rs │ │ ├── listening_addresses.rs │ │ ├── pubsub.rs │ │ └── wantlist_and_cancellation.rs │ └── unixfs │ │ ├── CHANGELOG.md │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── benches │ │ ├── adder.rs │ │ └── ingest-tar.rs │ │ ├── examples │ │ ├── add.rs │ │ ├── cat.rs │ │ ├── get.rs │ │ └── resolve.rs │ │ ├── pb-rs-gen.sh │ │ └── src │ │ ├── config │ │ └── mod.rs │ │ ├── dagpb.rs │ │ ├── dir.rs │ │ ├── dir │ │ ├── builder.rs │ │ ├── builder │ │ │ ├── buffered.rs │ │ │ ├── custom_pb.rs │ │ │ ├── dir_builder.rs │ │ │ └── iter.rs │ │ ├── directory.rs │ │ └── sharded_lookup.rs │ │ ├── file.rs │ │ ├── file │ │ ├── adder.rs │ │ ├── reader.rs │ │ └── visit.rs │ │ ├── lib.rs │ │ ├── pb.rs │ │ ├── pb │ │ ├── merkledag.proto │ │ ├── merkledag.rs │ │ ├── unixfs.proto │ │ └── unixfs.rs │ │ ├── symlink.rs │ │ ├── test_support.rs │ │ └── walk.rs └── wasm-builder │ ├── Cargo.toml │ ├── README.md │ └── src │ ├── builder.rs │ ├── lib.rs │ ├── prerequisites.rs │ └── wasm_project.rs └── zombienet ├── 0000-block-building ├── block-building.toml ├── block-building.zndsl └── transaction-gets-finalized.js └── 0001-basic-warp-sync ├── README.md ├── chain-spec.json ├── generate-warp-sync-database.toml ├── test-warp-sync.toml └── test-warp-sync.zndsl /.dockerignore: -------------------------------------------------------------------------------- 1 | doc 2 | **target* 3 | .idea/ 4 | Dockerfile 5 | .dockerignore 6 | .local 7 | .env* 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | [*] 3 | indent_style=tab 4 | indent_size=tab 5 | tab_width=4 6 | end_of_line=lf 7 | charset=utf-8 8 | trim_trailing_whitespace=true 9 | max_line_length=100 10 | insert_final_newline=true 11 | 12 | [*.md] 13 | max_line_length=80 14 | indent_style=space 15 | indent_size=2 16 | 17 | [*.yml] 18 | indent_style=space 19 | indent_size=2 20 | tab_width=8 21 | end_of_line=lf 22 | 23 | [*.sh] 24 | indent_style=space 25 | indent_size=2 26 | tab_width=8 27 | end_of_line=lf 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/target/ 2 | **/*.rs.bk 3 | *.swp 4 | .wasm-binaries 5 | pwasm-alloc/target/ 6 | pwasm-libc/target/ 7 | pwasm-alloc/Cargo.lock 8 | pwasm-libc/Cargo.lock 9 | bin/node/runtime/wasm/target/ 10 | **/._* 11 | **/.criterion/ 12 | .vscode 13 | polkadot.* 14 | .DS_Store 15 | .idea/ 16 | nohup.out 17 | rls*.log 18 | *.orig 19 | *.rej 20 | **/wip/*.stderr 21 | .local 22 | **/hfuzz_target/ 23 | **/hfuzz_workspace/ 24 | .cargo-remote.toml 25 | *.bin 26 | *.iml 27 | scripts/ci/node-template-release/Cargo.lock 28 | start-frontend.sh 29 | start-node.sh 30 | start-all.sh 31 | old-extrinsics.rs.backup 32 | # default storing folder for the IPFS node ### 33 | /blockstore 34 | -------------------------------------------------------------------------------- /.maintain/getgoing.sh: -------------------------------------------------------------------------------- 1 | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2 | brew install openssl cmake 3 | curl https://sh.rustup.rs -sSf | sh 4 | source ~/.cargo/env 5 | cargo install --git https://github.com/paritytech/substrate subkey 6 | cargo install --git https://github.com/paritytech/substrate substrate 7 | -------------------------------------------------------------------------------- /.maintain/init.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | echo "*** Initializing WASM build environment" 6 | 7 | if [ -z $CI_PROJECT_NAME ] ; then 8 | rustup update nightly 9 | rustup update stable 10 | fi 11 | 12 | rustup target add wasm32-unknown-unknown --toolchain nightly 13 | -------------------------------------------------------------------------------- /.maintain/local-docker-test-network/grafana/provisioning/dashboards/dashboards.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | providers: 4 | - name: 'Prometheus' 5 | orgId: 1 6 | folder: '' 7 | type: file 8 | disableDeletion: false 9 | editable: false 10 | options: 11 | path: /etc/grafana/provisioning/dashboard-definitions 12 | -------------------------------------------------------------------------------- /.maintain/local-docker-test-network/prometheus/prometheus.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s 3 | 4 | scrape_configs: 5 | - job_name: 'substrate-nodes' 6 | static_configs: 7 | - targets: ['validator-a:9615'] 8 | labels: 9 | network: dev 10 | - targets: ['validator-b:9615'] 11 | labels: 12 | network: dev 13 | - targets: ['light-c:9615'] 14 | labels: 15 | network: dev 16 | -------------------------------------------------------------------------------- /.maintain/update-deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -- 2 | set -eu 3 | case $0 in 4 | (/*) dir=${0%/*}/;; 5 | (*/*) dir=./${0%/*};; 6 | (*) dir=.;; 7 | esac 8 | 9 | find "$dir/.." -name Cargo.lock -execdir cargo update \; 10 | -------------------------------------------------------------------------------- /bin/node-template/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style=space 5 | indent_size=2 6 | tab_width=2 7 | end_of_line=lf 8 | charset=utf-8 9 | trim_trailing_whitespace=true 10 | insert_final_newline = true 11 | 12 | [*.{rs,toml}] 13 | indent_style=tab 14 | indent_size=tab 15 | tab_width=4 16 | max_line_length=100 17 | -------------------------------------------------------------------------------- /bin/node-template/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.2" 2 | 3 | services: 4 | dev: 5 | container_name: node-template 6 | image: paritytech/ci-linux:production 7 | working_dir: /var/www/node-template 8 | ports: 9 | - "9944:9944" 10 | environment: 11 | - CARGO_HOME=/var/www/node-template/.cargo 12 | volumes: 13 | - .:/var/www/node-template 14 | - type: bind 15 | source: ./.local 16 | target: /root/.local 17 | command: bash -c "cargo build --release && ./target/release/node-template --dev --ws-external" 18 | -------------------------------------------------------------------------------- /bin/node-template/node/build.rs: -------------------------------------------------------------------------------- 1 | use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed}; 2 | 3 | fn main() { 4 | generate_cargo_keys(); 5 | 6 | rerun_if_git_head_changed(); 7 | } 8 | -------------------------------------------------------------------------------- /bin/node-template/node/src/main.rs: -------------------------------------------------------------------------------- 1 | //! Substrate Node Template CLI library. 2 | #![warn(missing_docs)] 3 | 4 | mod chain_spec; 5 | #[macro_use] 6 | mod service; 7 | mod benchmarking; 8 | mod cli; 9 | mod command; 10 | mod rpc; 11 | 12 | fn main() -> sc_cli::Result<()> { 13 | command::run() 14 | } 15 | -------------------------------------------------------------------------------- /bin/node-template/pallets/tdstest/README.md: -------------------------------------------------------------------------------- 1 | License: Unlicense -------------------------------------------------------------------------------- /bin/node-template/pallets/tdstest/src/benchmarking.rs: -------------------------------------------------------------------------------- 1 | //! Benchmarking setup for pallet-template 2 | 3 | use super::*; 4 | 5 | #[allow(unused)] 6 | use crate::Pallet as Template; 7 | use frame_benchmarking::{benchmarks, whitelisted_caller}; 8 | use frame_system::RawOrigin; 9 | 10 | benchmarks! { 11 | do_something { 12 | let s in 0 .. 100; 13 | let caller: T::AccountId = whitelisted_caller(); 14 | }: _(RawOrigin::Signed(caller), s) 15 | verify { 16 | assert_eq!(Something::::get(), Some(s)); 17 | } 18 | 19 | impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test); 20 | } 21 | -------------------------------------------------------------------------------- /bin/node-template/pallets/template/README.md: -------------------------------------------------------------------------------- 1 | License: Unlicense -------------------------------------------------------------------------------- /bin/node-template/pallets/template/src/benchmarking.rs: -------------------------------------------------------------------------------- 1 | //! Benchmarking setup for pallet-template 2 | 3 | use super::*; 4 | 5 | #[allow(unused)] 6 | use crate::Pallet as Template; 7 | use frame_benchmarking::{benchmarks, whitelisted_caller}; 8 | use frame_system::RawOrigin; 9 | 10 | benchmarks! { 11 | do_something { 12 | let s in 0 .. 100; 13 | let caller: T::AccountId = whitelisted_caller(); 14 | }: _(RawOrigin::Signed(caller), s) 15 | verify { 16 | assert_eq!(Something::::get(), Some(s)); 17 | } 18 | 19 | impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test); 20 | } 21 | -------------------------------------------------------------------------------- /bin/node-template/runtime/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | #[cfg(feature = "std")] 3 | { 4 | substrate_wasm_builder::WasmBuilder::new() 5 | .with_current_project() 6 | .export_heap_base() 7 | .import_memory() 8 | .build(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /bin/node-template/scripts/docker_run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This script is meant to be run on Unix/Linux based systems 3 | set -e 4 | 5 | echo "*** Start Substrate node template ***" 6 | 7 | cd $(dirname ${BASH_SOURCE[0]})/.. 8 | 9 | docker-compose down --remove-orphans 10 | docker-compose run --rm --service-ports dev $@ 11 | -------------------------------------------------------------------------------- /bin/node-template/scripts/init.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This script is meant to be run on Unix/Linux based systems 3 | set -e 4 | 5 | echo "*** Initializing WASM build environment" 6 | 7 | if [ -z $CI_PROJECT_NAME ] ; then 8 | rustup update nightly 9 | rustup update stable 10 | fi 11 | 12 | rustup target add wasm32-unknown-unknown --toolchain nightly 13 | -------------------------------------------------------------------------------- /bin/utils/chain-spec-builder/README.md: -------------------------------------------------------------------------------- 1 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /bin/utils/subkey/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "subkey" 3 | version = "2.0.2" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | readme = "README.md" 10 | publish = false 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [[bin]] 16 | path = "src/main.rs" 17 | name = "subkey" 18 | 19 | [dependencies] 20 | clap = { version = "4.0.9", features = ["derive"] } 21 | sc-cli = { version = "0.10.0-dev", path = "../../../client/cli" } 22 | -------------------------------------------------------------------------------- /client/allocator/README.md: -------------------------------------------------------------------------------- 1 | Collection of allocator implementations. 2 | 3 | This crate provides the following allocator implementations: 4 | - A freeing-bump allocator: [`FreeingBumpHeapAllocator`](https://docs.rs/sc-allocator/latest/sc_allocator/struct.FreeingBumpHeapAllocator.html) 5 | 6 | License: Apache-2.0 -------------------------------------------------------------------------------- /client/api/README.md: -------------------------------------------------------------------------------- 1 | Substrate client interfaces. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/authority-discovery/README.md: -------------------------------------------------------------------------------- 1 | # Substrate authority discovery 2 | 3 | This crate enables Substrate authorities to discover and directly connect to 4 | other authorities. It is split into two components the [`Worker`] and the 5 | [`Service`]. 6 | 7 | See [`Worker`] and [`Service`] for more documentation. 8 | 9 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 10 | -------------------------------------------------------------------------------- /client/authority-discovery/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | prost_build::compile_protos( 3 | &["src/worker/schema/dht-v1.proto", "src/worker/schema/dht-v2.proto"], 4 | &["src/worker/schema"], 5 | ) 6 | .unwrap(); 7 | } 8 | -------------------------------------------------------------------------------- /client/authority-discovery/src/worker/schema/dht-v1.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package authority_discovery_v1; 4 | 5 | // First we need to serialize the addresses in order to be able to sign them. 6 | message AuthorityAddresses { 7 | repeated bytes addresses = 1; 8 | } 9 | 10 | // Then we need to serialize addresses and signature to send them over the wire. 11 | message SignedAuthorityAddresses { 12 | bytes addresses = 1; 13 | bytes signature = 2; 14 | } -------------------------------------------------------------------------------- /client/block-builder/README.md: -------------------------------------------------------------------------------- 1 | Substrate block builder 2 | 3 | This crate provides the [`BlockBuilder`] utility and the corresponding runtime api 4 | [`BlockBuilder`](https://docs.rs/sc-block-builder/latest/sc_block_builder/struct.BlockBuilder.html).Error 5 | 6 | The block builder utility is used in the node as an abstraction over the runtime api to 7 | initialize a block, to push extrinsics and to finalize a block. 8 | 9 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/chain-spec/derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sc-chain-spec-derive" 3 | version = "4.0.0-dev" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Macros to derive chain spec extension traits implementation." 10 | 11 | [package.metadata.docs.rs] 12 | targets = ["x86_64-unknown-linux-gnu"] 13 | 14 | [lib] 15 | proc-macro = true 16 | 17 | [dependencies] 18 | proc-macro-crate = "1.1.3" 19 | proc-macro2 = "1.0.37" 20 | quote = "1.0.10" 21 | syn = "1.0.98" 22 | -------------------------------------------------------------------------------- /client/cli/README.adoc: -------------------------------------------------------------------------------- 1 | 2 | = Substrate CLI 3 | 4 | Substrate CLI library 5 | 6 | include::doc/shell-completion.adoc[] 7 | -------------------------------------------------------------------------------- /client/cli/README.md: -------------------------------------------------------------------------------- 1 | Substrate CLI library. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/consensus/aura/README.md: -------------------------------------------------------------------------------- 1 | Aura (Authority-round) consensus in substrate. 2 | 3 | Aura works by having a list of authorities A who are expected to roughly 4 | agree on the current time. Time is divided up into discrete slots of t 5 | seconds each. For each slot s, the author of that slot is A[s % |A|]. 6 | 7 | The author is allowed to issue one block but not more during that slot, 8 | and it will be built upon the longest valid chain that has been seen. 9 | 10 | Blocks from future steps will be either deferred or rejected depending on how 11 | far in the future they are. 12 | 13 | NOTE: Aura itself is designed to be generic over the crypto used. 14 | 15 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/consensus/babe/rpc/README.md: -------------------------------------------------------------------------------- 1 | RPC api for babe. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/consensus/common/README.md: -------------------------------------------------------------------------------- 1 | Collection of common consensus specific implementations 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/consensus/epochs/README.md: -------------------------------------------------------------------------------- 1 | Generic utilities for epoch-based consensus engines. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/consensus/manual-seal/README.md: -------------------------------------------------------------------------------- 1 | A manual sealing engine: the engine listens for rpc calls to seal blocks and create forks. 2 | This is suitable for a testing environment. 3 | 4 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/consensus/slots/README.md: -------------------------------------------------------------------------------- 1 | Slots functionality for Substrate. 2 | 3 | Some consensus algorithms have a concept of *slots*, which are intervals in 4 | time during which certain events can and/or must occur. This crate 5 | provides generic functionality for slots. 6 | 7 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/consensus/uncles/README.md: -------------------------------------------------------------------------------- 1 | Uncles functionality for Substrate. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/db/README.md: -------------------------------------------------------------------------------- 1 | Client backend that is backed by a database. 2 | 3 | # Canonicality vs. Finality 4 | 5 | Finality indicates that a block will not be reverted, according to the consensus algorithm, 6 | while canonicality indicates that the block may be reverted, but we will be unable to do so, 7 | having discarded heavy state that will allow a chain reorganization. 8 | 9 | Finality implies canonicality but not vice-versa. 10 | 11 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/executor/README.md: -------------------------------------------------------------------------------- 1 | A crate that provides means of executing/dispatching calls into the runtime. 2 | 3 | There are a few responsibilities of this crate at the moment: 4 | 5 | - It provides an implementation of a common entrypoint for calling into the runtime, both 6 | wasm and compiled. 7 | - It defines the environment for the wasm execution, namely the host functions that are to be 8 | provided into the wasm runtime module. 9 | - It also provides the required infrastructure for executing the current wasm runtime (specified 10 | by the current value of `:code` in the provided externalities), i.e. interfacing with 11 | wasm engine used, instance cache. 12 | 13 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/executor/benches/kusama_runtime.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/client/executor/benches/kusama_runtime.wasm -------------------------------------------------------------------------------- /client/executor/common/README.md: -------------------------------------------------------------------------------- 1 | A set of common definitions that are needed for defining execution engines. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/executor/wasmi/README.md: -------------------------------------------------------------------------------- 1 | This crate provides an implementation of `WasmModule` that is baked by wasmi. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/executor/wasmtime/README.md: -------------------------------------------------------------------------------- 1 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/finality-grandpa/rpc/README.md: -------------------------------------------------------------------------------- 1 | RPC API for GRANDPA. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/informant/README.md: -------------------------------------------------------------------------------- 1 | Console informant. Prints sync progress and block events. Runs on the calling thread. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/keystore/README.md: -------------------------------------------------------------------------------- 1 | Keystore (and session key management) for ed25519 based chains like Polkadot. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/network/bitswap/build.rs: -------------------------------------------------------------------------------- 1 | const PROTOS: &[&str] = &["src/schema/bitswap.v1.2.0.proto"]; 2 | 3 | fn main() { 4 | prost_build::compile_protos(PROTOS, &["src/schema"]).unwrap(); 5 | } 6 | -------------------------------------------------------------------------------- /client/network/light/build.rs: -------------------------------------------------------------------------------- 1 | const PROTOS: &[&str] = &["src/schema/light.v1.proto"]; 2 | 3 | fn main() { 4 | prost_build::compile_protos(PROTOS, &["src/schema"]).unwrap(); 5 | } 6 | -------------------------------------------------------------------------------- /client/network/sync/build.rs: -------------------------------------------------------------------------------- 1 | const PROTOS: &[&str] = &["src/schema/api.v1.proto"]; 2 | 3 | fn main() { 4 | prost_build::compile_protos(PROTOS, &["src/schema"]).unwrap(); 5 | } 6 | -------------------------------------------------------------------------------- /client/peerset/README.md: -------------------------------------------------------------------------------- 1 | Peer Set Manager (PSM). Contains the strategy for choosing which nodes the network should be 2 | connected to. 3 | 4 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/proposer-metrics/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sc-proposer-metrics" 3 | version = "0.10.0-dev" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Basic metrics for block production." 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | log = "0.4.17" 17 | prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../utils/prometheus" } 18 | -------------------------------------------------------------------------------- /client/proposer-metrics/README.md: -------------------------------------------------------------------------------- 1 | Prometheus basic proposer metrics. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/rpc-api/README.md: -------------------------------------------------------------------------------- 1 | Substrate RPC interfaces. 2 | 3 | A collection of RPC methods and subscriptions supported by all substrate clients. 4 | 5 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/rpc-servers/README.md: -------------------------------------------------------------------------------- 1 | Substrate RPC servers. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/rpc-spec-v2/README.md: -------------------------------------------------------------------------------- 1 | Substrate RPC interfaces. 2 | 3 | A collection of RPC methods and subscriptions supported by all substrate clients. 4 | 5 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/rpc/README.md: -------------------------------------------------------------------------------- 1 | Substrate RPC implementation. 2 | 3 | A core implementation of Substrate RPC interfaces. 4 | 5 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/service/README.md: -------------------------------------------------------------------------------- 1 | Substrate service. Starts a thread that spins up the network, client, and extrinsic pool. 2 | Manages communication between them. 3 | 4 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/sysinfo/README.md: -------------------------------------------------------------------------------- 1 | This crate contains the code necessary to gather basic hardware 2 | and software telemetry information about the node on which we're running. 3 | 4 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 5 | -------------------------------------------------------------------------------- /client/tracing/README.md: -------------------------------------------------------------------------------- 1 | Instrumentation implementation for substrate. 2 | 3 | This crate is unstable and the API and usage may change. 4 | 5 | # Usage 6 | 7 | See `sp-tracing` for examples on how to use tracing. 8 | 9 | Currently we provide `Log` (default), `Telemetry` variants for `Receiver` 10 | 11 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/tracing/proc-macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sc-tracing-proc-macro" 3 | version = "4.0.0-dev" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Helper macros for Substrate's client CLI" 10 | 11 | [package.metadata.docs.rs] 12 | targets = ["x86_64-unknown-linux-gnu"] 13 | 14 | [lib] 15 | proc-macro = true 16 | 17 | [dependencies] 18 | proc-macro-crate = "1.1.3" 19 | proc-macro2 = "1.0.37" 20 | quote = { version = "1.0.10", features = ["proc-macro"] } 21 | syn = { version = "1.0.98", features = ["proc-macro", "full", "extra-traits", "parsing"] } 22 | -------------------------------------------------------------------------------- /client/utils/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sc-utils" 3 | version = "4.0.0-dev" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "I/O for Substrate runtimes" 10 | readme = "README.md" 11 | 12 | [dependencies] 13 | backtrace = "0.3.67" 14 | futures = "0.3.21" 15 | futures-timer = "3.0.2" 16 | lazy_static = "1.4.0" 17 | log = "0.4" 18 | parking_lot = "0.12.1" 19 | prometheus = { version = "0.13.0", default-features = false } 20 | 21 | [features] 22 | default = ["metered"] 23 | metered = [] 24 | 25 | [dev-dependencies] 26 | tokio-test = "0.4.2" 27 | -------------------------------------------------------------------------------- /docs/Upgrade.md: -------------------------------------------------------------------------------- 1 | # Upgrade path for you building on substrate 2 | 3 | ## master 4 | - crate rename has been fixed `sp-application-crypto` (was `sc-application-crypto`); `.maintain/rename-crates-for-2.0.sh` has been updated accordingly, you can use it to upgrade to latest naming convention 5 | - crates have been renamed, run `bash .maintain/rename-crates-for-2.0.sh` -------------------------------------------------------------------------------- /docs/media/sub.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/docs/media/sub.gif -------------------------------------------------------------------------------- /frame/authority-discovery/README.md: -------------------------------------------------------------------------------- 1 | # Authority discovery module. 2 | 3 | This module is used by the `client/authority-discovery` to retrieve the 4 | current set of authorities. 5 | 6 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/authorship/README.md: -------------------------------------------------------------------------------- 1 | Authorship tracking for FRAME runtimes. 2 | 3 | This tracks the current author of the block and recent uncles. 4 | 5 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/babe/README.md: -------------------------------------------------------------------------------- 1 | Consensus extension module for BABE consensus. Collects on-chain randomness 2 | from VRF outputs and manages epoch transitions. 3 | 4 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/bags-list/fuzzer/.gitignore: -------------------------------------------------------------------------------- 1 | hfuzz_target 2 | hfuzz_workspace 3 | -------------------------------------------------------------------------------- /frame/contracts/benchmarks/README.md: -------------------------------------------------------------------------------- 1 | # Benchmarks 2 | 3 | This directory contains real world (ink!, solang) contracts which are used in macro benchmarks. 4 | Those benchmarks are not used to determine weights but rather to compare different contract 5 | languages and execution engines with larger wasm modules. 6 | 7 | Files in this directory are used by `#[extra]` benchmarks in `src/benchmarking`. The json 8 | files are for informational purposes only and are not consumed by the benchmarks. 9 | 10 | -------------------------------------------------------------------------------- /frame/contracts/benchmarks/ink_erc20.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/frame/contracts/benchmarks/ink_erc20.wasm -------------------------------------------------------------------------------- /frame/contracts/benchmarks/ink_erc20_test.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/frame/contracts/benchmarks/ink_erc20_test.wasm -------------------------------------------------------------------------------- /frame/contracts/benchmarks/solang_erc20.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/frame/contracts/benchmarks/solang_erc20.wasm -------------------------------------------------------------------------------- /frame/contracts/fixtures/debug_message_invalid_utf8.wat: -------------------------------------------------------------------------------- 1 | ;; Emit a "Hello World!" debug message 2 | (module 3 | (import "seal0" "seal_debug_message" (func $seal_debug_message (param i32 i32) (result i32))) 4 | (import "env" "memory" (memory 1 1)) 5 | 6 | (data (i32.const 0) "\fc") 7 | 8 | (func (export "call") 9 | (call $seal_debug_message 10 | (i32.const 0) ;; Pointer to the text buffer 11 | (i32.const 12) ;; The size of the buffer 12 | ) 13 | ;; the above call traps because we supplied invalid utf8 14 | unreachable 15 | ) 16 | 17 | (func (export "deploy")) 18 | ) 19 | -------------------------------------------------------------------------------- /frame/contracts/fixtures/dummy.wat: -------------------------------------------------------------------------------- 1 | ;; A valid contract which does nothing at all 2 | (module 3 | (func (export "deploy")) 4 | (func (export "call")) 5 | ) 6 | -------------------------------------------------------------------------------- /frame/contracts/fixtures/float_instruction.wat: -------------------------------------------------------------------------------- 1 | ;; Module that contains a float instruction which is illegal in deterministic mode 2 | (module 3 | (func (export "call") 4 | f32.const 1 5 | drop 6 | ) 7 | (func (export "deploy") 8 | f32.const 2 9 | drop 10 | ) 11 | ) 12 | -------------------------------------------------------------------------------- /frame/contracts/fixtures/invalid_contract.wat: -------------------------------------------------------------------------------- 1 | ;; Valid module but missing the call function 2 | (module 3 | (func (export "deploy")) 4 | ) 5 | -------------------------------------------------------------------------------- /frame/contracts/fixtures/invalid_module.wat: -------------------------------------------------------------------------------- 1 | ;; An invalid module 2 | (module 3 | (func (export "deploy")) 4 | (func (export "call") 5 | ;; imbalanced stack 6 | (i32.const 7) 7 | ) 8 | ) 9 | -------------------------------------------------------------------------------- /frame/contracts/fixtures/new_set_code_hash_contract.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (import "seal0" "seal_return" (func $seal_return (param i32 i32 i32))) 3 | (import "env" "memory" (memory 1 1)) 4 | 5 | ;; [0, 32) return value 6 | (data (i32.const 0) "\02") 7 | 8 | (func (export "deploy")) 9 | 10 | (func (export "call") 11 | (call $seal_return (i32.const 0) (i32.const 0) (i32.const 4)) 12 | ) 13 | ) 14 | -------------------------------------------------------------------------------- /frame/contracts/fixtures/run_out_of_gas.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (func (export "call") 3 | (loop $inf (br $inf)) ;; just run out of gas 4 | (unreachable) 5 | ) 6 | (func (export "deploy")) 7 | ) 8 | -------------------------------------------------------------------------------- /frame/contracts/fixtures/self_destructing_constructor.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (import "seal0" "seal_terminate" (func $seal_terminate (param i32 i32))) 3 | (import "env" "memory" (memory 1 1)) 4 | 5 | (func $assert (param i32) 6 | (block $ok 7 | (br_if $ok 8 | (get_local 0) 9 | ) 10 | (unreachable) 11 | ) 12 | ) 13 | 14 | (func (export "deploy") 15 | ;; Self-destruct by sending full balance to the 0 address. 16 | (call $seal_terminate 17 | (i32.const 0) ;; Pointer to destination address 18 | (i32.const 32) ;; Length of destination address 19 | ) 20 | ) 21 | 22 | (func (export "call")) 23 | ) 24 | -------------------------------------------------------------------------------- /frame/contracts/fixtures/set_empty_storage.wat: -------------------------------------------------------------------------------- 1 | ;; This module stores a KV pair into the storage 2 | (module 3 | (import "seal0" "seal_set_storage" (func $seal_set_storage (param i32 i32 i32))) 4 | (import "env" "memory" (memory 16 16)) 5 | 6 | (func (export "call") 7 | ) 8 | (func (export "deploy") 9 | (call $seal_set_storage 10 | (i32.const 0) ;; Pointer to storage key 11 | (i32.const 0) ;; Pointer to value 12 | (i32.load (i32.const 0)) ;; Size of value 13 | ) 14 | ) 15 | ) 16 | -------------------------------------------------------------------------------- /frame/contracts/primitives/README.md: -------------------------------------------------------------------------------- 1 | A crate that hosts a common definitions that are relevant for the pallet-contracts. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/conviction-voting/README.md: -------------------------------------------------------------------------------- 1 | # Voting Pallet 2 | 3 | - [`assembly::Config`](https://docs.rs/pallet-assembly/latest/pallet_assembly/trait.Config.html) 4 | - [`Call`](https://docs.rs/pallet-assembly/latest/pallet_assembly/enum.Call.html) 5 | 6 | ## Overview 7 | 8 | Pallet for voting in referenda. 9 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/missing_accuracy.rs: -------------------------------------------------------------------------------- 1 | use frame_election_provider_solution_type::generate_solution_type; 2 | 3 | generate_solution_type!(pub struct TestSolution::< 4 | VoterIndex = u16, 5 | TargetIndex = u8, 6 | Perbill, 7 | MaxVoters = ConstU32::<10>, 8 | >(8)); 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/missing_accuracy.stderr: -------------------------------------------------------------------------------- 1 | error: Expected binding: `Accuracy = ...` 2 | --> $DIR/missing_accuracy.rs:6:2 3 | | 4 | 6 | Perbill, 5 | | ^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/missing_size_bound.rs: -------------------------------------------------------------------------------- 1 | use frame_election_provider_solution_type::generate_solution_type; 2 | 3 | generate_solution_type!(pub struct TestSolution::< 4 | VoterIndex = u16, 5 | TargetIndex = u8, 6 | Accuracy = Perbill, 7 | ConstU32::<10>, 8 | >(8)); 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/missing_size_bound.stderr: -------------------------------------------------------------------------------- 1 | error: Expected binding: `MaxVoters = ...` 2 | --> tests/ui/fail/missing_size_bound.rs:7:2 3 | | 4 | 7 | ConstU32::<10>, 5 | | ^^^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/missing_target.rs: -------------------------------------------------------------------------------- 1 | use frame_election_provider_solution_type::generate_solution_type; 2 | 3 | generate_solution_type!(pub struct TestSolution::< 4 | VoterIndex = u16, 5 | u8, 6 | Accuracy = Perbill, 7 | MaxVoters = ConstU32::<10>, 8 | >(8)); 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/missing_target.stderr: -------------------------------------------------------------------------------- 1 | error: Expected binding: `TargetIndex = ...` 2 | --> $DIR/missing_target.rs:5:2 3 | | 4 | 5 | u8, 5 | | ^^ 6 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/missing_voter.rs: -------------------------------------------------------------------------------- 1 | use frame_election_provider_solution_type::generate_solution_type; 2 | 3 | generate_solution_type!(pub struct TestSolution::< 4 | u16, 5 | TargetIndex = u8, 6 | Accuracy = Perbill, 7 | MaxVoters = ConstU32::<10>, 8 | >(8)); 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/missing_voter.stderr: -------------------------------------------------------------------------------- 1 | error: Expected binding: `VoterIndex = ...` 2 | --> $DIR/missing_voter.rs:4:2 3 | | 4 | 4 | u16, 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/no_annotations.rs: -------------------------------------------------------------------------------- 1 | use frame_election_provider_solution_type::generate_solution_type; 2 | 3 | generate_solution_type!(pub struct TestSolution::< 4 | u16, 5 | u8, 6 | Perbill, 7 | MaxVoters = ConstU32::<10>, 8 | >(8)); 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/no_annotations.stderr: -------------------------------------------------------------------------------- 1 | error: Expected binding: `VoterIndex = ...` 2 | --> $DIR/no_annotations.rs:4:2 3 | | 4 | 4 | u16, 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/swap_voter_target.rs: -------------------------------------------------------------------------------- 1 | use frame_election_provider_solution_type::generate_solution_type; 2 | 3 | generate_solution_type!(pub struct TestSolution::< 4 | TargetIndex = u16, 5 | VoterIndex = u8, 6 | Accuracy = Perbill, 7 | MaxVoters = ConstU32::<10>, 8 | >(8)); 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/swap_voter_target.stderr: -------------------------------------------------------------------------------- 1 | error: Expected `VoterIndex` 2 | --> $DIR/swap_voter_target.rs:4:2 3 | | 4 | 4 | TargetIndex = u16, 5 | | ^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/wrong_attribute.rs: -------------------------------------------------------------------------------- 1 | use frame_election_provider_solution_type::generate_solution_type; 2 | 3 | generate_solution_type!( 4 | #[pages(1)] pub struct TestSolution::< 5 | VoterIndex = u8, 6 | TargetIndex = u16, 7 | Accuracy = Perbill, 8 | MaxVoters = ConstU32::<10>, 9 | >(8) 10 | ); 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /frame/election-provider-support/solution-type/tests/ui/fail/wrong_attribute.stderr: -------------------------------------------------------------------------------- 1 | error: compact solution can accept only #[compact] 2 | --> $DIR/wrong_attribute.rs:4:2 3 | | 4 | 4 | #[pages(1)] pub struct TestSolution::< 5 | | ^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/grandpa/README.md: -------------------------------------------------------------------------------- 1 | GRANDPA Consensus module for runtime. 2 | 3 | This manages the GRANDPA authority set ready for the native code. 4 | These authorities are only for GRANDPA finality, not for consensus overall. 5 | 6 | In the future, it will also handle misbehavior reports, and on-chain 7 | finality notifications. 8 | 9 | For full integration with GRANDPA, the `GrandpaApi` should be implemented. 10 | The necessary items are re-exported via the `fg_primitives` crate. 11 | 12 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/indices/README.md: -------------------------------------------------------------------------------- 1 | An index is a short form of an address. This module handles allocation 2 | of indices for a newly created accounts. 3 | 4 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/membership/README.md: -------------------------------------------------------------------------------- 1 | # Membership Module 2 | 3 | Allows control of membership of a set of `AccountId`s, useful for managing membership of a 4 | collective. A prime member may be set. 5 | 6 | License: Apache-2.0 7 | -------------------------------------------------------------------------------- /frame/nis/README.md: -------------------------------------------------------------------------------- 1 | 2 | License: Apache-2.0 3 | -------------------------------------------------------------------------------- /frame/nomination-pools/benchmarking/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/frame/nomination-pools/benchmarking/README.md -------------------------------------------------------------------------------- /frame/nomination-pools/runtime-api/README.md: -------------------------------------------------------------------------------- 1 | Runtime API definition for nomination-pools pallet. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/offences/README.md: -------------------------------------------------------------------------------- 1 | # Offences Module 2 | 3 | Tracks reported offences 4 | 5 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/offences/benchmarking/README.md: -------------------------------------------------------------------------------- 1 | Offences pallet benchmarking. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/referenda/README.md: -------------------------------------------------------------------------------- 1 | # Referenda Pallet 2 | 3 | - [`assembly::Config`](https://docs.rs/pallet-assembly/latest/pallet_assembly/trait.Config.html) 4 | - [`Call`](https://docs.rs/pallet-assembly/latest/pallet_assembly/enum.Call.html) 5 | 6 | ## Overview 7 | 8 | The Assembly pallet handles the administration of general stakeholder voting. 9 | -------------------------------------------------------------------------------- /frame/remark/README.md: -------------------------------------------------------------------------------- 1 | # Remark Storage Pallet 2 | 3 | Allows storing arbitrary data off chain. 4 | 5 | 6 | License: Apache-2.0 7 | -------------------------------------------------------------------------------- /frame/root-offences/README.md: -------------------------------------------------------------------------------- 1 | # Root Offences Pallet 2 | 3 | Pallet that allows the root to create an offence. 4 | 5 | NOTE: This pallet should only be used for testing purposes. -------------------------------------------------------------------------------- /frame/root-testing/README.md: -------------------------------------------------------------------------------- 1 | # Root Testing Pallet 2 | 3 | Pallet that contains extrinsics that can be usefull in testing. 4 | 5 | NOTE: This pallet should only be used for testing purposes and should not be used in production runtimes! -------------------------------------------------------------------------------- /frame/session/benchmarking/README.md: -------------------------------------------------------------------------------- 1 | Benchmarks for the Session Pallet. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/support/README.md: -------------------------------------------------------------------------------- 1 | Support code for the runtime. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/support/procedural/tools/derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "frame-support-procedural-tools-derive" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Use to derive parsing for parsing struct." 10 | 11 | [package.metadata.docs.rs] 12 | targets = ["x86_64-unknown-linux-gnu"] 13 | 14 | [lib] 15 | proc-macro = true 16 | 17 | [dependencies] 18 | proc-macro2 = "1.0.37" 19 | quote = { version = "1.0.10", features = ["proc-macro"] } 20 | syn = { version = "1.0.98", features = ["proc-macro", "full", "extra-traits", "parsing"] } 21 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/abundant_where_param.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | Block = Block1, 8 | UncheckedExtrinsic = Uxt, 9 | {} 10 | } 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/abundant_where_param.stderr: -------------------------------------------------------------------------------- 1 | error: `Block` was declared above. Please use exactly one declaration for `Block`. 2 | --> $DIR/abundant_where_param.rs:7:3 3 | | 4 | 7 | Block = Block1, 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/conflicting_index.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | UncheckedExtrinsic = UncheckedExtrinsic, 6 | Block = Block, 7 | NodeBlock = Block, 8 | { 9 | System: system::{}, 10 | Pallet1: pallet1::{} = 0, 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/conflicting_index.stderr: -------------------------------------------------------------------------------- 1 | error: Pallet indices are conflicting: Both pallets System and Pallet1 are at index 0 2 | --> $DIR/conflicting_index.rs:9:3 3 | | 4 | 9 | System: system::{}, 5 | | ^^^^^^ 6 | 7 | error: Pallet indices are conflicting: Both pallets System and Pallet1 are at index 0 8 | --> $DIR/conflicting_index.rs:10:3 9 | | 10 | 10 | Pallet1: pallet1::{} = 0, 11 | | ^^^^^^^ 12 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/conflicting_index_2.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | UncheckedExtrinsic = UncheckedExtrinsic, 6 | Block = Block, 7 | NodeBlock = Block, 8 | { 9 | System: system::{} = 5, 10 | Pallet1: pallet1::{} = 3, 11 | Pallet2: pallet2::{}, 12 | Pallet3: pallet3::{}, 13 | } 14 | } 15 | 16 | fn main() {} 17 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/conflicting_index_2.stderr: -------------------------------------------------------------------------------- 1 | error: Pallet indices are conflicting: Both pallets System and Pallet3 are at index 5 2 | --> $DIR/conflicting_index_2.rs:9:3 3 | | 4 | 9 | System: system::{} = 5, 5 | | ^^^^^^ 6 | 7 | error: Pallet indices are conflicting: Both pallets System and Pallet3 are at index 5 8 | --> $DIR/conflicting_index_2.rs:12:3 9 | | 10 | 12 | Pallet3: pallet3::{}, 11 | | ^^^^^^^ 12 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/conflicting_module_name.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | System: system::{Pallet}, 10 | Balance: balances::{Pallet}, 11 | Balance: balances::{Pallet}, 12 | } 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/conflicting_module_name.stderr: -------------------------------------------------------------------------------- 1 | error: Two pallets with the same name! 2 | --> $DIR/conflicting_module_name.rs:10:3 3 | | 4 | 10 | Balance: balances::{Pallet}, 5 | | ^^^^^^^ 6 | 7 | error: Two pallets with the same name! 8 | --> $DIR/conflicting_module_name.rs:11:3 9 | | 10 | 11 | Balance: balances::{Pallet}, 11 | | ^^^^^^^ 12 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/double_module_parts.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | System: system::{Pallet}, 10 | Balance: balances::{Config, Call, Config, Origin}, 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/double_module_parts.stderr: -------------------------------------------------------------------------------- 1 | error: `Config` was already declared before. Please remove the duplicate declaration 2 | --> $DIR/double_module_parts.rs:10:37 3 | | 4 | 10 | Balance: balances::{Config, Call, Config, Origin}, 5 | | ^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/duplicate_exclude.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | UncheckedExtrinsic = UncheckedExtrinsic, 6 | Block = Block, 7 | NodeBlock = Block, 8 | { 9 | System: frame_system exclude_parts { Call, Call }, 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/duplicate_exclude.stderr: -------------------------------------------------------------------------------- 1 | error: `Call` was already declared before. Please remove the duplicate declaration 2 | --> $DIR/duplicate_exclude.rs:9:46 3 | | 4 | 9 | System: frame_system exclude_parts { Call, Call }, 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/empty_pallet_path.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | system: , 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/empty_pallet_path.stderr: -------------------------------------------------------------------------------- 1 | error: expected one of: `crate`, `self`, `super`, identifier 2 | --> $DIR/empty_pallet_path.rs:9:11 3 | | 4 | 9 | system: , 5 | | ^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/exclude_missspell.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | UncheckedExtrinsic = UncheckedExtrinsic, 6 | Block = Block, 7 | NodeBlock = Block, 8 | { 9 | System: frame_system exclude_part { Call }, 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/exclude_missspell.stderr: -------------------------------------------------------------------------------- 1 | error: Unexpected tokens, expected one of `::$ident` `::{`, `exclude_parts`, `use_parts`, `=`, `,` 2 | --> $DIR/exclude_missspell.rs:9:24 3 | | 4 | 9 | System: frame_system exclude_part { Call }, 5 | | ^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/feature_gated_system_pallet.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | #[cfg(test)] 10 | System: frame_system::{Pallet, Call, Storage, Config, Event}, 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/feature_gated_system_pallet.stderr: -------------------------------------------------------------------------------- 1 | error: `System` pallet declaration is feature gated, please remove any `#[cfg]` attributes 2 | --> tests/construct_runtime_ui/feature_gated_system_pallet.rs:10:3 3 | | 4 | 10 | System: frame_system::{Pallet, Call, Storage, Config, Event}, 5 | | ^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/generics_in_invalid_module.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | System: system::{Pallet}, 10 | Balance: balances::::{Call, Origin}, 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/generics_in_invalid_module.stderr: -------------------------------------------------------------------------------- 1 | error: `Call` is not allowed to have generics. Only the following pallets are allowed to have generics: `Event`, `Origin`, `Config`. 2 | --> $DIR/generics_in_invalid_module.rs:10:36 3 | | 4 | 10 | Balance: balances::::{Call, Origin}, 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_meta_literal.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | System: system::{Pallet}, 10 | #[cfg(feature = 1)] 11 | Balance: balances::{Config, Call}, 12 | } 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_meta_literal.stderr: -------------------------------------------------------------------------------- 1 | error: feature = 1 2 | ^ expected one of ``, `all`, `any`, `not` here 3 | --> tests/construct_runtime_ui/invalid_meta_literal.rs:10:3 4 | | 5 | 10 | #[cfg(feature = 1)] 6 | | ^ 7 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_module_details.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | system: System::(), 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr: -------------------------------------------------------------------------------- 1 | error: Unexpected tokens, expected one of `::$ident` `::{`, `exclude_parts`, `use_parts`, `=`, `,` 2 | --> tests/construct_runtime_ui/invalid_module_details.rs:9:17 3 | | 4 | 9 | system: System::(), 5 | | ^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_module_details_keyword.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | system: System::{enum}, 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_module_details_keyword.stderr: -------------------------------------------------------------------------------- 1 | error: expected one of: `Pallet`, `Call`, `Storage`, `Event`, `Config`, `Origin`, `Inherent`, `ValidateUnsigned` 2 | --> $DIR/invalid_module_details_keyword.rs:9:20 3 | | 4 | 9 | system: System::{enum}, 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_module_entry.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | System: system::{Pallet}, 10 | Balance: balances::{Error}, 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_module_entry.stderr: -------------------------------------------------------------------------------- 1 | error: expected one of: `Pallet`, `Call`, `Storage`, `Event`, `Config`, `Origin`, `Inherent`, `ValidateUnsigned` 2 | --> $DIR/invalid_module_entry.rs:10:23 3 | | 4 | 10 | Balance: balances::{Error}, 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_token_after_module.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | system: System ? 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_token_after_module.stderr: -------------------------------------------------------------------------------- 1 | error: Unexpected tokens, expected one of `::$ident` `::{`, `exclude_parts`, `use_parts`, `=`, `,` 2 | --> $DIR/invalid_token_after_module.rs:9:18 3 | | 4 | 9 | system: System ? 5 | | ^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_token_after_name.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | system ? 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_token_after_name.stderr: -------------------------------------------------------------------------------- 1 | error: expected `:` 2 | --> $DIR/invalid_token_after_name.rs:9:10 3 | | 4 | 9 | system ? 5 | | ^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_where_param.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | TypeX = Block, 8 | UncheckedExtrinsic = UncheckedExtrinsic, 9 | {} 10 | } 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/invalid_where_param.stderr: -------------------------------------------------------------------------------- 1 | error: expected one of: `Block`, `NodeBlock`, `UncheckedExtrinsic` 2 | --> $DIR/invalid_where_param.rs:7:3 3 | | 4 | 7 | TypeX = Block, 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | System: system::{Pallet}, 10 | Balance: balances::::{Event}, 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.stderr: -------------------------------------------------------------------------------- 1 | error: Instantiable pallet with no generic `Event` cannot be constructed: pallet `Balance` must have generic `Event` 2 | --> $DIR/missing_event_generic_on_module_with_instance.rs:10:3 3 | | 4 | 10 | Balance: balances::::{Event}, 5 | | ^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/missing_module_instance.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | system: System::<>, 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/missing_module_instance.stderr: -------------------------------------------------------------------------------- 1 | error: expected identifier 2 | --> $DIR/missing_module_instance.rs:9:20 3 | | 4 | 9 | system: System::<>, 5 | | ^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | System: system::{Pallet}, 10 | Balance: balances::::{Origin}, 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.stderr: -------------------------------------------------------------------------------- 1 | error: Instantiable pallet with no generic `Origin` cannot be constructed: pallet `Balance` must have generic `Origin` 2 | --> $DIR/missing_origin_generic_on_module_with_instance.rs:10:3 3 | | 4 | 10 | Balance: balances::::{Origin}, 5 | | ^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/missing_system_module.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | } 10 | } 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr: -------------------------------------------------------------------------------- 1 | error: `System` pallet declaration is missing. Please add this line: `System: frame_system::{Pallet, Call, Storage, Config, Event},` 2 | --> $DIR/missing_system_module.rs:8:2 3 | | 4 | 8 | / { 5 | 9 | | } 6 | | |_____^ 7 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/missing_where_block.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime {} 5 | } 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/missing_where_block.stderr: -------------------------------------------------------------------------------- 1 | error: expected `where` 2 | --> tests/construct_runtime_ui/missing_where_block.rs:4:19 3 | | 4 | 4 | pub enum Runtime {} 5 | | ^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/missing_where_param.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | {} 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr: -------------------------------------------------------------------------------- 1 | error: Missing associated type for `UncheckedExtrinsic`. Add `UncheckedExtrinsic` = ... to where section. 2 | --> tests/construct_runtime_ui/missing_where_param.rs:7:2 3 | | 4 | 7 | {} 5 | | ^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/more_than_256_modules.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | UncheckedExtrinsic = UncheckedExtrinsic, 6 | Block = Block, 7 | NodeBlock = Block, 8 | { 9 | System: system::{} = 255, 10 | Pallet256: pallet256::{}, 11 | } 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/more_than_256_modules.stderr: -------------------------------------------------------------------------------- 1 | error: Pallet index doesn't fit into u8, index is 256 2 | --> $DIR/more_than_256_modules.rs:10:3 3 | | 4 | 10 | Pallet256: pallet256::{}, 5 | | ^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/no_comma_after_where.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | UncheckedExtrinsic = UncheckedExtrinsic 6 | Block = Block, 7 | NodeBlock = Block, 8 | { 9 | System: system, 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/no_comma_after_where.stderr: -------------------------------------------------------------------------------- 1 | error: Expected `,` or `{` 2 | --> $DIR/no_comma_after_where.rs:6:3 3 | | 4 | 6 | Block = Block, 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/old_unsupported_pallet_decl.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | mod pallet_old { 4 | pub trait Config: frame_system::Config {} 5 | 6 | decl_storage! { 7 | trait Store for Module as Example {} 8 | } 9 | 10 | decl_module! { 11 | pub struct Module for enum Call where origin: T::RuntimeOrigin {} 12 | } 13 | 14 | } 15 | construct_runtime! { 16 | pub enum Runtime where 17 | UncheckedExtrinsic = UncheckedExtrinsic, 18 | Block = Block, 19 | NodeBlock = Block, 20 | { 21 | System: frame_system, 22 | OldPallet: pallet_old, 23 | } 24 | } 25 | 26 | fn main() {} 27 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/unsupported_meta_structure.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | System: system::{Pallet}, 10 | #[cfg(feature(test))] 11 | Balance: balances::{Config, Call}, 12 | } 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/unsupported_meta_structure.stderr: -------------------------------------------------------------------------------- 1 | error: feature(test) 2 | ^ expected one of `=`, `,`, `)` here 3 | --> tests/construct_runtime_ui/unsupported_meta_structure.rs:10:3 4 | | 5 | 10 | #[cfg(feature(test))] 6 | | ^ 7 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/unsupported_pallet_attr.rs: -------------------------------------------------------------------------------- 1 | use frame_support::construct_runtime; 2 | 3 | construct_runtime! { 4 | pub enum Runtime where 5 | Block = Block, 6 | NodeBlock = Block, 7 | UncheckedExtrinsic = UncheckedExtrinsic 8 | { 9 | System: system::{Pallet}, 10 | #[attr] 11 | Balance: balances::{Config, Call}, 12 | } 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/unsupported_pallet_attr.stderr: -------------------------------------------------------------------------------- 1 | error: Unsupported attribute, only #[cfg] is supported on pallet declarations in `construct_runtime` 2 | --> tests/construct_runtime_ui/unsupported_pallet_attr.rs:10:3 3 | | 4 | 10 | #[attr] 5 | | ^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/decl_module_ui/reserved_keyword_two_times_integrity_test.rs: -------------------------------------------------------------------------------- 1 | frame_support::decl_module! { 2 | pub struct Module for enum Call where origin: T::RuntimeOrigin, system=self { 3 | fn integrity_test() {} 4 | 5 | fn integrity_test() {} 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /frame/support/test/tests/decl_module_ui/reserved_keyword_two_times_on_initialize.rs: -------------------------------------------------------------------------------- 1 | frame_support::decl_module! { 2 | pub struct Module for enum Call where origin: T::RuntimeOrigin, system=self { 3 | fn on_initialize() -> Weight { 4 | 0 5 | } 6 | 7 | fn on_initialize() -> Weight { 8 | 0 9 | } 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/decl_module_ui/reserved_keyword_two_times_on_initialize.stderr: -------------------------------------------------------------------------------- 1 | error: `on_initialize` can only be passed once as input. 2 | --> tests/decl_module_ui/reserved_keyword_two_times_on_initialize.rs:1:1 3 | | 4 | 1 | / frame_support::decl_module! { 5 | 2 | | pub struct Module for enum Call where origin: T::RuntimeOrigin, system=self { 6 | 3 | | fn on_initialize() -> Weight { 7 | 4 | | 0 8 | ... | 9 | 10 | | } 10 | 11 | | } 11 | | |_^ 12 | | 13 | = note: this error originates in the macro `$crate::decl_module` which comes from the expansion of the macro `frame_support::decl_module` (in Nightly builds, run with -Z macro-backtrace for more info) 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/decl_storage_ui/config_duplicate.stderr: -------------------------------------------------------------------------------- 1 | error: `config()`/`get()` with the same name already defined. 2 | --> $DIR/config_duplicate.rs:27:21 3 | | 4 | 27 | pub Value2 config(value): u32; 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/decl_storage_ui/config_get_duplicate.stderr: -------------------------------------------------------------------------------- 1 | error: `config()`/`get()` with the same name already defined. 2 | --> $DIR/config_get_duplicate.rs:27:21 3 | | 4 | 27 | pub Value2 config(value): u32; 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/decl_storage_ui/get_duplicate.stderr: -------------------------------------------------------------------------------- 1 | error: `config()`/`get()` with the same name already defined. 2 | --> $DIR/get_duplicate.rs:27:21 3 | | 4 | 27 | pub Value2 get(fn value) config(): u32; 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/clone.rs: -------------------------------------------------------------------------------- 1 | trait Config { 2 | type C; 3 | } 4 | 5 | #[derive(frame_support::CloneNoBound)] 6 | struct Foo { 7 | c: T::C, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/clone.stderr: -------------------------------------------------------------------------------- 1 | error[E0277]: the trait bound `::C: Clone` is not satisfied 2 | --> tests/derive_no_bound_ui/clone.rs:7:2 3 | | 4 | 7 | c: T::C, 5 | | ^ the trait `Clone` is not implemented for `::C` 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/debug.rs: -------------------------------------------------------------------------------- 1 | trait Config { 2 | type C; 3 | } 4 | 5 | #[derive(frame_support::DebugNoBound)] 6 | struct Foo { 7 | c: T::C, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/debug.stderr: -------------------------------------------------------------------------------- 1 | error[E0277]: `::C` doesn't implement `std::fmt::Debug` 2 | --> tests/derive_no_bound_ui/debug.rs:7:2 3 | | 4 | 7 | c: T::C, 5 | | ^ `::C` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` 6 | | 7 | = help: the trait `std::fmt::Debug` is not implemented for `::C` 8 | = note: required for the cast from `::C` to the object type `dyn std::fmt::Debug` 9 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/default.rs: -------------------------------------------------------------------------------- 1 | trait Config { 2 | type C; 3 | } 4 | 5 | #[derive(frame_support::DefaultNoBound)] 6 | struct Foo { 7 | c: T::C, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/default.stderr: -------------------------------------------------------------------------------- 1 | error[E0277]: the trait bound `::C: std::default::Default` is not satisfied 2 | --> tests/derive_no_bound_ui/default.rs:7:2 3 | | 4 | 7 | c: T::C, 5 | | ^ the trait `std::default::Default` is not implemented for `::C` 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/default_empty_enum.rs: -------------------------------------------------------------------------------- 1 | #[derive(frame_support::DefaultNoBound)] 2 | enum Empty {} 3 | 4 | fn main() {} 5 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/default_empty_enum.stderr: -------------------------------------------------------------------------------- 1 | error: cannot derive Default for an empty enum 2 | --> tests/derive_no_bound_ui/default_empty_enum.rs:2:6 3 | | 4 | 2 | enum Empty {} 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/default_no_attribute.rs: -------------------------------------------------------------------------------- 1 | trait Config { 2 | type C; 3 | } 4 | 5 | #[derive(frame_support::DefaultNoBound)] 6 | enum Foo { 7 | Bar(T::C), 8 | Baz, 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/default_no_attribute.stderr: -------------------------------------------------------------------------------- 1 | error: no default declared, make a variant default by placing `#[default]` above it 2 | --> tests/derive_no_bound_ui/default_no_attribute.rs:6:6 3 | | 4 | 6 | enum Foo { 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/default_too_many_attributes.rs: -------------------------------------------------------------------------------- 1 | trait Config { 2 | type C; 3 | } 4 | 5 | #[derive(frame_support::DefaultNoBound)] 6 | enum Foo { 7 | #[default] 8 | Bar(T::C), 9 | #[default] 10 | Baz, 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/default_union.rs: -------------------------------------------------------------------------------- 1 | #[derive(frame_support::DefaultNoBound)] 2 | union Foo { 3 | field1: u32, 4 | field2: (), 5 | } 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/default_union.stderr: -------------------------------------------------------------------------------- 1 | error: Union type not supported by `derive(DefaultNoBound)` 2 | --> tests/derive_no_bound_ui/default_union.rs:2:1 3 | | 4 | 2 | union Foo { 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/eq.rs: -------------------------------------------------------------------------------- 1 | trait Config { 2 | type C; 3 | } 4 | 5 | #[derive(frame_support::EqNoBound)] 6 | struct Foo { 7 | c: T::C, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/eq.stderr: -------------------------------------------------------------------------------- 1 | error[E0277]: can't compare `Foo` with `Foo` 2 | --> tests/derive_no_bound_ui/eq.rs:6:8 3 | | 4 | 6 | struct Foo { 5 | | ^^^ no implementation for `Foo == Foo` 6 | | 7 | = help: the trait `PartialEq` is not implemented for `Foo` 8 | note: required by a bound in `std::cmp::Eq` 9 | --> $RUST/core/src/cmp.rs 10 | | 11 | | pub trait Eq: PartialEq { 12 | | ^^^^^^^^^^^^^^^ required by this bound in `std::cmp::Eq` 13 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/partial_eq.rs: -------------------------------------------------------------------------------- 1 | trait Config { 2 | type C; 3 | } 4 | 5 | #[derive(frame_support::PartialEqNoBound)] 6 | struct Foo { 7 | c: T::C, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /frame/support/test/tests/derive_no_bound_ui/partial_eq.stderr: -------------------------------------------------------------------------------- 1 | error[E0369]: binary operation `==` cannot be applied to type `::C` 2 | --> tests/derive_no_bound_ui/partial_eq.rs:7:2 3 | | 4 | 7 | c: T::C, 5 | | ^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/attr_non_empty.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet [foo]] 2 | mod foo { 3 | } 4 | 5 | fn main() { 6 | } 7 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/attr_non_empty.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet macro call: unexpected attribute. Macro call must be bare, such as `#[frame_support::pallet]` or `#[pallet]`, or must specify the `dev_mode` attribute, such as `#[frame_support::pallet(dev_mode)]` or #[pallet(dev_mode)]. 2 | --> tests/pallet_ui/attr_non_empty.rs:1:26 3 | | 4 | 1 | #[frame_support::pallet [foo]] 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_conflicting_indices.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::DispatchResultWithPostInfo; 4 | 5 | #[pallet::config] 6 | pub trait Config: frame_system::Config {} 7 | 8 | #[pallet::pallet] 9 | pub struct Pallet(core::marker::PhantomData); 10 | 11 | #[pallet::call] 12 | impl Pallet { 13 | #[pallet::weight(0)] 14 | #[pallet::call_index(10)] 15 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} 16 | 17 | #[pallet::weight(0)] 18 | #[pallet::call_index(10)] 19 | pub fn bar(origin: OriginFor) -> DispatchResultWithPostInfo {} 20 | } 21 | } 22 | 23 | fn main() { 24 | } 25 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_conflicting_indices.stderr: -------------------------------------------------------------------------------- 1 | error: Call indices are conflicting: Both functions foo and bar are at index 10 2 | --> tests/pallet_ui/call_conflicting_indices.rs:15:10 3 | | 4 | 15 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} 5 | | ^^^ 6 | 7 | error: Call indices are conflicting: Both functions foo and bar are at index 10 8 | --> tests/pallet_ui/call_conflicting_indices.rs:19:10 9 | | 10 | 19 | pub fn bar(origin: OriginFor) -> DispatchResultWithPostInfo {} 11 | | ^^^ 12 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_index_has_suffix.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::DispatchResultWithPostInfo; 4 | use frame_system::pallet_prelude::OriginFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::call] 13 | impl Pallet { 14 | #[pallet::call_index(0something)] 15 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} 16 | } 17 | } 18 | 19 | fn main() { 20 | } 21 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_index_has_suffix.stderr: -------------------------------------------------------------------------------- 1 | error: Number literal must not have a suffix 2 | --> tests/pallet_ui/call_index_has_suffix.rs:14:30 3 | | 4 | 14 | #[pallet::call_index(0something)] 5 | | ^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_invalid_attr.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::DispatchResultWithPostInfo; 4 | use frame_system::pallet_prelude::OriginFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::call] 13 | impl Pallet { 14 | #[pallet::weird_attr] 15 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} 16 | } 17 | } 18 | 19 | fn main() { 20 | } 21 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_invalid_attr.stderr: -------------------------------------------------------------------------------- 1 | error: expected `weight` or `call_index` 2 | --> tests/pallet_ui/call_invalid_attr.rs:14:13 3 | | 4 | 14 | #[pallet::weird_attr] 5 | | ^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_invalid_const.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet { 17 | const Foo: u8 = 3u8; 18 | } 19 | } 20 | 21 | fn main() { 22 | } 23 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_invalid_const.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::call, only method accepted 2 | --> $DIR/call_invalid_const.rs:17:3 3 | | 4 | 17 | const Foo: u8 = 3u8; 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_invalid_index.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::DispatchResultWithPostInfo; 4 | use frame_system::pallet_prelude::OriginFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::call] 13 | impl Pallet { 14 | #[pallet::weight(0)] 15 | #[pallet::call_index(256)] 16 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} 17 | } 18 | } 19 | 20 | fn main() { 21 | } 22 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_invalid_index.stderr: -------------------------------------------------------------------------------- 1 | error: number too large to fit in target type 2 | --> tests/pallet_ui/call_invalid_index.rs:15:24 3 | | 4 | 15 | #[pallet::call_index(256)] 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_invalid_origin_type.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet { 17 | pub fn foo(origin: u8) {} 18 | } 19 | } 20 | 21 | fn main() { 22 | } 23 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_invalid_origin_type.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid type: expected `OriginFor` 2 | --> $DIR/call_invalid_origin_type.rs:17:22 3 | | 4 | 17 | pub fn foo(origin: u8) {} 5 | | ^^ 6 | 7 | error: expected `OriginFor` 8 | --> $DIR/call_invalid_origin_type.rs:17:22 9 | | 10 | 17 | pub fn foo(origin: u8) {} 11 | | ^^ 12 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_invalid_return.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::{BlockNumberFor, OriginFor}; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet { 17 | pub fn foo(origin: OriginFor) -> ::DispatchResult { todo!() } 18 | } 19 | } 20 | 21 | fn main() { 22 | } 23 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_invalid_return.stderr: -------------------------------------------------------------------------------- 1 | error: expected `DispatchResultWithPostInfo` or `DispatchResult` 2 | --> tests/pallet_ui/call_invalid_return.rs:17:39 3 | | 4 | 17 | pub fn foo(origin: OriginFor) -> ::DispatchResult { todo!() } 5 | | ^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_invalid_vis.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::call, dispatchable function must be public: `pub fn` 2 | --> $DIR/call_invalid_vis.rs:20:3 3 | | 4 | 20 | fn foo(origin: OriginFor) -> DispatchResultWithPostInfo { 5 | | ^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_invalid_vis_2.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::call, dispatchable function must be public: `pub fn` 2 | --> $DIR/call_invalid_vis_2.rs:20:3 3 | | 4 | 20 | pub(crate) fn foo(origin: OriginFor) -> DispatchResultWithPostInfo { 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_missing_index.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::DispatchResult; 4 | use frame_system::pallet_prelude::OriginFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::call] 13 | impl Pallet { 14 | #[pallet::weight(0)] 15 | pub fn foo(_: OriginFor) -> DispatchResult { 16 | Ok(()) 17 | } 18 | } 19 | } 20 | 21 | fn main() { 22 | } 23 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_missing_weight.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::{Hooks, DispatchResultWithPostInfo}; 4 | use frame_system::pallet_prelude::{BlockNumberFor, OriginFor}; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet { 17 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} 18 | } 19 | } 20 | 21 | fn main() { 22 | } 23 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_missing_weight.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::call, requires weight attribute i.e. `#[pallet::weight($expr)]` 2 | --> $DIR/call_missing_weight.rs:17:7 3 | | 4 | 17 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} 5 | | ^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_multiple_call_index.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::DispatchResultWithPostInfo; 4 | use frame_system::pallet_prelude::OriginFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::call] 13 | impl Pallet { 14 | #[pallet::weight(0)] 15 | #[pallet::call_index(1)] 16 | #[pallet::call_index(2)] 17 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} 18 | } 19 | } 20 | 21 | fn main() { 22 | } 23 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_multiple_call_index.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::call, too many call_index attributes given 2 | --> tests/pallet_ui/call_multiple_call_index.rs:17:7 3 | | 4 | 17 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo {} 5 | | ^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_no_origin.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet { 17 | pub fn foo() {} 18 | } 19 | } 20 | 21 | fn main() { 22 | } 23 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_no_origin.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::call, must have at least origin arg 2 | --> $DIR/call_no_origin.rs:17:7 3 | | 4 | 17 | pub fn foo() {} 5 | | ^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_no_return.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::{BlockNumberFor, OriginFor}; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet { 17 | pub fn foo(origin: OriginFor) {} 18 | } 19 | } 20 | 21 | fn main() { 22 | } 23 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_no_return.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::call, require return type DispatchResultWithPostInfo 2 | --> $DIR/call_no_return.rs:17:7 3 | | 4 | 17 | pub fn foo(origin: OriginFor) {} 5 | | ^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/dev_mode_without_arg.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::call, requires weight attribute i.e. `#[pallet::weight($expr)]` 2 | --> tests/pallet_ui/dev_mode_without_arg.rs:24:7 3 | | 4 | 24 | pub fn my_call(_origin: OriginFor) -> DispatchResult { 5 | | ^^ 6 | 7 | error[E0432]: unresolved import `pallet` 8 | --> tests/pallet_ui/dev_mode_without_arg.rs:3:9 9 | | 10 | 3 | pub use pallet::*; 11 | | ^^^^^^ help: a similar path exists: `test_pallet::pallet` 12 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/duplicate_call_attr.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid duplicated attribute 2 | --> $DIR/duplicate_call_attr.rs:23:12 3 | | 4 | 23 | #[pallet::call] 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/duplicate_store_attr.stderr: -------------------------------------------------------------------------------- 1 | error: Unexpected duplicated attribute 2 | --> $DIR/duplicate_store_attr.rs:12:12 3 | | 4 | 12 | #[pallet::generate_store(trait Store)] 5 | | ^^^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/error_does_not_derive_pallet_error.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | #[pallet::config] 4 | pub trait Config: frame_system::Config {} 5 | 6 | #[pallet::pallet] 7 | pub struct Pallet(core::marker::PhantomData); 8 | 9 | #[pallet::error] 10 | pub enum Error { 11 | CustomError(crate::MyError), 12 | } 13 | } 14 | 15 | #[derive(scale_info::TypeInfo, codec::Encode, codec::Decode)] 16 | enum MyError {} 17 | 18 | fn main() { 19 | } 20 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/error_where_clause.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::error] 19 | pub enum Error where u32: From {} 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/error_where_clause.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::error, where clause is not allowed on pallet error item 2 | --> $DIR/error_where_clause.rs:19:20 3 | | 4 | 19 | pub enum Error where u32: From {} 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/error_wrong_item.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::error] 19 | pub struct Foo; 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/error_wrong_item.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::error, expected item enum 2 | --> $DIR/error_wrong_item.rs:19:2 3 | | 4 | 19 | pub struct Foo; 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/error_wrong_item_name.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::error] 19 | pub enum Foo {} 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/error_wrong_item_name.stderr: -------------------------------------------------------------------------------- 1 | error: expected `Error` 2 | --> $DIR/error_wrong_item_name.rs:19:11 3 | | 4 | 19 | pub enum Foo {} 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/event_not_in_trait.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config { 8 | type Bar; 9 | } 10 | 11 | #[pallet::pallet] 12 | pub struct Pallet(core::marker::PhantomData); 13 | 14 | #[pallet::hooks] 15 | impl Hooks> for Pallet {} 16 | 17 | #[pallet::call] 18 | impl Pallet {} 19 | 20 | #[pallet::event] 21 | pub enum Event { 22 | B { b: T::Bar }, 23 | } 24 | } 25 | 26 | fn main() { 27 | } 28 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/event_not_in_trait.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid usage of RuntimeEvent, `Config` contains no associated type `RuntimeEvent`, but enum `Event` is declared (in use of `#[pallet::event]`). An RuntimeEvent associated type must be declare on trait `Config`. 2 | --> $DIR/event_not_in_trait.rs:1:1 3 | | 4 | 1 | #[frame_support::pallet] 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^ 6 | | 7 | = note: this error originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info) 8 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/event_type_invalid_bound.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config { 8 | type Bar; 9 | type RuntimeEvent; 10 | } 11 | 12 | #[pallet::pallet] 13 | pub struct Pallet(core::marker::PhantomData); 14 | 15 | #[pallet::hooks] 16 | impl Hooks> for Pallet {} 17 | 18 | #[pallet::call] 19 | impl Pallet {} 20 | 21 | #[pallet::event] 22 | pub enum Event { 23 | B { b: T::Bar }, 24 | } 25 | } 26 | 27 | fn main() { 28 | } 29 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/event_type_invalid_bound.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid `type RuntimeEvent`, associated type `RuntimeEvent` is reserved and must bound: `IsType<::RuntimeEvent>` 2 | --> $DIR/event_type_invalid_bound.rs:9:3 3 | | 4 | 9 | type RuntimeEvent; 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/event_type_invalid_bound_2.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid `type RuntimeEvent`, associated type `RuntimeEvent` is reserved and must bound: `From` or `From>` or `From>` 2 | --> $DIR/event_type_invalid_bound_2.rs:9:3 3 | | 4 | 9 | type RuntimeEvent: IsType<::RuntimeEvent>; 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/event_wrong_item.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::event] 19 | pub struct Foo; 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/event_wrong_item.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::event, expected item enum 2 | --> $DIR/event_wrong_item.rs:19:2 3 | | 4 | 19 | pub struct Foo; 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/event_wrong_item_name.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::event] 19 | pub enum Foo {} 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/event_wrong_item_name.stderr: -------------------------------------------------------------------------------- 1 | error: expected `Event` 2 | --> $DIR/event_wrong_item_name.rs:19:11 3 | | 4 | 19 | pub enum Foo {} 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/genesis_inconsistent_build_config.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::genesis_build] 19 | impl GenesisBuild for GenesisConfig {} 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/genesis_inconsistent_build_config.stderr: -------------------------------------------------------------------------------- 1 | error: `#[pallet::genesis_config]` and `#[pallet::genesis_build]` attributes must be either both used or both not used, instead genesis_config is unused and genesis_build is used 2 | --> $DIR/genesis_inconsistent_build_config.rs:2:1 3 | | 4 | 2 | mod pallet { 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/genesis_invalid_generic.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::genesis_build] 19 | impl GenesisBuild for GenesisConfig {} 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/genesis_invalid_generic.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid genesis builder: expected `GenesisBuild` or `GenesisBuild` 2 | --> $DIR/genesis_invalid_generic.rs:19:7 3 | | 4 | 19 | impl GenesisBuild for GenesisConfig {} 5 | | ^^^^^^^^^^^^ 6 | 7 | error: expected `<` 8 | --> $DIR/genesis_invalid_generic.rs:1:1 9 | | 10 | 1 | #[frame_support::pallet] 11 | | ^^^^^^^^^^^^^^^^^^^^^^^^ 12 | | 13 | = note: this error originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info) 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/genesis_wrong_name.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::genesis_build] 19 | impl Foo {} 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/genesis_wrong_name.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::genesis_build, expected impl<..> GenesisBuild<..> for GenesisConfig<..> 2 | --> $DIR/genesis_wrong_name.rs:19:2 3 | | 4 | 19 | impl Foo {} 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/hooks_invalid_item.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | 5 | #[pallet::config] 6 | pub trait Config: frame_system::Config {} 7 | 8 | #[pallet::pallet] 9 | pub struct Pallet(_); 10 | 11 | #[pallet::hooks] 12 | impl Hooks for Pallet {} 13 | 14 | #[pallet::call] 15 | impl Pallet {} 16 | } 17 | 18 | fn main() { 19 | } 20 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/hooks_invalid_item.stderr: -------------------------------------------------------------------------------- 1 | error[E0107]: missing generics for trait `Hooks` 2 | --> tests/pallet_ui/hooks_invalid_item.rs:12:18 3 | | 4 | 12 | impl Hooks for Pallet {} 5 | | ^^^^^ expected 1 generic argument 6 | | 7 | note: trait defined here, with 1 generic parameter: `BlockNumber` 8 | --> $WORKSPACE/frame/support/src/traits/hooks.rs 9 | | 10 | | pub trait Hooks { 11 | | ^^^^^ ----------- 12 | help: add missing generic argument 13 | | 14 | 12 | impl Hooks for Pallet {} 15 | | ~~~~~~~~~~~~~~~~~~ 16 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/inconsistent_instance_1.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | } 18 | 19 | fn main() { 20 | } 21 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/inconsistent_instance_2.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData<(T, I)>); 11 | 12 | #[pallet::hooks] 13 | impl, I: 'static> Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl, I: 'static> Pallet {} 17 | } 18 | 19 | fn main() { 20 | } 21 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/inherent_check_inner_span.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::{Hooks, ProvideInherent}; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::inherent] 19 | impl ProvideInherent for Pallet {} 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/inherent_invalid_item.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::inherent] 19 | impl Foo {} 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/inherent_invalid_item.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::inherent, expected impl<..> ProvideInherent for Pallet<..> 2 | --> $DIR/inherent_invalid_item.rs:19:2 3 | | 4 | 19 | impl Foo {} 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/mod_not_inlined.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod foo; 3 | 4 | fn main() { 5 | } 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/mod_not_inlined.stderr: -------------------------------------------------------------------------------- 1 | error[E0658]: non-inline modules in proc macro input are unstable 2 | --> $DIR/mod_not_inlined.rs:2:1 3 | | 4 | 2 | mod foo; 5 | | ^^^^^^^^ 6 | | 7 | = note: see issue #54727 for more information 8 | 9 | error: Invalid pallet definition, expected mod to be inlined. 10 | --> $DIR/mod_not_inlined.rs:2:1 11 | | 12 | 2 | mod foo; 13 | | ^^^ 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/pallet_invalid_arg.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet(foo)] 2 | pub mod pallet {} 3 | 4 | fn main() {} 5 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/pallet_invalid_arg.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet macro call: unexpected attribute. Macro call must be bare, such as `#[frame_support::pallet]` or `#[pallet]`, or must specify the `dev_mode` attribute, such as `#[frame_support::pallet(dev_mode)]` or #[pallet(dev_mode)]. 2 | --> tests/pallet_ui/pallet_invalid_arg.rs:1:25 3 | | 4 | 1 | #[frame_support::pallet(foo)] 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::{Hooks, StorageValue}; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | #[pallet::without_storage_info] 11 | pub struct Pallet(core::marker::PhantomData); 12 | 13 | #[pallet::hooks] 14 | impl Hooks> for Pallet {} 15 | 16 | #[pallet::call] 17 | impl Pallet {} 18 | 19 | struct Bar; 20 | 21 | #[pallet::storage] 22 | type Foo = StorageValue; 23 | } 24 | 25 | fn main() { 26 | } 27 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::{Hooks, StorageValue}; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | #[pallet::without_storage_info] 11 | pub struct Pallet(core::marker::PhantomData); 12 | 13 | #[pallet::hooks] 14 | impl Hooks> for Pallet {} 15 | 16 | #[pallet::call] 17 | impl Pallet {} 18 | 19 | struct Bar; 20 | 21 | #[pallet::storage] 22 | type Foo = StorageValue<_, Bar>; 23 | } 24 | 25 | fn main() { 26 | } 27 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_incomplete_item.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::storage] 19 | type Foo; 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_incomplete_item.stderr: -------------------------------------------------------------------------------- 1 | error: free type alias without body 2 | --> $DIR/storage_incomplete_item.rs:19:2 3 | | 4 | 19 | type Foo; 5 | | ^^^^^^^^- 6 | | | 7 | | help: provide a definition for the type: `= ;` 8 | 9 | error[E0433]: failed to resolve: use of undeclared crate or module `pallet` 10 | --> $DIR/storage_incomplete_item.rs:18:4 11 | | 12 | 18 | #[pallet::storage] 13 | | ^^^^^^ use of undeclared crate or module `pallet` 14 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_invalid_attribute.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(_); 11 | 12 | #[pallet::call] 13 | impl Pallet {} 14 | 15 | #[pallet::storage] 16 | #[pallet::generate_store(pub trait Store)] 17 | type Foo = StorageValue; 18 | } 19 | 20 | fn main() { 21 | } 22 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_invalid_attribute.stderr: -------------------------------------------------------------------------------- 1 | error: expected one of: `getter`, `storage_prefix`, `unbounded`, `whitelist_storage` 2 | --> $DIR/storage_invalid_attribute.rs:16:12 3 | | 4 | 16 | #[pallet::generate_store(pub trait Store)] 5 | | ^^^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_invalid_first_generic.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::storage] 19 | type Foo = StorageValue; 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_invalid_first_generic.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::storage, for unnamed generic arguments the type first generic argument must be `_`, the argument is then replaced by macro. 2 | --> $DIR/storage_invalid_first_generic.rs:19:29 3 | | 4 | 19 | type Foo = StorageValue; 5 | | ^^ 6 | 7 | error: expected `_` 8 | --> $DIR/storage_invalid_first_generic.rs:19:29 9 | | 10 | 19 | type Foo = StorageValue; 11 | | ^^ 12 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_invalid_rename_value.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::storage] 13 | #[pallet::storage_prefix = "pub"] 14 | type Foo = StorageValue<_, u8>; 15 | } 16 | 17 | fn main() { 18 | } 19 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_invalid_rename_value.stderr: -------------------------------------------------------------------------------- 1 | error: `pub` is not a valid identifier 2 | --> $DIR/storage_invalid_rename_value.rs:13:29 3 | | 4 | 13 | #[pallet::storage_prefix = "pub"] 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_multiple_getters.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::storage] 19 | #[pallet::getter(fn get_foo)] 20 | #[pallet::getter(fn foo_error)] 21 | type Foo = StorageValue<_, u8>; 22 | } 23 | 24 | fn main() { 25 | } 26 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_multiple_getters.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid attribute: Duplicate attribute 2 | --> $DIR/storage_multiple_getters.rs:20:3 3 | | 4 | 20 | #[pallet::getter(fn foo_error)] 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_multiple_renames.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::storage] 19 | #[pallet::storage_prefix = "Bar"] 20 | #[pallet::storage_prefix = "Baz"] 21 | type Foo = StorageValue<_, u8>; 22 | } 23 | 24 | fn main() { 25 | } 26 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_multiple_renames.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid attribute: Duplicate attribute 2 | --> $DIR/storage_multiple_renames.rs:20:3 3 | | 4 | 20 | #[pallet::storage_prefix = "Baz"] 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_not_storage_type.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::storage] 19 | type Foo = u8; 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_not_storage_type.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::storage, expected ident: `StorageValue` or `StorageMap` or `CountedStorageMap` or `StorageDoubleMap` or `StorageNMap` in order to expand metadata, found `u8`. 2 | --> $DIR/storage_not_storage_type.rs:19:16 3 | | 4 | 19 | type Foo = u8; 5 | | ^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_result_query_missing_generics.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::*; 4 | 5 | #[pallet::config] 6 | pub trait Config: frame_system::Config {} 7 | 8 | #[pallet::pallet] 9 | pub struct Pallet(core::marker::PhantomData); 10 | 11 | #[pallet::error] 12 | pub enum Error { 13 | NonExistentValue, 14 | } 15 | 16 | #[pallet::storage] 17 | type Foo = StorageValue<_, u8, ResultQuery>; 18 | } 19 | 20 | fn main() { 21 | } 22 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_result_query_multiple_type_args.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::*; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::error] 13 | pub enum Error { 14 | NonExistentValue, 15 | SomeOtherError, 16 | } 17 | 18 | #[pallet::storage] 19 | type Foo = StorageValue<_, u8, ResultQuery::NonExistentValue, SomeOtherError>>; 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_result_query_multiple_type_args.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::storage, unexpected number of generic arguments for ResultQuery, expected 1 type argument, found 2 2 | --> tests/pallet_ui/storage_result_query_multiple_type_args.rs:19:56 3 | | 4 | 19 | type Foo = StorageValue<_, u8, ResultQuery::NonExistentValue, SomeOtherError>>; 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_result_query_no_defined_pallet_error.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::*; 4 | 5 | #[pallet::config] 6 | pub trait Config: frame_system::Config {} 7 | 8 | #[pallet::pallet] 9 | pub struct Pallet(core::marker::PhantomData); 10 | 11 | #[pallet::storage] 12 | type Foo = StorageValue<_, u8, ResultQuery>; 13 | } 14 | 15 | fn main() { 16 | } 17 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_result_query_no_defined_pallet_error.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::storage, unexpected number of path segments for the generics in ResultQuery, expected a path with at least 2 segments, found 1 2 | --> tests/pallet_ui/storage_result_query_no_defined_pallet_error.rs:12:56 3 | | 4 | 12 | type Foo = StorageValue<_, u8, ResultQuery>; 5 | | ^^^^^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_result_query_parenthesized_generics.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::*; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::error] 13 | pub enum Error { 14 | NonExistentValue, 15 | } 16 | 17 | #[pallet::storage] 18 | type Foo = StorageValue<_, u8, ResultQuery(NonExistentValue)>; 19 | } 20 | 21 | fn main() { 22 | } 23 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_result_query_parenthesized_generics.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::storage, unexpected generic args for ResultQuery, expected angle-bracketed arguments, found `(NonExistentValue)` 2 | --> tests/pallet_ui/storage_result_query_parenthesized_generics.rs:18:55 3 | | 4 | 18 | type Foo = StorageValue<_, u8, ResultQuery(NonExistentValue)>; 5 | | ^^^^^^^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_result_query_wrong_generic_kind.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::*; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::error] 13 | pub enum Error { 14 | NonExistentValue, 15 | } 16 | 17 | #[pallet::storage] 18 | type Foo = StorageValue<_, u8, ResultQuery<'static>>; 19 | } 20 | 21 | fn main() { 22 | } 23 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_result_query_wrong_generic_kind.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::storage, unexpected generic argument kind, expected a type path to a `PalletError` enum variant, found `'static` 2 | --> tests/pallet_ui/storage_result_query_wrong_generic_kind.rs:18:56 3 | | 4 | 18 | type Foo = StorageValue<_, u8, ResultQuery<'static>>; 5 | | ^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_value_duplicate_named_generic.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::{Hooks, StorageValue}; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::storage] 19 | type Foo = StorageValue; 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_value_duplicate_named_generic.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::storage, Duplicated named generic 2 | --> $DIR/storage_value_duplicate_named_generic.rs:19:42 3 | | 4 | 19 | type Foo = StorageValue; 5 | | ^^^^^ 6 | 7 | error: Invalid pallet::storage, Duplicated named generic 8 | --> $DIR/storage_value_duplicate_named_generic.rs:19:29 9 | | 10 | 19 | type Foo = StorageValue; 11 | | ^^^^^ 12 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_value_generic_named_and_unnamed.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::{Hooks, StorageValue, OptionQuery}; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::storage] 19 | type Foo = StorageValue; 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_value_generic_named_and_unnamed.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::storage, invalid generic declaration for storage. Expect only type generics or binding generics, e.g. `` or ``. 2 | --> $DIR/storage_value_generic_named_and_unnamed.rs:19:16 3 | | 4 | 19 | type Foo = StorageValue; 5 | | ^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_value_no_generic.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::storage] 19 | type Foo = StorageValue; 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_value_no_generic.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::storage, invalid number of generic generic arguments, expect more that 0 generic arguments. 2 | --> $DIR/storage_value_no_generic.rs:19:16 3 | | 4 | 19 | type Foo = StorageValue; 5 | | ^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_value_unexpected_named_generic.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::{Hooks, StorageValue}; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::storage] 19 | type Foo = StorageValue

; 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_value_unexpected_named_generic.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::storage, Unexpected generic `P` for `StorageValue`. `StorageValue` expect generics `Value`, and optional generics `QueryKind`, `OnEmpty`. 2 | --> $DIR/storage_value_unexpected_named_generic.rs:19:29 3 | | 4 | 19 | type Foo = StorageValue

; 5 | | ^ 6 | 7 | error: Invalid pallet::storage, cannot find `Value` generic, required for `StorageValue`. 8 | --> $DIR/storage_value_unexpected_named_generic.rs:19:28 9 | | 10 | 19 | type Foo = StorageValue

; 11 | | ^ 12 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_wrong_item.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::storage] 19 | impl Foo {} 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/storage_wrong_item.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::storage, expect item type. 2 | --> $DIR/storage_wrong_item.rs:19:2 3 | | 4 | 19 | impl Foo {} 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/store_trait_leak_private.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | use frame_support::pallet_prelude::StorageValue; 6 | 7 | #[pallet::config] 8 | pub trait Config: frame_system::Config {} 9 | 10 | #[pallet::pallet] 11 | #[pallet::generate_store(pub trait Store)] 12 | pub struct Pallet(core::marker::PhantomData); 13 | 14 | #[pallet::hooks] 15 | impl Hooks> for Pallet {} 16 | 17 | #[pallet::call] 18 | impl Pallet {} 19 | 20 | #[pallet::storage] 21 | type Foo = StorageValue<_, u8>; 22 | } 23 | 24 | fn main() { 25 | } 26 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/store_trait_leak_private.stderr: -------------------------------------------------------------------------------- 1 | error[E0446]: private type `_GeneratedPrefixForStorageFoo` in public interface 2 | --> $DIR/store_trait_leak_private.rs:11:37 3 | | 4 | 11 | #[pallet::generate_store(pub trait Store)] 5 | | ^^^^^ can't leak private type 6 | ... 7 | 20 | #[pallet::storage] 8 | | ------- `_GeneratedPrefixForStorageFoo` declared as private 9 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/trait_constant_invalid_bound.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config { 8 | #[pallet::constant] 9 | type U; 10 | } 11 | 12 | #[pallet::pallet] 13 | pub struct Pallet(core::marker::PhantomData); 14 | 15 | #[pallet::hooks] 16 | impl Hooks> for Pallet {} 17 | 18 | #[pallet::call] 19 | impl Pallet {} 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/trait_constant_invalid_bound.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid usage of `#[pallet::constant]`: `Get` trait bound not found 2 | --> $DIR/trait_constant_invalid_bound.rs:9:3 3 | | 4 | 9 | type U; 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/trait_constant_invalid_bound_lifetime.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config { 8 | #[pallet::constant] 9 | type U: Get<'static>; 10 | } 11 | 12 | #[pallet::pallet] 13 | pub struct Pallet(core::marker::PhantomData); 14 | 15 | #[pallet::hooks] 16 | impl Hooks> for Pallet {} 17 | 18 | #[pallet::call] 19 | impl Pallet {} 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/trait_constant_invalid_bound_lifetime.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid usage of `#[pallet::constant]`: Expected a type argument 2 | --> $DIR/trait_constant_invalid_bound_lifetime.rs:9:15 3 | | 4 | 9 | type U: Get<'static>; 5 | | ^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/trait_invalid_item.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config { 8 | #[pallet::constant] 9 | const U: u8 = 3; 10 | } 11 | 12 | #[pallet::pallet] 13 | pub struct Pallet(core::marker::PhantomData); 14 | 15 | #[pallet::hooks] 16 | impl Hooks> for Pallet {} 17 | 18 | #[pallet::call] 19 | impl Pallet {} 20 | } 21 | 22 | fn main() { 23 | } 24 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/trait_invalid_item.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::constant in pallet::config, expected type trait item 2 | --> $DIR/trait_invalid_item.rs:9:3 3 | | 4 | 9 | const U: u8 = 3; 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/trait_no_supertrait.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config { 8 | } 9 | 10 | #[pallet::pallet] 11 | pub struct Pallet(core::marker::PhantomData); 12 | 13 | #[pallet::hooks] 14 | impl Hooks> for Pallet {} 15 | 16 | #[pallet::call] 17 | impl Pallet {} 18 | } 19 | 20 | fn main() { 21 | } 22 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/trait_no_supertrait.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::trait, expected explicit `frame_system::Config` as supertrait, found none. (try `pub trait Config: frame_system::Config { ...` or `pub trait Config: frame_system::Config { ...`). To disable this check, use `#[pallet::disable_frame_system_supertrait_check]` 2 | --> $DIR/trait_no_supertrait.rs:7:2 3 | | 4 | 7 | pub trait Config { 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/type_value_error_in_block.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::Hooks; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(_); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::type_value] fn Foo() -> u32 { 19 | // Just wrong code to see span 20 | u32::new() 21 | } 22 | } 23 | 24 | fn main() { 25 | } 26 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/type_value_error_in_block.stderr: -------------------------------------------------------------------------------- 1 | error[E0599]: no function or associated item named `new` found for type `u32` in the current scope 2 | --> $DIR/type_value_error_in_block.rs:20:8 3 | | 4 | 20 | u32::new() 5 | | ^^^ function or associated item not found in `u32` 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/type_value_invalid_item.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::{Hooks, PhantomData}; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(_); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::type_value] struct Foo; 19 | } 20 | 21 | fn main() { 22 | } 23 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/type_value_invalid_item.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::type_value, expected item fn 2 | --> $DIR/type_value_invalid_item.rs:18:24 3 | | 4 | 18 | #[pallet::type_value] struct Foo; 5 | | ^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/type_value_no_return.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::{Hooks, PhantomData}; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(_); 11 | 12 | #[pallet::hooks] 13 | impl Hooks> for Pallet {} 14 | 15 | #[pallet::call] 16 | impl Pallet {} 17 | 18 | #[pallet::type_value] fn Foo() {} 19 | } 20 | 21 | fn main() { 22 | } 23 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/type_value_no_return.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::type_value, expected return type 2 | --> $DIR/type_value_no_return.rs:18:24 3 | | 4 | 18 | #[pallet::type_value] fn Foo() {} 5 | | ^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/weight_argument_has_suffix.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::DispatchResultWithPostInfo; 4 | use frame_system::pallet_prelude::OriginFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config {} 8 | 9 | #[pallet::pallet] 10 | pub struct Pallet(core::marker::PhantomData); 11 | 12 | #[pallet::call] 13 | impl Pallet { 14 | #[pallet::call_index(0)] 15 | #[pallet::weight(10_000something)] 16 | pub fn foo(origin: OriginFor) -> DispatchResultWithPostInfo { Ok(().into()) } 17 | } 18 | } 19 | 20 | fn main() { 21 | } 22 | -------------------------------------------------------------------------------- /frame/support/test/tests/storage_alias_ui/checks_for_valid_storage_type.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::storage_alias] 2 | type Ident = StorageValue; 3 | 4 | fn main() {} 5 | -------------------------------------------------------------------------------- /frame/support/test/tests/storage_alias_ui/checks_for_valid_storage_type.stderr: -------------------------------------------------------------------------------- 1 | error: If there are no generics, the prefix is only allowed to be an identifier. 2 | --> tests/storage_alias_ui/checks_for_valid_storage_type.rs:2:27 3 | | 4 | 2 | type Ident = StorageValue; 5 | | ^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/storage_alias_ui/forbid_underscore_as_prefix.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::storage_alias] 2 | type Ident = CustomStorage; 3 | 4 | fn main() {} 5 | -------------------------------------------------------------------------------- /frame/support/test/tests/storage_alias_ui/forbid_underscore_as_prefix.stderr: -------------------------------------------------------------------------------- 1 | error: expected one of: `StorageValue`, `StorageMap`, `StorageDoubleMap`, `StorageNMap` 2 | --> tests/storage_alias_ui/forbid_underscore_as_prefix.rs:2:14 3 | | 4 | 2 | type Ident = CustomStorage; 5 | | ^^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/storage_alias_ui/prefix_must_be_an_ident.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::storage_alias] 2 | type NoUnderscore = StorageValue<_, u32>; 3 | 4 | fn main() {} 5 | -------------------------------------------------------------------------------- /frame/support/test/tests/storage_alias_ui/prefix_must_be_an_ident.stderr: -------------------------------------------------------------------------------- 1 | error: `_` is not allowed as prefix by `storage_alias`. 2 | --> tests/storage_alias_ui/prefix_must_be_an_ident.rs:2:34 3 | | 4 | 2 | type NoUnderscore = StorageValue<_, u32>; 5 | | ^ 6 | -------------------------------------------------------------------------------- /frame/system/benchmarking/README.md: -------------------------------------------------------------------------------- 1 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/system/rpc/runtime-api/README.md: -------------------------------------------------------------------------------- 1 | Runtime API definition required by System RPC extensions. 2 | 3 | This API should be imported and implemented by the runtime, 4 | of a node that wants to use the custom RPC extension 5 | adding System access methods. 6 | 7 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/tds-ipfs-core/src/benchmarking.rs: -------------------------------------------------------------------------------- 1 | //! Benchmarking setup for pallet-template 2 | 3 | use super::*; 4 | 5 | #[allow(unused)] 6 | use crate::Pallet as Template; 7 | use frame_benchmarking::{benchmarks, whitelisted_caller}; 8 | use frame_system::RawOrigin; 9 | 10 | benchmarks! { 11 | impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test); 12 | } 13 | -------------------------------------------------------------------------------- /frame/tds-ipfs-core/src/error.rs: -------------------------------------------------------------------------------- 1 | pub mod pallet { 2 | #[pallet::error] 3 | pub enum Error { 4 | CannotCreateRequest, 5 | RequestTimeout, 6 | RequestFailed, 7 | FailedToAcquireLock, 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /frame/tds-ipfs/README.md: -------------------------------------------------------------------------------- 1 | # TDS IPFS 2 | [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) 3 | 4 | Example implementation to communicate with IPFS via the `tds-ipfs-core` module. 5 | 6 | ## Abstract 7 | 8 | This is an almost complete implementation of available IPFS commands with matching extrinsics, and is coupled to the `tds-ipfs-core` pallet. 9 | Each extrinsic calls a single IPFS command. 10 | 11 | ## Credits 12 | - [TDSoftware](https://github.com/tdsoftware) -------------------------------------------------------------------------------- /frame/tds-ipfs/rpc/runtime-api/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pallet-tds-ipfs-runtime-api" 3 | authors = ['Stefan Lang '] 4 | homepage = "https://www.tdsoftware.de/" 5 | version = "1.0.0" 6 | edition = "2021" 7 | repository = "https://github.com/TDSoftware/substrate-ipfs" 8 | 9 | [package.metadata.docs.rs] 10 | targets = ["x86_64-unknown-linux-gnu"] 11 | 12 | [dependencies] 13 | sp-api = { default-features = false, version = "4.0.0-dev", path = "../../../../primitives/api" } 14 | sp-std = { default-features = false, version = "5.0.0", path = "../../../../primitives/std" } 15 | 16 | [features] 17 | default = ["std"] 18 | std = [ 19 | "sp-api/std", 20 | ] 21 | -------------------------------------------------------------------------------- /frame/tds-ipfs/rpc/runtime-api/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(not(feature = "std"), no_std)] 2 | 3 | // Here we declare the runtime API. It is implemented it the `impl` block in 4 | // runtime file (the `runtime/src/lib.rs`) 5 | sp_api::decl_runtime_apis! { 6 | pub trait TDSIpfsApi { 7 | fn get_file_url_for_cid(cid_bytes: sp_std::vec::Vec) -> sp_std::vec::Vec; 8 | fn get_file_url_for_meta_data(meta_data: sp_std::vec::Vec) -> sp_std::vec::Vec; 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /frame/tds-ipfs/src/benchmarking.rs: -------------------------------------------------------------------------------- 1 | //! Benchmarking setup for pallet-template 2 | 3 | use super::*; 4 | 5 | #[allow(unused)] 6 | use crate::Pallet as Template; 7 | use frame_benchmarking::{benchmarks, whitelisted_caller}; 8 | use frame_system::RawOrigin; 9 | 10 | benchmarks! { 11 | impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test); 12 | } 13 | -------------------------------------------------------------------------------- /frame/tds-ipfs/src/tests.rs: -------------------------------------------------------------------------------- 1 | use pallet_tds_ipfs_core::IpfsCommand; 2 | -------------------------------------------------------------------------------- /frame/transaction-payment/rpc/README.md: -------------------------------------------------------------------------------- 1 | RPC interface for the transaction payment pallet. 2 | 3 | License: Apache-2.0 4 | -------------------------------------------------------------------------------- /frame/transaction-payment/rpc/runtime-api/README.md: -------------------------------------------------------------------------------- 1 | Runtime API definition for transaction payment pallet. 2 | 3 | License: Apache-2.0 4 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/adding_self_parameter.rs: -------------------------------------------------------------------------------- 1 | sp_api::decl_runtime_apis! { 2 | pub trait Api { 3 | fn test(&self); 4 | } 5 | } 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/adding_self_parameter.stderr: -------------------------------------------------------------------------------- 1 | error: `self` as argument not supported. 2 | --> $DIR/adding_self_parameter.rs:3:11 3 | | 4 | 3 | fn test(&self); 5 | | ^ 6 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/changed_in_no_default_method.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime::traits::GetNodeBlockType; 2 | use substrate_test_runtime_client::runtime::Block; 3 | 4 | /// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType` 5 | /// trait are done by the `construct_runtime!` macro in a real runtime. 6 | struct Runtime {} 7 | impl GetNodeBlockType for Runtime { 8 | type NodeBlock = Block; 9 | } 10 | 11 | sp_api::decl_runtime_apis! { 12 | #[api_version(2)] 13 | pub trait Api { 14 | #[changed_in(2)] 15 | fn test(data: u64); 16 | } 17 | } 18 | 19 | fn main() {} 20 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/changed_in_no_default_method.stderr: -------------------------------------------------------------------------------- 1 | error: There is no 'default' method with this name (without `changed_in` attribute). 2 | The 'default' method is used to call into the latest implementation. 3 | --> tests/ui/changed_in_no_default_method.rs:15:6 4 | | 5 | 15 | fn test(data: u64); 6 | | ^^^^ 7 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/changed_in_unknown_version.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime::traits::GetNodeBlockType; 2 | use substrate_test_runtime_client::runtime::Block; 3 | 4 | /// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType` 5 | /// trait are done by the `construct_runtime!` macro in a real runtime. 6 | struct Runtime {} 7 | impl GetNodeBlockType for Runtime { 8 | type NodeBlock = Block; 9 | } 10 | 11 | sp_api::decl_runtime_apis! { 12 | pub trait Api { 13 | #[changed_in(2)] 14 | fn test(data: u64); 15 | fn test(data: u64); 16 | } 17 | } 18 | 19 | fn main() {} 20 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/changed_in_unknown_version.stderr: -------------------------------------------------------------------------------- 1 | error: `changed_in` version can not be greater than the `api_version` 2 | --> $DIR/changed_in_unknown_version.rs:14:3 3 | | 4 | 14 | fn test(data: u64); 5 | | ^^ 6 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/declaring_old_block.rs: -------------------------------------------------------------------------------- 1 | sp_api::decl_runtime_apis! { 2 | pub trait Api { 3 | fn test(); 4 | } 5 | } 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/declaring_old_block.stderr: -------------------------------------------------------------------------------- 1 | error: `Block: BlockT` generic parameter will be added automatically by the `decl_runtime_apis!` macro! If you try to use a different trait than the substrate `Block` trait, please rename it locally. 2 | --> $DIR/declaring_old_block.rs:2:23 3 | | 4 | 2 | pub trait Api { 5 | | ^^^^^^ 6 | 7 | error: `Block: BlockT` generic parameter will be added automatically by the `decl_runtime_apis!` macro! 8 | --> $DIR/declaring_old_block.rs:2:16 9 | | 10 | 2 | pub trait Api { 11 | | ^^^^^ 12 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/declaring_own_block_with_different_name.rs: -------------------------------------------------------------------------------- 1 | sp_api::decl_runtime_apis! { 2 | pub trait Api { 3 | fn test(); 4 | } 5 | } 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/declaring_own_block_with_different_name.stderr: -------------------------------------------------------------------------------- 1 | error: `Block: BlockT` generic parameter will be added automatically by the `decl_runtime_apis!` macro! If you try to use a different trait than the substrate `Block` trait, please rename it locally. 2 | --> $DIR/declaring_own_block_with_different_name.rs:2:19 3 | | 4 | 2 | pub trait Api { 5 | | ^^^^^^ 6 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/empty_impl_runtime_apis_call.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime::traits::GetNodeBlockType; 2 | use substrate_test_runtime_client::runtime::Block; 3 | 4 | /// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType` 5 | /// trait are done by the `construct_runtime!` macro in a real runtime. 6 | struct Runtime {} 7 | impl GetNodeBlockType for Runtime { 8 | type NodeBlock = Block; 9 | } 10 | 11 | sp_api::decl_runtime_apis! { 12 | pub trait Api { 13 | fn test(data: u64); 14 | } 15 | } 16 | 17 | sp_api::impl_runtime_apis! {} 18 | 19 | fn main() {} 20 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/empty_impl_runtime_apis_call.stderr: -------------------------------------------------------------------------------- 1 | error: No api implementation given! 2 | --> $DIR/empty_impl_runtime_apis_call.rs:17:1 3 | | 4 | 17 | sp_api::impl_runtime_apis! {} 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | | 7 | = note: this error originates in the macro `sp_api::impl_runtime_apis` (in Nightly builds, run with -Z macro-backtrace for more info) 8 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/impl_missing_version.stderr: -------------------------------------------------------------------------------- 1 | error[E0433]: failed to resolve: could not find `ApiV4` in `runtime_decl_for_Api` 2 | --> tests/ui/impl_missing_version.rs:21:13 3 | | 4 | 21 | impl self::Api for Runtime { 5 | | ^^^ could not find `ApiV4` in `runtime_decl_for_Api` 6 | 7 | error[E0405]: cannot find trait `ApiV4` in module `self::runtime_decl_for_Api` 8 | --> tests/ui/impl_missing_version.rs:21:13 9 | | 10 | 11 | pub trait Api { 11 | | ------------- similarly named trait `ApiV2` defined here 12 | ... 13 | 21 | impl self::Api for Runtime { 14 | | ^^^ help: a trait with a similar name exists: `ApiV2` 15 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/impl_two_traits_with_same_name.stderr: -------------------------------------------------------------------------------- 1 | error: Two traits with the same name detected! The trait name is used to generate its ID. Please rename one trait at the declaration! 2 | --> $DIR/impl_two_traits_with_same_name.rs:30:15 3 | | 4 | 30 | impl second::Api for Runtime { 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/invalid_api_version_1.rs: -------------------------------------------------------------------------------- 1 | sp_api::decl_runtime_apis! { 2 | #[api_version] 3 | pub trait Api { 4 | fn test(data: u64); 5 | } 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/invalid_api_version_1.stderr: -------------------------------------------------------------------------------- 1 | error: Unexpected `api_version` attribute. The supported format is `api_version(1)` 2 | --> tests/ui/invalid_api_version_1.rs:2:2 3 | | 4 | 2 | #[api_version] 5 | | ^ 6 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/invalid_api_version_2.rs: -------------------------------------------------------------------------------- 1 | sp_api::decl_runtime_apis! { 2 | #[api_version("1")] 3 | pub trait Api { 4 | fn test(data: u64); 5 | } 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/invalid_api_version_2.stderr: -------------------------------------------------------------------------------- 1 | error: Unexpected `api_version` attribute. The supported format is `api_version(1)` 2 | --> tests/ui/invalid_api_version_2.rs:2:2 3 | | 4 | 2 | #[api_version("1")] 5 | | ^ 6 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/invalid_api_version_3.rs: -------------------------------------------------------------------------------- 1 | sp_api::decl_runtime_apis! { 2 | #[api_version()] 3 | pub trait Api { 4 | fn test(data: u64); 5 | } 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/invalid_api_version_3.stderr: -------------------------------------------------------------------------------- 1 | error: Unexpected `api_version` attribute. The supported format is `api_version(1)` 2 | --> tests/ui/invalid_api_version_3.rs:2:2 3 | | 4 | 2 | #[api_version()] 5 | | ^ 6 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/invalid_api_version_4.rs: -------------------------------------------------------------------------------- 1 | sp_api::decl_runtime_apis! { 2 | pub trait Api { 3 | #[api_version("1")] 4 | fn test(data: u64); 5 | } 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/invalid_api_version_4.stderr: -------------------------------------------------------------------------------- 1 | error: Unexpected `api_version` attribute. The supported format is `api_version(1)` 2 | --> tests/ui/invalid_api_version_4.rs:3:3 3 | | 4 | 3 | #[api_version("1")] 5 | | ^ 6 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/method_ver_lower_than_trait_ver.rs: -------------------------------------------------------------------------------- 1 | sp_api::decl_runtime_apis! { 2 | #[api_version(2)] 3 | pub trait Api { 4 | #[api_version(1)] 5 | fn test(data: u64); 6 | } 7 | } 8 | 9 | fn main() {} -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/method_ver_lower_than_trait_ver.stderr: -------------------------------------------------------------------------------- 1 | error: Method version `1` is older than (or equal to) trait version `2`.Methods can't define versions older than the trait version. 2 | --> tests/ui/method_ver_lower_than_trait_ver.rs:4:3 3 | | 4 | 4 | #[api_version(1)] 5 | | ^ 6 | 7 | error: Trait version is set here. 8 | --> tests/ui/method_ver_lower_than_trait_ver.rs:2:2 9 | | 10 | 2 | #[api_version(2)] 11 | | ^ 12 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/missing_block_generic_parameter.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime::traits::GetNodeBlockType; 2 | use substrate_test_runtime_client::runtime::Block; 3 | 4 | /// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType` 5 | /// trait are done by the `construct_runtime!` macro in a real runtime. 6 | struct Runtime {} 7 | impl GetNodeBlockType for Runtime { 8 | type NodeBlock = Block; 9 | } 10 | 11 | sp_api::decl_runtime_apis! { 12 | pub trait Api { 13 | fn test(data: u64); 14 | } 15 | } 16 | 17 | sp_api::impl_runtime_apis! { 18 | impl self::Api for Runtime { 19 | fn test(data: u64) { 20 | unimplemented!() 21 | } 22 | } 23 | } 24 | 25 | fn main() {} 26 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/missing_block_generic_parameter.stderr: -------------------------------------------------------------------------------- 1 | error: Missing `Block` generic parameter. 2 | --> $DIR/missing_block_generic_parameter.rs:18:13 3 | | 4 | 18 | impl self::Api for Runtime { 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/missing_path_for_trait.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime::traits::GetNodeBlockType; 2 | use substrate_test_runtime_client::runtime::Block; 3 | 4 | /// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType` 5 | /// trait are done by the `construct_runtime!` macro in a real runtime. 6 | struct Runtime {} 7 | impl GetNodeBlockType for Runtime { 8 | type NodeBlock = Block; 9 | } 10 | 11 | sp_api::decl_runtime_apis! { 12 | pub trait Api { 13 | fn test(data: u64); 14 | } 15 | } 16 | 17 | sp_api::impl_runtime_apis! { 18 | impl Api for Runtime { 19 | fn test(data: u64) { 20 | unimplemented!() 21 | } 22 | } 23 | } 24 | 25 | fn main() {} 26 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/missing_path_for_trait.stderr: -------------------------------------------------------------------------------- 1 | error: The implemented trait has to be referenced with a path, e.g. `impl client::Core for Runtime`. 2 | --> $DIR/missing_path_for_trait.rs:18:7 3 | | 4 | 18 | impl Api for Runtime { 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/missing_versioned_method.stderr: -------------------------------------------------------------------------------- 1 | error[E0046]: not all trait items implemented, missing: `test3` 2 | --> tests/ui/missing_versioned_method.rs:21:2 3 | | 4 | 15 | fn test3(); 5 | | ----------- `test3` from trait 6 | ... 7 | 21 | impl self::Api for Runtime { 8 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `test3` in implementation 9 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/missing_versioned_method_multiple_vers.stderr: -------------------------------------------------------------------------------- 1 | error[E0046]: not all trait items implemented, missing: `test3` 2 | --> tests/ui/missing_versioned_method_multiple_vers.rs:23:2 3 | | 4 | 15 | fn test3(); 5 | | ----------- `test3` from trait 6 | ... 7 | 23 | impl self::Api for Runtime { 8 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `test3` in implementation 9 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/mock_advanced_block_id_by_value.rs: -------------------------------------------------------------------------------- 1 | use substrate_test_runtime_client::runtime::Block; 2 | use sp_api::ApiError; 3 | 4 | sp_api::decl_runtime_apis! { 5 | pub trait Api { 6 | fn test(); 7 | } 8 | } 9 | 10 | struct MockApi; 11 | 12 | sp_api::mock_impl_runtime_apis! { 13 | impl Api for MockApi { 14 | #[advanced] 15 | fn test(&self, _: BlockId) -> Result<(), ApiError> { 16 | Ok(().into()) 17 | } 18 | } 19 | } 20 | 21 | fn main() {} 22 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/mock_advanced_block_id_by_value.stderr: -------------------------------------------------------------------------------- 1 | error: `BlockId` needs to be taken by reference and not by value! 2 | --> tests/ui/mock_advanced_block_id_by_value.rs:12:1 3 | | 4 | 12 | / sp_api::mock_impl_runtime_apis! { 5 | 13 | | impl Api for MockApi { 6 | 14 | | #[advanced] 7 | 15 | | fn test(&self, _: BlockId) -> Result<(), ApiError> { 8 | ... | 9 | 18 | | } 10 | 19 | | } 11 | | |_^ 12 | | 13 | = note: this error originates in the macro `sp_api::mock_impl_runtime_apis` (in Nightly builds, run with -Z macro-backtrace for more info) 14 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/mock_advanced_missing_blockid.rs: -------------------------------------------------------------------------------- 1 | use substrate_test_runtime_client::runtime::Block; 2 | use sp_api::ApiError; 3 | 4 | sp_api::decl_runtime_apis! { 5 | pub trait Api { 6 | fn test(); 7 | } 8 | } 9 | 10 | struct MockApi; 11 | 12 | sp_api::mock_impl_runtime_apis! { 13 | impl Api for MockApi { 14 | #[advanced] 15 | fn test(&self) -> Result<(), ApiError> { 16 | Ok(().into()) 17 | } 18 | } 19 | } 20 | 21 | fn main() {} 22 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/mock_advanced_missing_blockid.stderr: -------------------------------------------------------------------------------- 1 | error: If using the `advanced` attribute, it is required that the function takes at least one argument, the `BlockId`. 2 | --> tests/ui/mock_advanced_missing_blockid.rs:15:3 3 | | 4 | 15 | fn test(&self) -> Result<(), ApiError> { 5 | | ^^ 6 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/mock_only_one_block_type.rs: -------------------------------------------------------------------------------- 1 | struct Block2; 2 | 3 | sp_api::decl_runtime_apis! { 4 | pub trait Api { 5 | fn test(data: u64); 6 | } 7 | 8 | pub trait Api2 { 9 | fn test(data: u64); 10 | } 11 | } 12 | 13 | struct MockApi; 14 | 15 | sp_api::mock_impl_runtime_apis! { 16 | impl Api for MockApi { 17 | fn test(data: u64) {} 18 | } 19 | 20 | impl Api2 for MockApi { 21 | fn test(data: u64) {} 22 | } 23 | } 24 | 25 | fn main() {} 26 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/mock_only_one_block_type.stderr: -------------------------------------------------------------------------------- 1 | error: Block type should be the same between all runtime apis. 2 | --> $DIR/mock_only_one_block_type.rs:20:12 3 | | 4 | 20 | impl Api2 for MockApi { 5 | | ^^^^^^ 6 | 7 | error: First block type found here 8 | --> $DIR/mock_only_one_block_type.rs:16:11 9 | | 10 | 16 | impl Api for MockApi { 11 | | ^^^^^ 12 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/mock_only_one_self_type.rs: -------------------------------------------------------------------------------- 1 | sp_api::decl_runtime_apis! { 2 | pub trait Api { 3 | fn test(data: u64); 4 | } 5 | 6 | pub trait Api2 { 7 | fn test(data: u64); 8 | } 9 | } 10 | 11 | struct MockApi; 12 | struct MockApi2; 13 | 14 | sp_api::mock_impl_runtime_apis! { 15 | impl Api for MockApi { 16 | fn test(data: u64) {} 17 | } 18 | 19 | impl Api2 for MockApi2 { 20 | fn test(data: u64) {} 21 | } 22 | } 23 | 24 | fn main() {} 25 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/mock_only_one_self_type.stderr: -------------------------------------------------------------------------------- 1 | error: Self type should not change between runtime apis 2 | --> $DIR/mock_only_one_self_type.rs:19:23 3 | | 4 | 19 | impl Api2 for MockApi2 { 5 | | ^^^^^^^^ 6 | 7 | error: First self type found here 8 | --> $DIR/mock_only_one_self_type.rs:15:22 9 | | 10 | 15 | impl Api for MockApi { 11 | | ^^^^^^^ 12 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/mock_only_self_reference.rs: -------------------------------------------------------------------------------- 1 | use substrate_test_runtime_client::runtime::Block; 2 | 3 | sp_api::decl_runtime_apis! { 4 | pub trait Api { 5 | fn test(data: u64); 6 | fn test2(data: u64); 7 | } 8 | } 9 | 10 | struct MockApi; 11 | 12 | sp_api::mock_impl_runtime_apis! { 13 | impl Api for MockApi { 14 | fn test(self, data: u64) {} 15 | 16 | fn test2(&mut self, data: u64) {} 17 | } 18 | } 19 | 20 | fn main() {} 21 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/no_default_implementation.rs: -------------------------------------------------------------------------------- 1 | sp_api::decl_runtime_apis! { 2 | pub trait Api { 3 | fn test() { 4 | println!("Hey, I'm a default implementation!"); 5 | } 6 | } 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/no_default_implementation.stderr: -------------------------------------------------------------------------------- 1 | error: A runtime API function cannot have a default implementation! 2 | --> $DIR/no_default_implementation.rs:3:13 3 | | 4 | 3 | fn test() { 5 | | ___________________^ 6 | 4 | | println!("Hey, I'm a default implementation!"); 7 | 5 | | } 8 | | |_________^ 9 | -------------------------------------------------------------------------------- /primitives/application-crypto/README.md: -------------------------------------------------------------------------------- 1 | Traits and macros for constructing application specific strongly typed crypto wrappers. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/arithmetic/README.md: -------------------------------------------------------------------------------- 1 | Minimal fixed point arithmetic primitives and types for runtime. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/authority-discovery/README.md: -------------------------------------------------------------------------------- 1 | Runtime Api to help discover authorities. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/authorship/README.md: -------------------------------------------------------------------------------- 1 | Authorship Primitives 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/beefy/test-res/large-raw-commitment: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/primitives/beefy/test-res/large-raw-commitment -------------------------------------------------------------------------------- /primitives/block-builder/README.md: -------------------------------------------------------------------------------- 1 | The block builder runtime api. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/blockchain/README.md: -------------------------------------------------------------------------------- 1 | Substrate blockchain traits and primitives. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/consensus/aura/README.md: -------------------------------------------------------------------------------- 1 | Primitives for Aura. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/consensus/babe/README.md: -------------------------------------------------------------------------------- 1 | Primitives for BABE. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/consensus/common/README.md: -------------------------------------------------------------------------------- 1 | Common utilities for building and using consensus engines in substrate. 2 | 3 | Much of this crate is _unstable_ and thus the API is likely to undergo 4 | change. Implementors of traits should not rely on the interfaces to remain 5 | the same. 6 | 7 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/consensus/pow/README.md: -------------------------------------------------------------------------------- 1 | Primitives for Substrate Proof-of-Work (PoW) consensus. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/consensus/slots/README.md: -------------------------------------------------------------------------------- 1 | Primitives for slots-based consensus engines. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/consensus/vrf/README.md: -------------------------------------------------------------------------------- 1 | Primitives for VRF-based consensus engines. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/database/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-database" 3 | version = "4.0.0-dev" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Substrate database trait." 10 | documentation = "https://docs.rs/sp-database" 11 | readme = "README.md" 12 | 13 | [dependencies] 14 | kvdb = "0.13.0" 15 | parking_lot = "0.12.1" 16 | -------------------------------------------------------------------------------- /primitives/database/README.md: -------------------------------------------------------------------------------- 1 | The main database trait, allowing Substrate to store data persistently. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/externalities/README.md: -------------------------------------------------------------------------------- 1 | Substrate externalities abstraction 2 | 3 | The externalities mainly provide access to storage and to registered extensions. Extensions 4 | are for example the keystore or the offchain externalities. These externalities are used to 5 | access the node from the runtime via the runtime interfaces. 6 | 7 | This crate exposes the main [`Externalities`] trait. 8 | 9 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/finality-grandpa/README.md: -------------------------------------------------------------------------------- 1 | Primitives for GRANDPA integration, suitable for WASM compilation. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/io/README.md: -------------------------------------------------------------------------------- 1 | I/O host interface for substrate runtime. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/keyring/README.md: -------------------------------------------------------------------------------- 1 | Support code for the runtime. A set of test accounts. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/maybe-compressed-blob/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-maybe-compressed-blob" 3 | version = "4.1.0-dev" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Handling of blobs, usually Wasm code, which may be compresed" 10 | documentation = "https://docs.rs/sp-maybe-compressed-blob" 11 | readme = "README.md" 12 | 13 | [dependencies] 14 | thiserror = "1.0" 15 | zstd = { version = "0.11.2", default-features = false } 16 | -------------------------------------------------------------------------------- /primitives/maybe-compressed-blob/README.md: -------------------------------------------------------------------------------- 1 | Handling of blobs, typicaly validation code, which may be compressed. 2 | 3 | License: Apache-2.0 4 | -------------------------------------------------------------------------------- /primitives/npos-elections/fuzzer/.gitignore: -------------------------------------------------------------------------------- 1 | hfuzz_target 2 | hfuzz_workspace 3 | -------------------------------------------------------------------------------- /primitives/offchain/README.md: -------------------------------------------------------------------------------- 1 | The Offchain Worker runtime api primitives. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/panic-handler/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-panic-handler" 3 | version = "5.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Custom panic hook with bug report link" 10 | documentation = "https://docs.rs/sp-panic-handler" 11 | readme = "README.md" 12 | 13 | [package.metadata.docs.rs] 14 | targets = ["x86_64-unknown-linux-gnu"] 15 | 16 | [dependencies] 17 | backtrace = "0.3.64" 18 | lazy_static = "1.4.0" 19 | regex = "1.6.0" 20 | -------------------------------------------------------------------------------- /primitives/panic-handler/README.md: -------------------------------------------------------------------------------- 1 | Custom panic hook with bug report link 2 | 3 | This crate provides the [`set`] function, which wraps around [`std::panic::set_hook`] and 4 | sets up a panic hook that prints a backtrace and invites the user to open an issue to the 5 | given URL. 6 | 7 | By default, the panic handler aborts the process by calling [`std::process::exit`]. This can 8 | temporarily be disabled by using an [`AbortGuard`]. 9 | 10 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/rpc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-rpc" 3 | version = "6.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Substrate RPC primitives and utilities." 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | rustc-hash = "1.1.0" 17 | serde = { version = "1.0.136", features = ["derive"] } 18 | sp-core = { version = "7.0.0", path = "../core" } 19 | 20 | [dev-dependencies] 21 | serde_json = "1.0.85" 22 | -------------------------------------------------------------------------------- /primitives/rpc/README.md: -------------------------------------------------------------------------------- 1 | Substrate RPC primitives and utilities. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/no_duplicate_versions.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime_interface::runtime_interface; 2 | 3 | #[runtime_interface] 4 | trait Test { 5 | #[version(2)] 6 | fn test() { } 7 | #[version(2)] 8 | fn test() { } 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/no_duplicate_versions.stderr: -------------------------------------------------------------------------------- 1 | error: Duplicated version attribute 2 | --> $DIR/no_duplicate_versions.rs:7:2 3 | | 4 | 7 | #[version(2)] 5 | | ^ 6 | 7 | error: Previous version with the same number defined here 8 | --> $DIR/no_duplicate_versions.rs:5:2 9 | | 10 | 5 | #[version(2)] 11 | | ^ 12 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/no_gaps_in_versions.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime_interface::runtime_interface; 2 | 3 | #[runtime_interface] 4 | trait Test { 5 | #[version(1)] 6 | fn test2() {} 7 | #[version(2)] 8 | fn test2() {} 9 | #[version(3)] 10 | fn test2() {} 11 | 12 | fn test() { } 13 | #[version(3)] 14 | fn test() { } 15 | } 16 | 17 | fn main() {} 18 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/no_gaps_in_versions.stderr: -------------------------------------------------------------------------------- 1 | error: Unexpected version attribute: missing version '2' for this function 2 | --> $DIR/no_gaps_in_versions.rs:13:2 3 | | 4 | 13 | #[version(3)] 5 | | ^ 6 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/no_generic_parameters_method.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime_interface::runtime_interface; 2 | 3 | #[runtime_interface] 4 | trait Test { 5 | fn test() {} 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/no_generic_parameters_method.stderr: -------------------------------------------------------------------------------- 1 | error: Generic parameters not supported. 2 | --> $DIR/no_generic_parameters_method.rs:5:10 3 | | 4 | 5 | fn test() {} 5 | | ^ 6 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/no_generic_parameters_trait.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime_interface::runtime_interface; 2 | 3 | #[runtime_interface] 4 | trait Test { 5 | fn test() {} 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/no_generic_parameters_trait.stderr: -------------------------------------------------------------------------------- 1 | error: Generic parameters not supported. 2 | --> $DIR/no_generic_parameters_trait.rs:4:12 3 | | 4 | 4 | trait Test { 5 | | ^ 6 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/no_method_implementation.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime_interface::runtime_interface; 2 | 3 | #[runtime_interface] 4 | trait Test { 5 | fn test(); 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/no_method_implementation.stderr: -------------------------------------------------------------------------------- 1 | error: Methods need to have an implementation. 2 | --> $DIR/no_method_implementation.rs:5:2 3 | | 4 | 5 | fn test(); 5 | | ^^ 6 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/pass_by_enum_with_struct.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime_interface::pass_by::PassByEnum; 2 | 3 | #[derive(PassByEnum)] 4 | struct Test; 5 | 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/pass_by_enum_with_struct.stderr: -------------------------------------------------------------------------------- 1 | error: `PassByEnum` only supports enums as input type. 2 | --> $DIR/pass_by_enum_with_struct.rs:3:10 3 | | 4 | 3 | #[derive(PassByEnum)] 5 | | ^^^^^^^^^^ 6 | | 7 | = note: this error originates in the derive macro `PassByEnum` (in Nightly builds, run with -Z macro-backtrace for more info) 8 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/pass_by_enum_with_value_variant.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime_interface::pass_by::PassByEnum; 2 | 3 | #[derive(PassByEnum)] 4 | enum Test { 5 | Var0(u32), 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/pass_by_enum_with_value_variant.stderr: -------------------------------------------------------------------------------- 1 | error: `PassByEnum` only supports unit variants. 2 | --> $DIR/pass_by_enum_with_value_variant.rs:3:10 3 | | 4 | 3 | #[derive(PassByEnum)] 5 | | ^^^^^^^^^^ 6 | | 7 | = note: this error originates in the derive macro `PassByEnum` (in Nightly builds, run with -Z macro-backtrace for more info) 8 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/pass_by_inner_with_two_fields.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime_interface::pass_by::PassByInner; 2 | 3 | #[derive(PassByInner)] 4 | struct Test { 5 | data: u32, 6 | data2: u32, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/pass_by_inner_with_two_fields.stderr: -------------------------------------------------------------------------------- 1 | error: Only newtype/one field structs are supported by `PassByInner`! 2 | --> $DIR/pass_by_inner_with_two_fields.rs:3:10 3 | | 4 | 3 | #[derive(PassByInner)] 5 | | ^^^^^^^^^^^ 6 | | 7 | = note: this error originates in the derive macro `PassByInner` (in Nightly builds, run with -Z macro-backtrace for more info) 8 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/take_self_by_value.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime_interface::runtime_interface; 2 | 3 | #[runtime_interface] 4 | trait Test { 5 | fn test(self) {} 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /primitives/runtime-interface/tests/ui/take_self_by_value.stderr: -------------------------------------------------------------------------------- 1 | error: Taking `Self` by value is not allowed. 2 | --> $DIR/take_self_by_value.rs:5:10 3 | | 4 | 5 | fn test(self) {} 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /primitives/runtime/README.md: -------------------------------------------------------------------------------- 1 | Runtime Modules shared primitive types. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/serializer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-serializer" 3 | version = "4.0.0-dev" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Substrate customizable serde serializer." 10 | documentation = "https://docs.rs/sp-serializer" 11 | readme = "README.md" 12 | 13 | [package.metadata.docs.rs] 14 | targets = ["x86_64-unknown-linux-gnu"] 15 | 16 | [dependencies] 17 | serde = "1.0.136" 18 | serde_json = "1.0.85" 19 | -------------------------------------------------------------------------------- /primitives/serializer/README.md: -------------------------------------------------------------------------------- 1 | Substrate customizable serde serializer. 2 | 3 | The idea is that we can later change the implementation 4 | to something more compact, but for now we're using JSON. 5 | 6 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/session/README.md: -------------------------------------------------------------------------------- 1 | Substrate core types around sessions. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/staking/README.md: -------------------------------------------------------------------------------- 1 | A crate which contains primitives that are useful for implementation that uses staking 2 | approaches in general. Definitions related to sessions, slashing, etc go here. 3 | 4 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/state-machine/README.md: -------------------------------------------------------------------------------- 1 | Substrate state machine implementation. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/std/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-std" 3 | version = "5.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Lowest-abstraction level for the Substrate runtime: just exports useful primitives from std or client/alloc to be used with any code that depends on the runtime." 10 | documentation = "https://docs.rs/sp-std" 11 | readme = "README.md" 12 | 13 | [package.metadata.docs.rs] 14 | targets = ["x86_64-unknown-linux-gnu"] 15 | 16 | [features] 17 | default = ["std"] 18 | std = [] 19 | -------------------------------------------------------------------------------- /primitives/std/README.md: -------------------------------------------------------------------------------- 1 | Lowest-abstraction level for the Substrate runtime: just exports useful primitives from std 2 | or client/alloc to be used with any code that depends on the runtime. 3 | 4 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/storage/README.md: -------------------------------------------------------------------------------- 1 | Primitive types for storage related stuff. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/timestamp/README.md: -------------------------------------------------------------------------------- 1 | Substrate core types and inherents for timestamps. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/transaction-pool/README.md: -------------------------------------------------------------------------------- 1 | Transaction pool primitives types & Runtime API. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/transaction-storage-proof/README.md: -------------------------------------------------------------------------------- 1 | Transaction Storage Proof Primitives 2 | 3 | Contains types and basic code to extract storage proofs for indexed transactions. 4 | 5 | License: Apache-2.0 6 | -------------------------------------------------------------------------------- /primitives/trie/README.md: -------------------------------------------------------------------------------- 1 | Utility functions to interact with Substrate's Base-16 Modified Merkle Patricia tree ("trie"). 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/trie/test-res/invalid-delta-order: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/primitives/trie/test-res/invalid-delta-order -------------------------------------------------------------------------------- /primitives/trie/test-res/proof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/primitives/trie/test-res/proof -------------------------------------------------------------------------------- /primitives/trie/test-res/storage_root: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/primitives/trie/test-res/storage_root -------------------------------------------------------------------------------- /primitives/trie/test-res/valid-delta-order: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/primitives/trie/test-res/valid-delta-order -------------------------------------------------------------------------------- /primitives/version/README.md: -------------------------------------------------------------------------------- 1 | Version module for the Substrate runtime; Provides a function that returns the runtime version. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/wasm-interface/README.md: -------------------------------------------------------------------------------- 1 | Types and traits for interfacing between the host and the wasm runtime. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | # Basic 2 | hard_tabs = true 3 | max_width = 100 4 | use_small_heuristics = "Max" 5 | # Imports 6 | imports_granularity = "Crate" 7 | reorder_imports = true 8 | # Consistency 9 | newline_style = "Unix" 10 | # Format comments 11 | comment_width = 100 12 | wrap_comments = true 13 | # Misc 14 | chain_width = 80 15 | spaces_around_ranges = false 16 | binop_separator = "Back" 17 | reorder_impl_items = false 18 | match_arm_leading_pipes = "Preserve" 19 | match_arm_blocks = false 20 | match_block_trailing_comma = true 21 | trailing_comma = "Vertical" 22 | trailing_semicolon = false 23 | use_field_init_shorthand = true 24 | edition = "2021" 25 | -------------------------------------------------------------------------------- /scripts/ci/gitlab/check_signed.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck source=../common/lib.sh 4 | source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh" 5 | 6 | version="$CI_COMMIT_TAG" 7 | 8 | echo '[+] Checking tag has been signed' 9 | check_tag "paritytech/substrate" "$version" 10 | case $? in 11 | 0) echo '[+] Tag found and has been signed'; exit 0 12 | ;; 13 | 1) echo '[!] Tag found but has not been signed. Aborting release.'; exit 1 14 | ;; 15 | 2) echo '[!] Tag not found. Aborting release.'; exit 1 16 | esac 17 | -------------------------------------------------------------------------------- /scripts/ci/gitlab/crate-publishing-pipeline.yml: -------------------------------------------------------------------------------- 1 | default: !reference [.crate-publishing-pipeline-definitions, default] 2 | -------------------------------------------------------------------------------- /scripts/ci/gitlab/default-pipeline.yml: -------------------------------------------------------------------------------- 1 | default: !reference [.default-pipeline-definitions, default] 2 | -------------------------------------------------------------------------------- /scripts/ci/gitlab/skip_if_draft.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | url="https://api.github.com/repos/paritytech/substrate/pulls/${CI_COMMIT_REF_NAME}" 3 | echo "[+] API URL: $url" 4 | 5 | draft_state=$(curl -H "Authorization: token ${GITHUB_PR_TOKEN}" "$url" | jq -r .draft) 6 | echo "[+] Draft state: $draft_state" 7 | 8 | if [ "$draft_state" = 'true' ]; then 9 | echo "[!] PR is currently a draft, stopping pipeline" 10 | exit 1 11 | else 12 | echo "[+] PR is not a draft. Proceeding with CI pipeline" 13 | exit 0 14 | fi 15 | -------------------------------------------------------------------------------- /scripts/ci/monitoring/grafana-dashboards/README_dashboard.md: -------------------------------------------------------------------------------- 1 | ## Substrate Dashboard 2 | 3 | Shared templated Grafana dashboards. 4 | 5 | To import the dashboards follow the [Grafana 6 | documentation](https://grafana.com/docs/grafana/latest/reference/export_import/). 7 | You can see an example setup [here](./substrate-networking.json). 8 | -------------------------------------------------------------------------------- /scripts/ci/node-template-release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | export TERM=xterm 6 | PROJECT_ROOT=`git rev-parse --show-toplevel` 7 | 8 | if [ "$#" -ne 1 ]; then 9 | echo "node-template-release.sh path_to_target_archive" 10 | exit 1 11 | fi 12 | 13 | PATH_TO_ARCHIVE=$1 14 | cd $PROJECT_ROOT/scripts/ci/node-template-release 15 | 16 | cargo run $PROJECT_ROOT/bin/node-template $PROJECT_ROOT/$PATH_TO_ARCHIVE 17 | -------------------------------------------------------------------------------- /scripts/ci/node-template-release/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "node-template-release" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "GPL-3.0" 7 | homepage = "https://substrate.io" 8 | publish = false 9 | 10 | [package.metadata.docs.rs] 11 | targets = ["x86_64-unknown-linux-gnu"] 12 | 13 | [dependencies] 14 | clap = { version = "4.0.9", features = ["derive"] } 15 | flate2 = "1.0" 16 | fs_extra = "1" 17 | git2 = "0.8" 18 | glob = "0.2" 19 | tar = "0.4" 20 | tempfile = "3" 21 | toml = "0.4" 22 | 23 | [workspace] 24 | -------------------------------------------------------------------------------- /test-utils/derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "substrate-test-utils-derive" 3 | version = "0.10.0-dev" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Substrate test utilities macros" 10 | publish = false 11 | 12 | [dependencies] 13 | proc-macro-crate = "1.1.3" 14 | proc-macro2 = "1.0.37" 15 | quote = "1.0.10" 16 | syn = { version = "1.0.98", features = ["full"] } 17 | 18 | [lib] 19 | proc-macro = true 20 | -------------------------------------------------------------------------------- /test-utils/test-crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "substrate-test-utils-test-crate" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | publish = false 10 | 11 | [package.metadata.docs.rs] 12 | targets = ["x86_64-unknown-linux-gnu"] 13 | 14 | [dev-dependencies] 15 | tokio = { version = "1.22.0", features = ["macros"] } 16 | sc-service = { version = "0.10.0-dev", path = "../../client/service" } 17 | test-utils = { package = "substrate-test-utils", version = "4.0.0-dev", path = ".." } 18 | -------------------------------------------------------------------------------- /test-utils/tests/ui/too-many-func-parameters.stderr: -------------------------------------------------------------------------------- 1 | error: No arguments expected for tests. 2 | --> $DIR/too-many-func-parameters.rs:20:1 3 | | 4 | 20 | async fn too_many_func_parameters(_: u32) { 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /utils/build-script-utils/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "substrate-build-script-utils" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Crate with utility functions for `build.rs` scripts." 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | platforms = "2.0" 17 | -------------------------------------------------------------------------------- /utils/build-script-utils/README.md: -------------------------------------------------------------------------------- 1 | Crate with utility functions for `build.rs` scripts. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /utils/fork-tree/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fork-tree" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Utility library for managing tree-like ordered data with logic for pruning the tree while finalizing nodes." 10 | documentation = "https://docs.rs/fork-tree" 11 | readme = "README.md" 12 | 13 | [package.metadata.docs.rs] 14 | targets = ["x86_64-unknown-linux-gnu"] 15 | 16 | [dependencies] 17 | codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"] } 18 | -------------------------------------------------------------------------------- /utils/fork-tree/README.md: -------------------------------------------------------------------------------- 1 | Utility library for managing tree-like ordered data with logic for pruning 2 | the tree while finalizing nodes. 3 | 4 | License: Apache-2.0 -------------------------------------------------------------------------------- /utils/frame/benchmarking-cli/src/machine/reference_hardware.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "metric": "Blake2256", 4 | "minimum": 1029.0 5 | }, 6 | { 7 | "metric": "Sr25519Verify", 8 | "minimum": 0.650391 9 | }, 10 | { 11 | "metric": "MemCopy", 12 | "minimum": 14666.752 13 | }, 14 | { 15 | "metric": "DiskSeqWrite", 16 | "minimum": 450.0 17 | }, 18 | { 19 | "metric": "DiskRndWrite", 20 | "minimum": 200.0 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /utils/frame/benchmarking-cli/src/pallet/README.md: -------------------------------------------------------------------------------- 1 | The pallet command is explained in [frame/benchmarking](../../../../../frame/benchmarking/README.md). 2 | 3 | License: Apache-2.0 4 | -------------------------------------------------------------------------------- /utils/frame/frame-utilities-cli/README.md: -------------------------------------------------------------------------------- 1 | frame-system CLI utilities 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /utils/frame/generate-bags/node-runtime/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "node-runtime-generate-bags" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2021" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.io" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Bag threshold generation script for pallet-bag-list and kitchensink-runtime." 10 | publish = false 11 | 12 | [dependencies] 13 | kitchensink-runtime = { version = "3.0.0-dev", path = "../../../../bin/node/runtime" } 14 | generate-bags = { version = "4.0.0-dev", path = "../" } 15 | 16 | # third-party 17 | clap = { version = "4.0.9", features = ["derive"] } 18 | -------------------------------------------------------------------------------- /utils/frame/remote-externalities/test_data/proxy_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/utils/frame/remote-externalities/test_data/proxy_test -------------------------------------------------------------------------------- /utils/frame/rpc/state-trie-migration-rpc/README.md: -------------------------------------------------------------------------------- 1 | Node-specific RPC methods for interaction with trie migration. 2 | 3 | License: Apache-2.0 4 | -------------------------------------------------------------------------------- /utils/frame/rpc/support/README.md: -------------------------------------------------------------------------------- 1 | Combines [sc_rpc_api::state::StateClient] with [frame_support::storage::generator] traits 2 | to provide strongly typed chain state queries over rpc. 3 | 4 | License: Apache-2.0 -------------------------------------------------------------------------------- /utils/frame/rpc/system/README.md: -------------------------------------------------------------------------------- 1 | System FRAME specific RPC methods. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /utils/rust-ipfs/.cargo-ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TDSoftware/substrate-ipfs/5e0a0744c7b510a68c899ba98d7e73f04f90e691/utils/rust-ipfs/.cargo-ok -------------------------------------------------------------------------------- /utils/rust-ipfs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 0.3.0-alpha.3 [unreleased] 2 | - refactor/opt: Expanded UninitializedIpfs functionality [PR 21] 3 | - feat/upnp: Use libp2p-nat for handling port forwarding [PR 23] 4 | - refactor/task: Move swarm and events into a task [PR 25] 5 | 6 | [PR 23]: https://github.com/dariusc93/rust-ipfs/pull/23 7 | [PR 21]: https://github.com/dariusc93/rust-ipfs/pull/21 8 | [PR 25]: https://github.com/dariusc93/rust-ipfs/pull/25 9 | 10 | # 0.3.0-alpha.2 11 | - fix: Poll receiving oneshot channel directly [PR 20] 12 | 13 | [PR 20]: https://github.com/dariusc93/rust-ipfs/pull/20 14 | 15 | # 0.3.0-alpha.1 16 | - See commit history -------------------------------------------------------------------------------- /utils/rust-ipfs/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | The `rust-ipfs` project follows the [`IPFS Community Code of Conduct`](https://github.com/ipfs/community/blob/master/code-of-conduct.md) 4 | -------------------------------------------------------------------------------- /utils/rust-ipfs/archived/conformance/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | http 3 | -------------------------------------------------------------------------------- /utils/rust-ipfs/archived/conformance/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ipfs-rust-conformance", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "npx mocha" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "aegir": "^21.3.0", 13 | "interface-ipfs-core": "0.139.0", 14 | "ipfsd-ctl": "github:rs-ipfs/js-ipfsd-ctl#add_rust_ipfs_http", 15 | "mocha": "^7.1.0", 16 | "ipfs-http-client": "46.0.0", 17 | "why-is-node-running": "2.2.0" 18 | }, 19 | "devDependencies": { 20 | "rust-ipfs-dep": "github:rs-ipfs/npm-rust-ipfs-dep#master", 21 | "ipfs": "0.49.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /utils/rust-ipfs/archived/conformance/patches/await_subprocess.patch: -------------------------------------------------------------------------------- 1 | --- node_modules/ipfsd-ctl/src/ipfsd-daemon.js 2020-03-06 15:26:44.365192780 +0200 2 | +++ node_modules/ipfsd-ctl/src/ipfsd-daemon.js 2020-07-20 14:54:43.353680062 +0300 3 | @@ -260,6 +250,7 @@ 4 | 5 | try { 6 | await this.api.stop() 7 | + await this.subprocess; 8 | } catch (err) { 9 | if (!killed) { 10 | throw err // if was killed then ignore error 11 | -------------------------------------------------------------------------------- /utils/rust-ipfs/archived/conformance/patches/bootstrap.patch: -------------------------------------------------------------------------------- 1 | --- node_modules/interface-ipfs-core/src/bootstrap/reset.js 2 | +++ node_modules/interface-ipfs-core/src/bootstrap/reset.js 3 | @@ -34,7 +34,7 @@ module.exports = (common, options) => { 4 | const res = await ipfs.bootstrap.reset() 5 | 6 | const peers = res.Peers 7 | - expect(peers).to.have.property('length').that.is.gt(1) 8 | + expect(peers).to.have.property('length').that.is.gt(0) 9 | }) 10 | 11 | it('should return a list of all peers removed when all option is passed', async () => { 12 | -------------------------------------------------------------------------------- /utils/rust-ipfs/archived/http/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | // vergen will generate build flags which will allow direct usage of env!(...) macro to find 3 | // VERGEN_SHA_SHORT and others: https://docs.rs/vergen/3.0.4/vergen/ 4 | // 5 | // the rebuild on each commit can be turned off: 6 | // https://docs.rs/vergen/3.0.4/vergen/struct.ConstantsFlags.html#associatedconstant.REBUILD_ON_HEAD_CHANGE 7 | vergen::generate_cargo_keys(vergen::ConstantsFlags::all()) 8 | .expect("Unable to generate the cargo keys!"); 9 | 10 | prost_build::compile_protos(&["src/keys.proto"], &["src"]).unwrap(); 11 | } 12 | -------------------------------------------------------------------------------- /utils/rust-ipfs/archived/http/src/keys.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package keys_proto; 4 | 5 | enum KeyType { 6 | RSA = 0; 7 | Ed25519 = 1; 8 | Secp256k1 = 2; 9 | } 10 | 11 | message PublicKey { 12 | required KeyType Type = 1; 13 | required bytes Data = 2; 14 | } 15 | 16 | message PrivateKey { 17 | required KeyType Type = 1; 18 | required bytes Data = 2; 19 | } 20 | -------------------------------------------------------------------------------- /utils/rust-ipfs/archived/http/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! `ipfs-http` http API implementation. 2 | //! 3 | //! This crate is most useful as a binary used first and foremost for compatibility testing against 4 | //! other ipfs implementations. 5 | 6 | #[macro_use] 7 | extern crate tracing; 8 | 9 | pub mod v0; 10 | 11 | pub mod config; 12 | -------------------------------------------------------------------------------- /utils/rust-ipfs/bitswap/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | prost_build::compile_protos(&["src/bitswap_pb.proto"], &["src"]).unwrap(); 3 | } 4 | -------------------------------------------------------------------------------- /utils/rust-ipfs/bitswap/src/block.rs: -------------------------------------------------------------------------------- 1 | pub type Block = libipld::Block; 2 | -------------------------------------------------------------------------------- /utils/rust-ipfs/bitswap/src/error.rs: -------------------------------------------------------------------------------- 1 | use thiserror::Error; 2 | 3 | #[derive(Debug, Error)] 4 | pub enum BitswapError { 5 | #[error("Error while reading from socket: {0}")] 6 | ReadError(#[from] std::io::Error), 7 | #[error("Error while decoding bitswap message: {0}")] 8 | ProtobufError(#[from] prost::DecodeError), 9 | #[error("Error while parsing cid: {0}")] 10 | Cid(#[from] libipld::cid::Error), 11 | #[error("Error while handling IPLD: {0}")] 12 | Ipld(#[from] libipld::error::Error), 13 | #[error("Error while handling Multihash: {0}")] 14 | Multihash(#[from] libipld::multihash::Error), 15 | } 16 | -------------------------------------------------------------------------------- /utils/rust-ipfs/bitswap/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Bitswap protocol implementation 2 | #[macro_use] 3 | extern crate tracing; 4 | 5 | mod behaviour; 6 | mod block; 7 | mod error; 8 | mod ledger; 9 | mod prefix; 10 | mod protocol; 11 | 12 | pub use self::behaviour::{Bitswap, BitswapEvent, Stats}; 13 | pub use self::block::Block; 14 | pub use self::error::BitswapError; 15 | pub use self::ledger::Priority; 16 | 17 | mod bitswap_pb { 18 | include!(concat!(env!("OUT_DIR"), "/bitswap_pb.rs")); 19 | } 20 | -------------------------------------------------------------------------------- /utils/rust-ipfs/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | // prost_build::compile_protos(&["src/ipns/ipns_pb.proto"], &["src"]).unwrap(); 3 | } 4 | -------------------------------------------------------------------------------- /utils/rust-ipfs/src/error.rs: -------------------------------------------------------------------------------- 1 | //! Crate-wide errors. 2 | //! 3 | //! The error handling in `ipfs` is subject to change in the future. 4 | 5 | /// Just re-export anyhow for now. 6 | /// 7 | /// # Stability 8 | /// 9 | /// Very likely to change in the future. 10 | pub use anyhow::Error; 11 | 12 | /// A try conversion failed. 13 | /// 14 | /// # Stability 15 | /// 16 | /// Very likely to change in the future. 17 | pub struct TryError; 18 | -------------------------------------------------------------------------------- /utils/rust-ipfs/unixfs/README.md: -------------------------------------------------------------------------------- 1 | # ipfs-unixfs 2 | 3 | ## Goals 4 | 5 | * blockstore API independent way to traverse the merkledag 6 | * the core read API does not deal with loading blocks 7 | * instead access to interesting `Cid`s is given 8 | 9 | ## Status 10 | 11 | * unfiltered walking of known unixfs trees 12 | * creation of balanced file trees 13 | * creation of non HAMT-sharded directory trees 14 | 15 | See the docs at https://docs.rs/ipfs-unixfs. 16 | 17 | ## License 18 | 19 | MIT or APL2. 20 | -------------------------------------------------------------------------------- /utils/rust-ipfs/unixfs/src/config/mod.rs: -------------------------------------------------------------------------------- 1 | use libipld::cid::Version; 2 | 3 | /// the default cid version that is used if none is specified 4 | pub const DEFAULT_CID_VERSION: Version = Version::V0; 5 | -------------------------------------------------------------------------------- /zombienet/0000-block-building/block-building.toml: -------------------------------------------------------------------------------- 1 | [settings] 2 | enable_tracing = false 3 | 4 | [relaychain] 5 | default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}" 6 | default_command = "substrate" 7 | chain = "local" 8 | 9 | [[relaychain.nodes]] 10 | name = "alice" 11 | validator = true 12 | 13 | [[relaychain.nodes]] 14 | name = "bob" 15 | validator = true 16 | -------------------------------------------------------------------------------- /zombienet/0000-block-building/block-building.zndsl: -------------------------------------------------------------------------------- 1 | Description: Block building 2 | Network: ./block-building.toml 3 | Creds: config 4 | 5 | alice: is up within 30 seconds 6 | bob: is up within 30 seconds 7 | 8 | alice: reports node_roles is 4 9 | bob: reports node_roles is 4 10 | 11 | alice: reports peers count is at least 1 12 | bob: reports peers count is at least 1 13 | 14 | alice: reports block height is at least 5 within 20 seconds 15 | bob: reports block height is at least 5 within 20 seconds 16 | 17 | alice: count of log lines containing "error" is 0 within 2 seconds 18 | bob: count of log lines containing "error" is 0 within 2 seconds 19 | 20 | alice: js-script ./transaction-gets-finalized.js within 30 seconds 21 | -------------------------------------------------------------------------------- /zombienet/0001-basic-warp-sync/generate-warp-sync-database.toml: -------------------------------------------------------------------------------- 1 | # this file is not intended to be executed in CI stage 2 | [relaychain] 3 | default_image = "docker.io/parity/substrate:latest" 4 | default_command = "substrate" 5 | 6 | # refer to ./README.md for more details on how to create snapshot and spec 7 | chain = "gen-db" 8 | chain_spec_path = "chain-spec.json" 9 | 10 | 11 | [[relaychain.nodes]] 12 | name = "alice" 13 | validator = true 14 | 15 | [[relaychain.nodes]] 16 | name = "bob" 17 | validator = true 18 | --------------------------------------------------------------------------------