Skip to content

Commit 8a7b2bc

Browse files
committed
cleanup
1 parent b3f7b81 commit 8a7b2bc

File tree

7 files changed

+27
-30
lines changed

7 files changed

+27
-30
lines changed

consensus/types/src/light_client_bootstrap.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,11 @@ impl<E: EthSpec> ForkVersionDeserialize for LightClientBootstrap<E> {
145145
}
146146
}
147147
}
148+
149+
#[cfg(test)]
150+
mod tests {
151+
use super::*;
152+
use crate::MainnetEthSpec;
153+
154+
ssz_tests!(LightClientBootstrapDeneb<MainnetEthSpec>);
155+
}

consensus/types/src/light_client_finality_update.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,11 @@ impl<E: EthSpec> ForkVersionDeserialize for LightClientFinalityUpdate<E> {
175175
}
176176
}
177177
}
178+
179+
#[cfg(test)]
180+
mod tests {
181+
use super::*;
182+
use crate::MainnetEthSpec;
183+
184+
ssz_tests!(LightClientFinalityUpdateDeneb<MainnetEthSpec>);
185+
}

consensus/types/src/light_client_optimistic_update.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,11 @@ impl<T: EthSpec> ForkVersionDeserialize for LightClientOptimisticUpdate<T> {
169169
}
170170
}
171171
}
172+
173+
#[cfg(test)]
174+
mod tests {
175+
use super::*;
176+
use crate::MainnetEthSpec;
177+
178+
ssz_tests!(LightClientOptimisticUpdateDeneb<MainnetEthSpec>);
179+
}

consensus/types/src/light_client_update.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,11 @@ impl<E: EthSpec> LightClientUpdate<E> {
264264
#[cfg(test)]
265265
mod tests {
266266
use super::*;
267+
use crate::MainnetEthSpec;
267268
use ssz_types::typenum::Unsigned;
268269

270+
ssz_tests!(LightClientUpdateDeneb<MainnetEthSpec>);
271+
269272
#[test]
270273
fn finalized_root_params() {
271274
assert!(2usize.pow(FINALIZED_ROOT_PROOF_LEN as u32) <= FINALIZED_ROOT_INDEX);

consensus/types/src/test_utils/macros.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,6 @@ macro_rules! ssz_tests {
2727
};
2828
}
2929

30-
#[macro_export]
31-
macro_rules! ssz_tests_by_fork {
32-
($type: ty, $fork:expr) => {
33-
#[test]
34-
pub fn test_ssz_round_trip() {
35-
use ssz::ssz_encode;
36-
use $crate::test_utils::{SeedableRng, TestRandom, XorShiftRng};
37-
38-
let mut rng = XorShiftRng::from_seed([42; 16]);
39-
let original = <$type>::random_for_test(&mut rng);
40-
41-
let bytes = ssz_encode(&original);
42-
let decoded = <$type>::from_ssz_bytes(&bytes, $fork).unwrap();
43-
44-
assert_eq!(original, decoded);
45-
}
46-
};
47-
}
48-
4930
#[macro_export]
5031
macro_rules! tree_hash_tests {
5132
($type: ty) => {

consensus/types/src/test_utils/test_random.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ mod bitfield;
1212
mod hash256;
1313
mod kzg_commitment;
1414
mod kzg_proof;
15-
mod light_client_header;
1615
mod public_key;
1716
mod public_key_bytes;
1817
mod secret_key;

consensus/types/src/test_utils/test_random/light_client_header.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)