Make last shred for an interrupted slot signed + typed (#6760)
This commit is contained in:
@ -3804,7 +3804,7 @@ pub mod tests {
|
||||
slot,
|
||||
next_shred_index as u32,
|
||||
1,
|
||||
None,
|
||||
Some(&[1, 1, 1]),
|
||||
true,
|
||||
true,
|
||||
)];
|
||||
|
@ -160,22 +160,23 @@ impl Shred {
|
||||
data_header.flags |= LAST_SHRED_IN_SLOT
|
||||
}
|
||||
|
||||
let mut start = 0;
|
||||
Self::serialize_obj_into(
|
||||
&mut start,
|
||||
SIZE_OF_COMMON_SHRED_HEADER,
|
||||
&mut payload,
|
||||
&common_header,
|
||||
)
|
||||
.expect("Failed to write header into shred buffer");
|
||||
Self::serialize_obj_into(
|
||||
&mut start,
|
||||
SIZE_OF_DATA_SHRED_HEADER,
|
||||
&mut payload,
|
||||
&data_header,
|
||||
)
|
||||
.expect("Failed to write data header into shred buffer");
|
||||
|
||||
if let Some(data) = data {
|
||||
let mut start = 0;
|
||||
Self::serialize_obj_into(
|
||||
&mut start,
|
||||
SIZE_OF_COMMON_SHRED_HEADER,
|
||||
&mut payload,
|
||||
&common_header,
|
||||
)
|
||||
.expect("Failed to write header into shred buffer");
|
||||
Self::serialize_obj_into(
|
||||
&mut start,
|
||||
SIZE_OF_DATA_SHRED_HEADER,
|
||||
&mut payload,
|
||||
&data_header,
|
||||
)
|
||||
.expect("Failed to write data header into shred buffer");
|
||||
payload[start..start + data.len()].clone_from_slice(data);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user