From 3c0a049bee193ec2cba03612736ee7576727e59e Mon Sep 17 00:00:00 2001 From: Vladislav Date: Sat, 10 Oct 2020 00:35:09 +0300 Subject: [PATCH] Add `CompactAs` derive for `Fixed*` types (#7293) Signed-off-by: Vladislav Markushin Co-authored-by: Shawn Tabrizi --- substrate/primitives/arithmetic/src/fixed_point.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/substrate/primitives/arithmetic/src/fixed_point.rs b/substrate/primitives/arithmetic/src/fixed_point.rs index 59c237efb6..970a241560 100644 --- a/substrate/primitives/arithmetic/src/fixed_point.rs +++ b/substrate/primitives/arithmetic/src/fixed_point.rs @@ -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 {