Merge pull request #329 from poanetwork/vb-connect-to-unknown-network
Connect to unknown private network fix
This commit is contained in:
commit
10d6399dfb
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
## Current Master
|
## 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
|
- [#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
|
- [#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
|
- [#323](https://github.com/poanetwork/nifty-wallet/pull/323) - (Chore) update Mainnet tokens metadata
|
||||||
|
|
|
@ -40,29 +40,29 @@ const CLASSIC_CODE = 61
|
||||||
const RSK_CODE = 30
|
const RSK_CODE = 30
|
||||||
const RSK_TESTNET_CODE = 31
|
const RSK_TESTNET_CODE = 31
|
||||||
|
|
||||||
const POA_DISPLAY_NAME = 'POA Core'
|
const POA_DISPLAY_NAME = 'POA'
|
||||||
const DAI_DISPLAY_NAME = 'xDai Chain'
|
const DAI_DISPLAY_NAME = 'xDai'
|
||||||
const POA_SOKOL_DISPLAY_NAME = 'Sokol'
|
const POA_SOKOL_DISPLAY_NAME = 'Sokol Testnet'
|
||||||
const MAINNET_DISPLAY_NAME = 'Main Ethereum Network'
|
const MAINNET_DISPLAY_NAME = 'Ethereum'
|
||||||
const ROPSTEN_DISPLAY_NAME = 'Ropsten'
|
const ROPSTEN_DISPLAY_NAME = 'Ropsten Testnet'
|
||||||
const RINKEBY_DISPLAY_NAME = 'Rinkeby'
|
const RINKEBY_DISPLAY_NAME = 'Rinkeby Testnet'
|
||||||
const KOVAN_DISPLAY_NAME = 'Kovan'
|
const KOVAN_DISPLAY_NAME = 'Kovan Testnet'
|
||||||
const GOERLI_TESTNET_DISPLAY_NAME = 'Görli Testnet'
|
const GOERLI_TESTNET_DISPLAY_NAME = 'Görli Testnet'
|
||||||
const CLASSIC_DISPLAY_NAME = 'Ethereum Classic'
|
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 RSK_TESTNET_DISPLAY_NAME = 'RSK Testnet'
|
||||||
|
|
||||||
const DROPDOWN_POA_DISPLAY_NAME = POA_DISPLAY_NAME
|
const DROPDOWN_POA_DISPLAY_NAME = POA_DISPLAY_NAME
|
||||||
const DROPDOWN_DAI_DISPLAY_NAME = DAI_DISPLAY_NAME
|
const DROPDOWN_DAI_DISPLAY_NAME = DAI_DISPLAY_NAME
|
||||||
const DROPDOWN_POA_SOKOL_DISPLAY_NAME = 'Sokol Network'
|
const DROPDOWN_POA_SOKOL_DISPLAY_NAME = POA_SOKOL_DISPLAY_NAME
|
||||||
const DROPDOWN_MAINNET_DISPLAY_NAME = 'Main Network'
|
const DROPDOWN_MAINNET_DISPLAY_NAME = MAINNET_DISPLAY_NAME
|
||||||
const DROPDOWN_ROPSTEN_DISPLAY_NAME = 'Ropsten Test Net'
|
const DROPDOWN_ROPSTEN_DISPLAY_NAME = ROPSTEN_DISPLAY_NAME
|
||||||
const DROPDOWN_RINKEBY_DISPLAY_NAME = 'Rinkeby Test Net'
|
const DROPDOWN_RINKEBY_DISPLAY_NAME = RINKEBY_DISPLAY_NAME
|
||||||
const DROPDOWN_KOVAN_DISPLAY_NAME = 'Kovan Test Net'
|
const DROPDOWN_KOVAN_DISPLAY_NAME = KOVAN_DISPLAY_NAME
|
||||||
const DROPDOWN_GOERLI_TESTNET_DISPLAY_NAME = 'Görli Test Net'
|
const DROPDOWN_GOERLI_TESTNET_DISPLAY_NAME = GOERLI_TESTNET_DISPLAY_NAME
|
||||||
const DROPDOWN_CLASSIC_DISPLAY_NAME = 'Ethereum Classic'
|
const DROPDOWN_CLASSIC_DISPLAY_NAME = CLASSIC_DISPLAY_NAME
|
||||||
const DROPDOWN_RSK_DISPLAY_NAME = 'RSK Main Net'
|
const DROPDOWN_RSK_DISPLAY_NAME = RSK_DISPLAY_NAME
|
||||||
const DROPDOWN_RSK_TESTNET_DISPLAY_NAME = 'RSK Test Net'
|
const DROPDOWN_RSK_TESTNET_DISPLAY_NAME = RSK_TESTNET_DISPLAY_NAME
|
||||||
|
|
||||||
const chainTypes = {
|
const chainTypes = {
|
||||||
TEST: 1,
|
TEST: 1,
|
||||||
|
|
|
@ -46,6 +46,7 @@ const DeleteImportedAccount = require('./components/delete-imported-account')
|
||||||
const ConfirmChangePassword = require('./components/confirm-change-password')
|
const ConfirmChangePassword = require('./components/confirm-change-password')
|
||||||
const ethNetProps = require('eth-net-props')
|
const ethNetProps = require('eth-net-props')
|
||||||
const { getMetaMaskAccounts } = require('../../ui/app/selectors')
|
const { getMetaMaskAccounts } = require('../../ui/app/selectors')
|
||||||
|
const { getNetworkID } = require('./util')
|
||||||
|
|
||||||
module.exports = compose(
|
module.exports = compose(
|
||||||
withRouter,
|
withRouter,
|
||||||
|
@ -360,6 +361,8 @@ App.prototype.renderPrimary = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
App.prototype.getNetworkName = function () {
|
App.prototype.getNetworkName = function () {
|
||||||
const { network } = this.props
|
const { provider } = this.props
|
||||||
return ethNetProps.props.getNetworkDisplayName(network)
|
const providerName = provider.type
|
||||||
|
const network = getNetworkID({network: providerName})
|
||||||
|
return ethNetProps.props.getNetworkDisplayName(network.netId)
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,7 @@ textarea.twelve-word-phrase {
|
||||||
}
|
}
|
||||||
|
|
||||||
.network-name {
|
.network-name {
|
||||||
width: 5.2em;
|
width: 5.4em;
|
||||||
line-height: 9px;
|
line-height: 9px;
|
||||||
text-rendering: geometricPrecision;
|
text-rendering: geometricPrecision;
|
||||||
padding-left: 9px;
|
padding-left: 9px;
|
||||||
|
|
|
@ -14684,9 +14684,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"eth-net-props": {
|
"eth-net-props": {
|
||||||
"version": "1.0.29",
|
"version": "1.0.31",
|
||||||
"resolved": "https://registry.npmjs.org/eth-net-props/-/eth-net-props-1.0.29.tgz",
|
"resolved": "https://registry.npmjs.org/eth-net-props/-/eth-net-props-1.0.31.tgz",
|
||||||
"integrity": "sha512-tCJgAnf8QM1hxeVWPf/h5xe+mfQ01+jLM140mYHxRHWahO6VLRpTdD7Bb//cOfWbcMQMQNMBDR85vulQoCH7Kg==",
|
"integrity": "sha512-ecopbpwYmkkt1X0EwOE+BDN2Okwg+pCu3ZLOVQf8kjPC9pY8UQxbZr8QSp16t2U5H6UoxNTOcdXSFnMjTQrj0A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"chai": "^4.2.0"
|
"chai": "^4.2.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,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.29",
|
"eth-net-props": "^1.0.31",
|
||||||
"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.2.0",
|
"eth-sig-util": "^2.2.0",
|
||||||
|
|
|
@ -2,7 +2,7 @@ const assert = require('assert')
|
||||||
const { screens, elements, NETWORKS } = require('../elements')
|
const { screens, elements, NETWORKS } = require('../elements')
|
||||||
|
|
||||||
const RSKNetworkTests = async (f, account1) => {
|
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.setProvider(NETWORKS.RSK)
|
||||||
await f.delay(2000)
|
await f.delay(2000)
|
||||||
})
|
})
|
||||||
|
|
|
@ -210,9 +210,9 @@ const addCustomToken = async (f, account1, account2) => {
|
||||||
assert(await f.isDisabledAddInexistentToken(tokenAddress), true, 'can add inexistent token in MAINNET')
|
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)
|
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 () => {
|
it('can not add inexistent token to RSK testnet', async () => {
|
||||||
|
|
|
@ -251,7 +251,7 @@ const addTokeFromSearch = async (f) => {
|
||||||
assert.equal(await f.assertTokensNotDisplayed(), true, 'tokens are displayed')
|
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)
|
await f.setProvider(NETWORKS.RSK)
|
||||||
assert.equal(await f.assertTokensNotDisplayed(), true, 'tokens are displayed')
|
assert.equal(await f.assertTokensNotDisplayed(), true, 'tokens are displayed')
|
||||||
})
|
})
|
||||||
|
|
|
@ -132,7 +132,7 @@ const customRPC = async (f) => {
|
||||||
|
|
||||||
it('deleted custom rpc isn\'t displayed in \'Settings\' screen', async function () {
|
it('deleted custom rpc isn\'t displayed in \'Settings\' screen', async function () {
|
||||||
const currentNetwork = await f.waitUntilShowUp(screens.settings.currentNetwork)
|
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 () {
|
it('deleted custom rpc isn\'t displayed in network dropdown menu', async function () {
|
||||||
|
|
|
@ -38,7 +38,7 @@ const importAccount = async (f) => {
|
||||||
await menu.click()
|
await menu.click()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Auto-detect tokens for POA core network ', async () => {
|
it('Auto-detect tokens for POA ', async () => {
|
||||||
// await setProvider(NETWORKS.POA)
|
// await setProvider(NETWORKS.POA)
|
||||||
const tab = await f.waitUntilShowUp(tokensEl.menu)
|
const tab = await f.waitUntilShowUp(tokensEl.menu)
|
||||||
await tab.click()
|
await tab.click()
|
||||||
|
|
|
@ -66,7 +66,7 @@ describe('', function () {
|
||||||
assert.equal(kovanUrl, 'https://gitter.im/kovan-testnet/faucet/')
|
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})
|
const exchanges = getExchanges({network: 99})
|
||||||
assert.deepEqual(exchanges, [
|
assert.deepEqual(exchanges, [
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,31 +73,31 @@ describe('Network utils', () => {
|
||||||
const tests = [
|
const tests = [
|
||||||
{
|
{
|
||||||
input: 3,
|
input: 3,
|
||||||
expected: 'Ropsten',
|
expected: 'Ropsten Testnet',
|
||||||
}, {
|
}, {
|
||||||
input: 4,
|
input: 4,
|
||||||
expected: 'Rinkeby',
|
expected: 'Rinkeby Testnet',
|
||||||
}, {
|
}, {
|
||||||
input: 42,
|
input: 42,
|
||||||
expected: 'Kovan',
|
expected: 'Kovan Testnet',
|
||||||
}, {
|
}, {
|
||||||
input: 77,
|
input: 77,
|
||||||
expected: 'Sokol',
|
expected: 'Sokol Testnet',
|
||||||
}, {
|
}, {
|
||||||
input: 'ropsten',
|
input: 'ropsten',
|
||||||
expected: 'Ropsten',
|
expected: 'Ropsten Testnet',
|
||||||
}, {
|
}, {
|
||||||
input: 'rinkeby',
|
input: 'rinkeby',
|
||||||
expected: 'Rinkeby',
|
expected: 'Rinkeby Testnet',
|
||||||
}, {
|
}, {
|
||||||
input: 'kovan',
|
input: 'kovan',
|
||||||
expected: 'Kovan',
|
expected: 'Kovan Testnet',
|
||||||
}, {
|
}, {
|
||||||
input: 'sokol',
|
input: 'sokol',
|
||||||
expected: 'Sokol',
|
expected: 'Sokol Testnet',
|
||||||
}, {
|
}, {
|
||||||
input: 'mainnet',
|
input: 'mainnet',
|
||||||
expected: 'Main Ethereum Network',
|
expected: 'Ethereum',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue