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

Fail clippy on warnings, try remove TODO comments #547

Merged
merged 3 commits into from
Apr 9, 2024
Merged

Conversation

ghost
Copy link

@ghost ghost commented Apr 8, 2024

not all the TODO comments are addressed.

  • staking TODO comments seem bit complex and more time consuming
  • benchmarking comments in precompiles should be fixed with next polkadot-sdk/frontier upgrade to >1.3.0
  • from now on, it's going to be a lot easier during development if instead of check_on_save we run clippy_on_save. Since clippy also runs check underneath

@@ -140,6 +140,7 @@ impl<Api> EthCompatRuntimeApiCollection for Api where
{
}

#[allow(clippy::too_many_arguments)]
Copy link
Author

Choose a reason for hiding this comment

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

can be tackled later if someone wants. didn't want to touch critical node code

@@ -154,7 +154,7 @@ impl<T: Config> Pallet<T> {
error: <Error<T>>::DelegatorBondBelowMin.into(),
},
);
let new_amount: BalanceOf<T> = (bonded_amount - decrease_amount).into();
let new_amount: BalanceOf<T> = bonded_amount.saturating_sub(decrease_amount);
Copy link
Author

Choose a reason for hiding this comment

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

this is kinda big deal, I am wondering if there are more instances of using unsafe arithmetic in the staking code

@@ -409,8 +408,9 @@ fn geneses() {
});
}

#[allow(unused_imports)]
Copy link
Author

Choose a reason for hiding this comment

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

this is very weird compiler error, maybe because block_author is used only in tests it always complains that it is unused

@ghost ghost marked this pull request as ready for review April 8, 2024 08:53
@ghost ghost requested review from asiniscalchi, magecnion and ccubu April 8, 2024 08:56
@ghost ghost self-assigned this Apr 8, 2024
@asiniscalchi
Copy link
Member

that's cool

@asiniscalchi asiniscalchi merged commit 7ea70ad into main Apr 9, 2024
8 checks passed
@asiniscalchi asiniscalchi deleted the fix/todos branch April 9, 2024 11:07
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