Skip to content

Commit

Permalink
Fix minor nits in new electra state changes (Consensys#8194)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Harris <paul.harris@consensys.net>
  • Loading branch information
jtraglia and rolfyone authored Apr 15, 2024
1 parent 49a6665 commit e8eee85
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public PendingConsolidation(
spec.getSchemaDefinitions().toVersionElectra();
if (schemaDefinitionsElectra.isEmpty()) {
throw new IllegalArgumentException(
"Could not create PendingBalanceDeposit for pre-electra spec");
"Could not create PendingConsolidation for pre-electra spec");
}
return schemaDefinitionsElectra
.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public PendingPartialWithdrawal(
spec.getSchemaDefinitions().toVersionElectra();
if (schemaDefinitionsElectra.isEmpty()) {
throw new IllegalArgumentException(
"Could not create PendingBalanceDeposit for pre-electra spec");
"Could not create PendingPartialWithdrawal for pre-electra spec");
}
return schemaDefinitionsElectra
.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public enum BeaconStateFields implements SszFieldName {
HISTORICAL_SUMMARIES,
// Electra fields
DEPOSIT_RECEIPTS_START_INDEX,

DEPOSIT_BALANCE_TO_CONSUME,
EXIT_BALANCE_TO_CONSUME,
EARLIEST_EXIT_EPOCH,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ static MutableBeaconStateElectra required(final MutableBeaconState state) {
@Override
BeaconStateElectra commitChanges();

@Override
default Optional<MutableBeaconStateElectra> toMutableVersionElectra() {
return Optional.of(this);
}

default void setDepositReceiptsStartIndex(final UInt64 depositReceiptsStartIndex) {
final int fieldIndex =
getSchema().getFieldIndex(BeaconStateFields.DEPOSIT_RECEIPTS_START_INDEX);
set(fieldIndex, SszUInt64.of(depositReceiptsStartIndex));
}

@Override
default Optional<MutableBeaconStateElectra> toMutableVersionElectra() {
return Optional.of(this);
}

default void setDepositBalanceToConsume(final UInt64 depositBalanceToConsume) {
final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.DEPOSIT_BALANCE_TO_CONSUME);
set(fieldIndex, SszUInt64.of(depositBalanceToConsume));
Expand Down

0 comments on commit e8eee85

Please sign in to comment.