-
Notifications
You must be signed in to change notification settings - Fork 0
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(farm_manager): remove rewards validation on position withdrawal #82
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe changes in this pull request include an update to the Changes
Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@@ -307,16 +308,13 @@ pub(crate) fn withdraw_position( | |||
ContractError::Unauthorized | |||
); | |||
|
|||
if emergency_unlock.is_none() || emergency_unlock.is_some() && !emergency_unlock.unwrap() { |
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.
Not making sense anymore.
56867e8
to
3f8d4dc
Compare
@@ -1906,26 +1905,21 @@ pub fn test_manage_position() { | |||
}, | |||
vec![], | |||
|result| { | |||
let err = result.unwrap_err().downcast::<ContractError>().unwrap(); | |||
match err { |
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.
Would not error anymore, as the pending rewards check is not being done.
@@ -2299,6 +2279,161 @@ pub fn test_manage_position() { | |||
); | |||
} | |||
|
|||
#[test] | |||
#[allow(clippy::inconsistent_digit_grouping)] | |||
pub fn test_withdrawing_open_positions_updates_weight() { |
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.
A test to verify the weight is being updated properly when withdrawing an open position when the emergency unlock flag is used.
Description and Motivation
It didn't make sense to verify if the user had pending rewards when withdrawing a position due to the following reasons:
Related Issues
Checklist:
Update index.md
)cargo fmt --all --
.cargo clippy -- -D warnings
.just schemas
.Summary by CodeRabbit