Skip to content

Commit 7bffced

Browse files
authored
Merge branch 'main' into fix/primary-name-address-mismatch
2 parents d679bcb + 42e54f4 commit 7bffced

File tree

25 files changed

+207
-45
lines changed

25 files changed

+207
-45
lines changed

e2e/specs/stateful/profile.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable no-await-in-loop */
2+
/* eslint-disable no-restricted-syntax */
23
import { expect } from '@playwright/test'
34

45
import { test } from '../../../playwright/index.js'
@@ -49,6 +50,12 @@ const profiles = [
4950
value: '0xFc5...7acf0',
5051
fullValue: '0xFc5958B4B6F9a06D21E06429c8833f865577acf0',
5152
},
53+
{
54+
type: 'address',
55+
key: 'sui',
56+
value: '0x123...31231',
57+
fullValue: '0x1231231231231231231231231231231231231231231231231231231231231231',
58+
},
5259
{
5360
type: 'other',
5461
key: 'avatar',

e2e/specs/stateless/advancedEditor.spec.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ test('should be able to maintain state when returning from transaction modal whe
2525
{ coin: 'SOL', value: 'HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH' },
2626
{ coin: 'ETH', value: '0xbec1C7C11F2Fa9AB24b9E49122D26e721766DAF6' },
2727
{ coin: 'BTC', value: '1PzAJcFtEiXo9UGtRU6iqXQKj8NXtcC7DE' },
28+
{
29+
coin: 'SUI',
30+
// eslint-disable-next-line no-restricted-syntax -- SUI addresses are 64 hex chars, not private keys
31+
value: '0x1231231231231231231231231231231231231231231231231231231231231231',
32+
},
2833
],
2934
contentHash: 'ipfs://bafybeico3uuyj3vphxpvbowchdwjlrlrh62awxscrnii7w7flu5z6fk77y',
3035
abi: await encodeAbi({ encodeAs: 'json', data: dummyABI }),
@@ -51,6 +56,10 @@ test('should be able to maintain state when returning from transaction modal whe
5156
await expect(recordsPage.getRecordValue('address', 'BTC')).toHaveText(
5257
'1PzAJcFtEiXo9UGtRU6iqXQKj8NXtcC7DE',
5358
)
59+
await expect(recordsPage.getRecordValue('address', 'SUI')).toHaveText(
60+
// eslint-disable-next-line no-restricted-syntax -- SUI addresses are 64 hex chars, not private keys
61+
'0x1231231231231231231231231231231231231231231231231231231231231231',
62+
)
5463
await expect(recordsPage.getRecordValue('contentHash')).toHaveText(
5564
'ipfs://bafybeico3uuyj3vphxpvbowchdwjlrlrh62awxscrnii7w7flu5z6fk77y',
5665
)
@@ -71,6 +80,10 @@ test('should be able to maintain state when returning from transaction modal whe
7180
await expect(await advancedEditor.recordInput('address', 'BTC')).toHaveValue(
7281
'1PzAJcFtEiXo9UGtRU6iqXQKj8NXtcC7DE',
7382
)
83+
await expect(await advancedEditor.recordInput('address', 'SUI')).toHaveValue(
84+
// eslint-disable-next-line no-restricted-syntax -- SUI addresses are 64 hex chars, not private keys
85+
'0x1231231231231231231231231231231231231231231231231231231231231231',
86+
)
7487
await expect(await advancedEditor.recordInput('contentHash')).toHaveValue(
7588
'ipfs://bafybeico3uuyj3vphxpvbowchdwjlrlrh62awxscrnii7w7flu5z6fk77y',
7689
)
@@ -79,34 +92,37 @@ test('should be able to maintain state when returning from transaction modal whe
7992
await advancedEditor.recordClearButton('text', 'text').then((button) => button.click())
8093
await advancedEditor.recordClearButton('address', 'SOL').then((button) => button.click())
8194
await advancedEditor.recordClearButton('address', 'ETH').then((button) => button.click())
95+
await advancedEditor.recordClearButton('address', 'SUI').then((button) => button.click())
8296
await advancedEditor.recordInput('contentHash').then((input) => input.fill(''))
8397
await advancedEditor.recordInput('abi').then((input) => input.fill(''))
8498

8599
await advancedEditor.saveButton.click()
86100

87101
// Validate transaction display item
88-
await expect(transactionModal.displayItem('update')).toHaveText('5 records')
102+
await expect(transactionModal.displayItem('update')).toHaveText('6 records')
89103

90104
await transactionModal.backButton.click()
91105

92106
// Validate inputs have been rebuilt correctly
93107
await expect(await advancedEditor.recordComponent('text', 'text')).toHaveCount(0)
94108
await expect(await advancedEditor.recordComponent('address', 'SOL')).toHaveCount(0)
95109
await expect(await advancedEditor.recordComponent('address', 'ETH')).toHaveCount(0)
110+
await expect(await advancedEditor.recordComponent('address', 'SUI')).toHaveCount(0)
96111
await expect(await advancedEditor.recordInput('contentHash')).toHaveValue('')
97112
await expect(await advancedEditor.recordInput('abi')).toHaveValue('')
98113

99114
await advancedEditor.saveButton.click()
100115

101116
// Validate transaction display item
102-
await expect(transactionModal.displayItem('update')).toHaveText('5 records')
117+
await expect(transactionModal.displayItem('update')).toHaveText('6 records')
103118

104119
await transactionModal.autoComplete()
105120

106121
// Validate change in records
107122
await expect(recordsPage.getRecordButton('text', 'text')).toHaveCount(0)
108123
await expect(recordsPage.getRecordButton('address', 'SOL')).toHaveCount(0)
109124
await expect(recordsPage.getRecordButton('address', 'ETH')).toHaveCount(0)
125+
await expect(recordsPage.getRecordButton('address', 'SUI')).toHaveCount(0)
110126
await expect(recordsPage.getRecordButton('contentHash')).toHaveCount(0)
111127
await expect(recordsPage.getRecordButton('abi')).toHaveCount(0)
112128
})

e2e/specs/stateless/extendNames.spec.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ test('should be able to extend multiple names (including names in grace preiod)
113113
await addresPage.search(label)
114114
await expect(addresPage.getNameRow(name)).toBeVisible({ timeout: 5000 })
115115
await expect(await addresPage.getTimestamp(name)).not.toBe(timestampDict[name])
116-
await expect(await addresPage.getTimestamp(name)).toBe(timestampDict[name] + 31536000000 * 3)
116+
// Allow up to 3 days tolerance for leap year differences across 3 years
117+
const ts = await addresPage.getTimestamp(name)
118+
expect(Math.abs(ts - timestampDict[name] - 31536000000 * 3)).toBeLessThanOrEqual(86400000 * 3)
117119
}
118120
})
119121

@@ -179,7 +181,8 @@ test('should be able to extend a single unwrapped name from profile', async ({
179181
await extendNamesModal.getExtendButton.click()
180182
await transactionModal.autoComplete()
181183
const newTimestamp = await profilePage.getExpiryTimestamp()
182-
expect(newTimestamp).toEqual(timestamp + 31536000000)
184+
// Allow 1 day tolerance for leap year differences
185+
expect(Math.abs(newTimestamp - timestamp - 31536000000)).toBeLessThanOrEqual(86400000)
183186
})
184187
})
185188

@@ -241,7 +244,8 @@ test('should be able to extend a single unwrapped name in grace period from prof
241244
await transactionModal.autoComplete()
242245

243246
const newTimestamp = await profilePage.getExpiryTimestamp()
244-
expect(newTimestamp).toEqual(timestamp + 31536000000)
247+
// Allow 1 day tolerance for leap year differences
248+
expect(Math.abs(newTimestamp - timestamp - 31536000000)).toBeLessThanOrEqual(86400000)
245249
})
246250
})
247251

@@ -304,7 +308,8 @@ test('should be able to extend a single unwrapped name in grace period from prof
304308
const transactionModal = makePageObject('TransactionModal')
305309
await transactionModal.autoComplete()
306310
const newTimestamp = await profilePage.getExpiryTimestamp()
307-
await expect(newTimestamp).toEqual(timestamp + 31536000000)
311+
// Allow 1 day tolerance for leap year differences
312+
expect(Math.abs(newTimestamp - timestamp - 31536000000)).toBeLessThanOrEqual(86400000)
308313
})
309314
})
310315

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"hh": "NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only' hardhat"
5555
},
5656
"dependencies": {
57-
"@ensdomains/address-encoder": "1.1.3",
57+
"@ensdomains/address-encoder": "1.1.4",
5858
"@ensdomains/content-hash": "^3.0.0-beta.5",
5959
"@ensdomains/ens-contracts": "1.6.0",
6060
"@ensdomains/ens-test-env": "1.0.1",
@@ -198,6 +198,7 @@
198198
"@wagmi/core": "2.13.3",
199199
"@walletconnect/ethereum-provider": "2.11.1",
200200
"@walletconnect/modal": "2.6.2",
201+
"@ensdomains/address-encoder": "1.1.4",
201202
"aggregate-error": "npm:@socketregistry/aggregate-error@^1",
202203
"array-buffer-byte-length": "npm:@socketregistry/array-buffer-byte-length@^1",
203204
"array-flatten": "npm:@socketregistry/array-flatten@^1",

pnpm-lock.yaml

Lines changed: 8 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/locales/en/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"favourites": "Favourites",
7878
"settings": "Settings",
7979
"governance": "Governance",
80-
"community": "Community",
80+
"blog": "Blog",
8181
"developers": "Developers",
8282
"support": "Support",
8383
"bounty": "Bug Bounty",

public/locales/en/ensv2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
}
5050
},
5151
"banner": {
52-
"title": "Namechain is coming!",
52+
"title": "ENSv2 is coming!",
5353
"caption": "Keep up with ENSv2 development",
5454
"cta": "ENSv2 hub"
5555
}

public/locales/en/register.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@
9797
"matic": "0xb8c2C2...",
9898
"linea": "0xb8c2C2...",
9999
"scr": "0xb8c2C2...",
100-
"celo": "0xb8c2C2..."
100+
"celo": "0xb8c2C2...",
101+
"sui": "0x123abc..."
101102
}
102103
},
103104
"website": {

public/locales/es/ensv2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
}
5555
},
5656
"banner": {
57-
"title": "¡Namechain está llegando!",
57+
"title": "¡ENSv2 está llegando!",
5858
"caption": "Mantente al día con el desarrollo de ENSv2",
5959
"cta": "Centro de ENSv2"
6060
}

public/locales/pt/ensv2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
}
5555
},
5656
"banner": {
57-
"title": "Namechain está chegando!",
57+
"title": "ENSv2 está chegando!",
5858
"caption": "Mantenha-se atualizado com o desenvolvimento do ENSv2",
5959
"cta": "Central do ENSv2"
6060
}

0 commit comments

Comments
 (0)