Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update tests for @ensdomains/address-encoder@0.2.18 #75

Merged
merged 1 commit into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ensjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"ver": "pnpm version --no-workspaces-update"
},
"dependencies": {
"@ensdomains/address-encoder": "0.2.16",
"@ensdomains/address-encoder": "^0.2.18",
"@ensdomains/content-hash": "^2.5.7",
"@ensdomains/dnsprovejs": "^0.4.1",
"@ensdomains/dnssecoraclejs": "^0.2.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/ensjs/src/functions/getProfile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('getProfile', () => {
it('should return a profile object with specified records', async () => {
const result = await ensInstance.getProfile(
'0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC',
{ texts: ['description', 'url'], coinTypes: ['ETC', '0'] },
{ texts: ['description', 'url'], coinTypes: ['ETC_LEGACY', '0'] },
)
expect(result).toBeDefined()
if (result) {
Expand Down Expand Up @@ -86,7 +86,7 @@ describe('getProfile', () => {
it('should return a profile object with specified records', async () => {
const result = await ensInstance.getProfile('with-profile.eth', {
texts: ['description', 'url'],
coinTypes: ['ETC', '0'],
coinTypes: ['ETC_LEGACY', '0'],
})
expect((result as any).address).toBe(
'0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC',
Expand Down
8 changes: 4 additions & 4 deletions packages/ensjs/src/functions/getSpecificRecord.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ describe('getSpecificRecord', () => {
expect((result as any).addr).toBe(
'0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC',
)
expect((result as any).coin).toBe('ETC')
expect((result as any).coin).toBe('ETC_LEGACY')
})
it('should return the correct address based on a coin ID input as a string', async () => {
const result = await ensInstance.getAddr('with-profile.eth', '61')
expect((result as any).addr).toBe(
'0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC',
)
expect((result as any).coin).toBe('ETC')
expect((result as any).coin).toBe('ETC_LEGACY')
})
it('should return the correct address based on a coin name', async () => {
const result = await ensInstance.getAddr('with-profile.eth', 'ETC')
const result = await ensInstance.getAddr('with-profile.eth', 'ETC_LEGACY')
expect((result as any).addr).toBe(
'0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC',
)
expect((result as any).coin).toBe('ETC')
expect((result as any).coin).toBe('ETC_LEGACY')
})
it('should return null for a non-existent coin', async () => {
const result = await ensInstance.getAddr('with-profile.eth', 'BNB')
Expand Down
2 changes: 1 addition & 1 deletion packages/ensjs/src/functions/setRecord.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('setRecord', () => {
const tx = await ensInstance.setRecord('test123.eth', {
type: 'addr',
record: {
key: 'ETC',
key: 'ETC_LEGACY',
value: '0x42D63ae25990889E35F215bC95884039Ba354115',
},
addressOrIndex: 1,
Expand Down
5 changes: 4 additions & 1 deletion packages/ensjs/src/functions/setRecords.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ describe('setRecords', () => {
const tx = await ensInstance.setRecords('test123.eth', {
records: {
coinTypes: [
{ key: 'ETC', value: '0x42D63ae25990889E35F215bC95884039Ba354115' },
{
key: 'ETC_LEGACY',
value: '0x42D63ae25990889E35F215bC95884039Ba354115',
},
],
texts: [{ key: 'foo', value: 'bar' }],
},
Expand Down
22 changes: 12 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.