From a9e05cdb3163c9bc66a0dd8a58cc174af1535813 Mon Sep 17 00:00:00 2001 From: Gianmarco Fraccaroli Date: Fri, 21 Jul 2023 22:02:50 +0200 Subject: [PATCH] fixup! Merge branch 'bat/feature/refactor-cli' (#1738) --- apps/src/lib/cli/client.rs | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/apps/src/lib/cli/client.rs b/apps/src/lib/cli/client.rs index fb7d01559b..6b68316850 100644 --- a/apps/src/lib/cli/client.rs +++ b/apps/src/lib/cli/client.rs @@ -268,6 +268,19 @@ impl CliApi { ) .await?; } + Sub::TxUnjailValidator(TxUnjailValidator(mut args)) => { + let client = client.unwrap_or_else(|| { + C::from_tendermint_address( + &mut args.tx.ledger_address, + ) + }); + client + .wait_until_node_is_synced() + .await + .proceed_or_else(error)?; + let args = args.to_sdk(&mut ctx); + tx::submit_unjail_validator(&client, ctx, args).await?; + } // Ledger queries Sub::QueryEpoch(QueryEpoch(mut args)) => { let client = client.unwrap_or_else(|| { @@ -279,6 +292,24 @@ impl CliApi { .proceed_or_else(error)?; rpc::query_and_print_epoch(&client).await; } + Sub::QueryValidatorState(QueryValidatorState(mut args)) => { + let client = client.unwrap_or_else(|| { + C::from_tendermint_address( + &mut args.query.ledger_address, + ) + }); + client + .wait_until_node_is_synced() + .await + .proceed_or_else(error)?; + let args = args.to_sdk(&mut ctx); + rpc::query_and_print_validator_state( + &client, + &mut ctx.wallet, + args, + ) + .await; + } Sub::QueryTransfers(QueryTransfers(mut args)) => { let client = client.unwrap_or_else(|| { C::from_tendermint_address( @@ -518,6 +549,19 @@ impl CliApi { Utils::DefaultBaseDir(DefaultBaseDir(args)) => { utils::default_base_dir(global_args, args) } + Utils::EpochSleep(EpochSleep(args)) => { + let mut ctx = cli::Context::new(global_args) + .expect("expected to construct a context"); + let mut ledger_address = args.ledger_address.clone(); + let client = + C::from_tendermint_address(&mut ledger_address); + client + .wait_until_node_is_synced() + .await + .proceed_or_else(error)?; + let args = args.to_sdk(&mut ctx); + rpc::epoch_sleep(&client, args).await; + } }, } Ok(())