Skip to content

Commit 4b886f5

Browse files
committed
feat: added the ability to not confirm wallet connection actions or transaction signing
1 parent 5044d66 commit 4b886f5

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

qa/WalletExtension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export abstract class WalletExtension {
2525
*/
2626
abstract importWallet(seedPhrase: string): Promise<void>
2727

28-
abstract connect(): Promise<void>
28+
abstract connect(confirm?: boolean): Promise<void>
2929

30-
abstract accept(): Promise<void>
30+
abstract accept(confirm?: boolean): Promise<void>
3131
}

qa/tonkeeper/Tonkeeper.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,25 @@ export class Tonkeeper extends WalletExtension {
5252
await recoveryPhrasePage.getByRole('button', { name: 'Save' }).click()
5353
}
5454

55-
async connect(): Promise<void> {
55+
async connect(confirm?: boolean): Promise<void> {
5656
const acceptPage = await this.context.waitForEvent('page')
5757
await acceptPage.getByRole('button', { name: 'Connect wallet' }).click()
5858
await acceptPage.locator('#unlock-password').fill(this.password)
59-
await acceptPage.getByRole('button', { name: 'Confirm' }).click()
59+
if (confirm !== false) {
60+
await acceptPage.getByRole('button', { name: 'Confirm' }).click()
61+
} else {
62+
await acceptPage.getByRole('button', { name: 'Cancel' }).click()
63+
}
6064
}
6165

62-
async accept(): Promise<void> {
66+
async accept(confirm?: boolean): Promise<void> {
6367
const acceptPage = await this.context.waitForEvent('page')
6468
await acceptPage.getByRole('button', { name: 'Confirm' }).click()
6569
await acceptPage.locator('#unlock-password').fill(this.password)
66-
await acceptPage.getByRole('button', { name: 'Confirm' }).click()
70+
if (confirm !== false) {
71+
await acceptPage.getByRole('button', { name: 'Confirm' }).click()
72+
} else {
73+
await acceptPage.getByRole('button', { name: 'Cancel' }).click()
74+
}
6775
}
6876
}

0 commit comments

Comments
 (0)