-
Notifications
You must be signed in to change notification settings - Fork 3
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
remove panics from quote #22
Conversation
src/swap.rs
Outdated
remaining_amount = TokenAmount(0); | ||
} | ||
} else { | ||
virtual_cross_counter += 1; | ||
virtual_cross_counter.checked_add(1).ok_or("add overflow")?; |
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.
You probably miss assignment here
src/swap.rs
Outdated
@@ -209,22 +226,27 @@ impl JupiterInvariant { | |||
} | |||
crossed_ticks.push(tick.index); | |||
} else if !remaining_amount.is_zero() { | |||
total_amount_in += remaining_amount; | |||
total_amount_in |
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.
Probably missing assignment
src/swap.rs
Outdated
@@ -239,11 +261,13 @@ impl JupiterInvariant { | |||
} | |||
pool.current_tick_index = | |||
get_tick_at_sqrt_price(result.next_price_sqrt, pool.tick_spacing); | |||
virtual_cross_counter += 1; | |||
// |
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.
leftover comment
Changes