@@ -1367,7 +1367,7 @@ func TestNewRoute(t *testing.T) {
13671367 // overwrite the final hop's feature vector in the graph.
13681368 destFeatures * lnwire.FeatureVector
13691369
1370- paymentAddr * [ 32 ]byte
1370+ paymentAddr fn. Option [[ 32 ]byte ]
13711371
13721372 // metadata is the payment metadata to attach to the route.
13731373 metadata []byte
@@ -1446,7 +1446,7 @@ func TestNewRoute(t *testing.T) {
14461446 // a fee to receive the payment.
14471447 name : "two hop single shot mpp" ,
14481448 destFeatures : tlvPayAddrFeatures ,
1449- paymentAddr : & testPaymentAddr ,
1449+ paymentAddr : fn . Some ( testPaymentAddr ) ,
14501450 paymentAmount : 100000 ,
14511451 hops : []* models.CachedEdgePolicy {
14521452 createHop (0 , 1000 , 1000000 , 10 ),
@@ -1911,7 +1911,7 @@ func runDestPaymentAddr(t *testing.T, useCache bool) {
19111911 luoji := ctx .keyFromAlias ("luoji" )
19121912
19131913 // Add payment address w/o any invoice features.
1914- ctx .restrictParams .PaymentAddr = & [32 ]byte {1 }
1914+ ctx .restrictParams .PaymentAddr = fn . Some ( [32 ]byte {1 })
19151915
19161916 // Add empty destination features. This should cause us to fail, since
19171917 // this overrides anything in the graph.
@@ -2955,7 +2955,7 @@ func runInboundFees(t *testing.T, useCache bool) {
29552955 ctx := newPathFindingTestContext (t , useCache , testChannels , "a" )
29562956
29572957 payAddr := [32 ]byte {1 }
2958- ctx .restrictParams .PaymentAddr = & payAddr
2958+ ctx .restrictParams .PaymentAddr = fn . Some ( payAddr )
29592959 ctx .restrictParams .DestFeatures = tlvPayAddrFeatures
29602960
29612961 const (
@@ -2974,7 +2974,7 @@ func runInboundFees(t *testing.T, useCache bool) {
29742974 amt : paymentAmt ,
29752975 cltvDelta : finalHopCLTV ,
29762976 records : nil ,
2977- paymentAddr : & payAddr ,
2977+ paymentAddr : fn . Some ( payAddr ) ,
29782978 totalAmt : paymentAmt ,
29792979 },
29802980 nil ,
@@ -3469,7 +3469,7 @@ func TestLastHopPayloadSize(t *testing.T) {
34693469 {
34703470 name : "Non blinded final hop" ,
34713471 restrictions : & RestrictParams {
3472- PaymentAddr : paymentAddr ,
3472+ PaymentAddr : fn . Some ( * paymentAddr ) ,
34733473 DestCustomRecords : customRecords ,
34743474 Metadata : metadata ,
34753475 Amp : ampOptions ,
@@ -3501,12 +3501,10 @@ func TestLastHopPayloadSize(t *testing.T) {
35013501 t .Run (tc .name , func (t * testing.T ) {
35023502 t .Parallel ()
35033503
3504- var mpp * record.MPP
3505- if tc .restrictions .PaymentAddr != nil {
3506- mpp = record .NewMPP (
3507- tc .amount , * tc .restrictions .PaymentAddr ,
3508- )
3509- }
3504+ mpp := fn .MapOptionZ (tc .restrictions .PaymentAddr ,
3505+ func (addr [32 ]byte ) * record.MPP {
3506+ return record .NewMPP (tc .amount , addr )
3507+ })
35103508
35113509 // In case it's an AMP payment we use the max AMP record
35123510 // size to estimate the final hop size.
0 commit comments