Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix early returning iterator #433

Closed
2 tasks done
danwt opened this issue Nov 4, 2022 · 2 comments · Fixed by #447
Closed
2 tasks done

Fix early returning iterator #433

danwt opened this issue Nov 4, 2022 · 2 comments · Fixed by #447
Labels
type: bug Issues that need priority attention -- something isn't working

Comments

@danwt
Copy link
Contributor

danwt commented Nov 4, 2022

Problem

// continue to iterate through all consumers
return true

I think it should return false, rather than true.

if cb(ctx, channelID, chainID) {
break
}

Closing criteria

Fix the iteration if necessary, and add a regression test

TODOs

  • Labels have been added for issue
  • Issue has been added to the ICS project
@danwt danwt added type: bug Issues that need priority attention -- something isn't working ccv-core labels Nov 4, 2022
@mpoke
Copy link
Contributor

mpoke commented Nov 6, 2022

Nice catch @danwt. IMO the fix entails changing the if condition to

if !cb(ctx, channelID, chainID)

in order to be consistent with the other iterators.

@mpoke
Copy link
Contributor

mpoke commented Nov 6, 2022

Could be worthwhile to also create a UT for EndBlockCCR to catch these types of errors. The e2e tests have only one consumer chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Issues that need priority attention -- something isn't working
Projects
No open projects
Status: Done
2 participants