Skip to content

Commit

Permalink
Fix some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanjay176 committed Sep 4, 2024
1 parent d37733b commit 12c6ef1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions beacon_node/beacon_chain/tests/block_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ fn update_blob_signed_header<E: EthSpec>(
signed_block: &SignedBeaconBlock<E>,
blobs: &mut BlobSidecarList<E>,
) {
for old_blob_sidecar in blobs.iter_mut() {
for old_blob_sidecar in blobs.as_mut_slice().unwrap() {
let new_blob = Arc::new(BlobSidecar::<E> {
index: old_blob_sidecar.index,
blob: old_blob_sidecar.blob.clone(),
Expand Down Expand Up @@ -1214,7 +1214,7 @@ async fn verify_block_for_gossip_slashing_detection() {
let slasher = Arc::new(
Slasher::open(
SlasherConfig::new(slasher_dir.path().into()),
spec,
spec.clone(),
test_logger(),
)
.unwrap(),
Expand All @@ -1238,7 +1238,7 @@ async fn verify_block_for_gossip_slashing_detection() {

if let Some((kzg_proofs, blobs)) = blobs1 {
let sidecars =
BlobSidecar::build_sidecars(blobs, verified_block.block(), kzg_proofs).unwrap();
BlobSidecar::build_sidecars(blobs, verified_block.block(), kzg_proofs, &spec).unwrap();
for sidecar in sidecars {
let blob_index = sidecar.index;
let verified_blob = harness
Expand Down
11 changes: 8 additions & 3 deletions beacon_node/network/src/network_beacon_processor/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ impl TestRig {
assert!(beacon_processor.is_ok());
let block = next_block_tuple.0;
let blob_sidecars = if let Some((kzg_proofs, blobs)) = next_block_tuple.1 {
Some(BlobSidecar::build_sidecars(blobs, &block, kzg_proofs).unwrap())
Some(BlobSidecar::build_sidecars(blobs, &block, kzg_proofs, &chain.spec).unwrap())
} else {
None
};
Expand Down Expand Up @@ -341,7 +341,7 @@ impl TestRig {
}
pub fn enqueue_single_lookup_rpc_blobs(&self) {
if let Some(blobs) = self.next_blobs.clone() {
let blobs = FixedBlobSidecarList::from(blobs.into_iter().map(Some).collect::<Vec<_>>());
let blobs = FixedBlobSidecarList::new(blobs.into_iter().map(Some).collect::<Vec<_>>());
self.network_beacon_processor
.send_rpc_blobs(
self.next_block.canonical_root(),
Expand Down Expand Up @@ -1100,7 +1100,12 @@ async fn test_blobs_by_range() {
.block_root_at_slot(Slot::new(slot), WhenSlotSkipped::None)
.unwrap();
blob_count += root
.map(|root| rig.chain.get_blobs(&root).unwrap_or_default().len())
.map(|root| {
rig.chain
.get_blobs(&root)
.map(|list| list.len())
.unwrap_or(0)
})
.unwrap_or(0);
}
let mut actual_count = 0;
Expand Down

0 comments on commit 12c6ef1

Please sign in to comment.