mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 10:07:56 +00:00
Generic Normalize impl for arithmetic and npos-elections (#6374)
* add normalize * better api for normalize * Some grumbles * Update primitives/arithmetic/src/lib.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * More great review grumbles * Way better doc for everything. * Some improvement * Update primitives/arithmetic/src/lib.rs Co-authored-by: Bernhard Schuster <bernhard@ahoi.io> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
This commit is contained in:
@@ -114,7 +114,7 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
fn assert_per_thing_equal_error<T: PerThing>(a: T, b: T, err: u128) {
|
||||
fn assert_per_thing_equal_error<P: PerThing>(a: P, b: P, err: u128) {
|
||||
let a_abs = a.deconstruct().saturated_into::<u128>();
|
||||
let b_abs = b.deconstruct().saturated_into::<u128>();
|
||||
let diff = a_abs.max(b_abs) - a_abs.min(b_abs);
|
||||
|
||||
Reference in New Issue
Block a user