commit
cafabf914f
@ -1,16 +0,0 @@ |
||||
var assert = require('assert') |
||||
var linkGen = require('../../ui/lib/account-link') |
||||
|
||||
describe('account-link', function () { |
||||
it('adds ropsten prefix to ropsten test network', function () { |
||||
var result = linkGen('account', '3') |
||||
assert.notEqual(result.indexOf('ropsten'), -1, 'ropsten included') |
||||
assert.notEqual(result.indexOf('account'), -1, 'account included') |
||||
}) |
||||
|
||||
it('adds kovan prefix to kovan test network', function () { |
||||
var result = linkGen('account', '42') |
||||
assert.notEqual(result.indexOf('kovan'), -1, 'kovan included') |
||||
assert.notEqual(result.indexOf('account'), -1, 'account included') |
||||
}) |
||||
}) |
@ -1,14 +0,0 @@ |
||||
var assert = require('assert') |
||||
var linkGen = require('../../ui/lib/explorer-link') |
||||
|
||||
describe('explorer-link', function () { |
||||
it('adds ropsten prefix to ropsten test network', function () { |
||||
var result = linkGen('hash', '3') |
||||
assert.notEqual(result.indexOf('ropsten'), -1, 'ropsten injected') |
||||
}) |
||||
|
||||
it('adds kovan prefix to kovan test network', function () { |
||||
var result = linkGen('hash', '42') |
||||
assert.notEqual(result.indexOf('kovan'), -1, 'kovan injected') |
||||
}) |
||||
}) |
@ -1,26 +0,0 @@ |
||||
module.exports = function (address, network) { |
||||
const net = parseInt(network) |
||||
let link |
||||
switch (net) { |
||||
case 1: // main net
|
||||
link = `https://etherscan.io/address/${address}` |
||||
break |
||||
case 2: // morden test net
|
||||
link = `https://morden.etherscan.io/address/${address}` |
||||
break |
||||
case 3: // ropsten test net
|
||||
link = `https://ropsten.etherscan.io/address/${address}` |
||||
break |
||||
case 4: // rinkeby test net
|
||||
link = `https://rinkeby.etherscan.io/address/${address}` |
||||
break |
||||
case 42: // kovan test net
|
||||
link = `https://kovan.etherscan.io/address/${address}` |
||||
break |
||||
default: |
||||
link = '' |
||||
break |
||||
} |
||||
|
||||
return link |
||||
} |
@ -1,6 +0,0 @@ |
||||
const prefixForNetwork = require('./etherscan-prefix-for-network') |
||||
|
||||
module.exports = function (hash, network) { |
||||
const prefix = prefixForNetwork(network) |
||||
return `http://${prefix}etherscan.io/tx/${hash}` |
||||
} |
Loading…
Reference in new issue