diff --git a/node/src/chain_spec/gdev.rs b/node/src/chain_spec/gdev.rs index 370da7b0b27b4054089196d3e4f56a7860c703d3..57a3e530613fd7dfc3ddf8d88160759711dc4427 100644 --- a/node/src/chain_spec/gdev.rs +++ b/node/src/chain_spec/gdev.rs @@ -74,8 +74,6 @@ fn get_parameters(parameters_from_file: &Option<GenesisParameters>) -> CommonPar universal_dividend_square_money_growth_rate: parameters::SquareMoneyGrowthRate::get(), universal_dividend_ud_creation_period: parameters_from_file.ud_creation_period, universal_dividend_ud_reeval_period: parameters_from_file.ud_reeval_period, - universal_dividend_units_per_ud: - <Runtime as pallet_universal_dividend::Config>::UnitsPerUd::get(), wot_first_issuable_on: parameters_from_file.wot_first_cert_issuable_on, wot_min_cert_for_membership: parameters_from_file.wot_min_cert_for_membership, wot_min_cert_for_create_idty_right: parameters_from_file.wot_min_cert_for_create_idty_right, diff --git a/node/src/chain_spec/gen_genesis_data.rs b/node/src/chain_spec/gen_genesis_data.rs index d87347c4409e6b729e01f6bb837f2dc8223676ef..28014f16eb177273c7d4fb103bd9783a9cef0aae 100644 --- a/node/src/chain_spec/gen_genesis_data.rs +++ b/node/src/chain_spec/gen_genesis_data.rs @@ -749,11 +749,6 @@ fn dump_genesis_info(info: GenesisInfo) { get_best_unit_and_diviser_for_ms(p.universal_dividend_ud_creation_period as f32); let (universal_dividend_ud_reeval_period, universal_dividend_ud_reeval_period_unit) = get_best_unit_and_diviser_for_ms(p.universal_dividend_ud_reeval_period as f32); - let (universal_dividend_units_per_ud, universal_dividend_units_per_ud_unit) = - get_best_unit_and_diviser_for_currency_units( - p.universal_dividend_units_per_ud, - p.currency_name.clone(), - ); let (wot_first_issuable_on, wot_first_issuable_on_unit) = get_best_unit_and_diviser_for_blocks(p.wot_first_issuable_on); let (wot_min_cert_for_membership, wot_min_cert_for_membership_unit) = @@ -810,7 +805,6 @@ fn dump_genesis_info(info: GenesisInfo) { - universal_dividend.square_money_growth_rate: {} {}/equinox - universal_dividend.ud_creation_period: {} {} - universal_dividend.ud_reeval_period: {} {} - - universal_dividend.units_per_ud: {} {} - wot.first_issuable_on: {} {} - wot.min_cert_for_membership: {} {} - wot.min_cert_for_create_idty_right: {} {} @@ -852,8 +846,6 @@ fn dump_genesis_info(info: GenesisInfo) { universal_dividend_ud_creation_period_unit, universal_dividend_ud_reeval_period, universal_dividend_ud_reeval_period_unit, - universal_dividend_units_per_ud, - universal_dividend_units_per_ud_unit, wot_first_issuable_on, wot_first_issuable_on_unit, wot_min_cert_for_membership, @@ -1935,7 +1927,6 @@ pub struct CommonParameters { pub universal_dividend_square_money_growth_rate: Perbill, pub universal_dividend_ud_creation_period: u64, pub universal_dividend_ud_reeval_period: u64, - pub universal_dividend_units_per_ud: u64, pub wot_first_issuable_on: u32, pub wot_min_cert_for_membership: u32, pub wot_min_cert_for_create_idty_right: u32, diff --git a/node/src/chain_spec/gtest.rs b/node/src/chain_spec/gtest.rs index 3154b76cf236a83e14676a65cfa0338c31cbc9bb..0646b6e2a4148b1f38d2155125e0a7fda83e17cd 100644 --- a/node/src/chain_spec/gtest.rs +++ b/node/src/chain_spec/gtest.rs @@ -77,8 +77,6 @@ fn get_parameters(_: &Option<GenesisParameters>) -> CommonParameters { universal_dividend_square_money_growth_rate: parameters::SquareMoneyGrowthRate::get(), universal_dividend_ud_creation_period: parameters::UdCreationPeriod::get() as u64, universal_dividend_ud_reeval_period: parameters::UdReevalPeriod::get() as u64, - universal_dividend_units_per_ud: - <Runtime as pallet_universal_dividend::Config>::UnitsPerUd::get(), wot_first_issuable_on: parameters::WotFirstCertIssuableOn::get(), wot_min_cert_for_membership: parameters::WotMinCertForMembership::get(), wot_min_cert_for_create_idty_right: parameters::WotMinCertForCreateIdtyRight::get(), diff --git a/pallets/universal-dividend/src/lib.rs b/pallets/universal-dividend/src/lib.rs index d8fd07e5784ffc9b8fcce755fdf8af3c98d64821..256524f518e81393d4317893aa8b2bc6555d4ad6 100644 --- a/pallets/universal-dividend/src/lib.rs +++ b/pallets/universal-dividend/src/lib.rs @@ -109,11 +109,6 @@ pub mod pallet { #[pallet::constant] type UdReevalPeriod: Get<Self::Moment>; - /// The number of units to divide the amounts expressed in number of UDs. - /// Example: If you wish to express UD amounts with a maximum precision of milliUDs, choose 1000. - #[pallet::constant] - type UnitsPerUd: Get<BalanceOf<Self>>; - /// Type representing the weight of this pallet. type WeightInfo: WeightInfo; @@ -351,7 +346,7 @@ pub mod pallet { }) } - /// like balance.transfer, but give an amount in UD + /// like balance.transfer, but give an amount in milliUD fn do_transfer_ud( origin: OriginFor<T>, dest: <T::Lookup as StaticLookup>::Source, @@ -364,7 +359,7 @@ pub mod pallet { T::Currency::transfer( &who, &dest, - value.saturating_mul(ud_amount) / T::UnitsPerUd::get(), + value.saturating_mul(ud_amount) / 1_000u32.into(), preservation, )?; Ok(().into()) diff --git a/pallets/universal-dividend/src/mock.rs b/pallets/universal-dividend/src/mock.rs index b1397ffe57790f6f8b624fbb69e49bb4633bf5c2..233ec61e7aa9e8c538c362a05036e56b6eec9835 100644 --- a/pallets/universal-dividend/src/mock.rs +++ b/pallets/universal-dividend/src/mock.rs @@ -150,7 +150,6 @@ impl pallet_universal_dividend::Config for Test { type SquareMoneyGrowthRate = SquareMoneyGrowthRate; type UdCreationPeriod = UdCreationPeriod; type UdReevalPeriod = UdReevalPeriod; - type UnitsPerUd = frame_support::traits::ConstU64<1_000>; type WeightInfo = (); } diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs index 967139552b6cbbf29ff5c93245f2aebd3073d12e..ef3af870aae2010247505dde5ba9f7de59d8a4d3 100644 --- a/runtime/common/src/pallets_config.rs +++ b/runtime/common/src/pallets_config.rs @@ -448,7 +448,6 @@ macro_rules! pallets_config { type SquareMoneyGrowthRate = SquareMoneyGrowthRate; type UdCreationPeriod = UdCreationPeriod; type UdReevalPeriod = UdReevalPeriod; - type UnitsPerUd = frame_support::traits::ConstU64<1_000>; type WeightInfo = common_runtime::weights::pallet_universal_dividend::WeightInfo<Runtime>; }