Skip to content

Commit

Permalink
fix: in case of a forge test error, still loads the gas estimation re…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
0xtekgrinder committed May 12, 2024
1 parent ca916ee commit baf70a7
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions vscode/src/gas-estimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,8 @@ async function gasReportTests(cwd: string): Promise<ReportDecorators> {
exec(
"forge test --gas-report",
{ cwd },
async (error: any, _stdout: any, _stderr: any) => {
if (error) {
console.log("error", error);
reject(error);
}

if (_stdout === "null") {
async (_error: any, _stdout: any, _stderr: any) => {
if (_stdout === "null\n") {
resolve();
}

Expand Down Expand Up @@ -169,7 +164,7 @@ async function getGasReport(contracts: string[], cwd: string): Promise<Report> {
reject(error);
}

if (_stdout === "null") {
if (_stdout === "null\n") {
resolve();
}

Expand Down Expand Up @@ -439,5 +434,8 @@ export function registerGasEstimation() {
);
reportsSaved = report;
}
vscode.window.visibleTextEditors.forEach((editor) => {
showReport(editor, reports, reportsSaved, decorationType);
});
});
}

0 comments on commit baf70a7

Please sign in to comment.