Skip to content

Commit

Permalink
Extract check to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Dec 6, 2024
1 parent 505c459 commit 0fa8cff
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ export function getDomainHash({
safeAddress: string
safeVersion: SafeVersion
}): string {
const includeChainId = semverSatisfies(safeVersion, NEW_DOMAIN_TYPE_HASH_VERSION)
return TypedDataEncoder.hashDomain({
...(semverSatisfies(safeVersion, NEW_DOMAIN_TYPE_HASH_VERSION) && { chainId }),
...(includeChainId && { chainId }),
verifyingContract: safeAddress,
})
}
Expand Down

0 comments on commit 0fa8cff

Please sign in to comment.