Skip to content
Snippets Groups Projects
Unverified Commit 2dc89637 authored by bgallois's avatar bgallois
Browse files
parent 7d5c6878
No related branches found
No related tags found
No related merge requests found
Pipeline #37416 failed
......@@ -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,
......
......@@ -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,
......
......@@ -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(),
......
......@@ -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())
......
......@@ -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 = ();
}
......
......@@ -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>;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment