From 3b9d74364d0c64c1fa7b5c197a89627ee800d878 Mon Sep 17 00:00:00 2001 From: David Disu Date: Tue, 1 Mar 2022 08:29:47 +0100 Subject: [PATCH] Log etherscan link only if link is available --- apps/remix-ide/src/blockchain/blockchain.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index 8b0ebfba87..3382d3a649 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -355,10 +355,14 @@ export class Blockchain extends Plugin { this.executionContext.detectNetwork((error, network) => { if (error || !network) return if (network.name === 'VM') return - this.call('terminal', 'logHtml', + const viewEtherScanLink = etherScanLink(network.name, txhash) + + if (viewEtherScanLink) { + this.call('terminal', 'logHtml', ( view on etherscan )) + } }) }) this.txRunner = new TxRunner(web3Runner, { runAsync: true })