From 1686d23522f8d1ddd8e984982402a67ba4ef733b Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 18 Nov 2016 19:07:13 +0100 Subject: [PATCH 01/26] Don't query chain in Signer, use Redux isTest --- .../Signer/components/Account/Account.js | 18 ++++++---- .../Account/AccountLink/AccountLink.js | 14 ++++---- .../RequestFinishedWeb3.js | 9 +++-- .../RequestPendingWeb3/RequestPendingWeb3.js | 9 +++-- .../components/SignRequest/SignRequest.js | 33 +++++++++---------- .../TransactionFinished.js | 27 +++++++-------- .../TransactionMainDetails.js | 30 +++++++++++++---- .../TransactionPending/TransactionPending.js | 21 ++---------- .../TransactionSecondaryDetails.js | 10 ++++-- .../components/TxHashLink/TxHashLink.js | 6 ++-- .../Signer/containers/Embedded/embedded.js | 10 ++++-- .../containers/RequestsPage/RequestsPage.js | 17 ++++++++-- 12 files changed, 117 insertions(+), 87 deletions(-) diff --git a/js/src/views/Signer/components/Account/Account.js b/js/src/views/Signer/components/Account/Account.js index 63a601373..b6e7f2e48 100644 --- a/js/src/views/Signer/components/Account/Account.js +++ b/js/src/views/Signer/components/Account/Account.js @@ -25,7 +25,7 @@ export default class Account extends Component { static propTypes = { className: PropTypes.string, address: PropTypes.string.isRequired, - chain: PropTypes.string.isRequired, + isTest: PropTypes.bool.isRequired, balance: PropTypes.object // eth BigNumber, not required since it mght take time to fetch }; @@ -51,11 +51,13 @@ export default class Account extends Component { } render () { - const { address, chain, className } = this.props; + const { address, isTest, className } = this.props; return (
- + @@ -74,19 +76,23 @@ export default class Account extends Component { } renderName () { - const { address } = this.props; + const { address, isTest } = this.props; const name = ; if (!name) { return ( - + [{ this.shortAddress(address) }] ); } return ( - + { name } [{ this.tinyAddress(address) }] diff --git a/js/src/views/Signer/components/Account/AccountLink/AccountLink.js b/js/src/views/Signer/components/Account/AccountLink/AccountLink.js index 4e3c0a0a9..97ff35ce9 100644 --- a/js/src/views/Signer/components/Account/AccountLink/AccountLink.js +++ b/js/src/views/Signer/components/Account/AccountLink/AccountLink.js @@ -21,7 +21,7 @@ import styles from './AccountLink.css'; export default class AccountLink extends Component { static propTypes = { - chain: PropTypes.string.isRequired, + isTest: PropTypes.bool.isRequired, address: PropTypes.string.isRequired, className: PropTypes.string, children: PropTypes.node @@ -32,15 +32,15 @@ export default class AccountLink extends Component { }; componentWillMount () { - const { address, chain } = this.props; + const { address, isTest } = this.props; - this.updateLink(address, chain); + this.updateLink(address, isTest); } componentWillReceiveProps (nextProps) { - const { address, chain } = nextProps; + const { address, isTest } = nextProps; - this.updateLink(address, chain); + this.updateLink(address, isTest); } render () { @@ -56,8 +56,8 @@ export default class AccountLink extends Component { ); } - updateLink (address, chain) { - const link = addressLink(address, chain === 'morden' || chain === 'testnet'); + updateLink (address, isTest) { + const link = addressLink(address, isTest); this.setState({ link diff --git a/js/src/views/Signer/components/RequestFinishedWeb3/RequestFinishedWeb3.js b/js/src/views/Signer/components/RequestFinishedWeb3/RequestFinishedWeb3.js index 7b30d3e93..74a20f625 100644 --- a/js/src/views/Signer/components/RequestFinishedWeb3/RequestFinishedWeb3.js +++ b/js/src/views/Signer/components/RequestFinishedWeb3/RequestFinishedWeb3.js @@ -31,14 +31,16 @@ export default class RequestFinishedWeb3 extends Component { msg: PropTypes.string, status: PropTypes.string, error: PropTypes.string, - className: PropTypes.string + className: PropTypes.string, + isTest: PropTypes.bool.isRequired } render () { - const { payload, id, result, msg, status, error, date, className } = this.props; + const { payload, id, result, msg, status, error, date, className, isTest } = this.props; if (payload.sign) { const { sign } = payload; + return ( ); } if (payload.transaction) { const { transaction } = payload; + return ( ); } diff --git a/js/src/views/Signer/components/RequestPendingWeb3/RequestPendingWeb3.js b/js/src/views/Signer/components/RequestPendingWeb3/RequestPendingWeb3.js index 97fa43f69..d9e695dbc 100644 --- a/js/src/views/Signer/components/RequestPendingWeb3/RequestPendingWeb3.js +++ b/js/src/views/Signer/components/RequestPendingWeb3/RequestPendingWeb3.js @@ -30,7 +30,8 @@ export default class RequestPendingWeb3 extends Component { PropTypes.shape({ transaction: PropTypes.object.isRequired }), PropTypes.shape({ sign: PropTypes.object.isRequired }) ]).isRequired, - className: PropTypes.string + className: PropTypes.string, + isTest: PropTypes.bool.isRequired }; onConfirm = data => { @@ -41,10 +42,11 @@ export default class RequestPendingWeb3 extends Component { }; render () { - const { payload, id, className, isSending, date, onReject } = this.props; + const { payload, id, className, isSending, date, onReject, isTest } = this.props; if (payload.sign) { const { sign } = payload; + return ( ); } if (payload.transaction) { const { transaction } = payload; + return ( ); } diff --git a/js/src/views/Signer/components/SignRequest/SignRequest.js b/js/src/views/Signer/components/SignRequest/SignRequest.js index 719ddeec9..6fb2b37b7 100644 --- a/js/src/views/Signer/components/SignRequest/SignRequest.js +++ b/js/src/views/Signer/components/SignRequest/SignRequest.js @@ -39,24 +39,15 @@ export default class SignRequest extends Component { onReject: PropTypes.func, status: PropTypes.string, className: PropTypes.string, - chain: nullable(PropTypes.object), + isTest: PropTypes.bool.isRequired, balance: nullable(PropTypes.object) }; state = { - chain: null, balance: null } componentWillMount () { - this.context.api.parity.netChain() - .then((chain) => { - this.setState({ chain }); - }) - .catch((err) => { - console.error('could not fetch chain', err); - }); - this.context.api.eth.getBalance(this.props.address) .then((balance) => { this.setState({ balance }); @@ -68,6 +59,7 @@ export default class SignRequest extends Component { render () { const { className } = this.props; + return (
{ this.renderDetails() } @@ -77,15 +69,20 @@ export default class SignRequest extends Component { } renderDetails () { - const { address, hash } = this.props; - const { balance, chain } = this.state; + const { address, hash, isTest } = this.props; + const { balance } = this.state; - if (!balance || !chain) return (
); + if (!balance) { + return
; + } return (
- +

Dapp is requesting to sign arbitrary transaction using this account.

@@ -100,15 +97,17 @@ export default class SignRequest extends Component { if (isFinished) { if (status === 'confirmed') { - const { hash } = this.props; - const { chain } = this.state; + const { hash, isTest } = this.props; return (
Confirmed
Transaction hash: - +
); diff --git a/js/src/views/Signer/components/TransactionFinished/TransactionFinished.js b/js/src/views/Signer/components/TransactionFinished/TransactionFinished.js index 00d6a057f..54333115d 100644 --- a/js/src/views/Signer/components/TransactionFinished/TransactionFinished.js +++ b/js/src/views/Signer/components/TransactionFinished/TransactionFinished.js @@ -47,13 +47,12 @@ export default class TransactionFinished extends Component { txHash: PropTypes.string, // undefined if transacation is rejected className: PropTypes.string, data: PropTypes.string, - chain: nullable(PropTypes.object), + isTest: PropTypes.bool.isRequired, fromBalance: nullable(PropTypes.object), toBalance: nullable(PropTypes.object) }; state = { - chain: null, fromBalance: null, toBalance: null }; @@ -64,14 +63,6 @@ export default class TransactionFinished extends Component { const totalValue = tUtil.getTotalValue(fee, value); this.setState({ totalValue }); - this.context.api.parity.netChain() - .then((chain) => { - this.setState({ chain }); - }) - .catch((err) => { - console.error('could not fetch chain', err); - }); - this.fetchBalance(from, 'fromBalance'); if (to) { this.fetchBalance(to, 'toBalance'); @@ -79,8 +70,9 @@ export default class TransactionFinished extends Component { } render () { - const { chain, fromBalance, toBalance } = this.state; - if (!chain || !fromBalance || !toBalance) { + const { fromBalance, toBalance } = this.state; + + if (!fromBalance || !toBalance) { return (
@@ -130,16 +122,19 @@ export default class TransactionFinished extends Component { } renderTxHash () { - const { txHash } = this.props; - const { chain } = this.state; - if (!txHash || !chain) { + const { txHash, isTest } = this.props; + + if (!txHash) { return; } return (
Transaction hash: - +
); } diff --git a/js/src/views/Signer/components/TransactionMainDetails/TransactionMainDetails.js b/js/src/views/Signer/components/TransactionMainDetails/TransactionMainDetails.js index 10b54b10b..4efa567d2 100644 --- a/js/src/views/Signer/components/TransactionMainDetails/TransactionMainDetails.js +++ b/js/src/views/Signer/components/TransactionMainDetails/TransactionMainDetails.js @@ -30,7 +30,7 @@ export default class TransactionMainDetails extends Component { fromBalance: PropTypes.object, // eth BigNumber, not required since it might take time to fetch value: PropTypes.object.isRequired, // wei hex totalValue: PropTypes.object.isRequired, // wei BigNumber - chain: PropTypes.string.isRequired, + isTest: PropTypes.isTest.isRequired, to: PropTypes.string, // undefined if it's a contract toBalance: PropTypes.object, // eth BigNumber - undefined if it's a contract or until it's fetched className: PropTypes.string, @@ -39,11 +39,13 @@ export default class TransactionMainDetails extends Component { componentWillMount () { const { value, totalValue } = this.props; + this.updateDisplayValues(value, totalValue); } componentWillReceiveProps (nextProps) { const { value, totalValue } = nextProps; + this.updateDisplayValues(value, totalValue); } @@ -59,6 +61,7 @@ export default class TransactionMainDetails extends Component { render () { const { className, children } = this.props; + return (
{ this.renderTransfer() } @@ -69,7 +72,8 @@ export default class TransactionMainDetails extends Component { } renderTransfer () { - const { from, fromBalance, to, toBalance, chain } = this.props; + const { from, fromBalance, to, toBalance, isTest } = this.props; + if (!to) { return; } @@ -78,7 +82,10 @@ export default class TransactionMainDetails extends Component {
- +
@@ -88,7 +95,10 @@ export default class TransactionMainDetails extends Component {
- +
@@ -96,15 +106,20 @@ export default class TransactionMainDetails extends Component { } renderContract () { - const { from, fromBalance, to, chain } = this.props; + const { from, fromBalance, to, isTest } = this.props; + if (to) { return; } + return (
- +
@@ -126,6 +141,7 @@ export default class TransactionMainDetails extends Component { renderValue () { const { id } = this.props; const { valueDisplay, valueDisplayWei } = this.state; + return (
); } - } diff --git a/js/src/views/Signer/components/TransactionPending/TransactionPending.js b/js/src/views/Signer/components/TransactionPending/TransactionPending.js index 55e4f6405..55f09ac97 100644 --- a/js/src/views/Signer/components/TransactionPending/TransactionPending.js +++ b/js/src/views/Signer/components/TransactionPending/TransactionPending.js @@ -16,7 +16,6 @@ import React, { Component, PropTypes } from 'react'; -import CircularProgress from 'material-ui/CircularProgress'; import TransactionMainDetails from '../TransactionMainDetails'; import TransactionPendingForm from '../TransactionPendingForm'; import TransactionSecondaryDetails from '../TransactionSecondaryDetails'; @@ -43,7 +42,8 @@ export default class TransactionPending extends Component { onConfirm: PropTypes.func.isRequired, onReject: PropTypes.func.isRequired, isSending: PropTypes.bool.isRequired, - className: PropTypes.string + className: PropTypes.string, + isTest: PropTypes.bool.isRequired }; static defaultProps = { @@ -51,7 +51,6 @@ export default class TransactionPending extends Component { }; state = { - chain: null, fromBalance: null, toBalance: null }; @@ -64,28 +63,12 @@ export default class TransactionPending extends Component { const gasToDisplay = tUtil.getGasDisplay(gas); this.setState({ gasPriceEthmDisplay, totalValue, gasToDisplay }); - this.context.api.parity.netChain() - .then((chain) => { - this.setState({ chain }); - }) - .catch((err) => { - console.error('could not fetch chain', err); - }); - const { from, to } = this.props; this.fetchBalance(from, 'fromBalance'); if (to) this.fetchBalance(to, 'toBalance'); } render () { - if (!this.state.chain) { - return ( -
- -
- ); - } - const { totalValue, gasPriceEthmDisplay, gasToDisplay } = this.state; const { className, id, date, data, from } = this.props; diff --git a/js/src/views/Signer/components/TransactionSecondaryDetails/TransactionSecondaryDetails.js b/js/src/views/Signer/components/TransactionSecondaryDetails/TransactionSecondaryDetails.js index 61c1260d4..fb0a329e0 100644 --- a/js/src/views/Signer/components/TransactionSecondaryDetails/TransactionSecondaryDetails.js +++ b/js/src/views/Signer/components/TransactionSecondaryDetails/TransactionSecondaryDetails.js @@ -59,10 +59,13 @@ export default class TransactionSecondaryDetails extends Component { } renderGasPrice () { - if (!this.props.gasPriceEthmDisplay && !this.props.gasToDisplay) return null; + if (!this.props.gasPriceEthmDisplay && !this.props.gasToDisplay) { + return null; + } const { id } = this.props; const { gasPriceEthmDisplay, gasToDisplay } = this.props; + return (
{ children || txHash } diff --git a/js/src/views/Signer/containers/Embedded/embedded.js b/js/src/views/Signer/containers/Embedded/embedded.js index be3a65d61..e06eaf274 100644 --- a/js/src/views/Signer/containers/Embedded/embedded.js +++ b/js/src/views/Signer/containers/Embedded/embedded.js @@ -35,7 +35,8 @@ class Embedded extends Component { actions: PropTypes.shape({ startConfirmRequest: PropTypes.func.isRequired, startRejectRequest: PropTypes.func.isRequired - }).isRequired + }).isRequired, + isTest: PropTypes.bool.isRequired }; render () { @@ -70,7 +71,7 @@ class Embedded extends Component { } renderPending = (data) => { - const { actions } = this.props; + const { actions, isTest } = this.props; const { payload, id, isSending, date } = data; return ( @@ -83,6 +84,7 @@ class Embedded extends Component { id={ id } payload={ payload } date={ date } + isTest={ isTest } /> ); } @@ -93,11 +95,13 @@ class Embedded extends Component { } function mapStateToProps (state) { + const { isTest } = state.nodeStatus; const { actions, signer } = state; return { actions, - signer + signer, + isTest }; } diff --git a/js/src/views/Signer/containers/RequestsPage/RequestsPage.js b/js/src/views/Signer/containers/RequestsPage/RequestsPage.js index 2a0d087e3..bf4968610 100644 --- a/js/src/views/Signer/containers/RequestsPage/RequestsPage.js +++ b/js/src/views/Signer/containers/RequestsPage/RequestsPage.js @@ -35,7 +35,8 @@ class RequestsPage extends Component { actions: PropTypes.shape({ startConfirmRequest: PropTypes.func.isRequired, startRejectRequest: PropTypes.func.isRequired - }).isRequired + }).isRequired, + isTest: PropTypes.bool.isRequired }; render () { @@ -96,7 +97,7 @@ class RequestsPage extends Component { } renderPending = (data) => { - const { actions } = this.props; + const { actions, isTest } = this.props; const { payload, id, isSending, date } = data; return ( @@ -109,11 +110,13 @@ class RequestsPage extends Component { id={ id } payload={ payload } date={ date } + isTest={ isTest } /> ); } renderFinished = (data) => { + const { isTest } = this.props; const { payload, id, result, msg, status, error, date } = data; return ( @@ -127,6 +130,7 @@ class RequestsPage extends Component { error={ error } payload={ payload } date={ date } + isTest={ isTest } /> ); } @@ -143,7 +147,14 @@ class RequestsPage extends Component { } function mapStateToProps (state) { - return state; + const { isTest } = state.nodeStatus; + const { actions, signer } = state; + + return { + actions, + signer, + isTest + }; } function mapDispatchToProps (dispatch) { From 4498fd54a424a65069e7912d1a4bd772308822ef Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 18 Nov 2016 21:55:55 +0100 Subject: [PATCH 02/26] Typo slipped through --- .../components/TransactionMainDetails/TransactionMainDetails.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/views/Signer/components/TransactionMainDetails/TransactionMainDetails.js b/js/src/views/Signer/components/TransactionMainDetails/TransactionMainDetails.js index 4efa567d2..f86150e48 100644 --- a/js/src/views/Signer/components/TransactionMainDetails/TransactionMainDetails.js +++ b/js/src/views/Signer/components/TransactionMainDetails/TransactionMainDetails.js @@ -30,7 +30,7 @@ export default class TransactionMainDetails extends Component { fromBalance: PropTypes.object, // eth BigNumber, not required since it might take time to fetch value: PropTypes.object.isRequired, // wei hex totalValue: PropTypes.object.isRequired, // wei BigNumber - isTest: PropTypes.isTest.isRequired, + isTest: PropTypes.bool.isRequired, to: PropTypes.string, // undefined if it's a contract toBalance: PropTypes.object, // eth BigNumber - undefined if it's a contract or until it's fetched className: PropTypes.string, From efd1d9bd0e9ad10184e713b2fb191256c61d1a92 Mon Sep 17 00:00:00 2001 From: Arkadiy Paronyan Date: Sun, 20 Nov 2016 16:38:45 +0100 Subject: [PATCH 03/26] Ropsten network (#3539) * Ropsten network * Sorted premine * Comas * Removed trailing coma --- ethcore/res/ethereum/ropsten.json | 304 ++++++++++++++++++++++++++++++ ethcore/src/ethereum/mod.rs | 3 + parity/params.rs | 4 + 3 files changed, 311 insertions(+) create mode 100644 ethcore/res/ethereum/ropsten.json diff --git a/ethcore/res/ethereum/ropsten.json b/ethcore/res/ethereum/ropsten.json new file mode 100644 index 000000000..c92676161 --- /dev/null +++ b/ethcore/res/ethereum/ropsten.json @@ -0,0 +1,304 @@ +{ + "name": "Ropsten", + "engine": { + "Ethash": { + "params": { + "gasLimitBoundDivisor": "0x0400", + "minimumDifficulty": "0x020000", + "difficultyBoundDivisor": "0x0800", + "durationLimit": "0x0d", + "blockReward": "0x4563918244F40000", + "registrar": "0x52dff57a8a1532e6afb3dc07e2af58bb9eb05b3d", + "homesteadTransition": 0, + "eip150Transition": 0, + "eip155Transition": 10, + "eip160Transition": 10, + "eip161abcTransition": 10, + "eip161dTransition": 10 + } + } + }, + "params": { + "accountStartNonce": "0x0", + "maximumExtraDataSize": "0x20", + "minGasLimit": "0x1388", + "networkID" : "0x3" + }, + "genesis": { + "seal": { + "ethereum": { + "nonce": "0x0000000000000042", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + }, + "difficulty": "0x100000", + "author": "0x0000000000000000000000000000000000000000", + "timestamp": "0x00", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "extraData": "0x3535353535353535353535353535353535353535353535353535353535353535", + "gasLimit": "0x1000000" + }, + "nodes": [ + "enode://a22f0977ce02653bf95e38730106356342df48b5222e2c2a1a6f9ef34769bf593bae9ca0a888cf60839edd52efc1b6e393c63a57d76f4c4fe14e641f1f9e637e@128.199.55.137:30303", + "enode://012239fccf3ff1d92b036983a430cb6705c6528c96c0354413f8854802138e5135c084ab36e7c54efb621c46728df8c3a6f4c1db9bb48a1330efe3f82f2dd7a6@52.169.94.142:30303" + ], + "accounts": { + "0000000000000000000000000000000000000001": { "balance": "1", "nonce": "0", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, + "0000000000000000000000000000000000000002": { "balance": "1", "nonce": "0", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, + "0000000000000000000000000000000000000003": { "balance": "1", "nonce": "0", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, + "0000000000000000000000000000000000000004": { "balance": "1", "nonce": "0", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, + "0000000000000000000000000000000000000000": { "balance": "1" }, + "0000000000000000000000000000000000000005": { "balance": "1" }, + "0000000000000000000000000000000000000006": { "balance": "1" }, + "0000000000000000000000000000000000000007": { "balance": "1" }, + "0000000000000000000000000000000000000008": { "balance": "1" }, + "0000000000000000000000000000000000000009": { "balance": "1" }, + "000000000000000000000000000000000000000a": { "balance": "0" }, + "000000000000000000000000000000000000000b": { "balance": "0" }, + "000000000000000000000000000000000000000c": { "balance": "0" }, + "000000000000000000000000000000000000000d": { "balance": "0" }, + "000000000000000000000000000000000000000e": { "balance": "0" }, + "000000000000000000000000000000000000000f": { "balance": "0" }, + "0000000000000000000000000000000000000010": { "balance": "0" }, + "0000000000000000000000000000000000000011": { "balance": "0" }, + "0000000000000000000000000000000000000012": { "balance": "0" }, + "0000000000000000000000000000000000000013": { "balance": "0" }, + "0000000000000000000000000000000000000014": { "balance": "0" }, + "0000000000000000000000000000000000000015": { "balance": "0" }, + "0000000000000000000000000000000000000016": { "balance": "0" }, + "0000000000000000000000000000000000000017": { "balance": "0" }, + "0000000000000000000000000000000000000018": { "balance": "0" }, + "0000000000000000000000000000000000000019": { "balance": "0" }, + "000000000000000000000000000000000000001a": { "balance": "0" }, + "000000000000000000000000000000000000001b": { "balance": "0" }, + "000000000000000000000000000000000000001c": { "balance": "0" }, + "000000000000000000000000000000000000001d": { "balance": "0" }, + "000000000000000000000000000000000000001e": { "balance": "0" }, + "000000000000000000000000000000000000001f": { "balance": "0" }, + "0000000000000000000000000000000000000020": { "balance": "0" }, + "0000000000000000000000000000000000000021": { "balance": "0" }, + "0000000000000000000000000000000000000022": { "balance": "0" }, + "0000000000000000000000000000000000000023": { "balance": "0" }, + "0000000000000000000000000000000000000024": { "balance": "0" }, + "0000000000000000000000000000000000000025": { "balance": "0" }, + "0000000000000000000000000000000000000026": { "balance": "0" }, + "0000000000000000000000000000000000000027": { "balance": "0" }, + "0000000000000000000000000000000000000028": { "balance": "0" }, + "0000000000000000000000000000000000000029": { "balance": "0" }, + "000000000000000000000000000000000000002a": { "balance": "0" }, + "000000000000000000000000000000000000002b": { "balance": "0" }, + "000000000000000000000000000000000000002c": { "balance": "0" }, + "000000000000000000000000000000000000002d": { "balance": "0" }, + "000000000000000000000000000000000000002e": { "balance": "0" }, + "000000000000000000000000000000000000002f": { "balance": "0" }, + "0000000000000000000000000000000000000030": { "balance": "0" }, + "0000000000000000000000000000000000000031": { "balance": "0" }, + "0000000000000000000000000000000000000032": { "balance": "0" }, + "0000000000000000000000000000000000000033": { "balance": "0" }, + "0000000000000000000000000000000000000034": { "balance": "0" }, + "0000000000000000000000000000000000000035": { "balance": "0" }, + "0000000000000000000000000000000000000036": { "balance": "0" }, + "0000000000000000000000000000000000000037": { "balance": "0" }, + "0000000000000000000000000000000000000038": { "balance": "0" }, + "0000000000000000000000000000000000000039": { "balance": "0" }, + "000000000000000000000000000000000000003a": { "balance": "0" }, + "000000000000000000000000000000000000003b": { "balance": "0" }, + "000000000000000000000000000000000000003c": { "balance": "0" }, + "000000000000000000000000000000000000003d": { "balance": "0" }, + "000000000000000000000000000000000000003e": { "balance": "0" }, + "000000000000000000000000000000000000003f": { "balance": "0" }, + "0000000000000000000000000000000000000040": { "balance": "0" }, + "0000000000000000000000000000000000000041": { "balance": "0" }, + "0000000000000000000000000000000000000042": { "balance": "0" }, + "0000000000000000000000000000000000000043": { "balance": "0" }, + "0000000000000000000000000000000000000044": { "balance": "0" }, + "0000000000000000000000000000000000000045": { "balance": "0" }, + "0000000000000000000000000000000000000046": { "balance": "0" }, + "0000000000000000000000000000000000000047": { "balance": "0" }, + "0000000000000000000000000000000000000048": { "balance": "0" }, + "0000000000000000000000000000000000000049": { "balance": "0" }, + "000000000000000000000000000000000000004a": { "balance": "0" }, + "000000000000000000000000000000000000004b": { "balance": "0" }, + "000000000000000000000000000000000000004c": { "balance": "0" }, + "000000000000000000000000000000000000004d": { "balance": "0" }, + "000000000000000000000000000000000000004e": { "balance": "0" }, + "000000000000000000000000000000000000004f": { "balance": "0" }, + "0000000000000000000000000000000000000050": { "balance": "0" }, + "0000000000000000000000000000000000000051": { "balance": "0" }, + "0000000000000000000000000000000000000052": { "balance": "0" }, + "0000000000000000000000000000000000000053": { "balance": "0" }, + "0000000000000000000000000000000000000054": { "balance": "0" }, + "0000000000000000000000000000000000000055": { "balance": "0" }, + "0000000000000000000000000000000000000056": { "balance": "0" }, + "0000000000000000000000000000000000000057": { "balance": "0" }, + "0000000000000000000000000000000000000058": { "balance": "0" }, + "0000000000000000000000000000000000000059": { "balance": "0" }, + "000000000000000000000000000000000000005a": { "balance": "0" }, + "000000000000000000000000000000000000005b": { "balance": "0" }, + "000000000000000000000000000000000000005c": { "balance": "0" }, + "000000000000000000000000000000000000005d": { "balance": "0" }, + "000000000000000000000000000000000000005e": { "balance": "0" }, + "000000000000000000000000000000000000005f": { "balance": "0" }, + "0000000000000000000000000000000000000060": { "balance": "0" }, + "0000000000000000000000000000000000000061": { "balance": "0" }, + "0000000000000000000000000000000000000062": { "balance": "0" }, + "0000000000000000000000000000000000000063": { "balance": "0" }, + "0000000000000000000000000000000000000064": { "balance": "0" }, + "0000000000000000000000000000000000000065": { "balance": "0" }, + "0000000000000000000000000000000000000066": { "balance": "0" }, + "0000000000000000000000000000000000000067": { "balance": "0" }, + "0000000000000000000000000000000000000068": { "balance": "0" }, + "0000000000000000000000000000000000000069": { "balance": "0" }, + "000000000000000000000000000000000000006a": { "balance": "0" }, + "000000000000000000000000000000000000006b": { "balance": "0" }, + "000000000000000000000000000000000000006c": { "balance": "0" }, + "000000000000000000000000000000000000006d": { "balance": "0" }, + "000000000000000000000000000000000000006e": { "balance": "0" }, + "000000000000000000000000000000000000006f": { "balance": "0" }, + "0000000000000000000000000000000000000070": { "balance": "0" }, + "0000000000000000000000000000000000000071": { "balance": "0" }, + "0000000000000000000000000000000000000072": { "balance": "0" }, + "0000000000000000000000000000000000000073": { "balance": "0" }, + "0000000000000000000000000000000000000074": { "balance": "0" }, + "0000000000000000000000000000000000000075": { "balance": "0" }, + "0000000000000000000000000000000000000076": { "balance": "0" }, + "0000000000000000000000000000000000000077": { "balance": "0" }, + "0000000000000000000000000000000000000078": { "balance": "0" }, + "0000000000000000000000000000000000000079": { "balance": "0" }, + "000000000000000000000000000000000000007a": { "balance": "0" }, + "000000000000000000000000000000000000007b": { "balance": "0" }, + "000000000000000000000000000000000000007c": { "balance": "0" }, + "000000000000000000000000000000000000007d": { "balance": "0" }, + "000000000000000000000000000000000000007e": { "balance": "0" }, + "000000000000000000000000000000000000007f": { "balance": "0" }, + "0000000000000000000000000000000000000080": { "balance": "0" }, + "0000000000000000000000000000000000000081": { "balance": "0" }, + "0000000000000000000000000000000000000082": { "balance": "0" }, + "0000000000000000000000000000000000000083": { "balance": "0" }, + "0000000000000000000000000000000000000084": { "balance": "0" }, + "0000000000000000000000000000000000000085": { "balance": "0" }, + "0000000000000000000000000000000000000086": { "balance": "0" }, + "0000000000000000000000000000000000000087": { "balance": "0" }, + "0000000000000000000000000000000000000088": { "balance": "0" }, + "0000000000000000000000000000000000000089": { "balance": "0" }, + "000000000000000000000000000000000000008a": { "balance": "0" }, + "000000000000000000000000000000000000008b": { "balance": "0" }, + "000000000000000000000000000000000000008c": { "balance": "0" }, + "000000000000000000000000000000000000008d": { "balance": "0" }, + "000000000000000000000000000000000000008e": { "balance": "0" }, + "000000000000000000000000000000000000008f": { "balance": "0" }, + "0000000000000000000000000000000000000090": { "balance": "0" }, + "0000000000000000000000000000000000000091": { "balance": "0" }, + "0000000000000000000000000000000000000092": { "balance": "0" }, + "0000000000000000000000000000000000000093": { "balance": "0" }, + "0000000000000000000000000000000000000094": { "balance": "0" }, + "0000000000000000000000000000000000000095": { "balance": "0" }, + "0000000000000000000000000000000000000096": { "balance": "0" }, + "0000000000000000000000000000000000000097": { "balance": "0" }, + "0000000000000000000000000000000000000098": { "balance": "0" }, + "0000000000000000000000000000000000000099": { "balance": "0" }, + "000000000000000000000000000000000000009a": { "balance": "0" }, + "000000000000000000000000000000000000009b": { "balance": "0" }, + "000000000000000000000000000000000000009c": { "balance": "0" }, + "000000000000000000000000000000000000009d": { "balance": "0" }, + "000000000000000000000000000000000000009e": { "balance": "0" }, + "000000000000000000000000000000000000009f": { "balance": "0" }, + "00000000000000000000000000000000000000a0": { "balance": "0" }, + "00000000000000000000000000000000000000a1": { "balance": "0" }, + "00000000000000000000000000000000000000a2": { "balance": "0" }, + "00000000000000000000000000000000000000a3": { "balance": "0" }, + "00000000000000000000000000000000000000a4": { "balance": "0" }, + "00000000000000000000000000000000000000a5": { "balance": "0" }, + "00000000000000000000000000000000000000a6": { "balance": "0" }, + "00000000000000000000000000000000000000a7": { "balance": "0" }, + "00000000000000000000000000000000000000a8": { "balance": "0" }, + "00000000000000000000000000000000000000a9": { "balance": "0" }, + "00000000000000000000000000000000000000aa": { "balance": "0" }, + "00000000000000000000000000000000000000ab": { "balance": "0" }, + "00000000000000000000000000000000000000ac": { "balance": "0" }, + "00000000000000000000000000000000000000ad": { "balance": "0" }, + "00000000000000000000000000000000000000ae": { "balance": "0" }, + "00000000000000000000000000000000000000af": { "balance": "0" }, + "00000000000000000000000000000000000000b0": { "balance": "0" }, + "00000000000000000000000000000000000000b1": { "balance": "0" }, + "00000000000000000000000000000000000000b2": { "balance": "0" }, + "00000000000000000000000000000000000000b3": { "balance": "0" }, + "00000000000000000000000000000000000000b4": { "balance": "0" }, + "00000000000000000000000000000000000000b5": { "balance": "0" }, + "00000000000000000000000000000000000000b6": { "balance": "0" }, + "00000000000000000000000000000000000000b7": { "balance": "0" }, + "00000000000000000000000000000000000000b8": { "balance": "0" }, + "00000000000000000000000000000000000000b9": { "balance": "0" }, + "00000000000000000000000000000000000000ba": { "balance": "0" }, + "00000000000000000000000000000000000000bb": { "balance": "0" }, + "00000000000000000000000000000000000000bc": { "balance": "0" }, + "00000000000000000000000000000000000000bd": { "balance": "0" }, + "00000000000000000000000000000000000000be": { "balance": "0" }, + "00000000000000000000000000000000000000bf": { "balance": "0" }, + "00000000000000000000000000000000000000c0": { "balance": "0" }, + "00000000000000000000000000000000000000c1": { "balance": "0" }, + "00000000000000000000000000000000000000c2": { "balance": "0" }, + "00000000000000000000000000000000000000c3": { "balance": "0" }, + "00000000000000000000000000000000000000c4": { "balance": "0" }, + "00000000000000000000000000000000000000c5": { "balance": "0" }, + "00000000000000000000000000000000000000c6": { "balance": "0" }, + "00000000000000000000000000000000000000c7": { "balance": "0" }, + "00000000000000000000000000000000000000c8": { "balance": "0" }, + "00000000000000000000000000000000000000c9": { "balance": "0" }, + "00000000000000000000000000000000000000ca": { "balance": "0" }, + "00000000000000000000000000000000000000cb": { "balance": "0" }, + "00000000000000000000000000000000000000cc": { "balance": "0" }, + "00000000000000000000000000000000000000cd": { "balance": "0" }, + "00000000000000000000000000000000000000ce": { "balance": "0" }, + "00000000000000000000000000000000000000cf": { "balance": "0" }, + "00000000000000000000000000000000000000d0": { "balance": "0" }, + "00000000000000000000000000000000000000d1": { "balance": "0" }, + "00000000000000000000000000000000000000d2": { "balance": "0" }, + "00000000000000000000000000000000000000d3": { "balance": "0" }, + "00000000000000000000000000000000000000d4": { "balance": "0" }, + "00000000000000000000000000000000000000d5": { "balance": "0" }, + "00000000000000000000000000000000000000d6": { "balance": "0" }, + "00000000000000000000000000000000000000d7": { "balance": "0" }, + "00000000000000000000000000000000000000d8": { "balance": "0" }, + "00000000000000000000000000000000000000d9": { "balance": "0" }, + "00000000000000000000000000000000000000da": { "balance": "0" }, + "00000000000000000000000000000000000000db": { "balance": "0" }, + "00000000000000000000000000000000000000dc": { "balance": "0" }, + "00000000000000000000000000000000000000dd": { "balance": "0" }, + "00000000000000000000000000000000000000de": { "balance": "0" }, + "00000000000000000000000000000000000000df": { "balance": "0" }, + "00000000000000000000000000000000000000e0": { "balance": "0" }, + "00000000000000000000000000000000000000e1": { "balance": "0" }, + "00000000000000000000000000000000000000e2": { "balance": "0" }, + "00000000000000000000000000000000000000e3": { "balance": "0" }, + "00000000000000000000000000000000000000e4": { "balance": "0" }, + "00000000000000000000000000000000000000e5": { "balance": "0" }, + "00000000000000000000000000000000000000e6": { "balance": "0" }, + "00000000000000000000000000000000000000e7": { "balance": "0" }, + "00000000000000000000000000000000000000e8": { "balance": "0" }, + "00000000000000000000000000000000000000e9": { "balance": "0" }, + "00000000000000000000000000000000000000ea": { "balance": "0" }, + "00000000000000000000000000000000000000eb": { "balance": "0" }, + "00000000000000000000000000000000000000ec": { "balance": "0" }, + "00000000000000000000000000000000000000ed": { "balance": "0" }, + "00000000000000000000000000000000000000ee": { "balance": "0" }, + "00000000000000000000000000000000000000ef": { "balance": "0" }, + "00000000000000000000000000000000000000f0": { "balance": "0" }, + "00000000000000000000000000000000000000f1": { "balance": "0" }, + "00000000000000000000000000000000000000f2": { "balance": "0" }, + "00000000000000000000000000000000000000f3": { "balance": "0" }, + "00000000000000000000000000000000000000f4": { "balance": "0" }, + "00000000000000000000000000000000000000f5": { "balance": "0" }, + "00000000000000000000000000000000000000f6": { "balance": "0" }, + "00000000000000000000000000000000000000f7": { "balance": "0" }, + "00000000000000000000000000000000000000f8": { "balance": "0" }, + "00000000000000000000000000000000000000f9": { "balance": "0" }, + "00000000000000000000000000000000000000fa": { "balance": "0" }, + "00000000000000000000000000000000000000fb": { "balance": "0" }, + "00000000000000000000000000000000000000fc": { "balance": "0" }, + "00000000000000000000000000000000000000fd": { "balance": "0" }, + "00000000000000000000000000000000000000fe": { "balance": "0" }, + "00000000000000000000000000000000000000ff": { "balance": "0" }, + "874b54a8bd152966d63f706bae1ffeb0411921e5": { "balance": "1000000000000000000000000000000" } + } +} diff --git a/ethcore/src/ethereum/mod.rs b/ethcore/src/ethereum/mod.rs index 253a12372..e236924ad 100644 --- a/ethcore/src/ethereum/mod.rs +++ b/ethcore/src/ethereum/mod.rs @@ -63,6 +63,9 @@ pub fn new_transition_test() -> Spec { load(include_bytes!("../../res/ethereum/t /// Create a new Frontier main net chain spec without genesis accounts. pub fn new_mainnet_like() -> Spec { load(include_bytes!("../../res/ethereum/frontier_like_test.json")) } +/// Create a new Ropsten chain spec. +pub fn new_ropsten() -> Spec { load(include_bytes!("../../res/ethereum/ropsten.json")) } + /// Create a new Morden chain spec. pub fn new_morden() -> Spec { load(include_bytes!("../../res/ethereum/morden.json")) } diff --git a/parity/params.rs b/parity/params.rs index 54e08da32..8af70b91d 100644 --- a/parity/params.rs +++ b/parity/params.rs @@ -28,6 +28,7 @@ use user_defaults::UserDefaults; pub enum SpecType { Mainnet, Testnet, + Ropsten, Olympic, Classic, Expanse, @@ -49,6 +50,7 @@ impl str::FromStr for SpecType { "frontier" | "homestead" | "mainnet" => SpecType::Mainnet, "frontier-dogmatic" | "homestead-dogmatic" | "classic" => SpecType::Classic, "morden" | "testnet" => SpecType::Testnet, + "ropsten" => SpecType::Ropsten, "olympic" => SpecType::Olympic, "expanse" => SpecType::Expanse, "dev" => SpecType::Dev, @@ -63,6 +65,7 @@ impl SpecType { match *self { SpecType::Mainnet => Ok(ethereum::new_frontier()), SpecType::Testnet => Ok(ethereum::new_morden()), + SpecType::Ropsten => Ok(ethereum::new_ropsten()), SpecType::Olympic => Ok(ethereum::new_olympic()), SpecType::Classic => Ok(ethereum::new_classic()), SpecType::Expanse => Ok(ethereum::new_expanse()), @@ -285,6 +288,7 @@ mod tests { assert_eq!(SpecType::Mainnet, "mainnet".parse().unwrap()); assert_eq!(SpecType::Testnet, "testnet".parse().unwrap()); assert_eq!(SpecType::Testnet, "morden".parse().unwrap()); + assert_eq!(SpecType::Ropsten, "ropsten".parse().unwrap()); assert_eq!(SpecType::Olympic, "olympic".parse().unwrap()); } From 92a34d9dd892cf53e2cc5b244e8c74fc31580711 Mon Sep 17 00:00:00 2001 From: GitLab Build Bot Date: Sun, 20 Nov 2016 16:06:52 +0000 Subject: [PATCH 04/26] [ci skip] js-precompiled 20161120-160026 --- Cargo.lock | 2 +- js/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4a209e009..bffde3803 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1250,7 +1250,7 @@ dependencies = [ [[package]] name = "parity-ui-precompiled" version = "1.4.0" -source = "git+https://github.com/ethcore/js-precompiled.git#20e50a56709fbe3e39d0fea6cf31f48bd1da4bff" +source = "git+https://github.com/ethcore/js-precompiled.git#2f78566b69c96e21ca1799cbf04d7a4d510c6240" dependencies = [ "parity-dapps-glue 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/js/package.json b/js/package.json index d4ee6fe8e..d4c418f37 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "parity.js", - "version": "0.2.56", + "version": "0.2.57", "main": "release/index.js", "jsnext:main": "src/index.js", "author": "Parity Team ", From 845bc52e36003e2ad4553f72b6c547c7a105a89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Sun, 20 Nov 2016 17:40:28 +0100 Subject: [PATCH 05/26] Moving contract resolver to separate crate --- Cargo.lock | 13 +++++++++- dapps/Cargo.toml | 4 +-- dapps/src/apps/fetcher.rs | 7 +++--- dapps/src/apps/mod.rs | 1 - dapps/src/lib.rs | 7 +++--- dapps/src/tests/helpers.rs | 2 +- ethcore/hash-fetch/Cargo.toml | 14 +++++++++++ .../hash-fetch/res}/registrar.json | 0 .../hash-fetch/res}/urlhint.json | 0 ethcore/hash-fetch/src/lib.rs | 25 +++++++++++++++++++ .../hash-fetch/src}/urlhint.rs | 4 +-- 11 files changed, 63 insertions(+), 14 deletions(-) create mode 100644 ethcore/hash-fetch/Cargo.toml rename {dapps/src/apps => ethcore/hash-fetch/res}/registrar.json (100%) rename {dapps/src/apps => ethcore/hash-fetch/res}/urlhint.json (100%) create mode 100644 ethcore/hash-fetch/src/lib.rs rename {dapps/src/apps => ethcore/hash-fetch/src}/urlhint.rs (98%) diff --git a/Cargo.lock b/Cargo.lock index 4a209e009..a590d479c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -334,8 +334,8 @@ version = "1.5.0" dependencies = [ "clippy 0.0.96 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-devtools 1.4.0", + "ethcore-hash-fetch 1.5.0", "ethcore-rpc 1.5.0", "ethcore-util 1.5.0", "fetch 0.1.0", @@ -366,6 +366,17 @@ dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ethcore-hash-fetch" +version = "1.5.0" +dependencies = [ + "ethabi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethcore-util 1.5.0", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ethcore-io" version = "1.5.0" diff --git a/dapps/Cargo.toml b/dapps/Cargo.toml index f6e9d102d..15e537820 100644 --- a/dapps/Cargo.toml +++ b/dapps/Cargo.toml @@ -20,20 +20,20 @@ url = "1.0" rustc-serialize = "0.3" serde = "0.8" serde_json = "0.8" -ethabi = "0.2.2" linked-hash-map = "0.3" parity-dapps-glue = "1.4" mime = "0.2" +mime_guess = "1.6.1" time = "0.1.35" serde_macros = { version = "0.8", optional = true } zip = { version = "0.1", default-features = false } ethcore-devtools = { path = "../devtools" } ethcore-rpc = { path = "../rpc" } ethcore-util = { path = "../util" } +ethcore-hash-fetch = { path = "../ethcore/hash-fetch" } fetch = { path = "../util/fetch" } parity-ui = { path = "./ui" } -mime_guess = { version = "1.6.1" } clippy = { version = "0.0.96", optional = true} [build-dependencies] diff --git a/dapps/src/apps/fetcher.rs b/dapps/src/apps/fetcher.rs index 2c1414201..e7f36d144 100644 --- a/dapps/src/apps/fetcher.rs +++ b/dapps/src/apps/fetcher.rs @@ -24,6 +24,7 @@ use std::io::{self, Read, Write}; use std::path::PathBuf; use std::sync::Arc; use rustc_serialize::hex::FromHex; +use hash_fetch::urlhint::{URLHintContract, URLHint, URLHintResult}; use hyper; use hyper::status::StatusCode; @@ -37,7 +38,6 @@ use handlers::{ContentHandler, ContentFetcherHandler, ContentValidator}; use endpoint::{Endpoint, EndpointPath, Handler}; use apps::cache::{ContentCache, ContentStatus}; use apps::manifest::{MANIFEST_FILENAME, deserialize_manifest, serialize_manifest, Manifest}; -use apps::urlhint::{URLHintContract, URLHint, URLHintResult}; /// Limit of cached dapps/content const MAX_CACHED_DAPPS: usize = 20; @@ -402,10 +402,11 @@ mod tests { use std::env; use std::sync::Arc; use util::Bytes; + use hash_fetch::urlhint::{URLHint, URLHintResult}; + + use apps::cache::ContentStatus; use endpoint::EndpointInfo; use page::LocalPageEndpoint; - use apps::cache::ContentStatus; - use apps::urlhint::{URLHint, URLHintResult}; use super::ContentFetcher; struct FakeResolver; diff --git a/dapps/src/apps/mod.rs b/dapps/src/apps/mod.rs index 3cb0d8256..4c9270aa5 100644 --- a/dapps/src/apps/mod.rs +++ b/dapps/src/apps/mod.rs @@ -21,7 +21,6 @@ use parity_dapps::WebApp; mod cache; mod fs; -pub mod urlhint; pub mod fetcher; pub mod manifest; diff --git a/dapps/src/lib.rs b/dapps/src/lib.rs index 2c9fa33d1..7c7ea0a86 100644 --- a/dapps/src/lib.rs +++ b/dapps/src/lib.rs @@ -51,13 +51,13 @@ extern crate serde; extern crate serde_json; extern crate zip; extern crate rand; -extern crate ethabi; extern crate jsonrpc_core; extern crate jsonrpc_http_server; extern crate mime_guess; extern crate rustc_serialize; extern crate ethcore_rpc; extern crate ethcore_util as util; +extern crate ethcore_hash_fetch as hash_fetch; extern crate linked_hash_map; extern crate fetch; extern crate parity_dapps_glue as parity_dapps; @@ -84,12 +84,11 @@ mod url; #[cfg(test)] mod tests; -pub use self::apps::urlhint::ContractClient; - use std::sync::{Arc, Mutex}; use std::net::SocketAddr; use std::collections::HashMap; +use hash_fetch::urlhint::ContractClient; use jsonrpc_core::{IoHandler, IoDelegate}; use router::auth::{Authorization, NoAuth, HttpBasicAuth}; use ethcore_rpc::Extendable; @@ -219,7 +218,7 @@ impl Server { ) -> Result { let panic_handler = Arc::new(Mutex::new(None)); let authorization = Arc::new(authorization); - let content_fetcher = Arc::new(apps::fetcher::ContentFetcher::new(apps::urlhint::URLHintContract::new(registrar), sync_status, signer_address.clone())); + let content_fetcher = Arc::new(apps::fetcher::ContentFetcher::new(hash_fetch::urlhint::URLHintContract::new(registrar), sync_status, signer_address.clone())); let endpoints = Arc::new(apps::all_endpoints(dapps_path, signer_address.clone())); let cors_domains = Self::cors_domains(signer_address.clone()); diff --git a/dapps/src/tests/helpers.rs b/dapps/src/tests/helpers.rs index f7c9e8ba6..66bf0f8eb 100644 --- a/dapps/src/tests/helpers.rs +++ b/dapps/src/tests/helpers.rs @@ -22,7 +22,7 @@ use env_logger::LogBuilder; use ServerBuilder; use Server; -use apps::urlhint::ContractClient; +use hash_fetch::urlhint::ContractClient; use util::{Bytes, Address, Mutex, ToPretty}; use devtools::http_client; diff --git a/ethcore/hash-fetch/Cargo.toml b/ethcore/hash-fetch/Cargo.toml new file mode 100644 index 000000000..f1a65bfc8 --- /dev/null +++ b/ethcore/hash-fetch/Cargo.toml @@ -0,0 +1,14 @@ +[package] +description = "Fetching hash-addressed content." +homepage = "https://ethcore.io" +license = "GPL-3.0" +name = "ethcore-hash-fetch" +version = "1.5.0" +authors = ["Ethcore "] + +[dependencies] +log = "0.3" +rustc-serialize = "0.3" +ethabi = "0.2.2" +mime_guess = "1.6.1" +ethcore-util = { path = "../../util" } diff --git a/dapps/src/apps/registrar.json b/ethcore/hash-fetch/res/registrar.json similarity index 100% rename from dapps/src/apps/registrar.json rename to ethcore/hash-fetch/res/registrar.json diff --git a/dapps/src/apps/urlhint.json b/ethcore/hash-fetch/res/urlhint.json similarity index 100% rename from dapps/src/apps/urlhint.json rename to ethcore/hash-fetch/res/urlhint.json diff --git a/ethcore/hash-fetch/src/lib.rs b/ethcore/hash-fetch/src/lib.rs new file mode 100644 index 000000000..ac613a558 --- /dev/null +++ b/ethcore/hash-fetch/src/lib.rs @@ -0,0 +1,25 @@ +// 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 . + +#[macro_use] +extern crate log; +extern crate rustc_serialize; +extern crate mime_guess; +extern crate ethabi; +extern crate ethcore_util as util; + +pub mod urlhint; + diff --git a/dapps/src/apps/urlhint.rs b/ethcore/hash-fetch/src/urlhint.rs similarity index 98% rename from dapps/src/apps/urlhint.rs rename to ethcore/hash-fetch/src/urlhint.rs index 27769d07a..b7f905144 100644 --- a/dapps/src/apps/urlhint.rs +++ b/ethcore/hash-fetch/src/urlhint.rs @@ -92,8 +92,8 @@ pub struct URLHintContract { impl URLHintContract { pub fn new(client: Arc) -> Self { - let urlhint = Interface::load(include_bytes!("./urlhint.json")).expect("urlhint.json is valid ABI"); - let registrar = Interface::load(include_bytes!("./registrar.json")).expect("registrar.json is valid ABI"); + let urlhint = Interface::load(include_bytes!("../res/urlhint.json")).expect("urlhint.json is valid ABI"); + let registrar = Interface::load(include_bytes!("../res/registrar.json")).expect("registrar.json is valid ABI"); URLHintContract { urlhint: Contract::new(urlhint), From cc8a9d410b235a17c59ebfc9067c56b53dac56b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Sun, 20 Nov 2016 18:30:54 +0100 Subject: [PATCH 06/26] Adding fetch API to the crate --- Cargo.lock | 1 + ethcore/hash-fetch/Cargo.toml | 1 + ethcore/hash-fetch/src/client.rs | 114 ++++++++++++++++++++++++++++++ ethcore/hash-fetch/src/lib.rs | 8 +++ ethcore/hash-fetch/src/urlhint.rs | 48 ++++++++----- util/bigint/src/uint.rs | 1 + util/fetch/src/lib.rs | 2 +- 7 files changed, 155 insertions(+), 20 deletions(-) create mode 100644 ethcore/hash-fetch/src/client.rs diff --git a/Cargo.lock b/Cargo.lock index a590d479c..85aac6e54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -372,6 +372,7 @@ version = "1.5.0" dependencies = [ "ethabi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.5.0", + "fetch 0.1.0", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/ethcore/hash-fetch/Cargo.toml b/ethcore/hash-fetch/Cargo.toml index f1a65bfc8..4fb724c08 100644 --- a/ethcore/hash-fetch/Cargo.toml +++ b/ethcore/hash-fetch/Cargo.toml @@ -11,4 +11,5 @@ log = "0.3" rustc-serialize = "0.3" ethabi = "0.2.2" mime_guess = "1.6.1" +fetch = { path = "../../util/fetch" } ethcore-util = { path = "../../util" } diff --git a/ethcore/hash-fetch/src/client.rs b/ethcore/hash-fetch/src/client.rs new file mode 100644 index 000000000..f5d19afa5 --- /dev/null +++ b/ethcore/hash-fetch/src/client.rs @@ -0,0 +1,114 @@ +// 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 . + +//! Hash-addressed content resolver & fetcher. + +use std::{io, fs}; +use std::sync::Arc; +use std::path::PathBuf; + +use util::{Mutex, H256, sha3}; +use fetch::{Fetch, FetchError, Client as FetchClient}; + +use urlhint::{ContractClient, URLHintContract, URLHint, URLHintResult}; + +/// API for fetching by hash. +pub trait HashFetch { + /// Fetch hash-addressed content. + /// Parameters: + /// 1. `hash` - content hash + /// 2. `on_done` - callback function invoked when the content is ready (or there was error during fetch) + /// + /// This function may fail immediately when fetch cannot be initialized or content cannot be resolved. + fn fetch(&self, hash: H256, on_done: Box) + Send>) -> Result<(), Error>; +} + +/// Hash-fetching error. +#[derive(Debug)] +pub enum Error { + /// Hash could not be resolved to a valid content address. + NoResolution, + /// Downloaded content hash does not match. + HashMismatch { expected: H256, got: H256 }, + /// IO Error while validating hash. + IO(io::Error), + /// Error during fetch. + Fetch(FetchError), +} + +impl From for Error { + fn from(error: FetchError) -> Self { + Error::Fetch(error) + } +} + +impl From for Error { + fn from(error: io::Error) -> Self { + Error::IO(error) + } +} + +/// Default Hash-fetching client using on-chain contract to resolve hashes to URLs. +pub struct Client { + contract: URLHintContract, + fetch: Mutex, +} + +impl Client { + /// Creates new instance of the `Client` given on-chain contract client. + pub fn new(contract: Arc) -> Self { + Client { + contract: URLHintContract::new(contract), + fetch: Mutex::new(FetchClient::default()), + } + } +} + +impl HashFetch for Client { + fn fetch(&self, hash: H256, on_done: Box) + Send>) -> Result<(), Error> { + debug!(target: "dapps", "Fetching: {:?}", hash); + + let url = try!( + self.contract.resolve(hash.to_vec()).map(|content| match content { + URLHintResult::Dapp(dapp) => { + dapp.url() + }, + URLHintResult::Content(content) => { + content.url + }, + }).ok_or_else(|| Error::NoResolution) + ); + + debug!(target: "dapps", "Resolved {:?} to {:?}. Fetching...", hash, url); + + self.fetch.lock().request_async(&url, Default::default(), Box::new(move |result| { + fn validate_hash(hash: H256, result: Result) -> Result { + let path = try!(result); + let mut file_reader = io::BufReader::new(try!(fs::File::open(&path))); + let content_hash = try!(sha3(&mut file_reader)); + + if content_hash != hash { + Err(Error::HashMismatch{ got: content_hash, expected: hash }) + } else { + Ok(path) + } + } + + debug!(target: "dapps", "Content fetched, validating hash ({:?})", hash); + on_done(validate_hash(hash, result)) + })).map_err(Into::into) + } +} diff --git a/ethcore/hash-fetch/src/lib.rs b/ethcore/hash-fetch/src/lib.rs index ac613a558..ffb74b260 100644 --- a/ethcore/hash-fetch/src/lib.rs +++ b/ethcore/hash-fetch/src/lib.rs @@ -14,12 +14,20 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +//! Hash-addressed content resolver & fetcher. + +#![warn(missing_docs)] + #[macro_use] extern crate log; extern crate rustc_serialize; extern crate mime_guess; extern crate ethabi; extern crate ethcore_util as util; +extern crate fetch; + +mod client; pub mod urlhint; +pub use client::{HashFetch, Client}; diff --git a/ethcore/hash-fetch/src/urlhint.rs b/ethcore/hash-fetch/src/urlhint.rs index b7f905144..9cbd13b1e 100644 --- a/ethcore/hash-fetch/src/urlhint.rs +++ b/ethcore/hash-fetch/src/urlhint.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +//! URLHint Contract + use std::fmt; use std::sync::Arc; use rustc_serialize::hex::ToHex; @@ -24,15 +26,30 @@ use util::{Address, Bytes, Hashable}; const COMMIT_LEN: usize = 20; +/// RAW Contract interface. +/// Should execute transaction using current blockchain state. +pub trait ContractClient: Send + Sync { + /// Get registrar address + fn registrar(&self) -> Result; + /// Call Contract + fn call(&self, address: Address, data: Bytes) -> Result; +} + +/// Github-hosted dapp. #[derive(Debug, PartialEq)] pub struct GithubApp { + /// Github Account pub account: String, + /// Github Repository pub repo: String, + /// Commit on Github pub commit: [u8;COMMIT_LEN], + /// Dapp owner address pub owner: Address, } impl GithubApp { + /// Returns URL of this Github-hosted dapp package. pub fn url(&self) -> String { // Since https fetcher doesn't support redirections we use direct link // format!("https://github.com/{}/{}/archive/{}.zip", self.account, self.repo, self.commit.to_hex()) @@ -53,22 +70,17 @@ impl GithubApp { } } +/// Hash-Addressed Content #[derive(Debug, PartialEq)] pub struct Content { + /// URL of the content pub url: String, + /// MIME type of the content pub mime: String, + /// Content owner address pub owner: Address, } -/// RAW Contract interface. -/// Should execute transaction using current blockchain state. -pub trait ContractClient: Send + Sync { - /// Get registrar address - fn registrar(&self) -> Result; - /// Call Contract - fn call(&self, address: Address, data: Bytes) -> Result; -} - /// Result of resolving id to URL #[derive(Debug, PartialEq)] pub enum URLHintResult { @@ -84,6 +96,7 @@ pub trait URLHint { fn resolve(&self, id: Bytes) -> Option; } +/// `URLHintContract` API pub struct URLHintContract { urlhint: Contract, registrar: Contract, @@ -91,6 +104,7 @@ pub struct URLHintContract { } impl URLHintContract { + /// Creates new `URLHintContract` pub fn new(client: Arc) -> Self { let urlhint = Interface::load(include_bytes!("../res/urlhint.json")).expect("urlhint.json is valid ABI"); let registrar = Interface::load(include_bytes!("../res/registrar.json")).expect("registrar.json is valid ABI"); @@ -244,11 +258,6 @@ fn guess_mime_type(url: &str) -> Option { }) } -#[cfg(test)] -pub fn test_guess_mime_type(url: &str) -> Option { - guess_mime_type(url) -} - fn as_string(e: T) -> String { format!("{:?}", e) } @@ -260,6 +269,7 @@ mod tests { use rustc_serialize::hex::FromHex; use super::*; + use super::guess_mime_type; use util::{Bytes, Address, Mutex, ToPretty}; struct FakeRegistrar { @@ -390,10 +400,10 @@ mod tests { let url5 = "https://ethcore.io/parity.png"; - assert_eq!(test_guess_mime_type(url1), None); - assert_eq!(test_guess_mime_type(url2), Some("image/png".into())); - assert_eq!(test_guess_mime_type(url3), Some("image/png".into())); - assert_eq!(test_guess_mime_type(url4), Some("image/jpeg".into())); - assert_eq!(test_guess_mime_type(url5), Some("image/png".into())); + assert_eq!(guess_mime_type(url1), None); + assert_eq!(guess_mime_type(url2), Some("image/png".into())); + assert_eq!(guess_mime_type(url3), Some("image/png".into())); + assert_eq!(guess_mime_type(url4), Some("image/jpeg".into())); + assert_eq!(guess_mime_type(url5), Some("image/png".into())); } } diff --git a/util/bigint/src/uint.rs b/util/bigint/src/uint.rs index dab00537e..f4dd91140 100644 --- a/util/bigint/src/uint.rs +++ b/util/bigint/src/uint.rs @@ -683,6 +683,7 @@ macro_rules! construct_uint { bytes[i] = (arr[pos] >> ((rev % 8) * 8)) as u8; } } + #[inline] fn exp10(n: usize) -> Self { match n { diff --git a/util/fetch/src/lib.rs b/util/fetch/src/lib.rs index 7ab38604b..8ec9e0ddd 100644 --- a/util/fetch/src/lib.rs +++ b/util/fetch/src/lib.rs @@ -26,4 +26,4 @@ extern crate rand; pub mod client; pub mod fetch_file; -pub use self::client::{Client, Fetch, FetchError, FetchResult}; \ No newline at end of file +pub use self::client::{Client, Fetch, FetchError, FetchResult}; From 94328e97845aef1ced5078ebd9ab80b156fb8643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Sun, 20 Nov 2016 22:40:23 +0100 Subject: [PATCH 07/26] Fixing main --- Cargo.lock | 1 + Cargo.toml | 1 + parity/dapps.rs | 2 +- parity/main.rs | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 85aac6e54..609d02dab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,6 +11,7 @@ dependencies = [ "ethcore 1.5.0", "ethcore-dapps 1.5.0", "ethcore-devtools 1.4.0", + "ethcore-hash-fetch 1.5.0", "ethcore-io 1.5.0", "ethcore-ipc 1.4.0", "ethcore-ipc-codegen 1.4.0", diff --git a/Cargo.toml b/Cargo.toml index fe72d67ec..a8d7ba794 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,6 +43,7 @@ ethcore-ipc-nano = { path = "ipc/nano" } ethcore-ipc = { path = "ipc/rpc" } ethcore-ipc-hypervisor = { path = "ipc/hypervisor" } ethcore-logger = { path = "logger" } +ethcore-hash-fetch = { path = "ethcore/hash-fetch" } rlp = { path = "util/rlp" } ethcore-stratum = { path = "stratum" } ethcore-dapps = { path = "dapps", optional = true } diff --git a/parity/dapps.rs b/parity/dapps.rs index 80f2f7060..16ae4dd98 100644 --- a/parity/dapps.rs +++ b/parity/dapps.rs @@ -110,7 +110,7 @@ mod server { use rpc_apis; use ethcore_rpc::is_major_importing; - use ethcore_dapps::ContractClient; + use hash_fetch::urlhint::ContractClient; pub use ethcore_dapps::Server as WebappServer; diff --git a/parity/main.rs b/parity/main.rs index 0fc88d8e7..274d29de2 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -42,6 +42,7 @@ extern crate ethcore_ipc_nano as nanoipc; extern crate serde; extern crate serde_json; extern crate rlp; +extern crate ethcore_hash_fetch as hash_fetch; extern crate json_ipc_server as jsonipc; From 21b2b4ac273137839c5c7dcb4919f193d60a16c6 Mon Sep 17 00:00:00 2001 From: GitLab Build Bot Date: Mon, 21 Nov 2016 09:37:54 +0000 Subject: [PATCH 08/26] [ci skip] js-precompiled 20161121-093611 --- Cargo.lock | 2 +- js/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69a964d11..02e45b49e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1263,7 +1263,7 @@ dependencies = [ [[package]] name = "parity-ui-precompiled" version = "1.4.0" -source = "git+https://github.com/ethcore/js-precompiled.git#2f78566b69c96e21ca1799cbf04d7a4d510c6240" +source = "git+https://github.com/ethcore/js-precompiled.git#587684374a12bf715151dd987a552a3d61e42972" dependencies = [ "parity-dapps-glue 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/js/package.json b/js/package.json index d4c418f37..7f4157cad 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "parity.js", - "version": "0.2.57", + "version": "0.2.58", "main": "release/index.js", "jsnext:main": "src/index.js", "author": "Parity Team ", From d48391d6be7195408b0aaa0d54053aceaf80a428 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 21 Nov 2016 12:26:38 +0100 Subject: [PATCH 09/26] ropsten --- js/src/redux/providers/status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/redux/providers/status.js b/js/src/redux/providers/status.js index ed7a2cbe0..bdc4dd38b 100644 --- a/js/src/redux/providers/status.js +++ b/js/src/redux/providers/status.js @@ -251,7 +251,7 @@ export default class Status { .then(([ clientVersion, defaultExtraData, netChain, netPort, rpcSettings, enode ]) => { - const isTest = netChain === 'morden' || netChain === 'testnet'; + const isTest = netChain === 'morden' || netChain === 'ropsten' || netChain === 'testnet'; const longStatus = { clientVersion, From 278b1e3bd50a5668d185ce094c439258dd8dcaed Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 21 Nov 2016 13:04:32 +0100 Subject: [PATCH 10/26] ropsten updates as per comment --- js/src/dapps/basiccoin/services.js | 2 +- js/src/redux/providers/statusReducer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/dapps/basiccoin/services.js b/js/src/dapps/basiccoin/services.js index 4aed4199f..3dd5202a7 100644 --- a/js/src/dapps/basiccoin/services.js +++ b/js/src/dapps/basiccoin/services.js @@ -105,7 +105,7 @@ export function attachInstances () { ]) .then(([registryAddress, netChain]) => { const registry = api.newContract(abis.registry, registryAddress).instance; - isTest = netChain === 'morden' || netChain === 'testnet'; + isTest = ['morden', 'ropsten', 'testnet'].includes(netChain); console.log(`contract was found at registry=${registryAddress}`); console.log(`running on ${netChain}, isTest=${isTest}`); diff --git a/js/src/redux/providers/statusReducer.js b/js/src/redux/providers/statusReducer.js index f0b6947c0..07fa993b9 100644 --- a/js/src/redux/providers/statusReducer.js +++ b/js/src/redux/providers/statusReducer.js @@ -31,7 +31,7 @@ const initialState = { gasLimit: new BigNumber(0), hashrate: new BigNumber(0), minGasPrice: new BigNumber(0), - netChain: 'morden', + netChain: 'ropsten', netPeers: { active: new BigNumber(0), connected: new BigNumber(0), From c6db1575542b5c33f635dfa95356d11d57bba1fb Mon Sep 17 00:00:00 2001 From: keorn Date: Mon, 21 Nov 2016 12:06:14 +0000 Subject: [PATCH 11/26] fix flaky test, clean up specs --- ethcore/res/authority_round.json | 4 ++-- ethcore/res/instant_seal.json | 6 +++--- ethcore/src/engines/authority_round.rs | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ethcore/res/authority_round.json b/ethcore/res/authority_round.json index ad23b461f..9ab782395 100644 --- a/ethcore/res/authority_round.json +++ b/ethcore/res/authority_round.json @@ -21,8 +21,8 @@ "genesis": { "seal": { "generic": { - "fields": 1, - "rlp": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa" + "fields": 2, + "rlp": "0x200" } }, "difficulty": "0x20000", diff --git a/ethcore/res/instant_seal.json b/ethcore/res/instant_seal.json index 2d5b38659..a6b24faf9 100644 --- a/ethcore/res/instant_seal.json +++ b/ethcore/res/instant_seal.json @@ -11,9 +11,9 @@ }, "genesis": { "seal": { - "ethereum": { - "nonce": "0x00006d6f7264656e", - "mixHash": "0x00000000000000000000000000000000000000647572616c65787365646c6578" + "generic": { + "fields": 0, + "rlp": "0x0" } }, "difficulty": "0x20000", diff --git a/ethcore/src/engines/authority_round.rs b/ethcore/src/engines/authority_round.rs index 9bed99e8b..8bd4156d7 100644 --- a/ethcore/src/engines/authority_round.rs +++ b/ethcore/src/engines/authority_round.rs @@ -254,8 +254,8 @@ impl Engine for AuthorityRound { /// Check if the signature belongs to the correct proposer. fn verify_block_unordered(&self, header: &Header, _block: Option<&[u8]>) -> Result<(), Error> { - let header_step = try!(header_step(header)); - // Give one step slack if step is lagging, double vote is still not possible. + let header_step = try!(header_step(header)); + // Give one step slack if step is lagging, double vote is still not possible. if header_step <= self.step() + 1 { let proposer_signature = try!(header_signature(header)); let ok_sig = try!(verify_address(self.step_proposer(header_step), &proposer_signature, &header.bare_hash())); @@ -417,13 +417,13 @@ mod tests { let engine = Spec::new_test_round().engine; let signature = tap.sign(addr, Some("0".into()), header.bare_hash()).unwrap(); - let mut step = UNIX_EPOCH.elapsed().unwrap().as_secs(); + let time = UNIX_EPOCH.elapsed().unwrap().as_secs(); + // Two authorities. + let mut step = time - time % 2; header.set_seal(vec![encode(&step).to_vec(), encode(&(&*signature as &[u8])).to_vec()]); - let first_ok = engine.verify_block_seal(&header).is_ok(); + assert!(engine.verify_block_seal(&header).is_err()); step = step + 1; header.set_seal(vec![encode(&step).to_vec(), encode(&(&*signature as &[u8])).to_vec()]); - let second_ok = engine.verify_block_seal(&header).is_ok(); - - assert!(first_ok ^ second_ok); + assert!(engine.verify_block_seal(&header).is_ok()); } } From 959ccc705a81aa912ade59f5125a30f7b9997ee3 Mon Sep 17 00:00:00 2001 From: keorn Date: Mon, 21 Nov 2016 12:07:43 +0000 Subject: [PATCH 12/26] fix indent --- ethcore/src/engines/authority_round.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/src/engines/authority_round.rs b/ethcore/src/engines/authority_round.rs index 8bd4156d7..830fcf9c8 100644 --- a/ethcore/src/engines/authority_round.rs +++ b/ethcore/src/engines/authority_round.rs @@ -255,7 +255,7 @@ impl Engine for AuthorityRound { /// Check if the signature belongs to the correct proposer. fn verify_block_unordered(&self, header: &Header, _block: Option<&[u8]>) -> Result<(), Error> { let header_step = try!(header_step(header)); - // Give one step slack if step is lagging, double vote is still not possible. + // Give one step slack if step is lagging, double vote is still not possible. if header_step <= self.step() + 1 { let proposer_signature = try!(header_signature(header)); let ok_sig = try!(verify_address(self.step_proposer(header_step), &proposer_signature, &header.bare_hash())); From 8bb8ecac2dd40e9e6112ffa7d43f0047a4f976e5 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 21 Nov 2016 14:39:26 +0100 Subject: [PATCH 13/26] --testnet set to ropset --- parity/cli/usage.txt | 2 +- parity/configuration.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parity/cli/usage.txt b/parity/cli/usage.txt index 89603d311..3e3e79247 100644 --- a/parity/cli/usage.txt +++ b/parity/cli/usage.txt @@ -32,7 +32,7 @@ Operating Options: (default: {flag_mode_alarm}). --chain CHAIN Specify the blockchain type. CHAIN may be either a JSON chain specification file or olympic, frontier, - homestead, mainnet, morden, classic, expanse, + homestead, mainnet, morden, ropsten, classic, expanse, testnet or dev (default: {flag_chain}). -d --db-path PATH Specify the database & configuration directory path (default: {flag_db_path}). diff --git a/parity/configuration.rs b/parity/configuration.rs index 61063aa18..5188b44f1 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -313,7 +313,7 @@ impl Configuration { fn chain(&self) -> String { if self.args.flag_testnet { - "morden".to_owned() + "ropsten".to_owned() } else { self.args.flag_chain.clone() } @@ -905,7 +905,7 @@ mod tests { // then assert_eq!(conf.network_settings(), NetworkSettings { name: "testname".to_owned(), - chain: "morden".to_owned(), + chain: "ropsten".to_owned(), network_port: 30303, rpc_enabled: true, rpc_interface: "local".to_owned(), From efdf017c430c71df1efca166cba46c4791a06677 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 21 Nov 2016 15:03:20 +0100 Subject: [PATCH 14/26] Import account message --- parity/account.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parity/account.rs b/parity/account.rs index 9d400cab5..ae7e1f62b 100644 --- a/parity/account.rs +++ b/parity/account.rs @@ -102,7 +102,7 @@ fn import(i: ImportAccounts) -> Result { let from = DiskDirectory::at(path); imported += try!(import_accounts(&from, &to).map_err(|_| "Importing accounts failed.")).len(); } - Ok(format!("{}", imported)) + Ok(format!("{} account(s) imported", imported)) } fn import_geth(i: ImportFromGethAccounts) -> Result { From e90743ecbf595f7a4c9c02db87700e011c4b757c Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 21 Nov 2016 15:47:36 +0100 Subject: [PATCH 15/26] Use actual registry fee --- js/src/dapps/registry/Names/actions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/src/dapps/registry/Names/actions.js b/js/src/dapps/registry/Names/actions.js index ee73ad78e..fb319f166 100644 --- a/js/src/dapps/registry/Names/actions.js +++ b/js/src/dapps/registry/Names/actions.js @@ -29,6 +29,8 @@ export const reserve = (name) => (dispatch, getState) => { const state = getState(); const account = state.accounts.selected; const contract = state.contract; + const fee = state.fee; + if (!contract || !account) return; if (alreadyQueued(state.names.queue, 'reserve', name)) return; const reserve = contract.functions.find((f) => f.name === 'reserve'); @@ -36,7 +38,7 @@ export const reserve = (name) => (dispatch, getState) => { name = name.toLowerCase(); const options = { from: account.address, - value: toWei(1).toString() + value: fee }; const values = [ sha3(name) ]; From 42964e9a8e167c7c8d36aa75fca41ea70a7b7c05 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 21 Nov 2016 15:48:46 +0100 Subject: [PATCH 16/26] lint fixes --- js/src/dapps/registry/Names/actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/dapps/registry/Names/actions.js b/js/src/dapps/registry/Names/actions.js index fb319f166..74e446d9d 100644 --- a/js/src/dapps/registry/Names/actions.js +++ b/js/src/dapps/registry/Names/actions.js @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -import { sha3, toWei } from '../parity.js'; +import { sha3 } from '../parity.js'; const alreadyQueued = (queue, action, name) => !!queue.find((entry) => entry.action === action && entry.name === name); From af0db9f80eecf88577c86253166fdaf8ce5cc713 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 21 Nov 2016 18:14:23 +0100 Subject: [PATCH 17/26] New registry contract address for ropsten (#3549) * New registry for ropsten * Registry address * Registry with payable modifier --- ethcore/res/ethereum/ropsten.json | 504 +++++++++++++++--------------- 1 file changed, 252 insertions(+), 252 deletions(-) diff --git a/ethcore/res/ethereum/ropsten.json b/ethcore/res/ethereum/ropsten.json index c92676161..62282801d 100644 --- a/ethcore/res/ethereum/ropsten.json +++ b/ethcore/res/ethereum/ropsten.json @@ -8,7 +8,7 @@ "difficultyBoundDivisor": "0x0800", "durationLimit": "0x0d", "blockReward": "0x4563918244F40000", - "registrar": "0x52dff57a8a1532e6afb3dc07e2af58bb9eb05b3d", + "registrar": "0x81a4b044831c4f12ba601adb9274516939e9b8a2", "homesteadTransition": 0, "eip150Transition": 0, "eip155Transition": 10, @@ -47,258 +47,258 @@ "0000000000000000000000000000000000000002": { "balance": "1", "nonce": "0", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, "0000000000000000000000000000000000000003": { "balance": "1", "nonce": "0", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, "0000000000000000000000000000000000000004": { "balance": "1", "nonce": "0", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, - "0000000000000000000000000000000000000000": { "balance": "1" }, - "0000000000000000000000000000000000000005": { "balance": "1" }, - "0000000000000000000000000000000000000006": { "balance": "1" }, - "0000000000000000000000000000000000000007": { "balance": "1" }, - "0000000000000000000000000000000000000008": { "balance": "1" }, - "0000000000000000000000000000000000000009": { "balance": "1" }, - "000000000000000000000000000000000000000a": { "balance": "0" }, - "000000000000000000000000000000000000000b": { "balance": "0" }, - "000000000000000000000000000000000000000c": { "balance": "0" }, - "000000000000000000000000000000000000000d": { "balance": "0" }, - "000000000000000000000000000000000000000e": { "balance": "0" }, - "000000000000000000000000000000000000000f": { "balance": "0" }, - "0000000000000000000000000000000000000010": { "balance": "0" }, - "0000000000000000000000000000000000000011": { "balance": "0" }, - "0000000000000000000000000000000000000012": { "balance": "0" }, - "0000000000000000000000000000000000000013": { "balance": "0" }, - "0000000000000000000000000000000000000014": { "balance": "0" }, - "0000000000000000000000000000000000000015": { "balance": "0" }, - "0000000000000000000000000000000000000016": { "balance": "0" }, - "0000000000000000000000000000000000000017": { "balance": "0" }, - "0000000000000000000000000000000000000018": { "balance": "0" }, - "0000000000000000000000000000000000000019": { "balance": "0" }, - "000000000000000000000000000000000000001a": { "balance": "0" }, - "000000000000000000000000000000000000001b": { "balance": "0" }, - "000000000000000000000000000000000000001c": { "balance": "0" }, - "000000000000000000000000000000000000001d": { "balance": "0" }, - "000000000000000000000000000000000000001e": { "balance": "0" }, - "000000000000000000000000000000000000001f": { "balance": "0" }, - "0000000000000000000000000000000000000020": { "balance": "0" }, - "0000000000000000000000000000000000000021": { "balance": "0" }, - "0000000000000000000000000000000000000022": { "balance": "0" }, - "0000000000000000000000000000000000000023": { "balance": "0" }, - "0000000000000000000000000000000000000024": { "balance": "0" }, - "0000000000000000000000000000000000000025": { "balance": "0" }, - "0000000000000000000000000000000000000026": { "balance": "0" }, - "0000000000000000000000000000000000000027": { "balance": "0" }, - "0000000000000000000000000000000000000028": { "balance": "0" }, - "0000000000000000000000000000000000000029": { "balance": "0" }, - "000000000000000000000000000000000000002a": { "balance": "0" }, - "000000000000000000000000000000000000002b": { "balance": "0" }, - "000000000000000000000000000000000000002c": { "balance": "0" }, - "000000000000000000000000000000000000002d": { "balance": "0" }, - "000000000000000000000000000000000000002e": { "balance": "0" }, - "000000000000000000000000000000000000002f": { "balance": "0" }, - "0000000000000000000000000000000000000030": { "balance": "0" }, - "0000000000000000000000000000000000000031": { "balance": "0" }, - "0000000000000000000000000000000000000032": { "balance": "0" }, - "0000000000000000000000000000000000000033": { "balance": "0" }, - "0000000000000000000000000000000000000034": { "balance": "0" }, - "0000000000000000000000000000000000000035": { "balance": "0" }, - "0000000000000000000000000000000000000036": { "balance": "0" }, - "0000000000000000000000000000000000000037": { "balance": "0" }, - "0000000000000000000000000000000000000038": { "balance": "0" }, - "0000000000000000000000000000000000000039": { "balance": "0" }, - "000000000000000000000000000000000000003a": { "balance": "0" }, - "000000000000000000000000000000000000003b": { "balance": "0" }, - "000000000000000000000000000000000000003c": { "balance": "0" }, - "000000000000000000000000000000000000003d": { "balance": "0" }, - "000000000000000000000000000000000000003e": { "balance": "0" }, - "000000000000000000000000000000000000003f": { "balance": "0" }, - "0000000000000000000000000000000000000040": { "balance": "0" }, - "0000000000000000000000000000000000000041": { "balance": "0" }, - "0000000000000000000000000000000000000042": { "balance": "0" }, - "0000000000000000000000000000000000000043": { "balance": "0" }, - "0000000000000000000000000000000000000044": { "balance": "0" }, - "0000000000000000000000000000000000000045": { "balance": "0" }, - "0000000000000000000000000000000000000046": { "balance": "0" }, - "0000000000000000000000000000000000000047": { "balance": "0" }, - "0000000000000000000000000000000000000048": { "balance": "0" }, - "0000000000000000000000000000000000000049": { "balance": "0" }, - "000000000000000000000000000000000000004a": { "balance": "0" }, - "000000000000000000000000000000000000004b": { "balance": "0" }, - "000000000000000000000000000000000000004c": { "balance": "0" }, - "000000000000000000000000000000000000004d": { "balance": "0" }, - "000000000000000000000000000000000000004e": { "balance": "0" }, - "000000000000000000000000000000000000004f": { "balance": "0" }, - "0000000000000000000000000000000000000050": { "balance": "0" }, - "0000000000000000000000000000000000000051": { "balance": "0" }, - "0000000000000000000000000000000000000052": { "balance": "0" }, - "0000000000000000000000000000000000000053": { "balance": "0" }, - "0000000000000000000000000000000000000054": { "balance": "0" }, - "0000000000000000000000000000000000000055": { "balance": "0" }, - "0000000000000000000000000000000000000056": { "balance": "0" }, - "0000000000000000000000000000000000000057": { "balance": "0" }, - "0000000000000000000000000000000000000058": { "balance": "0" }, - "0000000000000000000000000000000000000059": { "balance": "0" }, - "000000000000000000000000000000000000005a": { "balance": "0" }, - "000000000000000000000000000000000000005b": { "balance": "0" }, - "000000000000000000000000000000000000005c": { "balance": "0" }, - "000000000000000000000000000000000000005d": { "balance": "0" }, - "000000000000000000000000000000000000005e": { "balance": "0" }, - "000000000000000000000000000000000000005f": { "balance": "0" }, - "0000000000000000000000000000000000000060": { "balance": "0" }, - "0000000000000000000000000000000000000061": { "balance": "0" }, - "0000000000000000000000000000000000000062": { "balance": "0" }, - "0000000000000000000000000000000000000063": { "balance": "0" }, - "0000000000000000000000000000000000000064": { "balance": "0" }, - "0000000000000000000000000000000000000065": { "balance": "0" }, - "0000000000000000000000000000000000000066": { "balance": "0" }, - "0000000000000000000000000000000000000067": { "balance": "0" }, - "0000000000000000000000000000000000000068": { "balance": "0" }, - "0000000000000000000000000000000000000069": { "balance": "0" }, - "000000000000000000000000000000000000006a": { "balance": "0" }, - "000000000000000000000000000000000000006b": { "balance": "0" }, - "000000000000000000000000000000000000006c": { "balance": "0" }, - "000000000000000000000000000000000000006d": { "balance": "0" }, - "000000000000000000000000000000000000006e": { "balance": "0" }, - "000000000000000000000000000000000000006f": { "balance": "0" }, - "0000000000000000000000000000000000000070": { "balance": "0" }, - "0000000000000000000000000000000000000071": { "balance": "0" }, - "0000000000000000000000000000000000000072": { "balance": "0" }, - "0000000000000000000000000000000000000073": { "balance": "0" }, - "0000000000000000000000000000000000000074": { "balance": "0" }, - "0000000000000000000000000000000000000075": { "balance": "0" }, - "0000000000000000000000000000000000000076": { "balance": "0" }, - "0000000000000000000000000000000000000077": { "balance": "0" }, - "0000000000000000000000000000000000000078": { "balance": "0" }, - "0000000000000000000000000000000000000079": { "balance": "0" }, - "000000000000000000000000000000000000007a": { "balance": "0" }, - "000000000000000000000000000000000000007b": { "balance": "0" }, - "000000000000000000000000000000000000007c": { "balance": "0" }, - "000000000000000000000000000000000000007d": { "balance": "0" }, - "000000000000000000000000000000000000007e": { "balance": "0" }, - "000000000000000000000000000000000000007f": { "balance": "0" }, - "0000000000000000000000000000000000000080": { "balance": "0" }, - "0000000000000000000000000000000000000081": { "balance": "0" }, - "0000000000000000000000000000000000000082": { "balance": "0" }, - "0000000000000000000000000000000000000083": { "balance": "0" }, - "0000000000000000000000000000000000000084": { "balance": "0" }, - "0000000000000000000000000000000000000085": { "balance": "0" }, - "0000000000000000000000000000000000000086": { "balance": "0" }, - "0000000000000000000000000000000000000087": { "balance": "0" }, - "0000000000000000000000000000000000000088": { "balance": "0" }, - "0000000000000000000000000000000000000089": { "balance": "0" }, - "000000000000000000000000000000000000008a": { "balance": "0" }, - "000000000000000000000000000000000000008b": { "balance": "0" }, - "000000000000000000000000000000000000008c": { "balance": "0" }, - "000000000000000000000000000000000000008d": { "balance": "0" }, - "000000000000000000000000000000000000008e": { "balance": "0" }, - "000000000000000000000000000000000000008f": { "balance": "0" }, - "0000000000000000000000000000000000000090": { "balance": "0" }, - "0000000000000000000000000000000000000091": { "balance": "0" }, - "0000000000000000000000000000000000000092": { "balance": "0" }, - "0000000000000000000000000000000000000093": { "balance": "0" }, - "0000000000000000000000000000000000000094": { "balance": "0" }, - "0000000000000000000000000000000000000095": { "balance": "0" }, - "0000000000000000000000000000000000000096": { "balance": "0" }, - "0000000000000000000000000000000000000097": { "balance": "0" }, - "0000000000000000000000000000000000000098": { "balance": "0" }, - "0000000000000000000000000000000000000099": { "balance": "0" }, - "000000000000000000000000000000000000009a": { "balance": "0" }, - "000000000000000000000000000000000000009b": { "balance": "0" }, - "000000000000000000000000000000000000009c": { "balance": "0" }, - "000000000000000000000000000000000000009d": { "balance": "0" }, - "000000000000000000000000000000000000009e": { "balance": "0" }, - "000000000000000000000000000000000000009f": { "balance": "0" }, - "00000000000000000000000000000000000000a0": { "balance": "0" }, - "00000000000000000000000000000000000000a1": { "balance": "0" }, - "00000000000000000000000000000000000000a2": { "balance": "0" }, - "00000000000000000000000000000000000000a3": { "balance": "0" }, - "00000000000000000000000000000000000000a4": { "balance": "0" }, - "00000000000000000000000000000000000000a5": { "balance": "0" }, - "00000000000000000000000000000000000000a6": { "balance": "0" }, - "00000000000000000000000000000000000000a7": { "balance": "0" }, - "00000000000000000000000000000000000000a8": { "balance": "0" }, - "00000000000000000000000000000000000000a9": { "balance": "0" }, - "00000000000000000000000000000000000000aa": { "balance": "0" }, - "00000000000000000000000000000000000000ab": { "balance": "0" }, - "00000000000000000000000000000000000000ac": { "balance": "0" }, - "00000000000000000000000000000000000000ad": { "balance": "0" }, - "00000000000000000000000000000000000000ae": { "balance": "0" }, - "00000000000000000000000000000000000000af": { "balance": "0" }, - "00000000000000000000000000000000000000b0": { "balance": "0" }, - "00000000000000000000000000000000000000b1": { "balance": "0" }, - "00000000000000000000000000000000000000b2": { "balance": "0" }, - "00000000000000000000000000000000000000b3": { "balance": "0" }, - "00000000000000000000000000000000000000b4": { "balance": "0" }, - "00000000000000000000000000000000000000b5": { "balance": "0" }, - "00000000000000000000000000000000000000b6": { "balance": "0" }, - "00000000000000000000000000000000000000b7": { "balance": "0" }, - "00000000000000000000000000000000000000b8": { "balance": "0" }, - "00000000000000000000000000000000000000b9": { "balance": "0" }, - "00000000000000000000000000000000000000ba": { "balance": "0" }, - "00000000000000000000000000000000000000bb": { "balance": "0" }, - "00000000000000000000000000000000000000bc": { "balance": "0" }, - "00000000000000000000000000000000000000bd": { "balance": "0" }, - "00000000000000000000000000000000000000be": { "balance": "0" }, - "00000000000000000000000000000000000000bf": { "balance": "0" }, - "00000000000000000000000000000000000000c0": { "balance": "0" }, - "00000000000000000000000000000000000000c1": { "balance": "0" }, - "00000000000000000000000000000000000000c2": { "balance": "0" }, - "00000000000000000000000000000000000000c3": { "balance": "0" }, - "00000000000000000000000000000000000000c4": { "balance": "0" }, - "00000000000000000000000000000000000000c5": { "balance": "0" }, - "00000000000000000000000000000000000000c6": { "balance": "0" }, - "00000000000000000000000000000000000000c7": { "balance": "0" }, - "00000000000000000000000000000000000000c8": { "balance": "0" }, - "00000000000000000000000000000000000000c9": { "balance": "0" }, - "00000000000000000000000000000000000000ca": { "balance": "0" }, - "00000000000000000000000000000000000000cb": { "balance": "0" }, - "00000000000000000000000000000000000000cc": { "balance": "0" }, - "00000000000000000000000000000000000000cd": { "balance": "0" }, - "00000000000000000000000000000000000000ce": { "balance": "0" }, - "00000000000000000000000000000000000000cf": { "balance": "0" }, - "00000000000000000000000000000000000000d0": { "balance": "0" }, - "00000000000000000000000000000000000000d1": { "balance": "0" }, - "00000000000000000000000000000000000000d2": { "balance": "0" }, - "00000000000000000000000000000000000000d3": { "balance": "0" }, - "00000000000000000000000000000000000000d4": { "balance": "0" }, - "00000000000000000000000000000000000000d5": { "balance": "0" }, - "00000000000000000000000000000000000000d6": { "balance": "0" }, - "00000000000000000000000000000000000000d7": { "balance": "0" }, - "00000000000000000000000000000000000000d8": { "balance": "0" }, - "00000000000000000000000000000000000000d9": { "balance": "0" }, + "0000000000000000000000000000000000000000": { "balance": "1" }, + "0000000000000000000000000000000000000005": { "balance": "1" }, + "0000000000000000000000000000000000000006": { "balance": "1" }, + "0000000000000000000000000000000000000007": { "balance": "1" }, + "0000000000000000000000000000000000000008": { "balance": "1" }, + "0000000000000000000000000000000000000009": { "balance": "1" }, + "000000000000000000000000000000000000000a": { "balance": "0" }, + "000000000000000000000000000000000000000b": { "balance": "0" }, + "000000000000000000000000000000000000000c": { "balance": "0" }, + "000000000000000000000000000000000000000d": { "balance": "0" }, + "000000000000000000000000000000000000000e": { "balance": "0" }, + "000000000000000000000000000000000000000f": { "balance": "0" }, + "0000000000000000000000000000000000000010": { "balance": "0" }, + "0000000000000000000000000000000000000011": { "balance": "0" }, + "0000000000000000000000000000000000000012": { "balance": "0" }, + "0000000000000000000000000000000000000013": { "balance": "0" }, + "0000000000000000000000000000000000000014": { "balance": "0" }, + "0000000000000000000000000000000000000015": { "balance": "0" }, + "0000000000000000000000000000000000000016": { "balance": "0" }, + "0000000000000000000000000000000000000017": { "balance": "0" }, + "0000000000000000000000000000000000000018": { "balance": "0" }, + "0000000000000000000000000000000000000019": { "balance": "0" }, + "000000000000000000000000000000000000001a": { "balance": "0" }, + "000000000000000000000000000000000000001b": { "balance": "0" }, + "000000000000000000000000000000000000001c": { "balance": "0" }, + "000000000000000000000000000000000000001d": { "balance": "0" }, + "000000000000000000000000000000000000001e": { "balance": "0" }, + "000000000000000000000000000000000000001f": { "balance": "0" }, + "0000000000000000000000000000000000000020": { "balance": "0" }, + "0000000000000000000000000000000000000021": { "balance": "0" }, + "0000000000000000000000000000000000000022": { "balance": "0" }, + "0000000000000000000000000000000000000023": { "balance": "0" }, + "0000000000000000000000000000000000000024": { "balance": "0" }, + "0000000000000000000000000000000000000025": { "balance": "0" }, + "0000000000000000000000000000000000000026": { "balance": "0" }, + "0000000000000000000000000000000000000027": { "balance": "0" }, + "0000000000000000000000000000000000000028": { "balance": "0" }, + "0000000000000000000000000000000000000029": { "balance": "0" }, + "000000000000000000000000000000000000002a": { "balance": "0" }, + "000000000000000000000000000000000000002b": { "balance": "0" }, + "000000000000000000000000000000000000002c": { "balance": "0" }, + "000000000000000000000000000000000000002d": { "balance": "0" }, + "000000000000000000000000000000000000002e": { "balance": "0" }, + "000000000000000000000000000000000000002f": { "balance": "0" }, + "0000000000000000000000000000000000000030": { "balance": "0" }, + "0000000000000000000000000000000000000031": { "balance": "0" }, + "0000000000000000000000000000000000000032": { "balance": "0" }, + "0000000000000000000000000000000000000033": { "balance": "0" }, + "0000000000000000000000000000000000000034": { "balance": "0" }, + "0000000000000000000000000000000000000035": { "balance": "0" }, + "0000000000000000000000000000000000000036": { "balance": "0" }, + "0000000000000000000000000000000000000037": { "balance": "0" }, + "0000000000000000000000000000000000000038": { "balance": "0" }, + "0000000000000000000000000000000000000039": { "balance": "0" }, + "000000000000000000000000000000000000003a": { "balance": "0" }, + "000000000000000000000000000000000000003b": { "balance": "0" }, + "000000000000000000000000000000000000003c": { "balance": "0" }, + "000000000000000000000000000000000000003d": { "balance": "0" }, + "000000000000000000000000000000000000003e": { "balance": "0" }, + "000000000000000000000000000000000000003f": { "balance": "0" }, + "0000000000000000000000000000000000000040": { "balance": "0" }, + "0000000000000000000000000000000000000041": { "balance": "0" }, + "0000000000000000000000000000000000000042": { "balance": "0" }, + "0000000000000000000000000000000000000043": { "balance": "0" }, + "0000000000000000000000000000000000000044": { "balance": "0" }, + "0000000000000000000000000000000000000045": { "balance": "0" }, + "0000000000000000000000000000000000000046": { "balance": "0" }, + "0000000000000000000000000000000000000047": { "balance": "0" }, + "0000000000000000000000000000000000000048": { "balance": "0" }, + "0000000000000000000000000000000000000049": { "balance": "0" }, + "000000000000000000000000000000000000004a": { "balance": "0" }, + "000000000000000000000000000000000000004b": { "balance": "0" }, + "000000000000000000000000000000000000004c": { "balance": "0" }, + "000000000000000000000000000000000000004d": { "balance": "0" }, + "000000000000000000000000000000000000004e": { "balance": "0" }, + "000000000000000000000000000000000000004f": { "balance": "0" }, + "0000000000000000000000000000000000000050": { "balance": "0" }, + "0000000000000000000000000000000000000051": { "balance": "0" }, + "0000000000000000000000000000000000000052": { "balance": "0" }, + "0000000000000000000000000000000000000053": { "balance": "0" }, + "0000000000000000000000000000000000000054": { "balance": "0" }, + "0000000000000000000000000000000000000055": { "balance": "0" }, + "0000000000000000000000000000000000000056": { "balance": "0" }, + "0000000000000000000000000000000000000057": { "balance": "0" }, + "0000000000000000000000000000000000000058": { "balance": "0" }, + "0000000000000000000000000000000000000059": { "balance": "0" }, + "000000000000000000000000000000000000005a": { "balance": "0" }, + "000000000000000000000000000000000000005b": { "balance": "0" }, + "000000000000000000000000000000000000005c": { "balance": "0" }, + "000000000000000000000000000000000000005d": { "balance": "0" }, + "000000000000000000000000000000000000005e": { "balance": "0" }, + "000000000000000000000000000000000000005f": { "balance": "0" }, + "0000000000000000000000000000000000000060": { "balance": "0" }, + "0000000000000000000000000000000000000061": { "balance": "0" }, + "0000000000000000000000000000000000000062": { "balance": "0" }, + "0000000000000000000000000000000000000063": { "balance": "0" }, + "0000000000000000000000000000000000000064": { "balance": "0" }, + "0000000000000000000000000000000000000065": { "balance": "0" }, + "0000000000000000000000000000000000000066": { "balance": "0" }, + "0000000000000000000000000000000000000067": { "balance": "0" }, + "0000000000000000000000000000000000000068": { "balance": "0" }, + "0000000000000000000000000000000000000069": { "balance": "0" }, + "000000000000000000000000000000000000006a": { "balance": "0" }, + "000000000000000000000000000000000000006b": { "balance": "0" }, + "000000000000000000000000000000000000006c": { "balance": "0" }, + "000000000000000000000000000000000000006d": { "balance": "0" }, + "000000000000000000000000000000000000006e": { "balance": "0" }, + "000000000000000000000000000000000000006f": { "balance": "0" }, + "0000000000000000000000000000000000000070": { "balance": "0" }, + "0000000000000000000000000000000000000071": { "balance": "0" }, + "0000000000000000000000000000000000000072": { "balance": "0" }, + "0000000000000000000000000000000000000073": { "balance": "0" }, + "0000000000000000000000000000000000000074": { "balance": "0" }, + "0000000000000000000000000000000000000075": { "balance": "0" }, + "0000000000000000000000000000000000000076": { "balance": "0" }, + "0000000000000000000000000000000000000077": { "balance": "0" }, + "0000000000000000000000000000000000000078": { "balance": "0" }, + "0000000000000000000000000000000000000079": { "balance": "0" }, + "000000000000000000000000000000000000007a": { "balance": "0" }, + "000000000000000000000000000000000000007b": { "balance": "0" }, + "000000000000000000000000000000000000007c": { "balance": "0" }, + "000000000000000000000000000000000000007d": { "balance": "0" }, + "000000000000000000000000000000000000007e": { "balance": "0" }, + "000000000000000000000000000000000000007f": { "balance": "0" }, + "0000000000000000000000000000000000000080": { "balance": "0" }, + "0000000000000000000000000000000000000081": { "balance": "0" }, + "0000000000000000000000000000000000000082": { "balance": "0" }, + "0000000000000000000000000000000000000083": { "balance": "0" }, + "0000000000000000000000000000000000000084": { "balance": "0" }, + "0000000000000000000000000000000000000085": { "balance": "0" }, + "0000000000000000000000000000000000000086": { "balance": "0" }, + "0000000000000000000000000000000000000087": { "balance": "0" }, + "0000000000000000000000000000000000000088": { "balance": "0" }, + "0000000000000000000000000000000000000089": { "balance": "0" }, + "000000000000000000000000000000000000008a": { "balance": "0" }, + "000000000000000000000000000000000000008b": { "balance": "0" }, + "000000000000000000000000000000000000008c": { "balance": "0" }, + "000000000000000000000000000000000000008d": { "balance": "0" }, + "000000000000000000000000000000000000008e": { "balance": "0" }, + "000000000000000000000000000000000000008f": { "balance": "0" }, + "0000000000000000000000000000000000000090": { "balance": "0" }, + "0000000000000000000000000000000000000091": { "balance": "0" }, + "0000000000000000000000000000000000000092": { "balance": "0" }, + "0000000000000000000000000000000000000093": { "balance": "0" }, + "0000000000000000000000000000000000000094": { "balance": "0" }, + "0000000000000000000000000000000000000095": { "balance": "0" }, + "0000000000000000000000000000000000000096": { "balance": "0" }, + "0000000000000000000000000000000000000097": { "balance": "0" }, + "0000000000000000000000000000000000000098": { "balance": "0" }, + "0000000000000000000000000000000000000099": { "balance": "0" }, + "000000000000000000000000000000000000009a": { "balance": "0" }, + "000000000000000000000000000000000000009b": { "balance": "0" }, + "000000000000000000000000000000000000009c": { "balance": "0" }, + "000000000000000000000000000000000000009d": { "balance": "0" }, + "000000000000000000000000000000000000009e": { "balance": "0" }, + "000000000000000000000000000000000000009f": { "balance": "0" }, + "00000000000000000000000000000000000000a0": { "balance": "0" }, + "00000000000000000000000000000000000000a1": { "balance": "0" }, + "00000000000000000000000000000000000000a2": { "balance": "0" }, + "00000000000000000000000000000000000000a3": { "balance": "0" }, + "00000000000000000000000000000000000000a4": { "balance": "0" }, + "00000000000000000000000000000000000000a5": { "balance": "0" }, + "00000000000000000000000000000000000000a6": { "balance": "0" }, + "00000000000000000000000000000000000000a7": { "balance": "0" }, + "00000000000000000000000000000000000000a8": { "balance": "0" }, + "00000000000000000000000000000000000000a9": { "balance": "0" }, + "00000000000000000000000000000000000000aa": { "balance": "0" }, + "00000000000000000000000000000000000000ab": { "balance": "0" }, + "00000000000000000000000000000000000000ac": { "balance": "0" }, + "00000000000000000000000000000000000000ad": { "balance": "0" }, + "00000000000000000000000000000000000000ae": { "balance": "0" }, + "00000000000000000000000000000000000000af": { "balance": "0" }, + "00000000000000000000000000000000000000b0": { "balance": "0" }, + "00000000000000000000000000000000000000b1": { "balance": "0" }, + "00000000000000000000000000000000000000b2": { "balance": "0" }, + "00000000000000000000000000000000000000b3": { "balance": "0" }, + "00000000000000000000000000000000000000b4": { "balance": "0" }, + "00000000000000000000000000000000000000b5": { "balance": "0" }, + "00000000000000000000000000000000000000b6": { "balance": "0" }, + "00000000000000000000000000000000000000b7": { "balance": "0" }, + "00000000000000000000000000000000000000b8": { "balance": "0" }, + "00000000000000000000000000000000000000b9": { "balance": "0" }, + "00000000000000000000000000000000000000ba": { "balance": "0" }, + "00000000000000000000000000000000000000bb": { "balance": "0" }, + "00000000000000000000000000000000000000bc": { "balance": "0" }, + "00000000000000000000000000000000000000bd": { "balance": "0" }, + "00000000000000000000000000000000000000be": { "balance": "0" }, + "00000000000000000000000000000000000000bf": { "balance": "0" }, + "00000000000000000000000000000000000000c0": { "balance": "0" }, + "00000000000000000000000000000000000000c1": { "balance": "0" }, + "00000000000000000000000000000000000000c2": { "balance": "0" }, + "00000000000000000000000000000000000000c3": { "balance": "0" }, + "00000000000000000000000000000000000000c4": { "balance": "0" }, + "00000000000000000000000000000000000000c5": { "balance": "0" }, + "00000000000000000000000000000000000000c6": { "balance": "0" }, + "00000000000000000000000000000000000000c7": { "balance": "0" }, + "00000000000000000000000000000000000000c8": { "balance": "0" }, + "00000000000000000000000000000000000000c9": { "balance": "0" }, + "00000000000000000000000000000000000000ca": { "balance": "0" }, + "00000000000000000000000000000000000000cb": { "balance": "0" }, + "00000000000000000000000000000000000000cc": { "balance": "0" }, + "00000000000000000000000000000000000000cd": { "balance": "0" }, + "00000000000000000000000000000000000000ce": { "balance": "0" }, + "00000000000000000000000000000000000000cf": { "balance": "0" }, + "00000000000000000000000000000000000000d0": { "balance": "0" }, + "00000000000000000000000000000000000000d1": { "balance": "0" }, + "00000000000000000000000000000000000000d2": { "balance": "0" }, + "00000000000000000000000000000000000000d3": { "balance": "0" }, + "00000000000000000000000000000000000000d4": { "balance": "0" }, + "00000000000000000000000000000000000000d5": { "balance": "0" }, + "00000000000000000000000000000000000000d6": { "balance": "0" }, + "00000000000000000000000000000000000000d7": { "balance": "0" }, + "00000000000000000000000000000000000000d8": { "balance": "0" }, + "00000000000000000000000000000000000000d9": { "balance": "0" }, "00000000000000000000000000000000000000da": { "balance": "0" }, - "00000000000000000000000000000000000000db": { "balance": "0" }, - "00000000000000000000000000000000000000dc": { "balance": "0" }, - "00000000000000000000000000000000000000dd": { "balance": "0" }, - "00000000000000000000000000000000000000de": { "balance": "0" }, - "00000000000000000000000000000000000000df": { "balance": "0" }, - "00000000000000000000000000000000000000e0": { "balance": "0" }, - "00000000000000000000000000000000000000e1": { "balance": "0" }, - "00000000000000000000000000000000000000e2": { "balance": "0" }, - "00000000000000000000000000000000000000e3": { "balance": "0" }, - "00000000000000000000000000000000000000e4": { "balance": "0" }, - "00000000000000000000000000000000000000e5": { "balance": "0" }, - "00000000000000000000000000000000000000e6": { "balance": "0" }, - "00000000000000000000000000000000000000e7": { "balance": "0" }, - "00000000000000000000000000000000000000e8": { "balance": "0" }, - "00000000000000000000000000000000000000e9": { "balance": "0" }, - "00000000000000000000000000000000000000ea": { "balance": "0" }, - "00000000000000000000000000000000000000eb": { "balance": "0" }, - "00000000000000000000000000000000000000ec": { "balance": "0" }, - "00000000000000000000000000000000000000ed": { "balance": "0" }, - "00000000000000000000000000000000000000ee": { "balance": "0" }, - "00000000000000000000000000000000000000ef": { "balance": "0" }, - "00000000000000000000000000000000000000f0": { "balance": "0" }, - "00000000000000000000000000000000000000f1": { "balance": "0" }, - "00000000000000000000000000000000000000f2": { "balance": "0" }, - "00000000000000000000000000000000000000f3": { "balance": "0" }, - "00000000000000000000000000000000000000f4": { "balance": "0" }, - "00000000000000000000000000000000000000f5": { "balance": "0" }, - "00000000000000000000000000000000000000f6": { "balance": "0" }, - "00000000000000000000000000000000000000f7": { "balance": "0" }, - "00000000000000000000000000000000000000f8": { "balance": "0" }, - "00000000000000000000000000000000000000f9": { "balance": "0" }, - "00000000000000000000000000000000000000fa": { "balance": "0" }, - "00000000000000000000000000000000000000fb": { "balance": "0" }, - "00000000000000000000000000000000000000fc": { "balance": "0" }, - "00000000000000000000000000000000000000fd": { "balance": "0" }, - "00000000000000000000000000000000000000fe": { "balance": "0" }, - "00000000000000000000000000000000000000ff": { "balance": "0" }, + "00000000000000000000000000000000000000db": { "balance": "0" }, + "00000000000000000000000000000000000000dc": { "balance": "0" }, + "00000000000000000000000000000000000000dd": { "balance": "0" }, + "00000000000000000000000000000000000000de": { "balance": "0" }, + "00000000000000000000000000000000000000df": { "balance": "0" }, + "00000000000000000000000000000000000000e0": { "balance": "0" }, + "00000000000000000000000000000000000000e1": { "balance": "0" }, + "00000000000000000000000000000000000000e2": { "balance": "0" }, + "00000000000000000000000000000000000000e3": { "balance": "0" }, + "00000000000000000000000000000000000000e4": { "balance": "0" }, + "00000000000000000000000000000000000000e5": { "balance": "0" }, + "00000000000000000000000000000000000000e6": { "balance": "0" }, + "00000000000000000000000000000000000000e7": { "balance": "0" }, + "00000000000000000000000000000000000000e8": { "balance": "0" }, + "00000000000000000000000000000000000000e9": { "balance": "0" }, + "00000000000000000000000000000000000000ea": { "balance": "0" }, + "00000000000000000000000000000000000000eb": { "balance": "0" }, + "00000000000000000000000000000000000000ec": { "balance": "0" }, + "00000000000000000000000000000000000000ed": { "balance": "0" }, + "00000000000000000000000000000000000000ee": { "balance": "0" }, + "00000000000000000000000000000000000000ef": { "balance": "0" }, + "00000000000000000000000000000000000000f0": { "balance": "0" }, + "00000000000000000000000000000000000000f1": { "balance": "0" }, + "00000000000000000000000000000000000000f2": { "balance": "0" }, + "00000000000000000000000000000000000000f3": { "balance": "0" }, + "00000000000000000000000000000000000000f4": { "balance": "0" }, + "00000000000000000000000000000000000000f5": { "balance": "0" }, + "00000000000000000000000000000000000000f6": { "balance": "0" }, + "00000000000000000000000000000000000000f7": { "balance": "0" }, + "00000000000000000000000000000000000000f8": { "balance": "0" }, + "00000000000000000000000000000000000000f9": { "balance": "0" }, + "00000000000000000000000000000000000000fa": { "balance": "0" }, + "00000000000000000000000000000000000000fb": { "balance": "0" }, + "00000000000000000000000000000000000000fc": { "balance": "0" }, + "00000000000000000000000000000000000000fd": { "balance": "0" }, + "00000000000000000000000000000000000000fe": { "balance": "0" }, + "00000000000000000000000000000000000000ff": { "balance": "0" }, "874b54a8bd152966d63f706bae1ffeb0411921e5": { "balance": "1000000000000000000000000000000" } } } From 65785475f35a1978e8da8182d8b12a8d7cb4867b Mon Sep 17 00:00:00 2001 From: GitLab Build Bot Date: Mon, 21 Nov 2016 17:37:37 +0000 Subject: [PATCH 18/26] [ci skip] js-precompiled 20161121-173542 --- Cargo.lock | 2 +- js/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 02e45b49e..a9af4e0c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1263,7 +1263,7 @@ dependencies = [ [[package]] name = "parity-ui-precompiled" version = "1.4.0" -source = "git+https://github.com/ethcore/js-precompiled.git#587684374a12bf715151dd987a552a3d61e42972" +source = "git+https://github.com/ethcore/js-precompiled.git#253103aef1579e6ff11d5efe8b31f394fd0857bc" dependencies = [ "parity-dapps-glue 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/js/package.json b/js/package.json index 7f4157cad..e4d34c316 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "parity.js", - "version": "0.2.58", + "version": "0.2.59", "main": "release/index.js", "jsnext:main": "src/index.js", "author": "Parity Team ", From eb94eda30b680467425ab5e088ab8c3949b081a3 Mon Sep 17 00:00:00 2001 From: GitLab Build Bot Date: Mon, 21 Nov 2016 18:16:10 +0000 Subject: [PATCH 19/26] [ci skip] js-precompiled 20161121-181249 --- Cargo.lock | 2 +- js/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a9af4e0c6..dd05fc18d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1263,7 +1263,7 @@ dependencies = [ [[package]] name = "parity-ui-precompiled" version = "1.4.0" -source = "git+https://github.com/ethcore/js-precompiled.git#253103aef1579e6ff11d5efe8b31f394fd0857bc" +source = "git+https://github.com/ethcore/js-precompiled.git#a0cf68024199f7a8c39c7d149ad622ac2f72129a" dependencies = [ "parity-dapps-glue 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/js/package.json b/js/package.json index e4d34c316..bed226f02 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "parity.js", - "version": "0.2.59", + "version": "0.2.60", "main": "release/index.js", "jsnext:main": "src/index.js", "author": "Parity Team ", From 8a1b585da23f8b250cb6f2019ff2da49714f6b84 Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Mon, 21 Nov 2016 20:44:07 +0100 Subject: [PATCH 20/26] Fix peers not displaying (#3561) * Add peers count to status polling * Array destruct for better readability --- js/src/redux/providers/status.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/js/src/redux/providers/status.js b/js/src/redux/providers/status.js index bdc4dd38b..50b28a5ac 100644 --- a/js/src/redux/providers/status.js +++ b/js/src/redux/providers/status.js @@ -155,24 +155,20 @@ export default class Status { const { refreshStatus } = this._store.getState().nodeStatus; - const statusPromises = [ this._api.eth.syncing() ]; + const statusPromises = [ this._api.eth.syncing(), this._api.parity.netPeers() ]; if (refreshStatus) { statusPromises.push(this._api.eth.hashrate()); - statusPromises.push(this._api.parity.netPeers()); } Promise .all(statusPromises) - .then((statusResults) => { - const status = statusResults.length === 1 - ? { - syncing: statusResults[0] - } + .then(([ syncing, netPeers, ...statusResults ]) => { + const status = statusResults.length === 0 + ? { syncing, netPeers } : { - syncing: statusResults[0], - hashrate: statusResults[1], - netPeers: statusResults[2] + syncing, netPeers, + hashrate: statusResults[0] }; if (!isEqual(status, this._status)) { From 5735d948f5fd327f71d851bdf2d8f29061b2e098 Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Mon, 21 Nov 2016 20:44:37 +0100 Subject: [PATCH 21/26] [Registry] Clear input and working buttons (#3563) * onClick to onTouchTap #3556 * onClick to onTouchTap 2 #3556 * Registry dApp clear input + check Signer #3557 --- js/src/dapps/registry/Lookup/lookup.js | 2 +- js/src/dapps/registry/Names/actions.js | 27 +++++++++++++++---- js/src/dapps/registry/Names/names.js | 18 ++++++++++++- js/src/dapps/registry/Records/records.js | 2 +- js/src/modals/LoadContract/loadContract.js | 2 +- js/src/ui/Form/TypedInput/typedInput.js | 4 +-- js/src/views/Dapps/dapps.js | 2 +- .../TransactionPendingFormConfirm.js | 2 +- .../TransactionPendingFormReject.js | 2 +- .../components/CallsToolbar/CallsToolbar.js | 4 +-- .../ScrollTopButton/ScrollTopButton.js | 2 +- 11 files changed, 50 insertions(+), 17 deletions(-) diff --git a/js/src/dapps/registry/Lookup/lookup.js b/js/src/dapps/registry/Lookup/lookup.js index 4238f1160..436d113b9 100644 --- a/js/src/dapps/registry/Lookup/lookup.js +++ b/js/src/dapps/registry/Lookup/lookup.js @@ -77,7 +77,7 @@ export default class Lookup extends Component { label='Lookup' primary icon={ } - onClick={ this.onLookupClick } + onTouchTap={ this.onLookupClick } />
{ output } diff --git a/js/src/dapps/registry/Names/actions.js b/js/src/dapps/registry/Names/actions.js index 74e446d9d..488145331 100644 --- a/js/src/dapps/registry/Names/actions.js +++ b/js/src/dapps/registry/Names/actions.js @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -import { sha3 } from '../parity.js'; +import { sha3, api } from '../parity.js'; const alreadyQueued = (queue, action, name) => !!queue.find((entry) => entry.action === action && entry.name === name); @@ -43,14 +43,23 @@ export const reserve = (name) => (dispatch, getState) => { const values = [ sha3(name) ]; dispatch(reserveStart(name)); + reserve.estimateGas(options, values) .then((gas) => { options.gas = gas.mul(1.2).toFixed(0); return reserve.postTransaction(options, values); }) - .then((data) => { + .then((requestId) => { + return api.pollMethod('parity_checkRequest', requestId); + }) + .then((txhash) => { dispatch(reserveSuccess(name)); - }).catch((err) => { + }) + .catch((err) => { + if (err && err.type === 'REQUEST_REJECTED') { + return dispatch(reserveFail(name)); + } + console.error(`could not reserve ${name}`); if (err) console.error(err.stack); dispatch(reserveFail(name)); @@ -81,9 +90,17 @@ export const drop = (name) => (dispatch, getState) => { options.gas = gas.mul(1.2).toFixed(0); return drop.postTransaction(options, values); }) - .then((data) => { + .then((requestId) => { + return api.pollMethod('parity_checkRequest', requestId); + }) + .then((txhash) => { dispatch(dropSuccess(name)); - }).catch((err) => { + }) + .catch((err) => { + if (err && err.type === 'REQUEST_REJECTED') { + dispatch(reserveFail(name)); + } + console.error(`could not drop ${name}`); if (err) console.error(err.stack); dispatch(reserveFail(name)); diff --git a/js/src/dapps/registry/Names/names.js b/js/src/dapps/registry/Names/names.js index dd7e6f772..369d9690c 100644 --- a/js/src/dapps/registry/Names/names.js +++ b/js/src/dapps/registry/Names/names.js @@ -86,6 +86,22 @@ export default class Names extends Component { name: '' }; + componentWillReceiveProps (nextProps) { + const nextQueue = nextProps.queue; + const prevQueue = this.props.queue; + + if (nextQueue.length > prevQueue.length) { + const newQueued = nextQueue[nextQueue.length - 1]; + const newName = newQueued.name; + + if (newName !== this.state.name) { + return; + } + + this.setState({ name: '' }); + } + } + render () { const { action, name } = this.state; const { fee, pending, queue } = this.props; @@ -120,7 +136,7 @@ export default class Names extends Component { label={ action === 'reserve' ? 'Reserve' : 'Drop' } primary icon={ } - onClick={ this.onSubmitClick } + onTouchTap={ this.onSubmitClick } /> { queue.length > 0 ? (
{ useSignerText }{ renderQueue(queue) }
) diff --git a/js/src/dapps/registry/Records/records.js b/js/src/dapps/registry/Records/records.js index 60640893c..89c751c36 100644 --- a/js/src/dapps/registry/Records/records.js +++ b/js/src/dapps/registry/Records/records.js @@ -52,7 +52,7 @@ export default class Records extends Component { label='Save' primary icon={ } - onClick={ this.onSaveClick } + onTouchTap={ this.onSaveClick } /> diff --git a/js/src/modals/LoadContract/loadContract.js b/js/src/modals/LoadContract/loadContract.js index 3de55561a..f67a2dce6 100644 --- a/js/src/modals/LoadContract/loadContract.js +++ b/js/src/modals/LoadContract/loadContract.js @@ -174,7 +174,7 @@ export default class LoadContract extends Component { const secondaryText = description || `Saved ${moment(timestamp).fromNow()}`; const remove = removable ? ( - + ) diff --git a/js/src/ui/Form/TypedInput/typedInput.js b/js/src/ui/Form/TypedInput/typedInput.js index 6bcb5bbf1..f5ec2a02f 100644 --- a/js/src/ui/Form/TypedInput/typedInput.js +++ b/js/src/ui/Form/TypedInput/typedInput.js @@ -96,7 +96,7 @@ export default class TypedInput extends Component { @@ -104,7 +104,7 @@ export default class TypedInput extends Component { diff --git a/js/src/views/Dapps/dapps.js b/js/src/views/Dapps/dapps.js index 5d87b808d..7faead576 100644 --- a/js/src/views/Dapps/dapps.js +++ b/js/src/views/Dapps/dapps.js @@ -67,7 +67,7 @@ export default class Dapps extends Component { label='edit' key='edit' icon={ } - onClick={ this.store.openModal } + onTouchTap={ this.store.openModal } /> ] } /> diff --git a/js/src/views/Signer/components/TransactionPendingForm/TransactionPendingFormConfirm/TransactionPendingFormConfirm.js b/js/src/views/Signer/components/TransactionPendingForm/TransactionPendingFormConfirm/TransactionPendingFormConfirm.js index 5765447ee..f2cc0f910 100644 --- a/js/src/views/Signer/components/TransactionPendingForm/TransactionPendingFormConfirm/TransactionPendingFormConfirm.js +++ b/js/src/views/Signer/components/TransactionPendingForm/TransactionPendingFormConfirm/TransactionPendingFormConfirm.js @@ -74,7 +74,7 @@ class TransactionPendingFormConfirm extends Component { data-effect='solid' > This cannot be undone
+ onTouchTap={ this._scrollToTop }> ); From f9ecea8f4de9d27eb3e3f19e82f95bba4be17746 Mon Sep 17 00:00:00 2001 From: Jannis Redmann Date: Mon, 21 Nov 2016 20:45:47 +0100 Subject: [PATCH 22/26] sms verification code style (#3564) * sms verification: fix code style * sms verification: move server-related code to 3rdparty * sms verification: adapt to ropsten --- .../sms-verification/index.js} | 18 ++++- js/src/contracts/sms-verification.js | 17 ---- .../SMSVerification/GatherData/gatherData.js | 7 +- .../modals/SMSVerification/SMSVerification.js | 80 +++++++++++-------- js/src/modals/SMSVerification/store.js | 5 +- 5 files changed, 68 insertions(+), 59 deletions(-) rename js/src/{modals/SMSVerification/terms-of-service.js => 3rdparty/sms-verification/index.js} (81%) diff --git a/js/src/modals/SMSVerification/terms-of-service.js b/js/src/3rdparty/sms-verification/index.js similarity index 81% rename from js/src/modals/SMSVerification/terms-of-service.js rename to js/src/3rdparty/sms-verification/index.js index f61b3c97d..9b113f364 100644 --- a/js/src/modals/SMSVerification/terms-of-service.js +++ b/js/src/3rdparty/sms-verification/index.js @@ -14,9 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +import { stringify } from 'querystring'; import React from 'react'; -export default ( +export const termsOfService = (
  • This privacy notice relates to your use of the Parity SMS verification service. We take your privacy seriously and deal in an honest, direct and transparent way when it comes to your data.
  • We collect your phone number when you use this service. This is temporarily kept in memory, and then encrypted and stored in our EU servers. We only retain the cryptographic hash of the number to prevent duplicated accounts. You consent to this use.
  • @@ -25,3 +26,18 @@ export default (
  • Parity Technology Limited is registered in England and Wales under company number 09760015 and complies with the Data Protection Act 1998 (UK). You may contact us via email at admin@parity.io. Our general privacy policy can be found here: https://ethcore.io/legal.html.
); + +export const postToServer = (query) => { + query = stringify(query); + return fetch('https://sms-verification.parity.io/?' + query, { + method: 'POST', mode: 'cors', cache: 'no-store' + }) + .then((res) => { + return res.json().then((data) => { + if (res.ok) { + return data.message; + } + throw new Error(data.message || 'unknown error'); + }); + }); +}; diff --git a/js/src/contracts/sms-verification.js b/js/src/contracts/sms-verification.js index e93d57ffc..c6893e639 100644 --- a/js/src/contracts/sms-verification.js +++ b/js/src/contracts/sms-verification.js @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -import { stringify } from 'querystring'; - export const checkIfVerified = (contract, account) => { return contract.instance.certified.call({}, [account]); }; @@ -35,18 +33,3 @@ export const checkIfRequested = (contract, account) => { }); }); }; - -export const postToServer = (query) => { - query = stringify(query); - return fetch('https://sms-verification.parity.io/?' + query, { - method: 'POST', mode: 'cors', cache: 'no-store' - }) - .then((res) => { - return res.json().then((data) => { - if (res.ok) { - return data.message; - } - throw new Error(data.message || 'unknown error'); - }); - }); -}; diff --git a/js/src/modals/SMSVerification/GatherData/gatherData.js b/js/src/modals/SMSVerification/GatherData/gatherData.js index f4036a3bc..3620de904 100644 --- a/js/src/modals/SMSVerification/GatherData/gatherData.js +++ b/js/src/modals/SMSVerification/GatherData/gatherData.js @@ -25,7 +25,7 @@ import ErrorIcon from 'material-ui/svg-icons/navigation/close'; import { fromWei } from '../../../api/util/wei'; import { Form, Input } from '../../../ui'; -import terms from '../terms-of-service'; +import { termsOfService } from '../../../3rdparty/sms-verification'; import styles from './gatherData.css'; export default class GatherData extends Component { @@ -66,7 +66,7 @@ export default class GatherData extends Component { disabled={ isVerified } onCheck={ this.consentOnChange } /> -
{ terms }
+
{ termsOfService }
); } @@ -123,8 +123,7 @@ export default class GatherData extends Component {

You already requested verification.

); - } - if (hasRequested === false) { + } else if (hasRequested === false) { return (
diff --git a/js/src/modals/SMSVerification/SMSVerification.js b/js/src/modals/SMSVerification/SMSVerification.js index 4ec0b608d..b7c8a901a 100644 --- a/js/src/modals/SMSVerification/SMSVerification.js +++ b/js/src/modals/SMSVerification/SMSVerification.js @@ -16,8 +16,8 @@ import React, { Component, PropTypes } from 'react'; import { observer } from 'mobx-react'; -import ActionDoneAll from 'material-ui/svg-icons/action/done-all'; -import ContentClear from 'material-ui/svg-icons/content/clear'; +import DoneIcon from 'material-ui/svg-icons/action/done-all'; +import CancelIcon from 'material-ui/svg-icons/content/clear'; import { Button, IdentityIcon, Modal } from '../../ui'; @@ -77,7 +77,7 @@ export default class SMSVerification extends Component { const cancel = (
@@ -140,37 +140,47 @@ export default class SMSVerification extends Component { setNumber, setConsentGiven, setCode } = this.props.store; - if (phase === 5) { - return (); - } - if (phase === 4) { - return (); - } - if (phase === 3) { - return ( - - ); - } - if (phase === 2) { - return (); - } - if (phase === 1) { - const { setNumber, setConsentGiven } = this.props.store; - return ( - - ); - } - if (phase === 0) { - return (

Preparing awesomeness!

); - } + switch (phase) { + case 0: + return ( +

Loading SMS Verification.

+ ); - return null; + case 1: + const { setNumber, setConsentGiven } = this.props.store; + return ( + + ); + + case 2: + return ( + + ); + + case 3: + return ( + + ); + + case 4: + return ( + + ); + + case 5: + return ( + + ); + + default: + return null; + } } } diff --git a/js/src/modals/SMSVerification/store.js b/js/src/modals/SMSVerification/store.js index 7337f4eac..8c4db373a 100644 --- a/js/src/modals/SMSVerification/store.js +++ b/js/src/modals/SMSVerification/store.js @@ -20,7 +20,8 @@ import { sha3 } from '../../api/util/sha3'; import Contracts from '../../contracts'; -import { checkIfVerified, checkIfRequested, postToServer } from '../../contracts/sms-verification'; +import { checkIfVerified, checkIfRequested } from '../../contracts/sms-verification'; +import { postToServer } from '../../3rdparty/sms-verification'; import checkIfTxFailed from '../../util/check-if-tx-failed'; import waitForConfirmations from '../../util/wait-for-block-confirmations'; @@ -87,7 +88,7 @@ export default class VerificationStore { this.account = account; this.step = LOADING; - Contracts.create(api).registry.getContract('smsVerification') + Contracts.create(api).registry.getContract('smsverification') .then((contract) => { this.contract = contract; this.load(); From b97763e13de1178a0323e3b5a9b50ea45e9dd8fa Mon Sep 17 00:00:00 2001 From: GitLab Build Bot Date: Mon, 21 Nov 2016 23:35:10 +0000 Subject: [PATCH 23/26] [ci skip] js-precompiled 20161121-233309 --- Cargo.lock | 2 +- js/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd05fc18d..7be09f3e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1263,7 +1263,7 @@ dependencies = [ [[package]] name = "parity-ui-precompiled" version = "1.4.0" -source = "git+https://github.com/ethcore/js-precompiled.git#a0cf68024199f7a8c39c7d149ad622ac2f72129a" +source = "git+https://github.com/ethcore/js-precompiled.git#f46188126257e03c775e76a3cea82b5f70549400" dependencies = [ "parity-dapps-glue 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/js/package.json b/js/package.json index bed226f02..62a09e1d1 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "parity.js", - "version": "0.2.60", + "version": "0.2.61", "main": "release/index.js", "jsnext:main": "src/index.js", "author": "Parity Team ", From bd6f343cbe1f70c4ef5084af4c8d4d8e23297808 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 22 Nov 2016 11:54:20 +0100 Subject: [PATCH 24/26] DappRegistry (#3405) * Initial version, just loading * Warning dialog * Retrive & show applications * Display completed * Edit/New mode start * Display distry state, resolve hashes to urls * Move buttons to top-level * Rework display * Update error handling & dirty checks * Formatting * Split sections into components * Styling updates * Slight styling adjustments * Start delete modal * Add modals for register & update * Flesh-out register modal * Register error handling * Register registers * List refresh on add & remove * Update operational * Simplify, remove bg image * Really remove bg * fix case * Collapse text-only components --- js/src/dapps/dappreg.html | 17 + js/src/dapps/dappreg.js | 35 ++ .../dapps/dappreg/Application/application.css | 58 +++ .../dapps/dappreg/Application/application.js | 64 +++ js/src/dapps/dappreg/Application/index.js | 17 + js/src/dapps/dappreg/Button/button.css | 38 ++ js/src/dapps/dappreg/Button/button.js | 52 ++ js/src/dapps/dappreg/Button/index.js | 17 + js/src/dapps/dappreg/ButtonBar/buttonBar.css | 21 + js/src/dapps/dappreg/ButtonBar/buttonBar.js | 101 ++++ js/src/dapps/dappreg/ButtonBar/index.js | 17 + js/src/dapps/dappreg/Dapp/dapp.css | 19 + js/src/dapps/dappreg/Dapp/dapp.js | 162 ++++++ js/src/dapps/dappreg/Dapp/index.js | 17 + js/src/dapps/dappreg/Input/index.js | 17 + js/src/dapps/dappreg/Input/input.css | 92 ++++ js/src/dapps/dappreg/Input/input.js | 47 ++ js/src/dapps/dappreg/Modal/index.js | 17 + js/src/dapps/dappreg/Modal/modal.css | 116 +++++ js/src/dapps/dappreg/Modal/modal.js | 66 +++ js/src/dapps/dappreg/ModalDelete/index.js | 17 + .../dapps/dappreg/ModalDelete/modalDelete.js | 159 ++++++ js/src/dapps/dappreg/ModalRegister/index.js | 17 + .../dappreg/ModalRegister/modalRegister.js | 159 ++++++ js/src/dapps/dappreg/ModalUpdate/index.js | 17 + .../dapps/dappreg/ModalUpdate/modalUpdate.js | 169 ++++++ js/src/dapps/dappreg/SelectAccount/index.js | 17 + .../dappreg/SelectAccount/selectAccount.js | 49 ++ js/src/dapps/dappreg/SelectDapp/index.js | 17 + js/src/dapps/dappreg/SelectDapp/selectDapp.js | 76 +++ js/src/dapps/dappreg/Warning/index.js | 17 + js/src/dapps/dappreg/Warning/warning.css | 36 ++ js/src/dapps/dappreg/Warning/warning.js | 51 ++ js/src/dapps/dappreg/dappsStore.js | 482 ++++++++++++++++++ js/src/dapps/dappreg/modalStore.js | 266 ++++++++++ js/src/dapps/dappreg/parity.js | 53 ++ js/webpack.config.js | 1 + 37 files changed, 2593 insertions(+) create mode 100644 js/src/dapps/dappreg.html create mode 100644 js/src/dapps/dappreg.js create mode 100644 js/src/dapps/dappreg/Application/application.css create mode 100644 js/src/dapps/dappreg/Application/application.js create mode 100644 js/src/dapps/dappreg/Application/index.js create mode 100644 js/src/dapps/dappreg/Button/button.css create mode 100644 js/src/dapps/dappreg/Button/button.js create mode 100644 js/src/dapps/dappreg/Button/index.js create mode 100644 js/src/dapps/dappreg/ButtonBar/buttonBar.css create mode 100644 js/src/dapps/dappreg/ButtonBar/buttonBar.js create mode 100644 js/src/dapps/dappreg/ButtonBar/index.js create mode 100644 js/src/dapps/dappreg/Dapp/dapp.css create mode 100644 js/src/dapps/dappreg/Dapp/dapp.js create mode 100644 js/src/dapps/dappreg/Dapp/index.js create mode 100644 js/src/dapps/dappreg/Input/index.js create mode 100644 js/src/dapps/dappreg/Input/input.css create mode 100644 js/src/dapps/dappreg/Input/input.js create mode 100644 js/src/dapps/dappreg/Modal/index.js create mode 100644 js/src/dapps/dappreg/Modal/modal.css create mode 100644 js/src/dapps/dappreg/Modal/modal.js create mode 100644 js/src/dapps/dappreg/ModalDelete/index.js create mode 100644 js/src/dapps/dappreg/ModalDelete/modalDelete.js create mode 100644 js/src/dapps/dappreg/ModalRegister/index.js create mode 100644 js/src/dapps/dappreg/ModalRegister/modalRegister.js create mode 100644 js/src/dapps/dappreg/ModalUpdate/index.js create mode 100644 js/src/dapps/dappreg/ModalUpdate/modalUpdate.js create mode 100644 js/src/dapps/dappreg/SelectAccount/index.js create mode 100644 js/src/dapps/dappreg/SelectAccount/selectAccount.js create mode 100644 js/src/dapps/dappreg/SelectDapp/index.js create mode 100644 js/src/dapps/dappreg/SelectDapp/selectDapp.js create mode 100644 js/src/dapps/dappreg/Warning/index.js create mode 100644 js/src/dapps/dappreg/Warning/warning.css create mode 100644 js/src/dapps/dappreg/Warning/warning.js create mode 100644 js/src/dapps/dappreg/dappsStore.js create mode 100644 js/src/dapps/dappreg/modalStore.js create mode 100644 js/src/dapps/dappreg/parity.js diff --git a/js/src/dapps/dappreg.html b/js/src/dapps/dappreg.html new file mode 100644 index 000000000..89c95c472 --- /dev/null +++ b/js/src/dapps/dappreg.html @@ -0,0 +1,17 @@ + + + + + + + + Dapp Registry + + +
+ + + + + + diff --git a/js/src/dapps/dappreg.js b/js/src/dapps/dappreg.js new file mode 100644 index 000000000..243576a34 --- /dev/null +++ b/js/src/dapps/dappreg.js @@ -0,0 +1,35 @@ +// 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 . + +import React from 'react'; +import ReactDOM from 'react-dom'; +import injectTapEventPlugin from 'react-tap-event-plugin'; +import { useStrict } from 'mobx'; + +injectTapEventPlugin(); +useStrict(true); + +import Application from './dappreg/Application'; + +import '../../assets/fonts/Roboto/font.css'; +import '../../assets/fonts/RobotoMono/font.css'; +import './style.css'; +import './dappreg.html'; + +ReactDOM.render( + , + document.querySelector('#container') +); diff --git a/js/src/dapps/dappreg/Application/application.css b/js/src/dapps/dappreg/Application/application.css new file mode 100644 index 000000000..f171d8127 --- /dev/null +++ b/js/src/dapps/dappreg/Application/application.css @@ -0,0 +1,58 @@ +/* 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 . +*/ + +.body { + color: #333; + background: #eee; + padding: 4.5em 0; + text-align: center; +} + +.apps { + background: #fff; + border-radius: 0.5em; + margin: 0 auto; + max-width: 980px; + padding: 1.5em; + text-align: left; +} + +.footer { + font-size: 0.75em; + margin: 1em; + padding: 1.5em; + text-align: center; +} + +.header { + background: #44e; + border-radius: 0 0 0.25em 0.25em; + color: #fff; + left: 0; + padding: 1em; + position: fixed; + right: 0; + top: 0; + z-index: 25; +} + +.loading { + text-align: center; + padding-top: 5em; + font-size: 2em; + color: #999; +} diff --git a/js/src/dapps/dappreg/Application/application.js b/js/src/dapps/dappreg/Application/application.js new file mode 100644 index 000000000..b5e4d5a97 --- /dev/null +++ b/js/src/dapps/dappreg/Application/application.js @@ -0,0 +1,64 @@ +// 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 . + +import React, { Component } from 'react'; +import { observer } from 'mobx-react'; + +import DappsStore from '../dappsStore'; + +import ButtonBar from '../ButtonBar'; +import Dapp from '../Dapp'; +import ModalDelete from '../ModalDelete'; +import ModalRegister from '../ModalRegister'; +import ModalUpdate from '../ModalUpdate'; +import SelectDapp from '../SelectDapp'; +import Warning from '../Warning'; +import styles from './application.css'; + +@observer +export default class Application extends Component { + dappsStore = DappsStore.instance(); + + render () { + if (this.dappsStore.isLoading) { + return ( +
+ Loading application +
+ ); + } + + return ( +
+
+ DAPP REGISTRY, a global view of distributed applications available on the network. Putting the puzzle together. +
+
+ + + +
+
+ { this.dappsStore.count } applications registered, { this.dappsStore.ownedCount } owned by user +
+ + + + +
+ ); + } +} diff --git a/js/src/dapps/dappreg/Application/index.js b/js/src/dapps/dappreg/Application/index.js new file mode 100644 index 000000000..236578226 --- /dev/null +++ b/js/src/dapps/dappreg/Application/index.js @@ -0,0 +1,17 @@ +// 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 . + +export default from './application'; diff --git a/js/src/dapps/dappreg/Button/button.css b/js/src/dapps/dappreg/Button/button.css new file mode 100644 index 000000000..a66736e46 --- /dev/null +++ b/js/src/dapps/dappreg/Button/button.css @@ -0,0 +1,38 @@ +/* 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 . +*/ + +.button { + background: #44e; + border: none; + border-radius: 0.25em; + color: #fff; + cursor: pointer; + font-size: 1em; + margin: 1em 0.375em; + opacity: 0.85; + padding: 0.75em 2em; + + &[disabled] { + opacity: 0.5; + cursor: default; + background: #aaa; + } + + &[data-warning="true"] { + background: #e44; + } +} diff --git a/js/src/dapps/dappreg/Button/button.js b/js/src/dapps/dappreg/Button/button.js new file mode 100644 index 000000000..1f3b67b4c --- /dev/null +++ b/js/src/dapps/dappreg/Button/button.js @@ -0,0 +1,52 @@ +// 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 . + +import React, { Component, PropTypes } from 'react'; + +import styles from './button.css'; + +export default class Button extends Component { + static propTypes = { + className: PropTypes.string, + disabled: PropTypes.bool, + label: PropTypes.string.isRequired, + warning: PropTypes.bool, + onClick: PropTypes.func.isRequired + } + + render () { + const { className, disabled, label, warning } = this.props; + const classes = `${styles.button} ${className}`; + + return ( + + ); + } + + onClick = (event) => { + if (this.props.disabled) { + return; + } + + this.props.onClick(event); + } +} diff --git a/js/src/dapps/dappreg/Button/index.js b/js/src/dapps/dappreg/Button/index.js new file mode 100644 index 000000000..f69a65e3d --- /dev/null +++ b/js/src/dapps/dappreg/Button/index.js @@ -0,0 +1,17 @@ +// 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 . + +export default from './button'; diff --git a/js/src/dapps/dappreg/ButtonBar/buttonBar.css b/js/src/dapps/dappreg/ButtonBar/buttonBar.css new file mode 100644 index 000000000..0aa84ee29 --- /dev/null +++ b/js/src/dapps/dappreg/ButtonBar/buttonBar.css @@ -0,0 +1,21 @@ +/* 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 . +*/ + +.buttonbar { + text-align: center; + margin: 1em 0 0 0; +} diff --git a/js/src/dapps/dappreg/ButtonBar/buttonBar.js b/js/src/dapps/dappreg/ButtonBar/buttonBar.js new file mode 100644 index 000000000..289def0ea --- /dev/null +++ b/js/src/dapps/dappreg/ButtonBar/buttonBar.js @@ -0,0 +1,101 @@ +// 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 . + +import React, { Component } from 'react'; +import { observer } from 'mobx-react'; + +import DappsStore from '../dappsStore'; +import ModalStore from '../modalStore'; + +import Button from '../Button'; +import styles from './buttonBar.css'; + +@observer +export default class ButtonBar extends Component { + dappsStore = DappsStore.instance(); + modalStore = ModalStore.instance(); + + render () { + let buttons = []; + + if (this.dappsStore.isEditing || this.dappsStore.isNew) { + buttons = [ +