Skip to content

Commit

Permalink
Add Pays::No on success for spaces sudo calls
Browse files Browse the repository at this point in the history
  • Loading branch information
F3Joule committed Jul 28, 2022
1 parent 3ea051a commit b32ac8f
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions pallets/spaces/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,11 @@ pub mod pallet {
Ok(())
}

#[pallet::weight(1_000_000 + T::DbWeight::get().reads_writes(1, 3))]
#[pallet::weight((
1_000_000 + T::DbWeight::get().reads_writes(1, 3),
DispatchClass::Operational,
Pays::Yes,
))]
pub fn force_create_space(
origin: OriginFor<T>,
space_id: SpaceId,
Expand All @@ -318,7 +322,7 @@ pub mod pallet {
content: Content,
hidden: bool,
permissions_opt: Option<SpacePermissions>,
) -> DispatchResult {
) -> DispatchResultWithPostInfo {
ensure_root(origin)?;

let permissions =
Expand Down Expand Up @@ -347,14 +351,18 @@ pub mod pallet {

Self::deposit_event(Event::SpaceCreated(owner, space_id));

Ok(())
Ok(Pays::No.into())
}

#[pallet::weight(10_000 + T::DbWeight::get().writes(1))]
pub fn force_set_next_space_id(origin: OriginFor<T>, space_id: SpaceId) -> DispatchResult {
#[pallet::weight((
10_000 + T::DbWeight::get().writes(1),
DispatchClass::Operational,
Pays::Yes,
))]
pub fn force_set_next_space_id(origin: OriginFor<T>, space_id: SpaceId) -> DispatchResultWithPostInfo {
ensure_root(origin)?;
NextSpaceId::<T>::put(space_id);
Ok(())
Ok(Pays::No.into())
}
}

Expand Down

0 comments on commit b32ac8f

Please sign in to comment.