Skip to content

Commit

Permalink
Merge pull request #613 from ensdomains/fix/viem-dnssec
Browse files Browse the repository at this point in the history
fix(viem): dnssec
  • Loading branch information
storywithoutend authored Jan 20, 2024
2 parents 5d9976a + 9b715ed commit 353b511
Show file tree
Hide file tree
Showing 20 changed files with 283 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
steps:
- uses: actions/checkout@v3

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ tsconfig.tsbuildinfo
!.yarn/sdks
!.yarn/versions

# wrangler
.wrangler/

# jest coverage
/coverage

Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": false
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "never"
},
"stylelint.configFile": ".stylelintrc.json",
"stylelint.validate": ["css", "typescriptreact"],
Expand Down
17 changes: 10 additions & 7 deletions e2e/specs/stateful/dnsclaim.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ test.describe('Import DNSSEC name', () => {
await page.goto('/noenssubdomain.com')
await login.connect()

await page.pause()
await page.getByTestId('dnssec-check-button').click()
await expect(page.getByText('Subdomain not set')).toBeVisible()
await expect(page.getByText('Subdomain not set')).toBeVisible({ timeout: 15000})
})

test('should not allow the use to proceed if they have not set the correct subdomain with the correct info', async ({
Expand All @@ -31,7 +32,7 @@ test.describe('Import DNSSEC name', () => {
await login.connect()

await page.getByTestId('dnssec-check-button').click()
await expect(page.getByText('Record Invalid')).toBeVisible()
await expect(page.getByText('Record Invalid')).toBeVisible({ timeout: 15000})
})

test('should allow user to import a domain that they are not the owner of', async ({
Expand All @@ -45,6 +46,7 @@ test.describe('Import DNSSEC name', () => {
await page.goto('/leontalbert.xyz/import')
await login.connect()

await page.pause()
const address = accounts.getAddress('user')
await expect(page.getByText(`a=${address}`)).toBeVisible({
timeout: 25000,
Expand Down Expand Up @@ -76,11 +78,12 @@ test.describe('Import DNSSEC name', () => {
await page.goto('/leontalbert.com/import')
await login.connect()

const address = accounts.getAddress('user')
await expect(page.getByText(`a=${address}`)).toBeVisible({
timeout: 25000,
})
await page.getByTestId('dnssec-check-button').click()
// const address = accounts.getAddress('user')
// await expect(page.getByText(`a=${address}`)).toBeVisible({
// timeout: 25000,
// })
await page.pause()
// await page.getByTestId('dnssec-check-button').click()
await expect(
page.getByText('You have verified your ownership and can claim this domain.'),
).toBeVisible({ timeout: 25000 })
Expand Down
5 changes: 2 additions & 3 deletions e2e/specs/stateful/moonpay.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ test.describe('Moonpay registration', () => {
await page.getByText('Credit or debit card').click()
await page.getByText('Next').click()

// NOTE: Moonpay has shut down there testnet, so we only check for the existence of the iframe
const moonpay = page.frameLocator('#moonpayIframe')
await expect(moonpay.getByText('Purchase NFT with card')).toBeVisible({ timeout: 25000 })
await moonpay.getByRole('button', { name: 'Continue' }).click()
await expect(moonpay.getByText('Checkout with MoonPay')).toBeVisible()
await expect(await moonpay.locator('html')).toHaveCount(1)
})
})
4 changes: 2 additions & 2 deletions e2e/specs/stateful/profile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ test.describe('Profile', () => {
await page.goto('/')
await login.connect()

await page.getByPlaceholder('Search for a name').fill('❤️❤️❤️.eth')
await page.getByPlaceholder('Search for a name').fill('❤️❤️❤️❤️❤️❤️.eth')
await page.getByPlaceholder('Search for a name').press('Enter')
await expect(page).toHaveURL('/%E2%9D%A4%E2%9D%A4%E2%9D%A4.eth')
await expect(page).toHaveURL('/%E2%9D%A4%E2%9D%A4%E2%9D%A4%E2%9D%A4%E2%9D%A4%E2%9D%A4.eth')
// This await is needed so that a headless provider can make it's function calls before the page closes.
await page.waitForTimeout(5000)
})
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@
"dependencies": {
"@ensdomains/address-encoder": "^0.2.21",
"@ensdomains/content-hash": "^3.0.0-beta.5",
"@ensdomains/dnsprovejs": "0.4.1",
"@ensdomains/ens-contracts": "1.0.0",
"@ensdomains/ensjs": "3.0.0",
"@ensdomains/ensjs": "3.0.1",
"@ensdomains/thorin": "0.6.44",
"@metamask/inpage-provider": "^8.1.0",
"@metamask/mobile-provider": "^2.1.0",
Expand Down Expand Up @@ -190,7 +189,7 @@
"typescript-styled-plugin": "^0.18.2",
"wagmi-cjs": "npm:[email protected]",
"wait-on": "^6.0.1",
"wrangler": "3.13.2",
"wrangler": "3.22.4",
"yalc": "^1.0.0-pre.53"
},
"pnpm": {
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default defineConfig({
testDir: './e2e/specs',
testMatch: '*.spec.ts',
retries: process.env.CI ? 2 : 0,
timeout: 60000, // add extra time for loading
timeout: 120000, // add extra time for loading
fullyParallel: true, // required to evenly shard
workers: 1, // keep tests serial for now
reporter: [['html', { open: 'never' }]],
Expand Down
5 changes: 0 additions & 5 deletions playwright/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ export const test = base.extend<Fixtures>({
const chainId = provider.network?.chainId || 1337
const chainRpcUrl = provider.connection?.url || 'http://localhost:8545'
const privateKeys = accounts.getAllPrivateKeys()
console.log('chainid', chainId)
console.log('chainRpcUrl', chainRpcUrl)
console.log('USER', accounts.getAddress('user'))
console.log('USER2', accounts.getAddress('user2'))
console.log('USER3', accounts.getAddress('user3'))
const wallet = await injectHeadlessWeb3Provider(page, privateKeys, chainId, chainRpcUrl)
await use(wallet)
},
Expand Down
Loading

0 comments on commit 353b511

Please sign in to comment.