Skip to content

Commit

Permalink
fixup! Merge branch 'bat/feature/refactor-cli' (#1738)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraccaman committed Jul 21, 2023
1 parent 5299478 commit a9e05cd
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions apps/src/lib/cli/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,19 @@ impl<IO> CliApi<IO> {
)
.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(|| {
Expand All @@ -279,6 +292,24 @@ impl<IO> CliApi<IO> {
.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(
Expand Down Expand Up @@ -518,6 +549,19 @@ impl<IO> CliApi<IO> {
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(())
Expand Down

0 comments on commit a9e05cd

Please sign in to comment.