Skip to content

Commit

Permalink
move timeout check location
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Apr 3, 2024
1 parent bd909a4 commit 00ed796
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions e2e/utils/zetacore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 00ed796

Please sign in to comment.