Remove duplicate comments (#6638)

This commit is contained in:
Kian Paimani
2020-07-12 10:02:56 +02:00
committed by GitHub
parent 903cd4e801
commit c03f1743c8
14 changed files with 0 additions and 82 deletions
-7
View File
@@ -284,17 +284,12 @@ mod tests {
use frame_support::{impl_outer_origin, assert_ok, assert_noop, parameter_types, weights::Weight}; use frame_support::{impl_outer_origin, assert_ok, assert_noop, parameter_types, weights::Weight};
use sp_core::H256; 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}; use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
impl_outer_origin! { impl_outer_origin! {
pub enum Origin for Test where system = frame_system {} 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)] #[derive(Clone, Eq, PartialEq)]
pub struct Test; pub struct Test;
parameter_types! { parameter_types! {
@@ -337,8 +332,6 @@ mod tests {
} }
type Assets = Module<Test>; type Assets = Module<Test>;
// This function basically just builds a genesis storage key/value store according to
// our desired mockup.
fn new_test_ext() -> sp_io::TestExternalities { fn new_test_ext() -> sp_io::TestExternalities {
frame_system::GenesisConfig::default().build_storage::<Test>().unwrap().into() frame_system::GenesisConfig::default().build_storage::<Test>().unwrap().into()
} }
-5
View File
@@ -6,8 +6,6 @@ use frame_support::{
impl_outer_origin, parameter_types, weights::Weight, impl_outer_origin, parameter_types, weights::Weight,
}; };
use sp_core::H256; 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::{ use sp_runtime::{
Perbill, Perbill,
testing::Header, testing::Header,
@@ -18,9 +16,6 @@ impl_outer_origin! {
pub enum Origin for Test where system = frame_system {} 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)] #[derive(Clone, Eq, Debug, PartialEq)]
pub struct Test; pub struct Test;
parameter_types! { parameter_types! {
@@ -114,8 +114,6 @@ impl OtherTrait for Test {
type OtherEvent = (); 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 { fn new_test_ext() -> sp_io::TestExternalities {
frame_system::GenesisConfig::default().build_storage::<Test>().unwrap().into() frame_system::GenesisConfig::default().build_storage::<Test>().unwrap().into()
} }
-8
View File
@@ -7,8 +7,6 @@ use frame_support::{
assert_ok, impl_outer_origin, parameter_types, impl_outer_dispatch, assert_ok, impl_outer_origin, parameter_types, impl_outer_dispatch,
}; };
use sp_core::H256; 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::{ use sp_runtime::{
Perbill, Perbill,
testing::Header, 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)] #[derive(Clone, Eq, PartialEq)]
pub struct Test; pub struct Test;
parameter_types! { parameter_types! {
@@ -111,8 +106,6 @@ type System = frame_system::Module<Test>;
type Balances = pallet_balances::Module<Test>; type Balances = pallet_balances::Module<Test>;
type EVM = Module<Test>; type EVM = Module<Test>;
// This function basically just builds a genesis storage key/value store according to
// our desired mockup.
pub fn new_test_ext() -> sp_io::TestExternalities { pub fn new_test_ext() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap(); let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().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::<Test>::default().assimilate_storage(&mut t).unwrap(); pallet_balances::GenesisConfig::<Test>::default().assimilate_storage(&mut t).unwrap();
GenesisConfig { accounts }.assimilate_storage(&mut t).unwrap(); GenesisConfig { accounts }.assimilate_storage(&mut t).unwrap();
t.into() t.into()
@@ -34,9 +34,6 @@ impl_outer_origin! {
pub enum Origin for Test where system = frame_system {} 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)] #[derive(Clone, Eq, PartialEq)]
pub struct Test; pub struct Test;
parameter_types! { 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 { pub fn new_test_ext() -> sp_io::TestExternalities {
frame_system::GenesisConfig::default() frame_system::GenesisConfig::default()
.build_storage::<Test>() .build_storage::<Test>()
-8
View File
@@ -1183,8 +1183,6 @@ mod tests {
}; };
use sp_core::H256; use sp_core::H256;
use frame_system::{EnsureSignedBy, EnsureOneOf, EnsureRoot}; 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::{ use sp_runtime::{
Perbill, testing::Header, traits::{BlakeTwo256, IdentityLookup}, Perbill, testing::Header, traits::{BlakeTwo256, IdentityLookup},
}; };
@@ -1193,9 +1191,6 @@ mod tests {
pub enum Origin for Test where system = frame_system {} 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)] #[derive(Clone, Eq, PartialEq)]
pub struct Test; pub struct Test;
parameter_types! { parameter_types! {
@@ -1282,11 +1277,8 @@ mod tests {
type Balances = pallet_balances::Module<Test>; type Balances = pallet_balances::Module<Test>;
type Identity = Module<Test>; type Identity = Module<Test>;
// This function basically just builds a genesis storage key/value store according to
// our desired mockup.
pub fn new_test_ext() -> sp_io::TestExternalities { pub fn new_test_ext() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap(); let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
// We use default for brevity, but you can configure as desired if needed.
pallet_balances::GenesisConfig::<Test> { pallet_balances::GenesisConfig::<Test> {
balances: vec![ balances: vec![
(1, 10), (1, 10),
-7
View File
@@ -284,8 +284,6 @@ mod tests {
ord_parameter_types ord_parameter_types
}; };
use sp_core::H256; 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 sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup, BadOrigin}, testing::Header};
use frame_system::EnsureSignedBy; use frame_system::EnsureSignedBy;
@@ -293,9 +291,6 @@ mod tests {
pub enum Origin for Test where system = frame_system {} 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)] #[derive(Clone, Eq, PartialEq)]
pub struct Test; pub struct Test;
parameter_types! { parameter_types! {
@@ -381,8 +376,6 @@ mod tests {
type Membership = Module<Test>; type Membership = Module<Test>;
// This function basically just builds a genesis storage key/value store according to
// our desired mockup.
fn new_test_ext() -> sp_io::TestExternalities { fn new_test_ext() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap(); let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
// We use default for brevity, but you can configure as desired if needed. // We use default for brevity, but you can configure as desired if needed.
-8
View File
@@ -244,8 +244,6 @@ mod tests {
}; };
use sp_core::H256; use sp_core::H256;
use frame_system::EnsureSignedBy; 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::{ use sp_runtime::{
Perbill, testing::Header, traits::{BlakeTwo256, IdentityLookup, BadOrigin}, Perbill, testing::Header, traits::{BlakeTwo256, IdentityLookup, BadOrigin},
}; };
@@ -254,9 +252,6 @@ mod tests {
pub enum Origin for Test where system = frame_system {} 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)] #[derive(Clone, Eq, PartialEq)]
pub struct Test; pub struct Test;
parameter_types! { parameter_types! {
@@ -324,11 +319,8 @@ mod tests {
type Balances = pallet_balances::Module<Test>; type Balances = pallet_balances::Module<Test>;
type Nicks = Module<Test>; type Nicks = Module<Test>;
// This function basically just builds a genesis storage key/value store according to
// our desired mockup.
fn new_test_ext() -> sp_io::TestExternalities { fn new_test_ext() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap(); let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
// We use default for brevity, but you can configure as desired if needed.
pallet_balances::GenesisConfig::<Test> { pallet_balances::GenesisConfig::<Test> {
balances: vec![ balances: vec![
(1, 10), (1, 10),
-5
View File
@@ -25,8 +25,6 @@ use frame_support::{
traits::{OnInitialize, OnFinalize}, traits::{OnInitialize, OnFinalize},
}; };
use sp_core::H256; 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::{ use sp_runtime::{
Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header, 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)] #[derive(Clone, Eq, PartialEq)]
pub struct Test; pub struct Test;
-7
View File
@@ -556,8 +556,6 @@ mod tests {
weights::constants::RocksDbWeight, weights::constants::RocksDbWeight,
}; };
use sp_core::H256; 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::{ use sp_runtime::{
Perbill, Perbill,
testing::Header, 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)] #[derive(Clone, Eq, PartialEq)]
pub struct Test; pub struct Test;
parameter_types! { parameter_types! {
@@ -699,8 +694,6 @@ mod tests {
type Logger = logger::Module<Test>; type Logger = logger::Module<Test>;
type Scheduler = Module<Test>; type Scheduler = Module<Test>;
// This function basically just builds a genesis storage key/value store according to
// our desired mockup.
pub fn new_test_ext() -> sp_io::TestExternalities { pub fn new_test_ext() -> sp_io::TestExternalities {
let t = system::GenesisConfig::default().build_storage::<Test>().unwrap(); let t = system::GenesisConfig::default().build_storage::<Test>().unwrap();
t.into() t.into()
-8
View File
@@ -22,8 +22,6 @@ use super::*;
use std::cell::RefCell; use std::cell::RefCell;
use frame_support::{impl_outer_origin, parameter_types, weights::Weight, ord_parameter_types}; use frame_support::{impl_outer_origin, parameter_types, weights::Weight, ord_parameter_types};
use sp_core::H256; 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::{ use sp_runtime::{
Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header, Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header,
}; };
@@ -33,9 +31,6 @@ impl_outer_origin! {
pub enum Origin for Test where system = frame_system {} 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)] #[derive(Clone, Eq, PartialEq)]
pub struct Test; pub struct Test;
parameter_types! { parameter_types! {
@@ -133,11 +128,8 @@ impl Trait for Test {
type System = frame_system::Module<Test>; type System = frame_system::Module<Test>;
type Balances = pallet_balances::Module<Test>; type Balances = pallet_balances::Module<Test>;
// This function basically just builds a genesis storage key/value store according to
// our desired mockup.
pub fn new_test_ext() -> sp_io::TestExternalities { pub fn new_test_ext() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap(); let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
// We use default for brevity, but you can configure as desired if needed.
pallet_balances::GenesisConfig::<Test> { pallet_balances::GenesisConfig::<Test> {
balances: vec![ balances: vec![
(5, 500_000), (5, 500_000),
-5
View File
@@ -23,8 +23,6 @@ use frame_support::{
impl_outer_origin, parameter_types, ord_parameter_types, traits::{OnInitialize, OnFinalize} impl_outer_origin, parameter_types, ord_parameter_types, traits::{OnInitialize, OnFinalize}
}; };
use sp_core::H256; 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::{ use sp_runtime::{
Perbill, Perbill,
testing::Header, testing::Header,
@@ -36,9 +34,6 @@ impl_outer_origin! {
pub enum Origin for Test {} 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)] #[derive(Clone, Eq, PartialEq)]
pub struct Test; pub struct Test;
parameter_types! { parameter_types! {
-2
View File
@@ -23,8 +23,6 @@ use frame_support::{
weights::Weight, weights::Weight,
}; };
use sp_core::H256; 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_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
use sp_io; use sp_io;
use crate as sudo; use crate as sudo;
-5
View File
@@ -416,8 +416,6 @@ mod tests {
traits::Get traits::Get
}; };
use sp_core::H256; 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::{ use sp_runtime::{
Perbill, Perbill,
testing::Header, testing::Header,
@@ -429,9 +427,6 @@ mod tests {
pub enum Origin for Test where system = frame_system {} 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)] #[derive(Clone, Eq, PartialEq)]
pub struct Test; pub struct Test;
parameter_types! { parameter_types! {