Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion apps/src/bin/namada-client/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ async fn main() -> Result<()> {
let _log_guard = logging::init_from_env_or(LevelFilter::INFO)?;

// run the CLI
CliApi::<CliIo>::handle_client_command::<HttpClient>(
CliApi::handle_client_command::<HttpClient, _>(
None,
cli::namada_client_cli()?,
&CliIo,
)
.await
}
2 changes: 1 addition & 1 deletion apps/src/bin/namada-relayer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ async fn main() -> Result<()> {

let cmd = cli::namada_relayer_cli()?;
// run the CLI
CliApi::<CliIo>::handle_relayer_command::<HttpClient>(None, cmd).await
CliApi::handle_relayer_command::<HttpClient>(None, cmd, &CliIo).await
}
2 changes: 1 addition & 1 deletion apps/src/bin/namada-wallet/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ pub fn main() -> Result<()> {
color_eyre::install()?;
let (cmd, ctx) = cli::namada_wallet_cli()?;
// run the CLI
CliApi::<CliIo>::handle_wallet_command(cmd, ctx)
CliApi::handle_wallet_command(cmd, ctx, &CliIo)
}
9 changes: 5 additions & 4 deletions apps/src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub mod wallet;

use clap::{ArgGroup, ArgMatches, ColorChoice};
use color_eyre::eyre::Result;
use namada::types::io::DefaultIo;
use namada::types::io::StdIo;
use utils::*;
pub use utils::{safe_exit, Cmd};

Expand Down Expand Up @@ -2534,6 +2534,7 @@ pub mod args {
use super::context::*;
use super::utils::*;
use super::{ArgGroup, ArgMatches};
use crate::cli::context::FromContext;
use crate::config::{self, Action, ActionAtHeight};
use crate::facade::tendermint::Timeout;
use crate::facade::tendermint_config::net::Address as TendermintAddress;
Expand Down Expand Up @@ -3525,8 +3526,8 @@ pub mod args {
target,
token,
amount,
native_token: (),
tx_code_path,
native_token: (),
}
}

Expand Down Expand Up @@ -3881,8 +3882,8 @@ pub mod args {
validator,
amount,
source,
native_token: (),
tx_code_path,
native_token: (),
}
}

Expand Down Expand Up @@ -5799,7 +5800,7 @@ pub fn namada_relayer_cli() -> Result<NamadaRelayer> {
cmds::EthBridgePool::WithContext(sub_cmd),
) => {
let global_args = args::Global::parse(&matches);
let context = Context::new::<DefaultIo>(global_args)?;
let context = Context::new::<StdIo>(global_args)?;
Ok(NamadaRelayer::EthBridgePoolWithCtx(Box::new((
sub_cmd, context,
))))
Expand Down
10 changes: 4 additions & 6 deletions apps/src/lib/cli/api.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::marker::PhantomData;

use namada::sdk::queries::Client;
use namada::sdk::rpc::wait_until_node_is_synched;
use namada::tendermint_rpc::HttpClient;
Expand All @@ -13,7 +11,7 @@ use crate::client::utils;
#[async_trait::async_trait(?Send)]
pub trait CliClient: Client + Sync {
fn from_tendermint_address(address: &mut TendermintAddress) -> Self;
async fn wait_until_node_is_synced<IO: Io>(&self) -> Halt<()>;
async fn wait_until_node_is_synced(&self, io: &impl Io) -> Halt<()>;
}

#[async_trait::async_trait(?Send)]
Expand All @@ -22,8 +20,8 @@ impl CliClient for HttpClient {
HttpClient::new(utils::take_config_address(address)).unwrap()
}

async fn wait_until_node_is_synced<IO: Io>(&self) -> Halt<()> {
wait_until_node_is_synched::<_, IO>(self).await
async fn wait_until_node_is_synced(&self, io: &impl Io) -> Halt<()> {
wait_until_node_is_synched(self, io).await
}
}

Expand All @@ -32,4 +30,4 @@ pub struct CliIo;
#[async_trait::async_trait(?Send)]
impl Io for CliIo {}

pub struct CliApi<IO: Io = CliIo>(PhantomData<IO>);
pub struct CliApi;
Loading