merge master into jr-use-badge-reg

This commit is contained in:
Jannis R 2016-12-09 13:14:35 +01:00
commit 3dc943e854
No known key found for this signature in database
GPG Key ID: 0FE83946296A88A5
16 changed files with 63 additions and 268 deletions

2
Cargo.lock generated
View File

@ -1271,7 +1271,7 @@ dependencies = [
[[package]] [[package]]
name = "parity-ui-precompiled" name = "parity-ui-precompiled"
version = "1.4.0" version = "1.4.0"
source = "git+https://github.com/ethcore/js-precompiled.git#a59b62ecec8773715d1db7e070bbbe5443eb7378" source = "git+https://github.com/ethcore/js-precompiled.git#1bf7160f6c8f25353d790dbd0935560d3d395727"
dependencies = [ dependencies = [
"parity-dapps-glue 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-dapps-glue 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]

View File

@ -7,6 +7,7 @@
"transform-runtime", "transform-runtime",
"transform-decorators-legacy", "transform-decorators-legacy",
"transform-class-properties", "transform-class-properties",
"transform-object-rest-spread",
"lodash" "lodash"
], ],
"retainLines": true, "retainLines": true,

View File

@ -1,6 +1,6 @@
{ {
"name": "parity.js", "name": "parity.js",
"version": "0.2.99", "version": "0.2.102",
"main": "release/index.js", "main": "release/index.js",
"jsnext:main": "src/index.js", "jsnext:main": "src/index.js",
"author": "Parity Team <admin@parity.io>", "author": "Parity Team <admin@parity.io>",
@ -48,25 +48,26 @@
}, },
"devDependencies": { "devDependencies": {
"babel-cli": "6.18.0", "babel-cli": "6.18.0",
"babel-core": "6.18.2", "babel-core": "6.20.0",
"babel-eslint": "7.1.1", "babel-eslint": "7.1.1",
"babel-loader": "6.2.8", "babel-loader": "6.2.8",
"babel-plugin-lodash": "3.2.10", "babel-plugin-lodash": "3.2.10",
"babel-plugin-transform-class-properties": "6.19.0", "babel-plugin-transform-class-properties": "6.18.0",
"babel-plugin-transform-decorators-legacy": "1.3.4", "babel-plugin-transform-decorators-legacy": "1.3.4",
"babel-plugin-transform-object-rest-spread": "6.20.2",
"babel-plugin-transform-react-remove-prop-types": "0.2.11", "babel-plugin-transform-react-remove-prop-types": "0.2.11",
"babel-plugin-transform-runtime": "6.15.0", "babel-plugin-transform-runtime": "6.15.0",
"babel-polyfill": "6.16.0", "babel-polyfill": "6.20.0",
"babel-preset-es2015": "6.18.0", "babel-preset-es2015": "6.18.0",
"babel-preset-es2015-rollup": "1.2.0",
"babel-preset-es2016": "6.16.0", "babel-preset-es2016": "6.16.0",
"babel-preset-es2017": "6.16.0", "babel-preset-es2017": "6.16.0",
"babel-preset-react": "6.16.0", "babel-preset-react": "6.16.0",
"babel-preset-stage-0": "6.16.0", "babel-preset-stage-0": "6.16.0",
"babel-register": "6.18.0", "babel-register": "6.18.0",
"babel-runtime": "6.18.0", "babel-runtime": "6.20.0",
"chai": "3.5.0", "chai": "3.5.0",
"chai-enzyme": "0.6.1", "chai-enzyme": "0.6.1",
"circular-dependency-plugin": "2.0.0",
"copy-webpack-plugin": "4.0.1", "copy-webpack-plugin": "4.0.1",
"core-js": "2.4.1", "core-js": "2.4.1",
"coveralls": "2.11.15", "coveralls": "2.11.15",

View File

@ -1 +1 @@
// test script 4 // test script 6

View File

@ -262,12 +262,11 @@ export default class Contract {
} }
const options = this._getFilterOptions(event, _options); const options = this._getFilterOptions(event, _options);
options.fromBlock = 0;
options.toBlock = 'latest';
return this._api.eth return this._api.eth
.getLogs({ .getLogs(options)
fromBlock: 0,
toBlock: 'latest',
...options
})
.then((logs) => this.parseEventLogs(logs)); .then((logs) => this.parseEventLogs(logs));
} }

View File

@ -17,7 +17,8 @@
import React, { Component, PropTypes } from 'react'; import React, { Component, PropTypes } from 'react';
import { MenuItem } from 'material-ui'; import { MenuItem } from 'material-ui';
import { AddressSelect, Form, Input, InputAddressSelect, Select } from '~/ui'; import { AddressSelect, Form, Input, Select, TypedInput } from '~/ui';
import { parseAbiType } from '~/util/abi';
import styles from '../executeContract.css'; import styles from '../executeContract.css';
@ -74,7 +75,7 @@ export default class DetailsStep extends Component {
const functions = contract.functions const functions = contract.functions
.filter((func) => !func.constant) .filter((func) => !func.constant)
.sort((a, b) => a.name.localeCompare(b.name)) .sort((a, b) => (a.name || '').localeCompare(b.name || ''))
.map((func) => { .map((func) => {
const params = (func.abi.inputs || []) const params = (func.abi.inputs || [])
.map((input, index) => { .map((input, index) => {
@ -125,56 +126,22 @@ export default class DetailsStep extends Component {
} }
return (func.abi.inputs || []).map((input, index) => { return (func.abi.inputs || []).map((input, index) => {
const onChange = (event, value) => onValueChange(event, index, value); const onChange = (value) => onValueChange(null, index, value);
const onSelect = (event, _index, value) => onValueChange(event, index, value);
const onSubmit = (value) => onValueChange(null, index, value);
const label = `${input.name}: ${input.type}`; const label = `${input.name}: ${input.type}`;
let inputbox;
switch (input.type) {
case 'address':
inputbox = (
<InputAddressSelect
accounts={ accounts }
editing
label={ label }
value={ values[index] }
error={ valuesError[index] }
onChange={ onChange } />
);
break;
case 'bool':
const boolitems = ['false', 'true'].map((bool) => {
return (
<MenuItem
key={ bool }
value={ bool }
label={ bool }>{ bool }</MenuItem>
);
});
inputbox = (
<Select
label={ label }
value={ values[index] ? 'true' : 'false' }
error={ valuesError[index] }
onChange={ onSelect }>{ boolitems }</Select>
);
break;
default:
inputbox = (
<Input
label={ label }
value={ values[index] }
error={ valuesError[index] }
onSubmit={ onSubmit } />
);
}
return ( return (
<div className={ styles.funcparams } key={ index }> <div
{ inputbox } key={ `${index}_${input.name || ''}` }
className={ styles.funcparams }
>
<TypedInput
label={ label }
value={ values[index] }
error={ valuesError[index] }
onChange={ onChange }
accounts={ accounts }
param={ parseAbiType(input.type) }
/>
</div> </div>
); );
}); });

View File

@ -23,6 +23,7 @@ import ContentClear from 'material-ui/svg-icons/content/clear';
import { BusyStep, CompletedStep, Button, IdentityIcon, Modal, TxHash } from '~/ui'; import { BusyStep, CompletedStep, Button, IdentityIcon, Modal, TxHash } from '~/ui';
import { MAX_GAS_ESTIMATION } from '../../util/constants'; import { MAX_GAS_ESTIMATION } from '../../util/constants';
import { validateAddress, validateUint } from '../../util/validation'; import { validateAddress, validateUint } from '../../util/validation';
import { parseAbiType } from '~/util/abi';
import DetailsStep from './DetailsStep'; import DetailsStep from './DetailsStep';
@ -66,7 +67,7 @@ class ExecuteContract extends Component {
const { contract } = this.props; const { contract } = this.props;
const functions = contract.functions const functions = contract.functions
.filter((func) => !func.constant) .filter((func) => !func.constant)
.sort((a, b) => a.name.localeCompare(b.name)); .sort((a, b) => (a.name || '').localeCompare(b.name || ''));
this.onFuncChange(null, functions[0]); this.onFuncChange(null, functions[0]);
} }
@ -111,7 +112,7 @@ class ExecuteContract extends Component {
<Button <Button
key='postTransaction' key='postTransaction'
label='post transaction' label='post transaction'
disabled={ sending || hasError } disabled={ !!(sending || hasError) }
icon={ <IdentityIcon address={ fromAddress } button /> } icon={ <IdentityIcon address={ fromAddress } button /> }
onClick={ this.postTransaction } /> onClick={ this.postTransaction } />
]; ];
@ -174,23 +175,9 @@ class ExecuteContract extends Component {
} }
onFuncChange = (event, func) => { onFuncChange = (event, func) => {
const values = func.inputs.map((input) => { const values = (func.abi.inputs || []).map((input) => {
switch (input.kind.type) { const parsedType = parseAbiType(input.type);
case 'address': return parsedType.default;
return '0x';
case 'bool':
return false;
case 'bytes':
return '0x';
case 'uint':
return '0';
default:
return '';
}
}); });
this.setState({ this.setState({

View File

@ -92,7 +92,7 @@ function findImports (path) {
return { error: 'File not found' }; return { error: 'File not found' };
} }
function compile (data) { function compile (data, optimized = 1) {
const { sourcecode, build } = data; const { sourcecode, build } = data;
const { longVersion } = build; const { longVersion } = build;
@ -109,7 +109,7 @@ function compile (data) {
'': sourcecode '': sourcecode
}; };
const compiled = compiler.compile({ sources: input }, 0, findImports); const compiled = compiler.compile({ sources: input }, optimized, findImports);
self.lastCompile = { self.lastCompile = {
version: longVersion, result: compiled, version: longVersion, result: compiled,

View File

@ -58,7 +58,7 @@ function modifyOperation (method, address, owner, operation) {
contract.instance[method] contract.instance[method]
.estimateGas(options, values) .estimateGas(options, values)
.then((gas) => { .then((gas) => {
options.gas = gas; options.gas = gas.mul(1.2);
return contract.instance[method].postTransaction(options, values); return contract.instance[method].postTransaction(options, values);
}) })
.then((requestId) => { .then((requestId) => {

View File

@ -15,6 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>. // along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react'; import React, { Component, PropTypes } from 'react';
import { uniq } from 'lodash';
import { Container } from '~/ui'; import { Container } from '~/ui';
@ -38,7 +39,10 @@ export default class Events extends Component {
return null; return null;
} }
const list = events.map((event) => { const eventsKey = uniq(events.map((e) => e.key));
const list = eventsKey.map((eventKey) => {
const event = events.find((e) => e.key === eventKey);
return ( return (
<Event <Event
key={ event.key } key={ event.key }

View File

@ -1,55 +0,0 @@
/* Copyright 2015, 2016 Ethcore (UK) Ltd.
/* This file is part of Parity.
/*
/* Parity is free software: you can redistribute it and/or modify
/* it under the terms of the GNU General Public License as published by
/* the Free Software Foundation, either version 3 of the License, or
/* (at your option) any later version.
/*
/* Parity is distributed in the hope that it will be useful,
/* but WITHOUT ANY WARRANTY; without even the implied warranty of
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/* GNU General Public License for more details.
/*
/* You should have received a copy of the GNU General Public License
/* along with Parity. If not, see <http://www.gnu.org/licenses/>.
*/
/* todo [adgo] - make local */
:global .transition-appear {
opacity: 0.01;
}
:global .transition-appear.transition-appear-active {
opacity: 1;
transition: opacity .3s ease-in-out;
}
:global .transition-enter {
opacity: 0.01;
}
:global .transition-enter.transition-enter-active {
opacity: 1;
transition: opacity .3s ease-in-out;
}
:global .transition-leave {
opacity: 1;
}
:global .transition-leave.transition-leave-active {
opacity: 0.01;
transition: opacity .3s ease-in-out;
}
:global .absoluteAnimationContainer {
position: relative;
}
:global .absoluteAnimationContainer > .transition-leave {
position: absolute;
top: 0;
left: 0;
right: 0;
width: 100%;
}

View File

@ -1,28 +0,0 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component } from 'react';
import AnimateChildren from './children';
export default Wrapped => class Animated extends Component {
render () {
return (
<AnimateChildren>
<Wrapped { ...this.props } />
</AnimateChildren>
);
}
};

View File

@ -1,63 +0,0 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import { isReactComponent } from '../../util/react';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import './AnimateChildren.css';
export default class AnimateChildren extends Component {
render () {
const className = this.props.absolute ? 'absoluteAnimationContainer' : '';
return (
<ReactCSSTransitionGroup
component='div'
className={ className }
transitionName='transition'
transitionAppear
transitionAppearTimeout={ 0 }
transitionLeaveTimeout={ 0 }
transitionEnterTimeout={ 0 }
>
{ this.renderChildren() }
</ReactCSSTransitionGroup>
);
}
renderChildren () {
const { children, isView } = this.props;
if (isView) {
return React.cloneElement(this.props.children, {
key: this.props.pathname
});
}
if (isReactComponent(children)) {
return React.cloneElement(this.props.children, { ...this.props });
}
return children;
}
static propTypes = {
children: PropTypes.any.isRequired,
pathname: PropTypes.string,
isView: PropTypes.bool,
absolute: PropTypes.bool
}
}

View File

@ -1,17 +0,0 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export default from './Animated';

View File

@ -15,7 +15,6 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>. // along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react'; import React, { Component, PropTypes } from 'react';
import AnimateChildren from '../../components-compositors/Animated/children';
import Call from '../Call'; import Call from '../Call';
import CallsToolbar from '../CallsToolbar'; import CallsToolbar from '../CallsToolbar';
import styles from './Calls.css'; import styles from './Calls.css';
@ -73,13 +72,11 @@ export default class Calls extends Component {
} }
return ( return (
<AnimateChildren> <div { ...this._test('empty-wrapper') }>
<div { ...this._test('empty-wrapper') }> <h3 className={ styles.historyInfo } { ...this._test('empty') }>
<h3 className={ styles.historyInfo } { ...this._test('empty') }> Fire up some calls and the results will be here.
Fire up some calls and the results will be here. </h3>
</h3> </div>
</div>
</AnimateChildren>
); );
} }
@ -90,17 +87,13 @@ export default class Calls extends Component {
return; return;
} }
return ( return calls.map((call, idx) => (
<AnimateChildren> <Call
{ calls.map((call, idx) => ( key={ calls.length - idx }
<Call call={ call }
key={ calls.length - idx } setActiveCall={ this.setActiveCall }
call={ call } />
setActiveCall={ this.setActiveCall } ));
/>
)) }
</AnimateChildren>
);
} }
clearActiveCall = () => { clearActiveCall = () => {

View File

@ -23,6 +23,7 @@ const postcssImport = require('postcss-import');
const postcssNested = require('postcss-nested'); const postcssNested = require('postcss-nested');
const postcssVars = require('postcss-simple-vars'); const postcssVars = require('postcss-simple-vars');
const rucksack = require('rucksack-css'); const rucksack = require('rucksack-css');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const ENV = process.env.NODE_ENV || 'development'; const ENV = process.env.NODE_ENV || 'development';
const isProd = ENV === 'production'; const isProd = ENV === 'production';
@ -102,7 +103,12 @@ function getPlugins (_isProd = isProd) {
} }
}), }),
new webpack.optimize.OccurrenceOrderPlugin(!_isProd) new webpack.optimize.OccurrenceOrderPlugin(!_isProd),
new CircularDependencyPlugin({
exclude: /node_modules/,
failOnError: true
})
]; ];
if (_isProd) { if (_isProd) {