File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -366,8 +366,16 @@ export async function getEmulationWithStack(
366
366
let gasRemaining = 0 ;
367
367
let tryCatchError : { code : number ; text : string } | undefined = undefined ;
368
368
const logs = txRes . result . vmLog ;
369
- //console.log('vmlogs:', logs);
370
369
const lines = logs . split ( '\n' ) ;
370
+ let isStackAfter = ( i : number ) => {
371
+ // go for all next lines until we find one starting with "stack:""
372
+ for ( let j = i + 1 ; j < lines . length ; j ++ ) {
373
+ if ( lines [ j ] . startsWith ( 'stack:' ) ) {
374
+ return true ;
375
+ }
376
+ }
377
+ return false ;
378
+ }
371
379
for ( let i = 0 ; i < lines . length ; i ++ ) {
372
380
let line = lines [ i ] ;
373
381
if ( line . startsWith ( 'execute' ) ) {
@@ -440,7 +448,7 @@ export async function getEmulationWithStack(
440
448
exitCode = Number ( line . slice ( 57 ) ) ;
441
449
explanation = line ;
442
450
}
443
- if ( i === lines . length - 1 ) {
451
+ if ( ! isStackAfter ( i ) ) { // if last
444
452
TVMResult . push ( {
445
453
instruction,
446
454
price : undefined ,
You can’t perform that action at this time.
0 commit comments