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

Use channel of pointers to objects for consistency #797

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

illia-malachyn
Copy link
Contributor

I had to change the access interface of some endpoints. I'm not sure if I should've done this

@illia-malachyn
Copy link
Contributor Author

cc @peterargue

@codecov-commenter
Copy link

codecov-commenter commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 53.33333% with 35 lines in your changes missing coverage. Please review.

Project coverage is 57.47%. Comparing base (2f7fa8b) to head (aac6b77).
Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
access/grpc/client.go 0.00% 15 Missing ⚠️
access/grpc/convert/convert.go 28.57% 10 Missing ⚠️
access/mocks/Client.go 0.00% 8 Missing ⚠️
access/http/client.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #797      +/-   ##
==========================================
+ Coverage   56.59%   57.47%   +0.88%     
==========================================
  Files          35       35              
  Lines        7305     7454     +149     
==========================================
+ Hits         4134     4284     +150     
+ Misses       2670     2660      -10     
- Partials      501      510       +9     
Flag Coverage Δ
unittests 57.47% <53.33%> (+0.88%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@peterargue peterargue left a comment

Choose a reason for hiding this comment

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

added a comment about returning nil instead of an empty object. otherwise looks good

access/grpc/convert/convert.go Outdated Show resolved Hide resolved
access/client.go Outdated Show resolved Hide resolved
access/grpc/client.go Outdated Show resolved Hide resolved
Copy link
Contributor

@janezpodhostnik janezpodhostnik 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 some empty return types that could be nil instead.

if m == nil {
return flow.BlockHeader{}, ErrEmptyMessage
return &flow.BlockHeader{}, ErrEmptyMessage
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can also be nil

Suggested change
return &flow.BlockHeader{}, ErrEmptyMessage
return nil, ErrEmptyMessage

@@ -346,10 +346,10 @@ func MessageToBlockHeader(m *entities.BlockHeader) (flow.BlockHeader, error) {

timeoutCertificate, err := MessageToTimeoutCertificate(m.GetLastViewTc())
if err != nil {
return flow.BlockHeader{}, fmt.Errorf("error converting timeout certificate: %w", err)
return &flow.BlockHeader{}, fmt.Errorf("error converting timeout certificate: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

if m == nil {
return flow.BlockDigest{}, ErrEmptyMessage
return &flow.BlockDigest{}, ErrEmptyMessage
Copy link
Contributor

Choose a reason for hiding this comment

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

and here

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.

4 participants