aboutsummaryrefslogtreecommitdiffstats
path: root/ui/lib/explorer-link.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/lib/explorer-link.js')
-rw-r--r--ui/lib/explorer-link.js21
1 files changed, 3 insertions, 18 deletions
diff --git a/ui/lib/explorer-link.js b/ui/lib/explorer-link.js
index e11249551..3b82ecd5f 100644
--- a/ui/lib/explorer-link.js
+++ b/ui/lib/explorer-link.js
@@ -1,21 +1,6 @@
+const prefixForNetwork = require('./etherscan-prefix-for-network')
+
module.exports = function (hash, network) {
- const net = parseInt(network)
- let prefix
- switch (net) {
- case 1: // main net
- prefix = ''
- break
- case 3: // ropsten test net
- prefix = 'ropsten.'
- break
- case 4: // rinkeby test net
- prefix = 'rinkeby.'
- break
- case 42: // kovan test net
- prefix = 'kovan.'
- break
- default:
- prefix = ''
- }
+ const prefix = prefixForNetwork(network)
return `http://${prefix}etherscan.io/tx/${hash}`
}