-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: master
Are you sure you want to change the base?
Conversation
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 { |
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.
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
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.
from_db_state
does not iterate through all swaps. It iterates through all saved states of a particular swap.
Would also be cool to make this generic over AliceState / BobState and move it onto common/ |
a350812
to
49c6d8c
Compare
85f6810
to
c5f2961
Compare
Closes #211