-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
htlcswitch+peer: introduce packetHandler, ChannelUpdateHandler interfaces for cleaner separation #5603
htlcswitch+peer: introduce packetHandler, ChannelUpdateHandler interfaces for cleaner separation #5603
Conversation
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.
Did a quick review and it's looking good! Love how we handle decoupling/embedding here, nice structural improvement!
htlcswitch/interfaces.go
Outdated
// came from another peer or if the update was created by user | ||
// initially. | ||
// | ||
// NOTE: This function MUST be non-blocking (or block as little as |
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.
nit: Though it's copied, I think the comments contradict themselves...
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.
Changed the comment, PTAL
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.
LGTM, nice structural refactors @Crypt-iQ 🥇
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.
LGTM👍
Needs an update to the release notes. |
This allows non-test usages of ChannelLinkConfig to omit the raw htlcswitch.Switch pointer.
This will allow separating the now-private *htlcPacket methods from the publicly-used ChannelLink interface methods.
GetLink, GetLinksByInterface now use ChannelUpdateHandler.
This commit allows the peer to be tested without relying on a raw htlcswitch.Switch pointer. This is accomplished by using a messageSwitch interface and adding the CreateAndAddLink method to the htlcswitch.Switch.
7df36c9
to
db4a488
Compare
Added release notes PTAL @yyforyongyu @bhandras |
Closing then opening to try to kick travis. |
Meant to fix some of the issues outlined in #5067. It removes
*htlcswitch.Switch
frompeer
unit tests and replaces it withmockMessageSwitch
.