Skip to content

Commit

Permalink
Fixed e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsekulic committed Nov 21, 2022
1 parent f8fbedb commit 1f5db07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions app/scripts/lib/personal-message-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,17 @@ export default class PersonalMessageManager extends EventEmitter {
* @param {object} [req] - The original request object possibly containing the origin
* @returns {promise} When the message has been signed or rejected
*/
addUnapprovedMessageAsync(msgParams, req) {
async addUnapprovedMessageAsync(msgParams, req) {
const msgId = await this.addUnapprovedMessage(msgParams, req);

return new Promise((resolve, reject) => {
if (!msgParams.from) {
reject(
new Error('MetaMask Message Signature: from field is required.'),
);
return;
}
const msgId = this.addUnapprovedMessage(msgParams, req);

this.once(`${msgId}:finished`, (data) => {
switch (data.status) {
case 'signed':
Expand Down
5 changes: 3 additions & 2 deletions app/scripts/lib/typed-message-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ export default class TypedMessageManager extends EventEmitter {
* @param version
* @returns {promise} When the message has been signed or rejected
*/
addUnapprovedMessageAsync(msgParams, req, version) {
async addUnapprovedMessageAsync(msgParams, req, version) {
const msgId = await this.addUnapprovedMessage(msgParams, req, version);

return new Promise((resolve, reject) => {
const msgId = this.addUnapprovedMessage(msgParams, req, version);
this.once(`${msgId}:finished`, (data) => {
switch (data.status) {
case 'signed':
Expand Down

0 comments on commit 1f5db07

Please sign in to comment.