Skip to content

Commit

Permalink
refactor: new registry address
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceban Mihail committed Jan 15, 2024
1 parent caedce7 commit 4e672b2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bns-resolver",
"version": "2.1.0",
"version": "2.1.1",
"description": "The Blockprime Name Resolver Library",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const BNS_REGISTRY_ADDRESS = {
1: '0xa58234a10B1b4556792F3fAB29F2D2fdD1e99Be6',
5: '0xa58234a10B1b4556792F3fAB29F2D2fdD1e99Be6',
11155111: '0xa58234a10B1b4556792F3fAB29F2D2fdD1e99Be6',
1: '0x5e15Be567B44800c88A5775Da5689b6A31e74705',
5: '0x5e15Be567B44800c88A5775Da5689b6A31e74705',
11155111: '0x5e15Be567B44800c88A5775Da5689b6A31e74705',
} as Record<number, string>;

export const REGISTRY_ABI = [
Expand Down
14 changes: 6 additions & 8 deletions test/resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ describe('BnsResolver', () => {

describe('resolveName', () => {
it('resolveName: test1.sxt - success resolution', async () => {
const addr = await bnsResolver.resolveName('max.sxt');
const addr = await bnsResolver.resolveName('ion.eps');
expect(addr).toEqual(
getAddress('0x772b207659fbf9b33f5bc698694931946948054e')
getAddress('0xb305c1f2200a17E0502416B1746aB88C9B5C449f')
);
});

it('resolveName: test2.sxt - name expired', async () => {
const addr = await bnsResolver.resolveName('test2.sxt');
const addr = await bnsResolver.resolveName('abc2.sxt');
expect(addr).toEqual(null);
});

Expand All @@ -46,11 +46,11 @@ describe('BnsResolver', () => {
});

describe('lookupAddress', () => {
it('lookupAddress: 0x084B5B4967b6EaB4EeDc628C12c7E63292cD5FC6 - success resolution', async () => {
it('lookupAddress: 0xb305c1f2200a17E0502416B1746aB88C9B5C449f - success resolution', async () => {
const addr = await bnsResolver.lookupAddress(
'0x772b207659fbf9b33f5bc698694931946948054e'
'0xb305c1f2200a17E0502416B1746aB88C9B5C449f'
);
expect(addr).toEqual('max.sxt');
expect(addr).toEqual('ion.eps');
});

it('lookupAddress: 0xf2EA5Fd6538EAb3B0466f1b1A447C742d8b30eFe - expired', async () => {
Expand All @@ -60,6 +60,4 @@ describe('BnsResolver', () => {
expect(addr).toEqual(null);
});
});

//@todo Finish tests when contracts are ready
});

0 comments on commit 4e672b2

Please sign in to comment.