mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Remove IndexedAttestation faulty Decode impl
This commit is contained in:
@@ -2,7 +2,6 @@ use crate::{test_utils::TestRandom, AggregateSignature, AttestationData, EthSpec
|
||||
use core::slice::Iter;
|
||||
use derivative::Derivative;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use ssz::Decode;
|
||||
use ssz::Encode;
|
||||
use ssz_derive::{Decode, Encode};
|
||||
use std::hash::{Hash, Hasher};
|
||||
@@ -187,26 +186,6 @@ impl<'a, E: EthSpec> IndexedAttestationRef<'a, E> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: EthSpec> Decode for IndexedAttestation<E> {
|
||||
fn is_ssz_fixed_len() -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, ssz::DecodeError> {
|
||||
if let Ok(result) = IndexedAttestationBase::from_ssz_bytes(bytes) {
|
||||
return Ok(IndexedAttestation::Base(result));
|
||||
}
|
||||
|
||||
if let Ok(result) = IndexedAttestationElectra::from_ssz_bytes(bytes) {
|
||||
return Ok(IndexedAttestation::Electra(result));
|
||||
}
|
||||
|
||||
Err(ssz::DecodeError::BytesInvalid(String::from(
|
||||
"bytes not valid for any fork variant",
|
||||
)))
|
||||
}
|
||||
}
|
||||
|
||||
/// Implementation of non-crypto-secure `Hash`, for use with `HashMap` and `HashSet`.
|
||||
///
|
||||
/// Guarantees `att1 == att2 -> hash(att1) == hash(att2)`.
|
||||
|
||||
Reference in New Issue
Block a user