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(staker): staker #437

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

refactor(staker): staker #437

wants to merge 23 commits into from

Conversation

notJoon
Copy link
Member

@notJoon notJoon commented Dec 12, 2024

Description

  • Remove unused internal functions and imports
  • Moved external incentive related functions from the staker file to a separate staker_external_incentive file
  • Extract condition check as functions
  • Change the parameters of the getTokenPairBalanceFromPosition function
    • The pool path is already obtained before this function is called with pn.PositionGetPositionPoolKey(tokenId) method, it is unnecessary to process it internally.
- func getTokenPairBalanceFromPosition(tokenId uint64) (string, string) {
+ func getTokenPairBalanceFromPosition(poolPath string, tokenId uint64) (string, string) {
- 	poolKey := pn.PositionGetPositionPoolKey(tokenId)
        // ...
}

Newly Added Test Files

  • manage_pool_tiers
  • reward_internal_emission
  • reward_manager
  • reward_recipient_store
  • staker

Test Result

Screenshot 2024-12-16 at 7 32 14 PM

@notJoon notJoon changed the title refactor: Staker refactor(staker): remove unused and split staker Dec 13, 2024
@notJoon notJoon requested review from onlyhyde and r3v4s December 13, 2024 02:58
@notJoon notJoon marked this pull request as ready for review December 13, 2024 02:58
@notJoon notJoon marked this pull request as draft December 13, 2024 10:41
@notJoon notJoon changed the title refactor(staker): remove unused and split staker refactor(staker): staker Dec 13, 2024
@notJoon notJoon marked this pull request as ready for review December 16, 2024 10:33
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.

  • do not inline get -> data check -> if nil panic -> if not nil type assertion for avl data
    • make it as separate function
  • for testcase screenshot, run it from gnoswap's repo(with current br branch), not from gno

@notJoon
Copy link
Member Author

notJoon commented Dec 17, 2024

* for testcase screenshot, run it from gnoswap's repo(with current br branch), not from gno

I don't think this will be a problem, since I just moved the entire main branch over to the gno side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants