From 99ca41047f8f7ddfd16c955fc340ebf969a641d4 Mon Sep 17 00:00:00 2001 From: Ranadeep Biswas Date: Tue, 12 Sep 2023 11:00:49 +0200 Subject: [PATCH 1/3] immut over mut ref on validate --- crates/ibc/src/core/handler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ibc/src/core/handler.rs b/crates/ibc/src/core/handler.rs index 5ddebcf97..784495e2f 100644 --- a/crates/ibc/src/core/handler.rs +++ b/crates/ibc/src/core/handler.rs @@ -53,7 +53,7 @@ pub fn dispatch( /// `dispatch()` on each successively. pub fn validate( ctx: &Ctx, - router: &mut impl Router, + router: &impl Router, msg: MsgEnvelope, ) -> Result<(), RouterError> where From 62ffb65ecd67df8503404485bbb4680af913ee53 Mon Sep 17 00:00:00 2001 From: Ranadeep Biswas Date: Tue, 12 Sep 2023 11:03:31 +0200 Subject: [PATCH 2/3] cargo fmt --- crates/ibc/src/core/handler.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/ibc/src/core/handler.rs b/crates/ibc/src/core/handler.rs index 784495e2f..7c2babfe3 100644 --- a/crates/ibc/src/core/handler.rs +++ b/crates/ibc/src/core/handler.rs @@ -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, - router: &impl Router, - msg: MsgEnvelope, -) -> Result<(), RouterError> +pub fn validate(ctx: &Ctx, router: &impl Router, msg: MsgEnvelope) -> Result<(), RouterError> where Ctx: ValidationContext, { From e59ada1501d9f04d225abcfcc855ff4eac3a91aa Mon Sep 17 00:00:00 2001 From: Ranadeep Biswas Date: Wed, 13 Sep 2023 10:18:13 +0200 Subject: [PATCH 3/3] add changelog --- .changelog/unreleased/bug-fixes/863-immut-ref-in-validate.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changelog/unreleased/bug-fixes/863-immut-ref-in-validate.md diff --git a/.changelog/unreleased/bug-fixes/863-immut-ref-in-validate.md b/.changelog/unreleased/bug-fixes/863-immut-ref-in-validate.md new file mode 100644 index 000000000..91cbda02b --- /dev/null +++ b/.changelog/unreleased/bug-fixes/863-immut-ref-in-validate.md @@ -0,0 +1,2 @@ +- Replace mutable ref with immutable ref in validate handler + ([\#863](https://github.com/cosmos/ibc-rs/issues/863)) \ No newline at end of file