Skip to content

Commit

Permalink
fix:simpilify code
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Kai <[email protected]>
  • Loading branch information
GrapeBaBa committed Aug 24, 2024
1 parent 5ac29c2 commit e093af3
Showing 1 changed file with 7 additions and 43 deletions.
50 changes: 7 additions & 43 deletions crates/beacon/src/blob_test_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,12 @@ use eth2::types::{
};
use once_cell::sync::Lazy;

pub static ORIGIN_BLOCK: Lazy<Hash256> = Lazy::new(|| {
Hash256::from([
0x09, 0x09, 0x09, 0x09, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
])
});
pub static ONE: Lazy<Hash256> = Lazy::new(|| {
Hash256::from([
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
])
});
pub static TWO: Lazy<Hash256> = Lazy::new(|| {
Hash256::from([
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
])
});
pub static THREE: Lazy<Hash256> = Lazy::new(|| {
Hash256::from([
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
])
});
pub static FOUR: Lazy<Hash256> = Lazy::new(|| {
Hash256::from([
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
])
});
pub static FIVE: Lazy<Hash256> = Lazy::new(|| {
Hash256::from([
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
])
});
pub static ORIGIN_BLOCK: Lazy<Hash256> = Lazy::new(|| Hash256::from([0x09; 5] + [0x00; 27]));
pub static ONE: Lazy<Hash256> = Lazy::new(|| Hash256::from([0x01] + [0x00; 31]));
pub static TWO: Lazy<Hash256> = Lazy::new(|| Hash256::from([0x02] + [0x00; 31]));
pub static THREE: Lazy<Hash256> = Lazy::new(|| Hash256::from([0x03] + [0x00; 31]));
pub static FOUR: Lazy<Hash256> = Lazy::new(|| Hash256::from([0x04] + [0x00; 31]));
pub static FIVE: Lazy<Hash256> = Lazy::new(|| Hash256::from([0x05] + [0x00; 31]));

pub const START_SLOT: u64 = 10;
#[allow(dead_code)]
Expand All @@ -74,4 +38,4 @@ pub fn new_blob_sidecars(n: usize) -> BlobSidecarList<MainnetEthSpec> {
.expect("TODO: panic message");
}
blob_sidecars
}
}

0 comments on commit e093af3

Please sign in to comment.