Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add Chilled event to staking chill extrinsics #9250

Merged
6 commits merged into from
Jul 5, 2021
Merged

Conversation

emostov
Copy link
Contributor

@emostov emostov commented Jul 1, 2021

closes #9242

This PR adds a Chilled(stash_account) event to chill_stash which is the underlying call used by the chill and chill_other extrinsic.

@emostov emostov added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Jul 1, 2021
@emostov emostov requested review from shawntabrizi and gui1117 July 1, 2021 14:20
@emostov emostov requested a review from kianenigma as a code owner July 1, 2021 14:20
@emostov emostov requested a review from coriolinus July 1, 2021 14:21
@emostov
Copy link
Contributor Author

emostov commented Jul 1, 2021

 left: `Event::Staking(Event::Chilled(14792786684846458762))`,
right: `Event::Staking(Event::Slash(14792786684846458762, 7000))`: Mismatch at: 0. Mismatching length. Got: 1803, expected: 1703', frame/offences/benchmarking/src/lib.rs:228:9

I need to fix this; error from tests in ci

@emostov
Copy link
Contributor Author

emostov commented Jul 1, 2021

Exact line of error:

assert_eq!(a, b, "Mismatch at: {}. {}", idx, length_mismatch);

Chilled events probs need to get added somewhere here:

let mut slash_events = raw_offenders.into_iter()
.flat_map(|offender| {
core::iter::once(offender.stash).chain(offender.nominator_stashes.into_iter())
})
.map(|stash| <T as StakingConfig>::Event::from(
StakingEvent::<T>::Slash(stash, BalanceOf::<T>::from(slash_amount))
))
.collect::<Vec<_>>();
let reward_events = reporters.into_iter()
.flat_map(|reporter| vec![
frame_system::Event::<T>::NewAccount(reporter.clone()).into(),
<T as BalancesConfig>::Event::from(
pallet_balances::Event::<T>::Endowed(reporter, (reward_amount / r).into())
).into()
]);
// rewards are applied after first offender and it's nominators
let slash_rest = slash_events.split_off(1 + n as usize);

@emostov emostov marked this pull request as draft July 4, 2021 22:25
@emostov emostov marked this pull request as ready for review July 4, 2021 22:26
@emostov
Copy link
Contributor Author

emostov commented Jul 5, 2021

bot merge

@ghost
Copy link

ghost commented Jul 5, 2021

Trying merge.

@ghost ghost merged commit fc49802 into master Jul 5, 2021
@ghost ghost deleted the zeke-staking-chill-event branch July 5, 2021 04:39
ordian added a commit that referenced this pull request Jul 5, 2021
* master:
  Bump linregress due to security vulnerability (#9262)
  pallet macro: always generate storage info on pallet struct (#9246)
  Less duplication in test code (#9270)
  Add `Chilled` event to staking chill extrinsics (#9250)
dvdplm added a commit that referenced this pull request Jul 6, 2021
* master:
  fix staking version in genesis (#9280)
  fix storage info for decl_storage (#9274)
  Authority_discovery: expose assimilate_storage with GenesisBuild (#9279)
  Update CODEOWNERS (#9278)
  Remove in-tree `max-encoded-len` and use the new SCALE codec crate instead (#9163)
  bump a bunch of deps in parity-common (#9263)
  Bump linregress due to security vulnerability (#9262)
  pallet macro: always generate storage info on pallet struct (#9246)
  Less duplication in test code (#9270)
  Add `Chilled` event to staking chill extrinsics (#9250)
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Explore adding an event for the staking pallet's chill_other
4 participants