multi: rename experimental endorsement signal to accountable
Renames the endorsement signal to accountable to match the latest proposal https://github.com/lightning/blips/pull/67
This commit is contained in:
1 parent
801de79cf1
commit
34329c684e
21 files changed
+229
-227
No files matched your search
@@ -122,9 +122,9 @@ type RouterBackend struct {
|
||||
// channel data from the first hop of a route.
|
||||
ParseCustomChannelData func(message proto.Message) error
|
||||
|
||||
// ShouldSetExpEndorsement returns a boolean indicating whether the
|
||||
// experimental endorsement bit should be set.
|
||||
ShouldSetExpEndorsement func() bool
|
||||
// ShouldSetExpAccountability returns a boolean indicating whether the
|
||||
// experimental accountability bit should be set.
|
||||
ShouldSetExpAccountability func() bool
|
||||
|
||||
// Clock is the clock used to validate payment requests expiry.
|
||||
// It is useful for testing.
|
||||
@@ -947,19 +947,19 @@ func (r *RouterBackend) extractIntentFromSendRequest(
|
||||
}
|
||||
payIntent.FirstHopCustomRecords = firstHopRecords
|
||||
|
||||
// If the experimental endorsement signal is not already set, propagate
|
||||
// If the experimental accountable signal is not already set, propagate
|
||||
// a zero value field if configured to set this signal.
|
||||
if r.ShouldSetExpEndorsement() {
|
||||
if r.ShouldSetExpAccountability() {
|
||||
if payIntent.FirstHopCustomRecords == nil {
|
||||
payIntent.FirstHopCustomRecords = make(
|
||||
map[uint64][]byte,
|
||||
)
|
||||
}
|
||||
|
||||
t := uint64(lnwire.ExperimentalEndorsementType)
|
||||
t := uint64(lnwire.ExperimentalAccountableType)
|
||||
if _, set := payIntent.FirstHopCustomRecords[t]; !set {
|
||||
payIntent.FirstHopCustomRecords[t] = []byte{
|
||||
lnwire.ExperimentalUnendorsed,
|
||||
lnwire.ExperimentalUnaccountable,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -677,7 +677,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
{
|
||||
name: "Amount conflict, both sat and msat specified",
|
||||
backend: &RouterBackend{
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return true
|
||||
},
|
||||
},
|
||||
@@ -692,7 +692,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
{
|
||||
name: "Both dest and payment_request provided",
|
||||
backend: &RouterBackend{
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
},
|
||||
@@ -708,7 +708,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
{
|
||||
name: "Both payment_hash and payment_request provided",
|
||||
backend: &RouterBackend{
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
},
|
||||
@@ -725,7 +725,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
name: "Both final_cltv_delta and payment_request " +
|
||||
"provided",
|
||||
backend: &RouterBackend{
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
},
|
||||
@@ -741,7 +741,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
{
|
||||
name: "Invalid payment request length",
|
||||
backend: &RouterBackend{
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
ActiveNetParams: &chaincfg.RegressionNetParams,
|
||||
@@ -756,7 +756,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
{
|
||||
name: "Expired invoice payment request",
|
||||
backend: &RouterBackend{
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
ActiveNetParams: &chaincfg.RegressionNetParams,
|
||||
@@ -772,7 +772,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
{
|
||||
name: "Invoice missing payment address",
|
||||
backend: &RouterBackend{
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
ActiveNetParams: &chaincfg.RegressionNetParams,
|
||||
@@ -789,7 +789,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
{
|
||||
name: "Invalid dest vertex length",
|
||||
backend: &RouterBackend{
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
},
|
||||
@@ -803,7 +803,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
{
|
||||
name: "Payment request with missing amount",
|
||||
backend: &RouterBackend{
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
},
|
||||
@@ -817,7 +817,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
{
|
||||
name: "Destination lacks AMP support",
|
||||
backend: &RouterBackend{
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
},
|
||||
@@ -834,7 +834,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
{
|
||||
name: "Invalid payment hash length",
|
||||
backend: &RouterBackend{
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
},
|
||||
@@ -849,7 +849,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
{
|
||||
name: "Payment amount exceeds maximum possible amount",
|
||||
backend: &RouterBackend{
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
},
|
||||
@@ -868,7 +868,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
name: "Reject self-payments if not permitted",
|
||||
backend: &RouterBackend{
|
||||
MaxTotalTimelock: 1000,
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
SelfNode: target,
|
||||
@@ -885,7 +885,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
name: "Required and optional feature bits set",
|
||||
backend: &RouterBackend{
|
||||
MaxTotalTimelock: 1000,
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
},
|
||||
@@ -906,7 +906,7 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
||||
name: "Valid send req parameters, payment settled",
|
||||
backend: &RouterBackend{
|
||||
MaxTotalTimelock: 1000,
|
||||
ShouldSetExpEndorsement: func() bool {
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
return false
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user