mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
Accept new Phragmén solutions if they are epsilon better + Better pre-inclusion checks. (#6173)
* part1: Accept inly epsilon better solutions * Fix pre-dispatch check * Fix build * review grumbles * Epsilon -> Threshold
This commit is contained in:
@@ -25,6 +25,9 @@ use crate::traits::{
|
||||
};
|
||||
use sp_debug_derive::RuntimeDebug;
|
||||
|
||||
/// Get the inner type of a `PerThing`.
|
||||
pub type InnerOf<P> = <P as PerThing>::Inner;
|
||||
|
||||
/// Something that implements a fixed point ration with an arbitrary granularity `X`, as _parts per
|
||||
/// `X`_.
|
||||
pub trait PerThing:
|
||||
@@ -312,8 +315,7 @@ macro_rules! implement_per_thing {
|
||||
///
|
||||
#[doc = $title]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
#[derive(Encode, Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord,
|
||||
RuntimeDebug, CompactAs)]
|
||||
#[derive(Encode, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, RuntimeDebug, CompactAs)]
|
||||
pub struct $name($type);
|
||||
|
||||
impl PerThing for $name {
|
||||
@@ -566,6 +568,12 @@ macro_rules! implement_per_thing {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for $name {
|
||||
fn default() -> Self {
|
||||
<Self as PerThing>::zero()
|
||||
}
|
||||
}
|
||||
|
||||
/// Non-overflow multiplication.
|
||||
///
|
||||
/// This is tailored to be used with a balance type.
|
||||
|
||||
Reference in New Issue
Block a user