-
Notifications
You must be signed in to change notification settings - Fork 563
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
Add basic support for account RPC methods in snaps simulator #1710
Conversation
Co-authored-by: Maarten Zuidhoorn <[email protected]>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1710 +/- ##
=======================================
Coverage 95.87% 95.87%
=======================================
Files 239 239
Lines 5401 5409 +8
Branches 836 836
=======================================
+ Hits 5178 5186 +8
Misses 223 223
☔ View full report in Codecov by Sentry. |
@@ -80,16 +80,20 @@ export function* initSaga({ payload }: PayloadAction<string>) { | |||
|
|||
const srp: string = yield select(getSrp); | |||
|
|||
const sharedHooks = { | |||
getMnemonic: async () => mnemonicPhraseToBytes(srp), |
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 this be covered?
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.
None of the hooks are currently covered because we don't have tests that run them directly. IMO out of scope for this PR and not exactly sure how we test to cover them
This PR adds basic support for account RPC methods in the simulator by deriving the first address of the SRP and returning that when
eth_requestAccounts
oreth_accounts
is requested. In the future, we should provide a permission flow that mirrors MetaMask clients, but for now this is useful.Fixes #1578