Skip to content

Commit

Permalink
Merge pull request #5558 from NomicFoundation/fix/issue-543
Browse files Browse the repository at this point in the history
fix: issue 543
  • Loading branch information
fvictorio authored Aug 6, 2024
2 parents 61b2bf2 + f5d5d15 commit 69c59e9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-ravens-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hardhat": patch
---

Fixed an issue with `debug_traceTransaction` when large responses were generated
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,13 @@ export class EdrProviderWrapper
const responseObject: Response = await this._provider.handleRequest(
stringifiedArgs
);
const response = JSON.parse(responseObject.json);

let response;
if (typeof responseObject.data === "string") {
response = JSON.parse(responseObject.data);
} else {
response = responseObject.data;
}

const needsTraces =
this._node._vm.evm.events.eventNames().length > 0 ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ export function getMinimalEthereumJsVm(
})
);

const response = JSON.parse(responseObject.json);
let response;
if (typeof responseObject.data === "string") {
response = JSON.parse(responseObject.data);
} else {
response = responseObject.data;
}

return Buffer.from(response.result.slice(2), "hex");
},
Expand Down

0 comments on commit 69c59e9

Please sign in to comment.