Skip to content

Commit

Permalink
[WIP][UPDATE] 1.0.0-rc.4 (#643)
Browse files Browse the repository at this point in the history
* chore(package): update electron to version 2.0.8

* [FEATURE] Use network specific storage for transaction cache.

* Move switching provider to TimeNodeStore

* [FIX] Mainnet DAY ABIs (#591)

* Set a proper ABI for the contract DAY token

* DAY token abi is same for all networks

* [BUGFIX] Transaction Cache wrong transactions. (#599)

* Enable provider change notification

* Stop timenode when swithcing providers

* Update snapshots

* chore(package): update style-loader to version 0.23.0 (#588)

* chore(package): update mobx to version 5.1.0 (#579)

* Start scanning after restart (#604)

* Disable faucet on the mainnet (#603)

* Disable faucet on the mainnet

* Use const netId

* chore(package): update eslint-config-standard to version 12.0.0 (#605)

* chore(package): update eslint-plugin-standard to version 4.0.0 (#602)

* chore(package): update concurrently to version 4.0.1 (#607)

Closes #571

* Update enzyme to the latest version 🚀 (#574)

* chore(package): update enzyme to version 3.5.0

* chore(package): update enzyme-adapter-react-16 to version 1.3.0

* chore(package): update eslint-plugin-promise to version 4.0.0 (#542)

* chore(package): update eslint-plugin-react to version 7.11.1 (#609)

Closes #514

* Include TimeNode-specific provider when checking for active timenodes counter

* [FIX] DAY token balance inconsistencies (#613)

* Fix wrong network being sent to worker

* Fix failing tests

* Update package.json version

* [FIX] DAY balance check (#619)

* Fix checking DAY balance

* Change stats and network info fetching logic

* Review changes

* Move wallet unlock logic from view to store

* Show info that analytics will be shown after the TimeNode has been unlocked

* [BUGFIX] Fix transactions not loading on Ropsten. (#621)

* Update README.md

* [FEATURE] Open external links in OS browser in Electron. (#622)

* Only send active timenode when scanning started (#623)

* chore(package): update enzyme-adapter-react-16 to version 1.3.1 (#625)

* [FEATURE] Store cache in IndexedDB instead of Local Storage. (#626)

* Electron: About (#627)

* Add about screen

* Override appName

* Add version to menu.

* [FEATURE] Apply DRY principle to getting web3 provider. (#629)

* chore(package): update webpack to version 4.17.2 (#633)

* stop abusing nodes and stats

* make the start sequence async

* remove unnecesasry checks

* remove console.log

* rm trailing spaces

* Predefined tokens on mainnet (#641)

* chore(package): update mobx-react to version 5.2.6 (#636)

* chore(package): update bluebird to version 3.5.2 (#632)

*  chore(package): Greenkeeper/monorepo.enzyme 1.5.0 (#644)

* chore(package): update enzyme to version 3.6.0

Closes #634

* chore(package): update enzyme-adapter-react-16 to version 1.5.0

Closes #634

* chore(package): update autoprefixer to version 9.1.5 (#645)

Closes #635

* [FEATURE] Improved Dashboard (#638)

* Initial dash

* Add pagination, improve style.scss

* Add separate component for actions table

* Add pagination

* Exact version

* Remove zombie code

* Rename concatActions to combineActions for clarity

* [FIX][TimeNode] Miscellaneous Fixes (#647)

* Fix Actions table column widths, fix pagination ... linking nowhere

* Margins improvement

* Only show "Showing actions: 1-100/500" when there are some actions

* Fix clearing stats event not emitted

* [FIX] TimeMint Check (#648)

* Fix timemint check

* Init to null

* 1.0.0-rc.4

* chore(package): update electron-builder to version 20.28.4 (#642)

* chore(package): update browserslist to version 4.1.1 (#639)

* chore(package): update webpack-dev-server to version 3.1.7 (#615)

* chore(package): update babel-eslint to version 9.0.0 (#590)

* Merge remote-tracking branch 'origin/master' into develop

* Fixes an issue with exports failing on tests (#650)

* Remove duplicate method.

* [FIX] Dashboard links on Electron (#649)

* Merge 'master' into 'develop' fix (#651)

* Update react to the latest version 🚀 (#652)

* chore(package): update react to version 16.5.0

* chore(package): update react-dom to version 16.5.0

* chore(package): update react-test-renderer to version 16.5.0

* [FIX] Misc fixes (#657)

* Fix error that uses checked attr without onClick

* Match color of the pagination selected pagae

* Only show pagination when there is more than 1 page

* Rename TimeNodeStatistics file to TimeNodeDashboard

* Fix resetting stats when detaching the wallet

* chore(package): update @ethereum-alarm-clock/timenode-core to version 5.2.0 (#659)

* reordEvent (#658)
  • Loading branch information
adibas03 authored and josipbagaric committed Sep 7, 2018
1 parent 7b7e73f commit a27cae5
Show file tree
Hide file tree
Showing 40 changed files with 2,051 additions and 2,067 deletions.
4 changes: 4 additions & 0 deletions __tests__/App.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ScheduleStore from '../app/stores/ScheduleStore';
import DateTimeValidator from '../app/stores/DateTimeValidatorStore';
import LocalStorageService from '../app/services/storage';
import LocalStorageMock from '../__mocks__/LocalStorageMock';
import TokenHelper from '../app/services/token-helper';

momentDurationFormatSetup(moment);

Expand Down Expand Up @@ -175,13 +176,16 @@ describe('App', () => {

const dateTimeValidatorStore = new DateTimeValidator();

const tokenHelper = new TokenHelper(web3Service);

const injectables = {
dateTimeValidatorStore,
eacService,
featuresService,
keenStore,
scheduleStore,
storageService,
tokenHelper,
transactionStore,
timeNodeStore,
web3Service
Expand Down
3 changes: 3 additions & 0 deletions __tests__/TransactionDetails.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Web3Service from '../app/services/web3';
import BigNumber from 'bignumber.js';
import TransactionDetails from '../app/components/TransactionScanner/TransactionDetails';
import { TransactionStore } from '../app/stores/TransactionStore';
import TokenHelper from '../app/services/token-helper';

describe('TransactionDetails', () => {
it('correctly renders', async () => {
Expand Down Expand Up @@ -53,9 +54,11 @@ describe('TransactionDetails', () => {
};

const transactionStore = new TransactionStore(eacService, web3Service);
const tokenHelper = new TokenHelper(web3Service);

const injectables = {
eacService,
tokenHelper,
transactionStore,
web3Service
};
Expand Down
6 changes: 3 additions & 3 deletions __tests__/ValueDisplay.unit.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import renderer from 'react-test-renderer';
import { ValueDisplay } from '../app/components/Common/ValueDisplay';
import { ValueDisplay } from '../app/components/Common';
import { Provider } from 'mobx-react';
import Web3Service from '../app/services/web3';
import BigNumber from 'bignumber.js';
Expand All @@ -26,7 +26,7 @@ describe('ValueDisplay', () => {
let mockedRender = renderer.create(
<Provider {...injectables}>
<ValueDisplay priceInWei={new BigNumber(bignumber)} />
</Provider>,
</Provider>
);

let tree = mockedRender.toJSON();
Expand All @@ -35,4 +35,4 @@ describe('ValueDisplay', () => {
expect(tree).toBe(display);
}
});
});
});
36 changes: 33 additions & 3 deletions app/components/Common/ValueDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,46 @@ import { Component } from 'react';
import PropTypes from 'prop-types';
import { inject } from 'mobx-react';

const ETHER_UNITS_VALUES_MAPPING = {
WEI: 1,
MWEI: 1000000,
ETH: 1000000000000000000
};

@inject('web3Service')
export class ValueDisplay extends Component {
class ValueDisplay extends Component {
render() {
const { priceInWei } = this.props;

if (!priceInWei) {
return null;
}

return this.props.web3Service.humanizeCurrencyDisplay(priceInWei);
return this._humanizeCurrencyDisplay(priceInWei);
}

/**
* @private
*/
_humanizeCurrencyDisplay(priceInWei) {
let unit = 'ETH';

if (!priceInWei) {
return null;
}

const priceAsNumber = priceInWei.toNumber();

let display = priceAsNumber;

if (priceAsNumber < ETHER_UNITS_VALUES_MAPPING.MWEI && priceAsNumber > 0) {
unit = 'WEI';
} else {
display = priceInWei.div(ETHER_UNITS_VALUES_MAPPING.ETH).toFixed();
unit = 'ETH';
}

return `${display} ${unit}`;
}
}

Expand All @@ -20,4 +50,4 @@ ValueDisplay.propTypes = {
web3Service: PropTypes.any
};

export default ValueDisplay;
export { ValueDisplay };
2 changes: 1 addition & 1 deletion app/components/Common/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export { Step } from './Step';
export { InputField } from './InputField';
export { ScheduleWizard } from './ScheduleWizard';
export { AwaitingMining } from './AwaitingMining';
export { Faucet } from './Faucet';
export { URLNotFound } from './URLNotFound';
export { ValueDisplay } from './ValueDisplay';
15 changes: 8 additions & 7 deletions app/components/ScheduleWizard/InfoSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Alert from '../Common/Alert';
import { TOKEN_ADDRESSES, PREDEFINED_TOKENS_FOR_NETWORK } from '../../config/web3Config';
import Select from '../Common/Select';

@inject('tokenHelper')
@inject('scheduleStore')
@inject('web3Service')
@observer
Expand Down Expand Up @@ -87,9 +88,9 @@ class InfoSettings extends AbstractSetting {

async calculateTokenTransferMinimumGasandData() {
const {
web3Service,
web3Service: { web3 },
scheduleStore
scheduleStore,
tokenHelper
} = this.props;
const isAddress = this.ethereumAddressValidator().validator;
const minEstimate = 21000;
Expand All @@ -100,13 +101,13 @@ class InfoSettings extends AbstractSetting {
isAddress(scheduleStore.receiverAddress, web3) == 0
) {
try {
estimate = await web3Service.estimateTokenTransfer(
estimate = await tokenHelper.estimateTokenTransfer(
scheduleStore.toAddress,
scheduleStore.receiverAddress,
scheduleStore.tokenToSend * 10 ** this.state.token.decimals
);
estimate = estimate + 20000;
scheduleStore.tokenData = await web3Service.getTokenTransferData(
scheduleStore.tokenData = await tokenHelper.getTokenTransferData(
scheduleStore.toAddress,
scheduleStore.receiverAddress,
scheduleStore.tokenToSend * 10 ** this.state.token.decimals
Expand Down Expand Up @@ -147,13 +148,13 @@ class InfoSettings extends AbstractSetting {
}

async getTokenDetails(onlyBalance = false) {
const { web3Service, scheduleStore } = this.props;
const { scheduleStore, tokenHelper } = this.props;
if (!onlyBalance) {
const tokenDetails = await web3Service.fetchTokenDetails(scheduleStore.toAddress);
const tokenDetails = await tokenHelper.fetchTokenDetails(scheduleStore.toAddress);
this.setState({ token: tokenDetails });
scheduleStore.tokenSymbol = tokenDetails.symbol;
}
let _balance = await web3Service.fetchTokenBalance(scheduleStore.toAddress);
let _balance = await tokenHelper.fetchTokenBalance(scheduleStore.toAddress);
_balance = _balance == '-' ? _balance : Number(_balance / 10 ** this.state.token.decimals);
const balance = new RegExp('^\\d+\\.?\\d{8,}$').test(_balance) ? _balance.toFixed(8) : _balance;
this.setState({ token: Object.assign(this.state.token, { balance }) });
Expand Down
12 changes: 9 additions & 3 deletions app/components/ScheduleWizard/ScheduleRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@ import React from 'react';
import { Route } from 'react-router-dom';
import { inject, observer } from 'mobx-react';
import MetamaskComponent from '../Common/MetamaskComponent';
import ScheduleWizard from './ScheduleWizard';
import { ScheduleWizard } from './ScheduleWizard';

@inject('web3Service')
@observer
export class ScheduleRoute extends MetamaskComponent {
class ScheduleRoute extends MetamaskComponent {
render() {
return (
<div className="container padding-25 sm-padding-10">
<h1 className="view-title">Schedule Transaction</h1>
<Route render={routeProps => <ScheduleWizard {...Object.assign({ isWeb3Usable: this.isWeb3Usable }, routeProps)} />} />
<Route
render={routeProps => (
<ScheduleWizard {...Object.assign({ isWeb3Usable: this.isWeb3Usable }, routeProps)} />
)}
/>
</div>
);
}
}

export { ScheduleRoute };
2 changes: 1 addition & 1 deletion app/components/ScheduleWizard/ScheduleWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,4 +428,4 @@ ScheduleWizard.propTypes = {
isWeb3Usable: PropTypes.any
};

export default ScheduleWizard;
export { ScheduleWizard };
3 changes: 2 additions & 1 deletion app/components/TimeNode/Modals/TimeNodeDetachModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ class TimeNodeDetachModal extends Component {

detachWallet() {
const { timeNodeStore } = this.props;
timeNodeStore.detachWallet();
timeNodeStore.clearStats();
timeNodeStore.updateStats();
timeNodeStore.detachWallet();
timeNodeStore.unlocked = false;
}

Expand Down
Loading

0 comments on commit a27cae5

Please sign in to comment.