Skip to content

deduplicate gas estimation code #249

@altergui

Description

@altergui

these 5 funcs do some kind of gas estimation

func (tm *TxManager) EstimateGas(
func (tm *TxManager) BuildDynamicFeeTx(
func (tm *TxManager) rebuildRegularTx(
func (tm *TxManager) rebuildBlobTx(
func (tm *TxManager) cancelTx(ctx context.Context, ptx *PendingTransaction) error {

we should really dedup all that code (maybe convert rebuildRegularTx into a buildRegularTx that is reused?)

and maintain a single method that correctly estimates gas for any passed tx (with blobs or without, etc), and use that method (and only that one) among all of the codebase

so git grep tm.cli.SuggestGasTipCap , tm.cli.SuggestGasPrice and tm.cli.EstimateGas should yield only 1 match

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions