Skip to content

Commit b14340f

Browse files
committed
Update integration test and add changelog for debug_traceTransaction error response
Updated DebugTraceTransactionIntegrationTest to expect JsonRpcErrorResponse instead of success with null for unknown transaction hash. Added changelog entry covering both debug_traceTransaction (besu-eth#10150) and debug_traceBlockByNumber (besu-eth#10133) error response changes. Refs: besu-eth#10115 Signed-off-by: Vivek Singh Solanki <viveksolanki0509@gmail.com>
1 parent 32035e7 commit b14340f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Removed `TransactionSelectionResult.BLOCK_OCCUPANCY_ABOVE_THRESHOLD`, in general it could be replaced with `BLOCK_FULL`
1313
- Experimental Bonsai Archive column families have changed to improve performance during bonsai to archive migration. If you are using the Bonsai archive you will need to do a full resync [#10058](https://github.com/besu-eth/besu/pull/10058/changes)
1414
- `debug_traceTransaction` and `debug_traceBlockByNumber`: the `error` field in `StructLog` entries is now serialized as a plain string (e.g. `"INVALID_JUMP_DESTINATION"`) instead of an array of strings, aligning with the execution-apis opcode tracer spec. [#10117](https://github.com/besu-eth/besu/pull/10117)
15+
- `debug_traceTransaction` now returns a JSON-RPC error response (`-32000: Transaction not found`) instead of a success response with `null` result when the transaction hash is unknown [#10150](https://github.com/besu-eth/besu/pull/10150). `debug_traceBlockByNumber` now returns a JSON-RPC error response (`-32000: genesis is not traceable`) instead of a success response with `null` result when tracing the genesis block [#10133](https://github.com/besu-eth/besu/pull/10133).
1516

1617
### Upcoming Breaking Changes
1718
- RPC changes to enhance compatibility with other ELs

ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext;
2525
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcParameters;
2626
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod;
27+
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse;
2728
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse;
2829
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
30+
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType;
2931
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.CallTracerResult;
3032
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.OpCodeLoggerTracerResult;
3133
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.StructLog;
@@ -95,10 +97,11 @@ public void debugTraceTransactionMissingTest() {
9597
};
9698
final JsonRpcRequestContext request =
9799
new JsonRpcRequestContext(new JsonRpcRequest("2.0", DEBUG_TRACE_TRANSACTION, params));
98-
final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(null, null);
99-
100100
final JsonRpcResponse response = method.response(request);
101-
assertThat(response).usingRecursiveComparison().isEqualTo(expectedResponse);
101+
assertThat(response).isInstanceOf(JsonRpcErrorResponse.class);
102+
final JsonRpcErrorResponse errorResponse = (JsonRpcErrorResponse) response;
103+
assertThat(errorResponse.getErrorType())
104+
.isEqualByComparingTo(RpcErrorType.TRANSACTION_NOT_FOUND);
102105
}
103106

104107
@Test

0 commit comments

Comments
 (0)