diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1.java index 5ebaffa3fc3..77c0521a325 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1.java @@ -27,6 +27,7 @@ import org.hyperledger.besu.ethereum.chain.Blockchain; import java.util.Arrays; +import java.util.List; import java.util.stream.Collectors; import io.vertx.core.Vertx; @@ -55,7 +56,10 @@ public String getName() { public JsonRpcResponse syncResponse(final JsonRpcRequestContext request) { engineCallListener.executionEngineCalled(); - final Hash[] blockHashes = request.getRequiredParameter(0, Hash[].class); + final List blockHashes = + Arrays.stream(request.getRequest().getParams()) + .map(Hash.class::cast) + .collect(Collectors.toList()); traceLambda(LOG, "{} parameters: blockHashes {}", () -> getName(), () -> blockHashes); @@ -63,6 +67,6 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext request) { return new JsonRpcSuccessResponse( request.getRequest().getId(), blockResultFactory.payloadBodiesCompleteV1( - Arrays.stream(blockHashes).map(blockchain::getBlockBody).collect(Collectors.toList()))); + blockHashes.stream().map(blockchain::getBlockBody).collect(Collectors.toList()))); } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1Test.java index e5724c23e3e..f0bc8d75503 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1Test.java @@ -224,9 +224,7 @@ private JsonRpcResponse resp(final Hash[] hashes) { return method.response( new JsonRpcRequestContext( new JsonRpcRequest( - "2.0", - RpcMethod.ENGINE_GET_PAYLOAD_BODIES_BY_HASH_V1.getMethodName(), - new Object[] {hashes}))); + "2.0", RpcMethod.ENGINE_GET_PAYLOAD_BODIES_BY_HASH_V1.getMethodName(), hashes))); } private EngineGetPayloadBodiesResultV1 fromSuccessResp(final JsonRpcResponse resp) {