Fix failing beacon chain tests and remove unnecessary blob clone

This commit is contained in:
Jimmy Chen 2023-08-23 11:23:12 +10:00
parent 609c2c2250
commit 4bd527546b
No known key found for this signature in database
GPG Key ID: 7AAEE02659DCF690
2 changed files with 6 additions and 6 deletions

View File

@ -1893,11 +1893,11 @@ where
self.set_current_slot(slot); self.set_current_slot(slot);
let (block, blobs) = block_contents; let (block, blobs) = block_contents;
// Note: we are just dropping signatures here and skipping signature verification. // Note: we are just dropping signatures here and skipping signature verification.
let blobs_without_signatures = blobs.as_ref().map(|blobs| { let blobs_without_signatures = blobs.map(|blobs| {
VariableList::from( VariableList::from(
blobs blobs
.into_iter() .into_iter()
.map(|blob| blob.message.clone()) .map(|blob| blob.message)
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
) )
}); });
@ -1922,11 +1922,11 @@ where
) -> Result<SignedBeaconBlockHash, BlockError<E>> { ) -> Result<SignedBeaconBlockHash, BlockError<E>> {
let (block, blobs) = block_contents; let (block, blobs) = block_contents;
// Note: we are just dropping signatures here and skipping signature verification. // Note: we are just dropping signatures here and skipping signature verification.
let blobs_without_signatures = blobs.as_ref().map(|blobs| { let blobs_without_signatures = blobs.map(|blobs| {
VariableList::from( VariableList::from(
blobs blobs
.into_iter() .into_iter()
.map(|blob| blob.message.clone()) .map(|blob| blob.message)
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
) )
}); });

View File

@ -2380,10 +2380,10 @@ async fn process_blocks_and_attestations_for_unaligned_checkpoint() {
let (unadvanced_split_state, unadvanced_split_state_root) = let (unadvanced_split_state, unadvanced_split_state_root) =
harness.get_current_state_and_root(); harness.get_current_state_and_root();
let (invalid_fork_block, _) = harness let ((invalid_fork_block, _), _) = harness
.make_block(unadvanced_split_state.clone(), split_slot) .make_block(unadvanced_split_state.clone(), split_slot)
.await; .await;
let (valid_fork_block, _) = harness let ((valid_fork_block, _), _) = harness
.make_block(unadvanced_split_state.clone(), split_slot + 1) .make_block(unadvanced_split_state.clone(), split_slot + 1)
.await; .await;