Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use toUnicode function to normalize ens domains in the UI #29231

6 changes: 5 additions & 1 deletion ui/selectors/selectors.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { toUnicode } from 'punycode/punycode.js';
import { SubjectType } from '@metamask/permission-controller';
import { ApprovalType } from '@metamask/controller-utils';
import {
Expand Down Expand Up @@ -729,7 +730,10 @@ export function getAddressBook(state) {

export function getEnsResolutionByAddress(state, address) {
if (state.metamask.ensResolutionsByAddress[address]) {
return state.metamask.ensResolutionsByAddress[address];
const ensResolution = state.metamask.ensResolutionsByAddress[address];
// ensResolution is a punycode encoded string hence toUnicode is used to decode it from same package
const normalizedEnsResolution = toUnicode(ensResolution);
return normalizedEnsResolution;
}

const entry =
Expand Down
Loading