File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -444,6 +444,9 @@ export class DebugImpl implements Debug {
444
444
throw predefined . RESOURCE_NOT_FOUND ( `Failed to retrieve contract results for transaction ${ transactionHash } ` ) ;
445
445
}
446
446
447
+ // return empty array if no actions
448
+ if ( actionsResponse . length === 0 ) return [ ] ;
449
+
447
450
const { call_type : type } = actionsResponse [ 0 ] ;
448
451
const formattedActions = await this . formatActionsResult ( actionsResponse , requestDetails ) ;
449
452
Original file line number Diff line number Diff line change @@ -422,6 +422,19 @@ describe('Debug API Test Suite', async function () {
422
422
423
423
expect ( result ) . to . deep . equal ( expectedResult ) ;
424
424
} ) ;
425
+
426
+ it ( 'Should return empty array if no actions found' , async function ( ) {
427
+ restMock . onGet ( CONTARCTS_RESULTS_ACTIONS ) . reply ( 200 , JSON . stringify ( { actions : [ ] } ) ) ;
428
+
429
+ const result = await debugService . traceTransaction (
430
+ transactionHash ,
431
+ callTracer ,
432
+ tracerConfigFalse ,
433
+ requestDetails ,
434
+ ) ;
435
+
436
+ expect ( result ) . to . be . empty ;
437
+ } ) ;
425
438
} ) ;
426
439
427
440
describe ( 'opcodeLogger' , async function ( ) {
You can’t perform that action at this time.
0 commit comments