Skip to content

Commit

Permalink
fix(kreivo-runtime): use specific CreateOrigin for runtime benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
pandres95 committed Jun 25, 2024
1 parent fc6da53 commit d05d4fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion runtime/kreivo/src/communities/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use super::*;

use frame_support::traits::TryMapSuccess;
use frame_system::{EnsureNever, EnsureRootWithSuccess, EnsureSigned};
#[cfg(not(feature = "runtime-benchmarks"))]
use frame_system::EnsureNever;
use frame_system::{EnsureRootWithSuccess, EnsureSigned};
use pallet_communities::origin::{EnsureCommunity, EnsureSignedPays};
use sp_runtime::{morph_types, traits::AccountIdConversion};
use virto_common::{CommunityId, MembershipId};
Expand Down Expand Up @@ -54,7 +56,10 @@ type AnyoneElsePays = EnsureSignedPays<Runtime, CommunityDepositAmount, Treasury

impl pallet_communities::Config for Runtime {
type CommunityId = CommunityId;
#[cfg(not(feature = "runtime-benchmarks"))]
type CreateOrigin = EnsureNever<CreationPayment>;
#[cfg(feature = "runtime-benchmarks")]
type CreateOrigin = RootCreatesCommunitiesForFree;
type AdminOrigin = EitherOf<EnsureCommunity<Self>, EnsureCommunityAccount>;
type MemberMgmtOrigin = EitherOf<EnsureCommunity<Self>, EnsureCommunityAccount>;
type MemberMgmt = CommunityMemberships;
Expand Down

0 comments on commit d05d4fc

Please sign in to comment.