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

nomination-pools: Add era to Unbonded event #11749

Closed
wirednkod opened this issue Jun 27, 2022 · 4 comments · Fixed by #11770
Closed

nomination-pools: Add era to Unbonded event #11749

wirednkod opened this issue Jun 27, 2022 · 4 comments · Fixed by #11770
Labels
J0-enhancement An additional feature request. U2-some_time_soon Issue is worth doing soon. Z0-trivial Writing the issue is of the same difficulty as patching the code. Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.

Comments

@wirednkod
Copy link
Contributor

In nomination-pools tests that test cases that has Era as part of the case, it is a good idea to add in the assert_eq! of pool_events_since_last_call the era as part of the eq.
E.g. in the partial_unbond_max_chunks and this assert_eq! could have something like:

	Event::Unbonded { member: 20, pool_id: 1, balance: 3, points: 3, era: 1 },
	Event::Unbonded { member: 20, pool_id: 1, balance: 1, points: 1, era: 2 }
@wirednkod wirednkod self-assigned this Jun 27, 2022
@wirednkod wirednkod added U4-some_day_maybe Issue might be worth doing eventually. U2-some_time_soon Issue is worth doing soon. and removed U4-some_day_maybe Issue might be worth doing eventually. labels Jun 27, 2022
@kianenigma kianenigma added J0-enhancement An additional feature request. Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder labels Jun 27, 2022
@hirschenberger
Copy link
Contributor

hirschenberger commented Jul 1, 2022

So an EraIndex has to be added to Event::Unbonded. Does it make sense to add it to other events as well?

@kianenigma
Copy link
Contributor

Which other events you have in mind @hirschenberger? It should be events that are era-related. Unbonding has a clear link to eras, because you will be unbnded 28 eras after. For, bonding for example doesn't have any significant semantical relation.

@hirschenberger
Copy link
Contributor

It was just a question, I had no specific events in mind. I see that UnbondingPollSlashed already has an Era field, so I can add it to Unbonded and extend the tests.

@kianenigma kianenigma changed the title Improve Era-related Nomination-pools pallet, tests nomination-pools: Add era to Unbonded event Jul 1, 2022
@kianenigma
Copy link
Contributor

Updated the title to clarify what is meant :)

@kianenigma kianenigma added Z0-trivial Writing the issue is of the same difficulty as patching the code. and removed Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder labels Jul 1, 2022
hirschenberger added a commit to hirschenberger/substrate that referenced this issue Jul 4, 2022
@wirednkod wirednkod removed their assignment Jul 20, 2022
paritytech-processbot bot pushed a commit that referenced this issue Jul 25, 2022
* Add era to `Unbonded` event

fixes #11749

* Fix missing tests

* Add comment for `era` field in `Unbonded` struct.

Co-authored-by: parity-processbot <>
DaviRain-Su pushed a commit to octopus-network/substrate that referenced this issue Aug 23, 2022
* Add era to `Unbonded` event

fixes paritytech#11749

* Fix missing tests

* Add comment for `era` field in `Unbonded` struct.

Co-authored-by: parity-processbot <>
ark0f pushed a commit to gear-tech/substrate that referenced this issue Feb 27, 2023
* Add era to `Unbonded` event

fixes paritytech#11749

* Fix missing tests

* Add comment for `era` field in `Unbonded` struct.

Co-authored-by: parity-processbot <>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request. U2-some_time_soon Issue is worth doing soon. Z0-trivial Writing the issue is of the same difficulty as patching the code. Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Projects
No open projects
3 participants