Skip to content

Commit

Permalink
Merge pull request #832 from MyEtherWallet/develop
Browse files Browse the repository at this point in the history
Tag release 0.1.0
  • Loading branch information
dternyak authored Jan 15, 2018
2 parents af4d415 + c2241dd commit 93852bb
Show file tree
Hide file tree
Showing 289 changed files with 7,543 additions and 2,875 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- docker pull dternyak/eth-priv-to-addr:latest

- sudo apt-get install libusb-1.0

install:
- npm install --silent

Expand Down
10 changes: 7 additions & 3 deletions common/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import BroadcastTx from 'containers/Tabs/BroadcastTx';
import ErrorScreen from 'components/ErrorScreen';
import PageNotFound from 'components/PageNotFound';
import LogOutPrompt from 'components/LogOutPrompt';
import { Aux } from 'components/ui';
import { Store } from 'redux';
import { pollOfflineStatus } from 'actions/config';
import { AppState } from 'reducers';

interface Props {
Expand All @@ -30,6 +30,10 @@ export default class Root extends Component<Props, State> {
error: null
};

public componentDidMount() {
this.props.store.dispatch(pollOfflineStatus());
}

public componentDidCatch(error: Error) {
this.setState({ error });
}
Expand Down Expand Up @@ -70,11 +74,11 @@ export default class Root extends Component<Props, State> {
return (
<Provider store={store} key={Math.random()}>
<Router key={Math.random()}>
<Aux>
<React.Fragment>
{routes}
<LegacyRoutes />
<LogOutPrompt />
</Aux>
</React.Fragment>
</Router>
</Provider>
);
Expand Down
22 changes: 13 additions & 9 deletions common/actions/config/actionCreators.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import * as interfaces from './actionTypes';
import { TypeKeys } from './constants';
import { NodeConfig, CustomNodeConfig, CustomNetworkConfig } from 'config/data';
import { NodeConfig, CustomNodeConfig, NetworkConfig, CustomNetworkConfig } from 'config/data';

export type TForceOfflineConfig = typeof forceOfflineConfig;
export function forceOfflineConfig(): interfaces.ForceOfflineAction {
export type TToggleOfflineConfig = typeof toggleOfflineConfig;
export function toggleOfflineConfig(): interfaces.ToggleOfflineAction {
return {
type: TypeKeys.CONFIG_FORCE_OFFLINE
type: TypeKeys.CONFIG_TOGGLE_OFFLINE
};
}

export type TToggleOfflineConfig = typeof toggleOfflineConfig;
export function toggleOfflineConfig(): interfaces.ToggleOfflineAction {
export type TToggleAutoGasLimit = typeof toggleAutoGasLimit;
export function toggleAutoGasLimit(): interfaces.ToggleAutoGasLimitAction {
return {
type: TypeKeys.CONFIG_TOGGLE_OFFLINE
type: TypeKeys.CONFIG_TOGGLE_AUTO_GAS_LIMIT
};
}

Expand All @@ -25,10 +25,14 @@ export function changeLanguage(sign: string): interfaces.ChangeLanguageAction {
}

export type TChangeNode = typeof changeNode;
export function changeNode(nodeSelection: string, node: NodeConfig): interfaces.ChangeNodeAction {
export function changeNode(
nodeSelection: string,
node: NodeConfig,
network: NetworkConfig
): interfaces.ChangeNodeAction {
return {
type: TypeKeys.CONFIG_NODE_CHANGE,
payload: { nodeSelection, node }
payload: { nodeSelection, node, network }
};
}

Expand Down
10 changes: 5 additions & 5 deletions common/actions/config/actionTypes.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { TypeKeys } from './constants';
import { NodeConfig, CustomNodeConfig, CustomNetworkConfig } from 'config/data';
import { NodeConfig, CustomNodeConfig, NetworkConfig, CustomNetworkConfig } from 'config/data';

/*** Toggle Offline ***/
export interface ToggleOfflineAction {
type: TypeKeys.CONFIG_TOGGLE_OFFLINE;
}

/*** Force Offline ***/
export interface ForceOfflineAction {
type: TypeKeys.CONFIG_FORCE_OFFLINE;
export interface ToggleAutoGasLimitAction {
type: TypeKeys.CONFIG_TOGGLE_AUTO_GAS_LIMIT;
}

/*** Change Language ***/
Expand All @@ -24,6 +23,7 @@ export interface ChangeNodeAction {
payload: {
nodeSelection: string;
node: NodeConfig;
network: NetworkConfig;
};
}

Expand Down Expand Up @@ -78,8 +78,8 @@ export type ConfigAction =
| ChangeNodeAction
| ChangeLanguageAction
| ToggleOfflineAction
| ToggleAutoGasLimitAction
| PollOfflineStatus
| ForceOfflineAction
| ChangeNodeIntentAction
| AddCustomNodeAction
| RemoveCustomNodeAction
Expand Down
2 changes: 1 addition & 1 deletion common/actions/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export enum TypeKeys {
CONFIG_NODE_CHANGE = 'CONFIG_NODE_CHANGE',
CONFIG_NODE_CHANGE_INTENT = 'CONFIG_NODE_CHANGE_INTENT',
CONFIG_TOGGLE_OFFLINE = 'CONFIG_TOGGLE_OFFLINE',
CONFIG_FORCE_OFFLINE = 'CONFIG_FORCE_OFFLINE',
CONFIG_TOGGLE_AUTO_GAS_LIMIT = 'CONFIG_TOGGLE_AUTO_GAS_LIMIT',
CONFIG_POLL_OFFLINE_STATUS = 'CONFIG_POLL_OFFLINE_STATUS',
CONFIG_ADD_CUSTOM_NODE = 'CONFIG_ADD_CUSTOM_NODE',
CONFIG_REMOVE_CUSTOM_NODE = 'CONFIG_REMOVE_CUSTOM_NODE',
Expand Down
22 changes: 0 additions & 22 deletions common/actions/ens/actionCreators.ts

This file was deleted.

1 change: 1 addition & 0 deletions common/actions/ens/actionCreators/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './resolveDomain';
35 changes: 35 additions & 0 deletions common/actions/ens/actionCreators/resolveDomain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import * as ActionTypes from '../actionTypes';
import { TypeKeys } from '../constants';
import { DomainRequest } from 'libs/ens';
import { ResolveDomainCached } from 'actions/ens';

export type TResolveDomainRequested = typeof resolveDomainRequested;
export const resolveDomainRequested = (domain: string): ActionTypes.ResolveDomainRequested => ({
type: TypeKeys.ENS_RESOLVE_DOMAIN_REQUESTED,
payload: { domain }
});

export const resolveDomainCached = (
payload: ResolveDomainCached['payload']
): ResolveDomainCached => ({
type: TypeKeys.ENS_RESOLVE_DOMAIN_CACHED,
payload
});

export type TResolveDomainSucceeded = typeof resolveDomainSucceeded;
export const resolveDomainSucceeded = (
domain: string,
domainData: DomainRequest
): ActionTypes.ResolveDomainSucceeded => ({
type: TypeKeys.ENS_RESOLVE_DOMAIN_SUCCEEDED,
payload: { domain, domainData }
});

export type TResolveDomainFailed = typeof resolveDomainFailed;
export const resolveDomainFailed = (
domain: string,
error: Error
): ActionTypes.ResolveDomainFailed => ({
type: TypeKeys.ENS_RESOLVE_DOMAIN_FAILED,
payload: { domain, error }
});
17 changes: 0 additions & 17 deletions common/actions/ens/actionTypes.ts

This file was deleted.

5 changes: 5 additions & 0 deletions common/actions/ens/actionTypes/actionTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ResolveDomainAction } from './resolveDomain';

export * from './resolveDomain';

export type EnsAction = ResolveDomainAction;
1 change: 1 addition & 0 deletions common/actions/ens/actionTypes/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './actionTypes';
28 changes: 28 additions & 0 deletions common/actions/ens/actionTypes/resolveDomain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { TypeKeys } from '../constants';
import { DomainRequest } from 'libs/ens';

export interface ResolveDomainRequested {
type: TypeKeys.ENS_RESOLVE_DOMAIN_REQUESTED;
payload: { domain: string };
}

export interface ResolveDomainSucceeded {
type: TypeKeys.ENS_RESOLVE_DOMAIN_SUCCEEDED;
payload: { domain: string; domainData: DomainRequest };
}

export interface ResolveDomainCached {
type: TypeKeys.ENS_RESOLVE_DOMAIN_CACHED;
payload: { domain: string };
}

export interface ResolveDomainFailed {
type: TypeKeys.ENS_RESOLVE_DOMAIN_FAILED;
payload: { domain: string; error: Error };
}

export type ResolveDomainAction =
| ResolveDomainRequested
| ResolveDomainSucceeded
| ResolveDomainFailed
| ResolveDomainCached;
8 changes: 6 additions & 2 deletions common/actions/ens/constants.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
export const ENS_RESOLVE = 'ENS_RESOLVE';
export const ENS_CACHE = 'ENS_CACHE';
export enum TypeKeys {
ENS_RESOLVE_DOMAIN_REQUESTED = 'ENS_RESOLVE_DOMAIN_REQUESTED',
ENS_RESOLVE_DOMAIN_SUCCEEDED = 'ENS_RESOLVE_DOMAIN_SUCCEEDED',
ENS_RESOLVE_DOMAIN_CACHED = 'ENS_RESOLVE_DOMAIN_CACHED',
ENS_RESOLVE_DOMAIN_FAILED = 'ENS_RESOLVE_DOMAIN_FAILED'
}
31 changes: 31 additions & 0 deletions common/actions/onboardStatus/actionCreators.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import * as interfaces from './actionTypes';
import { TypeKeys } from './constants';

export type TStartOnboardSession = typeof startOnboardSession;
export function startOnboardSession(): interfaces.StartOnboardSessionAction {
return {
type: TypeKeys.START_ONBOARD_SESSION
};
}

export type TResumeSlide = typeof resumeSlide;
export function resumeSlide(slideNumber: number): interfaces.ResumeSlideAction {
return {
type: TypeKeys.RESUME_SLIDE,
slideNumber
};
}

export type TDecrementSlide = typeof decrementSlide;
export function decrementSlide(): interfaces.DecrementSlideAction {
return {
type: TypeKeys.DECREMENT_SLIDE
};
}

export type TIncrementSlide = typeof incrementSlide;
export function incrementSlide(): interfaces.IncrementSlideAction {
return {
type: TypeKeys.INCREMENT_SLIDE
};
}
24 changes: 24 additions & 0 deletions common/actions/onboardStatus/actionTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { TypeKeys } from './constants';

export interface StartOnboardSessionAction {
type: TypeKeys.START_ONBOARD_SESSION;
}

export interface ResumeSlideAction {
type: TypeKeys.RESUME_SLIDE;
slideNumber: number;
}

export interface DecrementSlideAction {
type: TypeKeys.DECREMENT_SLIDE;
}

export interface IncrementSlideAction {
type: TypeKeys.INCREMENT_SLIDE;
}

export type OnboardStatusAction =
| StartOnboardSessionAction
| ResumeSlideAction
| DecrementSlideAction
| IncrementSlideAction;
6 changes: 6 additions & 0 deletions common/actions/onboardStatus/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export enum TypeKeys {
START_ONBOARD_SESSION = 'START_ONBOARD_SESSION',
RESUME_SLIDE = 'RESUME_SLIDE',
DECREMENT_SLIDE = 'DECREMENT_SLIDE',
INCREMENT_SLIDE = 'INCREMENT_SLIDE'
}
2 changes: 2 additions & 0 deletions common/actions/onboardStatus/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './actionTypes';
export * from './actionCreators';
10 changes: 9 additions & 1 deletion common/actions/transaction/actionCreators/network.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {
TypeKeys,
EstimateGasFailedAction,
EstimateGasRequestedAction,
TypeKeys,
EstimateGasTimeoutAction,
EstimateGasSucceededAction,
GetFromRequestedAction,
GetFromSucceededAction,
Expand Down Expand Up @@ -29,6 +30,11 @@ const estimateGasFailed = (): EstimateGasFailedAction => ({
type: TypeKeys.ESTIMATE_GAS_FAILED
});

type TEstimateGasTimedout = typeof estimateGasTimedout;
const estimateGasTimedout = (): EstimateGasTimeoutAction => ({
type: TypeKeys.ESTIMATE_GAS_TIMEDOUT
});

type TGetFromRequested = typeof getFromRequested;
const getFromRequested = (): GetFromRequestedAction => ({
type: TypeKeys.GET_FROM_REQUESTED
Expand Down Expand Up @@ -63,6 +69,7 @@ const getNonceFailed = (): GetNonceFailedAction => ({
export {
estimateGasRequested,
estimateGasFailed,
estimateGasTimedout,
estimateGasSucceeded,
getFromRequested,
getFromSucceeded,
Expand All @@ -73,6 +80,7 @@ export {
TEstimateGasRequested,
TEstimateGasFailed,
TEstimateGasSucceeded,
TEstimateGasTimedout,
TGetFromRequested,
TGetFromSucceeded,
TGetNonceRequested,
Expand Down
1 change: 0 additions & 1 deletion common/actions/transaction/actionTypes/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ interface SetToFieldAction {
payload: {
raw: string;
value: Address | null;
error?: string | null;
};
}

Expand Down
1 change: 0 additions & 1 deletion common/actions/transaction/actionTypes/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ interface SetTokenToMetaAction {
payload: {
raw: string;
value: Address | null;
error?: string | null;
};
}

Expand Down
Loading

0 comments on commit 93852bb

Please sign in to comment.