mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
commit
5fa0b992a7
@ -5,6 +5,10 @@
|
|||||||
- Add info on token contract addresses.
|
- Add info on token contract addresses.
|
||||||
- Add validation preventing users from inputting their own addresses as token tracking addresses.
|
- Add validation preventing users from inputting their own addresses as token tracking addresses.
|
||||||
|
|
||||||
|
## 3.9.13 2017-9-8
|
||||||
|
|
||||||
|
- Changed the way we initialize the inpage provider to fix a bug affecting some developers.
|
||||||
|
|
||||||
## 3.9.12 2017-9-6
|
## 3.9.12 2017-9-6
|
||||||
|
|
||||||
- Fix bug that prevented Web3 1.0 compatibility
|
- Fix bug that prevented Web3 1.0 compatibility
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "MetaMask",
|
"name": "MetaMask",
|
||||||
"short_name": "Metamask",
|
"short_name": "Metamask",
|
||||||
"version": "3.9.12",
|
"version": "3.9.13",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"author": "https://metamask.io",
|
"author": "https://metamask.io",
|
||||||
"description": "Ethereum Browser Extension",
|
"description": "Ethereum Browser Extension",
|
||||||
|
@ -40,31 +40,37 @@ function MetamaskInpageProvider (connectionStream) {
|
|||||||
// start and stop polling to unblock first block lock
|
// start and stop polling to unblock first block lock
|
||||||
|
|
||||||
self.idMap = {}
|
self.idMap = {}
|
||||||
// handle sendAsync requests via asyncProvider
|
}
|
||||||
self.sendAsync = function (payload, cb) {
|
|
||||||
// rewrite request ids
|
// handle sendAsync requests via asyncProvider
|
||||||
var request = eachJsonMessage(payload, (_message) => {
|
// also remap ids inbound and outbound
|
||||||
const message = Object.assign({}, _message)
|
MetamaskInpageProvider.prototype.sendAsync = function (payload, cb) {
|
||||||
const newId = createRandomId()
|
const self = this
|
||||||
self.idMap[newId] = message.id
|
|
||||||
message.id = newId
|
// rewrite request ids
|
||||||
|
const request = eachJsonMessage(payload, (_message) => {
|
||||||
|
const message = Object.assign({}, _message)
|
||||||
|
const newId = createRandomId()
|
||||||
|
self.idMap[newId] = message.id
|
||||||
|
message.id = newId
|
||||||
|
return message
|
||||||
|
})
|
||||||
|
|
||||||
|
// forward to asyncProvider
|
||||||
|
self.asyncProvider.sendAsync(request, (err, _res) => {
|
||||||
|
if (err) return cb(err)
|
||||||
|
// transform messages to original ids
|
||||||
|
const res = eachJsonMessage(_res, (message) => {
|
||||||
|
const oldId = self.idMap[message.id]
|
||||||
|
delete self.idMap[message.id]
|
||||||
|
message.id = oldId
|
||||||
return message
|
return message
|
||||||
})
|
})
|
||||||
// forward to asyncProvider
|
cb(null, res)
|
||||||
asyncProvider.sendAsync(request, function (err, res) {
|
})
|
||||||
if (err) return cb(err)
|
|
||||||
// transform messages to original ids
|
|
||||||
eachJsonMessage(res, (message) => {
|
|
||||||
var oldId = self.idMap[message.id]
|
|
||||||
delete self.idMap[message.id]
|
|
||||||
message.id = oldId
|
|
||||||
return message
|
|
||||||
})
|
|
||||||
cb(null, res)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MetamaskInpageProvider.prototype.send = function (payload) {
|
MetamaskInpageProvider.prototype.send = function (payload) {
|
||||||
const self = this
|
const self = this
|
||||||
|
|
||||||
@ -110,10 +116,6 @@ MetamaskInpageProvider.prototype.send = function (payload) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MetamaskInpageProvider.prototype.sendAsync = function () {
|
|
||||||
throw new Error('MetamaskInpageProvider - sendAsync not overwritten')
|
|
||||||
}
|
|
||||||
|
|
||||||
MetamaskInpageProvider.prototype.isConnected = function () {
|
MetamaskInpageProvider.prototype.isConnected = function () {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user