Fixing UI to support both send and signTransaction
This commit is contained in:
parent
3e69ff0b88
commit
8686339b0c
@ -144,7 +144,8 @@ export function outSignerRequest (request) {
|
||||
break;
|
||||
|
||||
case 'payload':
|
||||
request[key].transaction = outTransaction(request[key].transaction);
|
||||
request[key].signTransaction = outTransaction(request[key].signTransaction);
|
||||
request[key].sendTransaction = outTransaction(request[key].sendTransaction);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
@ -72,8 +72,8 @@ export default class SignerMiddleware {
|
||||
};
|
||||
|
||||
// Sign request in-browser
|
||||
if (wallet && payload.transaction) {
|
||||
const { transaction } = payload;
|
||||
if (wallet && (payload.sendTransaction || payload.signTransaction)) {
|
||||
const transaction = payload.sendTransaction || payload.signTransaction;
|
||||
|
||||
(transaction.nonce.isZero()
|
||||
? this._api.parity.nextNonce(transaction.from)
|
||||
|
@ -25,7 +25,8 @@ export default class RequestFinished extends Component {
|
||||
result: PropTypes.any.isRequired,
|
||||
date: PropTypes.instanceOf(Date).isRequired,
|
||||
payload: PropTypes.oneOfType([
|
||||
PropTypes.shape({ transaction: PropTypes.object.isRequired }),
|
||||
PropTypes.shape({ signTransaction: PropTypes.object.isRequired }),
|
||||
PropTypes.shape({ sendTransaction: PropTypes.object.isRequired }),
|
||||
PropTypes.shape({ sign: PropTypes.object.isRequired })
|
||||
]).isRequired,
|
||||
msg: PropTypes.string,
|
||||
@ -58,8 +59,8 @@ export default class RequestFinished extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
if (payload.transaction) {
|
||||
const { transaction } = payload;
|
||||
if (payload.sendTransaction || payload.signTransaction) {
|
||||
const transaction = payload.sendTransaction || payload.signTransaction;
|
||||
|
||||
return (
|
||||
<TransactionFinished
|
||||
|
@ -27,7 +27,8 @@ export default class RequestPending extends Component {
|
||||
isSending: PropTypes.bool.isRequired,
|
||||
date: PropTypes.instanceOf(Date).isRequired,
|
||||
payload: PropTypes.oneOfType([
|
||||
PropTypes.shape({ transaction: PropTypes.object.isRequired }),
|
||||
PropTypes.shape({ signTransaction: PropTypes.object.isRequired }),
|
||||
PropTypes.shape({ sendTransaction: PropTypes.object.isRequired }),
|
||||
PropTypes.shape({ sign: PropTypes.object.isRequired })
|
||||
]).isRequired,
|
||||
className: PropTypes.string,
|
||||
@ -64,8 +65,8 @@ export default class RequestPending extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
if (payload.transaction) {
|
||||
const { transaction } = payload;
|
||||
if (payload.sendTransaction || payload.signTransaction) {
|
||||
const transaction = payload.sendTransaction || payload.signTransaction;
|
||||
|
||||
return (
|
||||
<TransactionPending
|
||||
|
Loading…
Reference in New Issue
Block a user