Skip to content

Commit

Permalink
Finish EF Test Fork Agnostic (#5714)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethDreamer authored May 3, 2024
1 parent 9b98f4e commit 7c6526d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion beacon_node/lighthouse_network/src/types/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ impl<E: EthSpec> PubsubMessage<E> {
Ok(PubsubMessage::ProposerSlashing(Box::new(proposer_slashing)))
}
GossipKind::AttesterSlashing => {
// TODO(electra): could an older attester slashing still be floating around during the fork transition?
let attester_slashing =
match fork_context.from_context_bytes(gossip_topic.fork_digest) {
Some(ForkName::Base)
Expand Down
11 changes: 9 additions & 2 deletions testing/ef_tests/src/cases/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,15 @@ impl<E: EthSpec> Operation<E> for AttesterSlashing<E> {
"attester_slashing".into()
}

fn decode(path: &Path, _fork_name: ForkName, _spec: &ChainSpec) -> Result<Self, Error> {
Ok(Self::Base(ssz_decode_file(path)?))
fn decode(path: &Path, fork_name: ForkName, _spec: &ChainSpec) -> Result<Self, Error> {
Ok(match fork_name {
ForkName::Base
| ForkName::Altair
| ForkName::Bellatrix
| ForkName::Capella
| ForkName::Deneb => Self::Base(ssz_decode_file(path)?),
ForkName::Electra => Self::Electra(ssz_decode_file(path)?),
})
}

fn apply_to(
Expand Down

0 comments on commit 7c6526d

Please sign in to comment.