From feaa2b6487e1578c4082ba0b4be087a627512c4b Mon Sep 17 00:00:00 2001 From: David Date: Wed, 14 Jun 2023 03:03:35 +0800 Subject: [PATCH] fix(pkg): minor fixes for `WaitReceipt` (#284) --- pkg/rpc/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/rpc/utils.go b/pkg/rpc/utils.go index 090342e1d..cc08738bf 100644 --- a/pkg/rpc/utils.go +++ b/pkg/rpc/utils.go @@ -53,9 +53,9 @@ func WaitReceipt(ctx context.Context, client *ethclient.Client, tx *types.Transa for { select { case <-ctxWithTimeout.Done(): - return nil, ctx.Err() + return nil, ctxWithTimeout.Err() case <-ticker.C: - receipt, err := client.TransactionReceipt(ctx, tx.Hash()) + receipt, err := client.TransactionReceipt(ctxWithTimeout, tx.Hash()) if err != nil { continue }