-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include events for voting #4613
Merged
muharem
merged 9 commits into
paritytech:master
from
dharjeezy:dami/add-events-to-pallet-conviction-voting
Jul 24, 2024
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e112443
include event for voting
dharjeezy 30c830a
Merge branch 'master' into dami/add-events-to-pallet-conviction-voting
dharjeezy ac79e2c
pr doc
dharjeezy 122a1c0
Merge remote-tracking branch 'origin/dami/add-events-to-pallet-convic…
dharjeezy ac57717
Merge branch 'master' into dami/add-events-to-pallet-conviction-voting
dharjeezy 844199d
changes as requested
dharjeezy 1f21107
Merge remote-tracking branch 'origin/dami/add-events-to-pallet-convic…
dharjeezy f115f09
nit pr doc
dharjeezy b300966
Update prdoc/pr_4613.prdoc
dharjeezy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
title: "Include events for vote and remove vote" | ||
|
||
doc: | ||
- audience: Runtime User | ||
description: | | ||
Includes event for vote and remove_vote | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd mention what the fields are |
||
|
||
crates: | ||
- name: pallet-conviction-voting | ||
bump: patch | ||
dharjeezy marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -170,6 +170,10 @@ pub mod pallet { | |||||
Delegated(T::AccountId, T::AccountId), | ||||||
/// An \[account\] has cancelled a previous delegation operation. | ||||||
Undelegated(T::AccountId), | ||||||
/// An account that has voted | ||||||
VoteEnacted { who: T::AccountId, vote: AccountVote<BalanceOf<T, I>> }, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Enacted sounds to me more final. |
||||||
/// A vote that been removed | ||||||
VoteRemoved { who: T::AccountId, vote: AccountVote<BalanceOf<T, I>> }, | ||||||
} | ||||||
|
||||||
#[pallet::error] | ||||||
|
@@ -427,6 +431,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> { | |||||
// Extend the lock to `balance` (rather than setting it) since we don't know what | ||||||
// other votes are in place. | ||||||
Self::extend_lock(who, &class, vote.balance()); | ||||||
Self::deposit_event(Event::VoteEnacted { who: who.clone(), vote }); | ||||||
Ok(()) | ||||||
}) | ||||||
}) | ||||||
|
@@ -462,6 +467,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> { | |||||
if let Some(approve) = v.1.as_standard() { | ||||||
tally.reduce(approve, *delegations); | ||||||
} | ||||||
Self::deposit_event(Event::VoteRemoved { who: who.clone(), vote: v.1 }); | ||||||
Ok(()) | ||||||
}, | ||||||
PollStatus::Completed(end, approved) => { | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise the CHANGELOG will read a bit weird.