From c076faeb8fde82d4997bca3a0955cd6b34e5450f Mon Sep 17 00:00:00 2001 From: Niranjana Binoy <43930900+NiranjanaBinoy@users.noreply.github.com> Date: Mon, 27 Sep 2021 09:58:12 -0400 Subject: [PATCH] adding checksum conversion (#12209) --- ui/helpers/utils/icon-factory.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/helpers/utils/icon-factory.js b/ui/helpers/utils/icon-factory.js index f5a36b9f9..c7f2e5260 100644 --- a/ui/helpers/utils/icon-factory.js +++ b/ui/helpers/utils/icon-factory.js @@ -1,4 +1,7 @@ -import { isValidHexAddress } from '../../../shared/modules/hexstring-utils'; +import { + isValidHexAddress, + toChecksumHexAddress, +} from '../../../shared/modules/hexstring-utils'; let iconFactory; @@ -25,7 +28,9 @@ IconFactory.prototype.iconForAddress = function ( // So the flag indicates whether the address of tokens currently on the tokenList is checksum or not. // And since the token.address from allTokens is checksumaddress // tokenAddress have to be changed to lowercase when we are using dynamic list - const addr = useTokenDetection ? address.toLowerCase() : address; + const addr = useTokenDetection + ? address.toLowerCase() + : toChecksumHexAddress(address); if (iconExistsFor(addr, tokenList)) { return imageElFor(addr, useTokenDetection, tokenList); }