mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
Delete RuntimeVariableList::from_vec (#7930)
This method is a footgun because it truncates the list. It is the source of a recent bug: - https://github.com/sigp/lighthouse/pull/7927 - Delete uses of `RuntimeVariableList::from_vec` and replace them with `::new` which does validation and can fail. - Propagate errors where possible, unwrap in tests and use `expect` for obviously-safe uses (in `chain_spec.rs`).
This commit is contained in:
@@ -1089,11 +1089,11 @@ mod tests {
|
||||
}
|
||||
|
||||
fn bbroot_request_v1(fork_name: ForkName, spec: &ChainSpec) -> BlocksByRootRequest {
|
||||
BlocksByRootRequest::new_v1(vec![Hash256::zero()], &fork_context(fork_name, spec))
|
||||
BlocksByRootRequest::new_v1(vec![Hash256::zero()], &fork_context(fork_name, spec)).unwrap()
|
||||
}
|
||||
|
||||
fn bbroot_request_v2(fork_name: ForkName, spec: &ChainSpec) -> BlocksByRootRequest {
|
||||
BlocksByRootRequest::new(vec![Hash256::zero()], &fork_context(fork_name, spec))
|
||||
BlocksByRootRequest::new(vec![Hash256::zero()], &fork_context(fork_name, spec)).unwrap()
|
||||
}
|
||||
|
||||
fn blbroot_request(fork_name: ForkName, spec: &ChainSpec) -> BlobsByRootRequest {
|
||||
@@ -1104,6 +1104,7 @@ mod tests {
|
||||
}],
|
||||
&fork_context(fork_name, spec),
|
||||
)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
fn ping_message() -> Ping {
|
||||
|
||||
Reference in New Issue
Block a user