Cancel tx JS (#4958)
* Remove transaction RPC * Bumping multihash and libc * Updating nanomsg * bump nanomsg * cancel tx * cancel-tx-js * cancel-tx-js * cancel-tx-js * cancel-tx-hs * cancel-tx-js * cancel-tx-js * cancel-tx-js * small fixes * edit & time till submit * edit & time till submit * updates * updates * udpates * udpates * grumbles * step 1 * Wonderful updates * ready * small refact * small refact * grumbles 1 * ffx2 * good ol' fashioned updates * latest and greatest * removeHash * removeHash * spec * fix 1 * fix 1 * fix 2 * fix 2 * ff * ff * ff * updates
This commit is contained in:
committed by
Jaco Greeff
parent
0768ce3600
commit
f7d5d6c0cd
@@ -22,7 +22,8 @@ import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
|
||||
import Store from '../../store';
|
||||
import * as RequestsActions from '~/redux/providers/signerActions';
|
||||
import { newError } from '~/redux/actions';
|
||||
import { startConfirmRequest, startRejectRequest } from '~/redux/providers/signerActions';
|
||||
import { Container, Page, TxList } from '~/ui';
|
||||
|
||||
import RequestPending from '../../components/RequestPending';
|
||||
@@ -36,12 +37,13 @@ class RequestsPage extends Component {
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
actions: PropTypes.shape({
|
||||
startConfirmRequest: PropTypes.func.isRequired,
|
||||
startRejectRequest: PropTypes.func.isRequired
|
||||
}).isRequired,
|
||||
gasLimit: PropTypes.object.isRequired,
|
||||
netVersion: PropTypes.string.isRequired,
|
||||
startConfirmRequest: PropTypes.func.isRequired,
|
||||
startRejectRequest: PropTypes.func.isRequired,
|
||||
|
||||
blockNumber: PropTypes.object,
|
||||
newError: PropTypes.func,
|
||||
signer: PropTypes.shape({
|
||||
pending: PropTypes.array.isRequired,
|
||||
finished: PropTypes.array.isRequired
|
||||
@@ -69,6 +71,7 @@ class RequestsPage extends Component {
|
||||
|
||||
renderLocalQueue () {
|
||||
const { localHashes } = this.store;
|
||||
const { blockNumber, newError } = this.props;
|
||||
|
||||
if (!localHashes.length) {
|
||||
return null;
|
||||
@@ -85,7 +88,9 @@ class RequestsPage extends Component {
|
||||
>
|
||||
<TxList
|
||||
address=''
|
||||
blockNumber={ blockNumber }
|
||||
hashes={ localHashes }
|
||||
onNewError={ newError }
|
||||
/>
|
||||
</Container>
|
||||
);
|
||||
@@ -114,7 +119,7 @@ class RequestsPage extends Component {
|
||||
title={
|
||||
<FormattedMessage
|
||||
id='signer.requestsPage.pendingTitle'
|
||||
defaultMessage='Pending Requests'
|
||||
defaultMessage='Pending Signature Authorization'
|
||||
/>
|
||||
}
|
||||
>
|
||||
@@ -124,7 +129,7 @@ class RequestsPage extends Component {
|
||||
}
|
||||
|
||||
renderPending = (data, index) => {
|
||||
const { actions, gasLimit, netVersion } = this.props;
|
||||
const { startConfirmRequest, startRejectRequest, gasLimit, netVersion } = this.props;
|
||||
const { date, id, isSending, payload, origin } = data;
|
||||
|
||||
return (
|
||||
@@ -137,8 +142,8 @@ class RequestsPage extends Component {
|
||||
isSending={ isSending }
|
||||
netVersion={ netVersion }
|
||||
key={ id }
|
||||
onConfirm={ actions.startConfirmRequest }
|
||||
onReject={ actions.startRejectRequest }
|
||||
onConfirm={ startConfirmRequest }
|
||||
onReject={ startRejectRequest }
|
||||
origin={ origin }
|
||||
payload={ payload }
|
||||
signerStore={ this.store }
|
||||
@@ -148,11 +153,11 @@ class RequestsPage extends Component {
|
||||
}
|
||||
|
||||
function mapStateToProps (state) {
|
||||
const { gasLimit, netVersion } = state.nodeStatus;
|
||||
const { actions, signer } = state;
|
||||
const { gasLimit, netVersion, blockNumber } = state.nodeStatus;
|
||||
const { signer } = state;
|
||||
|
||||
return {
|
||||
actions,
|
||||
blockNumber,
|
||||
gasLimit,
|
||||
netVersion,
|
||||
signer
|
||||
@@ -160,9 +165,11 @@ function mapStateToProps (state) {
|
||||
}
|
||||
|
||||
function mapDispatchToProps (dispatch) {
|
||||
return {
|
||||
actions: bindActionCreators(RequestsActions, dispatch)
|
||||
};
|
||||
return bindActionCreators({
|
||||
newError,
|
||||
startConfirmRequest,
|
||||
startRejectRequest
|
||||
}, dispatch);
|
||||
}
|
||||
|
||||
export default connect(
|
||||
|
||||
@@ -95,7 +95,11 @@ export default class SignerStore {
|
||||
this._api.parity
|
||||
.localTransactions()
|
||||
.then((localTransactions) => {
|
||||
this.setLocalHashes(Object.keys(localTransactions));
|
||||
const keys = Object
|
||||
.keys(localTransactions)
|
||||
.filter((key) => localTransactions[key].status !== 'canceled');
|
||||
|
||||
this.setLocalHashes(keys);
|
||||
})
|
||||
.then(nextTimeout)
|
||||
.catch(nextTimeout);
|
||||
|
||||
Reference in New Issue
Block a user