mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 21:34:46 +00:00
Bump ssz_types to v0.12.2 (#8032)
https://github.com/sigp/lighthouse/issues/8012 Replace all instances of `VariableList::from` and `FixedVector::from` to their `try_from` variants. While I tried to use proper error handling in most cases, there were certain situations where adding an `expect` for situations where `try_from` can trivially never fail avoided adding a lot of extra complexity. Co-Authored-By: Mac L <mjladson@pm.me> Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com> Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -868,16 +868,16 @@ mod test {
|
||||
let state = harness.get_current_state();
|
||||
let ((block, _blobs_opt), _state) = harness
|
||||
.make_block_with_modifier(state, slot, |block| {
|
||||
*block.body_mut().blob_kzg_commitments_mut().unwrap() = vec![].into();
|
||||
*block.body_mut().blob_kzg_commitments_mut().unwrap() = vec![].try_into().unwrap();
|
||||
})
|
||||
.await;
|
||||
|
||||
let index = 0;
|
||||
let column_sidecar = DataColumnSidecar::<E> {
|
||||
index,
|
||||
column: vec![].into(),
|
||||
kzg_commitments: vec![].into(),
|
||||
kzg_proofs: vec![].into(),
|
||||
column: vec![].try_into().unwrap(),
|
||||
kzg_commitments: vec![].try_into().unwrap(),
|
||||
kzg_proofs: vec![].try_into().unwrap(),
|
||||
signed_block_header: block.signed_block_header(),
|
||||
kzg_commitments_inclusion_proof: block
|
||||
.message()
|
||||
@@ -914,7 +914,9 @@ mod test {
|
||||
let ((block, _blobs_opt), _state) = harness
|
||||
.make_block_with_modifier(state, slot, |block| {
|
||||
*block.body_mut().blob_kzg_commitments_mut().unwrap() =
|
||||
vec![preloaded_commitments_single[0]; blob_count].into();
|
||||
vec![preloaded_commitments_single[0]; blob_count]
|
||||
.try_into()
|
||||
.unwrap();
|
||||
})
|
||||
.await;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user