-
-
Notifications
You must be signed in to change notification settings - Fork 261
Eth and personal sign #29
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
Conversation
brunobar79
left a comment
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.
Minor comments but this is solid stuff @estebanmino 💯
| import { EventEmitter } from 'events'; | ||
| import BaseController, { BaseConfig, BaseState } from './BaseController'; | ||
| import { validatePersonalSignMessageData, normalizeMessageData } from './util'; | ||
| const random = require('uuid/v1'); |
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.
import ?
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.
honestly I didn't question this, TransactionController uses the same and imports it in the same way
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.
You're right. Other files are also using require. Maybe we should standardize? cc: @bitpshr
src/PersonalMessageManager.ts
Outdated
| /** | ||
| * @type Message | ||
| * | ||
| * Represents, and contains data about, an 'personal_sign' type signature request. |
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.
"Represents, and contains data about a 'personal_sign' type signature request."
src/PersonalMessageManager.ts
Outdated
| * @property id - An id to track and identify the message object | ||
| * @property messageParams - The parameters to pass to the personal_sign method once the signature request is approved | ||
| * @property type - The json-prc signing method for which a signature request has been made. | ||
| * A 'Message' with always have a 'personal_sign' type |
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.
"A 'Message' which always has..."
src/PersonalMessageManager.ts
Outdated
| /** | ||
| * @type MessageParamsMetamask | ||
| * | ||
| * Represents, the parameters to pass to the personal_sign method once the signature request is approved |
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.
Represents the (remove comma)
| * | ||
| */ | ||
| getUnapprovedMessages() { | ||
| return this.messages |
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.
ES6 + Functional programming + TypeScript = 💣 🔥
Codecov Report
@@ Coverage Diff @@
## master #29 +/- ##
======================================
Coverage 100% 100%
======================================
Files 18 19 +1
Lines 889 989 +100
Branches 97 107 +10
======================================
+ Hits 889 989 +100
Continue to review full report at Codecov.
|
* add message manager * start message manager test * handle metamaskId * complete message manager tests * delete unnecessary imports * delete generated file * emit unapprovedMessage & keyring signMessage * update to PersonalMessageManager * update to PersonalMessageManager * add signPersonalMessage * eth_sign to personal_sign * fix signPersonalMessage * update doc * emit updateBadge when save messages * update doc * Update personalSIgn util tests description
* add message manager * start message manager test * handle metamaskId * complete message manager tests * delete unnecessary imports * delete generated file * emit unapprovedMessage & keyring signMessage * update to PersonalMessageManager * update to PersonalMessageManager * add signPersonalMessage * eth_sign to personal_sign * fix signPersonalMessage * update doc * emit updateBadge when save messages * update doc * Update personalSIgn util tests description
This PR is mostly a migration to ts of this to have both eth_sign and personal_sign as proposed here MetaMask/metamask-extension#4117
It also exposes
signPersonalMessagefrometh-keyring-controller