Skip to content

Commit 93852bb

Browse files
authored
Merge pull request #832 from MyEtherWallet/develop
Tag release 0.1.0
2 parents af4d415 + c2241dd commit 93852bb

File tree

289 files changed

+7543
-2875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+7543
-2875
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ before_install:
1414
- export DISPLAY=:99.0
1515
- sh -e /etc/init.d/xvfb start
1616
- docker pull dternyak/eth-priv-to-addr:latest
17-
17+
- sudo apt-get install libusb-1.0
18+
1819
install:
1920
- npm install --silent
2021

common/Root.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import BroadcastTx from 'containers/Tabs/BroadcastTx';
1313
import ErrorScreen from 'components/ErrorScreen';
1414
import PageNotFound from 'components/PageNotFound';
1515
import LogOutPrompt from 'components/LogOutPrompt';
16-
import { Aux } from 'components/ui';
1716
import { Store } from 'redux';
17+
import { pollOfflineStatus } from 'actions/config';
1818
import { AppState } from 'reducers';
1919

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

33+
public componentDidMount() {
34+
this.props.store.dispatch(pollOfflineStatus());
35+
}
36+
3337
public componentDidCatch(error: Error) {
3438
this.setState({ error });
3539
}
@@ -70,11 +74,11 @@ export default class Root extends Component<Props, State> {
7074
return (
7175
<Provider store={store} key={Math.random()}>
7276
<Router key={Math.random()}>
73-
<Aux>
77+
<React.Fragment>
7478
{routes}
7579
<LegacyRoutes />
7680
<LogOutPrompt />
77-
</Aux>
81+
</React.Fragment>
7882
</Router>
7983
</Provider>
8084
);

common/actions/config/actionCreators.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import * as interfaces from './actionTypes';
22
import { TypeKeys } from './constants';
3-
import { NodeConfig, CustomNodeConfig, CustomNetworkConfig } from 'config/data';
3+
import { NodeConfig, CustomNodeConfig, NetworkConfig, CustomNetworkConfig } from 'config/data';
44

5-
export type TForceOfflineConfig = typeof forceOfflineConfig;
6-
export function forceOfflineConfig(): interfaces.ForceOfflineAction {
5+
export type TToggleOfflineConfig = typeof toggleOfflineConfig;
6+
export function toggleOfflineConfig(): interfaces.ToggleOfflineAction {
77
return {
8-
type: TypeKeys.CONFIG_FORCE_OFFLINE
8+
type: TypeKeys.CONFIG_TOGGLE_OFFLINE
99
};
1010
}
1111

12-
export type TToggleOfflineConfig = typeof toggleOfflineConfig;
13-
export function toggleOfflineConfig(): interfaces.ToggleOfflineAction {
12+
export type TToggleAutoGasLimit = typeof toggleAutoGasLimit;
13+
export function toggleAutoGasLimit(): interfaces.ToggleAutoGasLimitAction {
1414
return {
15-
type: TypeKeys.CONFIG_TOGGLE_OFFLINE
15+
type: TypeKeys.CONFIG_TOGGLE_AUTO_GAS_LIMIT
1616
};
1717
}
1818

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

2727
export type TChangeNode = typeof changeNode;
28-
export function changeNode(nodeSelection: string, node: NodeConfig): interfaces.ChangeNodeAction {
28+
export function changeNode(
29+
nodeSelection: string,
30+
node: NodeConfig,
31+
network: NetworkConfig
32+
): interfaces.ChangeNodeAction {
2933
return {
3034
type: TypeKeys.CONFIG_NODE_CHANGE,
31-
payload: { nodeSelection, node }
35+
payload: { nodeSelection, node, network }
3236
};
3337
}
3438

common/actions/config/actionTypes.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { TypeKeys } from './constants';
2-
import { NodeConfig, CustomNodeConfig, CustomNetworkConfig } from 'config/data';
2+
import { NodeConfig, CustomNodeConfig, NetworkConfig, CustomNetworkConfig } from 'config/data';
33

44
/*** Toggle Offline ***/
55
export interface ToggleOfflineAction {
66
type: TypeKeys.CONFIG_TOGGLE_OFFLINE;
77
}
88

9-
/*** Force Offline ***/
10-
export interface ForceOfflineAction {
11-
type: TypeKeys.CONFIG_FORCE_OFFLINE;
9+
export interface ToggleAutoGasLimitAction {
10+
type: TypeKeys.CONFIG_TOGGLE_AUTO_GAS_LIMIT;
1211
}
1312

1413
/*** Change Language ***/
@@ -24,6 +23,7 @@ export interface ChangeNodeAction {
2423
payload: {
2524
nodeSelection: string;
2625
node: NodeConfig;
26+
network: NetworkConfig;
2727
};
2828
}
2929

@@ -78,8 +78,8 @@ export type ConfigAction =
7878
| ChangeNodeAction
7979
| ChangeLanguageAction
8080
| ToggleOfflineAction
81+
| ToggleAutoGasLimitAction
8182
| PollOfflineStatus
82-
| ForceOfflineAction
8383
| ChangeNodeIntentAction
8484
| AddCustomNodeAction
8585
| RemoveCustomNodeAction

common/actions/config/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export enum TypeKeys {
33
CONFIG_NODE_CHANGE = 'CONFIG_NODE_CHANGE',
44
CONFIG_NODE_CHANGE_INTENT = 'CONFIG_NODE_CHANGE_INTENT',
55
CONFIG_TOGGLE_OFFLINE = 'CONFIG_TOGGLE_OFFLINE',
6-
CONFIG_FORCE_OFFLINE = 'CONFIG_FORCE_OFFLINE',
6+
CONFIG_TOGGLE_AUTO_GAS_LIMIT = 'CONFIG_TOGGLE_AUTO_GAS_LIMIT',
77
CONFIG_POLL_OFFLINE_STATUS = 'CONFIG_POLL_OFFLINE_STATUS',
88
CONFIG_ADD_CUSTOM_NODE = 'CONFIG_ADD_CUSTOM_NODE',
99
CONFIG_REMOVE_CUSTOM_NODE = 'CONFIG_REMOVE_CUSTOM_NODE',

common/actions/ens/actionCreators.ts

-22
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './resolveDomain';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import * as ActionTypes from '../actionTypes';
2+
import { TypeKeys } from '../constants';
3+
import { DomainRequest } from 'libs/ens';
4+
import { ResolveDomainCached } from 'actions/ens';
5+
6+
export type TResolveDomainRequested = typeof resolveDomainRequested;
7+
export const resolveDomainRequested = (domain: string): ActionTypes.ResolveDomainRequested => ({
8+
type: TypeKeys.ENS_RESOLVE_DOMAIN_REQUESTED,
9+
payload: { domain }
10+
});
11+
12+
export const resolveDomainCached = (
13+
payload: ResolveDomainCached['payload']
14+
): ResolveDomainCached => ({
15+
type: TypeKeys.ENS_RESOLVE_DOMAIN_CACHED,
16+
payload
17+
});
18+
19+
export type TResolveDomainSucceeded = typeof resolveDomainSucceeded;
20+
export const resolveDomainSucceeded = (
21+
domain: string,
22+
domainData: DomainRequest
23+
): ActionTypes.ResolveDomainSucceeded => ({
24+
type: TypeKeys.ENS_RESOLVE_DOMAIN_SUCCEEDED,
25+
payload: { domain, domainData }
26+
});
27+
28+
export type TResolveDomainFailed = typeof resolveDomainFailed;
29+
export const resolveDomainFailed = (
30+
domain: string,
31+
error: Error
32+
): ActionTypes.ResolveDomainFailed => ({
33+
type: TypeKeys.ENS_RESOLVE_DOMAIN_FAILED,
34+
payload: { domain, error }
35+
});

common/actions/ens/actionTypes.ts

-17
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { ResolveDomainAction } from './resolveDomain';
2+
3+
export * from './resolveDomain';
4+
5+
export type EnsAction = ResolveDomainAction;
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './actionTypes';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { TypeKeys } from '../constants';
2+
import { DomainRequest } from 'libs/ens';
3+
4+
export interface ResolveDomainRequested {
5+
type: TypeKeys.ENS_RESOLVE_DOMAIN_REQUESTED;
6+
payload: { domain: string };
7+
}
8+
9+
export interface ResolveDomainSucceeded {
10+
type: TypeKeys.ENS_RESOLVE_DOMAIN_SUCCEEDED;
11+
payload: { domain: string; domainData: DomainRequest };
12+
}
13+
14+
export interface ResolveDomainCached {
15+
type: TypeKeys.ENS_RESOLVE_DOMAIN_CACHED;
16+
payload: { domain: string };
17+
}
18+
19+
export interface ResolveDomainFailed {
20+
type: TypeKeys.ENS_RESOLVE_DOMAIN_FAILED;
21+
payload: { domain: string; error: Error };
22+
}
23+
24+
export type ResolveDomainAction =
25+
| ResolveDomainRequested
26+
| ResolveDomainSucceeded
27+
| ResolveDomainFailed
28+
| ResolveDomainCached;

common/actions/ens/constants.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
export const ENS_RESOLVE = 'ENS_RESOLVE';
2-
export const ENS_CACHE = 'ENS_CACHE';
1+
export enum TypeKeys {
2+
ENS_RESOLVE_DOMAIN_REQUESTED = 'ENS_RESOLVE_DOMAIN_REQUESTED',
3+
ENS_RESOLVE_DOMAIN_SUCCEEDED = 'ENS_RESOLVE_DOMAIN_SUCCEEDED',
4+
ENS_RESOLVE_DOMAIN_CACHED = 'ENS_RESOLVE_DOMAIN_CACHED',
5+
ENS_RESOLVE_DOMAIN_FAILED = 'ENS_RESOLVE_DOMAIN_FAILED'
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import * as interfaces from './actionTypes';
2+
import { TypeKeys } from './constants';
3+
4+
export type TStartOnboardSession = typeof startOnboardSession;
5+
export function startOnboardSession(): interfaces.StartOnboardSessionAction {
6+
return {
7+
type: TypeKeys.START_ONBOARD_SESSION
8+
};
9+
}
10+
11+
export type TResumeSlide = typeof resumeSlide;
12+
export function resumeSlide(slideNumber: number): interfaces.ResumeSlideAction {
13+
return {
14+
type: TypeKeys.RESUME_SLIDE,
15+
slideNumber
16+
};
17+
}
18+
19+
export type TDecrementSlide = typeof decrementSlide;
20+
export function decrementSlide(): interfaces.DecrementSlideAction {
21+
return {
22+
type: TypeKeys.DECREMENT_SLIDE
23+
};
24+
}
25+
26+
export type TIncrementSlide = typeof incrementSlide;
27+
export function incrementSlide(): interfaces.IncrementSlideAction {
28+
return {
29+
type: TypeKeys.INCREMENT_SLIDE
30+
};
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { TypeKeys } from './constants';
2+
3+
export interface StartOnboardSessionAction {
4+
type: TypeKeys.START_ONBOARD_SESSION;
5+
}
6+
7+
export interface ResumeSlideAction {
8+
type: TypeKeys.RESUME_SLIDE;
9+
slideNumber: number;
10+
}
11+
12+
export interface DecrementSlideAction {
13+
type: TypeKeys.DECREMENT_SLIDE;
14+
}
15+
16+
export interface IncrementSlideAction {
17+
type: TypeKeys.INCREMENT_SLIDE;
18+
}
19+
20+
export type OnboardStatusAction =
21+
| StartOnboardSessionAction
22+
| ResumeSlideAction
23+
| DecrementSlideAction
24+
| IncrementSlideAction;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export enum TypeKeys {
2+
START_ONBOARD_SESSION = 'START_ONBOARD_SESSION',
3+
RESUME_SLIDE = 'RESUME_SLIDE',
4+
DECREMENT_SLIDE = 'DECREMENT_SLIDE',
5+
INCREMENT_SLIDE = 'INCREMENT_SLIDE'
6+
}

common/actions/onboardStatus/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './actionTypes';
2+
export * from './actionCreators';

common/actions/transaction/actionCreators/network.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import {
2+
TypeKeys,
23
EstimateGasFailedAction,
34
EstimateGasRequestedAction,
4-
TypeKeys,
5+
EstimateGasTimeoutAction,
56
EstimateGasSucceededAction,
67
GetFromRequestedAction,
78
GetFromSucceededAction,
@@ -29,6 +30,11 @@ const estimateGasFailed = (): EstimateGasFailedAction => ({
2930
type: TypeKeys.ESTIMATE_GAS_FAILED
3031
});
3132

33+
type TEstimateGasTimedout = typeof estimateGasTimedout;
34+
const estimateGasTimedout = (): EstimateGasTimeoutAction => ({
35+
type: TypeKeys.ESTIMATE_GAS_TIMEDOUT
36+
});
37+
3238
type TGetFromRequested = typeof getFromRequested;
3339
const getFromRequested = (): GetFromRequestedAction => ({
3440
type: TypeKeys.GET_FROM_REQUESTED
@@ -63,6 +69,7 @@ const getNonceFailed = (): GetNonceFailedAction => ({
6369
export {
6470
estimateGasRequested,
6571
estimateGasFailed,
72+
estimateGasTimedout,
6673
estimateGasSucceeded,
6774
getFromRequested,
6875
getFromSucceeded,
@@ -73,6 +80,7 @@ export {
7380
TEstimateGasRequested,
7481
TEstimateGasFailed,
7582
TEstimateGasSucceeded,
83+
TEstimateGasTimedout,
7684
TGetFromRequested,
7785
TGetFromSucceeded,
7886
TGetNonceRequested,

common/actions/transaction/actionTypes/fields.ts

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ interface SetToFieldAction {
5252
payload: {
5353
raw: string;
5454
value: Address | null;
55-
error?: string | null;
5655
};
5756
}
5857

common/actions/transaction/actionTypes/meta.ts

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ interface SetTokenToMetaAction {
77
payload: {
88
raw: string;
99
value: Address | null;
10-
error?: string | null;
1110
};
1211
}
1312

0 commit comments

Comments
 (0)