Merge branch 'develop' into patch-1

This commit is contained in:
Connor Bryan 2018-08-15 16:08:21 -05:00 committed by GitHub
commit b865f590bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 87 additions and 14 deletions

View File

@ -6,6 +6,7 @@ import { Link } from 'react-router-dom';
import isEmpty from 'lodash/isEmpty'; import isEmpty from 'lodash/isEmpty';
import { import {
HardwareWalletName,
SecureWalletName, SecureWalletName,
InsecureWalletName, InsecureWalletName,
MiscWalletName, MiscWalletName,
@ -98,12 +99,17 @@ export interface InsecureWalletInfo extends BaseWalletInfo {
// tslint:disable-next-line:no-empty-interface // tslint:disable-next-line:no-empty-interface
interface MiscWalletInfo extends InsecureWalletInfo {} interface MiscWalletInfo extends InsecureWalletInfo {}
type HardwareWallets = { [key in HardwareWalletName]: SecureWalletInfo };
type SecureWallets = { [key in SecureWalletName]: SecureWalletInfo }; type SecureWallets = { [key in SecureWalletName]: SecureWalletInfo };
type InsecureWallets = { [key in InsecureWalletName]: InsecureWalletInfo }; type InsecureWallets = { [key in InsecureWalletName]: InsecureWalletInfo };
type MiscWallet = { [key in MiscWalletName]: MiscWalletInfo }; type MiscWallet = { [key in MiscWalletName]: MiscWalletInfo };
type Wallets = SecureWallets & InsecureWallets & MiscWallet; type Wallets = HardwareWallets & SecureWallets & InsecureWallets & MiscWallet;
const SECURE_WALLETS = Object.values(SecureWalletName); const HARDWARE_WALLETS = Object.values(HardwareWalletName);
/** @desc Hardware wallets are secure too, but we want to avoid duplication. */
const SECURE_WALLETS = Object.values(SecureWalletName).filter(
value => !HARDWARE_WALLETS.includes(value)
);
const INSECURE_WALLETS = Object.values(InsecureWalletName); const INSECURE_WALLETS = Object.values(InsecureWalletName);
const MISC_WALLETS = Object.values(MiscWalletName); const MISC_WALLETS = Object.values(MiscWalletName);
@ -309,7 +315,7 @@ const WalletDecrypt = withRouter<Props>(
<h2 className="WalletDecrypt-wallets-title">{translate('DECRYPT_ACCESS')}</h2> <h2 className="WalletDecrypt-wallets-title">{translate('DECRYPT_ACCESS')}</h2>
<div className="WalletDecrypt-wallets-row"> <div className="WalletDecrypt-wallets-row">
{SECURE_WALLETS.map((walletType: SecureWalletName) => { {HARDWARE_WALLETS.map((walletType: SecureWalletName) => {
const wallet = this.WALLETS[walletType]; const wallet = this.WALLETS[walletType];
return ( return (
<WalletButton <WalletButton
@ -328,23 +334,22 @@ const WalletDecrypt = withRouter<Props>(
})} })}
</div> </div>
<div className="WalletDecrypt-wallets-row"> <div className="WalletDecrypt-wallets-row">
{INSECURE_WALLETS.map((walletType: InsecureWalletName) => { {SECURE_WALLETS.map((walletType: SecureWalletName) => {
const wallet = this.WALLETS[walletType]; const wallet = this.WALLETS[walletType];
return ( return (
<WalletButton <WalletButton
key={walletType} key={walletType}
name={translateRaw(wallet.lid)} name={translateRaw(wallet.lid)}
example={wallet.example} description={translateRaw(wallet.description)}
helpLink={wallet.helpLink} helpLink={wallet.helpLink}
walletType={walletType} walletType={walletType}
isSecure={false} isSecure={true}
isDisabled={this.isWalletDisabled(walletType)} isDisabled={this.isWalletDisabled(walletType)}
disableReason={reasons[walletType]} disableReason={reasons[walletType]}
onClick={this.handleWalletChoice} onClick={this.handleWalletChoice}
/> />
); );
})} })}
{MISC_WALLETS.map((walletType: MiscWalletName) => { {MISC_WALLETS.map((walletType: MiscWalletName) => {
const wallet = this.WALLETS[walletType]; const wallet = this.WALLETS[walletType];
return ( return (
@ -355,6 +360,26 @@ const WalletDecrypt = withRouter<Props>(
helpLink={wallet.helpLink} helpLink={wallet.helpLink}
walletType={walletType} walletType={walletType}
isReadOnly={true} isReadOnly={true}
isSecure={true}
isDisabled={this.isWalletDisabled(walletType)}
disableReason={reasons[walletType]}
onClick={this.handleWalletChoice}
/>
);
})}
</div>
<div className="WalletDecrypt-wallets-row">
{INSECURE_WALLETS.map((walletType: InsecureWalletName) => {
const wallet = this.WALLETS[walletType];
return (
<WalletButton
key={walletType}
name={translateRaw(wallet.lid)}
example={wallet.example}
helpLink={wallet.helpLink}
walletType={walletType}
isSecure={false}
isDisabled={this.isWalletDisabled(walletType)} isDisabled={this.isWalletDisabled(walletType)}
disableReason={reasons[walletType]} disableReason={reasons[walletType]}
onClick={this.handleWalletChoice} onClick={this.handleWalletChoice}

File diff suppressed because one or more lines are too long

View File

@ -467,6 +467,32 @@ export const STATIC_NETWORKS_INITIAL_STATE: StaticNetworksState = {
} }
}, },
GO_TESTNET: {
id: 'GO_TESTNET',
name: 'GO',
unit: 'GO',
chainId: 31337,
isCustom: false,
color: '#00b04a',
blockExplorer: makeExplorer({
name: 'GoChain Testnet Explorer',
origin: 'https://testnet-explorer.gochain.io'
}),
tokens: [],
contracts: [],
isTestnet: true,
dPathFormats: {
[SecureWalletName.TREZOR]: GO_DEFAULT,
[SecureWalletName.SAFE_T]: GO_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: GO_DEFAULT
},
gasPriceSettings: {
min: 2,
max: 60,
initial: 2
}
},
EOSC: { EOSC: {
id: 'EOSC', id: 'EOSC',
name: 'EOS Classic', name: 'EOS Classic',
@ -491,6 +517,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: StaticNetworksState = {
initial: 20 initial: 20
} }
}, },
ESN: { ESN: {
id: 'ESN', id: 'ESN',
name: 'EthersocialNetwork', name: 'EthersocialNetwork',

View File

@ -78,12 +78,6 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
type: 'rpc', type: 'rpc',
service: 'Ethereum Commonwealth', service: 'Ethereum Commonwealth',
url: 'https://etc-geth.0xinfra.com/' url: 'https://etc-geth.0xinfra.com/'
},
{
name: makeNodeName('ETC', 'chainkorea'),
type: 'rpc',
service: 'Chainkorea',
url: 'https://node.classicexplorer.org/'
} }
], ],
@ -165,6 +159,12 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
type: 'rpc', type: 'rpc',
service: '0xinfra.com', service: '0xinfra.com',
url: 'https://clo-geth.0xinfra.com/' url: 'https://clo-geth.0xinfra.com/'
},
{
name: makeNodeName('CLO', 'chainkorea'),
type: 'rpc',
service: 'Chainkorea',
url: 'https://node.clopool.net/'
} }
], ],
@ -195,6 +195,15 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
} }
], ],
GO_TESTNET: [
{
name: makeNodeName('GO_TESTNET', 'go_testnet'),
type: 'rpc',
service: 'testnet-rpc.gochain.io',
url: 'https://testnet-rpc.gochain.io/'
}
],
EOSC: [ EOSC: [
{ {
name: makeNodeName('EOSC', 'eosc'), name: makeNodeName('EOSC', 'eosc'),

View File

@ -35,7 +35,6 @@
var passphrase = ""; var passphrase = "";
function unlockWithPassphrase() { function unlockWithPassphrase() {
if (!passphrase.length) return;
ipcRenderer.send('$EVENT', passphrase); ipcRenderer.send('$EVENT', passphrase);
} }

View File

@ -18,6 +18,7 @@ type StaticNetworkIds =
| 'RSK' | 'RSK'
| 'RSK_TESTNET' | 'RSK_TESTNET'
| 'GO' | 'GO'
| 'GO_TESTNET'
| 'EOSC' | 'EOSC'
| 'ESN'; | 'ESN';