Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
TarekkMA committed Feb 17, 2023
1 parent a6b3919 commit 450fbe3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
4 changes: 1 addition & 3 deletions pallets/roles/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ use subsocial_support::{
use super::*;

fn get_dummy_space_id<T: Config + pallet_spaces::Config>(
#[allow(unused_variables)]
origin: RawOrigin<T::AccountId>,
#[allow(unused_variables)] origin: RawOrigin<T::AccountId>,
) -> Result<SpaceId, DispatchError> {
cfg_if! {
if #[cfg(test)] {
Expand Down Expand Up @@ -49,7 +48,6 @@ fn get_caller_account<T: Config>() -> T::AccountId {
}
}


fn dummy_list_of_users<T: Config>(num_of_users: u32) -> Vec<User<T::AccountId>> {
let mut users_to_grant = Vec::<User<T::AccountId>>::new();

Expand Down
11 changes: 7 additions & 4 deletions pallets/roles/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand All @@ -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)]
Expand All @@ -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
Expand Down
18 changes: 9 additions & 9 deletions pallets/roles/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
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,
};

use crate as roles;

use super::*;

type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 450fbe3

Please sign in to comment.