Skip to content

Commit

Permalink
Merge pull request #109 from getlipa/feature/make-lnurl-pay-invoice-o…
Browse files Browse the repository at this point in the history
…ptional

Make LNURL pay invoice optional
  • Loading branch information
danielgranhao authored Jul 1, 2024
2 parents 4543426 + 21ca3f0 commit 7fce8e6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion graphql/schemas/operations.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ mutation AssignLightningAddress {
}
}

mutation SubmitLnurlPayInvoice($id: String!, $invoice: String!) {
mutation SubmitLnurlPayInvoice($id: String!, $invoice: String) {
submit_lnurl_pay_invoice(id: $id, invoice: $invoice)
}

Expand Down
2 changes: 1 addition & 1 deletion graphql/schemas/schema_wallet_read.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ type mutation_root {
start_prepared_session_v2(challenge: String!, challengeSignature: String!, challengeSignatureType: ChallengeSignatureType, preparedPermissionToken: String!): SessionPermit
start_session(authPubKey: String!, challenge: String!, challengeSignature: String!, challengeSignatureType: ChallengeSignatureType, signedAuthPubKey: String!, walletPubKey: String!): TokenContainer
start_session_v2(authPubKey: String!, challenge: String!, challengeSignature: String!, challengeSignatureType: ChallengeSignatureType, signedAuthPubKey: String!, walletPubKey: String!): SessionPermit
submit_lnurl_pay_invoice(id: String!, invoice: String!): Void
submit_lnurl_pay_invoice(id: String!, invoice: String): Void
}

scalar numeric
Expand Down
2 changes: 1 addition & 1 deletion pigeon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub async fn submit_lnurl_pay_invoice(
backend_url: &str,
auth: &Auth,
id: String,
invoice: String,
invoice: Option<String>,
) -> graphql::Result<()> {
let token = auth.query_token().await?;
let client = build_async_client(Some(&token))?;
Expand Down
11 changes: 10 additions & 1 deletion pigeon/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ async fn test_submit_lnurl_pay_invoice() {
&backend_url,
&auth,
"5fab1a65-3486-4dfd-bba8-dad2c1a1b98e".to_string(),
"invoice".to_string(),
Some("invoice".to_string()),
)
.await
.unwrap();

submit_lnurl_pay_invoice(
&backend_url,
&auth,
"44872a5a-8be9-4a27-a80f-2ec66ff1f5b6".to_string(),
None,
)
.await
.unwrap();
Expand Down

0 comments on commit 7fce8e6

Please sign in to comment.