-
Notifications
You must be signed in to change notification settings - Fork 204
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
Heartbeat sender factory #4455
Heartbeat sender factory #4455
Conversation
…_sender_factory # Conflicts: # heartbeat/sender/sender.go
Codecov Report
@@ Coverage Diff @@
## feat/multisigner #4455 +/- ##
====================================================
+ Coverage 73.92% 73.95% +0.02%
====================================================
Files 697 698 +1
Lines 88727 88808 +81
====================================================
+ Hits 65589 65675 +86
+ Misses 18204 18200 -4
+ Partials 4934 4933 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -59,3 +66,26 @@ func (chs *commonHeartbeatSender) generateMessageBytes( | |||
|
|||
return chs.marshaller.Marshal(msg) | |||
} | |||
|
|||
// GetCurrentNodeType will return the current sender type and subtype | |||
func (chs *commonHeartbeatSender) GetCurrentNodeType() (string, core.P2PPeerSubType, error) { |
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.
👍 less duplicated code
|
||
_, _, err = nodesCoordinator.GetValidatorWithPublicKey(pkBytes) | ||
if err == nil && isMultikey { | ||
return false, heartbeat.ErrInvalidConfiguration |
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.
we might return more info here, for easier debugging.
Something like:
return false, fmt.Errorf("%w, len(keysMap) = %d, isValidator = %v", heartbeat.ErrInvalidConfiguration, len(keysMap) > 0, err == nil)
hbSender, err := createHeartbeatSender(args) | ||
assert.Nil(t, err) | ||
assert.False(t, check.IfNil(hbSender)) | ||
assert.Equal(t, "*sender.heartbeatSender", fmt.Sprintf("%T", hbSender)) |
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.
👍
@@ -41,7 +42,7 @@ type ArgSender struct { | |||
|
|||
// sender defines the component which sends authentication and heartbeat messages | |||
type sender struct { | |||
heartbeatSender *heartbeatSender | |||
heartbeatSender heartbeatSenderHandler |
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.
👍 for cleaning up
no way around this, thus.
Version: Version, | ||
WorkingDir: "workingDir", | ||
UseLogView: true, | ||
BaseVersion: fmt.Sprintf("%s-base", Version), |
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.
why -base suffix?
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.
clear now, pushed
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.
No other things from me 👍
Description of the reasoning behind the pull request (what feature was missing / how the problem was manifesting itself / what was the motive behind the refactoring)
Proposed Changes
Testing procedure