Why does ENS keep returning null for existing domains...

This commit is contained in:
Marco van Dijk 2023-11-03 14:31:57 +01:00
parent 903a9b85c2
commit 51255de9d8

View File

@ -104,8 +104,7 @@ const getEnsDomain = async function (addr) {
return cached.domain ? cached.domain : cached.address; return cached.domain ? cached.domain : cached.address;
} }
// Refresh cause not cached or stale // Refresh cause not cached or stale
const address = ethers.getAddress(addr); const ensDomain = await l1provider.lookupAddress(addr);
const ensDomain = await l1provider.lookupAddress(address);
let ensObj; let ensObj;
if (!ensDomain) { if (!ensDomain) {
let domain = null; let domain = null;
@ -211,7 +210,7 @@ const onOrchUpdate = async function (id, obj, tag, region, livepeer_regions) {
// Overwrite name with ENS domain if set // Overwrite name with ENS domain if set
let ensDomain = null; let ensDomain = null;
while (!ensDomain) { while (!ensDomain) {
ensDomain = await getEnsDomain(id); ensDomain = await getEnsDomain(id.toLowerCase());
} }
// Retrieve entry to update or init it // Retrieve entry to update or init it
let newObj = orchCache[id.toLowerCase()]; let newObj = orchCache[id.toLowerCase()];