Merge pull request #2737 from ethereum/metamask

fix metamask loading and notification
pull/2741/head^2
yann300 2 years ago committed by GitHub
commit 3ae3b077eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/remix-ide/src/blockchain/execution-context.js
  2. 3
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx
  3. 2
      package.json
  4. 677
      yarn.lock

@ -156,7 +156,7 @@ export class ExecutionContext {
return cb() return cb()
} else { } else {
if (injectedProvider && injectedProvider._metamask && injectedProvider._metamask.isUnlocked) { if (injectedProvider && injectedProvider._metamask && injectedProvider._metamask.isUnlocked) {
if (!await injectedProvider._metamask.isUnlocked()) this.call('notification', 'toast', 'Please make sure the injected provider is unlocked (e.g Metamask).') if (!await injectedProvider._metamask.isUnlocked()) infoCb('Please make sure the injected provider is unlocked (e.g Metamask).')
} }
this.askPermission() this.askPermission()
this.executionContext = context this.executionContext = context

@ -1,6 +1,7 @@
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import DropdownPanel from './dropdown-panel' // eslint-disable-line import DropdownPanel from './dropdown-panel' // eslint-disable-line
import { BN } from 'ethereumjs-util' import { BN } from 'ethereumjs-util'
import Web3 from 'web3'
export const GlobalVariables = ({ block, receipt, tx }) => { export const GlobalVariables = ({ block, receipt, tx }) => {
// see https://docs.soliditylang.org/en/latest/units-and-global-variables.html#block-and-transaction-properties // see https://docs.soliditylang.org/en/latest/units-and-global-variables.html#block-and-transaction-properties
@ -17,7 +18,7 @@ export const GlobalVariables = ({ block, receipt, tx }) => {
'tx.origin': tx.from 'tx.origin': tx.from
} }
if (block.baseFeePerGas) { if (block.baseFeePerGas) {
globals['block.basefee'] = (new BN(block.baseFeePerGas.replace('0x', ''), 'hex')).toString(10) + ` Wei (${block.baseFeePerGas})` globals['block.basefee'] = Web3.utils.toBN(block.baseFeePerGas).toString(10) + ` Wei (${block.baseFeePerGas})`
} }
return ( return (

@ -211,7 +211,7 @@
"time-stamp": "^2.2.0", "time-stamp": "^2.2.0",
"ts-loader": "^9.2.6", "ts-loader": "^9.2.6",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"web3": "^1.5.1", "web3": "^1.7.5",
"winston": "^3.3.3", "winston": "^3.3.3",
"ws": "^7.3.0" "ws": "^7.3.0"
}, },

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save