Skip to content

Commit

Permalink
Remove .luxy and .kred from ENS resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
iurevych committed Nov 14, 2024
1 parent a80ac2f commit 33fef65
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 46 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 9.3.1

- Resolve .xyz TLD as UNS domains
- Remove .kred and .luxe from ENS resolution

## 9.3.0

Expand Down
2 changes: 1 addition & 1 deletion src/Ens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ export default class Ens extends NamingService {
private checkSupportedDomain(domain: string): boolean {
return (
domain === 'eth' ||
/^([^\s\\.]+\.)+(eth|luxe|kred)+$/.test(domain) ||
/^([^\s\\.]+\.)+(eth)+$/.test(domain) ||
/^([^\s\\.]+\.)(addr\.)(reverse)$/.test(domain)
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Resolution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -968,10 +968,10 @@ export default class Resolution {
async locations(domains: string[]): Promise<Locations> {
const zilDomains = domains.filter((domain) => domain.endsWith('.zil'));
const ensDomains = domains.filter((domain) =>
domain.match(/^([^\s\\.]+\.)+(eth|luxe|kred)+$/),
domain.match(/^([^\s\\.]+\.)+(eth)+$/),
);
const nonEnsDomains = domains.filter(
(domain) => !domain.match(/^([^\s\\.]+\.)+(eth|luxe|kred)+$/),
(domain) => !domain.match(/^([^\s\\.]+\.)+(eth)+$/),
);
// Here, we call both UNS and ZNS methods and merge the results.
// If any of the calls fails, this method will fail as well as we aren't interested in partial results.
Expand Down
5 changes: 1 addition & 4 deletions src/Uns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,7 @@ export default class Uns extends NamingService {
const tokens = domain.split('.');
return (
!!tokens.length &&
!(
domain === 'eth' ||
/^[^-]*[^-]*\.(eth|luxe|kred|addr\.reverse)$/.test(domain)
) &&
!(domain === 'eth' || /^[^-]*[^-]*\.(eth|addr\.reverse)$/.test(domain)) &&
tokens.every((v) => !!v.length)
);
}
Expand Down
5 changes: 1 addition & 4 deletions src/UnsInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,7 @@ export default class UnsInternal {
const tokens = domain.split('.');
return (
!!tokens.length &&
!(
domain === 'eth' ||
/^[^-]*[^-]*\.(eth|luxe|kred|addr\.reverse)$/.test(domain)
) &&
!(domain === 'eth' || /^[^-]*[^-]*\.(eth|addr\.reverse)$/.test(domain)) &&
tokens.every((v) => !!v.length)
);
}
Expand Down
34 changes: 0 additions & 34 deletions src/tests/Ens.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,40 +93,6 @@ describe('ENS', () => {
expect(result).toEqual(null);
});

it('resolves .luxe name using ENS blockchain', async () => {
const eyes = mockAsyncMethods(ens, {
resolver: '0xBD5F5ec7ed5f19b53726344540296C02584A5237',
fetchAddress: '0xf3dE750A73C11a6a2863761E930BF5fE979d5663',
});

const result = await resolution.addr('john.luxe', 'ETH');
expectSpyToBeCalled(eyes);
expect(result).toEqual('0xf3dE750A73C11a6a2863761E930BF5fE979d5663');
});

it('resolves .kred name using ENS blockchain', async () => {
const eyes = mockAsyncMethods(ens, {
resolver: '0x96184444629F3489c4dE199871E6F99568229d8f',
fetchAddress: '0x96184444629F3489c4dE199871E6F99568229d8f',
});
const result = await resolution.addr('brantly.kred', 'ETH');
expectSpyToBeCalled(eyes);
expect(result).toEqual('0x96184444629F3489c4dE199871E6F99568229d8f');
});

it('resolves .luxe name using ENS blockchain with thrown error', async () => {
const spies = mockAsyncMethods(ens, {
resolver: undefined,
owner: undefined,
});

await expectResolutionErrorCode(
resolution.addr('something.luxe', 'ETH'),
ResolutionErrorCode.UnregisteredDomain,
);
expectSpyToBeCalled(spies);
});

it('resolves name with resolver but without an owner', async () => {
const eyes = mockAsyncMethods(ens, {
resolver: '0x226159d592E2b063810a10Ebf6dcbADA94Ed68b8',
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function constructRecords(
return records;
}

const EnsTlds = ['eth', 'luxe', 'kred', 'reverse'];
const EnsTlds = ['eth', 'reverse'];

export const findNamingServiceName = async (
domain: string,
Expand Down

0 comments on commit 33fef65

Please sign in to comment.