diff --git a/e2e/utils/zetacore.go b/e2e/utils/zetacore.go index 30fa0bcf08..4aeac71ba3 100644 --- a/e2e/utils/zetacore.go +++ b/e2e/utils/zetacore.go @@ -49,7 +49,11 @@ func WaitCctxsMinedByInTxHash( // fetch cctxs by inTxHash for i := 0; ; i++ { + if time.Since(startTime) > timeout { + panic(fmt.Sprintf("waiting cctx timeout, cctx not mined, inTxHash: %s", inTxHash)) + } time.Sleep(1 * time.Second) + res, err := cctxClient.InTxHashToCctxData(ctx, &crosschaintypes.QueryInTxHashToCctxDataRequest{ InTxHash: inTxHash, }) @@ -93,13 +97,6 @@ func WaitCctxsMinedByInTxHash( cctxs = append(cctxs, &cctx) } if !allFound { - if time.Since(startTime) > timeout { - panic(fmt.Sprintf( - "waiting cctx timeout, cctx not mined, inTxHash: %s, current cctxs: %v", - inTxHash, - cctxs, - )) - } continue } return cctxs