├── .circleci └── config.yml ├── .dockerignore ├── .editorconfig ├── .gitattributes ├── .gitignore ├── .maintain ├── Dockerfile ├── build-only-wasm.sh ├── common │ └── lib.sh ├── deny.toml ├── ensure-deps.sh ├── frame-weight-template.hbs ├── getgoing.sh ├── github │ └── check_labels.sh ├── init.sh ├── local-docker-test-network │ ├── docker-compose.yml │ ├── grafana │ │ └── provisioning │ │ │ ├── dashboards │ │ │ └── dashboards.yml │ │ │ └── datasources │ │ │ └── datasource.yml │ └── prometheus │ │ └── prometheus.yml ├── 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 ├── rename-crates-for-2.0.sh ├── runtime-dep.py ├── rustdoc-header.html ├── update-copyright.sh └── update-deps.sh ├── .rustfmt.toml ├── Cargo.lock ├── Cargo.toml ├── HEADER-APACHE2 ├── HEADER-GPL3 ├── LICENSE-APACHE2 ├── LICENSE-GPL3 ├── README.md ├── bin ├── node-template │ ├── LICENSE │ ├── README.md │ ├── node │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ ├── chain_spec.rs │ │ │ ├── cli.rs │ │ │ ├── command.rs │ │ │ ├── lib.rs │ │ │ ├── main.rs │ │ │ ├── rpc.rs │ │ │ └── service.rs │ ├── pallets │ │ └── template │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ ├── lib.rs │ │ │ ├── mock.rs │ │ │ └── tests.rs │ ├── runtime │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ └── lib.rs │ └── scripts │ │ └── init.sh ├── 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 │ ├── browser-testing │ │ ├── Cargo.toml │ │ ├── src │ │ │ └── lib.rs │ │ └── webdriver.json │ ├── cli │ │ ├── Cargo.toml │ │ ├── bin │ │ │ └── main.rs │ │ ├── browser-demo │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── build.sh │ │ │ ├── favicon.png │ │ │ └── index.html │ │ ├── build.rs │ │ ├── doc │ │ │ └── shell-completion.adoc │ │ ├── res │ │ │ └── flaming-fir.json │ │ ├── src │ │ │ ├── browser.rs │ │ │ ├── chain_spec.rs │ │ │ ├── cli.rs │ │ │ ├── command.rs │ │ │ ├── lib.rs │ │ │ └── service.rs │ │ └── tests │ │ │ ├── build_spec_works.rs │ │ │ ├── check_block_works.rs │ │ │ ├── common.rs │ │ │ ├── export_import_flow.rs │ │ │ ├── inspect_works.rs │ │ │ ├── purge_chain_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-client │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ ├── rpc │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── runtime │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ ├── constants.rs │ │ │ ├── impls.rs │ │ │ └── lib.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.adoc │ ├── README.md │ └── src │ ├── lib.rs │ └── main.rs ├── client ├── api │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── backend.rs │ │ ├── call_executor.rs │ │ ├── cht.rs │ │ ├── client.rs │ │ ├── execution_extensions.rs │ │ ├── in_mem.rs │ │ ├── leaves.rs │ │ ├── lib.rs │ │ ├── light.rs │ │ ├── notifications.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.proto │ │ └── tests.rs ├── basic-authorship │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── basic_authorship.rs │ │ └── lib.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 │ │ ├── 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 │ │ │ ├── digests.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 │ │ │ ├── lib.rs │ │ │ └── longest_chain.rs │ ├── epochs │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── lib.rs │ │ │ └── migration.rs │ ├── manual-seal │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── consensus.rs │ │ │ ├── consensus │ │ │ └── babe.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 │ └── src │ │ ├── bench.rs │ │ ├── cache │ │ ├── list_cache.rs │ │ ├── list_entry.rs │ │ ├── list_storage.rs │ │ └── mod.rs │ │ ├── changes_tries_storage.rs │ │ ├── children.rs │ │ ├── lib.rs │ │ ├── light.rs │ │ ├── offchain.rs │ │ ├── parity_db.rs │ │ ├── stats.rs │ │ ├── storage_cache.rs │ │ ├── upgrade.rs │ │ └── utils.rs ├── executor │ ├── Cargo.toml │ ├── README.md │ ├── common │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ ├── sandbox.rs │ │ │ ├── util.rs │ │ │ └── wasm_runtime.rs │ ├── runtime-test │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ └── lib.rs │ ├── src │ │ ├── integration_tests │ │ │ ├── mod.rs │ │ │ └── sandbox.rs │ │ ├── lib.rs │ │ ├── native_executor.rs │ │ └── wasm_runtime.rs │ ├── wasmi │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── lib.rs │ └── wasmtime │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ ├── host.rs │ │ ├── imports.rs │ │ ├── instance_wrapper.rs │ │ ├── instance_wrapper │ │ └── globals_snapshot.rs │ │ ├── lib.rs │ │ ├── runtime.rs │ │ ├── state_holder.rs │ │ └── util.rs ├── finality-grandpa-warp-sync │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── proof.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 ├── informant │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── display.rs │ │ └── lib.rs ├── keystore │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── local.rs ├── light │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── backend.rs │ │ ├── blockchain.rs │ │ ├── call_executor.rs │ │ ├── fetcher.rs │ │ └── lib.rs ├── network-gossip │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── bridge.rs │ │ ├── lib.rs │ │ ├── state_machine.rs │ │ └── validator.rs ├── network │ ├── Cargo.toml │ ├── README.md │ ├── build.rs │ ├── src │ │ ├── behaviour.rs │ │ ├── bitswap.rs │ │ ├── block_request_handler.rs │ │ ├── chain.rs │ │ ├── config.rs │ │ ├── discovery.rs │ │ ├── error.rs │ │ ├── gossip.rs │ │ ├── gossip │ │ │ └── tests.rs │ │ ├── lib.rs │ │ ├── light_client_requests.rs │ │ ├── light_client_requests │ │ │ ├── handler.rs │ │ │ └── sender.rs │ │ ├── network_state.rs │ │ ├── on_demand_layer.rs │ │ ├── peer_info.rs │ │ ├── protocol.rs │ │ ├── protocol │ │ │ ├── event.rs │ │ │ ├── generic_proto.rs │ │ │ ├── generic_proto │ │ │ │ ├── behaviour.rs │ │ │ │ ├── handler.rs │ │ │ │ ├── tests.rs │ │ │ │ ├── upgrade.rs │ │ │ │ └── upgrade │ │ │ │ │ ├── collec.rs │ │ │ │ │ ├── legacy.rs │ │ │ │ │ └── notifications.rs │ │ │ ├── message.rs │ │ │ ├── sync.rs │ │ │ └── sync │ │ │ │ ├── blocks.rs │ │ │ │ └── extra_requests.rs │ │ ├── request_responses.rs │ │ ├── schema.rs │ │ ├── schema │ │ │ ├── api.v1.proto │ │ │ ├── bitswap.v1.2.0.proto │ │ │ └── light.v1.proto │ │ ├── service.rs │ │ ├── service │ │ │ ├── metrics.rs │ │ │ ├── out_events.rs │ │ │ └── tests.rs │ │ ├── transactions.rs │ │ ├── transport.rs │ │ └── utils.rs │ └── test │ │ ├── Cargo.toml │ │ └── src │ │ ├── block_import.rs │ │ ├── lib.rs │ │ └── sync.rs ├── offchain │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── api.rs │ │ ├── api │ │ ├── http.rs │ │ ├── http_dummy.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 │ │ ├── errors.rs │ │ ├── helpers.rs │ │ ├── lib.rs │ │ ├── metadata.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 │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── author │ │ ├── mod.rs │ │ └── tests.rs │ │ ├── chain │ │ ├── chain_full.rs │ │ ├── chain_light.rs │ │ ├── mod.rs │ │ └── tests.rs │ │ ├── lib.rs │ │ ├── offchain │ │ ├── mod.rs │ │ └── tests.rs │ │ ├── state │ │ ├── mod.rs │ │ ├── state_full.rs │ │ ├── state_light.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 │ │ │ ├── light.rs │ │ │ ├── mod.rs │ │ │ └── wasm_override.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 │ │ ├── light.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 ├── telemetry │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── endpoints.rs │ │ ├── layer.rs │ │ ├── lib.rs │ │ ├── node.rs │ │ └── transport.rs ├── tracing │ ├── Cargo.toml │ ├── README.md │ ├── proc-macro │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── lib.rs │ │ └── logging │ │ ├── directives.rs │ │ ├── event_format.rs │ │ ├── layers │ │ ├── console_log.rs │ │ ├── mod.rs │ │ └── prefix_layer.rs │ │ └── mod.rs └── transaction-pool │ ├── Cargo.toml │ ├── README.md │ ├── graph │ ├── Cargo.toml │ ├── README.md │ ├── benches │ │ └── basics.rs │ └── src │ │ ├── base_pool.rs │ │ ├── future.rs │ │ ├── lib.rs │ │ ├── listener.rs │ │ ├── pool.rs │ │ ├── ready.rs │ │ ├── rotator.rs │ │ ├── tracked_map.rs │ │ ├── validated_pool.rs │ │ └── watcher.rs │ └── src │ ├── api.rs │ ├── error.rs │ ├── lib.rs │ ├── metrics.rs │ ├── revalidation.rs │ └── testing │ ├── mod.rs │ └── pool.rs ├── docs ├── CHANGELOG.md ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.adoc ├── 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 ├── frame ├── assets │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.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 │ │ └── tests.rs ├── balances │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ ├── tests_composite.rs │ │ ├── tests_local.rs │ │ ├── tests_reentrancy.rs │ │ └── weights.rs ├── benchmarking │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── analysis.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ └── utils.rs ├── bounties │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ └── weights.rs ├── collective │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ └── weights.rs ├── contracts │ ├── CHANGELOG.md │ ├── COMPLEXITY.md │ ├── Cargo.toml │ ├── README.md │ ├── common │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── lib.rs │ ├── fixtures │ │ ├── call_return_code.wat │ │ ├── caller_contract.wat │ │ ├── chain_extension.wat │ │ ├── check_default_rent_allowance.wat │ │ ├── crypto_hashes.wat │ │ ├── destroy_and_transfer.wat │ │ ├── drain.wat │ │ ├── event_size.wat │ │ ├── instantiate_return_code.wat │ │ ├── ok_trap_revert.wat │ │ ├── restoration.wat │ │ ├── return_from_start_fn.wat │ │ ├── return_with_data.wat │ │ ├── run_out_of_gas.wat │ │ ├── self_destruct.wat │ │ ├── self_destructing_constructor.wat │ │ ├── set_empty_storage.wat │ │ ├── set_rent.wat │ │ ├── storage_size.wat │ │ └── transfer_return_code.wat │ ├── proc-macro │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── rpc │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── runtime-api │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── benchmarking │ │ ├── code.rs │ │ ├── mod.rs │ │ └── sandbox.rs │ │ ├── chain_extension.rs │ │ ├── exec.rs │ │ ├── gas.rs │ │ ├── lib.rs │ │ ├── rent.rs │ │ ├── schedule.rs │ │ ├── storage.rs │ │ ├── tests.rs │ │ ├── wasm │ │ ├── code_cache.rs │ │ ├── env_def │ │ │ ├── macros.rs │ │ │ └── mod.rs │ │ ├── mod.rs │ │ ├── prepare.rs │ │ └── runtime.rs │ │ └── weights.rs ├── democracy │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── conviction.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ ├── tests │ │ ├── cancellation.rs │ │ ├── decoders.rs │ │ ├── delegation.rs │ │ ├── external_proposing.rs │ │ ├── fast_tracking.rs │ │ ├── lock_voting.rs │ │ ├── preimage.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 │ │ ├── mock.rs │ │ ├── unsigned.rs │ │ └── weights.rs ├── elections-phragmen │ ├── CHANGELOG.md │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── migrations_3_0_0.rs │ │ └── weights.rs ├── elections │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── example-offchain-worker │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── tests.rs ├── example-parallel │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── tests.rs ├── example │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── executive │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── gilt │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── grandpa │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── default_weights.rs │ │ ├── equivocation.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── identity │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── tests.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 ├── merkle-mountain-range │ ├── Cargo.toml │ ├── primitives │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── benchmarking.rs │ │ ├── default_weights.rs │ │ ├── lib.rs │ │ ├── mmr │ │ ├── mmr.rs │ │ ├── mod.rs │ │ ├── storage.rs │ │ └── utils.rs │ │ ├── mock.rs │ │ └── tests.rs ├── metadata │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── multisig │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ └── weights.rs ├── nicks │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── node-authorization │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── offences │ ├── Cargo.toml │ ├── README.md │ ├── benchmarking │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── lib.rs │ │ │ └── mock.rs │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.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 ├── recovery │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── scheduler │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.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 │ │ ├── mock.rs │ │ ├── tests.rs │ │ └── weights.rs ├── society │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── staking │ ├── Cargo.toml │ ├── README.md │ ├── fuzzer │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── mock.rs │ │ │ └── submit_solution.rs │ ├── reward-curve │ │ ├── Cargo.toml │ │ ├── src │ │ │ ├── lib.rs │ │ │ └── log.rs │ │ └── tests │ │ │ └── test.rs │ └── src │ │ ├── benchmarking.rs │ │ ├── inflation.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── offchain_election.rs │ │ ├── slashing.rs │ │ ├── testing_utils.rs │ │ ├── tests.rs │ │ └── weights.rs ├── sudo │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── support │ ├── Cargo.toml │ ├── README.md │ ├── procedural │ │ ├── Cargo.toml │ │ ├── src │ │ │ ├── clone_no_bound.rs │ │ │ ├── construct_runtime │ │ │ │ ├── mod.rs │ │ │ │ └── parse.rs │ │ │ ├── debug_no_bound.rs │ │ │ ├── lib.rs │ │ │ ├── pallet │ │ │ │ ├── expand │ │ │ │ │ ├── call.rs │ │ │ │ │ ├── constants.rs │ │ │ │ │ ├── error.rs │ │ │ │ │ ├── event.rs │ │ │ │ │ ├── genesis_build.rs │ │ │ │ │ ├── genesis_config.rs │ │ │ │ │ ├── hooks.rs │ │ │ │ │ ├── instances.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── pallet_struct.rs │ │ │ │ │ ├── storage.rs │ │ │ │ │ ├── store_trait.rs │ │ │ │ │ └── type_value.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_version.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_struct.rs │ │ │ │ └── store_trait.rs │ │ │ └── transactional.rs │ │ └── tools │ │ │ ├── Cargo.toml │ │ │ ├── derive │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── lib.rs │ │ │ └── src │ │ │ ├── lib.rs │ │ │ └── syn_ext.rs │ ├── src │ │ ├── dispatch.rs │ │ ├── error.rs │ │ ├── event.rs │ │ ├── genesis_config.rs │ │ ├── hash.rs │ │ ├── inherent.rs │ │ ├── instances.rs │ │ ├── lib.rs │ │ ├── metadata.rs │ │ ├── origin.rs │ │ ├── storage │ │ │ ├── child.rs │ │ │ ├── generator │ │ │ │ ├── double_map.rs │ │ │ │ ├── map.rs │ │ │ │ ├── mod.rs │ │ │ │ └── value.rs │ │ │ ├── hashed.rs │ │ │ ├── migration.rs │ │ │ ├── mod.rs │ │ │ ├── types │ │ │ │ ├── double_map.rs │ │ │ │ ├── map.rs │ │ │ │ ├── mod.rs │ │ │ │ └── value.rs │ │ │ └── unhashed.rs │ │ ├── traits.rs │ │ ├── unsigned.rs │ │ └── weights.rs │ └── test │ │ ├── Cargo.toml │ │ ├── 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 │ │ ├── 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 │ │ ├── generics_in_invalid_module.rs │ │ ├── generics_in_invalid_module.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 │ │ ├── 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 │ │ ├── eq.rs │ │ ├── eq.stderr │ │ ├── partial_eq.rs │ │ └── partial_eq.stderr │ │ ├── final_keys.rs │ │ ├── genesisconfig.rs │ │ ├── instance.rs │ │ ├── issue2219.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_invalid_const.rs │ │ ├── call_invalid_const.stderr │ │ ├── call_invalid_origin_type.rs │ │ ├── call_invalid_origin_type.stderr │ │ ├── call_missing_weight.rs │ │ ├── call_missing_weight.stderr │ │ ├── call_no_origin.rs │ │ ├── call_no_origin.stderr │ │ ├── call_no_return.rs │ │ ├── call_no_return.stderr │ │ ├── duplicate_call_attr.rs │ │ ├── duplicate_call_attr.stderr │ │ ├── duplicate_store_attr.rs │ │ ├── duplicate_store_attr.stderr │ │ ├── error_no_fieldless.rs │ │ ├── error_no_fieldless.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 │ │ ├── storage_incomplete_item.rs │ │ ├── storage_incomplete_item.stderr │ │ ├── storage_invalid_first_generic.rs │ │ ├── storage_invalid_first_generic.stderr │ │ ├── storage_not_storage_type.rs │ │ ├── storage_not_storage_type.stderr │ │ ├── storage_value_no_generic.rs │ │ ├── storage_value_no_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_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 │ │ ├── pallet_version.rs │ │ ├── pallet_with_name_trait_is_valid.rs │ │ ├── reserved_keyword.rs │ │ ├── reserved_keyword │ │ ├── on_initialize.rs │ │ └── on_initialize.stderr │ │ ├── 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_nonce.rs │ │ ├── check_spec_version.rs │ │ ├── check_tx_version.rs │ │ ├── check_weight.rs │ │ └── mod.rs │ │ ├── lib.rs │ │ ├── limits.rs │ │ ├── mock.rs │ │ ├── mocking.rs │ │ ├── offchain.rs │ │ ├── tests.rs │ │ └── weights.rs ├── timestamp │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ └── weights.rs ├── tips │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ └── weights.rs ├── transaction-payment │ ├── Cargo.toml │ ├── README.md │ ├── rpc │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── runtime-api │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── lib.rs │ │ ├── payment.rs │ │ └── types.rs ├── treasury │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ └── weights.rs ├── try-runtime │ ├── Cargo.toml │ └── src │ │ └── lib.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 │ └── weights.rs ├── primitives ├── allocator │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── error.rs │ │ ├── freeing_bump.rs │ │ └── lib.rs ├── api │ ├── Cargo.toml │ ├── README.md │ ├── proc-macro │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── 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_two_traits_with_same_name.rs │ │ ├── impl_two_traits_with_same_name.stderr │ │ ├── invalid_api_version.rs │ │ ├── invalid_api_version.stderr │ │ ├── invalid_api_version_2.rs │ │ ├── invalid_api_version_2.stderr │ │ ├── invalid_api_version_3.rs │ │ ├── invalid_api_version_3.stderr │ │ ├── missing_block_generic_parameter.rs │ │ ├── missing_block_generic_parameter.stderr │ │ ├── missing_path_for_trait.rs │ │ ├── missing_path_for_trait.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 │ │ ├── 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.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 ├── block-builder │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── blockchain │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── backend.rs │ │ ├── error.rs │ │ ├── header_metadata.rs │ │ └── lib.rs ├── chain-spec │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── consensus │ ├── aura │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── inherents.rs │ │ │ └── lib.rs │ ├── babe │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── digests.rs │ │ │ ├── inherents.rs │ │ │ └── lib.rs │ ├── common │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── block_import.rs │ │ │ ├── block_validation.rs │ │ │ ├── error.rs │ │ │ ├── evaluation.rs │ │ │ ├── import_queue.rs │ │ │ ├── import_queue │ │ │ ├── basic_queue.rs │ │ │ └── buffered_link.rs │ │ │ ├── lib.rs │ │ │ ├── metrics.rs │ │ │ ├── offline_tracker.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 │ └── src │ │ ├── changes_trie.rs │ │ ├── crypto.rs │ │ ├── ecdsa.rs │ │ ├── ed25519.rs │ │ ├── hash.rs │ │ ├── hasher.rs │ │ ├── hashing.rs │ │ ├── hexdisplay.rs │ │ ├── lib.rs │ │ ├── offchain │ │ ├── mod.rs │ │ ├── storage.rs │ │ └── testing.rs │ │ ├── sandbox.rs │ │ ├── sr25519.rs │ │ ├── testing.rs │ │ ├── traits.rs │ │ ├── u32_trait.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 ├── election-providers │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── onchain.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 │ │ └── 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 ├── npos-elections │ ├── Cargo.toml │ ├── README.md │ ├── benches │ │ └── phragmen.rs │ ├── compact │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── assignment.rs │ │ │ ├── codec.rs │ │ │ └── lib.rs │ ├── fuzzer │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── common.rs │ │ │ ├── compact.rs │ │ │ ├── phragmen_balancing.rs │ │ │ ├── phragmms_balancing.rs │ │ │ └── reduce.rs │ └── src │ │ ├── balancing.rs │ │ ├── helpers.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── node.rs │ │ ├── phragmen.rs │ │ ├── phragmms.rs │ │ ├── reduce.rs │ │ └── tests.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 ├── 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 │ │ ├── lib.rs │ │ ├── multiaddress.rs │ │ ├── offchain │ │ ├── http.rs │ │ ├── mod.rs │ │ ├── storage.rs │ │ └── storage_lock.rs │ │ ├── random_number_generator.rs │ │ ├── runtime_logger.rs │ │ ├── runtime_string.rs │ │ ├── testing.rs │ │ ├── traits.rs │ │ └── transaction_validity.rs ├── sandbox │ ├── Cargo.toml │ ├── README.md │ ├── src │ │ └── lib.rs │ ├── with_std.rs │ └── without_std.rs ├── serializer │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── session │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs ├── sr-api │ └── proc-macro │ │ └── src │ │ └── lib.rs ├── staking │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── offence.rs ├── state-machine │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── backend.rs │ │ ├── basic.rs │ │ ├── changes_trie │ │ ├── build.rs │ │ ├── build_cache.rs │ │ ├── build_iterator.rs │ │ ├── changes_iterator.rs │ │ ├── input.rs │ │ ├── mod.rs │ │ ├── prune.rs │ │ ├── storage.rs │ │ └── surface_iterator.rs │ │ ├── error.rs │ │ ├── ext.rs │ │ ├── in_memory_backend.rs │ │ ├── lib.rs │ │ ├── overlayed_changes │ │ ├── changeset.rs │ │ ├── mod.rs │ │ └── offchain.rs │ │ ├── proving_backend.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 ├── tasks │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── async_externalities.rs │ │ └── 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 │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── pool.rs │ │ └── runtime_api.rs ├── trie │ ├── Cargo.toml │ ├── README.md │ ├── benches │ │ └── bench.rs │ ├── src │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── node_codec.rs │ │ ├── node_header.rs │ │ ├── storage_proof.rs │ │ └── trie_stream.rs │ └── test-res │ │ ├── invalid-delta-order │ │ ├── proof │ │ ├── storage_root │ │ └── valid-delta-order ├── utils │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ ├── metrics.rs │ │ ├── mpsc.rs │ │ └── status_sinks.rs ├── version │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs └── wasm-interface │ ├── Cargo.toml │ ├── README.md │ └── src │ ├── lib.rs │ └── wasmi_impl.rs ├── prml ├── attestation │ ├── Cargo.toml │ └── src │ │ ├── benchmarking.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── weights.rs ├── consortium-permission │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── mock.rs │ │ └── tests.rs ├── doughnut │ ├── Cargo.toml │ └── src │ │ ├── constants.rs │ │ ├── impls.rs │ │ └── lib.rs ├── generic-asset │ ├── Cargo.toml │ ├── rpc │ │ ├── Cargo.toml │ │ ├── runtime-api │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── benchmarking.rs │ │ ├── imbalances.rs │ │ ├── impls.rs │ │ ├── lib.rs │ │ ├── mock.rs │ │ ├── tests.rs │ │ ├── types.rs │ │ └── weights.rs ├── support │ ├── Cargo.toml │ └── src │ │ └── lib.rs └── validator-manager │ ├── Cargo.toml │ ├── README.md │ └── src │ ├── lib.rs │ ├── mock.rs │ └── tests.rs ├── shell.nix ├── ss58-registry.json ├── 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 │ ├── missing-func-parameter.rs │ ├── missing-func-parameter.stderr │ ├── too-many-func-parameters.rs │ └── too-many-func-parameters.stderr └── utils ├── browser ├── Cargo.toml ├── README.md └── src │ └── lib.rs ├── 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 │ └── src │ │ ├── command.rs │ │ ├── lib.rs │ │ ├── template.hbs │ │ └── writer.rs ├── frame-utilities-cli │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── module_id.rs ├── remote-externalities │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── rpc │ ├── support │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── lib.rs │ └── system │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ └── lib.rs └── try-runtime │ └── cli │ ├── Cargo.toml │ └── src │ └── lib.rs ├── prometheus ├── Cargo.toml ├── README.md └── src │ ├── lib.rs │ ├── networking.rs │ └── sourced.rs └── wasm-builder ├── Cargo.toml ├── README.md └── src ├── builder.rs ├── lib.rs ├── prerequisites.rs └── wasm_project.rs /.dockerignore: -------------------------------------------------------------------------------- 1 | doc 2 | **target* 3 | .idea/ 4 | Dockerfile 5 | .dockerignore 6 | .local 7 | -------------------------------------------------------------------------------- /.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 | [*.yml] 13 | indent_style=space 14 | indent_size=2 15 | tab_width=8 16 | end_of_line=lf 17 | 18 | [*.sh] 19 | indent_style=space 20 | indent_size=2 21 | tab_width=8 22 | end_of_line=lf 23 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | Cargo.lock linguist-generated=true 2 | -------------------------------------------------------------------------------- /.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/ 25 | .cargo-remote.toml 26 | *.bin 27 | -------------------------------------------------------------------------------- /.maintain/build-only-wasm.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # Script for building only the WASM binary of the given project. 4 | 5 | set -e 6 | 7 | PROJECT_ROOT=`git rev-parse --show-toplevel` 8 | 9 | if [ "$#" -lt 1 ]; then 10 | echo "You need to pass the name of the crate you want to compile!" 11 | exit 1 12 | fi 13 | 14 | WASM_BUILDER_RUNNER="$PROJECT_ROOT/target/release/wbuild-runner/$1" 15 | 16 | if [ -z "$2" ]; then 17 | export WASM_TARGET_DIRECTORY=$(pwd) 18 | else 19 | export WASM_TARGET_DIRECTORY=$2 20 | fi 21 | 22 | if [ -d $WASM_BUILDER_RUNNER ]; then 23 | export DEBUG=false 24 | export OUT_DIR="$PROJECT_ROOT/target/release/build" 25 | cargo run --release --manifest-path="$WASM_BUILDER_RUNNER/Cargo.toml" \ 26 | | grep -vE "cargo:rerun-if-|Executing build command" 27 | else 28 | cargo build --release -p $1 29 | fi 30 | -------------------------------------------------------------------------------- /.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/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](../../../.maintain/sentry-node). 8 | -------------------------------------------------------------------------------- /.maintain/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=$(pwd)/$1 14 | cd $PROJECT_ROOT/.maintain/node-template-release 15 | 16 | cargo run $PROJECT_ROOT/bin/node-template $PATH_TO_ARCHIVE 17 | -------------------------------------------------------------------------------- /.maintain/node-template-release/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "node-template-release" 3 | version = "2.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "GPL-3.0" 7 | 8 | [dependencies] 9 | toml = "0.4" 10 | tar = "0.4" 11 | glob = "0.2" 12 | structopt = "0.3" 13 | tempfile = "3" 14 | fs_extra = "1" 15 | git2 = "0.8" 16 | flate2 = "1.0" 17 | 18 | [workspace] 19 | 20 | [package.metadata.docs.rs] 21 | targets = ["x86_64-unknown-linux-gnu"] 22 | -------------------------------------------------------------------------------- /.maintain/rustdoc-header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 11 | -------------------------------------------------------------------------------- /.maintain/update-copyright.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SINGLE_DATES=$(grep -lr "// Copyright (C) [0-9]* Parity Technologies (UK) Ltd.") 4 | YEAR=$(date +%Y) 5 | 6 | for file in $SINGLE_DATES; do 7 | FILE_YEAR=$(cat $file | sed -n "s|// Copyright (C) \([[:digit:]][[:digit:]][[:digit:]][[:digit:]]\) Parity Technologies (UK) Ltd.|\1|p") 8 | if [ $YEAR -ne $FILE_YEAR ]; then 9 | sed -i -e "s|// Copyright (C) \([[:digit:]][[:digit:]][[:digit:]][[:digit:]]\) Parity Technologies (UK) Ltd.|// Copyright (C) \1-$YEAR Parity Technologies (UK) Ltd.|g" $file 10 | fi 11 | done 12 | 13 | grep -lr "// Copyright (C) [0-9]*-[0-9]* Parity Technologies (UK) Ltd." | 14 | xargs sed -i -e "s|// Copyright (C) \([[:digit:]][[:digit:]][[:digit:]][[:digit:]]\)-[[:digit:]][[:digit:]][[:digit:]][[:digit:]] Parity Technologies (UK) Ltd.|// Copyright (C) \1-$YEAR Parity Technologies (UK) Ltd.|g" 15 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.rustfmt.toml: -------------------------------------------------------------------------------- 1 | # Conform to: https://wiki.parity.io/Substrate-Style-Guide 2 | reorder_imports = true 3 | hard_tabs = true 4 | max_width = 120 5 | -------------------------------------------------------------------------------- /HEADER-APACHE2: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | -------------------------------------------------------------------------------- /HEADER-GPL3: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 5 | 6 | // This program is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program. If not, see . 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Plug 2 | [![CircleCI](https://circleci.com/gh/plugblockchain/plug-blockchain.svg?style=svg)](https://circleci.com/gh/plugblockchain/plug-blockchain) 3 | 4 | The fully permissioned blockchain framework built on [Substrate](https://github.com/paritytech/substrate). 5 | 6 | ## Build 7 | See https://github.com/paritytech/substrate#6-building 8 | -------------------------------------------------------------------------------- /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/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod chain_spec; 2 | pub mod service; 3 | pub mod rpc; 4 | -------------------------------------------------------------------------------- /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 cli; 8 | mod command; 9 | mod rpc; 10 | 11 | fn main() -> sc_cli::Result<()> { 12 | command::run() 13 | } 14 | -------------------------------------------------------------------------------- /bin/node-template/pallets/template/README.md: -------------------------------------------------------------------------------- 1 | License: Unlicense -------------------------------------------------------------------------------- /bin/node-template/pallets/template/src/tests.rs: -------------------------------------------------------------------------------- 1 | use crate::{Error, mock::*}; 2 | use frame_support::{assert_ok, assert_noop}; 3 | 4 | #[test] 5 | fn it_works_for_default_value() { 6 | new_test_ext().execute_with(|| { 7 | // Dispatch a signed extrinsic. 8 | assert_ok!(TemplateModule::do_something(Origin::signed(1), 42)); 9 | // Read pallet storage and assert an expected result. 10 | assert_eq!(TemplateModule::something(), Some(42)); 11 | }); 12 | } 13 | 14 | #[test] 15 | fn correct_error_for_none_value() { 16 | new_test_ext().execute_with(|| { 17 | // Ensure the expected error is thrown when no value is present. 18 | assert_noop!( 19 | TemplateModule::cause_error(Origin::signed(1)), 20 | Error::::NoneValue 21 | ); 22 | }); 23 | } 24 | -------------------------------------------------------------------------------- /bin/node-template/runtime/build.rs: -------------------------------------------------------------------------------- 1 | use substrate_wasm_builder::WasmBuilder; 2 | 3 | fn main() { 4 | WasmBuilder::new() 5 | .with_current_project() 6 | .export_heap_base() 7 | .import_memory() 8 | .build() 9 | } 10 | -------------------------------------------------------------------------------- /bin/node-template/scripts/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 | -------------------------------------------------------------------------------- /bin/node/browser-testing/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "node-browser-testing" 3 | version = "2.0.0" 4 | authors = ["Parity Technologies "] 5 | description = "Tests for the in-browser light client." 6 | edition = "2018" 7 | license = "Apache-2.0" 8 | 9 | [dependencies] 10 | futures-timer = "3.0.2" 11 | libp2p = { version = "0.35.1", default-features = false } 12 | jsonrpc-core = "15.0.0" 13 | serde = "1.0.106" 14 | serde_json = "1.0.48" 15 | wasm-bindgen = { version = "=0.2.70", features = ["serde-serialize"] } 16 | wasm-bindgen-futures = "0.4.18" 17 | wasm-bindgen-test = "0.3.18" 18 | futures = "0.3.9" 19 | 20 | node-cli = { path = "../cli", default-features = false, features = ["browser"], version = "2.0.0"} 21 | sc-rpc-api = { path = "../../../client/rpc-api", version = "0.9.0"} 22 | -------------------------------------------------------------------------------- /bin/node/browser-testing/webdriver.json: -------------------------------------------------------------------------------- 1 | { 2 | "goog:chromeOptions": { 3 | "args": [ 4 | "--whitelisted-ips=127.0.0.1" 5 | ] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /bin/node/cli/bin/main.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2018-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 5 | 6 | // This program is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program. If not, see . 18 | 19 | //! Substrate Node CLI 20 | 21 | #![warn(missing_docs)] 22 | 23 | fn main() -> sc_cli::Result<()> { 24 | node_cli::run() 25 | } 26 | -------------------------------------------------------------------------------- /bin/node/cli/browser-demo/.gitignore: -------------------------------------------------------------------------------- 1 | pkg -------------------------------------------------------------------------------- /bin/node/cli/browser-demo/README.md: -------------------------------------------------------------------------------- 1 | # How to run this demo 2 | 3 | ```sh 4 | # If necessary, install wasm-bindgen 5 | # The version must match that used when building the browser demo. 6 | cargo install --version 0.2.67 wasm-bindgen-cli 7 | 8 | # Run the build script 9 | ./build.sh 10 | ``` 11 | -------------------------------------------------------------------------------- /bin/node/cli/browser-demo/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e -x 3 | cargo +nightly build --release -p node-cli --target wasm32-unknown-unknown --no-default-features --features browser -Z features=itarget 4 | wasm-bindgen ../../../../target/wasm32-unknown-unknown/release/node_cli.wasm --out-dir pkg --target web 5 | python -m http.server 8000 6 | -------------------------------------------------------------------------------- /bin/node/cli/browser-demo/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plugblockchain/plug-blockchain/003d87bd38d2cd023e5c75d59b8a29aff8a12961/bin/node/cli/browser-demo/favicon.png -------------------------------------------------------------------------------- /bin/node/inspect/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "node-inspect" 3 | version = "0.8.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | 10 | [package.metadata.docs.rs] 11 | targets = ["x86_64-unknown-linux-gnu"] 12 | 13 | [dependencies] 14 | codec = { package = "parity-scale-codec", version = "2.0.0" } 15 | derive_more = "0.99" 16 | log = "0.4.8" 17 | sc-cli = { version = "0.9.0", path = "../../../client/cli" } 18 | sc-client-api = { version = "3.0.0", path = "../../../client/api" } 19 | sc-service = { version = "0.9.0", default-features = false, path = "../../../client/service" } 20 | sp-blockchain = { version = "3.0.0", path = "../../../primitives/blockchain" } 21 | sp-core = { version = "3.0.0", path = "../../../primitives/core" } 22 | sp-runtime = { version = "3.0.0", path = "../../../primitives/runtime" } 23 | structopt = "0.3.8" 24 | -------------------------------------------------------------------------------- /bin/node/rpc-client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "node-rpc-client" 3 | version = "2.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | 10 | [package.metadata.docs.rs] 11 | targets = ["x86_64-unknown-linux-gnu"] 12 | 13 | [dependencies] 14 | futures = "0.1.29" 15 | hyper = "~0.12.35" 16 | jsonrpc-core-client = { version = "15.1.0", default-features = false, features = ["http"] } 17 | log = "0.4.8" 18 | node-primitives = { version = "2.0.0", path = "../primitives" } 19 | sp-tracing = { version = "3.0.0", path = "../../../primitives/tracing" } 20 | sc-rpc = { version = "3.0.0", path = "../../../client/rpc" } 21 | -------------------------------------------------------------------------------- /bin/node/runtime/build.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | use substrate_wasm_builder::WasmBuilder; 19 | 20 | fn main() { 21 | WasmBuilder::new() 22 | .with_current_project() 23 | .export_heap_base() 24 | .import_memory() 25 | .build() 26 | } 27 | -------------------------------------------------------------------------------- /bin/utils/chain-spec-builder/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "chain-spec-builder" 3 | version = "2.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | build = "build.rs" 7 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 8 | homepage = "https://substrate.dev" 9 | repository = "https://github.com/paritytech/substrate/" 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | ansi_term = "0.12.1" 17 | sc-keystore = { version = "3.0.0", path = "../../../client/keystore" } 18 | sc-chain-spec = { version = "3.0.0", path = "../../../client/chain-spec" } 19 | node-cli = { version = "2.0.0", path = "../../node/cli" } 20 | sp-core = { version = "3.0.0", path = "../../../primitives/core" } 21 | sp-keystore = { version = "0.9.0", path = "../../../primitives/keystore" } 22 | rand = "0.7.2" 23 | structopt = "0.3.8" 24 | -------------------------------------------------------------------------------- /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.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | readme = "README.md" 10 | 11 | [package.metadata.docs.rs] 12 | targets = ["x86_64-unknown-linux-gnu"] 13 | 14 | [[bin]] 15 | path = "src/main.rs" 16 | name = "subkey" 17 | 18 | [dependencies] 19 | sc-cli = { version = "0.9.0", path = "../../../client/cli" } 20 | structopt = "0.3.14" 21 | -------------------------------------------------------------------------------- /bin/utils/subkey/README.md: -------------------------------------------------------------------------------- 1 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /bin/utils/subkey/src/main.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2018-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 5 | 6 | // This program is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program. If not, see . 18 | 19 | //! Subkey utility, based on node_runtime. 20 | 21 | fn main() -> Result<(), sc_cli::Error> { 22 | subkey::run() 23 | } 24 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /client/authority-discovery/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | prost_build::compile_protos(&["src/worker/schema/dht.proto"], &["src/worker/schema"]).unwrap(); 3 | } 4 | -------------------------------------------------------------------------------- /client/authority-discovery/src/worker/schema/dht.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package authority_discovery; 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 | } 15 | -------------------------------------------------------------------------------- /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 = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 7 | homepage = "https://substrate.dev" 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 = "0.1.4" 19 | proc-macro2 = "1.0.6" 20 | quote = "1.0.3" 21 | syn = "1.0.58" 22 | 23 | [dev-dependencies] 24 | -------------------------------------------------------------------------------- /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/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sc-consensus" 3 | version = "0.9.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Collection of common consensus specific imlementations for Substrate (client)" 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | sc-client-api = { version = "3.0.0", path = "../../api" } 17 | sp-blockchain = { version = "3.0.0", path = "../../../primitives/blockchain" } 18 | sp-runtime = { version = "3.0.0", path = "../../../primitives/runtime" } 19 | sp-consensus = { version = "0.9.0", path = "../../../primitives/consensus/common" } 20 | -------------------------------------------------------------------------------- /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/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sc-consensus-epochs" 3 | version = "0.9.0" 4 | authors = ["Parity Technologies "] 5 | description = "Generic epochs-based utilities for consensus" 6 | edition = "2018" 7 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 8 | homepage = "https://substrate.dev" 9 | repository = "https://github.com/paritytech/substrate/" 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } 17 | parking_lot = "0.11.1" 18 | fork-tree = { version = "3.0.0", path = "../../../utils/fork-tree" } 19 | sp-runtime = { path = "../../../primitives/runtime" , version = "3.0.0"} 20 | sp-blockchain = { version = "3.0.0", path = "../../../primitives/blockchain" } 21 | sc-client-api = { path = "../../api" , version = "3.0.0"} 22 | -------------------------------------------------------------------------------- /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/pow/README.md: -------------------------------------------------------------------------------- 1 | Proof of work consensus for Substrate. 2 | 3 | To use this engine, you can need to have a struct that implements 4 | `PowAlgorithm`. After that, pass an instance of the struct, along 5 | with other necessary client references to `import_queue` to setup 6 | the queue. Use the `start_mine` function for basic CPU mining. 7 | 8 | The auxiliary storage for PoW engine only stores the total difficulty. 9 | For other storage requirements for particular PoW algorithm (such as 10 | the actual difficulty for each particular blocks), you can take a client 11 | reference in your `PowAlgorithm` implementation, and use a separate prefix 12 | for the auxiliary storage. It is also possible to just use the runtime 13 | as the storage, but it is not recommended as it won't work well with light 14 | clients. 15 | 16 | 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/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sc-consensus-uncles" 3 | version = "0.9.0" 4 | authors = ["Parity Technologies "] 5 | description = "Generic uncle inclusion utilities for consensus" 6 | edition = "2018" 7 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 8 | homepage = "https://substrate.dev" 9 | repository = "https://github.com/paritytech/substrate/" 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | sc-client-api = { version = "3.0.0", path = "../../api" } 17 | sp-core = { version = "3.0.0", path = "../../../primitives/core" } 18 | sp-runtime = { version = "3.0.0", path = "../../../primitives/runtime" } 19 | sp-authorship = { version = "3.0.0", path = "../../../primitives/authorship" } 20 | sp-consensus = { version = "0.9.0", path = "../../../primitives/consensus/common" } 21 | sp-inherents = { version = "3.0.0", path = "../../../primitives/inherents" } 22 | log = "0.4.8" 23 | -------------------------------------------------------------------------------- /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/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/light/README.md: -------------------------------------------------------------------------------- 1 | Light client components. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/network/build.rs: -------------------------------------------------------------------------------- 1 | const PROTOS: &[&str] = &[ 2 | "src/schema/api.v1.proto", 3 | "src/schema/light.v1.proto", 4 | "src/schema/bitswap.v1.2.0.proto", 5 | ]; 6 | 7 | fn main() { 8 | prost_build::compile_protos(PROTOS, &["src/schema"]).unwrap(); 9 | } 10 | -------------------------------------------------------------------------------- /client/offchain/README.md: -------------------------------------------------------------------------------- 1 | Substrate offchain workers. 2 | 3 | The offchain workers is a special function of the runtime that 4 | gets executed after block is imported. During execution 5 | it's able to asynchronously submit extrinsics that will either 6 | be propagated to other nodes or added to the next block 7 | produced by the node as unsigned transactions. 8 | 9 | Offchain workers can be used for computation-heavy tasks 10 | that are not feasible for execution during regular block processing. 11 | It can either be tasks that no consensus is required for, 12 | or some form of consensus over the data can be built on-chain 13 | for instance via: 14 | 1. Challenge period for incorrect computations 15 | 2. Majority voting for results 16 | 3. etc 17 | 18 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/peerset/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Connectivity manager based on reputation" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 5 | name = "sc-peerset" 6 | version = "3.0.0" 7 | authors = ["Parity Technologies "] 8 | edition = "2018" 9 | repository = "https://github.com/paritytech/substrate/" 10 | documentation = "https://docs.rs/sc-peerset" 11 | readme = "README.md" 12 | 13 | [package.metadata.docs.rs] 14 | targets = ["x86_64-unknown-linux-gnu"] 15 | 16 | 17 | [dependencies] 18 | futures = "0.3.9" 19 | libp2p = { version = "0.35.1", default-features = false } 20 | sp-utils = { version = "3.0.0", path = "../../primitives/utils"} 21 | log = "0.4.8" 22 | serde_json = "1.0.41" 23 | wasm-timer = "0.2" 24 | 25 | [dev-dependencies] 26 | rand = "0.7.2" 27 | -------------------------------------------------------------------------------- /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.9.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 7 | homepage = "https://substrate.dev" 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.8" 17 | prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus", version = "0.9.0"} 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/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/state-db/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sc-state-db" 3 | version = "0.9.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "GPL-3.0-or-later WITH Classpath-exception-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "State database maintenance. Handles canonicalization and pruning in the database." 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | thiserror = "1.0.21" 17 | parking_lot = "0.11.1" 18 | log = "0.4.11" 19 | sc-client-api = { version = "3.0.0", path = "../api" } 20 | sp-core = { version = "3.0.0", path = "../../primitives/core" } 21 | codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } 22 | parity-util-mem = { version = "0.9.0", default-features = false, features = ["primitive-types"] } 23 | parity-util-mem-derive = "0.1.0" 24 | -------------------------------------------------------------------------------- /client/state-db/README.md: -------------------------------------------------------------------------------- 1 | State database maintenance. Handles canonicalization and pruning in the database. The input to 2 | this module is a `ChangeSet` which is basically a list of key-value pairs (trie nodes) that 3 | were added or deleted during block execution. 4 | 5 | # Canonicalization. 6 | Canonicalization window tracks a tree of blocks identified by header hash. The in-memory 7 | overlay allows to get any node that was inserted in any of the blocks within the window. 8 | The tree is journaled to the backing database and rebuilt on startup. 9 | Canonicalization function selects one root from the top of the tree and discards all other roots and 10 | their subtrees. 11 | 12 | # Pruning. 13 | See `RefWindow` for pruning algorithm details. `StateDb` prunes on each canonicalization until pruning 14 | constraints are satisfied. 15 | 16 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /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 = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 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 = "0.1.4" 19 | proc-macro2 = "1.0.6" 20 | quote = { version = "1.0.3", features = ["proc-macro"] } 21 | syn = { version = "1.0.58", features = ["proc-macro", "full", "extra-traits", "parsing"] } 22 | -------------------------------------------------------------------------------- /client/transaction-pool/README.md: -------------------------------------------------------------------------------- 1 | Substrate transaction pool implementation. 2 | 3 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/transaction-pool/graph/README.md: -------------------------------------------------------------------------------- 1 | Generic Transaction Pool 2 | 3 | The pool is based on dependency graph between transactions 4 | and their priority. 5 | The pool is able to return an iterator that traverses transaction 6 | graph in the correct order taking into account priorities and dependencies. 7 | 8 | License: GPL-3.0-or-later WITH Classpath-exception-2.0 -------------------------------------------------------------------------------- /client/transaction-pool/src/testing/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2020-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 5 | 6 | // This program is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program. If not, see . 18 | 19 | //! Tests for top-level transaction pool api 20 | 21 | mod pool; 22 | -------------------------------------------------------------------------------- /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/plugblockchain/plug-blockchain/003d87bd38d2cd023e5c75d59b8a29aff8a12961/docs/media/sub.gif -------------------------------------------------------------------------------- /frame/atomic-swap/README.md: -------------------------------------------------------------------------------- 1 | # Atomic Swap 2 | 3 | A module for atomically sending funds. 4 | 5 | - [`atomic_swap::Config`](https://docs.rs/pallet-atomic-swap/latest/pallet_atomic_swap/trait.Trait.html) 6 | - [`Call`](https://docs.rs/pallet-atomic-swap/latest/pallet_atomic_swap/enum.Call.html) 7 | - [`Module`](https://docs.rs/pallet-atomic-swap/latest/pallet_atomic_swap/struct.Module.html) 8 | 9 | ## Overview 10 | 11 | A module for atomically sending funds from an origin to a target. A proof 12 | is used to allow the target to approve (claim) the swap. If the swap is not 13 | claimed within a specified duration of time, the sender may cancel it. 14 | 15 | ## Interface 16 | 17 | ### Dispatchable Functions 18 | 19 | * `create_swap` - called by a sender to register a new atomic swap 20 | * `claim_swap` - called by the target to approve a swap 21 | * `cancel_swap` - may be called by a sender after a specified duration 22 | 23 | License: Apache-2.0 24 | -------------------------------------------------------------------------------- /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/contracts/common/README.md: -------------------------------------------------------------------------------- 1 | A crate that hosts a common definitions that are relevant for the pallet-contracts. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/contracts/fixtures/return_from_start_fn.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (import "seal0" "seal_return" (func $seal_return (param i32 i32 i32))) 3 | (import "seal0" "seal_deposit_event" (func $seal_deposit_event (param i32 i32 i32 i32))) 4 | (import "env" "memory" (memory 1 1)) 5 | 6 | (start $start) 7 | (func $start 8 | (call $seal_deposit_event 9 | (i32.const 0) ;; The topics buffer 10 | (i32.const 0) ;; The topics buffer's length 11 | (i32.const 8) ;; The data buffer 12 | (i32.const 4) ;; The data buffer's length 13 | ) 14 | (call $seal_return 15 | (i32.const 0) 16 | (i32.const 8) 17 | (i32.const 4) 18 | ) 19 | (unreachable) 20 | ) 21 | 22 | (func (export "call") 23 | (unreachable) 24 | ) 25 | (func (export "deploy")) 26 | 27 | (data (i32.const 8) "\01\02\03\04") 28 | ) 29 | -------------------------------------------------------------------------------- /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/proc-macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pallet-contracts-proc-macro" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Procedural macros used in pallet_contracts" 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" 19 | quote = "1" 20 | syn = "1" 21 | 22 | [dev-dependencies] 23 | 24 | [features] 25 | # If set the full output is generated. Do NOT set when generating for wasm runtime. 26 | full = [] 27 | -------------------------------------------------------------------------------- /frame/contracts/rpc/README.md: -------------------------------------------------------------------------------- 1 | Node-specific RPC methods for interaction with contracts. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/contracts/rpc/runtime-api/README.md: -------------------------------------------------------------------------------- 1 | Runtime API definition required by Contracts 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 Contracts access methods. 6 | 7 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/elections-phragmen/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this crate will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | and this crate adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [3.0.0] - UNRELEASED 8 | 9 | ### Added 10 | [Add slashing events to elections-phragmen](https://github.com/paritytech/substrate/pull/7543) 11 | 12 | ### Changed 13 | 14 | ### Fixed 15 | [Don't slash all outgoing members](https://github.com/paritytech/substrate/pull/7394) 16 | [Fix wrong outgoing calculation in election](https://github.com/paritytech/substrate/pull/7384) 17 | 18 | ### Security 19 | \[**Needs Migration**\] [Fix elections-phragmen and proxy issue + Record deposits on-chain](https://github.com/paritytech/substrate/pull/7040) 20 | 21 | ## [2.0.0] - 2020-09-2020 22 | 23 | Initial version from which version tracking has begun. 24 | 25 | -------------------------------------------------------------------------------- /frame/elections/README.md: -------------------------------------------------------------------------------- 1 | Election module for stake-weighted membership selection of a collective. 2 | 3 | The composition of a set of account IDs works according to one or more approval votes 4 | weighted by stake. There is a partial carry-over facility to give greater weight to those 5 | whose voting is serially unsuccessful. 6 | 7 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/gilt/README.md: -------------------------------------------------------------------------------- 1 | 2 | License: Apache-2.0 3 | -------------------------------------------------------------------------------- /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 of a 4 | collective. A prime member may be set. 5 | 6 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/metadata/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "frame-metadata" 3 | version = "13.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Decodable variant of the RuntimeMetadata." 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } 17 | serde = { version = "1.0.101", optional = true, features = ["derive"] } 18 | sp-std = { version = "3.0.0", default-features = false, path = "../../primitives/std" } 19 | sp-core = { version = "3.0.0", default-features = false, path = "../../primitives/core" } 20 | 21 | [features] 22 | default = ["std"] 23 | std = [ 24 | "codec/std", 25 | "sp-std/std", 26 | "sp-core/std", 27 | "serde", 28 | ] 29 | -------------------------------------------------------------------------------- /frame/metadata/README.md: -------------------------------------------------------------------------------- 1 | Decodable variant of the RuntimeMetadata. 2 | 3 | This really doesn't belong here, but is necessary for the moment. In the future 4 | it should be removed entirely to an external module for shimming on to the 5 | codec-encoded metadata. 6 | 7 | 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/proxy/README.md: -------------------------------------------------------------------------------- 1 | # Proxy Module 2 | A module allowing accounts to give permission to other accounts to dispatch types of calls from 3 | their signed origin. 4 | 5 | The accounts to which permission is delegated may be requied to announce the action that they 6 | wish to execute some duration prior to execution happens. In this case, the target account may 7 | reject the announcement and in doing so, veto the execution. 8 | 9 | - [`proxy::Config`](https://docs.rs/pallet-proxy/latest/pallet_proxy/trait.Trait.html) 10 | - [`Call`](https://docs.rs/pallet-proxy/latest/pallet_proxy/enum.Call.html) 11 | 12 | ## Overview 13 | 14 | ## Interface 15 | 16 | ### Dispatchable Functions 17 | 18 | [`Call`]: ./enum.Call.html 19 | [`Config`]: ./trait.Config.html 20 | 21 | License: Apache-2.0 22 | -------------------------------------------------------------------------------- /frame/session/benchmarking/README.md: -------------------------------------------------------------------------------- 1 | Benchmarks for the Session Pallet. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/staking/fuzzer/.gitignore: -------------------------------------------------------------------------------- 1 | hfuzz_target 2 | hfuzz_workspace 3 | -------------------------------------------------------------------------------- /frame/staking/reward-curve/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pallet-staking-reward-curve" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Reward Curve for FRAME staking pallet" 10 | 11 | [package.metadata.docs.rs] 12 | targets = ["x86_64-unknown-linux-gnu"] 13 | 14 | [lib] 15 | proc-macro = true 16 | 17 | [dependencies] 18 | syn = { version = "1.0.58", features = ["full", "visit"] } 19 | quote = "1.0.3" 20 | proc-macro2 = "1.0.6" 21 | proc-macro-crate = "0.1.4" 22 | 23 | [dev-dependencies] 24 | sp-runtime = { version = "3.0.0", path = "../../../primitives/runtime" } 25 | -------------------------------------------------------------------------------- /frame/support/README.md: -------------------------------------------------------------------------------- 1 | Support code for the runtime. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/support/procedural/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "frame-support-procedural" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Proc macro of Support code for the runtime." 10 | 11 | [package.metadata.docs.rs] 12 | targets = ["x86_64-unknown-linux-gnu"] 13 | 14 | [lib] 15 | proc-macro = true 16 | 17 | [dependencies] 18 | frame-support-procedural-tools = { version = "3.0.0", path = "./tools" } 19 | proc-macro2 = "1.0.6" 20 | quote = "1.0.3" 21 | Inflector = "0.11.4" 22 | syn = { version = "1.0.58", features = ["full"] } 23 | 24 | [features] 25 | default = ["std"] 26 | std = [] 27 | -------------------------------------------------------------------------------- /frame/support/procedural/tools/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "frame-support-procedural-tools" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Proc macro helpers for procedural macros" 10 | 11 | [package.metadata.docs.rs] 12 | targets = ["x86_64-unknown-linux-gnu"] 13 | 14 | [dependencies] 15 | frame-support-procedural-tools-derive = { version = "3.0.0", path = "./derive" } 16 | proc-macro2 = "1.0.6" 17 | quote = "1.0.3" 18 | syn = { version = "1.0.58", features = ["full", "visit"] } 19 | proc-macro-crate = "0.1.5" 20 | -------------------------------------------------------------------------------- /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 = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 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.6" 19 | quote = { version = "1.0.3", features = ["proc-macro"] } 20 | syn = { version = "1.0.58", 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: Module indices are conflicting: Both modules System and Pallet1 are at index 0 2 | --> $DIR/conflicting_index.rs:9:3 3 | | 4 | 9 | System: system::{}, 5 | | ^^^^^^ 6 | 7 | error: Module indices are conflicting: Both modules 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: Module indices are conflicting: Both modules 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: Module indices are conflicting: Both modules 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::{Module}, 10 | Balance: balances::{Module}, 11 | Balance: balances::{Module}, 12 | } 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /frame/support/test/tests/construct_runtime_ui/conflicting_module_name.stderr: -------------------------------------------------------------------------------- 1 | error: Two modules with the same name! 2 | --> $DIR/conflicting_module_name.rs:10:3 3 | | 4 | 10 | Balance: balances::{Module}, 5 | | ^^^^^^^ 6 | 7 | error: Two modules with the same name! 8 | --> $DIR/conflicting_module_name.rs:11:3 9 | | 10 | 11 | Balance: balances::{Module}, 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::{Module}, 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/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::{Module}, 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 modules 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_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: expected curly braces 2 | --> $DIR/invalid_module_details.rs:9:19 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: `Module`, `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::{Module}, 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: `Module`, `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: expected `::` 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::{Module}, 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 module with no generic `Event` cannot be constructed: module `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::{Module}, 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 module with no generic `Origin` cannot be constructed: module `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` module declaration is missing. Please add this line: `System: frame_system::{Module, Call, Storage, Config, Event},` 2 | --> $DIR/missing_system_module.rs:8:2 3 | | 4 | 8 | { 5 | | _____^ 6 | 9 | | } 7 | | |_____^ 8 | -------------------------------------------------------------------------------- /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 | --> $DIR/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 | --> $DIR/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: Module 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/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::Origin, 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::Origin, system=self { 3 | fn on_initialize() -> Weight { 4 | 0 5 | } 6 | 7 | fn on_initialize() -> Weight { 8 | 0 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /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 | --> $DIR/clone.rs:7:2 3 | | 4 | 7 | c: T::C, 5 | | ^ the trait `Clone` is not implemented for `::C` 6 | | 7 | = note: required by `clone` 8 | -------------------------------------------------------------------------------- /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 | --> $DIR/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 to the object type `dyn std::fmt::Debug` 9 | -------------------------------------------------------------------------------- /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 | --> $DIR/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 | -------------------------------------------------------------------------------- /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 | --> $DIR/partial_eq.rs:7:2 3 | | 4 | 7 | c: T::C, 5 | | ^ 6 | | 7 | = note: the trait `std::cmp::PartialEq` is not implemented for `::C` 8 | -------------------------------------------------------------------------------- /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: expected no attributes, e.g. macro call must be just `#[frame_support::pallet]` or `#[pallet]` 2 | --> $DIR/attr_non_empty.rs:1:26 3 | | 4 | 1 | #[frame_support::pallet [foo]] 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_argument_invalid_bound.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 | type Bar: codec::Codec; 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 | #[pallet::weight(0)] 20 | fn foo(origin: OriginFor, bar: T::Bar) -> DispatchResultWithPostInfo { 21 | Ok(().into()) 22 | } 23 | } 24 | } 25 | 26 | fn main() { 27 | } 28 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_argument_invalid_bound_2.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 | 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 | #[pallet::weight(0)] 20 | fn foo(origin: OriginFor, bar: T::Bar) -> DispatchResultWithPostInfo { 21 | Ok(().into()) 22 | } 23 | } 24 | } 25 | 26 | fn main() { 27 | } 28 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.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 | use codec::{Encode, Decode}; 6 | 7 | #[pallet::config] 8 | pub trait Config: frame_system::Config {} 9 | 10 | #[pallet::pallet] 11 | pub struct Pallet(core::marker::PhantomData); 12 | 13 | #[pallet::hooks] 14 | impl Hooks> for Pallet {} 15 | 16 | #[derive(Encode, Decode)] 17 | struct Bar; 18 | 19 | #[pallet::call] 20 | impl Pallet { 21 | #[pallet::weight(0)] 22 | fn foo(origin: OriginFor, bar: Bar) -> DispatchResultWithPostInfo { 23 | Ok(().into()) 24 | } 25 | } 26 | } 27 | 28 | fn main() { 29 | } 30 | -------------------------------------------------------------------------------- /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_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 | 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:18 3 | | 4 | 17 | fn foo(origin: u8) {} 5 | | ^^ 6 | 7 | error: expected `OriginFor` 8 | --> $DIR/call_invalid_origin_type.rs:17:18 9 | | 10 | 17 | fn foo(origin: u8) {} 11 | | ^^ 12 | -------------------------------------------------------------------------------- /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 | 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:3 3 | | 4 | 17 | 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 | 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:3 3 | | 4 | 17 | 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 | 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:3 3 | | 4 | 17 | fn foo(origin: OriginFor) {} 5 | | ^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/duplicate_call_attr.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(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 | #[pallet::call] 24 | impl Pallet {} 25 | } 26 | 27 | fn main() { 28 | } 29 | -------------------------------------------------------------------------------- /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.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(trait Store)] 12 | #[pallet::generate_store(trait Store)] 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::storage] 22 | type Foo = StorageValue<_, u8>; 23 | } 24 | 25 | fn main() { 26 | } 27 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/duplicate_store_attr.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::pallet, multiple argument pallet::generate_store found 2 | --> $DIR/duplicate_store_attr.rs:12:33 3 | | 4 | 12 | #[pallet::generate_store(trait Store)] 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/error_no_fieldless.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 { 20 | U8(u8), 21 | } 22 | } 23 | 24 | fn main() { 25 | } 26 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/error_no_fieldless.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid pallet::error, unexpected fields, must be `Unit` 2 | --> $DIR/error_no_fieldless.rs:20:5 3 | | 4 | 20 | U8(u8), 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /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_field_not_member.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::{Hooks, IsType}; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config { 8 | type Bar; 9 | type Event: IsType<::Event> + From>; 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_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 Event, `Config` contains no associated type `Event`, but enum `Event` is declared (in use of `#[pallet::event]`). An Event 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 an attribute macro (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 Event; 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 Event`, associated type `Event` is reserved and must bound: `IsType<::Event>` 2 | --> $DIR/event_type_invalid_bound.rs:9:3 3 | | 4 | 9 | type Event; 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/event_type_invalid_bound_2.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::{Hooks, IsType}; 4 | use frame_system::pallet_prelude::BlockNumberFor; 5 | 6 | #[pallet::config] 7 | pub trait Config: frame_system::Config { 8 | type Bar; 9 | type Event: IsType<::Event>; 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_2.stderr: -------------------------------------------------------------------------------- 1 | error: Invalid `type Event`, associated type `Event` is reserved and must bound: `From` or `From>` or `From>` 2 | --> $DIR/event_type_invalid_bound_2.rs:9:3 3 | | 4 | 9 | type Event: IsType<::Event>; 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_default_not_satisfied.rs: -------------------------------------------------------------------------------- 1 | #[frame_support::pallet] 2 | mod pallet { 3 | use frame_support::pallet_prelude::{Hooks, GenesisBuild}; 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_config] 19 | pub struct GenesisConfig; 20 | 21 | #[pallet::genesis_build] 22 | impl GenesisBuild for GenesisConfig {} 23 | } 24 | 25 | fn main() { 26 | } 27 | -------------------------------------------------------------------------------- /frame/support/test/tests/pallet_ui/genesis_default_not_satisfied.stderr: -------------------------------------------------------------------------------- 1 | error[E0277]: the trait bound `pallet::GenesisConfig: std::default::Default` is not satisfied 2 | --> $DIR/genesis_default_not_satisfied.rs:22:18 3 | | 4 | 22 | impl GenesisBuild for GenesisConfig {} 5 | | ^^^^^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `pallet::GenesisConfig` 6 | | 7 | ::: $WORKSPACE/frame/support/src/traits.rs 8 | | 9 | | pub trait GenesisBuild: Default + MaybeSerializeDeserialize { 10 | | ------- required by this bound in `GenesisBuild` 11 | -------------------------------------------------------------------------------- /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 an attribute macro (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]: wrong number of type arguments: expected 1, found 0 2 | --> $DIR/hooks_invalid_item.rs:12:18 3 | | 4 | 12 | impl Hooks for Pallet {} 5 | | ^^^^^ expected 1 type argument 6 | -------------------------------------------------------------------------------- /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_check_inner_span.stderr: -------------------------------------------------------------------------------- 1 | error[E0046]: not all trait items implemented, missing: `Call`, `Error`, `INHERENT_IDENTIFIER`, `create_inherent` 2 | --> $DIR/inherent_check_inner_span.rs:19:2 3 | | 4 | 19 | impl ProvideInherent for Pallet {} 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Call`, `Error`, `INHERENT_IDENTIFIER`, `create_inherent` in implementation 6 | | 7 | = help: implement the missing item: `type Call = Type;` 8 | = help: implement the missing item: `type Error = Type;` 9 | = help: implement the missing item: `const INHERENT_IDENTIFIER: [u8; 8] = value;` 10 | = help: implement the missing item: `fn create_inherent(_: &InherentData) -> std::option::Option<::Call> { todo!() }` 11 | -------------------------------------------------------------------------------- /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/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_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 use of `#[pallet::storage]`, the type first generic argument must be `_`, the final argument is automatically set 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_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 `StorageDoubleMap` 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_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: pallet::storage unexpected number of generic argument, expected at least 2 args, found none 2 | --> $DIR/storage_value_no_generic.rs:19:16 3 | | 4 | 19 | type Foo = StorageValue; 5 | | ^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /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, expected 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]`, syntax must be `type $SomeIdent: Get<$SomeType>;` 2 | --> $DIR/trait_constant_invalid_bound.rs:9:3 3 | | 4 | 9 | type U; 5 | | ^^^^ 6 | 7 | error: expected `:` 8 | --> $DIR/trait_constant_invalid_bound.rs:9:9 9 | | 10 | 9 | type U; 11 | | ^ 12 | -------------------------------------------------------------------------------- /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_forgotten_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 | where ::AccountId: From 9 | {} 10 | 11 | #[pallet::pallet] 12 | pub struct Pallet(_); 13 | 14 | #[pallet::hooks] 15 | impl Hooks> for Pallet 16 | where ::AccountId: From 17 | {} 18 | 19 | #[pallet::call] 20 | impl Pallet 21 | where ::AccountId: From 22 | {} 23 | 24 | #[pallet::type_value] fn Foo() -> u32 { 3u32 } 25 | } 26 | 27 | fn main() { 28 | } 29 | -------------------------------------------------------------------------------- /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/reserved_keyword/on_initialize.rs: -------------------------------------------------------------------------------- 1 | macro_rules! reserved { 2 | ($($reserved:ident)*) => { 3 | $( 4 | mod $reserved { 5 | pub use frame_support::dispatch; 6 | 7 | pub trait Config: frame_support_test::Config {} 8 | 9 | pub mod system { 10 | use frame_support::dispatch; 11 | 12 | pub fn ensure_root(_: R) -> dispatch::DispatchResult { 13 | Ok(()) 14 | } 15 | } 16 | 17 | frame_support::decl_module! { 18 | pub struct Module for enum Call where origin: T::Origin, system=frame_support_test { 19 | #[weight = 0] 20 | fn $reserved(_origin) -> dispatch::DispatchResult { unreachable!() } 21 | } 22 | } 23 | } 24 | )* 25 | } 26 | } 27 | 28 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event); 29 | 30 | fn main() {} 31 | -------------------------------------------------------------------------------- /frame/system/benchmarking/README.md: -------------------------------------------------------------------------------- 1 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/system/rpc/runtime-api/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "frame-system-rpc-runtime-api" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Runtime API definition required by System RPC extensions." 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | sp-api = { version = "3.0.0", default-features = false, path = "../../../../primitives/api" } 17 | codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } 18 | 19 | [features] 20 | default = ["std"] 21 | std = [ 22 | "sp-api/std", 23 | "codec/std", 24 | ] 25 | -------------------------------------------------------------------------------- /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/system/src/extensions/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2020-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | pub mod check_genesis; 19 | pub mod check_mortality; 20 | pub mod check_nonce; 21 | pub mod check_spec_version; 22 | pub mod check_tx_version; 23 | pub mod check_weight; 24 | 25 | -------------------------------------------------------------------------------- /frame/transaction-payment/README.md: -------------------------------------------------------------------------------- 1 | # Transaction Payment Module 2 | 3 | This module provides the basic logic needed to pay the absolute minimum amount needed for a 4 | transaction to be included. This includes: 5 | - _weight fee_: A fee proportional to amount of weight a transaction consumes. 6 | - _length fee_: A fee proportional to the encoded length of the transaction. 7 | - _tip_: An optional tip. Tip increases the priority of the transaction, giving it a higher 8 | chance to be included by the transaction queue. 9 | 10 | Additionally, this module allows one to configure: 11 | - The mapping between one unit of weight to one unit of fee via [`Config::WeightToFee`]. 12 | - A means of updating the fee for the next block, via defining a multiplier, based on the 13 | final state of the chain at the end of the previous block. This can be configured via 14 | [`Config::FeeMultiplierUpdate`] 15 | 16 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/transaction-payment/rpc/README.md: -------------------------------------------------------------------------------- 1 | RPC interface for the transaction payment module. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /frame/transaction-payment/rpc/runtime-api/README.md: -------------------------------------------------------------------------------- 1 | Runtime API definition for transaction payment module. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/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/sp-allocator/latest/sp_allocator/struct.FreeingBumpHeapAllocator.html) 5 | 6 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/api/README.md: -------------------------------------------------------------------------------- 1 | Substrate runtime api 2 | 3 | The Substrate runtime api is the crucial interface between the node and the runtime. 4 | Every call that goes into the runtime is done with a runtime api. The runtime apis are not fixed. 5 | Every Substrate user can define its own apis with 6 | [`decl_runtime_apis`](https://docs.rs/sp-api/latest/sp_api/macro.decl_runtime_apis.html) and implement them in 7 | the runtime with [`impl_runtime_apis`](https://docs.rs/sp-api/latest/sp_api/macro.impl_runtime_apis.html). 8 | 9 | Every Substrate runtime needs to implement the [`Core`] runtime api. This api provides the basic 10 | functionality that every runtime needs to export. 11 | 12 | Besides the macros and the [`Core`] runtime api, this crates provides the [`Metadata`] runtime 13 | api, the [`ApiExt`] trait, the [`CallApiAt`] trait and the [`ConstructRuntimeApi`] trait. 14 | 15 | On a meta level this implies, the client calls the generated API from the client perspective. 16 | 17 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/api/proc-macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-api-proc-macro" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Macros for declaring and implementing runtime apis." 10 | documentation = "https://docs.rs/sp-api-proc-macro" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | 16 | [lib] 17 | proc-macro = true 18 | 19 | [dependencies] 20 | quote = "1.0.3" 21 | syn = { version = "1.0.58", features = ["full", "fold", "extra-traits", "visit"] } 22 | proc-macro2 = "1.0.6" 23 | blake2-rfc = { version = "0.2.18", default-features = false } 24 | proc-macro-crate = "0.1.4" 25 | 26 | # Required for the doc tests 27 | [features] 28 | default = [ "std" ] 29 | std = [] 30 | -------------------------------------------------------------------------------- /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 | --> $DIR/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 a macro (in Nightly builds, run with -Z macro-backtrace for more info) 8 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/impl_incorrect_method_signature.rs: -------------------------------------------------------------------------------- 1 | use sp_runtime::traits::{GetNodeBlockType, Block as BlockT}; 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: String) {} 20 | } 21 | 22 | impl sp_api::Core for Runtime { 23 | fn version() -> sp_api::RuntimeVersion { 24 | unimplemented!() 25 | } 26 | fn execute_block(_: Block) { 27 | unimplemented!() 28 | } 29 | fn initialize_block(_: &::Header) { 30 | unimplemented!() 31 | } 32 | } 33 | } 34 | 35 | fn main() {} 36 | -------------------------------------------------------------------------------- /primitives/api/test/tests/ui/impl_two_traits_with_same_name.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 | mod second { 18 | sp_api::decl_runtime_apis! { 19 | pub trait Api { 20 | fn test2(data: u64); 21 | } 22 | } 23 | } 24 | 25 | sp_api::impl_runtime_apis! { 26 | impl self::Api for Runtime { 27 | fn test(data: u64) {} 28 | } 29 | 30 | impl second::Api for Runtime { 31 | fn test2(data: u64) {} 32 | } 33 | } 34 | 35 | fn main() {} 36 | -------------------------------------------------------------------------------- /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.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.stderr: -------------------------------------------------------------------------------- 1 | error: Unexpected `api_version` attribute. The supported format is `api_version(1)` 2 | --> $DIR/invalid_api_version.rs:2:4 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 | --> $DIR/invalid_api_version_2.rs:2:4 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 | --> $DIR/invalid_api_version_3.rs:2:4 3 | | 4 | 2 | #[api_version()] 5 | | ^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /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/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 | --> $DIR/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 a macro (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 | --> $DIR/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/application-crypto/test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-application-crypto-test" 3 | version = "2.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | description = "Integration tests for application-crypto" 7 | license = "Apache-2.0" 8 | publish = false 9 | homepage = "https://substrate.dev" 10 | repository = "https://github.com/paritytech/substrate/" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | sp-core = { version = "3.0.0", default-features = false, path = "../../core" } 17 | sp-keystore = { version = "0.9.0", path = "../../keystore", default-features = false } 18 | substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" } 19 | sp-runtime = { version = "3.0.0", path = "../../runtime" } 20 | sp-api = { version = "3.0.0", path = "../../api" } 21 | sp-application-crypto = { version = "3.0.0", path = "../" } 22 | -------------------------------------------------------------------------------- /primitives/application-crypto/test/src/lib.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | //! Integration tests for application crypto 19 | 20 | #[cfg(test)] 21 | mod ed25519; 22 | #[cfg(test)] 23 | mod sr25519; 24 | #[cfg(test)] 25 | mod ecdsa; 26 | -------------------------------------------------------------------------------- /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/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-authorship" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | description = "Authorship primitives" 6 | edition = "2018" 7 | license = "Apache-2.0" 8 | homepage = "https://substrate.dev" 9 | repository = "https://github.com/paritytech/substrate/" 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | sp-inherents = { version = "3.0.0", default-features = false, path = "../inherents" } 17 | sp-runtime = { version = "3.0.0", default-features = false, path = "../runtime" } 18 | sp-std = { version = "3.0.0", default-features = false, path = "../std" } 19 | codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } 20 | 21 | [features] 22 | default = [ "std" ] 23 | std = [ 24 | "codec/std", 25 | "sp-std/std", 26 | "sp-inherents/std", 27 | "sp-runtime/std", 28 | ] 29 | -------------------------------------------------------------------------------- /primitives/authorship/README.md: -------------------------------------------------------------------------------- 1 | Authorship Primitives 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /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/blockchain/src/lib.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | //! Substrate blockchain traits and primitives. 19 | 20 | mod backend; 21 | mod header_metadata; 22 | mod error; 23 | 24 | pub use error::*; 25 | pub use backend::*; 26 | pub use header_metadata::*; 27 | -------------------------------------------------------------------------------- /primitives/chain-spec/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-chain-spec" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Substrate chain configurations types." 10 | readme = "README.md" 11 | 12 | [dependencies] 13 | serde = { version = "1.0.101", features = ["derive"] } 14 | serde_json = "1.0.41" 15 | -------------------------------------------------------------------------------- /primitives/chain-spec/README.md: -------------------------------------------------------------------------------- 1 | Types and traits related to chain specifications. 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/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-consensus-slots" 3 | version = "0.9.0" 4 | authors = ["Parity Technologies "] 5 | description = "Primitives for slots-based consensus" 6 | edition = "2018" 7 | license = "Apache-2.0" 8 | homepage = "https://substrate.dev" 9 | repository = "https://github.com/paritytech/substrate/" 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } 17 | sp-runtime = { version = "3.0.0", default-features = false, path = "../../runtime" } 18 | sp-arithmetic = { version = "3.0.0", default-features = false, path = "../../arithmetic" } 19 | 20 | [features] 21 | default = ["std"] 22 | std = [ 23 | "codec/std", 24 | "sp-runtime/std", 25 | "sp-arithmetic/std", 26 | ] 27 | -------------------------------------------------------------------------------- /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/consensus/vrf/src/lib.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | //! Primitives for VRF-based consensus engines. 19 | #![cfg_attr(not(feature = "std"), no_std)] 20 | 21 | pub mod schnorrkel; 22 | -------------------------------------------------------------------------------- /primitives/database/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-database" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 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 | parking_lot = "0.11.1" 15 | kvdb = "0.9.0" 16 | -------------------------------------------------------------------------------- /primitives/database/README.md: -------------------------------------------------------------------------------- 1 | The main database trait, allowing Substrate to store data persistently. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/debug-derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-debug-derive" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Macros to derive runtime debug implementation." 10 | documentation = "https://docs.rs/sp-debug-derive" 11 | 12 | 13 | [package.metadata.docs.rs] 14 | targets = ["x86_64-unknown-linux-gnu"] 15 | 16 | [lib] 17 | proc-macro = true 18 | 19 | [dependencies] 20 | quote = "1.0.3" 21 | syn = "1.0.58" 22 | proc-macro2 = "1.0" 23 | 24 | [features] 25 | std = [] 26 | 27 | [dev-dependencies] 28 | -------------------------------------------------------------------------------- /primitives/externalities/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-externalities" 3 | version = "0.9.0" 4 | license = "Apache-2.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Substrate externalities abstraction" 10 | documentation = "https://docs.rs/sp-externalities" 11 | readme = "README.md" 12 | 13 | [package.metadata.docs.rs] 14 | targets = ["x86_64-unknown-linux-gnu"] 15 | 16 | [dependencies] 17 | sp-storage = { version = "3.0.0", path = "../storage", default-features = false } 18 | sp-std = { version = "3.0.0", path = "../std", default-features = false } 19 | environmental = { version = "1.1.2", default-features = false } 20 | codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } 21 | 22 | [features] 23 | default = ["std"] 24 | std = [ 25 | "codec/std", 26 | "environmental/std", 27 | "sp-std/std", 28 | "sp-storage/std", 29 | ] 30 | -------------------------------------------------------------------------------- /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/inherents/README.md: -------------------------------------------------------------------------------- 1 | Provides types and traits for creating and checking inherents. 2 | 3 | Each inherent is added to a produced block. Each runtime decides on which inherents it 4 | wants to attach to its blocks. All data that is required for the runtime to create the inherents 5 | is stored in the `InherentData`. This `InherentData` is constructed by the node and given to 6 | the runtime. 7 | 8 | Types that provide data for inherents, should implement `InherentDataProvider` and need to be 9 | registered at `InherentDataProviders`. 10 | 11 | In the runtime, modules need to implement `ProvideInherent` when they can create and/or check 12 | inherents. By implementing `ProvideInherent`, a module is not enforced to create an inherent. 13 | A module can also just check given inherents. For using a module as inherent provider, it needs 14 | to be registered by the `construct_runtime!` macro. The macro documentation gives more 15 | information on how that is done. 16 | 17 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/io/README.md: -------------------------------------------------------------------------------- 1 | I/O host interface for substrate runtime. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/keyring/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-keyring" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Keyring support code for the runtime. A set of test accounts." 10 | documentation = "https://docs.rs/sp-keyring" 11 | readme = "README.md" 12 | 13 | [package.metadata.docs.rs] 14 | targets = ["x86_64-unknown-linux-gnu"] 15 | 16 | 17 | [dependencies] 18 | sp-core = { version = "3.0.0", path = "../core" } 19 | sp-runtime = { version = "3.0.0", path = "../runtime" } 20 | lazy_static = "1.4.0" 21 | strum = { version = "0.20.0", features = ["derive"] } 22 | -------------------------------------------------------------------------------- /primitives/keyring/README.md: -------------------------------------------------------------------------------- 1 | Support code for the runtime. A set of test accounts. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/npos-elections/compact/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-npos-elections-compact" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "NPoS Compact Solution Type" 10 | 11 | [package.metadata.docs.rs] 12 | targets = ["x86_64-unknown-linux-gnu"] 13 | 14 | [lib] 15 | proc-macro = true 16 | 17 | [dependencies] 18 | syn = { version = "1.0.58", features = ["full", "visit"] } 19 | quote = "1.0" 20 | proc-macro2 = "1.0.6" 21 | proc-macro-crate = "0.1.4" 22 | -------------------------------------------------------------------------------- /primitives/npos-elections/fuzzer/.gitignore: -------------------------------------------------------------------------------- 1 | hfuzz_target 2 | hfuzz_workspace 3 | -------------------------------------------------------------------------------- /primitives/offchain/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Substrate offchain workers primitives" 3 | name = "sp-offchain" 4 | version = "3.0.0" 5 | license = "Apache-2.0" 6 | authors = ["Parity Technologies "] 7 | edition = "2018" 8 | homepage = "https://substrate.dev" 9 | repository = "https://github.com/paritytech/substrate/" 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | sp-core = { version = "3.0.0", default-features = false, path = "../core" } 17 | sp-api = { version = "3.0.0", default-features = false, path = "../api" } 18 | sp-runtime = { version = "3.0.0", default-features = false, path = "../runtime" } 19 | 20 | [dev-dependencies] 21 | sp-state-machine = { version = "0.9.0", default-features = false, path = "../state-machine" } 22 | 23 | [features] 24 | default = ["std"] 25 | std = [ 26 | "sp-core/std", 27 | "sp-api/std", 28 | "sp-runtime/std" 29 | ] 30 | -------------------------------------------------------------------------------- /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 = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 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.38" 18 | -------------------------------------------------------------------------------- /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 = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 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 | serde = { version = "1.0.101", features = ["derive"] } 17 | sp-core = { version = "3.0.0", path = "../core" } 18 | 19 | [dev-dependencies] 20 | serde_json = "1.0.41" 21 | -------------------------------------------------------------------------------- /primitives/rpc/README.md: -------------------------------------------------------------------------------- 1 | Substrate RPC primitives and utilities. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/runtime-interface/proc-macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-runtime-interface-proc-macro" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "This crate provides procedural macros for usage within the context of the Substrate runtime interface." 10 | documentation = "https://docs.rs/sp-runtime-interface-proc-macro" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [lib] 16 | proc-macro = true 17 | 18 | [dependencies] 19 | syn = { version = "1.0.58", features = ["full", "visit", "fold", "extra-traits"] } 20 | quote = "1.0.3" 21 | proc-macro2 = "1.0.3" 22 | Inflector = "0.11.4" 23 | proc-macro-crate = "0.1.4" 24 | -------------------------------------------------------------------------------- /primitives/runtime-interface/test-wasm-deprecated/build.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | use substrate_wasm_builder::WasmBuilder; 19 | 20 | fn main() { 21 | WasmBuilder::new() 22 | .with_current_project() 23 | .export_heap_base() 24 | .import_memory() 25 | .build() 26 | } 27 | -------------------------------------------------------------------------------- /primitives/runtime-interface/test-wasm/build.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | use substrate_wasm_builder::WasmBuilder; 19 | 20 | fn main() { 21 | WasmBuilder::new() 22 | .with_current_project() 23 | .export_heap_base() 24 | .import_memory() 25 | .build() 26 | } 27 | -------------------------------------------------------------------------------- /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 a derive macro (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 a derive macro (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 a derive macro (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/runtime/src/offchain/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | //! A collection of higher lever helpers for offchain calls. 19 | 20 | pub mod http; 21 | pub mod storage; 22 | pub mod storage_lock; 23 | 24 | pub use sp_core::offchain::*; 25 | -------------------------------------------------------------------------------- /primitives/serializer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-serializer" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 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.101" 18 | serde_json = "1.0.41" 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/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-staking" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "A crate which contains primitives that are useful for implementation that uses staking approaches in general. Definitions related to sessions, slashing, etc go here." 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } 17 | sp-runtime = { version = "3.0.0", default-features = false, path = "../runtime" } 18 | sp-std = { version = "3.0.0", default-features = false, path = "../std" } 19 | 20 | [features] 21 | default = ["std"] 22 | std = [ 23 | "codec/std", 24 | "sp-runtime/std", 25 | "sp-std/std", 26 | ] 27 | -------------------------------------------------------------------------------- /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 = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | 10 | 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." 11 | documentation = "https://docs.rs/sp-std" 12 | readme = "README.md" 13 | 14 | [package.metadata.docs.rs] 15 | targets = ["x86_64-unknown-linux-gnu"] 16 | 17 | [features] 18 | default = ["std"] 19 | std = [] 20 | -------------------------------------------------------------------------------- /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/tasks/README.md: -------------------------------------------------------------------------------- 1 | Runtime asynchronous, pure computational tasks. 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/tracing/README.md: -------------------------------------------------------------------------------- 1 | Substrate tracing primitives and macros. 2 | 3 | To trace functions or invidual code in Substrate, this crate provides [`within_span`] 4 | and [`enter_span`]. See the individual docs for how to use these macros. 5 | 6 | Note that to allow traces from wasm execution environment there are 7 | 2 reserved identifiers for tracing `Field` recording, stored in the consts: 8 | `WASM_TARGET_KEY` and `WASM_NAME_KEY` - if you choose to record fields, you 9 | must ensure that your identifiers do not clash with either of these. 10 | 11 | Additionally, we have a const: `WASM_TRACE_IDENTIFIER`, which holds a span name used 12 | to signal that the 'actual' span name and target should be retrieved instead from 13 | the associated Fields mentioned above. 14 | 15 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/transaction-pool/README.md: -------------------------------------------------------------------------------- 1 | Transaction pool primitives types & Runtime API. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /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/plugblockchain/plug-blockchain/003d87bd38d2cd023e5c75d59b8a29aff8a12961/primitives/trie/test-res/invalid-delta-order -------------------------------------------------------------------------------- /primitives/trie/test-res/proof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plugblockchain/plug-blockchain/003d87bd38d2cd023e5c75d59b8a29aff8a12961/primitives/trie/test-res/proof -------------------------------------------------------------------------------- /primitives/trie/test-res/storage_root: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plugblockchain/plug-blockchain/003d87bd38d2cd023e5c75d59b8a29aff8a12961/primitives/trie/test-res/storage_root -------------------------------------------------------------------------------- /primitives/trie/test-res/valid-delta-order: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plugblockchain/plug-blockchain/003d87bd38d2cd023e5c75d59b8a29aff8a12961/primitives/trie/test-res/valid-delta-order -------------------------------------------------------------------------------- /primitives/utils/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-utils" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "I/O for Substrate runtimes" 10 | readme = "README.md" 11 | 12 | [dependencies] 13 | futures = "0.3.9" 14 | futures-core = "0.3.4" 15 | lazy_static = "1.4.0" 16 | prometheus = { version = "0.11.0", default-features = false } 17 | futures-timer = "3.0.2" 18 | 19 | [features] 20 | default = ["metered"] 21 | metered = [] 22 | -------------------------------------------------------------------------------- /primitives/utils/README.md: -------------------------------------------------------------------------------- 1 | Utilities Primitives for Substrate 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /primitives/utils/src/lib.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2020-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | //! Utilities Primitives for Substrate 19 | 20 | pub mod metrics; 21 | pub mod mpsc; 22 | pub mod status_sinks; 23 | -------------------------------------------------------------------------------- /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/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sp-wasm-interface" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Types and traits for interfacing between the host and the wasm runtime." 10 | documentation = "https://docs.rs/sp-wasm-interface" 11 | readme = "README.md" 12 | 13 | [package.metadata.docs.rs] 14 | targets = ["x86_64-unknown-linux-gnu"] 15 | 16 | [dependencies] 17 | wasmi = { version = "0.6.2", optional = true } 18 | impl-trait-for-tuples = "0.2.1" 19 | sp-std = { version = "3.0.0", path = "../std", default-features = false } 20 | codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } 21 | 22 | [features] 23 | default = [ "std" ] 24 | std = [ "wasmi", "sp-std/std", "codec/std" ] 25 | -------------------------------------------------------------------------------- /primitives/wasm-interface/README.md: -------------------------------------------------------------------------------- 1 | Types and traits for interfacing between the host and the wasm runtime. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /prml/consortium-permission/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "prml-consortium-permission" 3 | version = "2.0.0" 4 | authors = ["Centrality Developers "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | codec = { package = "parity-scale-codec", version = "1.3.5", default-features = false, features = ["derive"] } 9 | serde = { version = "1.0.101", optional = true } 10 | frame-support = { default-features = false, path = "../../frame/support" } 11 | frame-system = { default-features = false, path = "../../frame/system" } 12 | sp-runtime = { default-features = false, path = "../../primitives/runtime" } 13 | sp-std = { default-features = false, path = "../../primitives/std" } 14 | 15 | [dev-dependencies] 16 | sp-core = { path = "../../primitives/core" } 17 | sp-io = { path = "../../primitives/io" } 18 | 19 | [features] 20 | default = ["std"] 21 | std = [ 22 | "codec/std", 23 | "serde", 24 | "frame-support/std", 25 | "frame-system/std", 26 | "sp-runtime/std", 27 | "sp-std/std", 28 | ] 29 | -------------------------------------------------------------------------------- /prml/doughnut/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "prml-doughnut" 3 | version = "2.0.0" 4 | authors = ["Centrality Developers "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | codec = { package = "parity-scale-codec", version = "1.3.5", default-features = false, features = ["derive"] } 9 | serde = { version = "1.0.101", optional = true } 10 | sp-core = { default-features = false, path = "../../primitives/core" } 11 | sp-std = { default-features = false, path = "../../primitives/std" } 12 | sp-runtime = { path = "../../primitives/runtime", default-features = false } 13 | frame-support = { default-features = false, path = "../../frame/support" } 14 | 15 | [dev-dependencies] 16 | sp-keyring = { default-features = false, path = "../../primitives/keyring" } 17 | 18 | [features] 19 | default = ["std"] 20 | std = [ 21 | "codec/std", 22 | "serde", 23 | "sp-core/std", 24 | "sp-std/std", 25 | "sp-runtime/std", 26 | "frame-support/std", 27 | ] 28 | -------------------------------------------------------------------------------- /prml/generic-asset/rpc/runtime-api/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "prml-generic-asset-rpc-runtime-api" 3 | version = "3.0.0" 4 | authors = ["Centrality Developers "] 5 | edition = "2018" 6 | license = "GPL-3.0" 7 | repository = "https://github.com/plugblockchain/plug-blockchain/" 8 | description = "Runtime API definition required by Generic Asset RPC extensions." 9 | 10 | [dependencies] 11 | codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } 12 | prml-generic-asset = { default-features = false, path = "../../" } 13 | sp-api = { default-features = false, path = "../../../../primitives/api" } 14 | sp-std = { default-features = false, path = "../../../../primitives/std" } 15 | 16 | [features] 17 | default = ["std"] 18 | std = [ 19 | "sp-api/std", 20 | "codec/std", 21 | ] 22 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | let 2 | mozillaOverlay = 3 | import (builtins.fetchGit { 4 | url = "https://github.com/mozilla/nixpkgs-mozilla.git"; 5 | rev = "57c8084c7ef41366993909c20491e359bbb90f54"; 6 | }); 7 | nixpkgs = import { overlays = [ mozillaOverlay ]; }; 8 | rust-nightly = with nixpkgs; ((rustChannelOf { date = "2020-10-23"; channel = "nightly"; }).rust.override { 9 | targets = [ "wasm32-unknown-unknown" ]; 10 | }); 11 | in 12 | with nixpkgs; pkgs.mkShell { 13 | buildInputs = [ 14 | clang 15 | cmake 16 | pkg-config 17 | rust-nightly 18 | ] ++ stdenv.lib.optionals stdenv.isDarwin [ 19 | darwin.apple_sdk.frameworks.Security 20 | ]; 21 | 22 | LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; 23 | PROTOC = "${protobuf}/bin/protoc"; 24 | ROCKSDB_LIB_DIR = "${rocksdb}/lib"; 25 | } 26 | -------------------------------------------------------------------------------- /test-utils/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "substrate-test-utils" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Substrate test utilities" 10 | 11 | [package.metadata.docs.rs] 12 | targets = ["x86_64-unknown-linux-gnu"] 13 | 14 | [dependencies] 15 | futures = { version = "0.3.1", features = ["compat"] } 16 | substrate-test-utils-derive = { version = "0.9.0", path = "./derive" } 17 | tokio = { version = "0.2.13", features = ["macros"] } 18 | 19 | [dev-dependencies] 20 | sc-service = { version = "0.9.0", path = "../client/service" } 21 | trybuild = { version = "1.0.38", features = [ "diff" ] } 22 | -------------------------------------------------------------------------------- /test-utils/derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "substrate-test-utils-derive" 3 | version = "0.9.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "Substrate test utilities macros" 10 | 11 | [dependencies] 12 | quote = "1.0.6" 13 | syn = { version = "1.0.58", features = ["full"] } 14 | proc-macro-crate = "0.1.4" 15 | 16 | [lib] 17 | proc-macro = true 18 | -------------------------------------------------------------------------------- /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 = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 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 = "0.2.13", features = ["macros"] } 16 | test-utils = { version = "3.0.0", path = "..", package = "substrate-test-utils" } 17 | sc-service = { version = "0.9.0", path = "../../client/service" } 18 | -------------------------------------------------------------------------------- /test-utils/tests/ui/missing-func-parameter.stderr: -------------------------------------------------------------------------------- 1 | error: the test function accepts only one argument of type sc_service::TaskExecutor 2 | --> $DIR/missing-func-parameter.rs:20:1 3 | | 4 | 20 | async fn missing_func_parameter() { 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /test-utils/tests/ui/too-many-func-parameters.stderr: -------------------------------------------------------------------------------- 1 | error: the test function accepts only one argument of type sc_service::TaskExecutor 2 | --> $DIR/too-many-func-parameters.rs:23:1 3 | | 4 | 23 | async fn too_many_func_parameters(task_executor_1: TaskExecutor, task_executor_2: TaskExecutor) { 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /utils/browser/README.md: -------------------------------------------------------------------------------- 1 | License: Apache-2.0 -------------------------------------------------------------------------------- /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 = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 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 = "1.1" 17 | -------------------------------------------------------------------------------- /utils/build-script-utils/README.md: -------------------------------------------------------------------------------- 1 | Crate with utility functions for `build.rs` scripts. 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /utils/build-script-utils/src/lib.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | //! Crate with utility functions for `build.rs` scripts. 19 | 20 | mod version; 21 | mod git; 22 | 23 | pub use git::*; 24 | pub use version::*; 25 | -------------------------------------------------------------------------------- /utils/fork-tree/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fork-tree" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 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 = "2.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/README.md: -------------------------------------------------------------------------------- 1 | License: Apache-2.0 -------------------------------------------------------------------------------- /utils/frame/frame-utilities-cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "substrate-frame-cli" 3 | version = "3.0.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | license = "Apache-2.0" 7 | homepage = "https://substrate.dev" 8 | repository = "https://github.com/paritytech/substrate/" 9 | description = "cli interface for FRAME" 10 | documentation = "https://docs.rs/substrate-frame-cli" 11 | readme = "README.md" 12 | 13 | [dependencies] 14 | sp-core = { version = "3.0.0", path = "../../../primitives/core" } 15 | sc-cli = { version = "0.9.0", path = "../../../client/cli" } 16 | sp-runtime = { version = "3.0.0", path = "../../../primitives/runtime" } 17 | structopt = "0.3.8" 18 | frame-system = { version = "3.0.0", path = "../../../frame/system" } 19 | 20 | [dev-dependencies] 21 | 22 | [features] 23 | default = [] 24 | -------------------------------------------------------------------------------- /utils/frame/frame-utilities-cli/README.md: -------------------------------------------------------------------------------- 1 | frame-system CLI utilities 2 | 3 | License: Apache-2.0 -------------------------------------------------------------------------------- /utils/frame/frame-utilities-cli/src/lib.rs: -------------------------------------------------------------------------------- 1 | // This file is part of Substrate. 2 | 3 | // Copyright (C) 2020-2021 Parity Technologies (UK) Ltd. 4 | // SPDX-License-Identifier: Apache-2.0 5 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | //! frame-system CLI utilities 19 | 20 | mod module_id; 21 | 22 | pub use module_id::ModuleIdCmd; 23 | 24 | -------------------------------------------------------------------------------- /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/prometheus/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Endpoint to expose Prometheus metrics" 3 | name = "substrate-prometheus-endpoint" 4 | version = "0.9.0" 5 | license = "Apache-2.0" 6 | authors = ["Parity Technologies "] 7 | edition = "2018" 8 | homepage = "https://substrate.dev" 9 | repository = "https://github.com/paritytech/substrate/" 10 | readme = "README.md" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | log = "0.4.8" 17 | prometheus = { version = "0.11.0", default-features = false } 18 | futures-util = { version = "0.3.1", default-features = false, features = ["io"] } 19 | derive_more = "0.99" 20 | 21 | [target.'cfg(not(target_os = "unknown"))'.dependencies] 22 | async-std = { version = "1.6.5", features = ["unstable"] } 23 | hyper = { version = "0.13.9", default-features = false, features = ["stream"] } 24 | tokio = "0.2" 25 | -------------------------------------------------------------------------------- /utils/wasm-builder/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "substrate-wasm-builder" 3 | version = "4.0.0" 4 | authors = ["Parity Technologies "] 5 | description = "Utility for building WASM binaries" 6 | edition = "2018" 7 | readme = "README.md" 8 | repository = "https://github.com/paritytech/substrate/" 9 | license = "Apache-2.0" 10 | homepage = "https://substrate.dev" 11 | 12 | [package.metadata.docs.rs] 13 | targets = ["x86_64-unknown-linux-gnu"] 14 | 15 | [dependencies] 16 | build-helper = "0.1.1" 17 | cargo_metadata = "0.12.0" 18 | tempfile = "3.1.0" 19 | toml = "0.5.4" 20 | walkdir = "2.3.1" 21 | wasm-gc-api = "0.1.11" 22 | atty = "0.2.13" 23 | ansi_term = "0.12.1" 24 | --------------------------------------------------------------------------------