# Description
This PR removes redundant type definition from test definition config
implementations like
```
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type A = A;
...
}
```
This changes avoid redundancies in the code as the macro `derive_impl`
defines the relevant types. To implement the changes, it was a simple
fact of running tests and making sure that the tests would still run
while the definition would be removed.
Closes #3237
As a note, here is a brief account of things done from the Issue's
description statement
```
alliance migrate alliance, fast-unstake and bags list to use derive-impl #1636
asset-conversion DONE
asset-rate DONE
assets DONE
atomic-swap DONE
aura DONE
authority-discovery DONE
authorship migrate babe and authorship to use derive-impl #1790
babe migrate babe and authorship to use derive-impl #1790
bags-list migrate alliance, fast-unstake and bags list to use derive-impl #1636
balances DONE
beefy NOTHING TO DO --- also noted this error without failing tests Feb 13 13:49:08.941 ERROR runtime::timestamp: `pallet_timestamp::UnixTime::now` is called at genesis, invalid value returned: 0
beefy-mmr NOTHING TO DO
bounties DONE
child-bounties DONE
collective DONE
contracts DONE
conviction-voting DONE
core-fellowship NOTHING TO DO
democracy DONE
election-provider-multi-phase NOTHING TO DO
elections-phragmen DONE
executive NOTHING TO DO
fast-unstake migrate alliance, fast-unstake and bags list to use derive-impl #1636
glutton DONE
grandpa DONE
identity DONE
im-online NOTHING TO DO
indices Refactor indices pallet #1789
insecure-randomness-collective-flip DONE
lottery DONE
membership DONE
merkle-mountain-range NOTHING TO DO
message-queue DONE
multisig add frame_system::DefaultConfig to individual pallet DefaultConfigs substrate#14453
nft-fractionalization DONE
nfts DONE
nicks Refactor pallet-state-trie-migration to fungible::* traits #1801 NOT IN REPO
nis DONE
node-authorization DONE
nomination-pools NOTHING TO DO -- ONLY impl for Runtime
offences DELETED EVERYTHING -- IS THAT CORRECT??
preimage DONE
proxy add frame_system::DefaultConfig to individual pallet DefaultConfigs substrate#14453
ranked-collective NOTHING TO DO
recovery DONE
referenda DONE
remark DONE
root-offences DONE
root-testing NOTHING TO DO
salary NOTHING TO DO
scheduler DONE
scored-pool DONE
session DONE -- substrate/frame/session/benchmarking/src/mock.rs untouched
society NOTHING TO DO
staking DONE
staking-bags-benchmarks NOT IN REPO
state-trie-migration NOTHING TO DO
statement DONE
sudo DONE
system DONE
timestamp DONE
tips DONE
transaction-payment NOTHING TO DO
transaction-storage NOTHING TO DO
treasury DONE
try-runtime NOTHING TO DO -- no specific mention of 'for Test'
uniques DONE
utility DONE
vesting DONE
whitelist DONE
```
---------
Co-authored-by: command-bot <>
Co-authored-by: gupnik <nikhilgupta.iitk@gmail.com>
Scored Pool Module
The module maintains a scored membership pool. Each entity in the
pool can be attributed a Score. From this pool a set Members
is constructed. This set contains the MemberCount highest
scoring entities. Unscored entities are never part of Members.
If an entity wants to be part of the pool a deposit is required. The deposit is returned when the entity withdraws or when it is removed by an entity with the appropriate authority.
Every Period blocks the set of Members is refreshed from the
highest scoring members in the pool and, no matter if changes
occurred, T::MembershipChanged::set_members_sorted is invoked.
On first load T::MembershipInitialized::initialize_members is
invoked with the initial Members set.
It is possible to withdraw candidacy/resign your membership at any
time. If an entity is currently a member, this results in removal
from the Pool and Members; the entity is immediately replaced
by the next highest scoring candidate in the pool, if available.
Interface
Public Functions
submit_candidacy- Submit candidacy to become a member. Requires a deposit.withdraw_candidacy- Withdraw candidacy. Deposit is returned.score- Attribute a quantitative score to an entity.kick- Remove an entity from the pool and members. Deposit is returned.change_member_count- Changes the amount of candidates taken intoMembers.
Usage
use pallet_scored_pool::{self as scored_pool};
#[frame_support::pallet]
pub mod pallet {
use super::*;
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pallet::config]
pub trait Config: frame_system::Config + scored_pool::Config {}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
pub fn candidate(origin: OriginFor<T>) -> DispatchResult {
let who = ensure_signed(origin)?;
let _ = <scored_pool::Pallet<T>>::submit_candidacy(
T::RuntimeOrigin::from(Some(who.clone()).into())
);
Ok(())
}
}
}
Dependencies
This module depends on the System module.
License: Apache-2.0