Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"jsonrpc": "2.0",
"id": 67,
"error": {
"code": -38003,
"message": "Invalid payload attributes"
"code": -32602,
"message": "Invalid withdrawals"
}
},
"statusCode": 200
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"jsonrpc" : "2.0",
"id" : 67,
"error" : {
"code" : -32602,
"message" : "Invalid withdrawals"
"code" : -38003,
"message" : "Invalid payload attributes"
}
},
"statusCode" : 200
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext)
if (!getWithdrawalsValidator(
protocolSchedule.get(), newHead, maybePayloadAttributes.get().getTimestamp())
.validateWithdrawals(withdrawals)) {
return new JsonRpcErrorResponse(requestId, RpcErrorType.INVALID_WITHDRAWALS_PARAMS);
return new JsonRpcErrorResponse(requestId, getInvalidPayloadAttributesError());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,9 @@ protected boolean requireTerminalPoWBlockValidation() {
protected RpcErrorType getInvalidParametersError() {
return RpcErrorType.INVALID_PAYLOAD_ATTRIBUTES;
}

@Override
protected RpcErrorType getInvalidPayloadAttributesError() {
return RpcErrorType.INVALID_WITHDRAWALS_PARAMS;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public void shouldReturnValidWithoutFinalizedWithPayload() {

var payloadParams =
new EnginePayloadAttributesParameter(
String.valueOf(defaultPayloadTimestamp()),
String.valueOf(mockHeader.getTimestamp() + 1),
Bytes32.fromHexStringLenient("0xDEADBEEF").toHexString(),
Address.ECREC.toString(),
null,
Expand Down Expand Up @@ -431,7 +431,7 @@ public void shouldIgnoreUpdateToOldHeadAndNotPreparePayload() {

var payloadParams =
new EnginePayloadAttributesParameter(
String.valueOf(defaultPayloadTimestamp()),
String.valueOf(mockHeader.getTimestamp() + 1),
Bytes32.fromHexStringLenient("0xDEADBEEF").toHexString(),
Address.ECREC.toString(),
null,
Expand Down Expand Up @@ -483,7 +483,7 @@ public void shouldReturnInvalidIfPayloadTimestampNotGreaterThanHead() {
mockHeader.getHash(), Hash.ZERO, mockParent.getHash()),
Optional.of(payloadParams));

assertInvalidForkchoiceState(resp, RpcErrorType.INVALID_PAYLOAD_ATTRIBUTES);
assertInvalidForkchoiceState(resp, expectedInvalidPayloadError());
verify(engineCallListener, times(1)).executionEngineCalled();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ protected String getMethodName() {

@Override
protected RpcErrorType expectedInvalidPayloadError() {
return RpcErrorType.INVALID_WITHDRAWALS_PARAMS;
return RpcErrorType.INVALID_PAYLOAD_ATTRIBUTES;
}
}
Loading