Merge branch 'master' into new-token
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "parity.js",
|
||||
"version": "0.2.33",
|
||||
"version": "0.2.37",
|
||||
"main": "release/index.js",
|
||||
"jsnext:main": "src/index.js",
|
||||
"author": "Parity Team <admin@parity.io>",
|
||||
|
||||
@@ -309,7 +309,6 @@ export default class Contract {
|
||||
try {
|
||||
subscriptions[idx].callback(null, this.parseEventLogs(logs));
|
||||
} catch (error) {
|
||||
this.unsubscribe(idx);
|
||||
console.error('_sendSubscriptionChanges', error);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -107,7 +107,6 @@ export default class Manager {
|
||||
callback(error, data);
|
||||
} catch (error) {
|
||||
console.error(`Unable to update callback for subscriptionId ${subscriptionId}`, error);
|
||||
this.unsubscribe(subscriptionId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,26 +28,26 @@ export function attachInterface () {
|
||||
return Promise
|
||||
.all([
|
||||
registry.getAddress.call({}, [api.util.sha3('githubhint'), 'A']),
|
||||
api.eth.accounts(),
|
||||
api.parity.accounts()
|
||||
]);
|
||||
})
|
||||
.then(([address, addresses, accountsInfo]) => {
|
||||
accountsInfo = accountsInfo || {};
|
||||
.then(([address, accountsInfo]) => {
|
||||
console.log(`githubhint was found at ${address}`);
|
||||
|
||||
const contract = api.newContract(abis.githubhint, address);
|
||||
const accounts = addresses.reduce((obj, address) => {
|
||||
const info = accountsInfo[address] || {};
|
||||
const accounts = Object
|
||||
.keys(accountsInfo)
|
||||
.filter((address) => accountsInfo[address].uuid)
|
||||
.reduce((obj, address) => {
|
||||
const account = accountsInfo[address];
|
||||
|
||||
return Object.assign(obj, {
|
||||
[address]: {
|
||||
address,
|
||||
name: info.name,
|
||||
uuid: info.uuid
|
||||
}
|
||||
});
|
||||
}, {});
|
||||
return Object.assign(obj, {
|
||||
[address]: {
|
||||
address,
|
||||
name: account.name
|
||||
}
|
||||
});
|
||||
}, {});
|
||||
const fromAddress = Object.keys(accounts)[0];
|
||||
|
||||
return {
|
||||
|
||||
@@ -49,3 +49,15 @@
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.warning {
|
||||
background: #f80;
|
||||
bottom: 0;
|
||||
color: #fff;
|
||||
left: 0;
|
||||
opacity: 1;
|
||||
padding: 1.5em;
|
||||
position: fixed;
|
||||
right: 50%;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ export default class Application extends Component {
|
||||
};
|
||||
|
||||
render () {
|
||||
const { api } = window.parity;
|
||||
const {
|
||||
actions,
|
||||
accounts, contacts,
|
||||
@@ -60,9 +61,11 @@ export default class Application extends Component {
|
||||
lookup,
|
||||
events
|
||||
} = this.props;
|
||||
let warning = null;
|
||||
|
||||
return (
|
||||
<div>
|
||||
{ warning }
|
||||
<div className={ styles.header }>
|
||||
<h1>RΞgistry</h1>
|
||||
<Accounts { ...accounts } actions={ actions.accounts } />
|
||||
@@ -70,13 +73,11 @@ export default class Application extends Component {
|
||||
{ contract && fee ? (
|
||||
<div>
|
||||
<Lookup { ...lookup } accounts={ accounts.all } contacts={ contacts } actions={ actions.lookup } />
|
||||
|
||||
{ this.renderActions() }
|
||||
|
||||
<Events { ...events } accounts={ accounts.all } contacts={ contacts } actions={ actions.events } />
|
||||
<p className={ styles.address }>
|
||||
The Registry is provided by the contract at <code>{ contract.address }.</code>
|
||||
</p>
|
||||
<div className={ styles.warning }>
|
||||
WARNING: The name registry is experimental. Please ensure that you understand the risks, benefits & consequences of registering a name before doing so. A non-refundable fee of { api.util.fromWei(fee).toFormat(3) }<small>ETH</small> is required for all registrations.
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<CircularProgress size={ 60 } />
|
||||
|
||||
@@ -19,18 +19,16 @@ import { api } from '../parity';
|
||||
export const set = (addresses) => ({ type: 'addresses set', addresses });
|
||||
|
||||
export const fetch = () => (dispatch) => {
|
||||
return Promise
|
||||
.all([
|
||||
api.eth.accounts(),
|
||||
api.parity.accounts()
|
||||
])
|
||||
.then(([ accounts, data ]) => {
|
||||
data = data || {};
|
||||
const addresses = Object.keys(data)
|
||||
.filter((address) => data[address] && !data[address].meta.deleted)
|
||||
return api.parity
|
||||
.accounts()
|
||||
.then((accountsInfo) => {
|
||||
const addresses = Object
|
||||
.keys(accountsInfo)
|
||||
.filter((address) => accountsInfo[address] && !accountsInfo[address].meta.deleted)
|
||||
.map((address) => ({
|
||||
...data[address], address,
|
||||
isAccount: accounts.includes(address)
|
||||
...accountsInfo[address],
|
||||
address,
|
||||
isAccount: !!accountsInfo[address].uuid
|
||||
}));
|
||||
dispatch(set(addresses));
|
||||
})
|
||||
|
||||
@@ -146,7 +146,7 @@ export default class Import extends Component {
|
||||
}
|
||||
|
||||
sortFunctions = (a, b) => {
|
||||
return a.name.localeCompare(b.name);
|
||||
return (a.name || '').localeCompare(b.name || '');
|
||||
}
|
||||
|
||||
countFunctions () {
|
||||
|
||||
@@ -49,26 +49,26 @@ export function attachInterface (callback) {
|
||||
return Promise
|
||||
.all([
|
||||
registry.getAddress.call({}, [api.util.sha3('signaturereg'), 'A']),
|
||||
api.eth.accounts(),
|
||||
api.parity.accounts()
|
||||
]);
|
||||
})
|
||||
.then(([address, addresses, accountsInfo]) => {
|
||||
accountsInfo = accountsInfo || {};
|
||||
.then(([address, accountsInfo]) => {
|
||||
console.log(`signaturereg was found at ${address}`);
|
||||
|
||||
const contract = api.newContract(abis.signaturereg, address);
|
||||
const accounts = addresses.reduce((obj, address) => {
|
||||
const info = accountsInfo[address] || {};
|
||||
const accounts = Object
|
||||
.keys(accountsInfo)
|
||||
.filter((address) => accountsInfo[address].uuid)
|
||||
.reduce((obj, address) => {
|
||||
const info = accountsInfo[address] || {};
|
||||
|
||||
return Object.assign(obj, {
|
||||
[address]: {
|
||||
address,
|
||||
name: info.name || 'Unnamed',
|
||||
uuid: info.uuid
|
||||
}
|
||||
});
|
||||
}, {});
|
||||
return Object.assign(obj, {
|
||||
[address]: {
|
||||
address,
|
||||
name: info.name || 'Unnamed'
|
||||
}
|
||||
});
|
||||
}, {});
|
||||
const fromAddress = Object.keys(accounts)[0];
|
||||
|
||||
return {
|
||||
|
||||
@@ -35,16 +35,13 @@ export const setSelectedAccount = (address) => ({
|
||||
});
|
||||
|
||||
export const loadAccounts = () => (dispatch) => {
|
||||
Promise
|
||||
.all([
|
||||
api.eth.accounts(),
|
||||
api.parity.accounts()
|
||||
])
|
||||
.then(([ accounts, accountsInfo ]) => {
|
||||
accountsInfo = accountsInfo || {};
|
||||
|
||||
const accountsList = accounts
|
||||
.map(address => ({
|
||||
api.parity
|
||||
.accounts()
|
||||
.then((accountsInfo) => {
|
||||
const accountsList = Object
|
||||
.keys(accountsInfo)
|
||||
.filter((address) => accountsInfo[address].uuid)
|
||||
.map((address) => ({
|
||||
...accountsInfo[address],
|
||||
address
|
||||
}));
|
||||
|
||||
@@ -20,3 +20,15 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.warning {
|
||||
background: #f80;
|
||||
bottom: 0;
|
||||
color: #fff;
|
||||
left: 0;
|
||||
opacity: 1;
|
||||
padding: 1.5em;
|
||||
position: fixed;
|
||||
right: 50%;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import getMuiTheme from 'material-ui/styles/getMuiTheme';
|
||||
|
||||
import { api } from '../parity';
|
||||
|
||||
import Loading from '../Loading';
|
||||
import Status from '../Status';
|
||||
import Tokens from '../Tokens';
|
||||
@@ -59,6 +61,9 @@ export default class Application extends Component {
|
||||
<Actions />
|
||||
|
||||
<Tokens />
|
||||
<div className={ styles.warning }>
|
||||
WARNING: The token registry is experimental. Please ensure that you understand the steps, risks, benefits & consequences of registering a token before doing so. A non-refundable fee of { api.util.fromWei(contract.fee).toFormat(3) }<small>ETH</small> is required for all registrations.
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,12 @@
|
||||
.title {
|
||||
font-size: 3rem;
|
||||
font-weight: 300;
|
||||
margin-top: 0;
|
||||
margin: 0;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.byline {
|
||||
font-size: 1.25em;
|
||||
opacity: 0.75;
|
||||
margin: 0 0 1.75em 0;
|
||||
}
|
||||
|
||||
@@ -29,17 +29,12 @@ export default class Status extends Component {
|
||||
};
|
||||
|
||||
render () {
|
||||
const { address, fee } = this.props;
|
||||
const { fee } = this.props;
|
||||
|
||||
return (
|
||||
<div className={ styles.status }>
|
||||
<h1 className={ styles.title }>Token Registry</h1>
|
||||
|
||||
<Chip
|
||||
isAddress
|
||||
value={ address }
|
||||
label='Address' />
|
||||
|
||||
<h3 className={ styles.byline }>A global registry of all recognised tokens on the network</h3>
|
||||
<Chip
|
||||
isAddress={ false }
|
||||
value={ api.util.fromWei(fee).toFixed(3) + 'ETH' }
|
||||
|
||||
Reference in New Issue
Block a user