Skip to content

Commit

Permalink
Add MaxEncodedLen to implement_fixed! (paritytech#10768)
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
ggwpez authored Feb 1, 2022
1 parent 7daddf6 commit 7092504
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions primitives/arithmetic/src/fixed_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ macro_rules! implement_fixed {
Default,
Copy,
Clone,
codec::MaxEncodedLen,
PartialEq,
Eq,
PartialOrd,
Expand Down Expand Up @@ -667,6 +668,15 @@ macro_rules! implement_fixed {
assert!($name::DIV > 0);
}

#[test]
fn has_max_encoded_len() {
struct AsMaxEncodedLen<T: codec::MaxEncodedLen> {
_data: T,
}

let _ = AsMaxEncodedLen { _data: $name::min_value() };
}

#[test]
fn from_i129_works() {
let a = I129 { value: 1, negative: true };
Expand Down

0 comments on commit 7092504

Please sign in to comment.