Skip to content

Commit f8df64d

Browse files
committed
chore: apply code review suggestions
1 parent 3a23dec commit f8df64d

File tree

1 file changed

+13
-4
lines changed
  • v-next/hardhat/src/internal/builtin-plugins/solidity-test

1 file changed

+13
-4
lines changed

v-next/hardhat/src/internal/builtin-plugins/solidity-test/formatters.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,11 @@ function formatTrace(trace: CallTrace): NestedArray<string> {
116116
let closingLine: string | undefined;
117117
if (kind === CallKind.Create) {
118118
openingLine = `[${gasUsed}] ${chalk.yellow("→ new")} ${contract}`;
119-
if (formattedInputs !== undefined) {
120-
openingLine = `${openingLine}@${formattedInputs}`;
121-
}
119+
// TODO: Uncomment this when the formattedInputs starts containing
120+
// the address of where the contract was deployed instead of the code.
121+
// if (formattedInputs !== undefined) {
122+
// openingLine = `${openingLine}@${formattedInputs}`;
123+
// }
122124
} else {
123125
const formattedKind = formatKind(kind);
124126
openingLine = `[${gasUsed}] ${color(contract)}`;
@@ -133,7 +135,14 @@ function formatTrace(trace: CallTrace): NestedArray<string> {
133135
}
134136
}
135137
if (formattedOutputs !== undefined) {
136-
closingLine = `${color("←")} ${formattedOutputs}`;
138+
if (
139+
formattedOutputs === "EvmError: Revert" ||
140+
formattedOutputs.startsWith("revert:")
141+
) {
142+
closingLine = `${color("←")} ${color("[Revert]")} ${formattedOutputs}`;
143+
} else {
144+
closingLine = `${color("←")} ${formattedOutputs}`;
145+
}
137146
}
138147

139148
const lines = [];

0 commit comments

Comments
 (0)