-
Notifications
You must be signed in to change notification settings - Fork 85
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
base: master
Are you sure you want to change the base?
Use channel of pointers to objects for consistency #797
Conversation
cc @peterargue |
Codecov ReportAttention: Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this 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
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
I had to change the access interface of some endpoints. I'm not sure if I should've done this