mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 19:02:42 +00:00
Impl ssz enc/dec for NonZeroUsize
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use super::*;
|
||||
use core::num::NonZeroUsize;
|
||||
use ethereum_types::{H256, U128, U256};
|
||||
|
||||
macro_rules! impl_encodable_for_uint {
|
||||
@@ -80,6 +81,20 @@ impl Encode for bool {
|
||||
}
|
||||
}
|
||||
|
||||
impl Encode for NonZeroUsize {
|
||||
fn is_ssz_fixed_len() -> bool {
|
||||
<usize as Encode>::is_ssz_fixed_len()
|
||||
}
|
||||
|
||||
fn ssz_fixed_len() -> usize {
|
||||
<usize as Encode>::ssz_fixed_len()
|
||||
}
|
||||
|
||||
fn ssz_append(&self, buf: &mut Vec<u8>) {
|
||||
self.get().ssz_append(buf)
|
||||
}
|
||||
}
|
||||
|
||||
impl Encode for H256 {
|
||||
fn is_ssz_fixed_len() -> bool {
|
||||
true
|
||||
|
||||
Reference in New Issue
Block a user