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 bug of geting destination and add new ln invoice test vector from bolt11 #10

Merged
merged 3 commits into from
May 18, 2020

Conversation

kafaichoi
Copy link
Member

  • return error tuple instead of crashing when decoding a ln invoice with sub msat in amount
  • new test vectors are copied from BOLT11 additional and negative tests lightning/bolts#736
  • fix bug of not ignoring n and h field when their length is not expected ones.(found this issue after adding test vector)
  • fix bug of missing destination when we can't get it from n field but able to recover it from signature(found this issue after adding test vector)

Ran test and lint in local. All passed.

kafaichoi added 2 commits May 16, 2020 22:11
return error tuple instead of crashing when decoding a ln invoice with
sub msat in amount

new test vectors are copied from lightning/bolts#736

{:ok, amount_msat}
case Decimal.equal?(rounded_amount_msat_dec, amount_msat_dec) do
Copy link
Member

Choose a reason for hiding this comment

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

Why use Decimal instead of D?

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it back to using D to be more consistent. Thanks!

…eld but it's able to recover it in signature recovery. ignore n and h field if data length is not valid
@kafaichoi kafaichoi force-pushed the add-new-ln-invoice-test-vector-from-bolt11 branch from fc0ae59 to 3f0334b Compare May 18, 2020 00:33
@kafaichoi kafaichoi merged commit 18916a2 into master May 18, 2020
@philipglazman philipglazman deleted the add-new-ln-invoice-test-vector-from-bolt11 branch December 2, 2020 17:40
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