Skip to content

Commit 8348448

Browse files
improve comment to explain why we cannot use deepClone from hh-utils
1 parent a2c6746 commit 8348448

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

v-next/hardhat-ethers/src/internal/signers/deep-copy.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const PRIMITIVE = [
1212

1313
export async function deepCopy<T = any>(value: T): Promise<T> {
1414
// The function 'deepClone' from 'hardhat-utils' cannot be used to replace this function, it won't properly clone
15-
// the value.
15+
// the value. The reason is that 'deepClone' doesn't handle certain custom cases,
16+
// such as skipping objects with a getAddress method and treating primitive types explicitly.
17+
// These custom checks are necessary for correct behavior in our use case.
1618

1719
if (
1820
value === null ||

0 commit comments

Comments
 (0)