From 5eb73ed732c0e52d46e1c54c68fd1df23a58c6b7 Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Sun, 7 Jul 2024 18:00:47 -0700 Subject: [PATCH] add context to the error returned by waitForReceipt when context is done before tx is mined (#293) --- chainio/txmgr/txmgr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chainio/txmgr/txmgr.go b/chainio/txmgr/txmgr.go index b0c3b222..5df7da23 100644 --- a/chainio/txmgr/txmgr.go +++ b/chainio/txmgr/txmgr.go @@ -129,7 +129,7 @@ func (m *SimpleTxManager) waitForReceipt(ctx context.Context, txID wallet.TxID) for { select { case <-ctx.Done(): - return nil, ctx.Err() + return nil, errors.Join(errors.New("Context done before tx was mined"), ctx.Err()) case <-queryTicker.C: if receipt := m.queryReceipt(ctx, txID); receipt != nil { return receipt, nil