message: Refactor: resilient metamask `getInpageProvider` helper
diff: @@ -120,15 +120,18 @@ export const methodCaller = async (
  *
  * @return {Object} The `MetamaskInpageProvider` object instance
  */
  -export const getInpageProvider = (): MetamaskInpageProviderType =>
  +export const getInpageProvider = (): MetamaskInpageProviderType => {
  /*
  * We need this little go-around trick to mock just one export of
  * the module, while leaving the rest of the module intact so we can test it
  *
  * See: https://github.com/facebook/jest/issues/936
  */
  - /* eslint-disable-next-line no-use-before-define */
  - global.web3.currentProvider;
  + if (global.ethereum) {
  + return global.ethereum;
  + }
  + return global.web3.currentProvider;
  +};
  /**
  * Add a new observer method to Metamask's state update events
  