htlcswitch/hop/payload: extend tests to required type failures
This commit is contained in:
2 files changed
+38
-5
No files matched your search
@@ -98,7 +98,7 @@ var decodePayloadTests = []decodePayloadTest{
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "required type zero",
|
||||
name: "required type zero final hop",
|
||||
payload: []byte{0x00, 0x00},
|
||||
expErr: hop.ErrInvalidPayload{
|
||||
Type: 0,
|
||||
@@ -106,6 +106,28 @@ var decodePayloadTests = []decodePayloadTest{
|
||||
FinalHop: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "required type zero final hop zero sid",
|
||||
payload: []byte{0x00, 0x00, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
expErr: hop.ErrInvalidPayload{
|
||||
Type: 0,
|
||||
Violation: hop.RequiredViolation,
|
||||
FinalHop: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "required type zero intermediate hop",
|
||||
payload: []byte{0x00, 0x00, 0x06, 0x08, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
expErr: hop.ErrInvalidPayload{
|
||||
Type: 0,
|
||||
Violation: hop.RequiredViolation,
|
||||
FinalHop: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// TestDecodeHopPayloadRecordValidation asserts that parsing the payloads in the
|
||||
|
||||
Reference in new issue
Block a user