Skip to content

Commit 09ae045

Browse files
committed
fix: fixed return typed
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
1 parent b748814 commit 09ae045

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/relay/src/lib/debug.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ export class DebugImpl implements Debug {
429429
transactionHash: string,
430430
tracerConfig: ICallTracerConfig,
431431
requestDetails: RequestDetails,
432-
): Promise<CallTracerResult> {
432+
): Promise<CallTracerResult | null> {
433433
try {
434434
const [actionsResponse, transactionsResponse] = await Promise.all([
435435
this.mirrorNodeClient.getContractsResultsActions(transactionHash, requestDetails),
@@ -445,7 +445,7 @@ export class DebugImpl implements Debug {
445445
}
446446

447447
// return empty array if no actions
448-
if (actionsResponse.length === 0) return [];
448+
if (actionsResponse.length === 0) return null;
449449

450450
const { call_type: type } = actionsResponse[0];
451451
const formattedActions = await this.formatActionsResult(actionsResponse, requestDetails);

packages/relay/src/lib/types/debug.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ export interface TraceBlockByNumberTxResult {
7373
/**
7474
* The result of the trace, which can be either a {@link CallTracerResult} or an {@link EntityTraceStateMap}.
7575
*/
76-
result: CallTracerResult | EntityTraceStateMap;
76+
result: CallTracerResult | EntityTraceStateMap | null;
7777
}

packages/relay/tests/lib/debug.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ describe('Debug API Test Suite', async function () {
433433
requestDetails,
434434
);
435435

436-
expect(result).to.be.empty;
436+
expect(result).to.be.null;
437437
});
438438
});
439439

0 commit comments

Comments
 (0)