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

remove panics from quote #22

Merged
merged 5 commits into from
May 10, 2024
Merged

remove panics from quote #22

merged 5 commits into from
May 10, 2024

Conversation

none00y
Copy link
Collaborator

@none00y none00y commented May 9, 2024

Changes

  • improved error handling to prevent unwanted panics during execution

@none00y none00y requested a review from wojciech-cichocki May 9, 2024 13:15
@none00y none00y self-assigned this May 9, 2024
src/swap.rs Outdated
remaining_amount = TokenAmount(0);
}
} else {
virtual_cross_counter += 1;
virtual_cross_counter.checked_add(1).ok_or("add overflow")?;
Copy link
Member

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
Copy link
Member

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;
//
Copy link
Member

Choose a reason for hiding this comment

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

leftover comment

@none00y none00y merged commit 3788825 into master May 10, 2024
2 checks passed
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.

2 participants