Wait for invoice to be paid #941
Labels
No labels
DB & Storage
Deployment
Error Handling & Logging
Maintenance
Payment Backend
backport
backport v0.13.x
backport v0.14.x
backport v0.15.x
bindings
blocked
bug
cdk-sql
ci
cli
deps
documentation
duplicate
enhancement
good first issue
help wanted
invalid
keep-open
ldk-node-ui
migrations
mint
mutation-testing
needs rebase
needs review
new nut
nut change
question
ready
rust-version
rustfmt
stacked hold
stale
testing
wallet
weekly-report
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cashubtc/cdk#941
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently we don't have a nice fn on the wallet that will wait for an invoice to be paid. If you look at the examples we look checking for state. We should add a wallet fn that takes a mint quote and a time out and just waits until it is paid and mints once it is, erroring if it can't mint or times out
I think it would be best if a future is returned, and the caller decides how to wait on that event, either in that thread or in another thread. Do you think that would be better and more idiomatic?
Alternatively we can add more enphasis in our subscription layer, perhaps adding a timeout factor, from this current code:
To this version
The wallet notification will use websocket or http underneath.
I think the future is a good idea. This way the flow of minting is simplely
Compared to the current where you have to implement the waiting yourself and then call mint.
github.com/cashubtc/cdk@d24a968bd4/crates/cdk/examples/wallet.rs (L29-L58)