-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
This rewrites the `generate_storage_alias!` declarative macro as proc-macro attribute. While doing this the name is changed to `storage_alias`. The prefix can now also be the name of a pallet. This makes storage aliases work in migrations for all kind of chains and not just for the ones that use predefined prefixes.
…into gav-society-v2
…into gav-society-v2
Rebased |
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, though wondering why the later call indexes don't have complexity notation like the earlier ones do? I find that sort of thing really helpful when reviewing an unfamiliar function/algorithm/procedure so would be cool if every call had complexity notation IMO
/// pending payments, and elevate them from rank 0 to rank 1. | ||
#[pallet::call_index(7)] | ||
#[pallet::weight(T::WeightInfo::waive_repay())] | ||
pub fn waive_repay(origin: OriginFor<T>, amount: BalanceOf<T, I>) -> DispatchResult { |
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.
Could we get complexity notation for this one and later ones as well since we have it on the earlier calls?
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.
Or the other way, I find most of these complexity/weight comments pretty useless. Even if they should exist, it should be in the benchmarking code, not in the call documentation (where end users will see it through metadata).
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.
Indeed - they're actually mostly old and incorrect. As can be seen from the weight calls, they're all O(1) now. The only caveat to that is that BoundedVec
s in storage items must generally be full to ensure the maximum possible weight is determined. But I don't think that's especially useful to have in the function docs since it's a) fairly obvious; and b) as closely related to the storage item itself as it is the function.
bot merge |
Error: "Check reviews" status is not passing for paritytech/polkadot#7356 |
* New Society * More logic drafting * More work * Building * Some tests * Fixes * Improvements to the voting process * More tests * Test number 20 * Tests * 30 tests * Another test] * All tests enabled * Minor stuff * generate_storage_alias: Rewrite as proc macro attribute This rewrites the `generate_storage_alias!` declarative macro as proc-macro attribute. While doing this the name is changed to `storage_alias`. The prefix can now also be the name of a pallet. This makes storage aliases work in migrations for all kind of chains and not just for the ones that use predefined prefixes. * Maintenance operations don't pay fee * Fix compilation and FMT * Moare fixes * Migrations * Fix tests and add migration testing * Introduce lazy-cleanup and avoid unbounded prefix removal * Fixes * Fixes * [WIP][Society] Adding benchmarking to the v2. (#11776) * [Society] Adding benchmarking to the v2. * [Society] Code review. * [Society] Better code. * Using clear() + clear_prefix() and adding more tests. * Benchmarking again... * Fix Cargo * Fixes * Fixes * Spelling * Fix benchmarks * Another fix * Remove println --------- Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Artur Gontijo <[email protected]>
* New Society * More logic drafting * More work * Building * Some tests * Fixes * Improvements to the voting process * More tests * Test number 20 * Tests * 30 tests * Another test] * All tests enabled * Minor stuff * generate_storage_alias: Rewrite as proc macro attribute This rewrites the `generate_storage_alias!` declarative macro as proc-macro attribute. While doing this the name is changed to `storage_alias`. The prefix can now also be the name of a pallet. This makes storage aliases work in migrations for all kind of chains and not just for the ones that use predefined prefixes. * Maintenance operations don't pay fee * Fix compilation and FMT * Moare fixes * Migrations * Fix tests and add migration testing * Introduce lazy-cleanup and avoid unbounded prefix removal * Fixes * Fixes * [WIP][Society] Adding benchmarking to the v2. (paritytech#11776) * [Society] Adding benchmarking to the v2. * [Society] Code review. * [Society] Better code. * Using clear() + clear_prefix() and adding more tests. * Benchmarking again... * Fix Cargo * Fixes * Fixes * Spelling * Fix benchmarks * Another fix * Remove println --------- Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Artur Gontijo <[email protected]>
Closes #10465
Polkadot companion: paritytech/polkadot#7356
Substantial changes to Society:
Members
is no longer aVec
item).BoundedVec
.Candiate voting:
Member challenges:
New dispatchables to be integrated in the UI (CC @jacogr):
waive_repay
: Attempt to clear any payouts and promote the member to rank 1. This transfers the given amount of the sender's balance back into the Society. This will only work if the given amount is at least as great as the member's debt to the society.punish_skeptic
: Callable by a candidate after the voting period has ended to ensure that the Skeptic is punished for inaction or invalid voting.claim_membership
: Callable by a candidate to claim their membership after the voting period has ended and when there is a clear result of approval.bestow_membership
: Callable by the Founder to elevate a candidate to member after the voting period has ended and when there is not a clear result of rejection.kick_candidate
: Callable by the Founder to reject a candidate after the voting period has ended and when there is not a clear result of approval. The candidate loses their deposit.resign_candidacy
: Callable by a candidate to end their candidacy. The candidate loses their deposit.drop_candidate
: Callable by anyone to end a candidate's candidacy after the intake period following the one in which the candidate applied and only when there is a clear result of rejection. The candidate loses their deposit.TODO:
remove_all(None)
calls are bounded.