mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-27 20:47:38 +02:00
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:
@@ -809,6 +809,28 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
|
|||||||
valid: false,
|
valid: false,
|
||||||
expectedErrorMsg: "self-payments not allowed",
|
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",
|
name: "Valid send req parameters, payment settled",
|
||||||
backend: &RouterBackend{
|
backend: &RouterBackend{
|
||||||
|
Reference in New Issue
Block a user