Skip to content

Commit a68ce3a

Browse files
authored
refactor(tx_client): remove unnecessary type conversions for PFB gas limit (celestiaorg#5878)
Replace the redundant float round-trip in PFB gas limit calculation by using the uint64 returned from blobtypes.DefaultEstimateGas directly. This removes unnecessary conversions, aligns with usage across the codebase, and avoids any theoretical precision risk without changing behavior.
1 parent a08999c commit a68ce3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/user/tx_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ func (client *TxClient) BroadcastPayForBlobWithAccount(ctx context.Context, acco
299299
if err != nil {
300300
return nil, err
301301
}
302-
gasLimit := uint64(float64(blobtypes.DefaultEstimateGas(msg)))
302+
gasLimit := blobtypes.DefaultEstimateGas(msg)
303303
fee := uint64(math.Ceil(appconsts.DefaultMinGasPrice * float64(gasLimit)))
304304
// prepend calculated params, so it can be overwritten in case the user has specified it.
305305
opts = append([]TxOption{SetGasLimit(gasLimit), SetFee(fee)}, opts...)

0 commit comments

Comments
 (0)