Empty local middleware, until explicitly requested (#5912)

* Empty local middleware, until explicitly requested

* Remove previous empty overrides (unneeded now)

* Re-add over-zealous keyethereum removal
This commit is contained in:
Jaco Greeff 2017-06-23 13:40:16 +02:00 committed by GitHub
parent 614a80bd23
commit 0f41121556
5 changed files with 8 additions and 17 deletions

View File

@ -23,7 +23,8 @@ import { Db, Eth, Parity, Net, Personal, Shh, Signer, Trace, Web3 } from './rpc'
import Subscriptions from './subscriptions'; import Subscriptions from './subscriptions';
import util from './util'; import util from './util';
import { isFunction } from './util/types'; import { isFunction } from './util/types';
import { LocalAccountsMiddleware } from './local';
import LocalAccountsMiddleware from '~/api/local';
export default class Api extends EventEmitter { export default class Api extends EventEmitter {
constructor (transport, allowSubscriptions = true) { constructor (transport, allowSubscriptions = true) {
@ -50,7 +51,7 @@ export default class Api extends EventEmitter {
} }
// Doing a request here in test env would cause an error // Doing a request here in test env would cause an error
if (process.env.NODE_ENV !== 'test') { if (LocalAccountsMiddleware && process.env.NODE_ENV !== 'test') {
const middleware = this.parity const middleware = this.parity
.nodeKind() .nodeKind()
.then((nodeKind) => { .then((nodeKind) => {

View File

@ -14,8 +14,4 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>. // along with Parity. If not, see <http://www.gnu.org/licenses/>.
if (process.env.NODE_ENV !== 'test') { export default null;
process.browser = true;
}
export LocalAccountsMiddleware from './localAccountsMiddleware';

View File

@ -138,9 +138,9 @@ module.exports = {
resolve: { resolve: {
alias: { alias: {
'~/api/local': path.resolve(__dirname, '../src/api/local/localAccountsMiddleware.js'),
'~': path.resolve(__dirname, '../src'), '~': path.resolve(__dirname, '../src'),
'keythereum': path.resolve(__dirname, '../node_modules/keythereum/dist/keythereum'), 'keythereum': path.resolve(__dirname, '../node_modules/keythereum/dist/keythereum')
'vertx': 'empty-module'
}, },
modules: [ modules: [
path.join(__dirname, '../node_modules') path.join(__dirname, '../node_modules')

View File

@ -41,10 +41,7 @@ module.exports = {
resolve: { resolve: {
alias: { alias: {
'~': path.resolve(__dirname, '../src'), '~': path.resolve(__dirname, '../src')
'keythereum': 'empty-module',
'secp256k1': 'empty-module',
'vertx': 'empty-module'
} }
}, },

View File

@ -75,10 +75,7 @@ module.exports = {
}, },
resolve: { resolve: {
alias: { alias: {
'~': path.resolve(__dirname, '../src'), '~': path.resolve(__dirname, '../src')
'keythereum': 'empty-module',
'secp256k1': 'empty-module',
'vertx': 'empty-module'
}, },
modules: [ modules: [
path.resolve('./src'), path.resolve('./src'),