Skip to content

Commit

Permalink
fix: immut over mut ref on validate (cosmos#863)
Browse files Browse the repository at this point in the history
* immut over mut ref on validate

* cargo fmt

* add changelog
  • Loading branch information
rnbguy authored Sep 13, 2023
1 parent 133863d commit 95704fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/bug-fixes/863-immut-ref-in-validate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Replace mutable ref with immutable ref in validate handler
([\#863](https://github.com/cosmos/ibc-rs/issues/863))
6 changes: 1 addition & 5 deletions crates/ibc/src/core/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ pub fn dispatch(
/// That is, the state transition of message `i` must be applied before
/// message `i+1` is validated. This is equivalent to calling
/// `dispatch()` on each successively.
pub fn validate<Ctx>(
ctx: &Ctx,
router: &mut impl Router,
msg: MsgEnvelope,
) -> Result<(), RouterError>
pub fn validate<Ctx>(ctx: &Ctx, router: &impl Router, msg: MsgEnvelope) -> Result<(), RouterError>
where
Ctx: ValidationContext,
{
Expand Down

0 comments on commit 95704fc

Please sign in to comment.