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

feat(asb): Print more information when history command is invoked #218

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

binarybaron
Copy link

@binarybaron binarybaron commented Nov 29, 2024

Closes #211

@Einliterflasche
Copy link

This closes #211?


let all_swaps = db.all().await?;
for (swap_id, state) in all_swaps {
match SwapDetails::from_db_state(swap_id.clone(), state, &db).await {

Choose a reason for hiding this comment

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

We're calling from_db_state for every swap, but from_db_state iterates through all swaps itself. That's O(n^2), so we should probably move that into a single database query

Copy link
Author

Choose a reason for hiding this comment

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

from_db_state does not iterate through all swaps. It iterates through all saved states of a particular swap.

@binarybaron
Copy link
Author

Would also be cool to make this generic over AliceState / BobState and move it onto common/

@binarybaron binarybaron force-pushed the asb/enhance-history-cmd branch from a350812 to 49c6d8c Compare December 4, 2024 15:38
@binarybaron binarybaron marked this pull request as ready for review December 4, 2024 15:48
@binarybaron binarybaron changed the title feat(asb): Enhance history command with extra information feat(asb): Print more information when history command is invoked Dec 4, 2024
@binarybaron binarybaron force-pushed the asb/enhance-history-cmd branch from 85f6810 to c5f2961 Compare December 4, 2024 15:49
@binarybaron binarybaron requested a review from delta1 December 4, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add timestamps to asb's history command and order chronologically
2 participants