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

refactor: router #431

Merged
merged 65 commits into from
Dec 27, 2024
Merged

refactor: router #431

merged 65 commits into from
Dec 27, 2024

Conversation

notJoon
Copy link
Member

@notJoon notJoon commented Dec 10, 2024

Description

Refactor

  • Refactored route file mainly.

Remove

  • Removed unused compute_routes and gno_helper files
  • Removed underscore prefix from _swap functions and renamed them to swapInner
  • Remove DrySwapRoute function and related methods

Update

  • Modified to use enum values instead of hardcoded "EXACT_IN", "EXACT_OUT" strings. Additionally replace other hardcoded values with constants
  • Add _helper_test file for testing purpose

Functions that use Pool currently doesn't have tests yet. This is because there's no way to directly access and initialize the pool's state for now.

@notJoon notJoon added refactoring router router related works labels Dec 10, 2024
@notJoon notJoon self-assigned this Dec 10, 2024
router/router.gno Outdated Show resolved Hide resolved
@notJoon notJoon marked this pull request as ready for review December 11, 2024 13:22
@notJoon notJoon requested review from onlyhyde and r3v4s December 11, 2024 13:22
Copy link
Member

@dongwon8247 dongwon8247 left a comment

Choose a reason for hiding this comment

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

@notJoon Please add a unit test for swap_multi.gno, swap_single.gno and wrap_unwrap.gno.

Functions that use Pool currently doesn't have tests yet. This is because there's no way to directly access and initialize the pool's state for now.

Can you create mockup data in pool that you can use for testing purposes in router? This seems essential tests. Think about a way to complete tests for this please.

router/router.gno Outdated Show resolved Hide resolved
router/_helper_test.gno Outdated Show resolved Hide resolved
router/protocol_fee_swap.gno Outdated Show resolved Hide resolved
router/swap_inner_test.gno Outdated Show resolved Hide resolved
@notJoon
Copy link
Member Author

notJoon commented Dec 20, 2024

@onlyhyde The SwapRouter split commit was going into the staker (#437) instead of the router now that I checked, I'll revert this tomorrow.😇😇😇

onlyhyde
onlyhyde previously approved these changes Dec 27, 2024
Copy link

@r3v4s r3v4s self-requested a review December 27, 2024 05:54
@onlyhyde onlyhyde self-requested a review December 27, 2024 05:54
Copy link
Member

@r3v4s r3v4s left a comment

Choose a reason for hiding this comment

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

well done

@onlyhyde onlyhyde merged commit 913ed41 into main Dec 27, 2024
1 of 2 checks passed
@onlyhyde onlyhyde deleted the router-refact branch December 27, 2024 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring router router related works
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants