From 729161ca5327d64f5836df43ca342f89ceb23791 Mon Sep 17 00:00:00 2001 From: Jesse Schulman Date: Tue, 16 Jan 2024 22:38:12 -0800 Subject: [PATCH] Formatting --- crates/antelope/src/api/client.rs | 9 +++++++-- crates/antelope/src/api/default_provider.rs | 8 ++++++-- crates/antelope/tests/client.rs | 8 ++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/crates/antelope/src/api/client.rs b/crates/antelope/src/api/client.rs index 3aeb9de..4be48ed 100644 --- a/crates/antelope/src/api/client.rs +++ b/crates/antelope/src/api/client.rs @@ -23,8 +23,13 @@ impl Display for HTTPMethod { // TODO: Make this return an APIResponse with status code, timing, etc.. pub trait Provider: Debug + Default + Sync + Send { - fn post(&self, path: String, body: Option) -> impl std::future::Future> + Send; - fn get(&self, path: String) -> impl std::future::Future> + Send; + fn post( + &self, + path: String, + body: Option, + ) -> impl std::future::Future> + Send; + fn get(&self, path: String) + -> impl std::future::Future> + Send; } #[derive(Debug, Default, Clone)] diff --git a/crates/antelope/src/api/default_provider.rs b/crates/antelope/src/api/default_provider.rs index 52b2fc2..2dc6044 100644 --- a/crates/antelope/src/api/default_provider.rs +++ b/crates/antelope/src/api/default_provider.rs @@ -1,6 +1,6 @@ use crate::api::client::Provider; -use std::fmt::{Debug, Formatter}; use reqwest::Client; +use std::fmt::{Debug, Formatter}; #[derive(Default, Clone)] pub struct DefaultProvider { @@ -37,7 +37,11 @@ impl Debug for DefaultProvider { impl Provider for DefaultProvider { async fn get(&self, path: String) -> Result { - let res = self.client.get(self.base_url.to_string() + &path).send().await; + let res = self + .client + .get(self.base_url.to_string() + &path) + .send() + .await; if res.is_err() { return Err(res.err().unwrap().to_string()); } diff --git a/crates/antelope/tests/client.rs b/crates/antelope/tests/client.rs index a9a6d13..de6cf32 100644 --- a/crates/antelope/tests/client.rs +++ b/crates/antelope/tests/client.rs @@ -66,7 +66,10 @@ async fn chain_send_transaction() { mock_provider::make_mock_transaction(&info, Asset::from_string("0.0420 NUNYA")); let signed_invalid_transaction = mock_provider::sign_mock_transaction(&invalid_transaction, &info); - let failed_result = client.v1_chain.send_transaction(signed_invalid_transaction).await; + let failed_result = client + .v1_chain + .send_transaction(signed_invalid_transaction) + .await; assert!( failed_result.is_err(), "Failed transaction result should be err" @@ -108,7 +111,8 @@ pub async fn chain_get_table_rows() { reverse: None, index_position: None, show_payer: None, - }).await + }) + .await .unwrap(); assert_eq!(res1.rows.len(), 1, "Should get 1 row back");