From 7d9c453c178d5cfd6a6ad284665b5b72648816f7 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 27 Dec 2019 16:08:15 -0500 Subject: [PATCH] move txDetailsLink into remix-ide --- src/app/udapp/make-udapp.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/app/udapp/make-udapp.js b/src/app/udapp/make-udapp.js index 5b1ce24167..17fda93b9c 100644 --- a/src/app/udapp/make-udapp.js +++ b/src/app/udapp/make-udapp.js @@ -4,11 +4,25 @@ var yo = require('yo-yo') var EventsDecoder = remixLib.execution.EventsDecoder var TransactionReceiptResolver = require('../../lib/transactionReceiptResolver') +const transactionDetailsLinks = { + 'Main': 'https://www.etherscan.io/tx/', + 'Rinkeby': 'https://rinkeby.etherscan.io/tx/', + 'Ropsten': 'https://ropsten.etherscan.io/tx/', + 'Kovan': 'https://kovan.etherscan.io/tx/', + 'Goerli': 'https://goerli.etherscan.io/tx/' +} + +function txDetailsLink (network, hash) { + if (transactionDetailsLinks[network]) { + return transactionDetailsLinks[network] + hash + } +} + export function makeUdapp (blockchain, udapp, executionContext, compilersArtefacts, logHtmlCallback) { // ----------------- UniversalDApp ----------------- // TODO: to remove when possible udapp.event.register('transactionBroadcasted', (txhash, networkName) => { - var txLink = executionContext.txDetailsLink(networkName, txhash) + var txLink = txDetailsLink(networkName, txhash) if (txLink && logHtmlCallback) logHtmlCallback(yo`${txLink}`) })