accounts/abi/bind: improve error handling in WaitMined

- Change error logging from Trace to Warn level for better visibility
- Add immediate return for context cancellation errors
- Helps diagnose transaction receipt retrieval failures
This commit is contained in:
wonder olabisi 2025-11-23 20:27:29 +01:00
parent 9ac68e288c
commit bc8e8a74ed

View file

@ -43,7 +43,11 @@ func WaitMined(ctx context.Context, b DeployBackend, txHash common.Hash) (*types
if errors.Is(err, ethereum.NotFound) {
logger.Trace("Transaction not yet mined")
} else {
logger.Trace("Receipt retrieval failed", "err", err)
logger.Warn("Receipt retrieval failed", "err", err)
// For context cancellation, return immediately
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
return nil, err
}
}
// Wait for the next round.