Skip to content

Commit

Permalink
Merge pull request argentlabs#1997 from argentlabs/release/v5.3.17
Browse files Browse the repository at this point in the history
Merge Release v5.3.17 into main
  • Loading branch information
gergold committed Apr 5, 2023
2 parents 1b35e10 + 6fbdcd0 commit 428af80
Show file tree
Hide file tree
Showing 34 changed files with 383 additions and 284 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/chromatic.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/dependabot.yml

This file was deleted.

23 changes: 11 additions & 12 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
ARGENT_X_STATUS_URL: ${{ secrets.ARGENT_X_STATUS_URL }}
ARGENT_EXPLORER_BASE_URL: ${{ secrets.ARGENT_EXPLORER_BASE_URL }}

if: github.actor != 'dependabot[bot]'
steps:
- name: Check out repository code
uses: actions/checkout@v3
Expand All @@ -39,6 +38,17 @@ jobs:
node-version: "16"
cache: "yarn"

- name: Install dependencies
run: yarn setup

- name: Install Playwright Browsers
run: npx playwright install chromium

- name: Build
run: yarn lerna run --scope @argent-x/extension build
env:
UPLOAD_SENTRY_SOURCEMAPS: false

- name: Check docker local network
run: |
CODE=`curl --write-out '%{http_code}' \
Expand All @@ -55,17 +65,6 @@ jobs:
echo "Local network is online."
fi
- name: Install dependencies
run: yarn setup

- name: Install Playwright Browsers
run: npx playwright install chromium

- name: Build
run: yarn lerna run --scope @argent-x/extension build
env:
UPLOAD_SENTRY_SOURCEMAPS: false

- name: Run e2e tests
run: xvfb-run --auto-servernum yarn test:e2e

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
ARGENT_X_STATUS_URL: ${{ secrets.ARGENT_X_STATUS_URL }}
ARGENT_EXPLORER_BASE_URL: ${{ secrets.ARGENT_EXPLORER_BASE_URL }}

if: github.actor != 'dependabot[bot]'
steps:
- name: If github.head_ref not filled, we are merging
run: |
Expand Down Expand Up @@ -133,6 +132,7 @@ jobs:
run: |
gh pr comment ${{ env.GHA_BRANCH }} --body "[Builds for local testing](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
- name: SonarCloud Scan
if: github.actor != 'dependabot[bot]'
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": ["packages/*"],
"version": "5.3.16",
"version": "5.3.17",
"npmClient": "yarn",
"useWorkspaces": true
}
6 changes: 3 additions & 3 deletions packages/dapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@argent-x/dapp",
"version": "5.3.16",
"version": "5.3.17",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -10,8 +10,8 @@
"lint": "next lint"
},
"dependencies": {
"@argent/get-starknet": "^5.3.16",
"@argent/x-sessions": "^5.3.16",
"@argent/get-starknet": "^5.3.17",
"@argent/x-sessions": "^5.3.17",
"ethers": "^5.5.1",
"next": "^13.0.0",
"react": "^18.0.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/extension/e2e/src/page-objects/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,12 @@ export default class Account extends Navigation {
get contact() {
return this.page.locator("div h5")
}

get dappsBanner() {
return this.page.locator('[title="Dappland"]')
}

get dappsBannerClose() {
return this.page.locator('[title="Dappland"] svg')
}
}
63 changes: 63 additions & 0 deletions packages/extension/e2e/src/specs/dappsBanner.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { expect } from "@playwright/test"

import config from "../config"
import test from "../test"

test.describe("Banner", () => {
test("dapps banner should be visible after login", async ({ extension }) => {
await extension.wallet.newWalletOnboarding()
await extension.open()
await expect(extension.network.networkSelector).toBeVisible()
await extension.account.setUpAccountRecovery.click()
await extension.account.saveTheRecoveryPhrase.click()
await extension.navigation.continue.click()
await extension.navigation.yes.click()
await expect(extension.account.setUpAccountRecovery).toBeHidden()
await expect(extension.account.dappsBanner).toBeVisible()
let href = await extension.account.dappsBanner.getAttribute("href")
expect(href).toContain("https://www.dappland.com")
//check settings banner
await extension.navigation.showSettings.click()
href = await extension.account.dappsBanner.getAttribute("href")
expect(href).toContain("https://www.dappland.com")
})

test("dapps banner should not be visible after dismissed", async ({
extension,
}) => {
await extension.wallet.newWalletOnboarding()
await extension.open()
await expect(extension.network.networkSelector).toBeVisible()
await extension.account.setUpAccountRecovery.click()
await extension.account.saveTheRecoveryPhrase.click()
await extension.navigation.continue.click()
await extension.navigation.yes.click()
await expect(extension.account.setUpAccountRecovery).toBeHidden()
await expect(extension.account.dappsBanner).toBeVisible()
await extension.account.dappsBannerClose.click()
await expect(extension.account.dappsBanner).toBeHidden()
})

test("dapps banner shoud be visible after account recovery", async ({
extension,
}) => {
await extension.open()
await extension.wallet.restoreExistingWallet.click()
await extension.setClipBoardContent(config.wallets[1].seed)
await extension.paste()
await extension.navigation.continue.click()

await extension.wallet.password.fill(config.password)
await extension.wallet.repeatPassword.fill(config.password)

await extension.navigation.continue.click()

await expect(extension.wallet.finish.first()).toBeVisible({
timeout: 180000,
})

await extension.open()
await expect(extension.network.networkSelector).toBeVisible()
await expect(extension.account.dappsBanner).toBeVisible()
})
})
2 changes: 1 addition & 1 deletion packages/extension/manifest/v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/chrome-manifest.json",
"name": "Argent X",
"description": "The security of Ethereum with the scale of StarkNet",
"version": "5.3.16",
"version": "5.3.17",
"manifest_version": 2,
"browser_action": {
"default_icon": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/manifest/v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/chrome-manifest.json",
"name": "Argent X",
"description": "The security of Ethereum with the scale of StarkNet",
"version": "5.3.16",
"version": "5.3.17",
"manifest_version": 3,
"action": {
"default_icon": {
Expand Down
16 changes: 8 additions & 8 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@argent-x/extension",
"version": "5.3.16",
"version": "5.3.17",
"main": "index.js",
"license": "MIT",
"devDependencies": {
Expand Down Expand Up @@ -74,13 +74,13 @@
"push-release-branch": "git push --set-upstream origin release/v$npm_package_version --follow-tags"
},
"dependencies": {
"@argent/guardian": "^5.3.16",
"@argent/stack-router": "^5.3.16",
"@argent/ui": "^5.3.16",
"@argent/x-multicall": "^5.3.16",
"@argent/x-sessions": "^5.3.16",
"@argent/x-swap": "^5.3.16",
"@argent/x-window": "^5.3.16",
"@argent/guardian": "^5.3.17",
"@argent/stack-router": "^5.3.17",
"@argent/ui": "^5.3.17",
"@argent/x-multicall": "^5.3.17",
"@argent/x-sessions": "^5.3.17",
"@argent/x-swap": "^5.3.17",
"@argent/x-window": "^5.3.17",
"@chakra-ui/icons": "^2.0.15",
"@chakra-ui/react": "2.5.1",
"@extend-chrome/messages": "^1.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import config from "./e2e/src/config"
const isCI = Boolean(process.env.CI)

const playwrightConfig: PlaywrightTestConfig = {
workers: 1,
workers: 2,
timeout: 5 * 60e3, // 5 minutes
reportSlowTests: {
threshold: 1 * 60e3, // 1 minute
Expand Down
22 changes: 18 additions & 4 deletions packages/extension/src/shared/api/fetcher.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/** generic json fetcher */

export type Fetcher = (
import { useAppState } from "../../ui/app.state"

export type Fetcher = <T>(
input: RequestInfo | URL,
init?: RequestInit,
) => Promise<any>
) => Promise<T>

export interface FetcherError extends Error {
url?: string
Expand Down Expand Up @@ -37,7 +39,10 @@ export const fetcherError = (
return error
}

export const fetcher = async (input: RequestInfo | URL, init?: RequestInit) => {
export const fetcher = async <T>(
input: RequestInfo | URL,
init?: RequestInit,
): Promise<T> => {
const response = await fetch(input, init)
/** capture text here in the case of json parse failure we can include it in the error */
const responseText = await response.text()
Expand All @@ -64,7 +69,7 @@ export const fetcherWithArgentApiHeadersForNetwork = (
network: string,
fetcherImpl: Fetcher = fetcher,
) => {
const fetcherWithArgentApiHeaders = (
const fetcherWithArgentApiHeaders: Fetcher = (
input: RequestInfo | URL,
init?: RequestInit,
) => {
Expand All @@ -80,6 +85,15 @@ export const fetcherWithArgentApiHeadersForNetwork = (
return fetcherWithArgentApiHeaders
}

export const fetcherWithArgentApiHeaders = (fetcherImpl: Fetcher = fetcher) => {
const { switcherNetworkId } = useAppState.getState()
const fetcher = fetcherWithArgentApiHeadersForNetwork(
switcherNetworkId,
fetcherImpl,
)
return fetcher
}

/** convert KnownNetworksType to 'goerli' or 'mainnet' expected by API */

export const argentApiNetworkForNetwork = (network: string) => {
Expand Down
Loading

0 comments on commit 428af80

Please sign in to comment.