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

Feat/add GridPlus Lattice1 Hardware Wallet #1346

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
06bb15b
feat(hw): add gridplus connect option
mrcnk Nov 21, 2023
0e91d8d
feat(gridplus): add a gridplus connector route
mrcnk Nov 22, 2023
d840b7e
feat(gridplus): add nested routes for gridplus onboarding
mrcnk Dec 4, 2023
a9969b0
feat(gridplus): connect gridplus routes
mrcnk Dec 4, 2023
1bf3bb9
feat(gridplus): unstub onboarding
mrcnk Dec 14, 2023
2055931
fix(conflicts): resolve
mrcnk Dec 14, 2023
bf6c40d
feat(gridplus): wrap up gridplus onboarding
mrcnk Dec 15, 2023
cc5f025
feat(gridplus): add styles to addresses choice
mrcnk Dec 15, 2023
8ff215d
feat(gridplus): add signTransactionFromGridPlus and sendTransactionFr…
mrcnk Jan 5, 2024
0633f1f
feat(gridplus): add a handler for personal signature
mrcnk Jan 17, 2024
fc486e3
feat(gridplus): wrap up typed data signing
mrcnk Jan 18, 2024
6c0ba38
fix(gridplus): fix personal sign
mrcnk Jan 18, 2024
cace361
chore(e2e): add semi-automatic testing for GridPlus
mrcnk Jan 24, 2024
44b9a96
chore(gridplus): update image assets
mrcnk Jan 26, 2024
052c74d
feat(gridplus): implement add by index
mrcnk Jan 30, 2024
36dd231
chore(gridplus): improve onboarding ui
mrcnk Feb 1, 2024
f5c1b8d
feat(gridplus): add informative labels for the onboarding
mrcnk Feb 2, 2024
7e64b4a
chore(gridplus): handle case of removed permissions in Lattice
mrcnk Feb 12, 2024
e2bcecc
chore(gridplus): sync up with latest origin
mrcnk Feb 15, 2024
589f968
Merge branch 'master' into feat/add-gridplus-lattice1
mrcnk Feb 26, 2024
520ce66
fix(gridplus): pr improvements
mrcnk Feb 28, 2024
2c8759c
fix(gridplus): revert trezor vendor lib linting changes
mrcnk Feb 28, 2024
c0a489d
fix(gridplus): revert checkbox changes
mrcnk Feb 28, 2024
0ebd883
chore(gridplus): add onboarding e2e flow mocks
mrcnk Feb 29, 2024
25bc5f4
Merge branch 'master' into feat/add-gridplus-lattice1
BrodyHughes Feb 29, 2024
fe5d6e7
fix(gridplus): apply pr feedback
mrcnk Mar 11, 2024
e20520e
Merge branch 'feat/add-gridplus-lattice1' of github.com:mrcnk/browser…
mrcnk Mar 11, 2024
21b75f8
Merge branch 'master' into feat/add-gridplus-lattice1
mrcnk Mar 14, 2024
ade3086
fix(gridplus): fix L2 transactions
mrcnk Apr 15, 2024
ad91af6
fix(conflicts): resolve
mrcnk Apr 15, 2024
7b47ed3
chore(gridplus): update logo in wallets & keys
mrcnk Apr 15, 2024
0d2cca3
Merge branch 'master' into feat/add-gridplus-lattice1
DanielSinclair May 1, 2024
03accfd
refactor AddressChoice
greg-schrammel Apr 22, 2024
b309e86
a
greg-schrammel Apr 22, 2024
52179a6
generate password (?)
greg-schrammel Apr 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
49 changes: 48 additions & 1 deletion e2e/helpers.ts
Expand Up @@ -811,6 +811,53 @@ export async function importHardwareWalletFlow(
await findElementByText(driver, 'Rainbow is ready to use');
}

export async function importGridPlusWallet(driver: WebDriver, rootURL: string) {
await goToWelcome(driver, rootURL);
await findElementByTestIdAndClick({
id: 'import-wallet-button',
driver,
});
await findElementByTestIdAndClick({
id: 'connect-wallet-option',
driver,
});
await findElementByTestIdAndClick({
id: `gridplus-option`,
driver,
});
const inputDeviceId = await findElementByTestId({
id: 'gridplus-deviceid',
driver,
});
await inputDeviceId.sendKeys('MOCKED_DEVICE_ID');
const inputPassword = await findElementByTestId({
id: 'gridplus-password',
driver,
});
await inputPassword.sendKeys('MOCKED_PASSWORD');
await delayTime('long');
await findElementByTestIdAndClick({
id: 'gridplus-submit',
driver,
});
await findElementByTestIdAndClick({
id: 'gridplus-address-0',
driver,
});
await findElementByTestIdAndClick({
id: 'gridplus-submit',
driver,
});
await findElementByTestIdAndClick({
id: 'connect-wallets-button',
driver,
});
await findElementByTestIdAndClick({
id: 'hw-done',
driver,
});
}

export async function importWalletFlowUsingKeyboardNavigation(
driver: WebDriver,
rootURL: string,
Expand Down Expand Up @@ -1069,7 +1116,7 @@ export async function delay(ms: number) {
}

export async function delayTime(
time: 'short' | 'medium' | 'long' | 'very-long',
time: 'short' | 'medium' | 'long' | 'very-long' | 'unbelievably-long',
mrcnk marked this conversation as resolved.
Show resolved Hide resolved
) {
switch (time) {
case 'short':
Expand Down
37 changes: 37 additions & 0 deletions e2e/parallel/GridPlusImportFlow.test.ts
@@ -0,0 +1,37 @@
import 'chromedriver';
import 'geckodriver';
import { WebDriver } from 'selenium-webdriver';
import { afterAll, beforeAll, describe, it } from 'vitest';

import {
getExtensionIdByName,
getRootUrl,
importGridPlusWallet,
initDriverWithOptions,
} from '../helpers';

let rootURL = getRootUrl();
let driver: WebDriver;

const browser = process.env.BROWSER || 'chrome';
const os = process.env.OS || 'mac';

describe.runIf(browser !== 'firefox')(
'Import wallet with GridPlus Lattice1',
() => {
beforeAll(async () => {
driver = await initDriverWithOptions({
browser,
os,
});
const extensionId = await getExtensionIdByName(driver, 'Rainbow');
if (!extensionId) throw new Error('Extension not found');
rootURL += extensionId;
});
afterAll(async () => driver.quit());

it('should be able import a wallet via hw wallet', async () => {
await importGridPlusWallet(driver, rootURL);
mrcnk marked this conversation as resolved.
Show resolved Hide resolved
});
},
);
192 changes: 96 additions & 96 deletions lavamoat/build-webpack/policy.json
Expand Up @@ -841,6 +841,22 @@
"process.nextTick": true
}
},
"gridplus-sdk>secp256k1>node-gyp-build": {
"builtin": {
"fs.existsSync": true,
"fs.readdirSync": true,
"os.arch": true,
"os.platform": true,
"path.dirname": true,
"path.join": true,
"path.resolve": true
},
"globals": {
"__non_webpack_require__": true,
"__webpack_require__": true,
"process": true
}
},
"happy-dom>he": {
"globals": {
"define": true
Expand Down Expand Up @@ -1099,13 +1115,13 @@
"eslint>debug": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/code-frame": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/generator": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-environment-visitor": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-hoist-variables": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-split-export-declaration": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/parser": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/types": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>globals": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-environment-visitor": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-hoist-variables": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-split-export-declaration": true
"jest>@jest/core>jest-snapshot>@babel/traverse>globals": true
}
},
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/code-frame": {
Expand Down Expand Up @@ -1172,141 +1188,141 @@
"define": true
}
},
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/types": {
"globals": {
"console.warn": true,
"process.env.BABEL_TYPES_8_BREAKING": true
},
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name": {
"packages": {
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/types>@babel/helper-string-parser": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/types>@babel/helper-validator-identifier": true,
"lavamoat>lavamoat-core>@babel/types>to-fast-properties": true
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/types": true
}
},
"jest>@jest/core>jest-snapshot>@babel/types": {
"globals": {
"console.trace": true,
"process.env.BABEL_TYPES_8_BREAKING": true
},
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template": {
"packages": {
"jest>@jest/core>jest-snapshot>@babel/types>@babel/helper-string-parser": true,
"jest>@jest/core>jest-snapshot>@babel/types>@babel/helper-validator-identifier": true,
"lavamoat>lavamoat-core>@babel/types>to-fast-properties": true
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/parser": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/types": true
}
},
"lavamoat>@babel/highlight": {
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame": {
"globals": {
"console.warn": true,
"process.emitWarning": true
},
"packages": {
"lavamoat>@babel/highlight>@babel/helper-validator-identifier": true,
"lavamoat>@babel/highlight>chalk": true,
"react>loose-envify>js-tokens": true
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk": true,
"lavamoat>@babel/highlight": true
}
},
"lavamoat>@babel/highlight>chalk": {
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk": {
"globals": {
"process.env.TERM": true,
"process.platform": true
},
"packages": {
"lavamoat>@babel/highlight>chalk>ansi-styles": true,
"lavamoat>@babel/highlight>chalk>escape-string-regexp": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk>ansi-styles": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk>escape-string-regexp": true,
"supports-color": true
}
},
"lavamoat>@babel/highlight>chalk>ansi-styles": {
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk>ansi-styles": {
"packages": {
"lavamoat>@babel/highlight>chalk>ansi-styles>color-convert": true
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk>ansi-styles>color-convert": true
}
},
"lavamoat>@babel/highlight>chalk>ansi-styles>color-convert": {
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk>ansi-styles>color-convert": {
"packages": {
"lavamoat>@babel/highlight>chalk>ansi-styles>color-convert>color-name": true
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk>ansi-styles>color-convert>color-name": true
}
},
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name": {
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/types": {
"globals": {
"console.warn": true,
"process.env.BABEL_TYPES_8_BREAKING": true
},
"packages": {
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/types": true
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/types>@babel/helper-string-parser": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-function-name>@babel/types>@babel/helper-validator-identifier": true,
"lavamoat>lavamoat-core>@babel/types>to-fast-properties": true
}
},
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template": {
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-hoist-variables": {
"packages": {
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/parser": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/types": true
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-hoist-variables>@babel/types": true
}
},
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame": {
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-hoist-variables>@babel/types": {
"globals": {
"console.warn": true,
"process.emitWarning": true
"process.env.BABEL_TYPES_8_BREAKING": true
},
"packages": {
"lavamoat>@babel/highlight": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk": true
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-hoist-variables>@babel/types>@babel/helper-string-parser": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-hoist-variables>@babel/types>@babel/helper-validator-identifier": true,
"lavamoat>lavamoat-core>@babel/types>to-fast-properties": true
}
},
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk": {
"globals": {
"process.env.TERM": true,
"process.platform": true
},
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-split-export-declaration": {
"packages": {
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk>ansi-styles": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk>escape-string-regexp": true,
"supports-color": true
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-split-export-declaration>@babel/types": true
}
},
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk>ansi-styles": {
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-split-export-declaration>@babel/types": {
"globals": {
"console.warn": true,
"process.env.BABEL_TYPES_8_BREAKING": true
},
"packages": {
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk>ansi-styles>color-convert": true
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-split-export-declaration>@babel/types>@babel/helper-string-parser": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/helper-split-export-declaration>@babel/types>@babel/helper-validator-identifier": true,
"lavamoat>lavamoat-core>@babel/types>to-fast-properties": true
}
},
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk>ansi-styles>color-convert": {
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/types": {
"globals": {
"console.warn": true,
"process.env.BABEL_TYPES_8_BREAKING": true
},
"packages": {
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk>ansi-styles>color-convert>color-name": true
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/types>@babel/helper-string-parser": true,
"jest>@jest/core>jest-snapshot>@babel/traverse>@babel/types>@babel/helper-validator-identifier": true,
"lavamoat>lavamoat-core>@babel/types>to-fast-properties": true
}
},
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/types": {
"jest>@jest/core>jest-snapshot>@babel/types": {
"globals": {
"console.warn": true,
"console.trace": true,
"process.env.BABEL_TYPES_8_BREAKING": true
},
"packages": {
"lavamoat>lavamoat-core>@babel/types>to-fast-properties": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/types>@babel/helper-string-parser": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/types>@babel/helper-validator-identifier": true
"jest>@jest/core>jest-snapshot>@babel/types>@babel/helper-string-parser": true,
"jest>@jest/core>jest-snapshot>@babel/types>@babel/helper-validator-identifier": true,
"lavamoat>lavamoat-core>@babel/types>to-fast-properties": true
}
},
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-hoist-variables": {
"lavamoat>@babel/highlight": {
"packages": {
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-hoist-variables>@babel/types": true
"lavamoat>@babel/highlight>@babel/helper-validator-identifier": true,
"lavamoat>@babel/highlight>chalk": true,
"react>loose-envify>js-tokens": true
}
},
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-hoist-variables>@babel/types": {
"lavamoat>@babel/highlight>chalk": {
"globals": {
"console.warn": true,
"process.env.BABEL_TYPES_8_BREAKING": true
"process.env.TERM": true,
"process.platform": true
},
"packages": {
"lavamoat>lavamoat-core>@babel/types>to-fast-properties": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-hoist-variables>@babel/types>@babel/helper-string-parser": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-hoist-variables>@babel/types>@babel/helper-validator-identifier": true
"lavamoat>@babel/highlight>chalk>ansi-styles": true,
"lavamoat>@babel/highlight>chalk>escape-string-regexp": true,
"supports-color": true
}
},
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-split-export-declaration": {
"lavamoat>@babel/highlight>chalk>ansi-styles": {
"packages": {
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-split-export-declaration>@babel/types": true
"lavamoat>@babel/highlight>chalk>ansi-styles>color-convert": true
}
},
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-split-export-declaration>@babel/types": {
"globals": {
"console.warn": true,
"process.env.BABEL_TYPES_8_BREAKING": true
},
"lavamoat>@babel/highlight>chalk>ansi-styles>color-convert": {
"packages": {
"lavamoat>lavamoat-core>@babel/types>to-fast-properties": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-split-export-declaration>@babel/types>@babel/helper-string-parser": true,
"lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-split-export-declaration>@babel/types>@babel/helper-validator-identifier": true
"lavamoat>@babel/highlight>chalk>ansi-styles>color-convert>color-name": true
}
},
"lint-staged>execa>merge-stream": {
Expand Down Expand Up @@ -1526,23 +1542,7 @@
},
"native": true,
"packages": {
"viem>ws>bufferutil>node-gyp-build": true
}
},
"viem>ws>bufferutil>node-gyp-build": {
"builtin": {
"fs.existsSync": true,
"fs.readdirSync": true,
"os.arch": true,
"os.platform": true,
"path.dirname": true,
"path.join": true,
"path.resolve": true
},
"globals": {
"__non_webpack_require__": true,
"__webpack_require__": true,
"process": true
"gridplus-sdk>secp256k1>node-gyp-build": true
}
},
"viem>ws>utf-8-validate": {
Expand All @@ -1551,7 +1551,7 @@
},
"native": true,
"packages": {
"viem>ws>bufferutil>node-gyp-build": true
"gridplus-sdk>secp256k1>node-gyp-build": true
}
},
"vitest>acorn": {
Expand Down