Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Fukushima <[email protected]>
  • Loading branch information
gfukushima committed Feb 14, 2025
1 parent ba93902 commit fb65206
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,17 @@ public void validateExecutionPayload(
final Optional<? extends OptimisticExecutionPayloadExecutor> payloadExecutor,
final Optional<List<InclusionList>> inclusionLists)
throws BlockProcessingException {
final int maxTransactionPerInclusionList =
SpecConfigEip7805.required(specConfig).getMaxTransactionsPerInclusionList();
List<Transaction> inclusionListTransactions = List.of();

final List<Transaction> inclusionListTransactions;
if (inclusionLists.isPresent()) {
final int maxTransactionPerInclusionList =
SpecConfigEip7805.required(specConfig).getMaxTransactionsPerInclusionList();
inclusionListTransactions = getInclusionListTransactions(inclusionLists.get());
}
if (inclusionListTransactions.size() > maxTransactionPerInclusionList) {
throw new BlockProcessingException(
"Number of transaction in the inclusion list in block exceeds max transaction per inclusion list");

if (inclusionListTransactions.size() > maxTransactionPerInclusionList) {
throw new BlockProcessingException(
"Number of transaction in the inclusion list in block exceeds max transaction per inclusion list");
}
}
super.validateExecutionPayload(genericState, beaconBlockBody, payloadExecutor, inclusionLists);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void processDepositAddsNewValidatorWhenPubkeyIsNotFoundInRegistry()
postState.getBalances().size(),
originalValidatorBalancesSize + 1,
"No balance was added to the validator balances.");
if (spec.atSlot(postState.getSlot()).getMilestone().equals(SpecMilestone.ELECTRA)) {
if (spec.atSlot(postState.getSlot()).getMilestone().isGreaterThanOrEqualTo(SpecMilestone.ELECTRA)) {
assertEquals(
makeValidator(pubkey, withdrawalCredentials).withEffectiveBalance(UInt64.ZERO),
postState.getValidators().get(originalValidatorRegistrySize));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
import tech.pegasys.teku.spec.datastructures.type.SszKZGCommitment;
import tech.pegasys.teku.spec.logic.common.helpers.MiscHelpers;
import tech.pegasys.teku.spec.logic.common.statetransition.exceptions.BlockProcessingException;
import tech.pegasys.teku.spec.logic.versions.deneb.block.BlockProcessorDenebTest;
import tech.pegasys.teku.spec.logic.versions.deneb.types.VersionedHash;
import tech.pegasys.teku.spec.logic.versions.electra.block.BlockProcessorElectraTest;

public class BlockProcessorEip7805Test extends BlockProcessorDenebTest {
public class BlockProcessorEip7805Test extends BlockProcessorElectraTest {

@Override
protected Spec createSpec() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
import tech.pegasys.teku.spec.logic.versions.electra.util.AttestationUtilElectra;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsElectra;

class BlockProcessorElectraTest extends BlockProcessorDenebTest {
public class BlockProcessorElectraTest extends BlockProcessorDenebTest {

@Override
protected Spec createSpec() {
Expand Down

0 comments on commit fb65206

Please sign in to comment.