Add CompactAs derive for Fixed* types (#7293)

Signed-off-by: Vladislav Markushin <negigic@gmail.com>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Vladislav
2020-10-10 00:35:09 +03:00
committed by GitHub
parent a954ce5f2d
commit 3c0a049bee
@@ -17,7 +17,7 @@
//! Decimal Fixed Point implementations for Substrate runtime.
use sp_std::{ops::{self, Add, Sub, Mul, Div}, fmt::Debug, prelude::*, convert::{TryInto, TryFrom}};
use codec::{Encode, Decode};
use codec::{Encode, Decode, CompactAs};
use crate::{
helpers_128bit::multiply_by_rational, PerThing,
traits::{
@@ -342,7 +342,7 @@ macro_rules! implement_fixed {
/// A fixed point number representation in the range.
///
#[doc = $title]
#[derive(Encode, Decode, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Encode, Decode, CompactAs, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct $name($inner_type);
impl From<$inner_type> for $name {