lnrpc: add test case to TestExtractIntentFromSendRequest

Here we add a test case to TestExtractIntentFromSendRequest which shows
that an error is returned if the destination feature bit vector of a
payment request contains both the required and optional bits for a given
feature. This will be updated in an upcoming commit to be less strict.
This commit is contained in:
Elle Mouton
2025-06-25 13:10:48 +02:00
parent 33e6f28542
commit 9ee3bebc6a

View File

@@ -809,6 +809,28 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
valid: false,
expectedErrorMsg: "self-payments not allowed",
},
{
name: "Required and optional feature bits set",
backend: &RouterBackend{
MaxTotalTimelock: 1000,
ShouldSetExpEndorsement: func() bool {
return false
},
},
sendReq: &SendPaymentRequest{
Dest: destNodeBytes,
Amt: int64(paymentAmount),
PaymentHash: make([]byte, 32),
MaxParts: 10,
MaxShardSizeMsat: 30_000_000,
DestFeatures: []lnrpc.FeatureBit{
lnrpc.FeatureBit_GOSSIP_QUERIES_OPT,
lnrpc.FeatureBit_GOSSIP_QUERIES_REQ,
},
},
valid: false,
expectedErrorMsg: "feature pair exists",
},
{
name: "Valid send req parameters, payment settled",
backend: &RouterBackend{