diff --git a/htlcswitch/hop/payload_test.go b/htlcswitch/hop/payload_test.go index b0a92534..bfe2c134 100644 --- a/htlcswitch/hop/payload_test.go +++ b/htlcswitch/hop/payload_test.go @@ -10,6 +10,8 @@ import ( "github.com/lightningnetwork/lnd/record" ) +const testUnknownRequiredType = 0x10 + type decodePayloadTest struct { name string payload []byte @@ -81,21 +83,26 @@ var decodePayloadTests = []decodePayloadTest{ }, }, { - name: "required type after omitted hop id", - payload: []byte{0x02, 0x00, 0x04, 0x00, 0x0a, 0x00}, + name: "required type after omitted hop id", + payload: []byte{ + 0x02, 0x00, 0x04, 0x00, + testUnknownRequiredType, 0x00, + }, expErr: hop.ErrInvalidPayload{ - Type: 10, + Type: testUnknownRequiredType, Violation: hop.RequiredViolation, FinalHop: true, }, }, { name: "required type after included hop id", - payload: []byte{0x02, 0x00, 0x04, 0x00, 0x06, 0x08, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, + payload: []byte{ + 0x02, 0x00, 0x04, 0x00, 0x06, 0x08, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, + testUnknownRequiredType, 0x00, }, expErr: hop.ErrInvalidPayload{ - Type: 10, + Type: testUnknownRequiredType, Violation: hop.RequiredViolation, FinalHop: false, },