From 450fbe366fdc81271f93843c199d97d5ca311c30 Mon Sep 17 00:00:00 2001 From: Tarek Mohamed Abdalla Date: Fri, 17 Feb 2023 09:01:26 +0200 Subject: [PATCH] formatting --- pallets/roles/src/benchmarking.rs | 4 +--- pallets/roles/src/lib.rs | 11 +++++++---- pallets/roles/src/mock.rs | 18 +++++++++--------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/pallets/roles/src/benchmarking.rs b/pallets/roles/src/benchmarking.rs index f6791d8b..2a20a73e 100644 --- a/pallets/roles/src/benchmarking.rs +++ b/pallets/roles/src/benchmarking.rs @@ -19,8 +19,7 @@ use subsocial_support::{ use super::*; fn get_dummy_space_id( - #[allow(unused_variables)] - origin: RawOrigin, + #[allow(unused_variables)] origin: RawOrigin, ) -> Result { cfg_if! { if #[cfg(test)] { @@ -49,7 +48,6 @@ fn get_caller_account() -> T::AccountId { } } - fn dummy_list_of_users(num_of_users: u32) -> Vec> { let mut users_to_grant = Vec::>::new(); diff --git a/pallets/roles/src/lib.rs b/pallets/roles/src/lib.rs index 0228dd06..5760932b 100644 --- a/pallets/roles/src/lib.rs +++ b/pallets/roles/src/lib.rs @@ -17,6 +17,7 @@ use scale_info::TypeInfo; use sp_runtime::RuntimeDebug; use sp_std::{collections::btree_set::BTreeSet, prelude::*}; +pub use pallet::*; use pallet_permissions::{ Pallet as Permissions, PermissionChecker, SpacePermission, SpacePermissionSet, }; @@ -25,12 +26,11 @@ use subsocial_support::{ traits::{IsAccountBlocked, IsContentBlocked, SpaceFollowsProvider, SpacePermissionsProvider}, Content, ModerationError, SpaceId, User, WhoAndWhenOf, }; +pub use types::*; -pub use pallet::*; pub mod functions; pub mod types; -pub use types::*; // pub mod rpc; #[cfg(test)] @@ -44,13 +44,16 @@ pub mod weights; #[frame_support::pallet] pub mod pallet { - use super::*; - use crate::weights::WeightInfo; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; + use pallet_permissions::SpacePermissionsInfoOf; use subsocial_support::{remove_from_vec, WhoAndWhen}; + use crate::weights::WeightInfo; + + use super::*; + #[pallet::config] pub trait Config: frame_system::Config + pallet_permissions::Config + pallet_timestamp::Config diff --git a/pallets/roles/src/mock.rs b/pallets/roles/src/mock.rs index ebab49b2..51b0638e 100644 --- a/pallets/roles/src/mock.rs +++ b/pallets/roles/src/mock.rs @@ -1,21 +1,21 @@ -use super::*; - -use sp_core::H256; -use sp_io::TestExternalities; -use sp_std::{collections::btree_set::BTreeSet, prelude::Vec}; - use frame_support::{ assert_ok, dispatch::{DispatchError, DispatchResult}, parameter_types, traits::{ConstU32, Everything}, }; +use sp_core::H256; +use sp_io::TestExternalities; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, }; +use sp_std::{collections::btree_set::BTreeSet, prelude::Vec}; -use pallet_permissions::{SpacePermission, SpacePermission as SP, SpacePermissions}; +use pallet_permissions::{ + default_permissions::DefaultSpacePermissions, SpacePermission, SpacePermission as SP, + SpacePermissions, +}; use subsocial_support::{ traits::{SpaceFollowsProvider, SpacePermissionsProvider as SpacePermissionsProviderT}, Content, SpaceId, SpacePermissionsInfo, User, @@ -23,6 +23,8 @@ use subsocial_support::{ use crate as roles; +use super::*; + type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; @@ -103,8 +105,6 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = (); } -use pallet_permissions::default_permissions::DefaultSpacePermissions; - impl pallet_permissions::Config for Test { type DefaultSpacePermissions = DefaultSpacePermissions; }