Skip to content

Commit 1850f31

Browse files
committed
Rename beforeSign hook to afterSimulate
1 parent d29c6d6 commit 1850f31

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/transaction-controller/src/TransactionController.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4127,14 +4127,14 @@ export class TransactionController extends BaseController<
41274127
},
41284128
);
41294129

4130-
log('Calling afterSimulate hook', finalTransactionMeta);
4131-
41324130
if (ethQuery) {
4131+
log('Calling afterSimulate hook', finalTransactionMeta);
4132+
41334133
const result = await this.#afterSimulate({
41344134
transactionMeta: finalTransactionMeta,
41354135
});
41364136

4137-
if (result.updateTransaction) {
4137+
if (result?.updateTransaction) {
41384138
log('Updating transaction with afterSimulate data');
41394139

41404140
finalTransactionMeta = this.#updateTransactionInternal(
@@ -4150,6 +4150,8 @@ export class TransactionController extends BaseController<
41504150
txParams: { ...finalTransactionMeta.txParams, gas: undefined },
41514151
});
41524152

4153+
log('Updating gas following afterSimulate hook', estimatedGas);
4154+
41534155
finalTransactionMeta = this.#updateTransactionInternal(
41544156
{ transactionId },
41554157
(txMeta) => {

0 commit comments

Comments
 (0)