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

Refactor useResolveAddressMultichain to useResolveENSName #2637

Merged

Conversation

Da-Colon
Copy link
Contributor

@Da-Colon Da-Colon commented Dec 16, 2024

@adamgall

Very similar to useAddress.

Main difference it that the execution the lookup doesn't kickoff via useEffect but rather the hook spits out the function to be used as directed.

if you prefer I just refactor this back and fit useAddress in I can do that. I just prefer using a callback function to time the execution

@Da-Colon Da-Colon requested a review from adamgall December 16, 2024 20:33
@Da-Colon Da-Colon changed the base branch from develop to issue/2565-network-config-updates December 16, 2024 20:33
Copy link

netlify bot commented Dec 16, 2024

Deploy Preview for decent-interface-dev ready!

Name Link
🔨 Latest commit 30b14dc
🔍 Latest deploy log https://app.netlify.com/sites/decent-interface-dev/deploys/67609931fee9360008564d6e
😎 Deploy Preview https://deploy-preview-2637.app.dev.decentdao.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Da-Colon Da-Colon force-pushed the issue/2565-resolve-mainnet-ens branch from 4cbf0c5 to 8fc85e2 Compare December 16, 2024 20:47
@Da-Colon Da-Colon changed the title Issue/2565 resolve mainnet ens Refactor useResolveAddressMultichain to useResolveENSName Dec 16, 2024
@Da-Colon Da-Colon self-assigned this Dec 16, 2024
Comment on lines 50 to 58
try {
const resolvedAddress = await mainnetPublicClient.getEnsAddress({ name: normalizedName });
if (resolvedAddress) {
returnedResult.resolvedAddress = resolvedAddress;
returnedResult.isValid = true;
}
} catch {
// do nothing
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this try/catch is necessary any longer. I believe it was here previously to catch the error in .getEnsAddress when the call was made on a network that didn't ahve the ENS contracts deployed (all of them except for mainnet and sepolia IIRC).

@Da-Colon Da-Colon requested a review from adamgall December 16, 2024 21:20
@Da-Colon Da-Colon merged commit 5d4c6fd into issue/2565-network-config-updates Dec 16, 2024
7 checks passed
@Da-Colon Da-Colon deleted the issue/2565-resolve-mainnet-ens branch December 16, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants