From c204f4665db435dd7ee840abe7ec6b923314eefc Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Mon, 18 Nov 2024 09:09:33 +0100 Subject: [PATCH] fix(paseo): adjust inflation values for multiplier_tests --- relay/paseo/src/lib.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/relay/paseo/src/lib.rs b/relay/paseo/src/lib.rs index 8355a04..89195c1 100644 --- a/relay/paseo/src/lib.rs +++ b/relay/paseo/src/lib.rs @@ -710,8 +710,8 @@ impl pallet_staking::EraPayout for EraPayout { let relative_era_len = FixedU128::from_rational(era_duration_millis.into(), MILLISECONDS_PER_YEAR.into()); - // TI at the time of execution of [Referendum 1139](https://paseo.subsquare.io/referenda/1139), block hash: `0x39422610299a75ef69860417f4d0e1d94e77699f45005645ffc5e8e619950f9f`. - let fixed_total_issuance: i128 = 15_011_657_390_566_252_333; + // TI at the time of execution of [Referendum 1139](https://polkadot.subsquare.io/referenda/1139), block hash: `0x39422610299a75ef69860417f4d0e1d94e77699f45005645ffc5e8e619950f9f`. + let fixed_total_issuance: i128 = 1_487_502_468_008_283_162; let fixed_inflation_rate = FixedU128::from_rational(8, 100); let yearly_emission = fixed_inflation_rate.saturating_mul_int(fixed_total_issuance); @@ -3236,12 +3236,12 @@ mod multiplier_tests { ); // Values are within 0.1% - assert_relative_eq!(to_stakers as f64, (279_477 * UNITS) as f64, max_relative = 0.001); - assert_relative_eq!(to_treasury as f64, (49_320 * UNITS) as f64, max_relative = 0.001); - // Total per day is ~328,797 PAS + assert_relative_eq!(to_stakers as f64, (27_693 * UNITS) as f64, max_relative = 0.001); + assert_relative_eq!(to_treasury as f64, (4_887 * UNITS) as f64, max_relative = 0.001); + // Total per day is ~32,580 PAS assert_relative_eq!( (to_stakers as f64 + to_treasury as f64), - (328_797 * UNITS) as f64, + (32_580 * UNITS) as f64, max_relative = 0.001 ); } @@ -3257,12 +3257,12 @@ mod multiplier_tests { assert_relative_eq!( to_stakers as f64, - (279_477 * UNITS) as f64 * 2.0, + (27_693 * UNITS) as f64 * 2.0, max_relative = 0.001 ); assert_relative_eq!( to_treasury as f64, - (49_320 * UNITS) as f64 * 2.0, + (4_887 * UNITS) as f64 * 2.0, max_relative = 0.001 ); } @@ -3275,8 +3275,8 @@ mod multiplier_tests { (36525 * MILLISECONDS_PER_DAY) / 100, // 1 year ); - // Our yearly emissions is about 120M PAS: - let yearly_emission = 120_093_259 * UNITS; + // Our yearly emissions is about 12M PAS: + let yearly_emission = 11_909_325 * UNITS; assert_relative_eq!( to_stakers as f64 + to_treasury as f64, yearly_emission as f64, @@ -3299,13 +3299,13 @@ mod multiplier_tests { 456, // ignored (36525 * MILLISECONDS_PER_DAY) / 10, // 10 years ); - let initial_ti: i128 = 15_011_657_390_566_252_333; + let initial_ti: i128 = 1_487_502_468_008_283_162; let projected_total_issuance = (to_stakers as i128 + to_treasury as i128) + initial_ti; - // In 2034, there will be about 2.7 billion PAS in existence. + // In 2034, there will be about 267 million PAS in existence. assert_relative_eq!( projected_total_issuance as f64, - (2_700_000_000 * UNITS) as f64, + (267_750_000 * UNITS) as f64, max_relative = 0.001 ); } @@ -3319,7 +3319,7 @@ mod multiplier_tests { (36525 * MILLISECONDS_PER_DAY) / 100, // 1 year ); let yearly_emission = to_stakers + to_treasury; - let mut ti: i128 = 15_011_657_390_566_252_333; + let mut ti: i128 = 1_487_502_468_008_283_162; for y in 0..10 { let new_ti = ti + yearly_emission as i128;