Skip to content

Commit 9ee3beb

Browse files
committed
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.
1 parent 33e6f28 commit 9ee3beb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lnrpc/routerrpc/router_backend_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,28 @@ func TestExtractIntentFromSendRequest(t *testing.T) {
809809
valid: false,
810810
expectedErrorMsg: "self-payments not allowed",
811811
},
812+
{
813+
name: "Required and optional feature bits set",
814+
backend: &RouterBackend{
815+
MaxTotalTimelock: 1000,
816+
ShouldSetExpEndorsement: func() bool {
817+
return false
818+
},
819+
},
820+
sendReq: &SendPaymentRequest{
821+
Dest: destNodeBytes,
822+
Amt: int64(paymentAmount),
823+
PaymentHash: make([]byte, 32),
824+
MaxParts: 10,
825+
MaxShardSizeMsat: 30_000_000,
826+
DestFeatures: []lnrpc.FeatureBit{
827+
lnrpc.FeatureBit_GOSSIP_QUERIES_OPT,
828+
lnrpc.FeatureBit_GOSSIP_QUERIES_REQ,
829+
},
830+
},
831+
valid: false,
832+
expectedErrorMsg: "feature pair exists",
833+
},
812834
{
813835
name: "Valid send req parameters, payment settled",
814836
backend: &RouterBackend{

0 commit comments

Comments
 (0)