-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Alliance pallet: add force_set_members instead of init_members function #11997
Alliance pallet: add force_set_members instead of init_members function #11997
Conversation
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.
Looks good except a few questions and doc suggestions.
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
This reverts commit b654d68.
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
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.
Would consider changing the event MembersInitialized
to MembershipSet
, but otherwise looks good.
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
/cmd queue -c bench-bot $ pallet dev pallet_alliance |
@muharem https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1748367 was started for your command Comment |
@muharem Command |
/cmd queue -c bench-bot $ pallet dev pallet_alliance |
@muharem https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1796091 was started for your command Comment |
@muharem Command |
if founders.is_empty() { | ||
ensure!(fellows.is_empty() && allies.is_empty(), Error::<T, I>::FoundersMissing); | ||
// new members set not provided. | ||
return Ok(()) |
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.
I will return an actual weight here, and below. It can vary a lot from the assumed one.
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.
Just a few nits
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
/cmd queue -c bench-bot $ pallet dev pallet_alliance |
@muharem https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1797264 was started for your command Comment |
@muharem Command |
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.
LGTM. Could break out disband alliance into it's own dispatchable function as a later PR but not essential.
bot merge |
Error: Github API says paritytech/cumulus#1551 is not mergeable |
bot merge |
…on (paritytech#11997) * Alliance pallet: add force_set_members instead of init_members function * benchmark with witness data * remove invalid limit for clear * Apply suggestions from code review Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Revert "remove invalid limit for clear" This reverts commit b654d68. * compile constructor only for test * Update comments for force_set_members Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * ".git/.scripts/bench-bot.sh" pallet dev pallet_alliance * benchmark - founders count range * Revert "benchmark - founders count range" This reverts commit 744178f. * witness members count instead votable members count * update the doc * use decode_len for witness data checks * change witness data member count to voting member count; update clear limits * ".git/.scripts/bench-bot.sh" pallet dev pallet_alliance * merge master * fixes after merge master * revert to cb3e63 * disband alliance and return deposits * revert debug changes * weights * update docs * update test comments * Apply Joe suggestions from code review Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * rename event from AllianceDisband to AllianceDisbanded * ".git/.scripts/bench-bot.sh" pallet dev pallet_alliance Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by: command-bot <>
Fixes #11928
Root call
init_members
which is mean to initialize the alliance can be called only once. If an initial call had a mistake or the alliance lost the trust, there is no way to reset the alliance.In the PR we changing the name and behaviour of the
init_members
function. Insteadforce_set_members
function lets perform a root call on already initialized alliance, which will reset it and initialize new.Cumulus companion: paritytech/cumulus#1551