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

session keys prod sepolia #16

Merged
merged 23 commits into from
Dec 23, 2024
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 e2e/src/webwallet/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const config = {
emailPassword: process.env.EMAIL_PASSWORD!,
acc_destination: commonConfig.destinationAddress! || "",
vw_acc_addr: process.env.VW_ACC_ADDR! || "",
url: "https://web.argent.xyz",
url: "https://sepolia-web.argent.xyz/",
/*
TODO: wait for sepolia in prod
process.env.ARGENT_X_ENVIRONMENT === "prod"
Expand Down
52 changes: 51 additions & 1 deletion e2e/src/webwallet/page-objects/Dapps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
await popup.locator("[name=password]").fill(credentials.password)
await popup.locator("[name=repeatPassword]").fill(credentials.password)
} else {
await popup.locator("[name=password]").fill(credentials.password)

Check failure on line 65 in e2e/src/webwallet/page-objects/Dapps.ts

View workflow job for this annotation

GitHub Actions / test-webwallet

[WebWallet] › src/webwallet/specs/network.spec.ts:5:7 › Network › not implemented while calling Add Network

1) [WebWallet] › src/webwallet/specs/network.spec.ts:5:7 › Network › not implemented while calling Add Network TimeoutError: locator.fill: Timeout 120000ms exceeded. Call log: - waiting for locator('[name=password]') at src/webwallet/page-objects/Dapps.ts:65 63 | await popup.locator("[name=repeatPassword]").fill(credentials.password) 64 | } else { > 65 | await popup.locator("[name=password]").fill(credentials.password) | ^ 66 | } 67 | 68 | // password submit at Dapps.fillCredentials (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:65:46) at Dapps.requestConnectionFromDapp (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:37:7) at /__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/specs/network.spec.ts:9:5

Check failure on line 65 in e2e/src/webwallet/page-objects/Dapps.ts

View workflow job for this annotation

GitHub Actions / test-webwallet

[WebWallet] › src/webwallet/specs/signMessage.spec.ts:5:7 › Sign message › sign a message from testDapp

4) [WebWallet] › src/webwallet/specs/signMessage.spec.ts:5:7 › Sign message › sign a message from testDapp TimeoutError: locator.fill: Timeout 120000ms exceeded. Call log: - waiting for locator('[name=password]') at src/webwallet/page-objects/Dapps.ts:65 63 | await popup.locator("[name=repeatPassword]").fill(credentials.password) 64 | } else { > 65 | await popup.locator("[name=password]").fill(credentials.password) | ^ 66 | } 67 | 68 | // password submit at Dapps.fillCredentials (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:65:46) at Dapps.requestConnectionFromDapp (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:37:7) at /__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/specs/signMessage.spec.ts:6:5

Check failure on line 65 in e2e/src/webwallet/page-objects/Dapps.ts

View workflow job for this annotation

GitHub Actions / test-webwallet

[WebWallet] › src/webwallet/specs/connect.spec.ts:5:7 › Connect › connect from testDapp using starknetKitModal

1) [WebWallet] › src/webwallet/specs/connect.spec.ts:5:7 › Connect › connect from testDapp using starknetKitModal TimeoutError: locator.fill: Timeout 120000ms exceeded. Call log: - waiting for locator('[name=password]') at src/webwallet/page-objects/Dapps.ts:65 63 | await popup.locator("[name=repeatPassword]").fill(credentials.password) 64 | } else { > 65 | await popup.locator("[name=password]").fill(credentials.password) | ^ 66 | } 67 | 68 | // password submit at Dapps.fillCredentials (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:65:46) at Dapps.requestConnectionFromDapp (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:37:7) at /__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/specs/connect.spec.ts:9:5

Check failure on line 65 in e2e/src/webwallet/page-objects/Dapps.ts

View workflow job for this annotation

GitHub Actions / test-webwallet

[WebWallet] › src/webwallet/specs/connect.spec.ts:5:7 › Connect › connect from testDapp using starknetKitModal

1) [WebWallet] › src/webwallet/specs/connect.spec.ts:5:7 › Connect › connect from testDapp using starknetKitModal Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.fill: Timeout 120000ms exceeded. Call log: - waiting for locator('[name=password]') at src/webwallet/page-objects/Dapps.ts:65 63 | await popup.locator("[name=repeatPassword]").fill(credentials.password) 64 | } else { > 65 | await popup.locator("[name=password]").fill(credentials.password) | ^ 66 | } 67 | 68 | // password submit at Dapps.fillCredentials (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:65:46) at Dapps.requestConnectionFromDapp (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:37:7) at /__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/specs/connect.spec.ts:9:5

Check failure on line 65 in e2e/src/webwallet/page-objects/Dapps.ts

View workflow job for this annotation

GitHub Actions / test-webwallet

[WebWallet] › src/webwallet/specs/connect.spec.ts:17:7 › Connect › connect from testDapp using webwallet connector

2) [WebWallet] › src/webwallet/specs/connect.spec.ts:17:7 › Connect › connect from testDapp using webwallet connector Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.fill: Timeout 120000ms exceeded. Call log: - waiting for locator('[name=password]') at src/webwallet/page-objects/Dapps.ts:65 63 | await popup.locator("[name=repeatPassword]").fill(credentials.password) 64 | } else { > 65 | await popup.locator("[name=password]").fill(credentials.password) | ^ 66 | } 67 | 68 | // password submit at Dapps.fillCredentials (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:65:46) at Dapps.requestConnectionFromDapp (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:45:7) at /__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/specs/connect.spec.ts:21:5

Check failure on line 65 in e2e/src/webwallet/page-objects/Dapps.ts

View workflow job for this annotation

GitHub Actions / test-webwallet

[WebWallet] › src/webwallet/specs/sessionKeys.spec.ts:5:7 › Session Keys › create a sessions

3) [WebWallet] › src/webwallet/specs/sessionKeys.spec.ts:5:7 › Session Keys › create a sessions, send a transaction a get EFO data TimeoutError: locator.fill: Timeout 120000ms exceeded. Call log: - waiting for locator('[name=password]') at src/webwallet/page-objects/Dapps.ts:65 63 | await popup.locator("[name=repeatPassword]").fill(credentials.password) 64 | } else { > 65 | await popup.locator("[name=password]").fill(credentials.password) | ^ 66 | } 67 | 68 | // password submit at Dapps.fillCredentials (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:65:46) at Dapps.requestConnectionFromDapp (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:37:7) at /__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/specs/sessionKeys.spec.ts:9:5

Check failure on line 65 in e2e/src/webwallet/page-objects/Dapps.ts

View workflow job for this annotation

GitHub Actions / test-webwallet

[WebWallet] › src/webwallet/specs/sessionKeys.spec.ts:5:7 › Session Keys › create a sessions

3) [WebWallet] › src/webwallet/specs/sessionKeys.spec.ts:5:7 › Session Keys › create a sessions, send a transaction a get EFO data Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.fill: Timeout 120000ms exceeded. Call log: - waiting for locator('[name=password]') at src/webwallet/page-objects/Dapps.ts:65 63 | await popup.locator("[name=repeatPassword]").fill(credentials.password) 64 | } else { > 65 | await popup.locator("[name=password]").fill(credentials.password) | ^ 66 | } 67 | 68 | // password submit at Dapps.fillCredentials (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:65:46) at Dapps.requestConnectionFromDapp (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:37:7) at /__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/specs/sessionKeys.spec.ts:9:5

Check failure on line 65 in e2e/src/webwallet/page-objects/Dapps.ts

View workflow job for this annotation

GitHub Actions / test-webwallet

[WebWallet] › src/webwallet/specs/token.spec.ts:5:7 › Token › not implemented while calling Add Token

4) [WebWallet] › src/webwallet/specs/token.spec.ts:5:7 › Token › not implemented while calling Add Token TimeoutError: locator.fill: Timeout 120000ms exceeded. Call log: - waiting for locator('[name=password]') at src/webwallet/page-objects/Dapps.ts:65 63 | await popup.locator("[name=repeatPassword]").fill(credentials.password) 64 | } else { > 65 | await popup.locator("[name=password]").fill(credentials.password) | ^ 66 | } 67 | 68 | // password submit at Dapps.fillCredentials (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:65:46) at Dapps.requestConnectionFromDapp (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:37:7) at /__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/specs/token.spec.ts:9:5

Check failure on line 65 in e2e/src/webwallet/page-objects/Dapps.ts

View workflow job for this annotation

GitHub Actions / test-webwallet

[WebWallet] › src/webwallet/specs/token.spec.ts:5:7 › Token › not implemented while calling Add Token

4) [WebWallet] › src/webwallet/specs/token.spec.ts:5:7 › Token › not implemented while calling Add Token Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.fill: Timeout 120000ms exceeded. Call log: - waiting for locator('[name=password]') at src/webwallet/page-objects/Dapps.ts:65 63 | await popup.locator("[name=repeatPassword]").fill(credentials.password) 64 | } else { > 65 | await popup.locator("[name=password]").fill(credentials.password) | ^ 66 | } 67 | 68 | // password submit at Dapps.fillCredentials (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:65:46) at Dapps.requestConnectionFromDapp (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:37:7) at /__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/specs/token.spec.ts:9:5

Check failure on line 65 in e2e/src/webwallet/page-objects/Dapps.ts

View workflow job for this annotation

GitHub Actions / test-webwallet

[WebWallet] › src/webwallet/specs/transactions.spec.ts:5:7 › Transactions › send an ERC20 from testDapp

5) [WebWallet] › src/webwallet/specs/transactions.spec.ts:5:7 › Transactions › send an ERC20 from testDapp TimeoutError: locator.fill: Timeout 120000ms exceeded. Call log: - waiting for locator('[name=password]') at src/webwallet/page-objects/Dapps.ts:65 63 | await popup.locator("[name=repeatPassword]").fill(credentials.password) 64 | } else { > 65 | await popup.locator("[name=password]").fill(credentials.password) | ^ 66 | } 67 | 68 | // password submit at Dapps.fillCredentials (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:65:46) at Dapps.requestConnectionFromDapp (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:37:7) at /__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/specs/transactions.spec.ts:6:5
}

// password submit
Expand Down Expand Up @@ -125,10 +125,10 @@

await expect(popup.getByText("Sign Message")).toBeVisible()
await expect(popup.getByText("Confirm")).toBeVisible()
await popup.getByText("Confirm").click({ timeout: 30000, force: true })
await popup.getByText("Confirm").click({ timeout: 3000, force: true })

await Promise.all([
expect(this.dApp.getByText("Signer", { exact: true })).toBeVisible(),

Check failure on line 131 in e2e/src/webwallet/page-objects/Dapps.ts

View workflow job for this annotation

GitHub Actions / test-webwallet

[WebWallet] › src/webwallet/specs/signMessage.spec.ts:5:7 › Sign message › sign a message from testDapp

4) [WebWallet] › src/webwallet/specs/signMessage.spec.ts:5:7 › Sign message › sign a message from testDapp Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 120000ms waiting for expect(locator).toBeVisible() Locator: getByText('Signer', { exact: true }) Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 120000ms - waiting for getByText('Signer', { exact: true }) at src/webwallet/page-objects/Dapps.ts:131 129 | 130 | await Promise.all([ > 131 | expect(this.dApp.getByText("Signer", { exact: true })).toBeVisible(), | ^ 132 | expect(this.dApp.getByText("Cosigner", { exact: true })).toBeVisible(), 133 | expect(this.dApp.locator("[name=signer_r]")).toBeVisible(), 134 | expect(this.dApp.locator("[name=signer_s]")).toBeVisible(), at Dapps.signMessage (/__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/page-objects/Dapps.ts:131:62) at /__w/demo-dapp-starknet/demo-dapp-starknet/e2e/src/webwallet/specs/signMessage.spec.ts:13:5
expect(this.dApp.getByText("Cosigner", { exact: true })).toBeVisible(),
expect(this.dApp.locator("[name=signer_r]")).toBeVisible(),
expect(this.dApp.locator("[name=signer_s]")).toBeVisible(),
Expand All @@ -154,4 +154,54 @@
expect(dialog.message()).toContain("Not implemented")
await dialog.accept()
}

async sessionKeys() {
const popupPromise = this.dApp.waitForEvent("popup")

await this.dApp.locator('button :text-is("Session Keys")').click()
await expect(
this.dApp.locator(`button :text-is("Create session")`),
).toBeVisible()
await this.dApp.waitForTimeout(100)
const [, popup] = await Promise.all([
this.dApp.locator(`button :text-is("Create session")`).click(),
popupPromise,
])

await popup
.getByRole("button")
.and(popup.getByText("Start session"))
.click()
await this.dApp.waitForTimeout(1000)

const dialogPromise = this.dApp.waitForEvent("dialog")
const [, dialog] = await Promise.all([
this.dApp.getByText("Submit session tx").click(),
dialogPromise,
])

expect(dialog.message()).toContain("Transaction sent")
await dialog.accept()

await this.dApp.waitForTimeout(500)
await this.dApp.getByText("Submit EFO call").click()
const dialogPromiseEFO = this.dApp.waitForEvent("dialog")
await this.dApp.waitForTimeout(100)
this.dApp.getByText("Copy EFO call").click()
const dialogEFO = await dialogPromiseEFO
await this.dApp.waitForTimeout(500)
expect(dialogEFO.message()).toContain("Data copied in your clipboard")
await dialogEFO.accept()

await this.dApp.getByText("Submit EFO TypedData").click()
const dialogPromiseEFOTypedData = this.dApp.waitForEvent("dialog")
await this.dApp.waitForTimeout(100)
this.dApp.getByText("Copy EFO TypedData").click()
const dialogEFOTypedData = await dialogPromiseEFOTypedData
await this.dApp.waitForTimeout(500)
expect(dialogEFOTypedData.message()).toContain(
"Data copied in your clipboard",
)
await dialogEFOTypedData.accept()
}
}
18 changes: 18 additions & 0 deletions e2e/src/webwallet/specs/sessionKeys.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import test from "../test"
import config from "../config"

test.describe(`Session Keys`, () => {
test(`create a sessions, send a transaction a get EFO data`, async ({
webWallet,
dApp,
}) => {
await webWallet.dapps.requestConnectionFromDapp({
dApp,
credentials: config.validLogin,
newAccount: false,
useStarknetKitModal: true,
})

await webWallet.dapps.sessionKeys()
})
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
"prepare": "husky"
},
"dependencies": {
"@argent/x-sessions": "7.0.0-beta.5",
"@starknet-io/get-starknet-core": "4.0.4",
"@starknet-react/chains": "^3.1.0",
"@starknet-react/core": "^3.5.0",
"next": "15.0.2",
"react": "19.0.0-rc-02c0e824-20241028",
"react-dom": "19.0.0-rc-02c0e824-20241028",
"starknet": "^6.11.0",
"starknetkit": "^2.6.1"
"starknetkit": "2.6.2"
},
"devDependencies": {
"@commitlint/cli": "^19.5.0",
Expand Down
23 changes: 18 additions & 5 deletions pnpm-lock.yaml

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

99 changes: 0 additions & 99 deletions src/abi/DummyContract.json

This file was deleted.

Loading
Loading