diff --git a/CHANGELOG.md b/CHANGELOG.md index a24fc8b57..8c601f172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Current Master + - Add two most recently used custom RPCs to network dropdown menu. - Add personal_sign method support. - Add ability to customize gas and gasPrice on the transaction approval screen. diff --git a/app/scripts/lib/controllers/currency.js b/app/scripts/controllers/currency.js similarity index 100% rename from app/scripts/lib/controllers/currency.js rename to app/scripts/controllers/currency.js diff --git a/app/scripts/lib/controllers/preferences.js b/app/scripts/controllers/preferences.js similarity index 95% rename from app/scripts/lib/controllers/preferences.js rename to app/scripts/controllers/preferences.js index 7bd2e5631..8fd5fb8a0 100644 --- a/app/scripts/lib/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -1,5 +1,5 @@ const ObservableStore = require('obs-store') -const normalizeAddress = require('../sig-util').normalize +const normalizeAddress = require('eth-sig-util').normalize const extend = require('xtend') class PreferencesController { diff --git a/app/scripts/lib/controllers/shapeshift.js b/app/scripts/controllers/shapeshift.js similarity index 100% rename from app/scripts/lib/controllers/shapeshift.js rename to app/scripts/controllers/shapeshift.js diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index cbef8924a..ab55ed697 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -11,10 +11,10 @@ const streamIntoProvider = require('web3-stream-provider/handler') const MetaMaskProvider = require('web3-provider-engine/zero.js') const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex const KeyringController = require('./keyring-controller') -const PreferencesController = require('./lib/controllers/preferences') -const CurrencyController = require('./lib/controllers/currency') +const PreferencesController = require('./controllers/preferences') +const CurrencyController = require('./controllers/currency') const NoticeController = require('./notice-controller') -const ShapeShiftController = require('./lib/controllers/shapeshift') +const ShapeShiftController = require('./controllers/shapeshift') const MessageManager = require('./lib/message-manager') const PersonalMessageManager = require('./lib/personal-message-manager') const TxManager = require('./transaction-manager') diff --git a/test/unit/currency-controller-test.js b/test/unit/currency-controller-test.js index c57b522c7..dd7fa91e0 100644 --- a/test/unit/currency-controller-test.js +++ b/test/unit/currency-controller-test.js @@ -5,7 +5,7 @@ const assert = require('assert') const extend = require('xtend') const rp = require('request-promise') const nock = require('nock') -const CurrencyController = require('../../app/scripts/lib/controllers/currency') +const CurrencyController = require('../../app/scripts/controllers/currency') describe('config-manager', function() { var currencyController diff --git a/ui/app/actions.js b/ui/app/actions.js index 337f05248..cda987cad 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -671,7 +671,7 @@ function markAccountsFound() { function setRpcTarget (newRpc) { return (dispatch) => { - if (global.METAMASK_DEBUG) console.log(`background.setRpcTarget`) + log.debug(`background.setRpcTarget`) background.setRpcTarget(newRpc) background.updateFrequentRpcList(newRpc, (frequentRpcList) => { const value = { diff --git a/ui/app/app.js b/ui/app/app.js index d8519def7..20f948770 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -501,6 +501,12 @@ App.prototype.renderCustomOption = function (provider) { const { rpcTarget, type } = provider if (type !== 'rpc') return null + // Concatenate long URLs + let label = rpcTarget + if (rpcTarget.length > 31) { + label = label.substr(0, 34) + '...' + } + switch (rpcTarget) { case 'http://localhost:8545': @@ -508,7 +514,8 @@ App.prototype.renderCustomOption = function (provider) { default: return h(DropMenuItem, { - label: `${rpcTarget}`, + label, + key: rpcTarget, closeMenu: () => this.setState({ isNetworkMenuOpen: false }), icon: h('i.fa.fa-question-circle.fa-lg'), activeNetworkRender: 'custom', @@ -526,6 +533,7 @@ App.prototype.renderCommonRpc = function (rpcList, provider) { } else { return h(DropMenuItem, { label: rpc, + key: rpc, closeMenu: () => this.setState({ isNetworkMenuOpen: false }), action: () => props.dispatch(actions.setRpcTarget(rpc)), icon: h('i.fa.fa-question-circle.fa-lg'),