diff --git a/networking/eth2/src/test/java/tech/pegasys/teku/networking/eth2/gossip/topics/Eth2GossipTopicFilterTest.java b/networking/eth2/src/test/java/tech/pegasys/teku/networking/eth2/gossip/topics/Eth2GossipTopicFilterTest.java index 9001d589914..3b275ee7595 100644 --- a/networking/eth2/src/test/java/tech/pegasys/teku/networking/eth2/gossip/topics/Eth2GossipTopicFilterTest.java +++ b/networking/eth2/src/test/java/tech/pegasys/teku/networking/eth2/gossip/topics/Eth2GossipTopicFilterTest.java @@ -37,7 +37,6 @@ import tech.pegasys.teku.spec.TestSpecInvocationContextProvider; import tech.pegasys.teku.spec.config.SpecConfig; import tech.pegasys.teku.spec.config.SpecConfigDeneb; -import tech.pegasys.teku.spec.config.SpecConfigElectra; import tech.pegasys.teku.spec.datastructures.state.Fork; import tech.pegasys.teku.spec.datastructures.state.ForkInfo; import tech.pegasys.teku.spec.util.DataStructureUtil; @@ -140,7 +139,8 @@ void shouldConsiderAllBlobSidecarSubnetsRelevant() { @TestTemplate void shouldNotConsiderBlobSidecarWithIncorrectSubnetIdRelevant() { - final int blobSidecarSubnetCount = getBlobSidecarSubnetCount(); + final int blobSidecarSubnetCount = + spec.forMilestone(specMilestone).miscHelpers().getBlobSidecarSubnetCount().orElseThrow(); assertThat( filter.isRelevantTopic( getTopicName(getBlobSidecarSubnetTopicName(blobSidecarSubnetCount + 1)))) @@ -160,14 +160,6 @@ void shouldNotAllowTopicsWithUnknownForkDigest() { assertThat(filter.isRelevantTopic(irrelevantTopic)).isFalse(); } - private int getBlobSidecarSubnetCount() { - return specMilestone.isGreaterThanOrEqualTo(SpecMilestone.ELECTRA) - ? SpecConfigElectra.required(spec.forMilestone(SpecMilestone.ELECTRA).getConfig()) - .getBlobSidecarSubnetCountElectra() - : SpecConfigDeneb.required(spec.forMilestone(SpecMilestone.DENEB).getConfig()) - .getBlobSidecarSubnetCount(); - } - private String getTopicName(final GossipTopicName name) { return GossipTopics.getTopic(forkInfo.getForkDigest(spec), name, SSZ_SNAPPY); }