diff options
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | app/manifest.json | 2 | ||||
-rw-r--r-- | app/scripts/lib/createProviderMiddleware.js | 16 | ||||
-rw-r--r-- | app/scripts/metamask-controller.js | 4 | ||||
-rwxr-xr-x | development/metamaskbot-build-announce.js | 16 | ||||
-rw-r--r-- | docs/porting_to_new_environment.md | 4 |
6 files changed, 13 insertions, 35 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 98ed6ac69..69ca119ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Current Develop Branch +## 6.3.2 Mon Apr 8 2019 + +- [#6389](https://github.com/MetaMask/metamask-extension/pull/6389): Fix display of gas chart on ethereum networks +- [#6395](https://github.com/MetaMask/metamask-extension/pull/6395): Fixes for signing methods for ledger and trezor devices +- [#6397](https://github.com/MetaMask/metamask-extension/pull/6397): Fix Wyre link + ## 6.3.1 Fri Mar 26 2019 - [#6353](https://github.com/MetaMask/metamask-extension/pull/6353): Open restore vault in full screen when clicked from popup diff --git a/app/manifest.json b/app/manifest.json index 941842636..5e464dc2f 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_appName__", "short_name": "__MSG_appName__", - "version": "6.3.1", + "version": "6.3.2", "manifest_version": 2, "author": "https://metamask.io", "description": "__MSG_appDescription__", diff --git a/app/scripts/lib/createProviderMiddleware.js b/app/scripts/lib/createProviderMiddleware.js deleted file mode 100644 index 8a939ba4e..000000000 --- a/app/scripts/lib/createProviderMiddleware.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = createProviderMiddleware - -/** - * Forwards an HTTP request to the current Web3 provider - * - * @param {{ provider: Object }} config Configuration containing current Web3 provider - */ -function createProviderMiddleware ({ provider }) { - return (req, res, next, end) => { - provider.sendAsync(req, (err, _res) => { - if (err) return end(err) - res.result = _res.result - end() - }) - } -} diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 4108ed4c0..d2a55acaa 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -18,7 +18,7 @@ const createFilterMiddleware = require('eth-json-rpc-filters') const createSubscriptionManager = require('eth-json-rpc-filters/subscriptionManager') const createOriginMiddleware = require('./lib/createOriginMiddleware') const createLoggerMiddleware = require('./lib/createLoggerMiddleware') -const createProviderMiddleware = require('./lib/createProviderMiddleware') +const providerAsMiddleware = require('eth-json-rpc-middleware/providerAsMiddleware') const {setupMultiplex} = require('./lib/stream-utils.js') const KeyringController = require('eth-keyring-controller') const NetworkController = require('./controllers/network') @@ -1373,7 +1373,7 @@ module.exports = class MetamaskController extends EventEmitter { // watch asset engine.push(this.preferencesController.requestWatchAsset.bind(this.preferencesController)) // forward to metamask primary provider - engine.push(createProviderMiddleware({ provider })) + engine.push(providerAsMiddleware(provider)) // setup connection const providerStream = createEngineStream({ engine }) diff --git a/development/metamaskbot-build-announce.js b/development/metamaskbot-build-announce.js index 07adbcb5d..b254c8a90 100755 --- a/development/metamaskbot-build-announce.js +++ b/development/metamaskbot-build-announce.js @@ -27,20 +27,8 @@ async function start () { const FIREFOX = `${BUILD_LINK_BASE}/builds/metamask-firefox-${VERSION}.zip` const EDGE = `${BUILD_LINK_BASE}/builds/metamask-edge-${VERSION}.zip` const OPERA = `${BUILD_LINK_BASE}/builds/metamask-opera-${VERSION}.zip` - const WALKTHROUGH = `${BUILD_LINK_BASE}/test-artifacts/screens/walkthrough%20%28en%29.gif` - - const commentBody = ` - <details> - <summary> - Builds ready [${SHORT_SHA1}]: - <a href="${CHROME}">chrome</a>, - <a href="${FIREFOX}">firefox</a>, - <a href="${EDGE}">edge</a>, - <a href="${OPERA}">opera</a> - </summary> - <image src="${WALKTHROUGH}"> - </details> - ` + + const commentBody = `Builds ready [${SHORT_SHA1}]: <a href="${CHROME}">chrome</a>, <a href="${FIREFOX}">firefox</a>, <a href="${EDGE}">edge</a>, <a href="${OPERA}">opera</a>` const JSON_PAYLOAD = JSON.stringify({ body: commentBody }) const POST_COMMENT_URI = `https://api.github.com/repos/metamask/metamask-extension/issues/${CIRCLE_PR_NUMBER}/comments` diff --git a/docs/porting_to_new_environment.md b/docs/porting_to_new_environment.md index d901f2b78..f7a2ac8b7 100644 --- a/docs/porting_to_new_environment.md +++ b/docs/porting_to_new_environment.md @@ -10,7 +10,7 @@ The `metamask-background` describes the file at `app/scripts/background.js`, whi When a new site is visited, the WebExtension creates a new `ContentScript` in that page's context, which can be seen at `app/scripts/contentscript.js`. This script represents a per-page setup process, which creates the per-page `web3` api, connects it to the background script via the Port API (wrapped in a [stream abstraction](https://github.com/substack/stream-handbook)), and injected into the DOM before anything loads. -The most confusing part about porting MetaMask to a new platform is the way we provide the Web3 API over a series of streams between contexts. Once you understand how we create the [InpageProvider](../app/scripts/lib/inpage-provider.js) in the [inpage.js script](../app/scripts/inpage.js), you will be able to understand how the [port-stream](../app/scripts/lib/port-stream.js) is just a thin wrapper around the [postMessage API](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage), and a similar stream API can be wrapped around any communication channel to communicate with the `MetaMaskController` via its `setupUntrustedCommunication(stream, domain)` method. +The most confusing part about porting MetaMask to a new platform is the way we provide the Web3 API over a series of streams between contexts. Once you understand how we create the [MetamaskInpageProvider](https://github.com/MetaMask/metamask-inpage-provider/blob/master/index.js) in the [inpage.js script](../app/scripts/inpage.js), you will be able to understand how the [port-stream](../app/scripts/lib/port-stream.js) is just a thin wrapper around the [postMessage API](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage), and a similar stream API can be wrapped around any communication channel to communicate with the `MetaMaskController` via its `setupUntrustedCommunication(stream, domain)` method. ### The MetaMask Controller @@ -89,7 +89,7 @@ MetaMask has two kinds of [duplex stream APIs](https://github.com/substack/strea If you are making a MetaMask-powered browser for a new platform, one of the trickiest tasks will be injecting the Web3 API into websites that are visited. On WebExtensions, we actually have to pipe data through a total of three JS contexts just to let sites talk to our background process (site -> contentscript -> background). -To see how we do that, you can refer to the [inpage script](https://github.com/MetaMask/metamask-extension/blob/master/app/scripts/inpage.js) that we inject into every website. There you can see it creates a multiplex stream to the background, and uses it to initialize what we call the [inpage-provider](https://github.com/MetaMask/metamask-extension/blob/master/app/scripts/lib/inpage-provider.js), which you can see stubs a few methods out, but mostly just passes calls to `sendAsync` through the stream it's passed! That's really all the magic that's needed to create a web3-like API in a remote context, once you have a stream to MetaMask available. +To see how we do that, you can refer to the [inpage script](https://github.com/MetaMask/metamask-extension/blob/master/app/scripts/inpage.js) that we inject into every website. There you can see it creates a multiplex stream to the background, and uses it to initialize what we call the [MetamaskInpageProvider](https://github.com/MetaMask/metamask-inpage-provider/blob/master/index.js), which you can see stubs a few methods out, but mostly just passes calls to `sendAsync` through the stream it's passed! That's really all the magic that's needed to create a web3-like API in a remote context, once you have a stream to MetaMask available. In `inpage.js` you can see we create a `PortStream`, that's just a class we use to wrap WebExtension ports as streams, so we can reuse our favorite stream abstraction over the more irregular API surface of the WebExtension. In a new platform, you will probably need to construct this stream differently. The key is that you need to construct a stream that talks from the site context to the background. Once you have that set up, it works like magic! |