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

wip(feat): reissue ecash notes from OOBNotes #1037

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oleonardolima
Copy link

No description provided.

mutiny-core/src/lib.rs Outdated Show resolved Hide resolved
@TonyGiorgio TonyGiorgio linked an issue Feb 20, 2024 that may be closed by this pull request
@oleonardolima oleonardolima force-pushed the feat/fedimint-oob-note-reissue branch 3 times, most recently from ed128ab to 2ac7972 Compare February 22, 2024 11:22
mutiny-core/src/lib.rs Outdated Show resolved Hide resolved
mutiny-core/src/lib.rs Outdated Show resolved Hide resolved

// TODO: (@leonardo) re-think about the results and errors that we need/want
match process_reissue_outcome(&mint_module, operation_id, logger.clone()).await? {
ReissueExternalNotesState::Created | ReissueExternalNotesState::Failed(_) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why return error on created

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure how to proceed with this, but if the stream is already finished and the final result is still Created, it didn't get processed by the federation without a real guaranteeing it will.

Copy link
Author

Choose a reason for hiding this comment

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

I'll need to check in the discord about this.

Copy link
Author

Choose a reason for hiding this comment

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

AFAIK there is no known error it would still be stuck at created even after all the stream is consumed, but still needs to handle the variant 🤔

Copy link
Author

Choose a reason for hiding this comment

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

@benthecarman What do you think we should do here with Created variant?
It's not supposed to have that after the whole stream is consumed, so still handle as failure/error ? 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

in process_reissue_outcome you only return the outcome if it is Failed or Done so you should just handle those two here, and leave the rest in the _ => case where you can throw an error.

Copy link
Author

Choose a reason for hiding this comment

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

wdyt about eb59a8b

mutiny-core/src/federation.rs Outdated Show resolved Hide resolved
mutiny-core/src/federation.rs Outdated Show resolved Hide resolved
@oleonardolima oleonardolima force-pushed the feat/fedimint-oob-note-reissue branch 2 times, most recently from 2f8abbb to 03d499d Compare February 22, 2024 21:10
@oleonardolima oleonardolima changed the title wip(feat): reissue ecash notes from OOBNotes` wip(feat): reissue ecash notes from OOBNotes Feb 22, 2024
.editorconfig Outdated Show resolved Hide resolved
@oleonardolima oleonardolima force-pushed the feat/fedimint-oob-note-reissue branch 2 times, most recently from 03497a7 to ef9545d Compare February 23, 2024 11:31
wip(feat): reissue ecash notes from `OOBNotes``

wip: working version 🚀

fix: clippy
@oleonardolima oleonardolima force-pushed the feat/fedimint-oob-note-reissue branch from 834b6c8 to 41760d9 Compare March 7, 2024 14:46
@@ -119,6 +119,7 @@ use crate::utils::parse_profile_metadata;
use mockall::{automock, predicate::*};

const DEFAULT_PAYMENT_TIMEOUT: u64 = 30;
const DEFAULT_REISSUE_TIMEOUT: u64 = 50;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is only used in federation.rs, would be better to define in there. This should probably go back to 30 seconds too. you're also always casting to i32, can just define it as such

Copy link
Author

Choose a reason for hiding this comment

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

nice, done!
but I kept it as u64 to follow the standard, or should I also change the other ones? 🤔

);
return Ok(outcome);
}
_ => { /* ignore and continue */ }
Copy link
Collaborator

Choose a reason for hiding this comment

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

would be helpful to log each state

Copy link
Author

Choose a reason for hiding this comment

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

nice, I'll add it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redeem out of band Fedimint ecash
3 participants