From 894cc7e4025dd54436edf9d46f5a2bb3dcac3b6b Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 28 Mar 2018 12:41:09 +0200 Subject: [PATCH 1/2] log transactio broadcasted --- src/app.js | 3 +++ src/app/panels/terminal.js | 6 ++++++ src/universal-dapp.js | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/src/app.js b/src/app.js index 38ff9c8ad2..412ad57b08 100644 --- a/src/app.js +++ b/src/app.js @@ -302,6 +302,9 @@ Please make a backup of your contracts and start using http://remix.ethereum.org logMessage: (msg) => { self._components.editorpanel.log({ type: 'log', value: msg }) }, + logHtmlMessage: (msg) => { + self._components.editorpanel.log({ type: 'html', value: msg }) + }, config: self._api.config, detectNetwork: (cb) => { executionContext.detectNetwork(cb) diff --git a/src/app/panels/terminal.js b/src/app/panels/terminal.js index 3bf82ffbec..70716208e8 100644 --- a/src/app/panels/terminal.js +++ b/src/app/panels/terminal.js @@ -66,6 +66,7 @@ class Terminal { self._INDEX.allMain = [] self._INDEX.commands = {} self._INDEX.commandsMain = {} + self.registerCommand('html', self._blocksRenderer('html'), { activate: true }) self.registerCommand('log', self._blocksRenderer('log'), { activate: true }) self.registerCommand('info', self._blocksRenderer('info'), { activate: true }) self.registerCommand('error', self._blocksRenderer('error'), { activate: true }) @@ -448,6 +449,11 @@ class Terminal { }, 0) } _blocksRenderer (mode) { + if (mode === 'html') { + return function logger (args, scopedCommands, append) { + if (args.length) append(args[0]) + } + } mode = { log: styles.terminal.text_RegularLog, info: styles.terminal.text_InfoLog, error: styles.terminal.text_ErrorLog }[mode] // defaults if (mode) { return function logger (args, scopedCommands, append) { diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 43d3f54504..1189745d97 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -51,6 +51,14 @@ UniversalDApp.prototype.reset = function (contracts, transactionContextAPI) { executionContext.vm().stateManager.cache.flush(function () {}) } this.txRunner = new TxRunner(this.accounts, this._api) + this.txRunner.event.register('transactionBroadcasted', (txhash) => { + this._api.detectNetwork((error, network) => { + if (!error && network) { + var txLink = executionContext.txDetailsLink(network.name, txhash) + if (txLink) this._api.logHtmlMessage(yo`${txLink}`) + } + }) + }) } UniversalDApp.prototype.newAccount = function (password, cb) { From 62a0f71142c3937878d4738a0d3289ce4e1c3e0b Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 28 Mar 2018 13:11:16 +0200 Subject: [PATCH 2/2] clear circle cache --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2f87db9f05..3e21810013 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,10 +26,10 @@ jobs: - checkout - restore_cache: keys: - - dep-bundle-4-{{ checksum "package.json" }} + - dep-bundle-5-{{ checksum "package.json" }} - run: npm install - save_cache: - key: dep-bundle-4-{{ checksum "package.json" }} + key: dep-bundle-5-{{ checksum "package.json" }} paths: - ~/repo/node_modules - run: npm run lint && npm run test && npm run downloadsolc && npm run make-mock-compiler && npm run build @@ -46,10 +46,10 @@ jobs: - checkout - restore_cache: keys: - - dep-bundle-4-{{ checksum "package.json" }} + - dep-bundle-5-{{ checksum "package.json" }} - run: npm install - save_cache: - key: dep-bundle-4-{{ checksum "package.json" }} + key: dep-bundle-5-{{ checksum "package.json" }} paths: - ~/repo/node_modules - run: npm run build_debugger