-
Notifications
You must be signed in to change notification settings - Fork 2
refactor(tron-wallet-snap): assert supported networks at handler boundaries instead of casting #394
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
Changes from all commits
31ad607
f803d0b
e354bc2
33731fa
9fdc091
eecc11a
746f36f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The previous code's direct access to |
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When working locally on each Snap we should have narrowed types for certain locally stored things that we know are chain specific. Keyring accounts are a good example. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import type { ExtendedKeyringAccount } from '@metamask/snap-networks-utils'; | ||
|
|
||
| import type { Network } from '../constants'; | ||
|
|
||
| export type TronKeyringAccount = Omit<ExtendedKeyringAccount, 'scopes'> & { | ||
| scopes: Network[]; | ||
| }; |
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.
The previous code's direct access to
baseUrlwas nice but doesn't play well with typescript becausenetworkalways gets casted asstring.