From 3f8b871637caaba50d0cae8dd16cc757c6e4ae32 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 29 Mar 2018 12:20:05 +0200 Subject: [PATCH] remove newAccount from API (use udapp directly) --- src/app.js | 6 ++---- src/app/tabs/run-tab.js | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/app.js b/src/app.js index 3524973435..637856f987 100644 --- a/src/app.js +++ b/src/app.js @@ -778,9 +778,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org }, getCompilationResult: () => { return compiler.lastCompilationResult - }, - newAccount: (pass, cb) => { - udapp.newAccount(pass, cb) } } var rhpEvents = { @@ -791,7 +788,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org staticAnalysis: staticanalysis.event } var rhpOpts = { - pluginAPI: new PluginAPI(self, compiler) + pluginAPI: new PluginAPI(self, compiler), + udapp: udapp } self._components.righthandpanel = new RighthandPanel(rhpAPI, rhpEvents, rhpOpts) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index edb13d8e6f..cae541f6d1 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -45,7 +45,7 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) { var el = yo`
- ${settings(container, appAPI, appEvents)} + ${settings(container, appAPI, appEvents, opts)} ${contractDropdown(event, appAPI, appEvents, instanceContainer)} ${pendingTxsContainer} ${instanceContainer} @@ -359,7 +359,7 @@ function contractDropdown (events, appAPI, appEvents, instanceContainer) { /* ------------------------------------------------ section SETTINGS: Environment, Account, Gas, Value ------------------------------------------------ */ -function settings (container, appAPI, appEvents) { +function settings (container, appAPI, appEvents, opts) { // SETTINGS HTML var net = yo`` const updateNetwork = () => { @@ -374,7 +374,7 @@ function settings (container, appAPI, appEvents) { } setInterval(updateNetwork, 5000) function newAccount () { - appAPI.newAccount('', (error, address) => { + opts.udapp.newAccount('', (error, address) => { if (!error) { container.querySelector('#txorigin').appendChild(yo``) addTooltip(`account ${address} created`)