aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <flyswatter@users.noreply.github.com>2017-01-11 07:38:07 +0800
committerGitHub <noreply@github.com>2017-01-11 07:38:07 +0800
commitff6e633e94a8bf4642e4e8992f9901dd6014cab1 (patch)
treef9e49394299c1fd434273ad790c87b61c07c24a3
parent2efcbd9674be56984de596cd0272fb380a30609e (diff)
parent0197d54bfcab15edf0eb0fc0a290dab7b6181a2a (diff)
downloadtangerine-wallet-browser-ff6e633e94a8bf4642e4e8992f9901dd6014cab1.tar
tangerine-wallet-browser-ff6e633e94a8bf4642e4e8992f9901dd6014cab1.tar.gz
tangerine-wallet-browser-ff6e633e94a8bf4642e4e8992f9901dd6014cab1.tar.bz2
tangerine-wallet-browser-ff6e633e94a8bf4642e4e8992f9901dd6014cab1.tar.lz
tangerine-wallet-browser-ff6e633e94a8bf4642e4e8992f9901dd6014cab1.tar.xz
tangerine-wallet-browser-ff6e633e94a8bf4642e4e8992f9901dd6014cab1.tar.zst
tangerine-wallet-browser-ff6e633e94a8bf4642e4e8992f9901dd6014cab1.zip
Merge branch 'dev' into gulp1
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/scripts/lib/config-manager.js7
-rw-r--r--app/scripts/lib/tx-utils.js17
-rw-r--r--package.json2
-rw-r--r--test/unit/config-manager-test.js4
5 files changed, 10 insertions, 21 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 420296bbd..9cd13e102 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
- Remove certain non-essential permissions from certain builds.
- Add a check for when a tx is included in a block.
+- Fix bug where browser-solidity would sometimes warn of a contract creation error when there was none.
- Minor modifications to network display.
- Network now displays properly for pending transactions.
- Implement replay attack protections allowed by EIP 155.
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js
index 93501c859..3a1f12ac0 100644
--- a/app/scripts/lib/config-manager.js
+++ b/app/scripts/lib/config-manager.js
@@ -1,7 +1,6 @@
const Migrator = require('pojo-migrator')
const MetamaskConfig = require('../config.js')
const migrations = require('./migrations')
-const rp = require('request-promise')
const ethUtil = require('ethereumjs-util')
const normalize = require('./sig-util').normalize
@@ -301,9 +300,9 @@ ConfigManager.prototype.getCurrentFiat = function () {
ConfigManager.prototype.updateConversionRate = function () {
var data = this.getData()
- return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`)
- .then((response) => {
- const parsedResponse = JSON.parse(response)
+ return fetch(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`)
+ .then(response => response.json())
+ .then((parsedResponse) => {
this.setConversionPrice(parsedResponse.ticker.price)
this.setConversionDate(parsedResponse.timestamp)
}).catch((err) => {
diff --git a/app/scripts/lib/tx-utils.js b/app/scripts/lib/tx-utils.js
index a976173f5..d1fb98f42 100644
--- a/app/scripts/lib/tx-utils.js
+++ b/app/scripts/lib/tx-utils.js
@@ -20,7 +20,6 @@ module.exports = class txProviderUtils {
if (err) return cb(err)
async.waterfall([
self.estimateTxGas.bind(self, txData, block.gasLimit),
- self.checkForTxGasError.bind(self, txData),
self.setTxGas.bind(self, txData, block.gasLimit),
], cb)
})
@@ -38,22 +37,10 @@ module.exports = class txProviderUtils {
this.query.estimateGas(txParams, cb)
}
- checkForTxGasError (txData, estimatedGasHex, cb) {
+ setTxGas (txData, blockGasLimitHex, estimatedGasHex, cb) {
txData.estimatedGas = estimatedGasHex
- // all gas used - must be an error
- if (estimatedGasHex === txData.txParams.gas) {
- txData.simulationFails = true
- }
- cb()
- }
-
- setTxGas (txData, blockGasLimitHex, cb) {
const txParams = txData.txParams
- // if OOG, nothing more to do
- if (txData.simulationFails) {
- cb()
- return
- }
+
// if gasLimit was specified and doesnt OOG,
// use original specified amount
if (txData.gasLimitSpecified) {
diff --git a/package.json b/package.json
index 17c3e3dcc..58c33c170 100644
--- a/package.json
+++ b/package.json
@@ -88,7 +88,6 @@
"redux": "^3.0.5",
"redux-logger": "^2.3.1",
"redux-thunk": "^1.0.2",
- "request-promise": "^4.1.1",
"sandwich-expando": "^1.0.5",
"textarea-caret": "^3.0.1",
"three.js": "^0.73.2",
@@ -120,6 +119,7 @@
"gulp-util": "^3.0.7",
"gulp-watch": "^4.3.5",
"gulp-zip": "^3.2.0",
+ "isomorphic-fetch": "^2.2.1",
"jsdom": "^8.1.0",
"jsdom-global": "^1.7.0",
"jshint-stylish": "~0.1.5",
diff --git a/test/unit/config-manager-test.js b/test/unit/config-manager-test.js
index 075abbe65..77d431d5f 100644
--- a/test/unit/config-manager-test.js
+++ b/test/unit/config-manager-test.js
@@ -1,8 +1,10 @@
+// polyfill fetch
+global.fetch = global.fetch || require('isomorphic-fetch')
const assert = require('assert')
const extend = require('xtend')
const rp = require('request-promise')
const nock = require('nock')
-var configManagerGen = require('../lib/mock-config-manager')
+const configManagerGen = require('../lib/mock-config-manager')
const STORAGE_KEY = 'metamask-persistance-key'
describe('config-manager', function() {