diff --git a/packages/embark-accounts-manager/src/index.ts b/packages/embark-accounts-manager/src/index.ts index d047a4944..dc87cf6a3 100644 --- a/packages/embark-accounts-manager/src/index.ts +++ b/packages/embark-accounts-manager/src/index.ts @@ -31,10 +31,6 @@ export default class AccountsManager { this.parseAndFundAccounts(); - this.events.setCommandHandler("accounts:get", (cb: any) => { - cb(null, this.accounts); - }); - this.embark.registerActionForEvent("blockchain:proxy:request", this.checkBlockchainRequest.bind(this)); this.embark.registerActionForEvent("blockchain:proxy:response", this.checkBlockchainResponse.bind(this)); diff --git a/packages/embark-proxy/src/index.ts b/packages/embark-proxy/src/index.ts index 1e2206f9f..68a6284ae 100644 --- a/packages/embark-proxy/src/index.ts +++ b/packages/embark-proxy/src/index.ts @@ -37,7 +37,7 @@ export default class ProxyManager { this.logger.warn(__("Configured wallet accounts will be ignored and cannot be used in the DApp, and transactions will not be logged.")); } - this.events.setCommandHandler("proxy:endpoint", async (cb) => { + this.events.setCommandHandler("proxy:endpoint:get", async (cb) => { await this.onReady(); if (!this.embark.config.blockchainConfig.proxy) { return cb(null, this.embark.config.blockchainConfig.endpoint); @@ -81,14 +81,4 @@ export default class ProxyManager { ); return; } - - public shutdownProxy() { - if (!this.embark.config.blockchainConfig.proxy) { - return; - } - - if (this.proxy) { - this.proxy.close(); - } - } } diff --git a/packages/embark-proxy/src/proxy.js b/packages/embark-proxy/src/proxy.js index 116c25000..d08136af6 100644 --- a/packages/embark-proxy/src/proxy.js +++ b/packages/embark-proxy/src/proxy.js @@ -14,8 +14,6 @@ export class Proxy { this.receipts = {}; this.transactions = {}; this.timeouts = {}; - // TODO create local events instance for the ready events that are just used locally once `events.js` is extracted in a package - this.events = options.events; this.plugins = options.plugins; this.logger = options.logger; } diff --git a/packages/embark-web3/src/index.js b/packages/embark-web3/src/index.js index bd91274d7..36a9dd0e8 100644 --- a/packages/embark-web3/src/index.js +++ b/packages/embark-web3/src/index.js @@ -67,7 +67,7 @@ class EmbarkWeb3 { async.map(this.config.contractsConfig.dappConnection, (conn, mapCb) => { if (conn === '$EMBARK') { // Connect to Embark's endpoint (proxy) - return this.events.request("proxy:endpoint", mapCb); + return this.events.request("proxy:endpoint:get", mapCb); } mapCb(null, conn); }, (err, results) => { diff --git a/packages/embark/src/lib/modules/blockchain-client/index.js b/packages/embark/src/lib/modules/blockchain-client/index.js index 1ebe92d0d..a56f5584c 100644 --- a/packages/embark/src/lib/modules/blockchain-client/index.js +++ b/packages/embark/src/lib/modules/blockchain-client/index.js @@ -15,7 +15,7 @@ class BlockchainClient { // TODO: unclear currently if this belongs here so it's a bit hardcoded for now this.events.setCommandHandler("blockchain:client:provider", (clientName, cb) => { - this.events.request("proxy:endpoint", (err, endpoint) => { + this.events.request("proxy:endpoint:get", (err, endpoint) => { if (err) { return cb(err); } diff --git a/packages/embark/src/lib/modules/blockchain/index.js b/packages/embark/src/lib/modules/blockchain/index.js index 06c16fc17..de5c74db2 100644 --- a/packages/embark/src/lib/modules/blockchain/index.js +++ b/packages/embark/src/lib/modules/blockchain/index.js @@ -39,7 +39,7 @@ class Blockchain { async.map(contractsConfig.dappConnection, (conn, mapCb) => { if (conn === '$EMBARK') { // Connect to Embark's endpoint (proxy) - return this.events.request("proxy:endpoint", mapCb); + return this.events.request("proxy:endpoint:get", mapCb); } mapCb(null, conn); }, (err, results) => {