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

IBC core validate handler uses mutable reference #864

Closed
rnbguy opened this issue Sep 13, 2023 · 0 comments · Fixed by #863
Closed

IBC core validate handler uses mutable reference #864

rnbguy opened this issue Sep 13, 2023 · 0 comments · Fixed by #863
Assignees
Labels
O: logic Objective: aims for better implementation logic
Milestone

Comments

@rnbguy
Copy link
Collaborator

rnbguy commented Sep 13, 2023

Bug Summary

The core validate handler uses a mutable reference, even though the mutability is not needed. This also adds risks of mistakenly calling a mutable method on it.

Details

&mut impl Router should be refactored to &impl Router

This is also detectable by running cargo +nightly clippy.

Version

pub fn validate<Ctx>(
ctx: &Ctx,
router: &mut impl Router,
msg: MsgEnvelope,
) -> Result<(), RouterError>

@rnbguy rnbguy added the O: logic Objective: aims for better implementation logic label Sep 13, 2023
@rnbguy rnbguy self-assigned this Sep 13, 2023
@github-project-automation github-project-automation bot moved this to 📥 To Do in ibc-rs Sep 13, 2023
@Farhad-Shabani Farhad-Shabani moved this from 📥 To Do to ✅ Done in ibc-rs Sep 27, 2023
@Farhad-Shabani Farhad-Shabani added this to the v0.45.0 milestone Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O: logic Objective: aims for better implementation logic
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants