Backporting to beta (#3229)
* Use ethcore_dappsPort when constructing URLs (#3139) * Upon connect, retrieve the available api ports * Update dapps to load from dappsPort * Update dapps summary with dappsPort * Allow proxy to use dappsPort * Replace /api/ping with HEAD / * Dynamic port for available apps * Retrieve content images with dappsPort * Fix / * Transfer token dropdown image fix * IdentityIcon loads images via contentHash * Update apps fetch to cater for dev & prod * DRY up 127.0.0.1:${dappsPort} with ${dappsUrl} * Cleaning up polluted namespaces (#3143) * Renaming ethcore_ to parity_ * Renaming files * Renaming poluted EthSigning * Tidy up the namespaces * Renaming files to match new structure * Splitting EthSigning into separate traits * jsapi move ethcore.* -> parity.* * Move jsonrpc parity definitions * Update UI API calls for parity interfaces * Move jsapi signer interfaces from personal to signer * Update UI to use signer.* where applicable * Updsate jsapi subscriptions for signer * Fix dodgy merge. * Update README. * Fix some tests. * Move parity-only personal.* to parity.* * Update UI for personal -> parity API moves * Update subscription APIs after personal -> parity move * personal. generateAuthorizationToken -> parity. generateAuthorizationToken (UI) * enode, dappsPort & signerPort (UI) * Update subscription tests (accountsInfo) * subscription update * personal -> parity * Additional error logging on method failures * move postTransaction to parity * Additional debug info with method failures * Fix personal tests. * Console wrning shows parameters, error object does not * Include parity_ signing methods. * Console log http transport info * Fix failing tests * Add RPC stubs for parity_accounts. * Allow some secure built-in dapps * Use parity_accounts in place of accountsInfo * Improve error reporting * Cleanup GHH error handling Former-commit-id: 5a094ccb9f0596d0e07abc23504b80dc099ad584
This commit is contained in:
@@ -42,7 +42,7 @@ export default class Balances {
|
||||
|
||||
_subscribeAccountsInfo () {
|
||||
this._api
|
||||
.subscribe('personal_accountsInfo', (error, accountsInfo) => {
|
||||
.subscribe('parity_accountsInfo', (error, accountsInfo) => {
|
||||
if (error) {
|
||||
return;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ export default class Balances {
|
||||
}
|
||||
|
||||
_retrieveTokens () {
|
||||
this._api.ethcore
|
||||
this._api.parity
|
||||
.registryAddress()
|
||||
.then((registryAddress) => {
|
||||
const registry = this._api.newContract(abis.registry, registryAddress);
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
import { handleActions } from 'redux-actions';
|
||||
import { bytesToHex } from '../../api/util/format';
|
||||
|
||||
import { parityNode } from '../../environment';
|
||||
|
||||
const ZERO = '0x0000000000000000000000000000000000000000000000000000000000000000';
|
||||
|
||||
const initialState = {
|
||||
@@ -28,7 +26,7 @@ const initialState = {
|
||||
export function hashToImageUrl (hashArray) {
|
||||
const hash = hashArray ? bytesToHex(hashArray) : ZERO;
|
||||
|
||||
return hash === ZERO ? null : `${parityNode}/api/content/${hash.substr(2)}`;
|
||||
return hash === ZERO ? null : `/api/content/${hash.substr(2)}`;
|
||||
}
|
||||
|
||||
export default handleActions({
|
||||
|
||||
@@ -28,9 +28,9 @@ export default class Personal {
|
||||
|
||||
_subscribeAccountsInfo () {
|
||||
this._api
|
||||
.subscribe('personal_accountsInfo', (error, accountsInfo) => {
|
||||
.subscribe('parity_accountsInfo', (error, accountsInfo) => {
|
||||
if (error) {
|
||||
console.error('personal_accountsInfo', error);
|
||||
console.error('parity_accountsInfo', error);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,22 +14,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Copyright 2015, 2016 Ethcore (UK) Ltd.
|
||||
// This file is part of Parity.
|
||||
|
||||
// Parity is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import { signerRequestsToConfirm } from './signerActions';
|
||||
|
||||
export default class Signer {
|
||||
@@ -44,7 +28,7 @@ export default class Signer {
|
||||
|
||||
_subscribeRequestsToConfirm () {
|
||||
this._api
|
||||
.subscribe('personal_requestsToConfirm', (error, pending) => {
|
||||
.subscribe('signer_requestsToConfirm', (error, pending) => {
|
||||
if (error) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ export default class SignerMiddleware {
|
||||
onConfirmStart = (store, action) => {
|
||||
const { id, password } = action.payload;
|
||||
|
||||
this._api.personal
|
||||
this._api.signer
|
||||
.confirmRequest(id, {}, password)
|
||||
.then((txHash) => {
|
||||
console.log('confirmRequest', id, txHash);
|
||||
@@ -71,7 +71,7 @@ export default class SignerMiddleware {
|
||||
onRejectStart = (store, action) => {
|
||||
const id = action.payload;
|
||||
|
||||
this._api.personal
|
||||
this._api.signer
|
||||
.rejectRequest(id)
|
||||
.then(() => {
|
||||
store.dispatch(actions.successRejectRequest({ id }));
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
import { statusBlockNumber, statusCollection, statusLogs } from './statusActions';
|
||||
|
||||
import { parityNode } from '../../environment';
|
||||
|
||||
export default class Status {
|
||||
constructor (store, api) {
|
||||
this._api = api;
|
||||
@@ -33,8 +31,8 @@ export default class Status {
|
||||
}
|
||||
|
||||
_fetchEnode () {
|
||||
this._api
|
||||
.ethcore.enode()
|
||||
this._api.parity
|
||||
.enode()
|
||||
.then((enode) => {
|
||||
this._store.dispatch(statusCollection({ enode }));
|
||||
})
|
||||
@@ -65,7 +63,7 @@ export default class Status {
|
||||
setTimeout(this._pollPing, timeout);
|
||||
};
|
||||
|
||||
fetch(`${parityNode}/api/ping`, { method: 'GET' })
|
||||
fetch('/', { method: 'HEAD' })
|
||||
.then((response) => dispatch(!!response.ok))
|
||||
.catch(() => dispatch(false));
|
||||
}
|
||||
@@ -103,16 +101,16 @@ export default class Status {
|
||||
.all([
|
||||
this._api.web3.clientVersion(),
|
||||
this._api.eth.coinbase(),
|
||||
this._api.ethcore.defaultExtraData(),
|
||||
this._api.ethcore.extraData(),
|
||||
this._api.ethcore.gasFloorTarget(),
|
||||
this._api.parity.defaultExtraData(),
|
||||
this._api.parity.extraData(),
|
||||
this._api.parity.gasFloorTarget(),
|
||||
this._api.eth.hashrate(),
|
||||
this._api.ethcore.minGasPrice(),
|
||||
this._api.ethcore.netChain(),
|
||||
this._api.ethcore.netPeers(),
|
||||
this._api.ethcore.netPort(),
|
||||
this._api.ethcore.nodeName(),
|
||||
this._api.ethcore.rpcSettings(),
|
||||
this._api.parity.minGasPrice(),
|
||||
this._api.parity.netChain(),
|
||||
this._api.parity.netPeers(),
|
||||
this._api.parity.netPort(),
|
||||
this._api.parity.nodeName(),
|
||||
this._api.parity.rpcSettings(),
|
||||
this._api.eth.syncing(),
|
||||
this._pollTraceMode()
|
||||
])
|
||||
@@ -155,8 +153,8 @@ export default class Status {
|
||||
|
||||
Promise
|
||||
.all([
|
||||
this._api.ethcore.devLogs(),
|
||||
this._api.ethcore.devLogsLevels()
|
||||
this._api.parity.devLogs(),
|
||||
this._api.parity.devLogsLevels()
|
||||
])
|
||||
.then(([devLogs, devLogsLevels]) => {
|
||||
this._store.dispatch(statusLogs({
|
||||
|
||||
Reference in New Issue
Block a user