Skip to content

Commit 9c5a054

Browse files
committed
test: update set of tests to supply data for the set of extra bytes
In this commit, we update the tests to always supply data for the extra bytes within the HopData payload. This ensures that the bytes are properly encoded/decoded at each hop.
1 parent 01bd198 commit 9c5a054

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sphinx_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"reflect"
88
"testing"
99

10-
"github.com/davecgh/go-spew/spew"
1110
"github.com/btcsuite/btcd/btcec"
1211
"github.com/btcsuite/btcd/chaincfg"
12+
"github.com/davecgh/go-spew/spew"
1313
)
1414

1515
// BOLT 4 Test Vectors
@@ -115,6 +115,7 @@ func newTestRoute(numHops int) ([]*Router, *[]HopData, *OnionPacket, error) {
115115
OutgoingCltv: uint32(i),
116116
})
117117
copy(hopsData[i].NextAddress[:], bytes.Repeat([]byte{byte(i)}, 8))
118+
copy(hopsData[i].ExtraBytes[:], bytes.Repeat([]byte{byte(i)}, padSize))
118119
}
119120

120121
// Generate a forwarding message to route to the final node via the

0 commit comments

Comments
 (0)