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

refactor: change test return type for concurrency #103

Merged
merged 3 commits into from
Jul 20, 2021

Conversation

Josumner
Copy link
Contributor

No description provided.

@Josumner Josumner requested review from daeMOn63 and ejfitzgerald and removed request for daeMOn63 July 19, 2021 09:04
daeMOn63
daeMOn63 previously approved these changes Jul 19, 2021
Copy link
Contributor

@daeMOn63 daeMOn63 left a comment

Choose a reason for hiding this comment

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

Looks good 👍
Just a small nit comment, since expResponse is mostly passed around as a pointer, it's probably best to just return a pointer from the start. No big deal in this context outside of some little code clarity improvement and negligible perf gain. The main interest appears with bigger structs, as returning a pointer reference would avoid some stack allocations and copies that are done when returning the actual struct.

testCases := []struct {
msg string
malleate func()
testFunc func() (*types.QueryAllFundsRequest, types.QueryAllFundsResponse)
Copy link
Contributor

Choose a reason for hiding this comment

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

why not returning a *types.QueryAllFundsResponse here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well spotted, I didn't meant to implement it in that way

@Josumner Josumner merged commit 05b7363 into master Jul 20, 2021
@Josumner Josumner deleted the grpc_test_refactor branch July 20, 2021 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants