Skip to content

Commit

Permalink
fix issue for DebugTraceTransaction and add tests for traceBlock apis
Browse files Browse the repository at this point in the history
Signed-off-by: Karim Taam <[email protected]>
  • Loading branch information
matkt committed Jan 31, 2025
1 parent 5eb91fa commit c089e73
Show file tree
Hide file tree
Showing 7 changed files with 1,663 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.DebugTraceTransactionResult;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.DebugTraceTransactionDetails;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.api.query.TransactionWithMetadata;
import org.hyperledger.besu.ethereum.debug.TraceOptions;
Expand Down Expand Up @@ -76,7 +76,7 @@ public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
RpcErrorType.INVALID_TRANSACTION_TRACE_PARAMS,
e);
}
final DebugTraceTransactionResult debugTraceTransactionResult =
final DebugTraceTransactionDetails debugTraceTransactionResult =
debugTraceTransactionResult(hash, transactionWithMetadata.get(), traceOptions);

return new JsonRpcSuccessResponse(
Expand All @@ -86,7 +86,7 @@ public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
}
}

private DebugTraceTransactionResult debugTraceTransactionResult(
private DebugTraceTransactionDetails debugTraceTransactionResult(
final Hash hash,
final TransactionWithMetadata transactionWithMetadata,
final TraceOptions traceOptions) {
Expand All @@ -100,7 +100,7 @@ private DebugTraceTransactionResult debugTraceTransactionResult(
mutableWorldState ->
transactionTracer
.traceTransaction(mutableWorldState, blockHash, hash, execTracer)
.map(DebugTraceTransactionResult::new))
.map(DebugTraceTransactionDetails::new))
.orElse(null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ protected BlockchainSetupUtil getBlockchainSetupUtil(final DataStorageFormat sto
}

public static Object[][] specs() {
return AbstractJsonRpcHttpBySpecTest.findSpecFiles(new String[] {"debug/trace-call"});
return AbstractJsonRpcHttpBySpecTest.findSpecFiles(
new String[] {"debug/trace-call", "debug/trace-block"});
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ protected BlockchainSetupUtil getBlockchainSetupUtil(final DataStorageFormat sto
}

public static Object[][] specs() {
return AbstractJsonRpcHttpBySpecTest.findSpecFiles(new String[] {"debug/trace-call"});
return AbstractJsonRpcHttpBySpecTest.findSpecFiles(
new String[] {"debug/trace-call", "debug/trace-block"});
}

@Test
Expand Down
Loading

0 comments on commit c089e73

Please sign in to comment.