Skip to content

Commit

Permalink
Iterate and log each client
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchen1991 committed Jan 7, 2025
1 parent 12c2986 commit d29be41
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/cli/cli-components/src/impls/commands/queries/clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ where
{
async fn run_command(app: &App, args: &Args) -> Result<App::Output, App::Error> {
let builder = app.load_builder().await?;
let logger = app.logger();

let host_chain_id = app.parse_arg(args, PhantomData::<symbol!("host_chain_id")>)?;
let reference_chain_id =
Expand All @@ -72,6 +73,20 @@ where
query_all_client_states::<Chain, Counterparty>(&host_chain_id, &reference_chain_id)
.await?;

for client in clients.iter() {
logger
.log(
&format!(
"- {}: {} -> {}",
client.client_id,
&host_chain_id,
client.client_state.chain_id()
),
&LevelInfo,
)
.await;
}

Ok(app.produce_output(clients))
}
}

0 comments on commit d29be41

Please sign in to comment.