-
Notifications
You must be signed in to change notification settings - Fork 912
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
Offers: Part 3. Offers and the plugins who love them! #4257
Conversation
The Travis CI bot is failing on every PR! |
3a30aa4
to
f45acf2
Compare
f45acf2
to
ba1ce52
Compare
ba1ce52
to
338c9f3
Compare
338c9f3
to
bf0749a
Compare
Rebased on top of #4256 now that it's merged. |
bf0749a
to
5a75edf
Compare
Rebased on master since part 2 committed, no other changes. |
5a75edf
to
f553635
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK f553635
|
||
inv1 = l1.rpc.call('fetchinvoice', {'offer': offer}) | ||
inv2 = l1.rpc.call('fetchinvoice', {'offer': offer}) | ||
assert inv1 != inv2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Paying and then fetching should fail.
That way they rebuild when we change flags in Makefile. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
It's not trivial, but fortunately gmtime and mktime exist already. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We prepare an invoice, but there's no code to send an error reply yet (future patch). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Invoices are signed with our own key, but we use a transient payer_key with a tweak for invoice_requests (and refunds). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is similar to the createinvoice API, except we don't need to save invoice requests in the database. We may, however, have to look up payment_key for recurring invoice requests, and sign the message with the payment_key. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…ffer Doesn't catch the reply yet, but prepares the invoice request based on the offer and sends it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Using onionmessage hook, we get the response and either present it to the user (invoice) or return the error to the user. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…FEATURES) This lets actually pay the invoice that fetchinvoice returns. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is useful for the caller to know when to call again. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This also lets us extend our testing to cover error cases. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
f553635
to
d2e4c5c
Compare
Fixed the two typos and rebased on ACK d2e4c5c |
This contains plugins both for creating offers and servicing invoice requests / invoices associated with them, and sending requests based on others' offers.
Changelog-None