Skip to content

Commit f620f5d

Browse files
committed
fix: fix gas calculation
1 parent 05b4eb4 commit f620f5d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/bridge-status-controller/src/bridge-status-controller.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,17 +1239,15 @@ export class BridgeStatusController extends StaticIntervalPollingController<Brid
12391239
): Promise<{
12401240
maxFeePerGas: Hex;
12411241
maxPriorityFeePerGas: Hex;
1242-
gas: Hex;
1242+
gas?: Hex;
12431243
}> => {
1244-
const maxGasLimit = toHex(transactionParams.gas ?? 0);
1245-
12461244
// If txFee is provided (gasIncluded case), use the quote's gas fees
12471245
// Convert to hex since txFee values from the quote are decimal strings
12481246
if (txFee) {
12491247
return {
12501248
maxFeePerGas: toHex(txFee.maxFeePerGas ?? 0),
12511249
maxPriorityFeePerGas: toHex(txFee.maxPriorityFeePerGas ?? 0),
1252-
gas: maxGasLimit,
1250+
gas: transactionParams.gas ? toHex(transactionParams.gas) : undefined,
12531251
};
12541252
}
12551253

@@ -1269,7 +1267,7 @@ export class BridgeStatusController extends StaticIntervalPollingController<Brid
12691267
return {
12701268
maxFeePerGas,
12711269
maxPriorityFeePerGas,
1272-
gas: maxGasLimit,
1270+
gas: transactionParams.gas ? toHex(transactionParams.gas) : undefined,
12731271
};
12741272
};
12751273

0 commit comments

Comments
 (0)