Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

feat: speedup initializing MetaMask #238

Merged
merged 51 commits into from
Jan 20, 2023
Merged

Conversation

BeroBurny
Copy link
Contributor

Short description of work done
Implement methods to backup user profile data and load the browser from updated data to speed up the initial start time of dappateer

PR Checklist

  • I have run linter locally
  • I have run unit and integration tests locally
    • Update configuration the newest version (readme and const)
  • Rebased to master branch / merged master

Closes #120

mpetrunic and others added 30 commits September 22, 2022 15:47
Fix casing of MetaMask

Co-authored-by: Marin Petrunic <marin.petrunic@gmail.com>
* fix: update ganache, fix test depending on goerli

* fix: bugs in selectors, less timeout, reorganise structure

* update yarn

* chore: improve root hooks

* try to increase timeout

* better ci

* add screenshot uploading to ci

* fix screenshot name

* run screenshot on failed test

* fix lint

* change viewport

* fix tests

* fix#123124

* fix tests

* whyyyyyyyyyyyyyyyyyyyyyyyyy

* please

* fix testing dapp

* dunno anymore

* fix lint

* fix typo in selector

* update dapp loading

* refactor script fetching for `index.html`

* fix dam sing test

Co-authored-by: Bernard <bero4net@gmail.com>
fix: import-token flakyness
* feat!: update recommended metamask version

* implement screenshot helper

* implement hide portfolio popup action

* implement close what's new modal action

* remove obsolete test

* fix dappeteer methods broken on update

* chore: fix lint

* update metamask version to `10.20.0`

* fix addToken.ts

* address issues

* fix lint

* fix tests

* fix #4

* fix non visible buttons

Co-authored-by: Bernard Stojanović <bero4net@gmail.com>
* chore: change eslint to chainsafe config

* address PR comments

* address PR comments

* fix tests
feat: add support for installing metamask flaask
* feat: add support for installing metamask flaask

* feat: ability to install snaps

* fi lint

* fix starting a snap

* fix snap install

Co-authored-by: Bernard <bero4net@gmail.com>
* fix: run all tests, faster check for installed snap

* fix condition bug
* Add invokeSnap method; update installSnap method parameter;

* adjust invokeSnap method after review

* Fix params type in invokeSnap method

* update invokeSnap Return type

* update invokeSnap with generic params

* update test expectation

* fix lint
* feat:add ability to accept dialogs (#138)

* fix lint

* move installSnap, invokeSnap to dappeteer api; add bringToFront call to dialog methods

* pair improvements

* fix lint

* add methods snap

* exclude flask tests from global

* exclude flask tests from global

Co-authored-by: Bernard <bero4net@gmail.com>
* feat!: add playwright support

* fix: lint

* fix: ci matrix

* don't run snap tests on non flask

* address PR comments
* pair improvements

* fix lint

* feat: add notify Snap method

* Added getAllNotifications method

* go back after getting all notifications

* remove timeout

* fix post merge errors

Co-authored-by: Bernard <bero4net@gmail.com>
Co-authored-by: Marin Petrunic <marin.petrunic@gmail.com>
* feat: install snap from local files

* fix: installing and invokeing snaps

* disable addToken test

* disable fail fast

* replace binance smart chain
set engines compatibility for 16 and above
* feat!: replaced addTokenMethod

* feat: remove add network method
* cache yarn and have lint and build as separate steps

* add back yarn.lock

* add jobs

* fix name
* add test to sign typed data

* add a check to see if the sign button is actually disabled

* clean up

* fix and clean

* remove flackyness

* lint

* fix playwright

* add hidden option for pupeteer types waitForSelector

* remove reload between tests
…#194)

* add retries when confirming prompts with lower timeout

* better snap error handling, ability to accept multiple key permissions

* bail on first fail

* add context to screenshots

* remove various random timeouts, add wait for overlay, more retrys

* fix lint

* increase timeout for loading network and token details

* address PR comments

* increase timeout

* add retry to profile dropdown
* chore: node engine requirements (#184) (#186)

set engines compatibility for 16 and above

Co-authored-by: Bernard Stojanović <bero4net@gmail.com>

* pair improvements

* fix lint

* feat: add notify Snap method

* go back after getting all notifications

* remove timeout

* wip

* Add notification observe method

* update test

* remove unused code

* wip notifiction observer

* wip observer based notifications

* wip observer based notifications

* remove unused dependency

* cleanup

* fixes after merge

* revert method names

* clean waitForNotification method

* emitter solution - FP

* emitter solution - ClassBased

* Cleanup class based emitter

* fix lint

* fixes after merge

* remove p-event library

* remove eslint comment

* update test configuration

* return NotificationList from waitForNotification

* add getNotificationEmitter method

* remove back button

Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com>
Co-authored-by: Bernard Stojanović <bero4net@gmail.com>
Co-authored-by: Marin Petrunic <marin.petrunic@gmail.com>
* sharedConst and signature check

* without sharedConst :)

* request accounts

* request accounts

* long typed data

* short typed data

* add token reject/accept

* add network accept/reject

* actually verify the lock/unlock

* contract interactions

* address comment

* web3-utils 1.3.4

* addToken and addNetwork use boolean

* remove useless wait
* docs

* change to metaMask accross the board and use bootstrap in our test

* MetaMMMMMMask

* snaps methods in API.md

* snaps usage in Readme.md

* Update README.md

Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com>

* address comment

* add forgotten menu item for initSnapEnv

* removing jsdoc

Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com>
* docs

* change to metaMask accross the board and use bootstrap in our test

* MetaMMMMMMask

* snaps methods in API.md

* snaps usage in Readme.md

* init

* lint

* add dev deps for ganache/console.log to make build pass

* Update README.md

Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com>

* address comment

* add forgotten menu item for initSnapEnv

* removing jsdoc

Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com>
@BeroBurny BeroBurny marked this pull request as ready for review January 17, 2023 15:49
irubido
irubido previously approved these changes Jan 18, 2023
# Conflicts:
#	.github/workflows/main.yml
irubido
irubido previously approved these changes Jan 19, 2023

getUserDataDirPath(): string;

storeUserData(destination: string): boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are we using the boolean returned from the method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It returns true if success false if fails somewhere
For future proofing and for users

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better to throw the error if the data is not stored? Can we assume the case that we can continue even if the method is failed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How avoid import seed to metamask every time
6 participants