Merge branch 'develop' into patch-2

This commit is contained in:
Connor Bryan 2018-08-15 15:46:54 -05:00 committed by GitHub
commit 04b6523c22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 75 additions and 14 deletions

View File

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

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: {
id: 'EOSC',
name: 'EOS Classic',
@ -491,6 +517,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: StaticNetworksState = {
initial: 20
}
},
ESN: {
id: 'ESN',
name: 'EthersocialNetwork',

View File

@ -78,12 +78,6 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
type: 'rpc',
service: 'Ethereum Commonwealth',
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',
service: '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: [
{
name: makeNodeName('EOSC', 'eosc'),

View File

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

View File

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