Skip to content

Commit ddadd4c

Browse files
fvictorioschaable
authored andcommitted
Improve stack traces test error when transaction reverts
1 parent af56e77 commit ddadd4c

File tree

1 file changed

+3
-3
lines changed
  • packages/hardhat-core/test/internal/hardhat-network/stack-traces

1 file changed

+3
-3
lines changed

packages/hardhat-core/test/internal/hardhat-network/stack-traces/test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -544,16 +544,14 @@ async function runTest(
544544
);
545545
}
546546

547-
compareConsoleLogs(logger.lines, tx.consoleLogs);
548-
549547
const vmTraceDecoder = (provider as any)._vmTraceDecoder as VmTraceDecoder;
550548
const decodedTrace = vmTraceDecoder.tryToDecodeMessageTrace(trace);
551549

552550
try {
553551
if (tx.stackTrace === undefined) {
554552
assert.isFalse(
555553
trace.exit.isError(),
556-
`Transaction ${txIndex} shouldn't have failed`
554+
`Transaction ${txIndex} shouldn't have failed (${trace.exit.getReason()})`
557555
);
558556
} else {
559557
assert.isDefined(
@@ -588,6 +586,8 @@ async function runTest(
588586
throw err;
589587
}
590588
}
589+
590+
compareConsoleLogs(logger.lines, tx.consoleLogs);
591591
}
592592
}
593593

0 commit comments

Comments
 (0)