From 717fa95bc7bb06dec59a53a61fa23a8d11e75909 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 20 May 2020 15:08:27 +0200 Subject: [PATCH] Restore the empty line after the license (#6088) --- substrate/client/api/src/call_executor.rs | 1 + substrate/client/api/src/cht.rs | 1 + substrate/client/api/src/in_mem.rs | 1 + substrate/client/api/src/leaves.rs | 1 + substrate/client/api/src/notifications.rs | 1 + substrate/client/authority-discovery/src/tests.rs | 1 + substrate/client/basic-authorship/src/lib.rs | 1 + substrate/client/block-builder/src/lib.rs | 1 + substrate/client/chain-spec/src/chain_spec.rs | 1 + substrate/client/cli/src/commands/build_spec_cmd.rs | 1 + substrate/client/cli/src/commands/check_block_cmd.rs | 1 + substrate/client/cli/src/commands/export_blocks_cmd.rs | 1 + substrate/client/cli/src/commands/export_state_cmd.rs | 1 + substrate/client/cli/src/commands/import_blocks_cmd.rs | 1 + substrate/client/cli/src/commands/purge_chain_cmd.rs | 1 + substrate/client/cli/src/commands/revert_cmd.rs | 1 + substrate/client/cli/src/commands/run_cmd.rs | 1 + substrate/client/cli/src/config.rs | 1 + substrate/client/cli/src/error.rs | 1 + substrate/client/cli/src/lib.rs | 1 + substrate/client/cli/src/params/database_params.rs | 1 + substrate/client/cli/src/params/import_params.rs | 1 + substrate/client/cli/src/params/keystore_params.rs | 1 + substrate/client/cli/src/params/network_params.rs | 1 + substrate/client/cli/src/params/node_key_params.rs | 1 + substrate/client/cli/src/params/pruning_params.rs | 1 + substrate/client/cli/src/params/shared_params.rs | 1 + substrate/client/cli/src/params/transaction_pool_params.rs | 1 + substrate/client/cli/src/runner.rs | 1 + substrate/client/consensus/aura/src/digests.rs | 1 + substrate/client/consensus/babe/rpc/src/lib.rs | 1 + substrate/client/consensus/manual-seal/src/error.rs | 1 + substrate/client/consensus/manual-seal/src/lib.rs | 1 + substrate/client/consensus/pow/src/lib.rs | 1 + substrate/client/db/src/bench.rs | 1 + substrate/client/db/src/cache/list_cache.rs | 1 + substrate/client/db/src/cache/list_entry.rs | 1 + substrate/client/db/src/cache/list_storage.rs | 1 + substrate/client/db/src/cache/mod.rs | 1 + substrate/client/db/src/lib.rs | 1 + substrate/client/db/src/light.rs | 1 + substrate/client/db/src/offchain.rs | 1 + substrate/client/db/src/stats.rs | 1 + substrate/client/db/src/utils.rs | 1 + substrate/client/executor/common/src/error.rs | 1 + substrate/client/executor/common/src/sandbox.rs | 1 + substrate/client/executor/common/src/util.rs | 1 + substrate/client/executor/src/integration_tests/sandbox.rs | 1 + substrate/client/executor/src/lib.rs | 1 + substrate/client/executor/src/native_executor.rs | 1 + substrate/client/executor/wasmtime/src/imports.rs | 1 + substrate/client/executor/wasmtime/src/instance_wrapper.rs | 1 + .../executor/wasmtime/src/instance_wrapper/globals_snapshot.rs | 1 + substrate/client/executor/wasmtime/src/state_holder.rs | 1 + substrate/client/finality-grandpa/rpc/src/error.rs | 1 + substrate/client/finality-grandpa/rpc/src/lib.rs | 1 + substrate/client/finality-grandpa/rpc/src/report.rs | 1 + substrate/client/finality-grandpa/src/authorities.rs | 1 + substrate/client/finality-grandpa/src/communication/mod.rs | 1 + substrate/client/finality-grandpa/src/environment.rs | 1 + substrate/client/finality-grandpa/src/finality_proof.rs | 1 + substrate/client/finality-grandpa/src/import.rs | 1 + substrate/client/finality-grandpa/src/justification.rs | 1 + substrate/client/finality-grandpa/src/lib.rs | 1 + substrate/client/finality-grandpa/src/observer.rs | 1 + substrate/client/finality-grandpa/src/tests.rs | 1 + substrate/client/finality-grandpa/src/until_imported.rs | 1 + substrate/client/finality-grandpa/src/voting_rule.rs | 1 + substrate/client/informant/src/lib.rs | 1 + substrate/client/network-gossip/src/state_machine.rs | 1 + substrate/client/network-gossip/src/validator.rs | 1 + substrate/client/network/src/chain.rs | 1 + substrate/client/network/src/config.rs | 1 + substrate/client/network/src/error.rs | 1 + substrate/client/network/src/network_state.rs | 1 + substrate/client/network/src/on_demand_layer.rs | 1 + substrate/client/network/src/protocol.rs | 1 + .../network/src/protocol/generic_proto/handler/notif_in.rs | 1 + .../network/src/protocol/generic_proto/upgrade/legacy.rs | 1 + substrate/client/network/src/protocol/message.rs | 1 + substrate/client/network/src/protocol/sync/blocks.rs | 1 + substrate/client/network/src/protocol/sync/extra_requests.rs | 1 + substrate/client/network/src/schema.rs | 1 + substrate/client/network/src/service.rs | 1 + substrate/client/network/src/service/out_events.rs | 1 + substrate/client/network/src/service/tests.rs | 1 + substrate/client/network/src/transport.rs | 1 + substrate/client/network/test/src/block_import.rs | 1 + substrate/client/network/test/src/sync.rs | 1 + substrate/client/peerset/src/lib.rs | 1 + substrate/client/peerset/tests/fuzz.rs | 1 + substrate/client/rpc-api/src/author/error.rs | 1 + substrate/client/rpc-api/src/author/mod.rs | 1 + substrate/client/rpc-api/src/chain/mod.rs | 1 + substrate/client/rpc-api/src/child_state/mod.rs | 1 + substrate/client/rpc-api/src/errors.rs | 1 + substrate/client/rpc-api/src/helpers.rs | 1 + substrate/client/rpc-api/src/offchain/error.rs | 1 + substrate/client/rpc-api/src/offchain/mod.rs | 1 + substrate/client/rpc-api/src/policy.rs | 1 + substrate/client/rpc-api/src/state/error.rs | 1 + substrate/client/rpc-api/src/state/helpers.rs | 1 + substrate/client/rpc-api/src/state/mod.rs | 1 + substrate/client/rpc-api/src/subscriptions.rs | 1 + substrate/client/rpc-api/src/system/error.rs | 1 + substrate/client/rpc-api/src/system/helpers.rs | 1 + substrate/client/rpc-api/src/system/mod.rs | 1 + substrate/client/rpc-servers/src/lib.rs | 1 + substrate/client/rpc/src/author/mod.rs | 1 + substrate/client/rpc/src/author/tests.rs | 1 + substrate/client/rpc/src/chain/mod.rs | 1 + substrate/client/rpc/src/chain/tests.rs | 1 + substrate/client/rpc/src/lib.rs | 1 + substrate/client/rpc/src/metadata.rs | 1 + substrate/client/rpc/src/offchain/mod.rs | 1 + substrate/client/rpc/src/offchain/tests.rs | 1 + substrate/client/rpc/src/state/mod.rs | 1 + substrate/client/rpc/src/state/tests.rs | 1 + substrate/client/rpc/src/system/mod.rs | 1 + substrate/client/rpc/src/system/tests.rs | 1 + substrate/client/service/src/builder.rs | 1 + substrate/client/service/src/chain_ops.rs | 1 + substrate/client/service/src/client/block_rules.rs | 1 + substrate/client/service/src/client/call_executor.rs | 1 + substrate/client/service/src/client/client.rs | 1 + substrate/client/service/src/client/genesis.rs | 1 + substrate/client/service/src/client/light/blockchain.rs | 1 + substrate/client/service/src/client/light/call_executor.rs | 1 + substrate/client/service/src/client/light/fetcher.rs | 1 + substrate/client/service/src/client/light/mod.rs | 1 + substrate/client/service/src/client/mod.rs | 1 + substrate/client/service/src/config.rs | 1 + substrate/client/service/src/error.rs | 1 + substrate/client/service/src/lib.rs | 1 + substrate/client/service/src/metrics.rs | 1 + substrate/client/service/test/src/client/db.rs | 3 ++- substrate/client/service/test/src/client/mod.rs | 1 + substrate/client/service/test/src/lib.rs | 1 + substrate/client/state-db/src/lib.rs | 1 + substrate/client/state-db/src/noncanonical.rs | 1 + substrate/client/state-db/src/pruning.rs | 1 + substrate/client/state-db/src/test.rs | 1 + substrate/client/telemetry/src/lib.rs | 1 + substrate/client/telemetry/src/worker.rs | 1 + substrate/client/telemetry/src/worker/node.rs | 1 + substrate/client/transaction-pool/graph/benches/basics.rs | 1 + substrate/client/transaction-pool/graph/src/base_pool.rs | 1 + substrate/client/transaction-pool/graph/src/error.rs | 1 + substrate/client/transaction-pool/graph/src/future.rs | 1 + substrate/client/transaction-pool/graph/src/lib.rs | 1 + substrate/client/transaction-pool/graph/src/listener.rs | 1 + substrate/client/transaction-pool/graph/src/pool.rs | 1 + substrate/client/transaction-pool/graph/src/ready.rs | 1 + substrate/client/transaction-pool/graph/src/rotator.rs | 1 + substrate/client/transaction-pool/graph/src/validated_pool.rs | 1 + substrate/client/transaction-pool/graph/src/watcher.rs | 1 + substrate/client/transaction-pool/src/api.rs | 1 + substrate/client/transaction-pool/src/error.rs | 1 + substrate/client/transaction-pool/src/lib.rs | 1 + substrate/client/transaction-pool/src/metrics.rs | 1 + substrate/client/transaction-pool/src/revalidation.rs | 1 + substrate/client/transaction-pool/src/testing/mod.rs | 1 + substrate/client/transaction-pool/src/testing/pool.rs | 1 + 163 files changed, 164 insertions(+), 1 deletion(-) diff --git a/substrate/client/api/src/call_executor.rs b/substrate/client/api/src/call_executor.rs index e5b670579a..d9d43900df 100644 --- a/substrate/client/api/src/call_executor.rs +++ b/substrate/client/api/src/call_executor.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! A method call executor interface. use std::{panic::UnwindSafe, result, cell::RefCell}; diff --git a/substrate/client/api/src/cht.rs b/substrate/client/api/src/cht.rs index ef282868c9..30cfd3a1b6 100644 --- a/substrate/client/api/src/cht.rs +++ b/substrate/client/api/src/cht.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Canonical hash trie definitions and helper functions. //! //! Each CHT is a trie mapping block numbers to canonical hash. diff --git a/substrate/client/api/src/in_mem.rs b/substrate/client/api/src/in_mem.rs index cb1724e468..0eb0681a82 100644 --- a/substrate/client/api/src/in_mem.rs +++ b/substrate/client/api/src/in_mem.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! In memory client backend use std::collections::HashMap; diff --git a/substrate/client/api/src/leaves.rs b/substrate/client/api/src/leaves.rs index c93446b94d..25f9f3d29b 100644 --- a/substrate/client/api/src/leaves.rs +++ b/substrate/client/api/src/leaves.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Helper for managing the set of available leaves in the chain for DB implementations. use std::collections::BTreeMap; diff --git a/substrate/client/api/src/notifications.rs b/substrate/client/api/src/notifications.rs index c89e8b6dfd..ec63c372c7 100644 --- a/substrate/client/api/src/notifications.rs +++ b/substrate/client/api/src/notifications.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Storage notifications use std::{ diff --git a/substrate/client/authority-discovery/src/tests.rs b/substrate/client/authority-discovery/src/tests.rs index 106c68b2d0..12edcf5fc9 100644 --- a/substrate/client/authority-discovery/src/tests.rs +++ b/substrate/client/authority-discovery/src/tests.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::{iter::FromIterator, sync::{Arc, Mutex}}; use futures::channel::mpsc::channel; diff --git a/substrate/client/basic-authorship/src/lib.rs b/substrate/client/basic-authorship/src/lib.rs index 7c77dde6b0..f5f2c089f6 100644 --- a/substrate/client/basic-authorship/src/lib.rs +++ b/substrate/client/basic-authorship/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Basic implementation of block-authoring logic. //! //! # Example diff --git a/substrate/client/block-builder/src/lib.rs b/substrate/client/block-builder/src/lib.rs index f630d42a9b..af40b33662 100644 --- a/substrate/client/block-builder/src/lib.rs +++ b/substrate/client/block-builder/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate block builder //! //! This crate provides the [`BlockBuilder`] utility and the corresponding runtime api diff --git a/substrate/client/chain-spec/src/chain_spec.rs b/substrate/client/chain-spec/src/chain_spec.rs index a6bf6212e1..52414f8687 100644 --- a/substrate/client/chain-spec/src/chain_spec.rs +++ b/substrate/client/chain-spec/src/chain_spec.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate chain configurations. use std::{borrow::Cow, fs::File, path::PathBuf, sync::Arc, collections::HashMap}; diff --git a/substrate/client/cli/src/commands/build_spec_cmd.rs b/substrate/client/cli/src/commands/build_spec_cmd.rs index e5e7123b4b..2f9e2fa059 100644 --- a/substrate/client/cli/src/commands/build_spec_cmd.rs +++ b/substrate/client/cli/src/commands/build_spec_cmd.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::error; use crate::params::NodeKeyParams; use crate::params::SharedParams; diff --git a/substrate/client/cli/src/commands/check_block_cmd.rs b/substrate/client/cli/src/commands/check_block_cmd.rs index 35f26af667..d1241f010d 100644 --- a/substrate/client/cli/src/commands/check_block_cmd.rs +++ b/substrate/client/cli/src/commands/check_block_cmd.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::{ CliConfiguration, error, params::{ImportParams, SharedParams, BlockNumberOrHash}, }; diff --git a/substrate/client/cli/src/commands/export_blocks_cmd.rs b/substrate/client/cli/src/commands/export_blocks_cmd.rs index 431add4128..2fdc408250 100644 --- a/substrate/client/cli/src/commands/export_blocks_cmd.rs +++ b/substrate/client/cli/src/commands/export_blocks_cmd.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::error; use crate::params::{BlockNumber, DatabaseParams, PruningParams, SharedParams}; use crate::CliConfiguration; diff --git a/substrate/client/cli/src/commands/export_state_cmd.rs b/substrate/client/cli/src/commands/export_state_cmd.rs index ee022e1afd..3ad6772882 100644 --- a/substrate/client/cli/src/commands/export_state_cmd.rs +++ b/substrate/client/cli/src/commands/export_state_cmd.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::{ CliConfiguration, error, params::{PruningParams, SharedParams, BlockNumberOrHash}, }; diff --git a/substrate/client/cli/src/commands/import_blocks_cmd.rs b/substrate/client/cli/src/commands/import_blocks_cmd.rs index 029e447562..e138850c8b 100644 --- a/substrate/client/cli/src/commands/import_blocks_cmd.rs +++ b/substrate/client/cli/src/commands/import_blocks_cmd.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::error; use crate::params::ImportParams; use crate::params::SharedParams; diff --git a/substrate/client/cli/src/commands/purge_chain_cmd.rs b/substrate/client/cli/src/commands/purge_chain_cmd.rs index 6b540a66a2..9d364a45f7 100644 --- a/substrate/client/cli/src/commands/purge_chain_cmd.rs +++ b/substrate/client/cli/src/commands/purge_chain_cmd.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::error; use crate::params::{DatabaseParams, SharedParams}; use crate::CliConfiguration; diff --git a/substrate/client/cli/src/commands/revert_cmd.rs b/substrate/client/cli/src/commands/revert_cmd.rs index ea6ba5ecf7..6117eaf488 100644 --- a/substrate/client/cli/src/commands/revert_cmd.rs +++ b/substrate/client/cli/src/commands/revert_cmd.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::error; use crate::params::{BlockNumber, PruningParams, SharedParams}; use crate::CliConfiguration; diff --git a/substrate/client/cli/src/commands/run_cmd.rs b/substrate/client/cli/src/commands/run_cmd.rs index c34a31e59b..f87d5bea6e 100644 --- a/substrate/client/cli/src/commands/run_cmd.rs +++ b/substrate/client/cli/src/commands/run_cmd.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::arg_enums::RpcMethods; use crate::error::{Error, Result}; use crate::params::ImportParams; diff --git a/substrate/client/cli/src/config.rs b/substrate/client/cli/src/config.rs index fb0101ec88..fdaee929a6 100644 --- a/substrate/client/cli/src/config.rs +++ b/substrate/client/cli/src/config.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Configuration trait for a CLI based on substrate use crate::arg_enums::Database; diff --git a/substrate/client/cli/src/error.rs b/substrate/client/cli/src/error.rs index fa336974d6..23c2bf05f0 100644 --- a/substrate/client/cli/src/error.rs +++ b/substrate/client/cli/src/error.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Initialization errors. /// Result type alias for the CLI. diff --git a/substrate/client/cli/src/lib.rs b/substrate/client/cli/src/lib.rs index 271572b43d..36d3649926 100644 --- a/substrate/client/cli/src/lib.rs +++ b/substrate/client/cli/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate CLI library. #![warn(missing_docs)] diff --git a/substrate/client/cli/src/params/database_params.rs b/substrate/client/cli/src/params/database_params.rs index 62b0436788..3ff8eb01d0 100644 --- a/substrate/client/cli/src/params/database_params.rs +++ b/substrate/client/cli/src/params/database_params.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::arg_enums::Database; use structopt::StructOpt; diff --git a/substrate/client/cli/src/params/import_params.rs b/substrate/client/cli/src/params/import_params.rs index e1c86aec9b..fb683df6d3 100644 --- a/substrate/client/cli/src/params/import_params.rs +++ b/substrate/client/cli/src/params/import_params.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::arg_enums::{ ExecutionStrategy, TracingReceiver, WasmExecutionMethod, DEFAULT_EXECUTION_BLOCK_CONSTRUCTION, DEFAULT_EXECUTION_IMPORT_BLOCK, diff --git a/substrate/client/cli/src/params/keystore_params.rs b/substrate/client/cli/src/params/keystore_params.rs index 4dbd793456..2fd610377d 100644 --- a/substrate/client/cli/src/params/keystore_params.rs +++ b/substrate/client/cli/src/params/keystore_params.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::error::Result; use sc_service::config::KeystoreConfig; use std::fs; diff --git a/substrate/client/cli/src/params/network_params.rs b/substrate/client/cli/src/params/network_params.rs index e328c32a40..c1639ad2b4 100644 --- a/substrate/client/cli/src/params/network_params.rs +++ b/substrate/client/cli/src/params/network_params.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::params::node_key_params::NodeKeyParams; use sc_network::{ config::{NetworkConfiguration, NodeKeyConfig, NonReservedPeerMode, TransportConfig}, diff --git a/substrate/client/cli/src/params/node_key_params.rs b/substrate/client/cli/src/params/node_key_params.rs index ede9fd02e1..7d19971ad6 100644 --- a/substrate/client/cli/src/params/node_key_params.rs +++ b/substrate/client/cli/src/params/node_key_params.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use sc_network::config::NodeKeyConfig; use sp_core::H256; use std::{path::PathBuf, str::FromStr}; diff --git a/substrate/client/cli/src/params/pruning_params.rs b/substrate/client/cli/src/params/pruning_params.rs index d96a44986d..3617935906 100644 --- a/substrate/client/cli/src/params/pruning_params.rs +++ b/substrate/client/cli/src/params/pruning_params.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::error; use sc_service::{PruningMode, Role}; use structopt::StructOpt; diff --git a/substrate/client/cli/src/params/shared_params.rs b/substrate/client/cli/src/params/shared_params.rs index 94fb3ceea6..5bf8102466 100644 --- a/substrate/client/cli/src/params/shared_params.rs +++ b/substrate/client/cli/src/params/shared_params.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::path::PathBuf; use structopt::StructOpt; diff --git a/substrate/client/cli/src/params/transaction_pool_params.rs b/substrate/client/cli/src/params/transaction_pool_params.rs index 00f5f0dbd6..2283c0f39f 100644 --- a/substrate/client/cli/src/params/transaction_pool_params.rs +++ b/substrate/client/cli/src/params/transaction_pool_params.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use sc_service::config::TransactionPoolOptions; use structopt::StructOpt; diff --git a/substrate/client/cli/src/runner.rs b/substrate/client/cli/src/runner.rs index 1600aed7d6..2d27743163 100644 --- a/substrate/client/cli/src/runner.rs +++ b/substrate/client/cli/src/runner.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::CliConfiguration; use crate::Result; use crate::SubstrateCli; diff --git a/substrate/client/consensus/aura/src/digests.rs b/substrate/client/consensus/aura/src/digests.rs index 8ddcb2bee4..3332e4c6a6 100644 --- a/substrate/client/consensus/aura/src/digests.rs +++ b/substrate/client/consensus/aura/src/digests.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Aura (Authority-Round) digests //! //! This implements the digests for AuRa, to allow the private diff --git a/substrate/client/consensus/babe/rpc/src/lib.rs b/substrate/client/consensus/babe/rpc/src/lib.rs index 0c8a16e4da..925328a856 100644 --- a/substrate/client/consensus/babe/rpc/src/lib.rs +++ b/substrate/client/consensus/babe/rpc/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! RPC api for babe. use sc_consensus_babe::{Epoch, authorship, Config}; diff --git a/substrate/client/consensus/manual-seal/src/error.rs b/substrate/client/consensus/manual-seal/src/error.rs index 36499893c3..2411a839b0 100644 --- a/substrate/client/consensus/manual-seal/src/error.rs +++ b/substrate/client/consensus/manual-seal/src/error.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! A manual sealing engine: the engine listens for rpc calls to seal blocks and create forks. //! This is suitable for a testing environment. use sp_consensus::{Error as ConsensusError, ImportResult}; diff --git a/substrate/client/consensus/manual-seal/src/lib.rs b/substrate/client/consensus/manual-seal/src/lib.rs index de9711b2a8..26f493d5d2 100644 --- a/substrate/client/consensus/manual-seal/src/lib.rs +++ b/substrate/client/consensus/manual-seal/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! A manual sealing engine: the engine listens for rpc calls to seal blocks and create forks. //! This is suitable for a testing environment. diff --git a/substrate/client/consensus/pow/src/lib.rs b/substrate/client/consensus/pow/src/lib.rs index b0d1e04348..2628a11d3b 100644 --- a/substrate/client/consensus/pow/src/lib.rs +++ b/substrate/client/consensus/pow/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Proof of work consensus for Substrate. //! //! To use this engine, you can need to have a struct that implements diff --git a/substrate/client/db/src/bench.rs b/substrate/client/db/src/bench.rs index 3b31a37b14..807e8c68e1 100644 --- a/substrate/client/db/src/bench.rs +++ b/substrate/client/db/src/bench.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! State backend that's useful for benchmarking use std::sync::Arc; diff --git a/substrate/client/db/src/cache/list_cache.rs b/substrate/client/db/src/cache/list_cache.rs index a2af053e87..0856350fb0 100644 --- a/substrate/client/db/src/cache/list_cache.rs +++ b/substrate/client/db/src/cache/list_cache.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! List-based cache. //! //! Maintains several lists, containing nodes that are inserted whenever diff --git a/substrate/client/db/src/cache/list_entry.rs b/substrate/client/db/src/cache/list_entry.rs index 39dee59d55..565a62cff4 100644 --- a/substrate/client/db/src/cache/list_entry.rs +++ b/substrate/client/db/src/cache/list_entry.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! List-cache storage entries. use sp_blockchain::Result as ClientResult; diff --git a/substrate/client/db/src/cache/list_storage.rs b/substrate/client/db/src/cache/list_storage.rs index 1fa26552e9..377d744eff 100644 --- a/substrate/client/db/src/cache/list_storage.rs +++ b/substrate/client/db/src/cache/list_storage.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! List-cache storage definition and implementation. use std::sync::Arc; diff --git a/substrate/client/db/src/cache/mod.rs b/substrate/client/db/src/cache/mod.rs index 03cda1b589..2b7cd2e620 100644 --- a/substrate/client/db/src/cache/mod.rs +++ b/substrate/client/db/src/cache/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! DB-backed cache of blockchain data. use std::{sync::Arc, collections::{HashMap, hash_map::Entry}}; diff --git a/substrate/client/db/src/lib.rs b/substrate/client/db/src/lib.rs index 75d36dde5c..037409dfc4 100644 --- a/substrate/client/db/src/lib.rs +++ b/substrate/client/db/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Client backend that is backed by a database. //! //! # Canonicality vs. Finality diff --git a/substrate/client/db/src/light.rs b/substrate/client/db/src/light.rs index 8607823462..f115ac9599 100644 --- a/substrate/client/db/src/light.rs +++ b/substrate/client/db/src/light.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! RocksDB-based light client blockchain storage. use std::{sync::Arc, collections::HashMap}; diff --git a/substrate/client/db/src/offchain.rs b/substrate/client/db/src/offchain.rs index a7cc1345d1..651510d6e8 100644 --- a/substrate/client/db/src/offchain.rs +++ b/substrate/client/db/src/offchain.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! RocksDB-based offchain workers local storage. use std::{ diff --git a/substrate/client/db/src/stats.rs b/substrate/client/db/src/stats.rs index 7a265ddf82..8d208024b4 100644 --- a/substrate/client/db/src/stats.rs +++ b/substrate/client/db/src/stats.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Database usage statistics use std::sync::atomic::{AtomicU64, Ordering as AtomicOrdering}; diff --git a/substrate/client/db/src/utils.rs b/substrate/client/db/src/utils.rs index c05a411258..80b08b3a6e 100644 --- a/substrate/client/db/src/utils.rs +++ b/substrate/client/db/src/utils.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Db-based backend utility structures and functions, used by both //! full and light storages. diff --git a/substrate/client/executor/common/src/error.rs b/substrate/client/executor/common/src/error.rs index 8fc0c4392c..04850e6f8d 100644 --- a/substrate/client/executor/common/src/error.rs +++ b/substrate/client/executor/common/src/error.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Rust executor possible errors. use sp_serializer; diff --git a/substrate/client/executor/common/src/sandbox.rs b/substrate/client/executor/common/src/sandbox.rs index 37860474cb..b2c35b7582 100644 --- a/substrate/client/executor/common/src/sandbox.rs +++ b/substrate/client/executor/common/src/sandbox.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! This module implements sandboxing support in the runtime. //! //! Sandboxing is baked by wasmi at the moment. In future, however, we would like to add/switch to diff --git a/substrate/client/executor/common/src/util.rs b/substrate/client/executor/common/src/util.rs index ebd14a5a6e..92a48e1401 100644 --- a/substrate/client/executor/common/src/util.rs +++ b/substrate/client/executor/common/src/util.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! A set of utilities for resetting a wasm instance to its initial state. use crate::error::{self, Error}; diff --git a/substrate/client/executor/src/integration_tests/sandbox.rs b/substrate/client/executor/src/integration_tests/sandbox.rs index 8fe7678955..f84e446b41 100644 --- a/substrate/client/executor/src/integration_tests/sandbox.rs +++ b/substrate/client/executor/src/integration_tests/sandbox.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use super::{TestExternalities, call_in_wasm}; use crate::WasmExecutionMethod; diff --git a/substrate/client/executor/src/lib.rs b/substrate/client/executor/src/lib.rs index a8b86da714..c02568c734 100644 --- a/substrate/client/executor/src/lib.rs +++ b/substrate/client/executor/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! A crate that provides means of executing/dispatching calls into the runtime. //! //! There are a few responsibilities of this crate at the moment: diff --git a/substrate/client/executor/src/native_executor.rs b/substrate/client/executor/src/native_executor.rs index 95f5dff8c6..b1eb504d5a 100644 --- a/substrate/client/executor/src/native_executor.rs +++ b/substrate/client/executor/src/native_executor.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::{ RuntimeInfo, error::{Error, Result}, wasm_runtime::{RuntimeCache, WasmExecutionMethod}, diff --git a/substrate/client/executor/wasmtime/src/imports.rs b/substrate/client/executor/wasmtime/src/imports.rs index b427606c3c..36752d72fa 100644 --- a/substrate/client/executor/wasmtime/src/imports.rs +++ b/substrate/client/executor/wasmtime/src/imports.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::state_holder; use sc_executor_common::error::WasmError; use sp_wasm_interface::{Function, Value, ValueType}; diff --git a/substrate/client/executor/wasmtime/src/instance_wrapper.rs b/substrate/client/executor/wasmtime/src/instance_wrapper.rs index 8b0b5cf382..9026b8054e 100644 --- a/substrate/client/executor/wasmtime/src/instance_wrapper.rs +++ b/substrate/client/executor/wasmtime/src/instance_wrapper.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Defines data and logic needed for interaction with an WebAssembly instance of a substrate //! runtime module. diff --git a/substrate/client/executor/wasmtime/src/instance_wrapper/globals_snapshot.rs b/substrate/client/executor/wasmtime/src/instance_wrapper/globals_snapshot.rs index db2cc28e68..01d82451fc 100644 --- a/substrate/client/executor/wasmtime/src/instance_wrapper/globals_snapshot.rs +++ b/substrate/client/executor/wasmtime/src/instance_wrapper/globals_snapshot.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use super::InstanceWrapper; use sc_executor_common::{ error::{Error, Result}, diff --git a/substrate/client/executor/wasmtime/src/state_holder.rs b/substrate/client/executor/wasmtime/src/state_holder.rs index ac5b64c774..711d3bb735 100644 --- a/substrate/client/executor/wasmtime/src/state_holder.rs +++ b/substrate/client/executor/wasmtime/src/state_holder.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::host::{HostContext, HostState}; scoped_tls::scoped_thread_local!(static HOST_STATE: HostState); diff --git a/substrate/client/finality-grandpa/rpc/src/error.rs b/substrate/client/finality-grandpa/rpc/src/error.rs index 73c36f23f5..bfd0596fdf 100644 --- a/substrate/client/finality-grandpa/rpc/src/error.rs +++ b/substrate/client/finality-grandpa/rpc/src/error.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::NOT_READY_ERROR_CODE; #[derive(derive_more::Display, derive_more::From)] diff --git a/substrate/client/finality-grandpa/rpc/src/lib.rs b/substrate/client/finality-grandpa/rpc/src/lib.rs index 6d8e10622b..1af84b7a84 100644 --- a/substrate/client/finality-grandpa/rpc/src/lib.rs +++ b/substrate/client/finality-grandpa/rpc/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! RPC API for GRANDPA. #![warn(missing_docs)] diff --git a/substrate/client/finality-grandpa/rpc/src/report.rs b/substrate/client/finality-grandpa/rpc/src/report.rs index 19b89c5083..a635728cb9 100644 --- a/substrate/client/finality-grandpa/rpc/src/report.rs +++ b/substrate/client/finality-grandpa/rpc/src/report.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::{ collections::{BTreeSet, HashSet}, fmt::Debug, diff --git a/substrate/client/finality-grandpa/src/authorities.rs b/substrate/client/finality-grandpa/src/authorities.rs index 2105d9ed38..b4cb254864 100644 --- a/substrate/client/finality-grandpa/src/authorities.rs +++ b/substrate/client/finality-grandpa/src/authorities.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Utilities for dealing with authorities, authority sets, and handoffs. use fork_tree::ForkTree; diff --git a/substrate/client/finality-grandpa/src/communication/mod.rs b/substrate/client/finality-grandpa/src/communication/mod.rs index 533acb8de6..abd1c27983 100644 --- a/substrate/client/finality-grandpa/src/communication/mod.rs +++ b/substrate/client/finality-grandpa/src/communication/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Communication streams for the polite-grandpa networking protocol. //! //! GRANDPA nodes communicate over a gossip network, where messages are not sent to diff --git a/substrate/client/finality-grandpa/src/environment.rs b/substrate/client/finality-grandpa/src/environment.rs index 85816b110b..afcc3891ac 100644 --- a/substrate/client/finality-grandpa/src/environment.rs +++ b/substrate/client/finality-grandpa/src/environment.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::collections::BTreeMap; use std::iter::FromIterator; use std::pin::Pin; diff --git a/substrate/client/finality-grandpa/src/finality_proof.rs b/substrate/client/finality-grandpa/src/finality_proof.rs index 82a5220d87..55f6376579 100644 --- a/substrate/client/finality-grandpa/src/finality_proof.rs +++ b/substrate/client/finality-grandpa/src/finality_proof.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! GRANDPA block finality proof generation and check. //! //! Finality of block B is proved by providing: diff --git a/substrate/client/finality-grandpa/src/import.rs b/substrate/client/finality-grandpa/src/import.rs index 3f3bcc0d8c..7e3799b1e2 100644 --- a/substrate/client/finality-grandpa/src/import.rs +++ b/substrate/client/finality-grandpa/src/import.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::{sync::Arc, collections::HashMap}; use log::{debug, trace}; diff --git a/substrate/client/finality-grandpa/src/justification.rs b/substrate/client/finality-grandpa/src/justification.rs index 7f86f7e443..b4db81f8a4 100644 --- a/substrate/client/finality-grandpa/src/justification.rs +++ b/substrate/client/finality-grandpa/src/justification.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::collections::{HashMap, HashSet}; use std::sync::Arc; diff --git a/substrate/client/finality-grandpa/src/lib.rs b/substrate/client/finality-grandpa/src/lib.rs index 41dedc2246..7b20d082a0 100644 --- a/substrate/client/finality-grandpa/src/lib.rs +++ b/substrate/client/finality-grandpa/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Integration of the GRANDPA finality gadget into substrate. //! //! This crate is unstable and the API and usage may change. diff --git a/substrate/client/finality-grandpa/src/observer.rs b/substrate/client/finality-grandpa/src/observer.rs index ee203a225d..cd678b3bb4 100644 --- a/substrate/client/finality-grandpa/src/observer.rs +++ b/substrate/client/finality-grandpa/src/observer.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::pin::Pin; use std::sync::Arc; use std::task::{Context, Poll}; diff --git a/substrate/client/finality-grandpa/src/tests.rs b/substrate/client/finality-grandpa/src/tests.rs index dbc54a0d64..25e6253652 100644 --- a/substrate/client/finality-grandpa/src/tests.rs +++ b/substrate/client/finality-grandpa/src/tests.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Tests and test helpers for GRANDPA. use super::*; diff --git a/substrate/client/finality-grandpa/src/until_imported.rs b/substrate/client/finality-grandpa/src/until_imported.rs index 6be1a1b1be..6a39c2637e 100644 --- a/substrate/client/finality-grandpa/src/until_imported.rs +++ b/substrate/client/finality-grandpa/src/until_imported.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Helper stream for waiting until one or more blocks are imported before //! passing through inner items. This is done in a generic way to support //! many different kinds of items. diff --git a/substrate/client/finality-grandpa/src/voting_rule.rs b/substrate/client/finality-grandpa/src/voting_rule.rs index d0c47037ab..60493867ce 100644 --- a/substrate/client/finality-grandpa/src/voting_rule.rs +++ b/substrate/client/finality-grandpa/src/voting_rule.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Handling custom voting rules for GRANDPA. //! //! This exposes the `VotingRule` trait used to implement arbitrary voting diff --git a/substrate/client/informant/src/lib.rs b/substrate/client/informant/src/lib.rs index 891e9c0211..6eea9c1d04 100644 --- a/substrate/client/informant/src/lib.rs +++ b/substrate/client/informant/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Console informant. Prints sync progress and block events. Runs on the calling thread. use ansi_term::Colour; diff --git a/substrate/client/network-gossip/src/state_machine.rs b/substrate/client/network-gossip/src/state_machine.rs index 0d8ad50970..da07bde3e7 100644 --- a/substrate/client/network-gossip/src/state_machine.rs +++ b/substrate/client/network-gossip/src/state_machine.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::{Network, MessageIntent, Validator, ValidatorContext, ValidationResult}; use std::collections::{HashMap, HashSet}; diff --git a/substrate/client/network-gossip/src/validator.rs b/substrate/client/network-gossip/src/validator.rs index cd0a733c91..fd29aaddaf 100644 --- a/substrate/client/network-gossip/src/validator.rs +++ b/substrate/client/network-gossip/src/validator.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use sc_network::{ObservedRole, PeerId}; use sp_runtime::traits::Block as BlockT; diff --git a/substrate/client/network/src/chain.rs b/substrate/client/network/src/chain.rs index f79cf6f61e..20fbe02843 100644 --- a/substrate/client/network/src/chain.rs +++ b/substrate/client/network/src/chain.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Blockchain access trait use sp_blockchain::{Error, HeaderBackend, HeaderMetadata}; diff --git a/substrate/client/network/src/config.rs b/substrate/client/network/src/config.rs index c1534c6d9c..394e8fc01a 100644 --- a/substrate/client/network/src/config.rs +++ b/substrate/client/network/src/config.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Configuration of the networking layer. //! //! The [`Params`] struct is the struct that must be passed in order to initialize the networking. diff --git a/substrate/client/network/src/error.rs b/substrate/client/network/src/error.rs index e46273c47b..fed7a331da 100644 --- a/substrate/client/network/src/error.rs +++ b/substrate/client/network/src/error.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate network possible errors. use libp2p::{PeerId, Multiaddr}; diff --git a/substrate/client/network/src/network_state.rs b/substrate/client/network/src/network_state.rs index ca6733de81..970a63faed 100644 --- a/substrate/client/network/src/network_state.rs +++ b/substrate/client/network/src/network_state.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Information about the networking, for diagnostic purposes. //! //! **Warning**: These APIs are not stable. diff --git a/substrate/client/network/src/on_demand_layer.rs b/substrate/client/network/src/on_demand_layer.rs index c76ebb0351..084172ee57 100644 --- a/substrate/client/network/src/on_demand_layer.rs +++ b/substrate/client/network/src/on_demand_layer.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! On-demand requests service. use crate::light_client_handler; diff --git a/substrate/client/network/src/protocol.rs b/substrate/client/network/src/protocol.rs index 8a71494d82..b3c08320f9 100644 --- a/substrate/client/network/src/protocol.rs +++ b/substrate/client/network/src/protocol.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::{ ExHashT, chain::{Client, FinalityProofProvider}, diff --git a/substrate/client/network/src/protocol/generic_proto/handler/notif_in.rs b/substrate/client/network/src/protocol/generic_proto/handler/notif_in.rs index 68708b9fb7..ef4644c548 100644 --- a/substrate/client/network/src/protocol/generic_proto/handler/notif_in.rs +++ b/substrate/client/network/src/protocol/generic_proto/handler/notif_in.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Implementations of the `IntoProtocolsHandler` and `ProtocolsHandler` traits for ingoing //! substreams for a single gossiping protocol. //! diff --git a/substrate/client/network/src/protocol/generic_proto/upgrade/legacy.rs b/substrate/client/network/src/protocol/generic_proto/upgrade/legacy.rs index aba7fda2c3..13560113bb 100644 --- a/substrate/client/network/src/protocol/generic_proto/upgrade/legacy.rs +++ b/substrate/client/network/src/protocol/generic_proto/upgrade/legacy.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::config::ProtocolId; use bytes::BytesMut; use futures::prelude::*; diff --git a/substrate/client/network/src/protocol/message.rs b/substrate/client/network/src/protocol/message.rs index 5baa8ed78f..bb2253b733 100644 --- a/substrate/client/network/src/protocol/message.rs +++ b/substrate/client/network/src/protocol/message.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Network packet message types. These get serialized and put into the lower level protocol payload. use bitflags::bitflags; diff --git a/substrate/client/network/src/protocol/sync/blocks.rs b/substrate/client/network/src/protocol/sync/blocks.rs index 8d7e375d08..b64c9e053e 100644 --- a/substrate/client/network/src/protocol/sync/blocks.rs +++ b/substrate/client/network/src/protocol/sync/blocks.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::cmp; use std::ops::Range; use std::collections::{HashMap, BTreeMap}; diff --git a/substrate/client/network/src/protocol/sync/extra_requests.rs b/substrate/client/network/src/protocol/sync/extra_requests.rs index 5df77a8228..6d688c130f 100644 --- a/substrate/client/network/src/protocol/sync/extra_requests.rs +++ b/substrate/client/network/src/protocol/sync/extra_requests.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use sp_blockchain::Error as ClientError; use crate::protocol::sync::{PeerSync, PeerSyncState}; use fork_tree::ForkTree; diff --git a/substrate/client/network/src/schema.rs b/substrate/client/network/src/schema.rs index c736b5c652..44fbbffd25 100644 --- a/substrate/client/network/src/schema.rs +++ b/substrate/client/network/src/schema.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Include sources generated from protobuf definitions. pub mod v1 { diff --git a/substrate/client/network/src/service.rs b/substrate/client/network/src/service.rs index 331580ecb4..4a52bfebdd 100644 --- a/substrate/client/network/src/service.rs +++ b/substrate/client/network/src/service.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Main entry point of the sc-network crate. //! //! There are two main structs in this module: [`NetworkWorker`] and [`NetworkService`]. diff --git a/substrate/client/network/src/service/out_events.rs b/substrate/client/network/src/service/out_events.rs index 024b974266..4a631601a6 100644 --- a/substrate/client/network/src/service/out_events.rs +++ b/substrate/client/network/src/service/out_events.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Registering events streams. //! //! This code holds the logic that is used for the network service to inform other parts of diff --git a/substrate/client/network/src/service/tests.rs b/substrate/client/network/src/service/tests.rs index cd1ac85497..8eaa984492 100644 --- a/substrate/client/network/src/service/tests.rs +++ b/substrate/client/network/src/service/tests.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::{config, Event, NetworkService, NetworkWorker}; use futures::prelude::*; diff --git a/substrate/client/network/src/transport.rs b/substrate/client/network/src/transport.rs index 7b42211433..0c9a809384 100644 --- a/substrate/client/network/src/transport.rs +++ b/substrate/client/network/src/transport.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use futures::prelude::*; use libp2p::{ InboundUpgradeExt, OutboundUpgradeExt, PeerId, Transport, diff --git a/substrate/client/network/test/src/block_import.rs b/substrate/client/network/test/src/block_import.rs index 34199abde2..ef6ac9268f 100644 --- a/substrate/client/network/test/src/block_import.rs +++ b/substrate/client/network/test/src/block_import.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Testing block import logic. use sp_consensus::ImportedAux; diff --git a/substrate/client/network/test/src/sync.rs b/substrate/client/network/test/src/sync.rs index a87badead7..13d04a8c4e 100644 --- a/substrate/client/network/test/src/sync.rs +++ b/substrate/client/network/test/src/sync.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use sp_consensus::BlockOrigin; use std::time::Duration; use futures::executor::block_on; diff --git a/substrate/client/peerset/src/lib.rs b/substrate/client/peerset/src/lib.rs index bde3bf628c..e5e8ec826f 100644 --- a/substrate/client/peerset/src/lib.rs +++ b/substrate/client/peerset/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Peer Set Manager (PSM). Contains the strategy for choosing which nodes the network should be //! connected to. diff --git a/substrate/client/peerset/tests/fuzz.rs b/substrate/client/peerset/tests/fuzz.rs index dbc688fd5e..aa2de56923 100644 --- a/substrate/client/peerset/tests/fuzz.rs +++ b/substrate/client/peerset/tests/fuzz.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use futures::prelude::*; use libp2p::PeerId; use rand::distributions::{Distribution, Uniform, WeightedIndex}; diff --git a/substrate/client/rpc-api/src/author/error.rs b/substrate/client/rpc-api/src/author/error.rs index 192d0c2795..e6ee36cdce 100644 --- a/substrate/client/rpc-api/src/author/error.rs +++ b/substrate/client/rpc-api/src/author/error.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Authoring RPC module errors. use crate::errors; diff --git a/substrate/client/rpc-api/src/author/mod.rs b/substrate/client/rpc-api/src/author/mod.rs index d99f854037..29f5b1d26e 100644 --- a/substrate/client/rpc-api/src/author/mod.rs +++ b/substrate/client/rpc-api/src/author/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate block-author/full-node API. pub mod error; diff --git a/substrate/client/rpc-api/src/chain/mod.rs b/substrate/client/rpc-api/src/chain/mod.rs index 0d394acd0b..a7b26f3024 100644 --- a/substrate/client/rpc-api/src/chain/mod.rs +++ b/substrate/client/rpc-api/src/chain/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate blockchain API. pub mod error; diff --git a/substrate/client/rpc-api/src/child_state/mod.rs b/substrate/client/rpc-api/src/child_state/mod.rs index 21045677f4..d956a7554f 100644 --- a/substrate/client/rpc-api/src/child_state/mod.rs +++ b/substrate/client/rpc-api/src/child_state/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate state API. use jsonrpc_derive::rpc; diff --git a/substrate/client/rpc-api/src/errors.rs b/substrate/client/rpc-api/src/errors.rs index a0c9c4cfbe..4e1a5b10fc 100644 --- a/substrate/client/rpc-api/src/errors.rs +++ b/substrate/client/rpc-api/src/errors.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use log::warn; pub fn internal(e: E) -> jsonrpc_core::Error { diff --git a/substrate/client/rpc-api/src/helpers.rs b/substrate/client/rpc-api/src/helpers.rs index 5ce9161ad5..025fef1102 100644 --- a/substrate/client/rpc-api/src/helpers.rs +++ b/substrate/client/rpc-api/src/helpers.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use jsonrpc_core::futures::prelude::*; use futures::{channel::oneshot, compat::Compat}; diff --git a/substrate/client/rpc-api/src/offchain/error.rs b/substrate/client/rpc-api/src/offchain/error.rs index 6e9b531623..ea5223f1ce 100644 --- a/substrate/client/rpc-api/src/offchain/error.rs +++ b/substrate/client/rpc-api/src/offchain/error.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Offchain RPC errors. use jsonrpc_core as rpc; diff --git a/substrate/client/rpc-api/src/offchain/mod.rs b/substrate/client/rpc-api/src/offchain/mod.rs index c456e56a4d..427b6a1cc0 100644 --- a/substrate/client/rpc-api/src/offchain/mod.rs +++ b/substrate/client/rpc-api/src/offchain/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate offchain API. pub mod error; diff --git a/substrate/client/rpc-api/src/policy.rs b/substrate/client/rpc-api/src/policy.rs index 3dc3bf8505..e6e3380e1a 100644 --- a/substrate/client/rpc-api/src/policy.rs +++ b/substrate/client/rpc-api/src/policy.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Policy-related types. //! //! Contains a `DenyUnsafe` type that can be used to deny potentially unsafe diff --git a/substrate/client/rpc-api/src/state/error.rs b/substrate/client/rpc-api/src/state/error.rs index 2dabe309ee..2fcca3c343 100644 --- a/substrate/client/rpc-api/src/state/error.rs +++ b/substrate/client/rpc-api/src/state/error.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! State RPC errors. use crate::errors; diff --git a/substrate/client/rpc-api/src/state/helpers.rs b/substrate/client/rpc-api/src/state/helpers.rs index b740a8e33b..0d176ea67f 100644 --- a/substrate/client/rpc-api/src/state/helpers.rs +++ b/substrate/client/rpc-api/src/state/helpers.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate state API helpers. use sp_core::Bytes; diff --git a/substrate/client/rpc-api/src/state/mod.rs b/substrate/client/rpc-api/src/state/mod.rs index cec32a26c6..1bfbb4786e 100644 --- a/substrate/client/rpc-api/src/state/mod.rs +++ b/substrate/client/rpc-api/src/state/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate state API. pub mod error; diff --git a/substrate/client/rpc-api/src/subscriptions.rs b/substrate/client/rpc-api/src/subscriptions.rs index 772e9d4ee8..7feae662ee 100644 --- a/substrate/client/rpc-api/src/subscriptions.rs +++ b/substrate/client/rpc-api/src/subscriptions.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::collections::HashMap; use std::sync::{Arc, atomic::{self, AtomicUsize}}; diff --git a/substrate/client/rpc-api/src/system/error.rs b/substrate/client/rpc-api/src/system/error.rs index bd75b86493..4897aa485c 100644 --- a/substrate/client/rpc-api/src/system/error.rs +++ b/substrate/client/rpc-api/src/system/error.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! System RPC module errors. use crate::system::helpers::Health; diff --git a/substrate/client/rpc-api/src/system/helpers.rs b/substrate/client/rpc-api/src/system/helpers.rs index fbc68de05a..5dbe93543d 100644 --- a/substrate/client/rpc-api/src/system/helpers.rs +++ b/substrate/client/rpc-api/src/system/helpers.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate system API helpers. use std::fmt; diff --git a/substrate/client/rpc-api/src/system/mod.rs b/substrate/client/rpc-api/src/system/mod.rs index 6a2026c978..a7b746ee1b 100644 --- a/substrate/client/rpc-api/src/system/mod.rs +++ b/substrate/client/rpc-api/src/system/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate system API. pub mod error; diff --git a/substrate/client/rpc-servers/src/lib.rs b/substrate/client/rpc-servers/src/lib.rs index 3366343213..6fe4586b6e 100644 --- a/substrate/client/rpc-servers/src/lib.rs +++ b/substrate/client/rpc-servers/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate RPC servers. #![warn(missing_docs)] diff --git a/substrate/client/rpc/src/author/mod.rs b/substrate/client/rpc/src/author/mod.rs index fc23db95a8..d59fad354e 100644 --- a/substrate/client/rpc/src/author/mod.rs +++ b/substrate/client/rpc/src/author/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate block-author/full-node API. #[cfg(test)] diff --git a/substrate/client/rpc/src/author/tests.rs b/substrate/client/rpc/src/author/tests.rs index a9caa6d91a..8c1b82028b 100644 --- a/substrate/client/rpc/src/author/tests.rs +++ b/substrate/client/rpc/src/author/tests.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use super::*; use std::{mem, sync::Arc}; diff --git a/substrate/client/rpc/src/chain/mod.rs b/substrate/client/rpc/src/chain/mod.rs index 8341724227..6d53fbbb06 100644 --- a/substrate/client/rpc/src/chain/mod.rs +++ b/substrate/client/rpc/src/chain/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate blockchain API. mod chain_full; diff --git a/substrate/client/rpc/src/chain/tests.rs b/substrate/client/rpc/src/chain/tests.rs index 477438e286..e86d1d547f 100644 --- a/substrate/client/rpc/src/chain/tests.rs +++ b/substrate/client/rpc/src/chain/tests.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use super::*; use assert_matches::assert_matches; use substrate_test_runtime_client::{ diff --git a/substrate/client/rpc/src/lib.rs b/substrate/client/rpc/src/lib.rs index 0ec44b5663..f979b0ab69 100644 --- a/substrate/client/rpc/src/lib.rs +++ b/substrate/client/rpc/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate RPC implementation. //! //! A core implementation of Substrate RPC interfaces. diff --git a/substrate/client/rpc/src/metadata.rs b/substrate/client/rpc/src/metadata.rs index 3c2902694e..0416b07a67 100644 --- a/substrate/client/rpc/src/metadata.rs +++ b/substrate/client/rpc/src/metadata.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! RPC Metadata use std::sync::Arc; diff --git a/substrate/client/rpc/src/offchain/mod.rs b/substrate/client/rpc/src/offchain/mod.rs index f55148b451..f8d2bb6a50 100644 --- a/substrate/client/rpc/src/offchain/mod.rs +++ b/substrate/client/rpc/src/offchain/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate offchain API. #[cfg(test)] diff --git a/substrate/client/rpc/src/offchain/tests.rs b/substrate/client/rpc/src/offchain/tests.rs index f1fa925a35..f65971a7ff 100644 --- a/substrate/client/rpc/src/offchain/tests.rs +++ b/substrate/client/rpc/src/offchain/tests.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use super::*; use assert_matches::assert_matches; use sp_core::{Bytes, offchain::storage::InMemOffchainStorage}; diff --git a/substrate/client/rpc/src/state/mod.rs b/substrate/client/rpc/src/state/mod.rs index e4d6918afb..168dc3e010 100644 --- a/substrate/client/rpc/src/state/mod.rs +++ b/substrate/client/rpc/src/state/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate state API. mod state_full; diff --git a/substrate/client/rpc/src/state/tests.rs b/substrate/client/rpc/src/state/tests.rs index a275624053..a610cbbfc8 100644 --- a/substrate/client/rpc/src/state/tests.rs +++ b/substrate/client/rpc/src/state/tests.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use super::*; use super::state_full::split_range; use self::error::Error; diff --git a/substrate/client/rpc/src/system/mod.rs b/substrate/client/rpc/src/system/mod.rs index 92a5f61c89..4b8abbe144 100644 --- a/substrate/client/rpc/src/system/mod.rs +++ b/substrate/client/rpc/src/system/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate system API. #[cfg(test)] diff --git a/substrate/client/rpc/src/system/tests.rs b/substrate/client/rpc/src/system/tests.rs index e79e85f771..25ebd80953 100644 --- a/substrate/client/rpc/src/system/tests.rs +++ b/substrate/client/rpc/src/system/tests.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use super::*; use sc_network::{self, PeerId}; diff --git a/substrate/client/service/src/builder.rs b/substrate/client/service/src/builder.rs index 81a861d621..cc7929e88c 100644 --- a/substrate/client/service/src/builder.rs +++ b/substrate/client/service/src/builder.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::{Service, NetworkStatus, NetworkState, error::Error, DEFAULT_PROTOCOL_ID, MallocSizeOfWasm}; use crate::{start_rpc_servers, build_network_future, TransactionPoolAdapter, TaskManager, SpawnTaskHandle}; use crate::status_sinks; diff --git a/substrate/client/service/src/chain_ops.rs b/substrate/client/service/src/chain_ops.rs index f02161fc72..5c7dca0da7 100644 --- a/substrate/client/service/src/chain_ops.rs +++ b/substrate/client/service/src/chain_ops.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Chain utilities. use crate::error; diff --git a/substrate/client/service/src/client/block_rules.rs b/substrate/client/service/src/client/block_rules.rs index 0d7e8effc6..247d09197b 100644 --- a/substrate/client/service/src/client/block_rules.rs +++ b/substrate/client/service/src/client/block_rules.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Client fixed chain specification rules use std::collections::{HashMap, HashSet}; diff --git a/substrate/client/service/src/client/call_executor.rs b/substrate/client/service/src/client/call_executor.rs index d0304914ff..049bd888b1 100644 --- a/substrate/client/service/src/client/call_executor.rs +++ b/substrate/client/service/src/client/call_executor.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::{sync::Arc, panic::UnwindSafe, result, cell::RefCell}; use codec::{Encode, Decode}; use sp_runtime::{ diff --git a/substrate/client/service/src/client/client.rs b/substrate/client/service/src/client/client.rs index 9db7b714e1..77b3f065f4 100644 --- a/substrate/client/service/src/client/client.rs +++ b/substrate/client/service/src/client/client.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate Client use std::{ diff --git a/substrate/client/service/src/client/genesis.rs b/substrate/client/service/src/client/genesis.rs index 9f68e20950..4df08025e3 100644 --- a/substrate/client/service/src/client/genesis.rs +++ b/substrate/client/service/src/client/genesis.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Tool for creating the genesis block. use sp_runtime::traits::{Block as BlockT, Header as HeaderT, Hash as HashT, Zero}; diff --git a/substrate/client/service/src/client/light/blockchain.rs b/substrate/client/service/src/client/light/blockchain.rs index 6076b386dc..c7b20de594 100644 --- a/substrate/client/service/src/client/light/blockchain.rs +++ b/substrate/client/service/src/client/light/blockchain.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Light client blockchain backend. Only stores headers and justifications of recent //! blocks. CHT roots are stored for headers of ancient blocks. diff --git a/substrate/client/service/src/client/light/call_executor.rs b/substrate/client/service/src/client/light/call_executor.rs index 0f6a8f1372..81be65339b 100644 --- a/substrate/client/service/src/client/light/call_executor.rs +++ b/substrate/client/service/src/client/light/call_executor.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Methods that light client could use to execute runtime calls. use std::{ diff --git a/substrate/client/service/src/client/light/fetcher.rs b/substrate/client/service/src/client/light/fetcher.rs index b62225c59c..5422554967 100644 --- a/substrate/client/service/src/client/light/fetcher.rs +++ b/substrate/client/service/src/client/light/fetcher.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Light client data fetcher. Fetches requested data from remote full nodes. use std::sync::Arc; diff --git a/substrate/client/service/src/client/light/mod.rs b/substrate/client/service/src/client/light/mod.rs index 32288d7b8b..a3456f96a3 100644 --- a/substrate/client/service/src/client/light/mod.rs +++ b/substrate/client/service/src/client/light/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Light client components. pub mod backend; diff --git a/substrate/client/service/src/client/mod.rs b/substrate/client/service/src/client/mod.rs index 52a67eb3e3..7c96f61a78 100644 --- a/substrate/client/service/src/client/mod.rs +++ b/substrate/client/service/src/client/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate Client and associated logic. //! //! The [`Client`] is one of the most important components of Substrate. It mainly comprises two diff --git a/substrate/client/service/src/config.rs b/substrate/client/service/src/config.rs index 7e4949e534..cc9c742ed6 100644 --- a/substrate/client/service/src/config.rs +++ b/substrate/client/service/src/config.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Service configuration. pub use sc_client_db::{Database, PruningMode, DatabaseSettingsSrc as DatabaseConfig}; diff --git a/substrate/client/service/src/error.rs b/substrate/client/service/src/error.rs index 244fa553ff..ffe1b39405 100644 --- a/substrate/client/service/src/error.rs +++ b/substrate/client/service/src/error.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Errors that can occur during the service operation. use sc_network; diff --git a/substrate/client/service/src/lib.rs b/substrate/client/service/src/lib.rs index 9e97bb5756..c902e6bb90 100644 --- a/substrate/client/service/src/lib.rs +++ b/substrate/client/service/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate service. Starts a thread that spins up the network, client, and extrinsic pool. //! Manages communication between them. diff --git a/substrate/client/service/src/metrics.rs b/substrate/client/service/src/metrics.rs index 040dc8eb62..f3463ffdbe 100644 --- a/substrate/client/service/src/metrics.rs +++ b/substrate/client/service/src/metrics.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::convert::TryFrom; use crate::NetworkStatus; diff --git a/substrate/client/service/test/src/client/db.rs b/substrate/client/service/test/src/client/db.rs index 19cf62b30d..36d4973224 100644 --- a/substrate/client/service/test/src/client/db.rs +++ b/substrate/client/service/test/src/client/db.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use sp_core::offchain::{OffchainStorage, storage::InMemOffchainStorage}; use std::sync::Arc; @@ -53,4 +54,4 @@ fn in_memory_offchain_storage() { assert!(!storage.compare_and_set(b"B", b"A", Some(b""), b"Y")); assert!(storage.compare_and_set(b"B", b"A", None, b"X")); assert_eq!(storage.get(b"B", b"A"), Some(b"X".to_vec())); -} \ No newline at end of file +} diff --git a/substrate/client/service/test/src/client/mod.rs b/substrate/client/service/test/src/client/mod.rs index 1cfbe2930d..2124f0ced4 100644 --- a/substrate/client/service/test/src/client/mod.rs +++ b/substrate/client/service/test/src/client/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use parity_scale_codec::{Encode, Decode, Joiner}; use sc_executor::native_executor_instance; use sp_state_machine::{StateMachine, OverlayedChanges, ExecutionStrategy, InMemoryBackend}; diff --git a/substrate/client/service/test/src/lib.rs b/substrate/client/service/test/src/lib.rs index a7e4b31ebb..63c7e0795d 100644 --- a/substrate/client/service/test/src/lib.rs +++ b/substrate/client/service/test/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Service integration test utils. use std::iter; diff --git a/substrate/client/state-db/src/lib.rs b/substrate/client/state-db/src/lib.rs index 68c658beb6..61470894e4 100644 --- a/substrate/client/state-db/src/lib.rs +++ b/substrate/client/state-db/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! State database maintenance. Handles canonicalization and pruning in the database. The input to //! this module is a `ChangeSet` which is basically a list of key-value pairs (trie nodes) that //! were added or deleted during block execution. diff --git a/substrate/client/state-db/src/noncanonical.rs b/substrate/client/state-db/src/noncanonical.rs index 34e7a8725c..d77f20c50d 100644 --- a/substrate/client/state-db/src/noncanonical.rs +++ b/substrate/client/state-db/src/noncanonical.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Canonicalization window. //! Maintains trees of block overlays and allows discarding trees/roots //! The overlays are added in `insert` and removed in `canonicalize`. diff --git a/substrate/client/state-db/src/pruning.rs b/substrate/client/state-db/src/pruning.rs index 743db9bc1f..69b07c285f 100644 --- a/substrate/client/state-db/src/pruning.rs +++ b/substrate/client/state-db/src/pruning.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Pruning window. //! //! For each block we maintain a list of nodes pending deletion. diff --git a/substrate/client/state-db/src/test.rs b/substrate/client/state-db/src/test.rs index 17686031a7..11ce4ad822 100644 --- a/substrate/client/state-db/src/test.rs +++ b/substrate/client/state-db/src/test.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Test utils use std::collections::HashMap; diff --git a/substrate/client/telemetry/src/lib.rs b/substrate/client/telemetry/src/lib.rs index 0752a3c53f..315bedbe5b 100644 --- a/substrate/client/telemetry/src/lib.rs +++ b/substrate/client/telemetry/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Telemetry utilities. //! //! Calling `init_telemetry` registers a global `slog` logger using `slog_scope::set_global_logger`. diff --git a/substrate/client/telemetry/src/worker.rs b/substrate/client/telemetry/src/worker.rs index b147313aee..68d4c4e209 100644 --- a/substrate/client/telemetry/src/worker.rs +++ b/substrate/client/telemetry/src/worker.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Contains the object that makes the telemetry work. //! //! # Usage diff --git a/substrate/client/telemetry/src/worker/node.rs b/substrate/client/telemetry/src/worker/node.rs index bdca054c23..6b1a0f62b1 100644 --- a/substrate/client/telemetry/src/worker/node.rs +++ b/substrate/client/telemetry/src/worker/node.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Contains the `Node` struct, which handles communications with a single telemetry endpoint. use bytes::BytesMut; diff --git a/substrate/client/transaction-pool/graph/benches/basics.rs b/substrate/client/transaction-pool/graph/benches/basics.rs index 80d5ac838b..ee92b60d54 100644 --- a/substrate/client/transaction-pool/graph/benches/basics.rs +++ b/substrate/client/transaction-pool/graph/benches/basics.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use criterion::{criterion_group, criterion_main, Criterion}; use futures::{future::{ready, Ready}, executor::block_on}; diff --git a/substrate/client/transaction-pool/graph/src/base_pool.rs b/substrate/client/transaction-pool/graph/src/base_pool.rs index 2cb9a16126..0128e94675 100644 --- a/substrate/client/transaction-pool/graph/src/base_pool.rs +++ b/substrate/client/transaction-pool/graph/src/base_pool.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! A basic version of the dependency graph. //! //! For a more full-featured pool, have a look at the `pool` module. diff --git a/substrate/client/transaction-pool/graph/src/error.rs b/substrate/client/transaction-pool/graph/src/error.rs index b970ab6f45..392ddaa39b 100644 --- a/substrate/client/transaction-pool/graph/src/error.rs +++ b/substrate/client/transaction-pool/graph/src/error.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Transaction pool errors. use sp_runtime::transaction_validity::{ diff --git a/substrate/client/transaction-pool/graph/src/future.rs b/substrate/client/transaction-pool/graph/src/future.rs index 76fa51a3ad..80e6825d4f 100644 --- a/substrate/client/transaction-pool/graph/src/future.rs +++ b/substrate/client/transaction-pool/graph/src/future.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::{ collections::{HashMap, HashSet}, fmt, diff --git a/substrate/client/transaction-pool/graph/src/lib.rs b/substrate/client/transaction-pool/graph/src/lib.rs index 6ef80e2eb2..04e5d0d3fb 100644 --- a/substrate/client/transaction-pool/graph/src/lib.rs +++ b/substrate/client/transaction-pool/graph/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Generic Transaction Pool //! //! The pool is based on dependency graph between transactions diff --git a/substrate/client/transaction-pool/graph/src/listener.rs b/substrate/client/transaction-pool/graph/src/listener.rs index 0bee4384c2..cccf542199 100644 --- a/substrate/client/transaction-pool/graph/src/listener.rs +++ b/substrate/client/transaction-pool/graph/src/listener.rs @@ -16,6 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::{ collections::HashMap, hash, }; diff --git a/substrate/client/transaction-pool/graph/src/pool.rs b/substrate/client/transaction-pool/graph/src/pool.rs index ffcdcdc06f..4f41e91109 100644 --- a/substrate/client/transaction-pool/graph/src/pool.rs +++ b/substrate/client/transaction-pool/graph/src/pool.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::{ hash, collections::HashMap, diff --git a/substrate/client/transaction-pool/graph/src/ready.rs b/substrate/client/transaction-pool/graph/src/ready.rs index dcd55f980f..b5807ffce4 100644 --- a/substrate/client/transaction-pool/graph/src/ready.rs +++ b/substrate/client/transaction-pool/graph/src/ready.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::{ collections::{HashMap, HashSet, BTreeSet}, cmp, diff --git a/substrate/client/transaction-pool/graph/src/rotator.rs b/substrate/client/transaction-pool/graph/src/rotator.rs index a6bb855f23..65e21d0d4b 100644 --- a/substrate/client/transaction-pool/graph/src/rotator.rs +++ b/substrate/client/transaction-pool/graph/src/rotator.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Rotate extrinsic inside the pool. //! //! Keeps only recent extrinsic and discard the ones kept for a significant amount of time. diff --git a/substrate/client/transaction-pool/graph/src/validated_pool.rs b/substrate/client/transaction-pool/graph/src/validated_pool.rs index 66047ad50d..7e8e91efe8 100644 --- a/substrate/client/transaction-pool/graph/src/validated_pool.rs +++ b/substrate/client/transaction-pool/graph/src/validated_pool.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use std::{ collections::{HashSet, HashMap}, hash, diff --git a/substrate/client/transaction-pool/graph/src/watcher.rs b/substrate/client/transaction-pool/graph/src/watcher.rs index 1c03c0e6a8..9d9a91bb23 100644 --- a/substrate/client/transaction-pool/graph/src/watcher.rs +++ b/substrate/client/transaction-pool/graph/src/watcher.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Extrinsics status updates. use futures::Stream; diff --git a/substrate/client/transaction-pool/src/api.rs b/substrate/client/transaction-pool/src/api.rs index f2cd9c707f..725fb6ec4a 100644 --- a/substrate/client/transaction-pool/src/api.rs +++ b/substrate/client/transaction-pool/src/api.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Chain api required for the transaction pool. use std::{marker::PhantomData, pin::Pin, sync::Arc}; diff --git a/substrate/client/transaction-pool/src/error.rs b/substrate/client/transaction-pool/src/error.rs index fa05ca6a64..c0f795df18 100644 --- a/substrate/client/transaction-pool/src/error.rs +++ b/substrate/client/transaction-pool/src/error.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Transaction pool error. use sp_transaction_pool::error::Error as TxPoolError; diff --git a/substrate/client/transaction-pool/src/lib.rs b/substrate/client/transaction-pool/src/lib.rs index 8976003b7d..05d7189a04 100644 --- a/substrate/client/transaction-pool/src/lib.rs +++ b/substrate/client/transaction-pool/src/lib.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Substrate transaction pool implementation. #![recursion_limit="256"] diff --git a/substrate/client/transaction-pool/src/metrics.rs b/substrate/client/transaction-pool/src/metrics.rs index 68c5042f2d..e377b2fe82 100644 --- a/substrate/client/transaction-pool/src/metrics.rs +++ b/substrate/client/transaction-pool/src/metrics.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Transaction pool Prometheus metrics. use std::sync::Arc; diff --git a/substrate/client/transaction-pool/src/revalidation.rs b/substrate/client/transaction-pool/src/revalidation.rs index 261ef5a140..33f3a3da47 100644 --- a/substrate/client/transaction-pool/src/revalidation.rs +++ b/substrate/client/transaction-pool/src/revalidation.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Pool periodic revalidation. use std::{sync::Arc, pin::Pin, collections::{HashMap, HashSet, BTreeMap}}; diff --git a/substrate/client/transaction-pool/src/testing/mod.rs b/substrate/client/transaction-pool/src/testing/mod.rs index c22d61491a..350c4137c3 100644 --- a/substrate/client/transaction-pool/src/testing/mod.rs +++ b/substrate/client/transaction-pool/src/testing/mod.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + //! Tests for top-level transaction pool api mod pool; diff --git a/substrate/client/transaction-pool/src/testing/pool.rs b/substrate/client/transaction-pool/src/testing/pool.rs index 0b5ce8e90d..4f30d5b6c3 100644 --- a/substrate/client/transaction-pool/src/testing/pool.rs +++ b/substrate/client/transaction-pool/src/testing/pool.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . + use crate::*; use sp_transaction_pool::TransactionStatus; use futures::executor::block_on;