Skip to content

Commit

Permalink
Ef test fixes (#5753)
Browse files Browse the repository at this point in the history
* attestation related ef test fixes

* delete commented out stuff
  • Loading branch information
realbigsean authored May 9, 2024
1 parent e32dfcd commit 07229b7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 23 deletions.
7 changes: 2 additions & 5 deletions testing/ef_tests/src/type_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,8 @@ type_name_generic!(LightClientUpdateDeneb, "LightClientUpdate");
type_name_generic!(PendingAttestation);
type_name!(ProposerSlashing);
type_name_generic!(SignedAggregateAndProof);
type_name_generic!(SignedAggregateAndProofBase, "SignedAggregateAndProofBase");
type_name_generic!(
SignedAggregateAndProofElectra,
"SignedAggregateAndProofElectra"
);
type_name_generic!(SignedAggregateAndProofBase, "SignedAggregateAndProof");
type_name_generic!(SignedAggregateAndProofElectra, "SignedAggregateAndProof");
type_name_generic!(SignedBeaconBlock);
type_name!(SignedBeaconBlockHeader);
type_name_generic!(SignedContributionAndProof);
Expand Down
49 changes: 31 additions & 18 deletions testing/ef_tests/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ mod ssz_static {
use types::historical_summary::HistoricalSummary;
use types::{AttesterSlashingBase, AttesterSlashingElectra, LightClientBootstrapAltair, *};

ssz_static_test!(aggregate_and_proof, AggregateAndProof<_>);
ssz_static_test!(attestation, Attestation<_>);
ssz_static_test!(attestation_data, AttestationData);
ssz_static_test!(beacon_block, SszStaticWithSpecHandler, BeaconBlock<_>);
Expand Down Expand Up @@ -249,7 +248,7 @@ mod ssz_static {
ssz_static_test!(voluntary_exit, VoluntaryExit);

#[test]
fn signed_aggregate_and_proof() {
fn attester_slashing() {
SszStaticHandler::<AttesterSlashingBase<MinimalEthSpec>, MinimalEthSpec>::pre_electra()
.run();
SszStaticHandler::<AttesterSlashingBase<MainnetEthSpec>, MainnetEthSpec>::pre_electra()
Expand All @@ -260,6 +259,36 @@ mod ssz_static {
.run();
}

#[test]
fn signed_aggregate_and_proof() {
SszStaticHandler::<SignedAggregateAndProofBase<MinimalEthSpec>, MinimalEthSpec>::pre_electra(
)
.run();
SszStaticHandler::<SignedAggregateAndProofBase<MainnetEthSpec>, MainnetEthSpec>::pre_electra(
)
.run();
SszStaticHandler::<SignedAggregateAndProofElectra<MinimalEthSpec>, MinimalEthSpec>::electra_only(
)
.run();
SszStaticHandler::<SignedAggregateAndProofElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only(
)
.run();
}

#[test]
fn aggregate_and_proof() {
SszStaticHandler::<AggregateAndProofBase<MinimalEthSpec>, MinimalEthSpec>::pre_electra()
.run();
SszStaticHandler::<AggregateAndProofBase<MainnetEthSpec>, MainnetEthSpec>::pre_electra()
.run();
SszStaticHandler::<AggregateAndProofElectra<MinimalEthSpec>, MinimalEthSpec>::electra_only(
)
.run();
SszStaticHandler::<AggregateAndProofElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only(
)
.run();
}

// BeaconBlockBody has no internal indicator of which fork it is for, so we test it separately.
#[test]
fn beacon_block_body() {
Expand All @@ -283,22 +312,6 @@ mod ssz_static {
.run();
}

#[test]
fn signed_aggregate_and_proof() {
SszStaticHandler::<SignedAggregateAndProofBase<MinimalEthSpec>, MinimalEthSpec>::pre_electra(
)
.run();
SszStaticHandler::<SignedAggregateAndProofBase<MainnetEthSpec>, MainnetEthSpec>::pre_electra(
)
.run();
SszStaticHandler::<SignedAggregateAndProofElectra<MinimalEthSpec>, MinimalEthSpec>::electra_only(
)
.run();
SszStaticHandler::<SignedAggregateAndProofElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only(
)
.run();
}

// Altair and later
#[test]
fn contribution_and_proof() {
Expand Down

0 comments on commit 07229b7

Please sign in to comment.