Skip to content

Commit

Permalink
chill_other takes stash
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Bulat committed Nov 27, 2023
1 parent cfa19c3 commit 9c5e772
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion substrate/frame/staking/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ benchmarks! {
)?;

let caller = whitelisted_caller();
}: _(RawOrigin::Signed(caller), controller)
}: _(RawOrigin::Signed(caller), stash.clone())
verify {
assert!(!T::VoterList::contains(&stash));
}
Expand Down
8 changes: 5 additions & 3 deletions substrate/frame/staking/src/pallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1764,11 +1764,13 @@ pub mod pallet {
/// who do not satisfy these requirements.
#[pallet::call_index(23)]
#[pallet::weight(T::WeightInfo::chill_other())]
pub fn chill_other(origin: OriginFor<T>, controller: T::AccountId) -> DispatchResult {
pub fn chill_other(origin: OriginFor<T>, stash: T::AccountId) -> DispatchResult {
// Anyone can call this function.
let caller = ensure_signed(origin)?;
let ledger = Self::ledger(Controller(controller.clone()))?;
let stash = ledger.stash;
let ledger = Self::ledger(Stash(stash.clone()))?;
let controller = ledger.controller()
.defensive_proof("ledger was fetched used the StakingInterface, so controller field must exist; qed.")
.ok_or(Error::<T>::NotController)?;

// In order for one user to chill another user, the following conditions must be met:
//
Expand Down

0 comments on commit 9c5e772

Please sign in to comment.