diff --git a/CHANGELOG.md b/CHANGELOG.md index 13a1003c2..95e60597d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Current Master +- [#329](https://github.com/poanetwork/nifty-wallet/pull/329) - (Fix) Connect to unknown private network fix - [#326](https://github.com/poanetwork/nifty-wallet/pull/326) - (Chore) HTTP2 RPC endpoints for POA and xDai - [#324](https://github.com/poanetwork/nifty-wallet/pull/324) - (Chore) Whitelist Geon token - [#323](https://github.com/poanetwork/nifty-wallet/pull/323) - (Chore) update Mainnet tokens metadata diff --git a/app/scripts/controllers/network/enums.js b/app/scripts/controllers/network/enums.js index 2bd0d9254..55c00155f 100644 --- a/app/scripts/controllers/network/enums.js +++ b/app/scripts/controllers/network/enums.js @@ -40,29 +40,29 @@ const CLASSIC_CODE = 61 const RSK_CODE = 30 const RSK_TESTNET_CODE = 31 -const POA_DISPLAY_NAME = 'POA Core' -const DAI_DISPLAY_NAME = 'xDai Chain' -const POA_SOKOL_DISPLAY_NAME = 'Sokol' -const MAINNET_DISPLAY_NAME = 'Main Ethereum Network' -const ROPSTEN_DISPLAY_NAME = 'Ropsten' -const RINKEBY_DISPLAY_NAME = 'Rinkeby' -const KOVAN_DISPLAY_NAME = 'Kovan' +const POA_DISPLAY_NAME = 'POA' +const DAI_DISPLAY_NAME = 'xDai' +const POA_SOKOL_DISPLAY_NAME = 'Sokol Testnet' +const MAINNET_DISPLAY_NAME = 'Ethereum' +const ROPSTEN_DISPLAY_NAME = 'Ropsten Testnet' +const RINKEBY_DISPLAY_NAME = 'Rinkeby Testnet' +const KOVAN_DISPLAY_NAME = 'Kovan Testnet' const GOERLI_TESTNET_DISPLAY_NAME = 'Görli Testnet' const CLASSIC_DISPLAY_NAME = 'Ethereum Classic' -const RSK_DISPLAY_NAME = 'RSK Mainnet' +const RSK_DISPLAY_NAME = 'RSK' const RSK_TESTNET_DISPLAY_NAME = 'RSK Testnet' const DROPDOWN_POA_DISPLAY_NAME = POA_DISPLAY_NAME const DROPDOWN_DAI_DISPLAY_NAME = DAI_DISPLAY_NAME -const DROPDOWN_POA_SOKOL_DISPLAY_NAME = 'Sokol Network' -const DROPDOWN_MAINNET_DISPLAY_NAME = 'Main Network' -const DROPDOWN_ROPSTEN_DISPLAY_NAME = 'Ropsten Test Net' -const DROPDOWN_RINKEBY_DISPLAY_NAME = 'Rinkeby Test Net' -const DROPDOWN_KOVAN_DISPLAY_NAME = 'Kovan Test Net' -const DROPDOWN_GOERLI_TESTNET_DISPLAY_NAME = 'Görli Test Net' -const DROPDOWN_CLASSIC_DISPLAY_NAME = 'Ethereum Classic' -const DROPDOWN_RSK_DISPLAY_NAME = 'RSK Main Net' -const DROPDOWN_RSK_TESTNET_DISPLAY_NAME = 'RSK Test Net' +const DROPDOWN_POA_SOKOL_DISPLAY_NAME = POA_SOKOL_DISPLAY_NAME +const DROPDOWN_MAINNET_DISPLAY_NAME = MAINNET_DISPLAY_NAME +const DROPDOWN_ROPSTEN_DISPLAY_NAME = ROPSTEN_DISPLAY_NAME +const DROPDOWN_RINKEBY_DISPLAY_NAME = RINKEBY_DISPLAY_NAME +const DROPDOWN_KOVAN_DISPLAY_NAME = KOVAN_DISPLAY_NAME +const DROPDOWN_GOERLI_TESTNET_DISPLAY_NAME = GOERLI_TESTNET_DISPLAY_NAME +const DROPDOWN_CLASSIC_DISPLAY_NAME = CLASSIC_DISPLAY_NAME +const DROPDOWN_RSK_DISPLAY_NAME = RSK_DISPLAY_NAME +const DROPDOWN_RSK_TESTNET_DISPLAY_NAME = RSK_TESTNET_DISPLAY_NAME const chainTypes = { TEST: 1, diff --git a/old-ui/app/app.js b/old-ui/app/app.js index e054fc429..62e5ada20 100644 --- a/old-ui/app/app.js +++ b/old-ui/app/app.js @@ -46,6 +46,7 @@ const DeleteImportedAccount = require('./components/delete-imported-account') const ConfirmChangePassword = require('./components/confirm-change-password') const ethNetProps = require('eth-net-props') const { getMetaMaskAccounts } = require('../../ui/app/selectors') +const { getNetworkID } = require('./util') module.exports = compose( withRouter, @@ -360,6 +361,8 @@ App.prototype.renderPrimary = function () { } App.prototype.getNetworkName = function () { - const { network } = this.props - return ethNetProps.props.getNetworkDisplayName(network) + const { provider } = this.props + const providerName = provider.type + const network = getNetworkID({network: providerName}) + return ethNetProps.props.getNetworkDisplayName(network.netId) } diff --git a/old-ui/app/css/index.css b/old-ui/app/css/index.css index 370e20e59..23518b406 100644 --- a/old-ui/app/css/index.css +++ b/old-ui/app/css/index.css @@ -243,7 +243,7 @@ textarea.twelve-word-phrase { } .network-name { - width: 5.2em; + width: 5.4em; line-height: 9px; text-rendering: geometricPrecision; padding-left: 9px; diff --git a/package-lock.json b/package-lock.json index e0169eaed..00da298a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14684,9 +14684,9 @@ } }, "eth-net-props": { - "version": "1.0.29", - "resolved": "https://registry.npmjs.org/eth-net-props/-/eth-net-props-1.0.29.tgz", - "integrity": "sha512-tCJgAnf8QM1hxeVWPf/h5xe+mfQ01+jLM140mYHxRHWahO6VLRpTdD7Bb//cOfWbcMQMQNMBDR85vulQoCH7Kg==", + "version": "1.0.31", + "resolved": "https://registry.npmjs.org/eth-net-props/-/eth-net-props-1.0.31.tgz", + "integrity": "sha512-ecopbpwYmkkt1X0EwOE+BDN2Okwg+pCu3ZLOVQf8kjPC9pY8UQxbZr8QSp16t2U5H6UoxNTOcdXSFnMjTQrj0A==", "requires": { "chai": "^4.2.0" } diff --git a/package.json b/package.json index 14632ec8f..f49d122c6 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "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-method-registry": "^1.0.0", - "eth-net-props": "^1.0.29", + "eth-net-props": "^1.0.31", "eth-phishing-detect": "^1.1.4", "eth-query": "^2.1.2", "eth-sig-util": "^2.2.0", diff --git a/test/e2e/test-cases/RSK-network-tests.js b/test/e2e/test-cases/RSK-network-tests.js index 9082a74da..b47b31343 100644 --- a/test/e2e/test-cases/RSK-network-tests.js +++ b/test/e2e/test-cases/RSK-network-tests.js @@ -2,7 +2,7 @@ const assert = require('assert') const { screens, elements, NETWORKS } = require('../elements') const RSKNetworkTests = async (f, account1) => { - it('connects to RSK mainnet', async function () { + it('connects to RSK', async function () { await f.setProvider(NETWORKS.RSK) await f.delay(2000) }) diff --git a/test/e2e/test-cases/add-token-custom.spec.js b/test/e2e/test-cases/add-token-custom.spec.js index 5edfeafad..b13419ee3 100644 --- a/test/e2e/test-cases/add-token-custom.spec.js +++ b/test/e2e/test-cases/add-token-custom.spec.js @@ -210,9 +210,9 @@ const addCustomToken = async (f, account1, account2) => { assert(await f.isDisabledAddInexistentToken(tokenAddress), true, 'can add inexistent token in MAINNET') }) - it('can not add inexistent token to RSK mainnet', async () => { + it('can not add inexistent token to RSK', async () => { await f.setProvider(NETWORKS.RSK) - assert(await f.isDisabledAddInexistentToken(tokenAddress), true, 'can add inexistent token in RSK mainnet') + assert(await f.isDisabledAddInexistentToken(tokenAddress), true, 'can add inexistent token in RSK') }) it('can not add inexistent token to RSK testnet', async () => { diff --git a/test/e2e/test-cases/add-token-search.spec.js b/test/e2e/test-cases/add-token-search.spec.js index 2e6a3497a..ec6440db1 100644 --- a/test/e2e/test-cases/add-token-search.spec.js +++ b/test/e2e/test-cases/add-token-search.spec.js @@ -251,7 +251,7 @@ const addTokeFromSearch = async (f) => { assert.equal(await f.assertTokensNotDisplayed(), true, 'tokens are displayed') }) - it('token should not be displayed in RSK mainnet', async () => { + it('token should not be displayed in RSK', async () => { await f.setProvider(NETWORKS.RSK) assert.equal(await f.assertTokensNotDisplayed(), true, 'tokens are displayed') }) diff --git a/test/e2e/test-cases/custom-rpc.spec.js b/test/e2e/test-cases/custom-rpc.spec.js index a901e05c1..c57af68d9 100644 --- a/test/e2e/test-cases/custom-rpc.spec.js +++ b/test/e2e/test-cases/custom-rpc.spec.js @@ -132,7 +132,7 @@ const customRPC = async (f) => { it('deleted custom rpc isn\'t displayed in \'Settings\' screen', async function () { const currentNetwork = await f.waitUntilShowUp(screens.settings.currentNetwork) - assert.equal(await currentNetwork.getText(), 'POA Core', 'custom Rpc is displayed after deletion') + assert.equal(await currentNetwork.getText(), 'POA', 'custom Rpc is displayed after deletion') }) it('deleted custom rpc isn\'t displayed in network dropdown menu', async function () { diff --git a/test/e2e/test-cases/import-account.spec.js b/test/e2e/test-cases/import-account.spec.js index f50aa605d..8d016cef4 100644 --- a/test/e2e/test-cases/import-account.spec.js +++ b/test/e2e/test-cases/import-account.spec.js @@ -38,7 +38,7 @@ const importAccount = async (f) => { await menu.click() }) - it('Auto-detect tokens for POA core network ', async () => { + it('Auto-detect tokens for POA ', async () => { // await setProvider(NETWORKS.POA) const tab = await f.waitUntilShowUp(tokensEl.menu) await tab.click() diff --git a/test/unit/app/buy-eth-url.spec.js b/test/unit/app/buy-eth-url.spec.js index 3ade98095..49ecb229a 100644 --- a/test/unit/app/buy-eth-url.spec.js +++ b/test/unit/app/buy-eth-url.spec.js @@ -66,7 +66,7 @@ describe('', function () { assert.equal(kovanUrl, 'https://gitter.im/kovan-testnet/faucet/') }) - it('returns exchanges for POA core network', function () { + it('returns exchanges for POA', function () { const exchanges = getExchanges({network: 99}) assert.deepEqual(exchanges, [ { diff --git a/test/unit/app/controllers/network-contoller-test.js b/test/unit/app/controllers/network-contoller-test.js index f90128de9..e8c013881 100644 --- a/test/unit/app/controllers/network-contoller-test.js +++ b/test/unit/app/controllers/network-contoller-test.js @@ -73,31 +73,31 @@ describe('Network utils', () => { const tests = [ { input: 3, - expected: 'Ropsten', + expected: 'Ropsten Testnet', }, { input: 4, - expected: 'Rinkeby', + expected: 'Rinkeby Testnet', }, { input: 42, - expected: 'Kovan', + expected: 'Kovan Testnet', }, { input: 77, - expected: 'Sokol', + expected: 'Sokol Testnet', }, { input: 'ropsten', - expected: 'Ropsten', + expected: 'Ropsten Testnet', }, { input: 'rinkeby', - expected: 'Rinkeby', + expected: 'Rinkeby Testnet', }, { input: 'kovan', - expected: 'Kovan', + expected: 'Kovan Testnet', }, { input: 'sokol', - expected: 'Sokol', + expected: 'Sokol Testnet', }, { input: 'mainnet', - expected: 'Main Ethereum Network', + expected: 'Ethereum', }, ]