mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 21:21:03 +00:00
pallet nis: remove benchmarking hack (#13759)
* pallet nis: remove benchmark hack Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * NearestPrefDown -> Down Tested on the kitchensink and in case that n = 10000000000000000 and d = 12000100600000000000000 it rounds the Perquintill up (correctly) since 833326347280+47318160/60000503 should round up. That triggers the path 'amount <= on_hold' in L736. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
29ea9e0ad9
commit
2c0993d0c0
@@ -1139,9 +1139,8 @@ pub mod pallet {
|
||||
// Now to activate the bid...
|
||||
let n = amount;
|
||||
let d = issuance.effective;
|
||||
let proportion =
|
||||
Perquintill::from_rational_with_rounding(n, d, Rounding::NearestPrefDown)
|
||||
.defensive_unwrap_or_default();
|
||||
let proportion = Perquintill::from_rational_with_rounding(n, d, Rounding::Down)
|
||||
.defensive_unwrap_or_default();
|
||||
let who = bid.who;
|
||||
let index = summary.index;
|
||||
summary.proportion_owed.defensive_saturating_accrue(proportion);
|
||||
|
||||
Reference in New Issue
Block a user