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

ledger: fix error shadowing in accountsNewRound #5266

Merged
merged 2 commits into from Apr 18, 2023

Conversation

algorandskiy
Copy link
Contributor

Summary

Fixed err shadowing in accountsNewRound and rewrote accountsNewRound and onlineAccountsNewRound to return immediately. This is a slight behavior change: all the updated* return values are now empty on error

Test Plan

Added new test. Existing tests passed.

* Rewrote accountsNewRound and onlineAccountsNewRound to return immediately
* This has a behavior change: all the updated* return values are now empty on error
Copy link
Contributor

@algonautshant algonautshant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look great!
The code is safer this way, and the test was needed!

@algorandskiy algorandskiy merged commit 885191a into algorand:master Apr 18, 2023
7 checks passed

if err != nil {
return
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think a function of this length should use naked returns at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants