Skip to content

Commit

Permalink
renaming MaxMembers... to MaxAccount...
Browse files Browse the repository at this point in the history
  • Loading branch information
gdnathan committed Jun 13, 2022
1 parent 950134f commit 00a9982
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub mod pallet {

/// The maximum number of account that can added or removed in a single call
#[pallet::constant]
type MaxMembersPerTransaction: Get<u32>;
type MaxAccountsPerTransaction: Get<u32>;

/// Weigths module
type WeightInfo: WeightInfo;
Expand Down Expand Up @@ -241,7 +241,7 @@ pub mod pallet {
#[pallet::weight(T::WeightInfo::create_supersig(members.len() as u32))]
pub fn create_supersig(
origin: OriginFor<T>,
members: BoundedVec<(T::AccountId, Role), T::MaxMembersPerTransaction>,
members: BoundedVec<(T::AccountId, Role), T::MaxAccountsPerTransaction>,
) -> DispatchResult {
let who = ensure_signed(origin)?;

Expand Down Expand Up @@ -447,7 +447,7 @@ pub mod pallet {
#[pallet::weight(T::WeightInfo::add_members(new_members.len() as u32))]
pub fn add_members(
origin: OriginFor<T>,
new_members: BoundedVec<(T::AccountId, Role), T::MaxMembersPerTransaction>,
new_members: BoundedVec<(T::AccountId, Role), T::MaxAccountsPerTransaction>,
) -> DispatchResult {
let supersig_account = ensure_signed(origin)?;
let supersig_id = Self::get_supersig_id_from_account(&supersig_account)?;
Expand Down Expand Up @@ -475,7 +475,7 @@ pub mod pallet {
#[pallet::weight(T::WeightInfo::remove_members(members_to_remove.len() as u32))]
pub fn remove_members(
origin: OriginFor<T>,
members_to_remove: BoundedVec<T::AccountId, T::MaxMembersPerTransaction>,
members_to_remove: BoundedVec<T::AccountId, T::MaxAccountsPerTransaction>,
) -> DispatchResult {
let supersig_account = ensure_signed(origin)?;
let supersig_id = Self::get_supersig_id_from_account(&supersig_account)?;
Expand Down Expand Up @@ -635,7 +635,7 @@ pub mod pallet {

fn internal_add_members(
supersig_id: SupersigId,
members: BoundedVec<(T::AccountId, Role), T::MaxMembersPerTransaction>,
members: BoundedVec<(T::AccountId, Role), T::MaxAccountsPerTransaction>,
) -> Result<Vec<(T::AccountId, Role)>, Error<T>> {
let mut added = Vec::new();

Expand All @@ -660,7 +660,7 @@ pub mod pallet {
#[transactional]
fn internal_remove_members(
supersig_id: SupersigId,
members: BoundedVec<T::AccountId, T::MaxMembersPerTransaction>,
members: BoundedVec<T::AccountId, T::MaxAccountsPerTransaction>,
) -> Result<Vec<T::AccountId>, pallet::Error<T>> {
let mut removed = Vec::new();

Expand Down
4 changes: 2 additions & 2 deletions src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ impl pallet_balances::Config for Test {
parameter_types! {
pub const SupersigPalletId: PalletId = PalletId(*b"id/susig");
pub const SupersigPreimageByteDeposit: Balance = 1000;
pub const MaxMembersPerTransaction: u32 = 4;
pub const MaxAccountsPerTransaction: u32 = 4;
}

impl pallet_supersig::Config for Test {
type Call = Call;
type Currency = Balances;
type DepositPerByte = SupersigPreimageByteDeposit;
type Event = Event;
type MaxMembersPerTransaction = MaxMembersPerTransaction;
type MaxAccountsPerTransaction = MaxAccountsPerTransaction;
type PalletId = SupersigPalletId;
type WeightInfo = pallet_supersig::weights::SubstrateWeight<Test>;
}
Expand Down

0 comments on commit 00a9982

Please sign in to comment.