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

Audit: PDM-005 - Superfluous Implementation of Hooks Trait #264

Closed
ashneverdawn opened this issue Jul 5, 2023 · 1 comment · Fixed by #343
Closed

Audit: PDM-005 - Superfluous Implementation of Hooks Trait #264

ashneverdawn opened this issue Jul 5, 2023 · 1 comment · Fixed by #343
Assignees

Comments

@ashneverdawn
Copy link
Contributor

ashneverdawn commented Jul 5, 2023

The Hooks trait has been declared in the orml-currencies-allowance-extension pallet, but no custom implementations have been provided.

ID PDM-005
Scope Code Quality
Status New

Description
The following code snippet raises concerns: pallets/orml-currencies-allowance-extension/src/lib.rs:99:

 #[pallet::hooks]
impl<T: Config> Hooks<T::BlockNumber> for Pallet<T> {}

The Hooks trait is typically used to perform logic on every block initialization, finalization, and other specific actions. However, in the case of the orml-currencies-allowance-extension pallet, no methods from the Hooks trait are implemented. While this does not cause any immediate detrimental effects, it can reduce code readability and increase complexity.

Recommendation
To improve code clarity and readability, it is recommended to eliminate the use of the Hooks trait in the orml-currencies-allowance- extension pallet. Since no custom implementations are provided, removing the Hooks trait declaration will simplify the code and remove unnecessary complexity.

@vadaynujra
Copy link

Hey team! Please add your planning poker estimate with Zenhub @ashneverdawn @ebma @TorstenStueber

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 a pull request may close this issue.

3 participants