Skip to content

Commit

Permalink
process tm verification only if client type is tendermint
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvja committed Sep 6, 2024
1 parent f072763 commit f48721f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions ibc-core/ics25-handler/src/entrypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ pub fn dispatch(
},
_ => panic!("Invalid message type"),
};
let header =
ibc_client_tendermint_types::Header::try_from(header.clone().client_message).unwrap();
validate(ctx, router, msg.clone(), Some(header.clone()))?;
execute(ctx, router, msg, Some(header))?;
} else {
validate(ctx, router, msg.clone(), None)?;
execute(ctx, router, msg, None)?;
if header.client_id.as_str().contains("tendermint") {
let header =
ibc_client_tendermint_types::Header::try_from(header.clone().client_message)
.unwrap();
validate(ctx, router, msg.clone(), Some(header.clone()))?;
execute(ctx, router, msg, Some(header))?;
return Ok(())
}
}
validate(ctx, router, msg.clone(), None)?;
execute(ctx, router, msg, None)?;

Ok(())
}
Expand Down

0 comments on commit f48721f

Please sign in to comment.