diff --git a/client/api/src/call_executor.rs b/client/api/src/call_executor.rs index e5b670579a4f0..d9d43900dfc94 100644 --- a/client/api/src/call_executor.rs +++ b/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/client/api/src/cht.rs b/client/api/src/cht.rs index ef282868c941e..30cfd3a1b671b 100644 --- a/client/api/src/cht.rs +++ b/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/client/api/src/in_mem.rs b/client/api/src/in_mem.rs index cb1724e468b56..0eb0681a82491 100644 --- a/client/api/src/in_mem.rs +++ b/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/client/api/src/leaves.rs b/client/api/src/leaves.rs index c93446b94d37d..25f9f3d29b022 100644 --- a/client/api/src/leaves.rs +++ b/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/client/api/src/notifications.rs b/client/api/src/notifications.rs index c89e8b6dfd237..ec63c372c7e59 100644 --- a/client/api/src/notifications.rs +++ b/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/client/authority-discovery/src/tests.rs b/client/authority-discovery/src/tests.rs index 106c68b2d0985..12edcf5fc9008 100644 --- a/client/authority-discovery/src/tests.rs +++ b/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/client/basic-authorship/src/lib.rs b/client/basic-authorship/src/lib.rs index 7c77dde6b02a1..f5f2c089f656e 100644 --- a/client/basic-authorship/src/lib.rs +++ b/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/client/block-builder/src/lib.rs b/client/block-builder/src/lib.rs index f630d42a9b2d4..af40b336623d8 100644 --- a/client/block-builder/src/lib.rs +++ b/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/client/chain-spec/src/chain_spec.rs b/client/chain-spec/src/chain_spec.rs index a6bf6212e1a9d..52414f8687c96 100644 --- a/client/chain-spec/src/chain_spec.rs +++ b/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/client/cli/src/commands/build_spec_cmd.rs b/client/cli/src/commands/build_spec_cmd.rs index e5e7123b4b76c..2f9e2fa059b30 100644 --- a/client/cli/src/commands/build_spec_cmd.rs +++ b/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/client/cli/src/commands/check_block_cmd.rs b/client/cli/src/commands/check_block_cmd.rs index 35f26af6670dd..d1241f010d597 100644 --- a/client/cli/src/commands/check_block_cmd.rs +++ b/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/client/cli/src/commands/export_blocks_cmd.rs b/client/cli/src/commands/export_blocks_cmd.rs index 431add4128b3f..2fdc408250bce 100644 --- a/client/cli/src/commands/export_blocks_cmd.rs +++ b/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/client/cli/src/commands/export_state_cmd.rs b/client/cli/src/commands/export_state_cmd.rs index ee022e1afd991..3ad6772882543 100644 --- a/client/cli/src/commands/export_state_cmd.rs +++ b/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/client/cli/src/commands/import_blocks_cmd.rs b/client/cli/src/commands/import_blocks_cmd.rs index 029e4475627ee..e138850c8bfd3 100644 --- a/client/cli/src/commands/import_blocks_cmd.rs +++ b/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/client/cli/src/commands/purge_chain_cmd.rs b/client/cli/src/commands/purge_chain_cmd.rs index 6b540a66a2e2b..9d364a45f7d09 100644 --- a/client/cli/src/commands/purge_chain_cmd.rs +++ b/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/client/cli/src/commands/revert_cmd.rs b/client/cli/src/commands/revert_cmd.rs index ea6ba5ecf7a38..6117eaf4880bf 100644 --- a/client/cli/src/commands/revert_cmd.rs +++ b/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/client/cli/src/commands/run_cmd.rs b/client/cli/src/commands/run_cmd.rs index c34a31e59b652..f87d5bea6eebe 100644 --- a/client/cli/src/commands/run_cmd.rs +++ b/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/client/cli/src/config.rs b/client/cli/src/config.rs index fb0101ec88536..fdaee929a678e 100644 --- a/client/cli/src/config.rs +++ b/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/client/cli/src/error.rs b/client/cli/src/error.rs index fa336974d626d..23c2bf05f0a14 100644 --- a/client/cli/src/error.rs +++ b/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/client/cli/src/lib.rs b/client/cli/src/lib.rs index 271572b43d10a..36d3649926f90 100644 --- a/client/cli/src/lib.rs +++ b/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/client/cli/src/params/database_params.rs b/client/cli/src/params/database_params.rs index 62b04367885e4..3ff8eb01d0643 100644 --- a/client/cli/src/params/database_params.rs +++ b/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/client/cli/src/params/import_params.rs b/client/cli/src/params/import_params.rs index e1c86aec9b6bb..fb683df6d3be9 100644 --- a/client/cli/src/params/import_params.rs +++ b/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/client/cli/src/params/keystore_params.rs b/client/cli/src/params/keystore_params.rs index 4dbd793456377..2fd610377d793 100644 --- a/client/cli/src/params/keystore_params.rs +++ b/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/client/cli/src/params/network_params.rs b/client/cli/src/params/network_params.rs index e328c32a40c7b..c1639ad2b4370 100644 --- a/client/cli/src/params/network_params.rs +++ b/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/client/cli/src/params/node_key_params.rs b/client/cli/src/params/node_key_params.rs index ede9fd02e121d..7d19971ad6470 100644 --- a/client/cli/src/params/node_key_params.rs +++ b/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/client/cli/src/params/pruning_params.rs b/client/cli/src/params/pruning_params.rs index d96a44986dad7..36179359063e7 100644 --- a/client/cli/src/params/pruning_params.rs +++ b/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/client/cli/src/params/shared_params.rs b/client/cli/src/params/shared_params.rs index 94fb3ceea66fc..5bf81024668c3 100644 --- a/client/cli/src/params/shared_params.rs +++ b/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/client/cli/src/params/transaction_pool_params.rs b/client/cli/src/params/transaction_pool_params.rs index 00f5f0dbd6012..2283c0f39f9c7 100644 --- a/client/cli/src/params/transaction_pool_params.rs +++ b/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/client/cli/src/runner.rs b/client/cli/src/runner.rs index 1600aed7d694b..2d27743163ae4 100644 --- a/client/cli/src/runner.rs +++ b/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/client/consensus/aura/src/digests.rs b/client/consensus/aura/src/digests.rs index 8ddcb2bee45ef..3332e4c6a6dff 100644 --- a/client/consensus/aura/src/digests.rs +++ b/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/client/consensus/babe/rpc/src/lib.rs b/client/consensus/babe/rpc/src/lib.rs index 0c8a16e4daaf4..925328a856f07 100644 --- a/client/consensus/babe/rpc/src/lib.rs +++ b/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/client/consensus/manual-seal/src/error.rs b/client/consensus/manual-seal/src/error.rs index 36499893c3694..2411a839b027c 100644 --- a/client/consensus/manual-seal/src/error.rs +++ b/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/client/consensus/manual-seal/src/lib.rs b/client/consensus/manual-seal/src/lib.rs index de9711b2a8ec9..26f493d5d220c 100644 --- a/client/consensus/manual-seal/src/lib.rs +++ b/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/client/consensus/pow/src/lib.rs b/client/consensus/pow/src/lib.rs index b0d1e04348f3b..2628a11d3baea 100644 --- a/client/consensus/pow/src/lib.rs +++ b/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/client/db/src/bench.rs b/client/db/src/bench.rs index 3b31a37b14900..807e8c68e1875 100644 --- a/client/db/src/bench.rs +++ b/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/client/db/src/cache/list_cache.rs b/client/db/src/cache/list_cache.rs index a2af053e87a63..0856350fb0910 100644 --- a/client/db/src/cache/list_cache.rs +++ b/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/client/db/src/cache/list_entry.rs b/client/db/src/cache/list_entry.rs index 39dee59d556fd..565a62cff4f2d 100644 --- a/client/db/src/cache/list_entry.rs +++ b/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/client/db/src/cache/list_storage.rs b/client/db/src/cache/list_storage.rs index 1fa26552e9d4d..377d744effa60 100644 --- a/client/db/src/cache/list_storage.rs +++ b/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/client/db/src/cache/mod.rs b/client/db/src/cache/mod.rs index 03cda1b589cca..2b7cd2e62076e 100644 --- a/client/db/src/cache/mod.rs +++ b/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/client/db/src/lib.rs b/client/db/src/lib.rs index 75d36dde5c8b0..037409dfc4376 100644 --- a/client/db/src/lib.rs +++ b/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/client/db/src/light.rs b/client/db/src/light.rs index 8607823462ebe..f115ac9599e8d 100644 --- a/client/db/src/light.rs +++ b/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/client/db/src/offchain.rs b/client/db/src/offchain.rs index a7cc1345d198f..651510d6e887e 100644 --- a/client/db/src/offchain.rs +++ b/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/client/db/src/stats.rs b/client/db/src/stats.rs index 7a265ddf823fb..8d208024b4bb2 100644 --- a/client/db/src/stats.rs +++ b/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/client/db/src/utils.rs b/client/db/src/utils.rs index c05a41125844e..80b08b3a6e59c 100644 --- a/client/db/src/utils.rs +++ b/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/client/executor/common/src/error.rs b/client/executor/common/src/error.rs index 8fc0c4392cc4a..04850e6f8dd7e 100644 --- a/client/executor/common/src/error.rs +++ b/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/client/executor/common/src/sandbox.rs b/client/executor/common/src/sandbox.rs index 37860474cb07c..b2c35b7582718 100644 --- a/client/executor/common/src/sandbox.rs +++ b/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/client/executor/common/src/util.rs b/client/executor/common/src/util.rs index ebd14a5a6e45f..92a48e1401814 100644 --- a/client/executor/common/src/util.rs +++ b/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/client/executor/src/integration_tests/sandbox.rs b/client/executor/src/integration_tests/sandbox.rs index 8fe76789553e3..f84e446b416c0 100644 --- a/client/executor/src/integration_tests/sandbox.rs +++ b/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/client/executor/src/lib.rs b/client/executor/src/lib.rs index a8b86da71449c..c02568c734b69 100644 --- a/client/executor/src/lib.rs +++ b/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/client/executor/src/native_executor.rs b/client/executor/src/native_executor.rs index 95f5dff8c6cfd..b1eb504d5a2b3 100644 --- a/client/executor/src/native_executor.rs +++ b/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/client/executor/wasmtime/src/imports.rs b/client/executor/wasmtime/src/imports.rs index b427606c3c36f..36752d72fa023 100644 --- a/client/executor/wasmtime/src/imports.rs +++ b/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/client/executor/wasmtime/src/instance_wrapper.rs b/client/executor/wasmtime/src/instance_wrapper.rs index 8b0b5cf382ecd..9026b8054e652 100644 --- a/client/executor/wasmtime/src/instance_wrapper.rs +++ b/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/client/executor/wasmtime/src/instance_wrapper/globals_snapshot.rs b/client/executor/wasmtime/src/instance_wrapper/globals_snapshot.rs index db2cc28e684fb..01d82451fcbbb 100644 --- a/client/executor/wasmtime/src/instance_wrapper/globals_snapshot.rs +++ b/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/client/executor/wasmtime/src/state_holder.rs b/client/executor/wasmtime/src/state_holder.rs index ac5b64c774e6e..711d3bb735d7c 100644 --- a/client/executor/wasmtime/src/state_holder.rs +++ b/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/client/finality-grandpa/rpc/src/error.rs b/client/finality-grandpa/rpc/src/error.rs index 73c36f23f5971..bfd0596fdf320 100644 --- a/client/finality-grandpa/rpc/src/error.rs +++ b/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/client/finality-grandpa/rpc/src/lib.rs b/client/finality-grandpa/rpc/src/lib.rs index 6d8e10622b962..1af84b7a84413 100644 --- a/client/finality-grandpa/rpc/src/lib.rs +++ b/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/client/finality-grandpa/rpc/src/report.rs b/client/finality-grandpa/rpc/src/report.rs index 19b89c50839e4..a635728cb938a 100644 --- a/client/finality-grandpa/rpc/src/report.rs +++ b/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/client/finality-grandpa/src/authorities.rs b/client/finality-grandpa/src/authorities.rs index 2105d9ed389ec..b4cb254864df7 100644 --- a/client/finality-grandpa/src/authorities.rs +++ b/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/client/finality-grandpa/src/communication/mod.rs b/client/finality-grandpa/src/communication/mod.rs index 533acb8de65f5..abd1c27983a6d 100644 --- a/client/finality-grandpa/src/communication/mod.rs +++ b/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/client/finality-grandpa/src/environment.rs b/client/finality-grandpa/src/environment.rs index 85816b110bc92..afcc3891ac39f 100644 --- a/client/finality-grandpa/src/environment.rs +++ b/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/client/finality-grandpa/src/finality_proof.rs b/client/finality-grandpa/src/finality_proof.rs index 82a5220d87503..55f6376579db4 100644 --- a/client/finality-grandpa/src/finality_proof.rs +++ b/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/client/finality-grandpa/src/import.rs b/client/finality-grandpa/src/import.rs index 3f3bcc0d8c842..7e3799b1e25e1 100644 --- a/client/finality-grandpa/src/import.rs +++ b/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/client/finality-grandpa/src/justification.rs b/client/finality-grandpa/src/justification.rs index 7f86f7e443a58..b4db81f8a42bf 100644 --- a/client/finality-grandpa/src/justification.rs +++ b/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/client/finality-grandpa/src/lib.rs b/client/finality-grandpa/src/lib.rs index 41dedc2246aa0..7b20d082a01ab 100644 --- a/client/finality-grandpa/src/lib.rs +++ b/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/client/finality-grandpa/src/observer.rs b/client/finality-grandpa/src/observer.rs index ee203a225d362..cd678b3bb4542 100644 --- a/client/finality-grandpa/src/observer.rs +++ b/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/client/finality-grandpa/src/tests.rs b/client/finality-grandpa/src/tests.rs index dbc54a0d64d1e..25e6253652001 100644 --- a/client/finality-grandpa/src/tests.rs +++ b/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/client/finality-grandpa/src/until_imported.rs b/client/finality-grandpa/src/until_imported.rs index 6be1a1b1bef03..6a39c2637eb7b 100644 --- a/client/finality-grandpa/src/until_imported.rs +++ b/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/client/finality-grandpa/src/voting_rule.rs b/client/finality-grandpa/src/voting_rule.rs index d0c47037ab3c8..60493867ce1f4 100644 --- a/client/finality-grandpa/src/voting_rule.rs +++ b/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/client/informant/src/lib.rs b/client/informant/src/lib.rs index 891e9c0211347..6eea9c1d0434c 100644 --- a/client/informant/src/lib.rs +++ b/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/client/network-gossip/src/state_machine.rs b/client/network-gossip/src/state_machine.rs index 0d8ad50970b35..da07bde3e7d1a 100644 --- a/client/network-gossip/src/state_machine.rs +++ b/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/client/network-gossip/src/validator.rs b/client/network-gossip/src/validator.rs index cd0a733c91667..fd29aaddafe6d 100644 --- a/client/network-gossip/src/validator.rs +++ b/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/client/network/src/chain.rs b/client/network/src/chain.rs index f79cf6f61e15b..20fbe0284397d 100644 --- a/client/network/src/chain.rs +++ b/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/client/network/src/config.rs b/client/network/src/config.rs index c1534c6d9c909..394e8fc01a471 100644 --- a/client/network/src/config.rs +++ b/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/client/network/src/error.rs b/client/network/src/error.rs index e46273c47baa8..fed7a331da93c 100644 --- a/client/network/src/error.rs +++ b/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/client/network/src/network_state.rs b/client/network/src/network_state.rs index ca6733de81d33..970a63faed4ea 100644 --- a/client/network/src/network_state.rs +++ b/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/client/network/src/on_demand_layer.rs b/client/network/src/on_demand_layer.rs index c76ebb0351f4a..084172ee57c4f 100644 --- a/client/network/src/on_demand_layer.rs +++ b/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/client/network/src/protocol.rs b/client/network/src/protocol.rs index 8a71494d8294d..b3c08320f956b 100644 --- a/client/network/src/protocol.rs +++ b/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/client/network/src/protocol/generic_proto/handler/notif_in.rs b/client/network/src/protocol/generic_proto/handler/notif_in.rs index 68708b9fb7ba8..ef4644c548a4f 100644 --- a/client/network/src/protocol/generic_proto/handler/notif_in.rs +++ b/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/client/network/src/protocol/generic_proto/upgrade/legacy.rs b/client/network/src/protocol/generic_proto/upgrade/legacy.rs index aba7fda2c3efb..13560113bb1a2 100644 --- a/client/network/src/protocol/generic_proto/upgrade/legacy.rs +++ b/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/client/network/src/protocol/message.rs b/client/network/src/protocol/message.rs index 5baa8ed78fd78..bb2253b733864 100644 --- a/client/network/src/protocol/message.rs +++ b/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/client/network/src/protocol/sync/blocks.rs b/client/network/src/protocol/sync/blocks.rs index 8d7e375d08820..b64c9e053e97b 100644 --- a/client/network/src/protocol/sync/blocks.rs +++ b/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/client/network/src/protocol/sync/extra_requests.rs b/client/network/src/protocol/sync/extra_requests.rs index 5df77a8228e81..6d688c130fafd 100644 --- a/client/network/src/protocol/sync/extra_requests.rs +++ b/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/client/network/src/schema.rs b/client/network/src/schema.rs index c736b5c652d5e..44fbbffd25406 100644 --- a/client/network/src/schema.rs +++ b/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/client/network/src/service.rs b/client/network/src/service.rs index 331580ecb40aa..4a52bfebdd8ce 100644 --- a/client/network/src/service.rs +++ b/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/client/network/src/service/out_events.rs b/client/network/src/service/out_events.rs index 024b974266974..4a631601a669e 100644 --- a/client/network/src/service/out_events.rs +++ b/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/client/network/src/service/tests.rs b/client/network/src/service/tests.rs index cd1ac85497dc8..8eaa98449213c 100644 --- a/client/network/src/service/tests.rs +++ b/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/client/network/src/transport.rs b/client/network/src/transport.rs index 7b4221143358a..0c9a809384e4c 100644 --- a/client/network/src/transport.rs +++ b/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/client/network/test/src/block_import.rs b/client/network/test/src/block_import.rs index 34199abde22c9..ef6ac9268f26a 100644 --- a/client/network/test/src/block_import.rs +++ b/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/client/network/test/src/sync.rs b/client/network/test/src/sync.rs index a87badead768d..13d04a8c4e81e 100644 --- a/client/network/test/src/sync.rs +++ b/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/client/peerset/src/lib.rs b/client/peerset/src/lib.rs index bde3bf628c363..e5e8ec826fe3c 100644 --- a/client/peerset/src/lib.rs +++ b/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/client/peerset/tests/fuzz.rs b/client/peerset/tests/fuzz.rs index dbc688fd5e7a5..aa2de56923b22 100644 --- a/client/peerset/tests/fuzz.rs +++ b/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/client/rpc-api/src/author/error.rs b/client/rpc-api/src/author/error.rs index 192d0c279569a..e6ee36cdce19a 100644 --- a/client/rpc-api/src/author/error.rs +++ b/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/client/rpc-api/src/author/mod.rs b/client/rpc-api/src/author/mod.rs index d99f854037d09..29f5b1d26e84c 100644 --- a/client/rpc-api/src/author/mod.rs +++ b/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/client/rpc-api/src/chain/mod.rs b/client/rpc-api/src/chain/mod.rs index 0d394acd0bb82..a7b26f3024248 100644 --- a/client/rpc-api/src/chain/mod.rs +++ b/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/client/rpc-api/src/child_state/mod.rs b/client/rpc-api/src/child_state/mod.rs index 21045677f4933..d956a7554f8ee 100644 --- a/client/rpc-api/src/child_state/mod.rs +++ b/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/client/rpc-api/src/errors.rs b/client/rpc-api/src/errors.rs index a0c9c4cfbe158..4e1a5b10fc512 100644 --- a/client/rpc-api/src/errors.rs +++ b/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/client/rpc-api/src/helpers.rs b/client/rpc-api/src/helpers.rs index 5ce9161ad5432..025fef1102c49 100644 --- a/client/rpc-api/src/helpers.rs +++ b/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/client/rpc-api/src/offchain/error.rs b/client/rpc-api/src/offchain/error.rs index 6e9b531623435..ea5223f1ce7f9 100644 --- a/client/rpc-api/src/offchain/error.rs +++ b/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/client/rpc-api/src/offchain/mod.rs b/client/rpc-api/src/offchain/mod.rs index c456e56a4d450..427b6a1cc017b 100644 --- a/client/rpc-api/src/offchain/mod.rs +++ b/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/client/rpc-api/src/policy.rs b/client/rpc-api/src/policy.rs index 3dc3bf85055e4..e6e3380e1a2b8 100644 --- a/client/rpc-api/src/policy.rs +++ b/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/client/rpc-api/src/state/error.rs b/client/rpc-api/src/state/error.rs index 2dabe309eee82..2fcca3c343f09 100644 --- a/client/rpc-api/src/state/error.rs +++ b/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/client/rpc-api/src/state/helpers.rs b/client/rpc-api/src/state/helpers.rs index b740a8e33b4ea..0d176ea67f35b 100644 --- a/client/rpc-api/src/state/helpers.rs +++ b/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/client/rpc-api/src/state/mod.rs b/client/rpc-api/src/state/mod.rs index cec32a26c6279..1bfbb4786e677 100644 --- a/client/rpc-api/src/state/mod.rs +++ b/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/client/rpc-api/src/subscriptions.rs b/client/rpc-api/src/subscriptions.rs index 772e9d4ee804a..7feae662eeb1f 100644 --- a/client/rpc-api/src/subscriptions.rs +++ b/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/client/rpc-api/src/system/error.rs b/client/rpc-api/src/system/error.rs index bd75b86493d26..4897aa485cbe4 100644 --- a/client/rpc-api/src/system/error.rs +++ b/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/client/rpc-api/src/system/helpers.rs b/client/rpc-api/src/system/helpers.rs index fbc68de05abcd..5dbe93543d8e5 100644 --- a/client/rpc-api/src/system/helpers.rs +++ b/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/client/rpc-api/src/system/mod.rs b/client/rpc-api/src/system/mod.rs index 6a2026c978729..a7b746ee1b114 100644 --- a/client/rpc-api/src/system/mod.rs +++ b/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/client/rpc-servers/src/lib.rs b/client/rpc-servers/src/lib.rs index 3366343213154..6fe4586b6ee5e 100644 --- a/client/rpc-servers/src/lib.rs +++ b/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/client/rpc/src/author/mod.rs b/client/rpc/src/author/mod.rs index fc23db95a8127..d59fad354ef3c 100644 --- a/client/rpc/src/author/mod.rs +++ b/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/client/rpc/src/author/tests.rs b/client/rpc/src/author/tests.rs index a9caa6d91a88c..8c1b82028bd79 100644 --- a/client/rpc/src/author/tests.rs +++ b/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/client/rpc/src/chain/mod.rs b/client/rpc/src/chain/mod.rs index 8341724227504..6d53fbbb06f6e 100644 --- a/client/rpc/src/chain/mod.rs +++ b/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/client/rpc/src/chain/tests.rs b/client/rpc/src/chain/tests.rs index 477438e286460..e86d1d547fbde 100644 --- a/client/rpc/src/chain/tests.rs +++ b/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/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 0ec44b5663949..f979b0ab6957e 100644 --- a/client/rpc/src/lib.rs +++ b/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/client/rpc/src/metadata.rs b/client/rpc/src/metadata.rs index 3c2902694e716..0416b07a6797b 100644 --- a/client/rpc/src/metadata.rs +++ b/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/client/rpc/src/offchain/mod.rs b/client/rpc/src/offchain/mod.rs index f55148b451e70..f8d2bb6a50f9c 100644 --- a/client/rpc/src/offchain/mod.rs +++ b/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/client/rpc/src/offchain/tests.rs b/client/rpc/src/offchain/tests.rs index f1fa925a35ee2..f65971a7ffe8a 100644 --- a/client/rpc/src/offchain/tests.rs +++ b/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/client/rpc/src/state/mod.rs b/client/rpc/src/state/mod.rs index e4d6918afb5f3..168dc3e0105a4 100644 --- a/client/rpc/src/state/mod.rs +++ b/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/client/rpc/src/state/tests.rs b/client/rpc/src/state/tests.rs index a2756240534bf..a610cbbfc8285 100644 --- a/client/rpc/src/state/tests.rs +++ b/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/client/rpc/src/system/mod.rs b/client/rpc/src/system/mod.rs index 92a5f61c893cf..4b8abbe144462 100644 --- a/client/rpc/src/system/mod.rs +++ b/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/client/rpc/src/system/tests.rs b/client/rpc/src/system/tests.rs index e79e85f77125e..25ebd80953be6 100644 --- a/client/rpc/src/system/tests.rs +++ b/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/client/service/src/builder.rs b/client/service/src/builder.rs index 81a861d621f8d..cc7929e88c6e4 100644 --- a/client/service/src/builder.rs +++ b/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/client/service/src/chain_ops.rs b/client/service/src/chain_ops.rs index f02161fc72d4c..5c7dca0da73dc 100644 --- a/client/service/src/chain_ops.rs +++ b/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/client/service/src/client/block_rules.rs b/client/service/src/client/block_rules.rs index 0d7e8effc6036..247d09197b604 100644 --- a/client/service/src/client/block_rules.rs +++ b/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/client/service/src/client/call_executor.rs b/client/service/src/client/call_executor.rs index d0304914ff3e3..049bd888b13c7 100644 --- a/client/service/src/client/call_executor.rs +++ b/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/client/service/src/client/client.rs b/client/service/src/client/client.rs index 9db7b714e13d3..77b3f065f43dd 100644 --- a/client/service/src/client/client.rs +++ b/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/client/service/src/client/genesis.rs b/client/service/src/client/genesis.rs index 9f68e209509ca..4df08025e3826 100644 --- a/client/service/src/client/genesis.rs +++ b/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/client/service/src/client/light/blockchain.rs b/client/service/src/client/light/blockchain.rs index 6076b386dc43f..c7b20de594d67 100644 --- a/client/service/src/client/light/blockchain.rs +++ b/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/client/service/src/client/light/call_executor.rs b/client/service/src/client/light/call_executor.rs index 0f6a8f13726c1..81be65339b696 100644 --- a/client/service/src/client/light/call_executor.rs +++ b/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/client/service/src/client/light/fetcher.rs b/client/service/src/client/light/fetcher.rs index b62225c59cf91..542255496739a 100644 --- a/client/service/src/client/light/fetcher.rs +++ b/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/client/service/src/client/light/mod.rs b/client/service/src/client/light/mod.rs index 32288d7b8b158..a3456f96a3786 100644 --- a/client/service/src/client/light/mod.rs +++ b/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/client/service/src/client/mod.rs b/client/service/src/client/mod.rs index 52a67eb3e346a..7c96f61a7867a 100644 --- a/client/service/src/client/mod.rs +++ b/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/client/service/src/config.rs b/client/service/src/config.rs index 7e4949e534875..cc9c742ed68db 100644 --- a/client/service/src/config.rs +++ b/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/client/service/src/error.rs b/client/service/src/error.rs index 244fa553ff239..ffe1b39405501 100644 --- a/client/service/src/error.rs +++ b/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/client/service/src/lib.rs b/client/service/src/lib.rs index 9e97bb5756290..c902e6bb90737 100644 --- a/client/service/src/lib.rs +++ b/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/client/service/src/metrics.rs b/client/service/src/metrics.rs index 040dc8eb62547..f3463ffdbe616 100644 --- a/client/service/src/metrics.rs +++ b/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/client/service/test/src/client/db.rs b/client/service/test/src/client/db.rs index 19cf62b30d5f3..36d49732246e5 100644 --- a/client/service/test/src/client/db.rs +++ b/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/client/service/test/src/client/mod.rs b/client/service/test/src/client/mod.rs index 1cfbe2930dc89..2124f0ced4122 100644 --- a/client/service/test/src/client/mod.rs +++ b/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/client/service/test/src/lib.rs b/client/service/test/src/lib.rs index a7e4b31ebb755..63c7e0795dc1a 100644 --- a/client/service/test/src/lib.rs +++ b/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/client/state-db/src/lib.rs b/client/state-db/src/lib.rs index 68c658beb6089..61470894e487e 100644 --- a/client/state-db/src/lib.rs +++ b/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/client/state-db/src/noncanonical.rs b/client/state-db/src/noncanonical.rs index 34e7a8725cd6b..d77f20c50d05f 100644 --- a/client/state-db/src/noncanonical.rs +++ b/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/client/state-db/src/pruning.rs b/client/state-db/src/pruning.rs index 743db9bc1f9ba..69b07c285fad8 100644 --- a/client/state-db/src/pruning.rs +++ b/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/client/state-db/src/test.rs b/client/state-db/src/test.rs index 17686031a73c2..11ce4ad822620 100644 --- a/client/state-db/src/test.rs +++ b/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/client/telemetry/src/lib.rs b/client/telemetry/src/lib.rs index 0752a3c53fc24..315bedbe5b6d9 100644 --- a/client/telemetry/src/lib.rs +++ b/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/client/telemetry/src/worker.rs b/client/telemetry/src/worker.rs index b147313aee13c..68d4c4e20971b 100644 --- a/client/telemetry/src/worker.rs +++ b/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/client/telemetry/src/worker/node.rs b/client/telemetry/src/worker/node.rs index bdca054c233f1..6b1a0f62b129b 100644 --- a/client/telemetry/src/worker/node.rs +++ b/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/client/transaction-pool/graph/benches/basics.rs b/client/transaction-pool/graph/benches/basics.rs index 80d5ac838b181..ee92b60d548e6 100644 --- a/client/transaction-pool/graph/benches/basics.rs +++ b/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/client/transaction-pool/graph/src/base_pool.rs b/client/transaction-pool/graph/src/base_pool.rs index 2cb9a16126b35..0128e94675e23 100644 --- a/client/transaction-pool/graph/src/base_pool.rs +++ b/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/client/transaction-pool/graph/src/error.rs b/client/transaction-pool/graph/src/error.rs index b970ab6f455e5..392ddaa39be6f 100644 --- a/client/transaction-pool/graph/src/error.rs +++ b/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/client/transaction-pool/graph/src/future.rs b/client/transaction-pool/graph/src/future.rs index 76fa51a3adb7b..80e6825d4ff9d 100644 --- a/client/transaction-pool/graph/src/future.rs +++ b/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/client/transaction-pool/graph/src/lib.rs b/client/transaction-pool/graph/src/lib.rs index 6ef80e2eb2708..04e5d0d3fbe9f 100644 --- a/client/transaction-pool/graph/src/lib.rs +++ b/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/client/transaction-pool/graph/src/listener.rs b/client/transaction-pool/graph/src/listener.rs index 0bee4384c2fd9..cccf542199a03 100644 --- a/client/transaction-pool/graph/src/listener.rs +++ b/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/client/transaction-pool/graph/src/pool.rs b/client/transaction-pool/graph/src/pool.rs index ffcdcdc06fce8..4f41e9110915e 100644 --- a/client/transaction-pool/graph/src/pool.rs +++ b/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/client/transaction-pool/graph/src/ready.rs b/client/transaction-pool/graph/src/ready.rs index dcd55f980f741..b5807ffce4480 100644 --- a/client/transaction-pool/graph/src/ready.rs +++ b/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/client/transaction-pool/graph/src/rotator.rs b/client/transaction-pool/graph/src/rotator.rs index a6bb855f23392..65e21d0d4b506 100644 --- a/client/transaction-pool/graph/src/rotator.rs +++ b/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/client/transaction-pool/graph/src/validated_pool.rs b/client/transaction-pool/graph/src/validated_pool.rs index 66047ad50d7c0..7e8e91efe8f6b 100644 --- a/client/transaction-pool/graph/src/validated_pool.rs +++ b/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/client/transaction-pool/graph/src/watcher.rs b/client/transaction-pool/graph/src/watcher.rs index 1c03c0e6a8920..9d9a91bb23f69 100644 --- a/client/transaction-pool/graph/src/watcher.rs +++ b/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/client/transaction-pool/src/api.rs b/client/transaction-pool/src/api.rs index f2cd9c707fc47..725fb6ec4a8bf 100644 --- a/client/transaction-pool/src/api.rs +++ b/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/client/transaction-pool/src/error.rs b/client/transaction-pool/src/error.rs index fa05ca6a644e0..c0f795df1801a 100644 --- a/client/transaction-pool/src/error.rs +++ b/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/client/transaction-pool/src/lib.rs b/client/transaction-pool/src/lib.rs index 8976003b7d4ba..05d7189a04a0d 100644 --- a/client/transaction-pool/src/lib.rs +++ b/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/client/transaction-pool/src/metrics.rs b/client/transaction-pool/src/metrics.rs index 68c5042f2d3ae..e377b2fe8294c 100644 --- a/client/transaction-pool/src/metrics.rs +++ b/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/client/transaction-pool/src/revalidation.rs b/client/transaction-pool/src/revalidation.rs index 261ef5a1408a2..33f3a3da478f3 100644 --- a/client/transaction-pool/src/revalidation.rs +++ b/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/client/transaction-pool/src/testing/mod.rs b/client/transaction-pool/src/testing/mod.rs index c22d61491a992..350c4137c37b2 100644 --- a/client/transaction-pool/src/testing/mod.rs +++ b/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/client/transaction-pool/src/testing/pool.rs b/client/transaction-pool/src/testing/pool.rs index 0b5ce8e90d7bb..4f30d5b6c3500 100644 --- a/client/transaction-pool/src/testing/pool.rs +++ b/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;