Skip to content

Commit

Permalink
Merge pull request #16 from argentlabs/develop
Browse files Browse the repository at this point in the history
session keys prod sepolia
  • Loading branch information
bluecco authored Dec 23, 2024
2 parents e9ea417 + 736a9db commit b41c86c
Show file tree
Hide file tree
Showing 27 changed files with 640 additions and 398 deletions.
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 @@ -125,7 +125,7 @@ export default class Dapps extends Navigation {

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(),
Expand Down Expand Up @@ -154,4 +154,54 @@ export default class Dapps extends Navigation {
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

0 comments on commit b41c86c

Please sign in to comment.