Skip to content

Commit

Permalink
remove duplicate payload.method typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Feb 6, 2020
1 parent a03eeec commit 07ed346
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,11 @@ MetamaskInpageProvider.prototype.send = function (methodOrPayload, params) {
}
}

// typecheck payload, payload.method, and payload.params
// typecheck payload and payload.params
if (
typeof payload !== 'object' ||
Array.isArray(payload) ||
!Array.isArray(params) ||
!payload.method || typeof payload.method !== 'string'
!Array.isArray(params)
) {
throw ethErrors.rpc.invalidRequest({
message: messages.errors.invalidParams(),
Expand Down

0 comments on commit 07ed346

Please sign in to comment.