Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: detect lightning param in bip 21 QR codes #42

Merged
merged 9 commits into from
May 31, 2022

Conversation

allenwhite
Copy link
Contributor

This PR addresses this issue, where we do not recognize the lightning param in BIP 21 QR codes.

In completing this work, I refactored the parsePaymentDestination method. The existing logic seemed to initially determine the paymentType, and then create the payment response based on this type. I attempted to reflect this approach through some new functions.

All existing test cases pass, and I added a case for this specific piece of functionality, as well as a couple other cases we were missing.

errorMessage: `Invalid lightning invoice for ${network} network`,
}
}
const dataToDecode = getDataToDecode(destinationText)
Copy link
Contributor

@samerbuna samerbuna May 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe pass protocol to getLightningPayResponse too (like getIntraLedgerPayResponse) and avoid doing this again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't feel comfortable passing in protocol since I needed it for getLNParam, but pointing this out did help me remove this duplicate function we didn't need.

@samerbuna samerbuna merged commit e51b198 into GaloyMoney:main May 31, 2022
@allenwhite allenwhite deleted the lightning-param branch May 31, 2022 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants