mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 08:41:07 +00:00
Add MaxEncodedLen to implement_fixed! (#10768)
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
ba3255376e
commit
dbb3f24e3e
@@ -369,6 +369,7 @@ macro_rules! implement_fixed {
|
|||||||
Default,
|
Default,
|
||||||
Copy,
|
Copy,
|
||||||
Clone,
|
Clone,
|
||||||
|
codec::MaxEncodedLen,
|
||||||
PartialEq,
|
PartialEq,
|
||||||
Eq,
|
Eq,
|
||||||
PartialOrd,
|
PartialOrd,
|
||||||
@@ -667,6 +668,15 @@ macro_rules! implement_fixed {
|
|||||||
assert!($name::DIV > 0);
|
assert!($name::DIV > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn has_max_encoded_len() {
|
||||||
|
struct AsMaxEncodedLen<T: codec::MaxEncodedLen> {
|
||||||
|
_data: T,
|
||||||
|
}
|
||||||
|
|
||||||
|
let _ = AsMaxEncodedLen { _data: $name::min_value() };
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn from_i129_works() {
|
fn from_i129_works() {
|
||||||
let a = I129 { value: 1, negative: true };
|
let a = I129 { value: 1, negative: true };
|
||||||
|
|||||||
Reference in New Issue
Block a user