Skip to content

Commit

Permalink
mainnet ur
Browse files Browse the repository at this point in the history
  • Loading branch information
TateB committed Dec 12, 2023
1 parent b32e860 commit 085e28d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ensjs/src/contracts/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const addresses = {
address: '0x21745FF62108968fBf5aB1E07961CC0FCBeB2364',
},
ensUniversalResolver: {
address: '0x9380F1974D2B7064eA0c0EC251968D8c69f0Ae31',
address: '0x20814C8e689187DfF7C93A9239ea22385d13b9F1',
},
},
goerli: {
Expand Down
30 changes: 30 additions & 0 deletions packages/ensjs/src/functions/public/getRecords.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
import { addEnsContracts } from '../../index.js'
import {
deploymentAddresses,
publicClient,
} from '../../test/addTestContracts.js'
import getRecords from './getRecords.js'

const mainnetPublicClient = createPublicClient({
chain: addEnsContracts(mainnet),
transport: http('https://web3.ens.domains/v1/mainnet'),
})

describe('getRecords()', () => {
it('works', async () => {
const result = await getRecords(publicClient, {
Expand Down Expand Up @@ -68,4 +76,26 @@ describe('getRecords()', () => {
}
`)
})
it('works with oldest resolver - jessesum.eth', async () => {
const result = await getRecords(mainnetPublicClient, {
name: 'jessesum.eth',
records: {
texts: ['description', 'url'],
coins: ['60', 'etcLegacy', '0'],
},
})
expect(result).toMatchInlineSnapshot(`
{
"coins": [
{
"id": 60,
"name": "eth",
"value": "0x8c4Eb6988A199DAbcae0Ce31052b3f3aC591787e",
},
],
"resolverAddress": "0x1da022710dF5002339274AaDEe8D58218e9D6AB5",
"texts": [],
}
`)
})
})

0 comments on commit 085e28d

Please sign in to comment.