From a75bc13230e4920c80b66f879d794e9c412cf68f Mon Sep 17 00:00:00 2001 From: Carla Kirk-Cohen Date: Thu, 2 Nov 2023 14:34:47 -0400 Subject: [PATCH] routing/test: set outgoing timelock on non-legacy test cases Provide valid hop payloads for tests cases that use TLV onion format. --- routing/router_test.go | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/routing/router_test.go b/routing/router_test.go index d6abfe7a9..227899c83 100644 --- a/routing/router_test.go +++ b/routing/router_test.go @@ -3471,10 +3471,11 @@ func TestSendToRouteSkipTempErrSuccess(t *testing.T) { // Create a simple 1-hop route. hops := []*route.Hop{ { - ChannelID: 1, - PubKeyBytes: node.PubKeyBytes, - AmtToForward: payAmt, - MPP: record.NewMPP(payAmt, [32]byte{}), + ChannelID: 1, + PubKeyBytes: node.PubKeyBytes, + AmtToForward: payAmt, + OutgoingTimeLock: 120, + MPP: record.NewMPP(payAmt, [32]byte{}), }, } rt, err := route.NewRouteFromHops(payAmt, 100, node.PubKeyBytes, hops) @@ -3607,10 +3608,11 @@ func TestSendToRouteSkipTempErrTempFailure(t *testing.T) { // Create a simple 1-hop route. hops := []*route.Hop{ { - ChannelID: 1, - PubKeyBytes: node.PubKeyBytes, - AmtToForward: payAmt, - MPP: record.NewMPP(payAmt, [32]byte{}), + ChannelID: 1, + PubKeyBytes: node.PubKeyBytes, + AmtToForward: payAmt, + OutgoingTimeLock: 120, + MPP: record.NewMPP(payAmt, [32]byte{}), }, } rt, err := route.NewRouteFromHops(payAmt, 100, node.PubKeyBytes, hops) @@ -3688,10 +3690,11 @@ func TestSendToRouteSkipTempErrPermanentFailure(t *testing.T) { // Create a simple 1-hop route. hops := []*route.Hop{ { - ChannelID: 1, - PubKeyBytes: node.PubKeyBytes, - AmtToForward: payAmt, - MPP: record.NewMPP(payAmt, [32]byte{}), + ChannelID: 1, + PubKeyBytes: node.PubKeyBytes, + AmtToForward: payAmt, + OutgoingTimeLock: 120, + MPP: record.NewMPP(payAmt, [32]byte{}), }, } rt, err := route.NewRouteFromHops(payAmt, 100, node.PubKeyBytes, hops) @@ -3773,10 +3776,11 @@ func TestSendToRouteTempFailure(t *testing.T) { // Create a simple 1-hop route. hops := []*route.Hop{ { - ChannelID: 1, - PubKeyBytes: node.PubKeyBytes, - AmtToForward: payAmt, - MPP: record.NewMPP(payAmt, [32]byte{}), + ChannelID: 1, + PubKeyBytes: node.PubKeyBytes, + AmtToForward: payAmt, + OutgoingTimeLock: 120, + MPP: record.NewMPP(payAmt, [32]byte{}), }, } rt, err := route.NewRouteFromHops(payAmt, 100, node.PubKeyBytes, hops)