Skip to content

Commit 13eeb1d

Browse files
committed
fix: issue 543
1 parent 6c943bb commit 13eeb1d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

packages/hardhat-core/src/internal/hardhat-network/provider/provider.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,13 @@ export class EdrProviderWrapper
354354
const responseObject: Response = await this._provider.handleRequest(
355355
stringifiedArgs
356356
);
357-
const response = JSON.parse(responseObject.json);
357+
358+
let response;
359+
if (typeof responseObject.data === "string") {
360+
response = JSON.parse(responseObject.data);
361+
} else {
362+
response = responseObject.data;
363+
}
358364

359365
const needsTraces =
360366
this._node._vm.evm.events.eventNames().length > 0 ||

packages/hardhat-core/src/internal/hardhat-network/provider/vm/minimal-vm.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ export function getMinimalEthereumJsVm(
8282
})
8383
);
8484

85-
const response = JSON.parse(responseObject.json);
85+
let response;
86+
if (typeof responseObject.data === "string") {
87+
response = JSON.parse(responseObject.data);
88+
} else {
89+
response = responseObject.data;
90+
}
8691

8792
return Buffer.from(response.result.slice(2), "hex");
8893
},

0 commit comments

Comments
 (0)