From 599bb5c464e15395e40bd7ef053a578a31e27cd8 Mon Sep 17 00:00:00 2001 From: AnieeG Date: Wed, 18 Dec 2024 08:10:02 -0800 Subject: [PATCH] comments --- deployment/environment/memory/environment.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/deployment/environment/memory/environment.go b/deployment/environment/memory/environment.go index 94f9def3419..e6496f52492 100644 --- a/deployment/environment/memory/environment.go +++ b/deployment/environment/memory/environment.go @@ -81,11 +81,13 @@ func generateMemoryChain(t *testing.T, inputs map[uint64]EVMChain) map[uint64]de } for { backend.Commit() - ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) - defer cancel() - receipt, err := bind.WaitMined(ctx, backend, tx) - if err != nil || receipt == nil { - return 0, fmt.Errorf("failed to get confirmed receipt for chain %s: %w", chainInfo.ChainName, err) + receipt, err := func() (*types.Receipt, error) { + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) + defer cancel() + return bind.WaitMined(ctx, backend, tx) + }() + if err != nil { + return 0, fmt.Errorf("tx %s failed to confirm: %v, chain %s", tx.Hash().Hex(), err, chainInfo.ChainSelector) } if receipt.Status == 0 { errReason, err := deployment.GetErrorReasonFromTx(chain.Backend.Client(), chain.DeployerKey.From, tx, receipt)