Skip to content

Commit 063b79c

Browse files
committed
Try fixing tests
1 parent 88bedf0 commit 063b79c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

beacon_node/beacon_chain/tests/block_verification.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ fn update_blob_signed_header<E: EthSpec>(
206206
signed_block: &SignedBeaconBlock<E>,
207207
blobs: &mut BlobSidecarList<E>,
208208
) {
209+
// Required to prevent as_mut_slice being called on an uninitialized list. Yuck.
210+
if blobs.is_empty() {
211+
return;
212+
}
209213
for old_blob_sidecar in blobs.as_mut_slice().unwrap() {
210214
let new_blob = Arc::new(BlobSidecar::<E> {
211215
index: old_blob_sidecar.index,

beacon_node/execution_layer/src/test_utils/execution_block_generator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ impl<E: EthSpec> ExecutionBlockGenerator<E> {
672672
// get random number between 0 and Max Blobs
673673
let mut rng = self.rng.lock();
674674
// TODO(pawan): thread the chainspec value here somehow
675-
let num_blobs = rng.gen::<usize>() % 6;
675+
let num_blobs = rng.gen::<usize>() % (6 + 1);
676676
let (bundle, transactions) = generate_blobs(num_blobs)?;
677677
for tx in Vec::from(transactions) {
678678
execution_payload

0 commit comments

Comments
 (0)