Skip to content

Commit

Permalink
5098: Update RpcErrorType.INVALID_EXCESS_BLOB_GAS_PARAMS
Browse files Browse the repository at this point in the history
Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>
  • Loading branch information
Matilda-Clerke committed Aug 13, 2024
1 parent a70a150 commit 2db0f4b
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -494,7 +494,7 @@ protected ValidationResult<RpcErrorType> validateBlobs(
if (maybeParentHeader.isPresent()) {
if (!validateExcessBlobGas(header, maybeParentHeader.get(), protocolSpec)) {
return ValidationResult.invalid(
RpcErrorType.INVALID_PARAMS,
RpcErrorType.INVALID_EXCESS_BLOB_GAS_PARAMS,
"Payload excessBlobGas does not match calculated excessBlobGas");
}
}
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ protected ValidationResult<RpcErrorType> validateParameters(
}
if (payloadParameter.getExcessBlobGas() != null) {
return ValidationResult.invalid(
RpcErrorType.INVALID_PARAMS, "non-null ExcessBlobGas pre-cancun");
RpcErrorType.INVALID_EXCESS_BLOB_GAS_PARAMS, "Missing excess blob gas field");
}
return ValidationResult.valid();
}
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ protected ValidationResult<RpcErrorType> validateParameters(
return ValidationResult.invalid(
RpcErrorType.INVALID_BLOB_GAS_USED_PARAMS, "Missing blob gas used field");
} else if (payloadParameter.getExcessBlobGas() == null) {
return ValidationResult.invalid(RpcErrorType.INVALID_PARAMS, "Missing blob gas fields");
return ValidationResult.invalid(RpcErrorType.INVALID_EXCESS_BLOB_GAS_PARAMS, "Missing excess blob gas field");
} else if (maybeVersionedHashParam == null || maybeVersionedHashParam.isEmpty()) {
return ValidationResult.invalid(
RpcErrorType.INVALID_PARAMS, "Missing versioned hashes field");
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ protected ValidationResult<RpcErrorType> validateParameters(
RpcErrorType.INVALID_BLOB_GAS_USED_PARAMS, "Missing blob gas used field");
} else if (payloadParameter.getExcessBlobGas() == null) {
return ValidationResult.invalid(
RpcErrorType.INVALID_PARAMS, "non-null ExcessBlobGas pre-cancun");
RpcErrorType.INVALID_EXCESS_BLOB_GAS_PARAMS, "Missing excess blob gas field");
} else if (maybeVersionedHashParam == null || maybeVersionedHashParam.isEmpty()) {
return ValidationResult.invalid(
RpcErrorType.INVALID_PARAMS, "Missing versioned hashes field");
Original file line number Diff line number Diff line change
@@ -170,7 +170,7 @@ public void shouldValidateExcessBlobGasCorrectly() {

final JsonRpcError jsonRpcError = fromErrorResp(resp);
assertThat(jsonRpcError.getCode()).isEqualTo(INVALID_PARAMS.getCode());
assertThat(jsonRpcError.getData()).isEqualTo("non-null ExcessBlobGas pre-cancun");
assertThat(jsonRpcError.getData()).isEqualTo("Missing excess blob gas field");
verify(engineCallListener, times(1)).executionEngineCalled();
}

Original file line number Diff line number Diff line change
@@ -219,7 +219,7 @@ public void shouldValidateExcessBlobGasCorrectly() {

final JsonRpcError jsonRpcError = fromErrorResp(resp);
assertThat(jsonRpcError.getCode()).isEqualTo(INVALID_PARAMS.getCode());
assertThat(jsonRpcError.getData()).isEqualTo("Missing blob gas fields");
assertThat(jsonRpcError.getData()).isEqualTo("Missing excess blob gas field");
verify(engineCallListener, times(1)).executionEngineCalled();
}

0 comments on commit 2db0f4b

Please sign in to comment.