Page MenuHomePhabricator

[lib] Introduce getENSNames: async function equivalent to useENSNames
ClosedPublic

Authored by ashoat on Feb 3 2023, 12:19 PM.
Tags
None
Referenced Files
F3294874: D6565.id22046.diff
Sat, Nov 16, 8:27 PM
Unknown Object (File)
Sun, Nov 3, 8:33 PM
Unknown Object (File)
Mon, Oct 28, 12:39 AM
Unknown Object (File)
Mon, Oct 28, 12:39 AM
Unknown Object (File)
Mon, Oct 28, 12:38 AM
Unknown Object (File)
Sep 28 2024, 4:22 AM
Unknown Object (File)
Sep 27 2024, 2:19 PM
Unknown Object (File)
Sep 4 2024, 2:12 PM
Subscribers

Details

Summary

Up until now, we've only needed to do ENS resolutions from the context of a React hook. In that case, we initially show the ETH address, then fetch the ENS name and swap it in once we have it.

In contrast, in other places we need an async function that will fetch the ENS name and return when it's done. Similar to useENSNames, it's useful to have a function that can take an array of objects and swap in the ENS names.

Since getENSNames needs ensContext bound it (and can't fetch it like a hook), I added a bound version of this function to the ENSCacheContext.

Depends on D6564

Test Plan

Tested in combination with following diffs, where it's actually used

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage