record/routing: set minimum padding size

This commit is contained in:
Elle Mouton
2024-07-26 10:32:47 +02:00
parent 398623bde5
commit 60a856ab65
4 changed files with 34 additions and 7 deletions

View File

@@ -196,6 +196,10 @@ func TestDummyHopBlindedDataEncoding(t *testing.T) {
encoded, err := EncodeBlindedRouteData(routeData)
require.NoError(t, err)
// Assert the size of an average dummy hop payload in case we need to
// update this constant in future.
require.Len(t, encoded, AverageDummyHopPayloadSize)
b := bytes.NewBuffer(encoded)
decodedData, err := DecodeBlindedRouteData(b)
require.NoError(t, err)