Skip to content

Commit

Permalink
change result to an assert
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Aug 13, 2024
1 parent 278146e commit c99c6f8
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions eip7594/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,10 @@ mod validation {
}

// Check that each cell has the right amount of bytes
//
// This should be infallible.
for (i, cell) in cells.iter().enumerate() {
if cell.len() != BYTES_PER_CELL {
// TODO: This check should always be true
return Err(VerifierError::CellDoesNotContainEnoughBytes {
cell_index: cell_indices[i],
num_bytes: cell.len(),
expected_num_bytes: BYTES_PER_CELL,
});
}
assert_eq!(cell.len(), BYTES_PER_CELL, "the number of bytes in a cell should always equal {} since the type is a reference to an array. Check cell at index {}", BYTES_PER_CELL, i);
}

// Check that we have no duplicate cell indices
Expand Down

0 comments on commit c99c6f8

Please sign in to comment.