Skip to content

Commit

Permalink
revert ctx_a renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Oct 18, 2023
1 parent 554ac48 commit 0da962b
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions crates/ibc/src/core/ics02_client/handler/update_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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());
}

Expand Down

0 comments on commit 0da962b

Please sign in to comment.