-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
✨ feat: Add keplr wallet support and shared utils package #1147
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Things to change:
|
"extends": "./tsconfig.build.json", | ||
"compilerOptions": { | ||
"rootDir": ".", | ||
"exactOptionalPropertyTypes": false, // Allows for `undefined` in `playwright.config.ts` | ||
"types": ["cypress"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will need that :)
let extensionNames = extensionsToSetup() | ||
|
||
if (!extensionNames.length) { | ||
extensionNames = ['Keplr'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we use MetaMask as default?
@@ -1,6 +1,6 @@ | |||
import path from 'node:path' | |||
import fs from 'fs-extra' | |||
import { CACHE_DIR_NAME } from './constants' | |||
import { CACHE_DIR_NAME } from '../../cache/src/constants' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do "./ensureCacheDirExists"?
export * from './downloadFile' | ||
export * from './unzipArchive' | ||
export * from '../../cache/src/unzipArchive' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why isn't it in the same "cache" directory?
@@ -1,6 +1,7 @@ | |||
import { getUniqueWalletSetupFunctions } from './utils/getUniqueWalletSetupFunctions' | |||
import { triggerCacheCreation } from './utils/triggerCacheCreation' | |||
|
|||
//@TODO: Make it so createCache can handle only one wallet setup function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason when we only have 1 setup file, the hash generated in prepareExtension creates what would have been the the hash from the second item in the wallet setup functions array.
If there's 2 or more setup functions this behaviour does not happen (this is true for MM as well even before adding Keplr)
This will be tackled in a separate issue
await notificationPage.waitForLoadState('domcontentloaded') | ||
await notificationPage.waitForSelector(notificationPageElements.approveButton) | ||
await notificationPage.click(notificationPageElements.approveButton) | ||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
@@ -0,0 +1,10 @@ | |||
export const homePageElements = { | |||
tokenNameLabel: (tokenName: string) => `:text-is("${tokenName}")`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tokenNameLabel: (tokenName: string) => `:text-is("${tokenName}")`, | |
getTokenNameLabel: (tokenName: string) => `:text-is("${tokenName}")`, |
newTokensFound: 'new token(s) found', | ||
addChainsButton: 'Add Chains', | ||
newTokensFoundSelector: 'text=new token(s) found', | ||
walletSelectors: (chainName: string) => `img[alt="${chainName}"]`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selectors? isn't it only one?
}, | ||
|
||
page: async ({ page }, use) => { | ||
await page.goto('https://wallet.keplr.app/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not to use default page?
NOTE:We need to update synpress npm packages and versioning in package.json before we merge this |
Motivation and context
We want to support keplr wallet and the cosmos ecosystem, as well as Phantom to support the Solana ecosystem. Additionally we want to set a standard for multi-wallet cache support
Does it fix any issue?
Other useful info
prepareExtension
wallet solely in sypress-cache and all the units are already tested in cacheQuality checklist