discovery+lnwire: remove embedding within ReplyChannelRange

In order to prep for allowing TLV extensions for the `ReplyChannelRange`
and `QueryChannelRange` messages, we'll need to remove the struct
embedding as is. If we don't remove this, then we'll attempt to decode
TLV extensions from both the embedded and outer struct.

All relevant call sites have been updated to reflect this minor change.
This commit is contained in:
Olaoluwa Osuntokun
2020-01-27 17:30:54 -08:00
committed by Johan T. Halseth
parent 466c079bbe
commit dd6f0ba931
6 changed files with 108 additions and 74 deletions

View File

@ -30,7 +30,7 @@ func TestReplyChannelRangeUnsorted(t *testing.T) {
var req2 ReplyChannelRange
err = req2.Decode(bytes.NewReader(b.Bytes()), 0)
if _, ok := err.(ErrUnsortedSIDs); !ok {
t.Fatalf("expected ErrUnsortedSIDs, got: %T",
t.Fatalf("expected ErrUnsortedSIDs, got: %v",
err)
}
})
@ -67,13 +67,11 @@ func TestReplyChannelRangeEmpty(t *testing.T) {
test := test
t.Run(test.name, func(t *testing.T) {
req := ReplyChannelRange{
QueryChannelRange: QueryChannelRange{
FirstBlockHeight: 1,
NumBlocks: 2,
},
Complete: 1,
EncodingType: test.encType,
ShortChanIDs: nil,
FirstBlockHeight: 1,
NumBlocks: 2,
Complete: 1,
EncodingType: test.encType,
ShortChanIDs: nil,
}
// First decode the hex string in the test case into a