Merge pull request #284 from poanetwork/blockscout
(Feature) Blockscout links
This commit is contained in:
commit
9f1849a725
|
@ -1,12 +1,6 @@
|
||||||
const extension = require('extensionizer')
|
const extension = require('extensionizer')
|
||||||
const explorerLinks = require('eth-net-props').explorerLinks
|
const explorerLinks = require('eth-net-props').explorerLinks
|
||||||
const { capitalizeFirstLetter } = require('../lib/util')
|
const { capitalizeFirstLetter } = require('../lib/util')
|
||||||
const {
|
|
||||||
POA_CODE,
|
|
||||||
DAI_CODE,
|
|
||||||
POA_SOKOL_CODE,
|
|
||||||
GOERLI_TESTNET_CODE,
|
|
||||||
CLASSIC_CODE } = require('../controllers/network/enums')
|
|
||||||
|
|
||||||
class ExtensionPlatform {
|
class ExtensionPlatform {
|
||||||
|
|
||||||
|
@ -130,17 +124,7 @@ class ExtensionPlatform {
|
||||||
}
|
}
|
||||||
|
|
||||||
_getExplorer (hash, networkId) {
|
_getExplorer (hash, networkId) {
|
||||||
let explorerName
|
const explorerName = 'BlockScout'
|
||||||
if (networkId === POA_CODE ||
|
|
||||||
networkId === DAI_CODE ||
|
|
||||||
networkId === POA_SOKOL_CODE ||
|
|
||||||
networkId === GOERLI_TESTNET_CODE ||
|
|
||||||
networkId === CLASSIC_CODE
|
|
||||||
) {
|
|
||||||
explorerName = 'BlockScout'
|
|
||||||
} else {
|
|
||||||
explorerName = 'Etherscan'
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
explorerName: explorerName,
|
explorerName: explorerName,
|
||||||
|
|
|
@ -10823,9 +10823,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"eth-net-props": {
|
"eth-net-props": {
|
||||||
"version": "1.0.22",
|
"version": "1.0.23",
|
||||||
"resolved": "https://registry.npmjs.org/eth-net-props/-/eth-net-props-1.0.22.tgz",
|
"resolved": "https://registry.npmjs.org/eth-net-props/-/eth-net-props-1.0.23.tgz",
|
||||||
"integrity": "sha512-xXXWwbnP60y/3dyRh3PgOXOna2Kd0kgFQle0tZ/1z2uavw96IEgEgQ30y2seb4lp/dbsbm9VrLnuUYeQP5Focg==",
|
"integrity": "sha512-hKed33ejnow+zleH8IVDWGwFrNnld5lKJ9D6trM9H7NtFen8j9n4q1ihK7pod0/0nxfQe0axnqrzb5gvbmvT+A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"chai": "^4.1.2"
|
"chai": "^4.1.2"
|
||||||
}
|
}
|
||||||
|
@ -16390,23 +16390,6 @@
|
||||||
"requires": {
|
"requires": {
|
||||||
"bn.js": "^4.11.8",
|
"bn.js": "^4.11.8",
|
||||||
"ethereumjs-util": "^6.0.0"
|
"ethereumjs-util": "^6.0.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"ethereumjs-util": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"bn.js": "^4.11.0",
|
|
||||||
"create-hash": "^1.1.2",
|
|
||||||
"ethjs-util": "0.1.6",
|
|
||||||
"keccak": "^1.0.2",
|
|
||||||
"rlp": "^2.0.0",
|
|
||||||
"safe-buffer": "^5.1.1",
|
|
||||||
"secp256k1": "^3.0.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19860,23 +19843,6 @@
|
||||||
"requires": {
|
"requires": {
|
||||||
"bn.js": "^4.11.8",
|
"bn.js": "^4.11.8",
|
||||||
"ethereumjs-util": "^6.0.0"
|
"ethereumjs-util": "^6.0.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"ethereumjs-util": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"bn.js": "^4.11.0",
|
|
||||||
"create-hash": "^1.1.2",
|
|
||||||
"ethjs-util": "0.1.6",
|
|
||||||
"keccak": "^1.0.2",
|
|
||||||
"rlp": "^2.0.0",
|
|
||||||
"safe-buffer": "^5.1.1",
|
|
||||||
"secp256k1": "^3.0.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@
|
||||||
"eth-keychain-controller": "github:vbaranov/KeyringController#simple-address",
|
"eth-keychain-controller": "github:vbaranov/KeyringController#simple-address",
|
||||||
"eth-ledger-bridge-keyring": "github:vbaranov/eth-ledger-bridge-keyring#0.1.0-clear-accounts-flag",
|
"eth-ledger-bridge-keyring": "github:vbaranov/eth-ledger-bridge-keyring#0.1.0-clear-accounts-flag",
|
||||||
"eth-method-registry": "^1.0.0",
|
"eth-method-registry": "^1.0.0",
|
||||||
"eth-net-props": "^1.0.22",
|
"eth-net-props": "^1.0.23",
|
||||||
"eth-phishing-detect": "^1.1.4",
|
"eth-phishing-detect": "^1.1.4",
|
||||||
"eth-query": "^2.1.2",
|
"eth-query": "^2.1.2",
|
||||||
"eth-sig-util": "^2.0.2",
|
"eth-sig-util": "^2.0.2",
|
||||||
|
|
|
@ -65,18 +65,18 @@ const addCustomToken = async (f, account1, account2) => {
|
||||||
assert.equal(await tokenBalance.getText(), token.supply + ' ' + token.ticker, 'balance is incorrect or not displayed')
|
assert.equal(await tokenBalance.getText(), token.supply + ' ' + token.ticker, 'balance is incorrect or not displayed')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('click to token opens the etherscan', async () => {
|
it('click to token opens the Blockscout', async () => {
|
||||||
const link = await f.waitUntilShowUp(screens.main.tokens.token)
|
const link = await f.waitUntilShowUp(screens.main.tokens.token)
|
||||||
await link.click()
|
await link.click()
|
||||||
await f.delay(2000)
|
await f.delay(2000)
|
||||||
const allHandles = await f.driver.getAllWindowHandles()
|
const allHandles = await f.driver.getAllWindowHandles()
|
||||||
console.log('allHandles.length ' + allHandles.length)
|
console.log('allHandles.length ' + allHandles.length)
|
||||||
assert.equal(allHandles.length, 2, 'etherscan wasn\'t opened')
|
assert.equal(allHandles.length, 2, 'blockscout wasn\'t opened')
|
||||||
await f.switchToLastPage()
|
await f.switchToLastPage()
|
||||||
await f.delay(2000)
|
await f.delay(2000)
|
||||||
const title = await f.waitUntilCurrentUrl()
|
const title = await f.waitUntilCurrentUrl()
|
||||||
console.log(title)
|
console.log(title)
|
||||||
assert.equal(title.includes('https://etherscan.io/token/'), true, 'etherscan wasn\'t opened')
|
assert.equal(title.includes('https://blockscout.com/poa/sokol/tokens/'), true, 'blockscout wasn\'t opened')
|
||||||
await f.switchToFirstPage()
|
await f.switchToFirstPage()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -88,7 +88,7 @@ const addCustomToken = async (f, account1, account2) => {
|
||||||
await menu.click()
|
await menu.click()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('link \'View on blockexplorer...\' leads to correct page ', async () => {
|
it('link \'View on Blockscout...\' leads to correct page ', async () => {
|
||||||
const menu = await f.waitUntilShowUp(menus.token.view)
|
const menu = await f.waitUntilShowUp(menus.token.view)
|
||||||
assert.notEqual(menu, false, 'item isn\'t displayed')
|
assert.notEqual(menu, false, 'item isn\'t displayed')
|
||||||
assert.equal(await menu.getText(), menus.token.viewText, 'incorrect name')
|
assert.equal(await menu.getText(), menus.token.viewText, 'incorrect name')
|
||||||
|
@ -96,12 +96,12 @@ const addCustomToken = async (f, account1, account2) => {
|
||||||
await f.delay(2000)
|
await f.delay(2000)
|
||||||
const allHandles = await f.driver.getAllWindowHandles()
|
const allHandles = await f.driver.getAllWindowHandles()
|
||||||
console.log('allHandles.length ' + allHandles.length)
|
console.log('allHandles.length ' + allHandles.length)
|
||||||
assert.equal(allHandles.length, 3, 'etherscan wasn\'t opened')
|
assert.equal(allHandles.length, 3, 'blockscout wasn\'t opened')
|
||||||
await f.switchToLastPage()
|
await f.switchToLastPage()
|
||||||
const title = await f.waitUntilCurrentUrl()
|
const title = await f.waitUntilCurrentUrl()
|
||||||
|
|
||||||
console.log(title)
|
console.log(title)
|
||||||
assert.equal(title.includes('https://etherscan.io/token/'), true, 'etherscan wasn\'t opened')
|
assert.equal(title.includes('https://blockscout.com/poa/sokol/tokens/'), true, 'blockscout wasn\'t opened')
|
||||||
await f.switchToFirstPage()
|
await f.switchToFirstPage()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue