mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 05:51:02 +00:00
Extended Balance Type for Staking's Election (#2134)
* First draft of extended balance type * Test cleanup. * Update staking docs. * Add a good failing test case for quintill * Bring back saturating. * Some final fixes * A few more. * Update wasm; Bump spec; * Re-bump. * Custom lossy conversion from currency to vote * remove print * Fix reverse conversion issue. * void. Re-trigger ci.
This commit is contained in:
@@ -110,6 +110,47 @@ macro_rules! assert_ok {
|
||||
}
|
||||
}
|
||||
|
||||
/// Panic when the vectors are different, without taking the order into account.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// #[macro_use]
|
||||
/// # extern crate srml_support;
|
||||
/// # use srml_support::{assert_eq_uvec};
|
||||
/// # fn main() {
|
||||
/// assert_eq_uvec!(vec![1,2], vec![2,1]);
|
||||
/// # }
|
||||
/// ```
|
||||
///
|
||||
/// ```rust,should_panic
|
||||
/// #[macro_use]
|
||||
/// # extern crate srml_support;
|
||||
/// # use srml_support::{assert_eq_uvec};
|
||||
/// # fn main() {
|
||||
/// assert_eq_uvec!(vec![1,2,3], vec![2,1]);
|
||||
/// # }
|
||||
/// ```
|
||||
#[macro_export]
|
||||
#[cfg(feature = "std")]
|
||||
macro_rules! assert_eq_uvec {
|
||||
( $x:expr, $y:expr ) => {
|
||||
$crate::__assert_eq_uvec!($x, $y);
|
||||
$crate::__assert_eq_uvec!($y, $x);
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
#[doc(hidden)]
|
||||
#[cfg(feature = "std")]
|
||||
macro_rules! __assert_eq_uvec {
|
||||
( $x:expr, $y:expr ) => {
|
||||
$x.iter().for_each(|e| {
|
||||
if !$y.contains(e) { panic!(format!("vectors not equal: {:?} != {:?}", $x, $y)); }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// The void type - it cannot exist.
|
||||
// Oh rust, you crack me up...
|
||||
#[derive(Clone, Eq, PartialEq)]
|
||||
|
||||
Reference in New Issue
Block a user