diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-08-09 08:58:04 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-08-09 08:58:04 +0800 |
commit | c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b (patch) | |
tree | d3c9aa67714c0b9494762bff3ca7e545d36789dc /packages | |
parent | 5b7774f9d00a0f80601e6ff4ed0920c6a150a350 (diff) | |
download | dexon-sol-tools-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar dexon-sol-tools-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar.gz dexon-sol-tools-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar.bz2 dexon-sol-tools-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar.lz dexon-sol-tools-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar.xz dexon-sol-tools-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar.zst dexon-sol-tools-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.zip |
Update comment about ethers checksummed address behavior
Diffstat (limited to 'packages')
-rw-r--r-- | packages/utils/src/abi_utils.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/utils/src/abi_utils.ts b/packages/utils/src/abi_utils.ts index fc64a2a89..c9b70966c 100644 --- a/packages/utils/src/abi_utils.ts +++ b/packages/utils/src/abi_utils.ts @@ -96,9 +96,9 @@ function isAbiDataEqual(name: ethers.ParamName, type: string, x: any, y: any): b } return true; } else if (type === 'address' || type === 'bytes') { - // HACK(albrow): ethers.js sometimes changes the case of addresses/bytes - // when decoding/encoding. To account for that, we convert to lowercase - // before comparing. + // HACK(albrow): ethers.js returns the checksummed address even when + // initially passed in a non-checksummed address. To account for that, + // we convert to lowercase before comparing. return _.isEqual(_.toLower(x), _.toLower(y)); } else if (_.startsWith(type, 'uint') || _.startsWith(type, 'int')) { return new BigNumber(x).eq(new BigNumber(y)); |