Skip to content

Commit

Permalink
improve comment to explain why we cannot use deepClone from hh-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherDedominici committed Oct 2, 2024
1 parent a2c6746 commit 8348448
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion v-next/hardhat-ethers/src/internal/signers/deep-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const PRIMITIVE = [

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

if (
value === null ||
Expand Down

0 comments on commit 8348448

Please sign in to comment.