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

fix(profit): Filter out NLS from buy-back #112

Merged
merged 20 commits into from
Jun 8, 2023
Merged

Conversation

KirilMihaylov
Copy link
Contributor

No description provided.

@KirilMihaylov KirilMihaylov added the bug Something isn't working label Jun 6, 2023
@KirilMihaylov KirilMihaylov requested a review from gmanev7 June 6, 2023 09:30
@KirilMihaylov KirilMihaylov self-assigned this Jun 6, 2023
Copy link
Member

@gmanev7 gmanev7 left a comment

Choose a reason for hiding this comment

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

besides the comments here below, there is one moderate issue that smells:

  • as partly duplicated code/logic at Idle::send_nls and BuyBack::finish
  • as that "ugly" Error -> set data mechanism when there is no balance != Nls at the BuyBack instantiation
    my suggestion is to move the 'no-non-NLS-balance' case inside the BuyBack

contracts/profit/src/state/buy_back.rs Outdated Show resolved Hide resolved
contracts/profit/src/state/buy_back.rs Outdated Show resolved Hide resolved
contracts/profit/src/profit.rs Outdated Show resolved Hide resolved
contracts/profit/src/state/buy_back.rs Outdated Show resolved Hide resolved
contracts/profit/src/state/idle.rs Outdated Show resolved Hide resolved
contracts/profit/src/state/idle.rs Outdated Show resolved Hide resolved
contracts/profit/src/state/idle.rs Outdated Show resolved Hide resolved
contracts/profit/src/error.rs Outdated Show resolved Hide resolved
contracts/profit/src/state/buy_back.rs Outdated Show resolved Hide resolved
contracts/profit/src/state/buy_back.rs Outdated Show resolved Hide resolved
@gmanev7 gmanev7 merged commit ecf2086 into main Jun 8, 2023
@KirilMihaylov KirilMihaylov deleted the fix_buy_back_on_nls branch June 8, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants