Skip to content

Commit

Permalink
fix: defer recover in checkAggAndBatcherHaveEnoughBalance
Browse files Browse the repository at this point in the history
  • Loading branch information
uri-99 committed Nov 19, 2024
1 parent dd2e35d commit 028466d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/chainio/avs_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ func (w *AvsWriter) checkIfAggregatorHadToPaidForBatcher(tx *types.Transaction,
}

func (w *AvsWriter) checkAggAndBatcherHaveEnoughBalance(tx *types.Transaction, txOpts bind.TransactOpts, batchIdentifierHash [32]byte, senderAddress [20]byte) error {
defer func() {
if r := recover(); r != nil {
w.logger.Error("Recovered from panic", "error", r)
}
// return fmt.Errorf("Recovered from panic") // TODO can't do this
}()

w.logger.Info("Checking if aggregator and batcher have enough balance for the transaction")
aggregatorAddress := txOpts.From
txGasAsBigInt := new(big.Int).SetUint64(tx.Gas())
Expand Down

0 comments on commit 028466d

Please sign in to comment.