From 0da962b1a9c90b97f839ccaba28dcbc517b0e91d Mon Sep 17 00:00:00 2001 From: Ranadeep Biswas Date: Wed, 18 Oct 2023 16:55:58 +0200 Subject: [PATCH] revert ctx_a renaming --- .../ics02_client/handler/update_client.rs | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/crates/ibc/src/core/ics02_client/handler/update_client.rs b/crates/ibc/src/core/ics02_client/handler/update_client.rs index 40f853f5f..ddd7bef73 100644 --- a/crates/ibc/src/core/ics02_client/handler/update_client.rs +++ b/crates/ibc/src/core/ics02_client/handler/update_client.rs @@ -205,7 +205,7 @@ mod tests { let update_height = Height::new(1, 21).unwrap(); let chain_id_b = ChainId::new("mockgaiaB", 1).unwrap(); - let mut ctx_a = MockContext::new( + let mut ctx = MockContext::new( ChainId::new("mockgaiaA", 1).unwrap(), HostType::Mock, 5, @@ -233,18 +233,15 @@ mod tests { signer, }; - let res = validate(&ctx_a, MsgUpdateOrMisbehaviour::UpdateClient(msg.clone())); + let res = validate(&ctx, MsgUpdateOrMisbehaviour::UpdateClient(msg.clone())); assert!(res.is_ok()); - let res = execute( - &mut ctx_a, - MsgUpdateOrMisbehaviour::UpdateClient(msg.clone()), - ); + let res = execute(&mut ctx, MsgUpdateOrMisbehaviour::UpdateClient(msg.clone())); assert!(res.is_ok(), "result: {res:?}"); - let client_state = ctx_a.client_state(&msg.client_id).unwrap(); + let client_state = ctx.client_state(&msg.client_id).unwrap(); assert!(client_state - .status(&ctx_a, &msg.client_id) + .status(&ctx, &msg.client_id) .unwrap() .is_active()); assert_eq!(client_state.latest_height(), latest_header_height); @@ -428,7 +425,7 @@ mod tests { let update_height = Height::new(1, 21).unwrap(); let chain_id_b = ChainId::new("mockgaiaB", 1).unwrap(); - let mut ctx_a = MockContext::new( + let mut ctx = MockContext::new( ChainId::new("mockgaiaA", 1).unwrap(), HostType::Mock, 5, @@ -457,18 +454,15 @@ mod tests { signer, }; - let res = validate(&ctx_a, MsgUpdateOrMisbehaviour::UpdateClient(msg.clone())); + let res = validate(&ctx, MsgUpdateOrMisbehaviour::UpdateClient(msg.clone())); assert!(res.is_ok()); - let res = execute( - &mut ctx_a, - MsgUpdateOrMisbehaviour::UpdateClient(msg.clone()), - ); + let res = execute(&mut ctx, MsgUpdateOrMisbehaviour::UpdateClient(msg.clone())); assert!(res.is_ok(), "result: {res:?}"); - let client_state = ctx_a.client_state(&msg.client_id).unwrap(); + let client_state = ctx.client_state(&msg.client_id).unwrap(); assert!(client_state - .status(&ctx_a, &msg.client_id) + .status(&ctx, &msg.client_id) .unwrap() .is_active()); assert_eq!(client_state.latest_height(), latest_header_height); @@ -608,7 +602,7 @@ mod tests { let chain_start_height = Height::new(1, 11).unwrap(); - let ctx_a = MockContext::new( + let ctx = MockContext::new( ChainId::new("mockgaiaA", 1).unwrap(), HostType::Mock, 5, @@ -638,7 +632,7 @@ mod tests { signer, }; - let res = validate(&ctx_a, MsgUpdateOrMisbehaviour::UpdateClient(msg)); + let res = validate(&ctx, MsgUpdateOrMisbehaviour::UpdateClient(msg)); assert!(res.is_err()); }