-
Notifications
You must be signed in to change notification settings - Fork 376
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
offer::Quantity::One
is incompatible with quantity: Some(1)
#3233
Comments
Thinking about it, I also wonder why the default isn't |
I believe we are compliant with the spec:
Although
Then when creating an invoice request:
Using |
Hmm, that might be the case, but it's a very confusing (and error-prone) API if How would the user know when to use which, or rather, how would they know never to set quantity to
If we want to keep this behavior, should our API enforce this rather than just briefly mentioning it in the docs, e.g., have |
Currently, they need to call
Are you talking about the sending or the receiving API? |
Right, but that would enforce giving a quantity which doesn't make sense in certain contexts?
In this case I was talking about the receiving side. I simply find it confusing that the use of |
True, though then I'd argue we should keep it as an
We need to be able to deal with offers not created by LDK. This requires creating an Instead, if the user doesn't specify a quantity when calling Footnotes
|
Hmm, then I also wonder if we should supporting unsetting Or maybe translating is error prone depending on how the user expects to use the offers API, and we're better of with the current API which I find confusing but at least would rather fail than introducing unintended effects? |
Yes, we would need to otherwise
I'm fine with either. We can make it less error-prone at the |
This is a bit confusing: The
Quantity
variant is namedOne
, butpay_for_offer
fails to send the invoice request with anUnexpectedQuantity
error if thequantity
argument isSome(1)
.Seems the source of this is
expects_quantity
inoffer.rs
returningfalse
for theOne
variant.Discovered by @slanesuke over at lightningdevkit/ldk-node#327
(cc @jkczyz)
The text was updated successfully, but these errors were encountered: