1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 17:33:23 +01:00

[MMI] Set approved status in tx controller in MMI logic (#20507)

* fix(custodial-signing): set approved status in tx controller in MMI logic

* Fixed the issue that was not showing custody-confirm-link

---------

Co-authored-by: Shane Terence Odlum <shane.odlum@consensys.net>
This commit is contained in:
Albert Olivé 2023-08-18 14:38:51 +02:00 committed by GitHub
parent 8807d06535
commit 60f149178c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -1779,7 +1779,11 @@ export default class TransactionController extends EventEmitter {
// MMI does not broadcast transactions, as that is the responsibility of the custodian
if (txMeta.custodyStatus) {
this.inProcessOfSigning.delete(txId);
// Custodial nonces and gas params are set by the custodian, so MMI follows the approve
// workflow before the transaction parameters are sent to the keyring
this.txStateManager.setTxStatusApproved(txId);
await this._signTransaction(txId);
// MMI relies on custodian to publish transactions so exits this code path early
return;
}
///: END:ONLY_INCLUDE_IN

View File

@ -746,9 +746,6 @@ export default class ConfirmTransactionBase extends Component {
sendTransaction(txData)
.then(() => {
if (!this._isMounted) {
return;
}
if (txData.custodyStatus) {
showCustodianDeepLink({
fromAddress,
@ -762,6 +759,9 @@ export default class ConfirmTransactionBase extends Component {
},
onDeepLinkShown: () => {
clearConfirmTransaction();
if (!this._isMounted) {
return;
}
this.setState({ submitting: false }, () => {
history.push(mostRecentOverviewPage);
updateCustomNonce('');
@ -769,6 +769,9 @@ export default class ConfirmTransactionBase extends Component {
},
});
} else {
if (!this._isMounted) {
return;
}
this.setState(
{
submitting: false,