Use constants instead of lazy_static for shred header sizes (#6472)

This commit is contained in:
Pankaj Garg
2019-10-21 12:46:16 -07:00
committed by GitHub
parent 364583ea5c
commit 84e911361a
4 changed files with 71 additions and 73 deletions

View File

@ -997,7 +997,7 @@ mod test {
fn test_dead_fork_entry_deserialize_failure() {
// Insert entry that causes deserialization failure
let res = check_dead_fork(|_, _| {
let payload_len = *SIZE_OF_DATA_SHRED_PAYLOAD;
let payload_len = SIZE_OF_DATA_SHRED_PAYLOAD;
let gibberish = [0xa5u8; PACKET_DATA_SIZE];
let mut data_header = DataShredHeader::default();
data_header.flags = DATA_COMPLETE_SHRED;
@ -1007,7 +1007,7 @@ mod test {
CodingShredHeader::default(),
);
bincode::serialize_into(
&mut shred.payload[*SIZE_OF_COMMON_SHRED_HEADER + *SIZE_OF_DATA_SHRED_HEADER..],
&mut shred.payload[SIZE_OF_COMMON_SHRED_HEADER + SIZE_OF_DATA_SHRED_HEADER..],
&gibberish[..payload_len],
)
.unwrap();