Skip to content
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
13 changes: 9 additions & 4 deletions substrate/frame/staking/src/pallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ pub mod pallet {
// (temporary) passive migration.
Self::ledger(StakingAccount::Stash(stash.clone())).map(|ledger| {
let controller = ledger.controller()
.defensive_proof("ledger was fetched used the StakingInterface, so controller field must exist; qed.")
.defensive_proof("ledger was fetched using StakingLedger, so controller field must exist; qed.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

.ok_or(Error::<T>::NotController)?;

if controller == stash {
Expand Down Expand Up @@ -1764,11 +1764,16 @@ 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 using StakingLedger, 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
Loading