Alliance pallet: add force_set_members instead of init_members function (#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 dba54e3071b63bfea908087aef213f4640e3ccbf.

* 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 aad16796f8dfed48079fb7f587b8f5b59382cda6.

* 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 <>
This commit is contained in:
Muharem Ismailov
2022-09-01 12:31:32 +02:00
committed by GitHub
parent 7f1b9a937a
commit d8e951758c
8 changed files with 711 additions and 181 deletions
+11 -1
View File
@@ -18,7 +18,8 @@
//! Some configurable implementations as associated type for the substrate runtime.
use crate::{
AccountId, AllianceMotion, Assets, Authorship, Balances, Call, Hash, NegativeImbalance, Runtime,
AccountId, AllianceCollective, AllianceMotion, Assets, Authorship, Balances, Call, Hash,
NegativeImbalance, Runtime,
};
use frame_support::{
pallet_prelude::*,
@@ -112,6 +113,15 @@ impl ProposalProvider<AccountId, Hash, Call> for AllianceProposalProvider {
fn proposal_of(proposal_hash: Hash) -> Option<Call> {
AllianceMotion::proposal_of(proposal_hash)
}
fn proposals() -> Vec<Hash> {
AllianceMotion::proposals().into_inner()
}
fn proposals_count() -> u32 {
pallet_collective::Proposals::<Runtime, AllianceCollective>::decode_len().unwrap_or(0)
as u32
}
}
#[cfg(test)]