From a92a6e11696670496fff11540ecc55b185899e42 Mon Sep 17 00:00:00 2001 From: Mateusz Nowakowski Date: Tue, 10 Dec 2024 14:41:24 +0100 Subject: [PATCH] minimal set of changes to disable sequencer registration for non sudo users --- pallets/sequencer-staking/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pallets/sequencer-staking/src/lib.rs b/pallets/sequencer-staking/src/lib.rs index 53f66795f..d4bda257b 100644 --- a/pallets/sequencer-staking/src/lib.rs +++ b/pallets/sequencer-staking/src/lib.rs @@ -380,8 +380,9 @@ pub mod pallet { stake_amount: BalanceOf, alias_account: Option, stake_action: StakeAction, + sender: T::AccountId, ) -> DispatchResultWithPostInfo { - let sender = ensure_signed(origin)?; + let _ = ensure_root(origin)?; ensure!( !AliasAccountInUse::::contains_key(sender.clone()), @@ -468,8 +469,9 @@ pub mod pallet { pub fn rejoin_active_sequencers( origin: OriginFor, chain: T::ChainId, + sender: T::AccountId, ) -> DispatchResultWithPostInfo { - let sender = ensure_signed(origin)?; + let _ = ensure_root(origin)?; ensure!( !Self::is_active_sequencer(chain, &sender), Error::::SequencerAlreadyInActiveSet