Skip to content

Commit 3c8a3c5

Browse files
committed
chore: update coverage data type
1 parent 2bfc953 commit 3c8a3c5

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

v-next/hardhat/src/internal/builtin-plugins/coverage/hook-handlers/solidity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default async (): Promise<Partial<SolidityHooks>> => ({
6363
context.config.paths.root,
6464
fsPath,
6565
);
66-
const tag = m.tag.toString("hex");
66+
const tag = Buffer.from(m.tag).toString("hex");
6767
const startLine = lineNumbers[m.startUtf16];
6868
const endLine = lineNumbers[m.endUtf16 - 1];
6969
coverageMetadata.push({
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export interface CoverageConfig {
2-
onCollectedCoverageCallback: (coverageData: Buffer[]) => void;
2+
onCollectedCoverageCallback: (coverageData: Uint8Array[]) => void;
33
}

v-next/hardhat/src/internal/builtin-plugins/network-manager/network-manager.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,12 @@ export class NetworkManagerImplementation implements NetworkManager {
225225
);
226226
if (shouldEnableCoverage) {
227227
coverageConfig = {
228-
onCollectedCoverageCallback: (coverageData: Buffer[]) => {
228+
onCollectedCoverageCallback: (coverageData: Uint8Array[]) => {
229229
// NOTE: We cast the tag we receive from EDR to a hex string to
230230
// make it easier to debug.
231-
const tags = coverageData.map((tag) => tag.toString("hex"));
231+
const tags = coverageData.map((tag) =>
232+
Buffer.from(tag).toString("hex"),
233+
);
232234
void hookManager.runParallelHandlers(
233235
"network",
234236
"onCoverageData",

0 commit comments

Comments
 (0)