Skip to content

Commit

Permalink
safety check for WC requests (#780)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobar79 authored Jun 15, 2020
1 parent 4190da0 commit 8f634f6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/parsers/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ export const getRequestDisplayDetails = (payload, assets, nativeCurrency) => {
payload.method === SIGN_TRANSACTION
) {
const transaction = get(payload, 'params[0]', null);

// Backwards compatibility with param name change
if (transaction.gas && !transaction.gasLimit) {
transaction.gasLimit = transaction.gas;
}

// We must pass a number through the bridge
if (!transaction.gasLimit) {
transaction.gasLimit = 0;
}

// Dapps usually won't send this
if (!transaction.nonce) {
transaction.nonce = 0;
}

return getTransactionDisplayDetails(
transaction,
assets,
Expand Down

0 comments on commit 8f634f6

Please sign in to comment.