mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
adding checksum conversion (#12209)
This commit is contained in:
parent
0e57973db8
commit
62876f26b3
@ -1,4 +1,7 @@
|
|||||||
import { isValidHexAddress } from '../../../shared/modules/hexstring-utils';
|
import {
|
||||||
|
isValidHexAddress,
|
||||||
|
toChecksumHexAddress,
|
||||||
|
} from '../../../shared/modules/hexstring-utils';
|
||||||
|
|
||||||
let iconFactory;
|
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.
|
// 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
|
// And since the token.address from allTokens is checksumaddress
|
||||||
// tokenAddress have to be changed to lowercase when we are using dynamic list
|
// 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)) {
|
if (iconExistsFor(addr, tokenList)) {
|
||||||
return imageElFor(addr, useTokenDetection, tokenList);
|
return imageElFor(addr, useTokenDetection, tokenList);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user