From c03f1743c87156c3f72435f9c28016d3f79a6f6b Mon Sep 17 00:00:00 2001 From: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Date: Sun, 12 Jul 2020 10:02:56 +0200 Subject: [PATCH] Remove duplicate comments (#6638) --- substrate/frame/assets/src/lib.rs | 7 ------- substrate/frame/atomic-swap/src/tests.rs | 5 ----- substrate/frame/benchmarking/src/tests.rs | 2 -- substrate/frame/evm/src/tests.rs | 8 -------- substrate/frame/generic-asset/src/mock.rs | 5 ----- substrate/frame/identity/src/lib.rs | 8 -------- substrate/frame/membership/src/lib.rs | 7 ------- substrate/frame/nicks/src/lib.rs | 8 -------- substrate/frame/recovery/src/mock.rs | 5 ----- substrate/frame/scheduler/src/lib.rs | 7 ------- substrate/frame/scored-pool/src/mock.rs | 8 -------- substrate/frame/society/src/mock.rs | 5 ----- substrate/frame/sudo/src/mock.rs | 2 -- substrate/frame/vesting/src/lib.rs | 5 ----- 14 files changed, 82 deletions(-) diff --git a/substrate/frame/assets/src/lib.rs b/substrate/frame/assets/src/lib.rs index 3dfee1ffa6..b64548145c 100644 --- a/substrate/frame/assets/src/lib.rs +++ b/substrate/frame/assets/src/lib.rs @@ -284,17 +284,12 @@ mod tests { use frame_support::{impl_outer_origin, assert_ok, assert_noop, parameter_types, weights::Weight}; use sp_core::H256; - // The testing primitives are very useful for avoiding having to work with signatures - // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header}; impl_outer_origin! { pub enum Origin for Test where system = frame_system {} } - // For testing the pallet, we construct most of a mock runtime. This means - // first constructing a configuration type (`Test`) which `impl`s each of the - // configuration traits of pallets we want to use. #[derive(Clone, Eq, PartialEq)] pub struct Test; parameter_types! { @@ -337,8 +332,6 @@ mod tests { } type Assets = Module; - // This function basically just builds a genesis storage key/value store according to - // our desired mockup. fn new_test_ext() -> sp_io::TestExternalities { frame_system::GenesisConfig::default().build_storage::().unwrap().into() } diff --git a/substrate/frame/atomic-swap/src/tests.rs b/substrate/frame/atomic-swap/src/tests.rs index 587b5ccbc1..82cd30d5d3 100644 --- a/substrate/frame/atomic-swap/src/tests.rs +++ b/substrate/frame/atomic-swap/src/tests.rs @@ -6,8 +6,6 @@ use frame_support::{ impl_outer_origin, parameter_types, weights::Weight, }; use sp_core::H256; -// The testing primitives are very useful for avoiding having to work with signatures -// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use sp_runtime::{ Perbill, testing::Header, @@ -18,9 +16,6 @@ impl_outer_origin! { pub enum Origin for Test where system = frame_system {} } -// For testing the pallet, we construct most of a mock runtime. This means -// first constructing a configuration type (`Test`) which `impl`s each of the -// configuration traits of pallets we want to use. #[derive(Clone, Eq, Debug, PartialEq)] pub struct Test; parameter_types! { diff --git a/substrate/frame/benchmarking/src/tests.rs b/substrate/frame/benchmarking/src/tests.rs index 4ff645562e..56e6da1494 100644 --- a/substrate/frame/benchmarking/src/tests.rs +++ b/substrate/frame/benchmarking/src/tests.rs @@ -114,8 +114,6 @@ impl OtherTrait for Test { type OtherEvent = (); } -// This function basically just builds a genesis storage key/value store according to -// our desired mockup. fn new_test_ext() -> sp_io::TestExternalities { frame_system::GenesisConfig::default().build_storage::().unwrap().into() } diff --git a/substrate/frame/evm/src/tests.rs b/substrate/frame/evm/src/tests.rs index 438ddbba87..f391b4dfe6 100644 --- a/substrate/frame/evm/src/tests.rs +++ b/substrate/frame/evm/src/tests.rs @@ -7,8 +7,6 @@ use frame_support::{ assert_ok, impl_outer_origin, parameter_types, impl_outer_dispatch, }; use sp_core::H256; -// The testing primitives are very useful for avoiding having to work with signatures -// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use sp_runtime::{ Perbill, testing::Header, @@ -25,9 +23,6 @@ impl_outer_dispatch! { } } -// For testing the pallet, we construct most of a mock runtime. This means -// first constructing a configuration type (`Test`) which `impl`s each of the -// configuration traits of pallets we want to use. #[derive(Clone, Eq, PartialEq)] pub struct Test; parameter_types! { @@ -111,8 +106,6 @@ type System = frame_system::Module; type Balances = pallet_balances::Module; type EVM = Module; -// This function basically just builds a genesis storage key/value store according to -// our desired mockup. pub fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); @@ -140,7 +133,6 @@ pub fn new_test_ext() -> sp_io::TestExternalities { } ); - // We use default for brevity, but you can configure as desired if needed. pallet_balances::GenesisConfig::::default().assimilate_storage(&mut t).unwrap(); GenesisConfig { accounts }.assimilate_storage(&mut t).unwrap(); t.into() diff --git a/substrate/frame/generic-asset/src/mock.rs b/substrate/frame/generic-asset/src/mock.rs index f04957b950..8c0a06a156 100644 --- a/substrate/frame/generic-asset/src/mock.rs +++ b/substrate/frame/generic-asset/src/mock.rs @@ -34,9 +34,6 @@ impl_outer_origin! { pub enum Origin for Test where system = frame_system {} } -// For testing the pallet, we construct most of a mock runtime. This means -// first constructing a configuration type (`Test`) which `impl`s each of the -// configuration traits of pallets we want to use. #[derive(Clone, Eq, PartialEq)] pub struct Test; parameter_types! { @@ -147,8 +144,6 @@ impl ExtBuilder { } } -// This function basically just builds a genesis storage key/value store according to -// our desired mockup. pub fn new_test_ext() -> sp_io::TestExternalities { frame_system::GenesisConfig::default() .build_storage::() diff --git a/substrate/frame/identity/src/lib.rs b/substrate/frame/identity/src/lib.rs index f303a37198..765d837a8a 100644 --- a/substrate/frame/identity/src/lib.rs +++ b/substrate/frame/identity/src/lib.rs @@ -1183,8 +1183,6 @@ mod tests { }; use sp_core::H256; use frame_system::{EnsureSignedBy, EnsureOneOf, EnsureRoot}; - // The testing primitives are very useful for avoiding having to work with signatures - // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use sp_runtime::{ Perbill, testing::Header, traits::{BlakeTwo256, IdentityLookup}, }; @@ -1193,9 +1191,6 @@ mod tests { pub enum Origin for Test where system = frame_system {} } - // For testing the pallet, we construct most of a mock runtime. This means - // first constructing a configuration type (`Test`) which `impl`s each of the - // configuration traits of pallets we want to use. #[derive(Clone, Eq, PartialEq)] pub struct Test; parameter_types! { @@ -1282,11 +1277,8 @@ mod tests { type Balances = pallet_balances::Module; type Identity = Module; - // This function basically just builds a genesis storage key/value store according to - // our desired mockup. pub fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - // We use default for brevity, but you can configure as desired if needed. pallet_balances::GenesisConfig:: { balances: vec![ (1, 10), diff --git a/substrate/frame/membership/src/lib.rs b/substrate/frame/membership/src/lib.rs index 3a99f8346d..7d56390b8b 100644 --- a/substrate/frame/membership/src/lib.rs +++ b/substrate/frame/membership/src/lib.rs @@ -284,8 +284,6 @@ mod tests { ord_parameter_types }; use sp_core::H256; - // The testing primitives are very useful for avoiding having to work with signatures - // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup, BadOrigin}, testing::Header}; use frame_system::EnsureSignedBy; @@ -293,9 +291,6 @@ mod tests { pub enum Origin for Test where system = frame_system {} } - // For testing the pallet, we construct most of a mock runtime. This means - // first constructing a configuration type (`Test`) which `impl`s each of the - // configuration traits of pallets we want to use. #[derive(Clone, Eq, PartialEq)] pub struct Test; parameter_types! { @@ -381,8 +376,6 @@ mod tests { type Membership = Module; - // This function basically just builds a genesis storage key/value store according to - // our desired mockup. fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); // We use default for brevity, but you can configure as desired if needed. diff --git a/substrate/frame/nicks/src/lib.rs b/substrate/frame/nicks/src/lib.rs index 4602146c9c..970c070b2e 100644 --- a/substrate/frame/nicks/src/lib.rs +++ b/substrate/frame/nicks/src/lib.rs @@ -244,8 +244,6 @@ mod tests { }; use sp_core::H256; use frame_system::EnsureSignedBy; - // The testing primitives are very useful for avoiding having to work with signatures - // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use sp_runtime::{ Perbill, testing::Header, traits::{BlakeTwo256, IdentityLookup, BadOrigin}, }; @@ -254,9 +252,6 @@ mod tests { pub enum Origin for Test where system = frame_system {} } - // For testing the pallet, we construct most of a mock runtime. This means - // first constructing a configuration type (`Test`) which `impl`s each of the - // configuration traits of pallets we want to use. #[derive(Clone, Eq, PartialEq)] pub struct Test; parameter_types! { @@ -324,11 +319,8 @@ mod tests { type Balances = pallet_balances::Module; type Nicks = Module; - // This function basically just builds a genesis storage key/value store according to - // our desired mockup. fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - // We use default for brevity, but you can configure as desired if needed. pallet_balances::GenesisConfig:: { balances: vec![ (1, 10), diff --git a/substrate/frame/recovery/src/mock.rs b/substrate/frame/recovery/src/mock.rs index b0030176bb..6b8ef169c0 100644 --- a/substrate/frame/recovery/src/mock.rs +++ b/substrate/frame/recovery/src/mock.rs @@ -25,8 +25,6 @@ use frame_support::{ traits::{OnInitialize, OnFinalize}, }; use sp_core::H256; -// The testing primitives are very useful for avoiding having to work with signatures -// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use sp_runtime::{ Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header, }; @@ -50,9 +48,6 @@ impl_outer_dispatch! { } } -// For testing the pallet, we construct most of a mock runtime. This means -// first constructing a configuration type (`Test`) which `impl`s each of the -// configuration traits of pallets we want to use. #[derive(Clone, Eq, PartialEq)] pub struct Test; diff --git a/substrate/frame/scheduler/src/lib.rs b/substrate/frame/scheduler/src/lib.rs index 6940c1ca45..0b8c9173a9 100644 --- a/substrate/frame/scheduler/src/lib.rs +++ b/substrate/frame/scheduler/src/lib.rs @@ -556,8 +556,6 @@ mod tests { weights::constants::RocksDbWeight, }; use sp_core::H256; - // The testing primitives are very useful for avoiding having to work with signatures - // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use sp_runtime::{ Perbill, testing::Header, @@ -638,9 +636,6 @@ mod tests { } } - // For testing the pallet, we construct most of a mock runtime. This means - // first constructing a configuration type (`Test`) which `impl`s each of the - // configuration traits of pallets we want to use. #[derive(Clone, Eq, PartialEq)] pub struct Test; parameter_types! { @@ -699,8 +694,6 @@ mod tests { type Logger = logger::Module; type Scheduler = Module; - // This function basically just builds a genesis storage key/value store according to - // our desired mockup. pub fn new_test_ext() -> sp_io::TestExternalities { let t = system::GenesisConfig::default().build_storage::().unwrap(); t.into() diff --git a/substrate/frame/scored-pool/src/mock.rs b/substrate/frame/scored-pool/src/mock.rs index 9804f087f8..552028afc9 100644 --- a/substrate/frame/scored-pool/src/mock.rs +++ b/substrate/frame/scored-pool/src/mock.rs @@ -22,8 +22,6 @@ use super::*; use std::cell::RefCell; use frame_support::{impl_outer_origin, parameter_types, weights::Weight, ord_parameter_types}; use sp_core::H256; -// The testing primitives are very useful for avoiding having to work with signatures -// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use sp_runtime::{ Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header, }; @@ -33,9 +31,6 @@ impl_outer_origin! { pub enum Origin for Test where system = frame_system {} } -// For testing the pallet, we construct most of a mock runtime. This means -// first constructing a configuration type (`Test`) which `impl`s each of the -// configuration traits of pallets we want to use. #[derive(Clone, Eq, PartialEq)] pub struct Test; parameter_types! { @@ -133,11 +128,8 @@ impl Trait for Test { type System = frame_system::Module; type Balances = pallet_balances::Module; -// This function basically just builds a genesis storage key/value store according to -// our desired mockup. pub fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - // We use default for brevity, but you can configure as desired if needed. pallet_balances::GenesisConfig:: { balances: vec![ (5, 500_000), diff --git a/substrate/frame/society/src/mock.rs b/substrate/frame/society/src/mock.rs index 7273b02acd..f29dbc8cb1 100644 --- a/substrate/frame/society/src/mock.rs +++ b/substrate/frame/society/src/mock.rs @@ -23,8 +23,6 @@ use frame_support::{ impl_outer_origin, parameter_types, ord_parameter_types, traits::{OnInitialize, OnFinalize} }; use sp_core::H256; -// The testing primitives are very useful for avoiding having to work with signatures -// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use sp_runtime::{ Perbill, testing::Header, @@ -36,9 +34,6 @@ impl_outer_origin! { pub enum Origin for Test {} } -// For testing the pallet, we construct most of a mock runtime. This means -// first constructing a configuration type (`Test`) which `impl`s each of the -// configuration traits of pallets we want to use. #[derive(Clone, Eq, PartialEq)] pub struct Test; parameter_types! { diff --git a/substrate/frame/sudo/src/mock.rs b/substrate/frame/sudo/src/mock.rs index cc9c91f3a4..5052d9c52d 100644 --- a/substrate/frame/sudo/src/mock.rs +++ b/substrate/frame/sudo/src/mock.rs @@ -23,8 +23,6 @@ use frame_support::{ weights::Weight, }; use sp_core::H256; -// The testing primitives are very useful for avoiding having to work with signatures -// or public keys. use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header}; use sp_io; use crate as sudo; diff --git a/substrate/frame/vesting/src/lib.rs b/substrate/frame/vesting/src/lib.rs index cc9cbfac93..7625cf7417 100644 --- a/substrate/frame/vesting/src/lib.rs +++ b/substrate/frame/vesting/src/lib.rs @@ -416,8 +416,6 @@ mod tests { traits::Get }; use sp_core::H256; - // The testing primitives are very useful for avoiding having to work with signatures - // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use sp_runtime::{ Perbill, testing::Header, @@ -429,9 +427,6 @@ mod tests { pub enum Origin for Test where system = frame_system {} } - // For testing the pallet, we construct most of a mock runtime. This means - // first constructing a configuration type (`Test`) which `impl`s each of the - // configuration traits of pallets we want to use. #[derive(Clone, Eq, PartialEq)] pub struct Test; parameter_types! {