forked from lightningnetwork/lnd
-
Notifications
You must be signed in to change notification settings - Fork 0
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
G175 origin chandb new types #105
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pull reviewers statsStats of the last 30 days for lnd:
|
0fbc058
to
b9f65e3
Compare
7d3db71
to
6ee21d7
Compare
6ee21d7
to
53084cb
Compare
To prepare for the addition of ChannelAuthProof2 along with a ChannelAuthProof interface, rename ChannelAuthProof to ChannelAuthProof1.
In preparation for the addition of ChannelEdgePolicy2 and a ChannelEdgePolicy interface, rename ChannelEdgePolicy to ChannelEdgePolicy1.
In preparaion for adding ChannelEdgeInfo2 and a ChannelEdgeInfo interface, rename ChannelEdgeInfo to ChannelEdgeInfo1.
Add new ChannelEdgeInfo and ChannelAuthProof interfaces and ensure that they are implemented by ChannelEdgeInfo1 and ChannelAuthProof respectively.
And ensure that ChannelEdgePolicy1 implements it.
And ensure that it implements the ChannelEdgeInfo interface.
And ensure that it implements the ChannelEdgePoicy interface.
This commit moves the serialisation, deserialisation and update functions for ChannelEdgePolicy1 and ChannelEdgeInfo1 into their own files.
53084cb
to
91f4488
Compare
In this commit, we update the `putChanEdgeInfo` function to take in the models.ChannelEdgeInfo interface. If the passed value is the legacy models.ChannelEdgeInfo1, then the encoding and decoding remains the same but if it is the new models.ChannelEdgeInfo2 then: - the encoding will be prefixed with a 0xff byte. This should not clash with the encoding of the legacy struct since that encoding will always start with a pub key (of node 1) which means it will always start with 0x02 or 0x03. - The 0xff is then followed by a type-byte which will be used to identify the encoding that follows (this is to make it future proof). For now, there is only one possible type-byte here. - This is then followed by the TLV encoding of ChannelEdgeInfo2.
Similarly to the previous commit, here we add the encoding for the new ChannelEdgePolicy2. This is done in the same was as for ChannelEdgeInfo2: - a 0xff prefix - followed by a type-byte - followed by the TLV encoding of the ChannelEdgePolicy2.
b9f65e3
to
be56e6f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Description
Description of change / link to associated issue.
Steps to Test
Steps for reviewers to follow to test the change.
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]
in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.