Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mkysel committed Nov 26, 2024
1 parent ae70f1e commit 2c67167
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
22 changes: 16 additions & 6 deletions examples/cli/cli-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,22 @@ async fn main() -> color_eyre::eyre::Result<()> {
info!("Starting CLI Client....");

let grpc: Box<dyn XmtpApi> = match (cli.testnet, &cli.env) {
(true, Env::Local) => {
Box::new(ClientV4::create("http://localhost:5050".into(), "http://localhost:5050".into(), false).await?)
}
(true, Env::Dev) => {
Box::new(ClientV4::create("https://grpc.testnet.xmtp.network:443".into(), "https://payer.testnet.xmtp.network:443".into(), true).await?)
}
(true, Env::Local) => Box::new(
ClientV4::create(
"http://localhost:5050".into(),
"http://localhost:5050".into(),
false,
)
.await?,
),
(true, Env::Dev) => Box::new(
ClientV4::create(
"https://grpc.testnet.xmtp.network:443".into(),
"https://payer.testnet.xmtp.network:443".into(),
true,
)
.await?,
),
(false, Env::Local) => {
Box::new(ClientV3::create("http://localhost:5556".into(), false).await?)
}
Expand Down
7 changes: 5 additions & 2 deletions xmtp_api_grpc/src/replication_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ pub struct ClientV4 {
}

impl ClientV4 {
pub async fn create(grpc_url: String, payer_url: String, is_secure: bool) -> Result<Self, Error> {
pub async fn create(
grpc_url: String,
payer_url: String,
is_secure: bool,
) -> Result<Self, Error> {
let app_version = MetadataValue::try_from(&String::from("0.0.0"))
.map_err(|e| Error::new(ErrorKind::MetadataError).with(e))?;
let libxmtp_version = MetadataValue::try_from(&String::from("0.0.0"))
Expand All @@ -96,7 +100,6 @@ impl ClientV4 {
.map_err(|e| Error::new(ErrorKind::SetupConnectionError).with(e))?,
};


// GroupMessageInputTODO(mkysel) for now we assume both payer and replication are on the same host
let client = ReplicationApiClient::new(grpc_channel.clone());
let payer_client = PayerApiClient::new(payer_channel.clone());
Expand Down

0 comments on commit 2c67167

Please sign in to comment.