Skip to content
Snippets Groups Projects
Unverified Commit e88b9a4b authored by bgallois's avatar bgallois
Browse files

move MembersCount

parent 40404150
No related branches found
No related tags found
1 merge request!286Refactore Runtime handlers and providers
Pipeline #38572 passed
......@@ -176,8 +176,6 @@ macro_rules! pallets_config {
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
}
pub struct OnChargeTransaction;
parameter_types! {
pub Target: Perquintill = Perquintill::from_percent(25);
pub MaxMultiplier: sp_runtime::FixedU128 = 10.into();
......@@ -411,19 +409,12 @@ macro_rules! pallets_config {
// UNIVERSAL DIVIDEND //
pub struct MembersCount;
impl frame_support::pallet_prelude::Get<Balance> for MembersCount {
fn get() -> Balance {
<Membership as sp_membership::traits::MembersCount>::members_count() as Balance
}
}
impl pallet_universal_dividend::Config for Runtime {
type Currency = Balances;
#[cfg(feature = "runtime-benchmarks")]
type IdtyAttr = Identity;
type MaxPastReeval = frame_support::traits::ConstU32<160>;
type MembersCount = MembersCount;
type MembersCount = common_runtime::providers::MembersCount<Membership>;
type MembersStorage = common_runtime::providers::UdMembersStorage<Runtime>;
type MomentIntoBalance = sp_runtime::traits::ConvertInto;
type RuntimeEvent = RuntimeEvent;
......
......@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
use crate::{entities::IdtyData, AccountId, IdtyIndex};
use crate::{entities::IdtyData, AccountId, Balance, IdtyIndex};
use core::marker::PhantomData;
use pallet_universal_dividend::FirstEligibleUd;
......@@ -116,3 +116,13 @@ macro_rules! impl_benchmark_setup_handler {
#[cfg(feature = "runtime-benchmarks")]
impl_benchmark_setup_handler!(pallet_membership::SetupBenchmark<<T as pallet_identity::Config>::IdtyIndex, T::AccountId>);
pub struct MembersCount<T>(PhantomData<T>);
impl<T> frame_support::pallet_prelude::Get<Balance> for MembersCount<T>
where
T: sp_membership::traits::MembersCount,
{
fn get() -> Balance {
T::members_count() as Balance
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment