Skip to content

Commit

Permalink
simplify loops
Browse files Browse the repository at this point in the history
  • Loading branch information
makramkd committed Nov 21, 2024
1 parent 7401b4a commit f78c4c5
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions integration-tests/smoke/ccip/ccip_batching_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,11 @@ func Test_CCIPBatching(t *testing.T) {
wg.Wait()

var i int
outer:
for {
for i < len(sourceChains) {
select {
case err := <-errs:
require.NoError(t, err)
i++
if i == len(sourceChains) {
break outer
}
case <-ctx.Done():
require.FailNow(t, "didn't get all errors before test context was done")
}
Expand Down Expand Up @@ -169,16 +165,12 @@ func Test_CCIPBatching(t *testing.T) {

i = 0
var reports []*offramp.OffRampCommitReportAccepted
outer2:
for {
for i < len(sourceChains) {
select {
case outputErr := <-outputErrs:
require.NoError(t, outputErr.err)
reports = append(reports, outputErr.output)
i++
if i == len(sourceChains) {
break outer2
}
case <-ctx.Done():
require.FailNow(t, "didn't get all commit reports before test context was done")
}
Expand Down Expand Up @@ -212,16 +204,12 @@ func Test_CCIPBatching(t *testing.T) {

i = 0
var execStates []map[uint64]int
outer3:
for {
for i < len(sourceChains) {
select {
case outputErr := <-execErrs:
require.NoError(t, outputErr.err)
execStates = append(execStates, outputErr.output)
i++
if i == len(sourceChains) {
break outer3
}
case <-ctx.Done():
require.FailNow(t, "didn't get all exec reports before test context was done")
}
Expand Down

0 comments on commit f78c4c5

Please sign in to comment.