@@ -15,19 +15,19 @@ import (
1515 "github.com/stretchr/testify/require"
1616)
1717
18- // testExperimentalEndorsement tests setting of positive and negative
19- // experimental endorsement signals.
20- func testExperimentalEndorsement (ht * lntest.HarnessTest ) {
21- testEndorsement (ht , true )
22- testEndorsement (ht , false )
18+ // testExperimentalAccountability tests setting of positive and negative
19+ // experimental accountable signals.
20+ func testExperimentalAccountability (ht * lntest.HarnessTest ) {
21+ testAccountability (ht , true )
22+ testAccountability (ht , false )
2323}
2424
25- // testEndorsement sets up a 5 hop network and tests propagation of
26- // experimental endorsement signals.
27- func testEndorsement (ht * lntest.HarnessTest , aliceEndorse bool ) {
25+ // testAccountability sets up a 5 hop network and tests propagation of
26+ // experimental accountable signals.
27+ func testAccountability (ht * lntest.HarnessTest , aliceAccountable bool ) {
2828 cfg := node .CfgAnchor
2929 carolCfg := append (
30- []string {"--protocol.no-experimental-endorsement " }, cfg ... ,
30+ []string {"--protocol.no-experimental-accountability " }, cfg ... ,
3131 )
3232 cfgs := [][]string {cfg , cfg , carolCfg , cfg , cfg }
3333
@@ -57,48 +57,41 @@ func testEndorsement(ht *lntest.HarnessTest, aliceEndorse bool) {
5757 FeeLimitMsat : math .MaxInt64 ,
5858 }
5959
60- var expectedValue []byte
61- hasEndorsement := lntest .ExperimentalEndorsementActive ()
62-
63- if hasEndorsement {
64- if aliceEndorse {
65- expectedValue = []byte {lnwire .ExperimentalEndorsed }
66- t := uint64 (lnwire .ExperimentalEndorsementType )
67- sendReq .FirstHopCustomRecords = map [uint64 ][]byte {
68- t : expectedValue ,
69- }
70- } else {
71- expectedValue = []byte {lnwire .ExperimentalUnendorsed }
60+ expectedValue := []byte {lnwire .ExperimentalUnaccountable }
61+ if aliceAccountable {
62+ expectedValue = []byte {lnwire .ExperimentalAccountable }
63+ t := uint64 (lnwire .ExperimentalAccountableType )
64+ sendReq .FirstHopCustomRecords = map [uint64 ][]byte {
65+ t : expectedValue ,
7266 }
7367 }
7468
7569 _ = alice .RPC .SendPayment (sendReq )
7670
7771 // Validate that our signal (positive or zero) propagates until carol
7872 // and then is dropped because she has disabled the feature.
79- // When the endorsement experiment is not active, no signal is sent.
80- validateEndorsedAndResume (
81- ht , bobIntercept , hasEndorsement , expectedValue ,
73+ validateAccountableAndResume (
74+ ht , bobIntercept , true , expectedValue ,
8275 )
83- validateEndorsedAndResume (
84- ht , carolIntercept , hasEndorsement , expectedValue ,
76+ validateAccountableAndResume (
77+ ht , carolIntercept , true , expectedValue ,
8578 )
86- validateEndorsedAndResume (ht , daveIntercept , false , nil )
79+ validateAccountableAndResume (ht , daveIntercept , false , nil )
8780
8881 var preimage lntypes.Preimage
8982 copy (preimage [:], invoice .RPreimage )
9083 ht .AssertPaymentStatus (alice , preimage .Hash (), lnrpc .Payment_SUCCEEDED )
9184}
9285
93- func validateEndorsedAndResume (ht * lntest.HarnessTest ,
94- interceptor rpc.InterceptorClient , hasEndorsement bool ,
86+ func validateAccountableAndResume (ht * lntest.HarnessTest ,
87+ interceptor rpc.InterceptorClient , hasAccountable bool ,
9588 expectedValue []byte ) {
9689
9790 packet := ht .ReceiveHtlcInterceptor (interceptor )
9891
9992 var expectedRecords map [uint64 ][]byte
100- if hasEndorsement {
101- u64Type := uint64 (lnwire .ExperimentalEndorsementType )
93+ if hasAccountable {
94+ u64Type := uint64 (lnwire .ExperimentalAccountableType )
10295 expectedRecords = map [uint64 ][]byte {
10396 u64Type : expectedValue ,
10497 }
0 commit comments