Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Set invoice labels after fedimint payment #965

Merged
merged 1 commit into from
Jan 16, 2024
Merged

Conversation

benthecarman
Copy link
Collaborator

Closes #963

@benthecarman benthecarman added bug Something isn't working fedimint labels Jan 14, 2024
@@ -816,7 +816,10 @@ impl<S: MutinyStorage> MutinyWallet<S> {
.pay_invoice(inv.clone(), labels.clone())
.await;
match payment_result {
Ok(r) => return Ok(r),
Ok(r) => {
self.storage.set_invoice_labels(inv.clone(), labels)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

If it happens inside of pay_invoice for node_manager then it should happen inside pay_invoice for fedimint_client, or vice versa.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's what I wanted but the fedimint client doesn't have an instance of storage.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay then they can both happen outside for now, that's probably better anyways so they both behave the same.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call, did that for invoice creation as well. Cleaned up code a lot

@benthecarman benthecarman merged commit 62a5d4b into master Jan 16, 2024
9 checks passed
@benthecarman benthecarman deleted the set-last-used-fedi branch January 16, 2024 17:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working fedimint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Making a payment to a contact from fedimint balance doesn't update contact's last_updated
2 participants