Bladeren bron

runtime: Remove exposed lock combinations.

Shamil Gadelshin 3 jaren geleden
bovenliggende
commit
c2958d5596
3 gewijzigde bestanden met toevoegingen van 2 en 28 verwijderingen
  1. 2 10
      runtime-modules/utility/src/lib.rs
  2. 0 9
      runtime-modules/utility/src/tests/mocks.rs
  3. 0 9
      runtime/src/lib.rs

+ 2 - 10
runtime-modules/utility/src/lib.rs

@@ -24,16 +24,15 @@ pub(crate) mod tests;
 
 mod benchmarking;
 
-use common::{working_group::WorkingGroup, AllowedLockCombinationProvider, BalanceKind};
+use common::{working_group::WorkingGroup, BalanceKind};
 use council::Module as Council;
-use frame_support::traits::{Currency, Get, LockIdentifier};
+use frame_support::traits::{Currency, Get};
 use frame_support::weights::{DispatchClass, Weight};
 use frame_support::{decl_error, decl_event, decl_module, ensure, print};
 use frame_system::{ensure_root, ensure_signed};
 use sp_arithmetic::traits::Zero;
 use sp_runtime::traits::Saturating;
 use sp_runtime::SaturatedConversion;
-use sp_std::collections::btree_set::BTreeSet;
 use sp_std::vec::Vec;
 
 type BalanceOf<T> = <T as balances::Trait>::Balance;
@@ -50,9 +49,6 @@ pub trait Trait: frame_system::Trait + balances::Trait + council::Trait {
 
     /// Weight information for extrinsics in this pallet.
     type WeightInfo: WeightInfo;
-
-    /// Exposes allowed lock combinations from the runtime level.
-    type AllowedLockCombinationProvider: AllowedLockCombinationProvider;
 }
 
 /// Utility WeightInfo.
@@ -119,10 +115,6 @@ decl_module! {
         /// Predefined errors
         type Error = Error<T>;
 
-        /// Exposes allowed lock combinations from the runtime level.
-        const AllowedLockCombinations: BTreeSet<(LockIdentifier, LockIdentifier)> =
-            T::AllowedLockCombinationProvider::get_allowed_lock_combinations();
-
         /// Signal proposal extrinsic. Should be used as callable object to pass to the `engine` module.
         ///
         /// <weight>

+ 0 - 9
runtime-modules/utility/src/tests/mocks.rs

@@ -206,15 +206,6 @@ impl Trait for Test {
     fn set_working_group_budget(working_group: WorkingGroup, budget: BalanceOf<Test>) {
         call_wg!(working_group<Test>, set_budget, budget)
     }
-
-    type AllowedLockCombinationProvider = AllowedLockCombinationProvider;
-}
-
-pub struct AllowedLockCombinationProvider;
-impl common::AllowedLockCombinationProvider for AllowedLockCombinationProvider {
-    fn get_allowed_lock_combinations() -> BTreeSet<(LockIdentifier, LockIdentifier)> {
-        Default::default()
-    }
 }
 
 impl WeightInfo for () {

+ 0 - 9
runtime/src/lib.rs

@@ -981,18 +981,9 @@ impl proposals_discussion::Trait for Runtime {
     type PostLifeTime = ForumPostLifeTime;
 }
 
-pub struct LockCombinationProvider;
-impl AllowedLockCombinationProvider for LockCombinationProvider {
-    fn get_allowed_lock_combinations() -> BTreeSet<(LockIdentifier, LockIdentifier)> {
-        ALLOWED_LOCK_COMBINATIONS.clone()
-    }
-}
-
 impl joystream_utility::Trait for Runtime {
     type Event = Event;
 
-    type AllowedLockCombinationProvider = LockCombinationProvider;
-
     type WeightInfo = weights::joystream_utility::WeightInfo;
 
     fn get_working_group_budget(working_group: WorkingGroup) -> Balance {