diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2Test.java index 55776b1d8be..2800d53a1be 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2Test.java @@ -131,18 +131,12 @@ public void shouldReturnInvalidIfWithdrawalsIsNotNull_WhenWithdrawalsProhibited( @Test public void shouldValidateBlobGasUsedCorrectly() { // V2 should return error if non-null blobGasUsed - final List withdrawals = List.of(); - lenient() - .when(protocolSpec.getWithdrawalsValidator()) - .thenReturn(new WithdrawalsValidator.ProhibitedWithdrawals()); - BlockHeader blockHeader = createBlockHeaderFixture(Optional.of(Collections.emptyList()), Optional.empty()) .blobGasUsed(100L) .buildHeader(); - var resp = resp(mockEnginePayload(blockHeader, Collections.emptyList(), withdrawals, null)); - + var resp = resp(mockEnginePayload(blockHeader, Collections.emptyList(), List.of(), null)); final JsonRpcError jsonRpcError = fromErrorResp(resp); assertThat(jsonRpcError.getCode()).isEqualTo(INVALID_PARAMS.getCode()); assertThat(jsonRpcError.getData()).isEqualTo("non-nil BlobGasUsed pre-cancun"); @@ -152,17 +146,12 @@ public void shouldValidateBlobGasUsedCorrectly() { @Test public void shouldValidateExcessBlobGasCorrectly() { // V2 should return error if non-null ExcessBlobGas - final List withdrawals = List.of(); - lenient() - .when(protocolSpec.getWithdrawalsValidator()) - .thenReturn(new WithdrawalsValidator.ProhibitedWithdrawals()); - BlockHeader blockHeader = createBlockHeaderFixture(Optional.of(Collections.emptyList()), Optional.empty()) .excessBlobGas(BlobGas.MAX_BLOB_GAS) .buildHeader(); - var resp = resp(mockEnginePayload(blockHeader, Collections.emptyList(), withdrawals, null)); + var resp = resp(mockEnginePayload(blockHeader, Collections.emptyList(), List.of(), null)); final JsonRpcError jsonRpcError = fromErrorResp(resp); assertThat(jsonRpcError.getCode()).isEqualTo(INVALID_PARAMS.getCode()); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3Test.java index af227ac0383..56cecbfb7db 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3Test.java @@ -31,7 +31,6 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequest; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.EnginePayloadParameter; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.WithdrawalParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcError; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; @@ -42,7 +41,6 @@ import org.hyperledger.besu.ethereum.core.Withdrawal; import org.hyperledger.besu.ethereum.mainnet.BodyValidation; import org.hyperledger.besu.ethereum.mainnet.ValidationResult; -import org.hyperledger.besu.ethereum.mainnet.WithdrawalsValidator; import org.hyperledger.besu.evm.gascalculator.CancunGasCalculator; import java.util.Collections; @@ -165,18 +163,13 @@ public void shouldReturnValidIfProtocolScheduleIsEmpty() { @Override public void shouldValidateBlobGasUsedCorrectly() { // V3 must return error if null blobGasUsed - final List withdrawals = List.of(); - lenient() - .when(protocolSpec.getWithdrawalsValidator()) - .thenReturn(new WithdrawalsValidator.ProhibitedWithdrawals()); - BlockHeader blockHeader = createBlockHeaderFixture(Optional.of(Collections.emptyList()), Optional.empty()) .excessBlobGas(BlobGas.MAX_BLOB_GAS) .blobGasUsed(null) .buildHeader(); - var resp = resp(mockEnginePayload(blockHeader, Collections.emptyList(), withdrawals, null)); + var resp = resp(mockEnginePayload(blockHeader, Collections.emptyList(), List.of(), null)); final JsonRpcError jsonRpcError = fromErrorResp(resp); assertThat(jsonRpcError.getCode()).isEqualTo(INVALID_PARAMS.getCode()); @@ -188,18 +181,13 @@ public void shouldValidateBlobGasUsedCorrectly() { @Override public void shouldValidateExcessBlobGasCorrectly() { // V3 must return error if null excessBlobGas - final List withdrawals = List.of(); - lenient() - .when(protocolSpec.getWithdrawalsValidator()) - .thenReturn(new WithdrawalsValidator.ProhibitedWithdrawals()); - BlockHeader blockHeader = createBlockHeaderFixture(Optional.of(Collections.emptyList()), Optional.empty()) .excessBlobGas(null) .blobGasUsed(100L) .buildHeader(); - var resp = resp(mockEnginePayload(blockHeader, Collections.emptyList(), withdrawals, null)); + var resp = resp(mockEnginePayload(blockHeader, Collections.emptyList(), List.of(), null)); final JsonRpcError jsonRpcError = fromErrorResp(resp); assertThat(jsonRpcError.getCode()).isEqualTo(INVALID_PARAMS.getCode());