Skip to content

Commit

Permalink
Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanjay176 committed Nov 7, 2023
1 parent c0b27ad commit ad7a6d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 1 addition & 7 deletions common/eth2/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1557,18 +1557,14 @@ impl<T: EthSpec, Payload: AbstractExecPayload<T>> BlockContents<T, Payload> {
// The `Full`` variant **must** contains blobs and proofs
let mut builder = ssz::SszDecoderBuilder::new(bytes);

// TODO(pawan): potential bug
builder.register_anonymous_variable_length_item()?;
builder.register_type::<KzgProofs<T>>()?;

builder.register_anonymous_variable_length_item()?;
builder.register_type::<BlobsList<T>>()?;

let mut decoder = builder.build()?;
let block = decoder
.decode_next_with(|bytes| BeaconBlock::from_ssz_bytes(bytes, spec))?;
let kzg_proofs =
decoder.decode_next_with(|bytes| KzgProofs::<T>::from_ssz_bytes(bytes))?;
let kzg_proofs = decoder.decode_next()?;
let blobs = decoder.decode_next()?;

Ok(BlockContents::new(block, Some((kzg_proofs, blobs))))
Expand Down Expand Up @@ -1722,8 +1718,6 @@ impl<T: EthSpec, Payload: AbstractExecPayload<T>> SignedBlockContents<T, Payload
let mut builder = ssz::SszDecoderBuilder::new(bytes);
builder.register_anonymous_variable_length_item()?;
builder.register_type::<KzgProofs<T>>()?;

builder.register_anonymous_variable_length_item()?;
builder.register_type::<BlobsList<T>>()?;

let mut decoder = builder.build()?;
Expand Down
5 changes: 4 additions & 1 deletion consensus/types/src/beacon_block_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ impl<'a, T: EthSpec, Payload: AbstractExecPayload<T>> BeaconBlockBodyRef<'a, T,
&self,
_index: usize,
) -> Option<FixedVector<Hash256, T::KzgCommitmentInclusionProofDepth>> {
todo!()
match self {
Self::Base(_) | Self::Altair(_) | Self::Merge(_) | Self::Capella(_) => None,
Self::Deneb(_body) => Some(FixedVector::from(vec![Hash256::random()])),
}
}
}

Expand Down

0 comments on commit ad7a6d8

Please sign in to comment.