From 15533485f1521dbf426c0cd895f09e16a7907136 Mon Sep 17 00:00:00 2001 From: janlegner Date: Wed, 11 Jan 2023 14:10:57 +0100 Subject: [PATCH] Reformatted the project --- client/forwarder.rs | 5 ++++- server/auth.rs | 8 ++++---- server/rpc_server.rs | 4 +++- server/solana_service.rs | 7 ++----- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/client/forwarder.rs b/client/forwarder.rs index 6c328dd..4f6d508 100644 --- a/client/forwarder.rs +++ b/client/forwarder.rs @@ -25,7 +25,10 @@ impl Forwarder for BlackholeForwarder { fn process(&self, transaction: Transaction) { metrics::TX_RECEIVED_COUNT.inc(); metrics::TX_FORWARD_SUCCEEDED_COUNT.inc(); - info!("Tx {} -> blackhole ({:?})", transaction.signature, transaction.tpu); + info!( + "Tx {} -> blackhole ({:?})", + transaction.signature, transaction.tpu + ); } } diff --git a/server/auth.rs b/server/auth.rs index 34b420b..2d0de23 100644 --- a/server/auth.rs +++ b/server/auth.rs @@ -16,7 +16,7 @@ pub enum Auth { impl ToString for Auth { fn to_string(&self) -> String { match self { - Auth::JWT(jwt) => jwt.to_string() + Auth::JWT(jwt) => jwt.to_string(), } } } @@ -31,12 +31,12 @@ pub struct JWT { impl ToString for JWT { fn to_string(&self) -> String { if let Some(partner) = &self.partner { - return format!("JWT:partner:{}", partner) + return format!("JWT:partner:{}", partner); } if let Some(pubkey) = &self.pubkey { - return format!("JWT:pubkey:{}", pubkey) + return format!("JWT:pubkey:{}", pubkey); } - return "JWT:Anonymous".to_string() + return "JWT:Anonymous".to_string(); } } diff --git a/server/rpc_server.rs b/server/rpc_server.rs index d9c0151..e6526e7 100644 --- a/server/rpc_server.rs +++ b/server/rpc_server.rs @@ -67,7 +67,9 @@ impl Rpc for RpcServer { }; info!("RPC method sendPriorityTransaction called: {:?}", auth); - metrics::SERVER_RPC_TX_ACCEPTED.with_label_values(&[&auth.to_string()]).inc(); + metrics::SERVER_RPC_TX_ACCEPTED + .with_label_values(&[&auth.to_string()]) + .inc(); metrics::SERVER_RPC_TX_BYTES_IN.inc_by(data.len() as u64); let wire_transaction = base64::decode(&data).unwrap(); diff --git a/server/solana_service.rs b/server/solana_service.rs index 5978e53..08f6e15 100644 --- a/server/solana_service.rs +++ b/server/solana_service.rs @@ -139,7 +139,7 @@ struct SignatureRecord { signature: Signature, } pub fn spawn_tx_signature_watcher( - client: Arc + client: Arc, ) -> Result, Box> { let (tx_signature, rx_signature) = unbounded_channel::(); @@ -194,10 +194,7 @@ pub fn spawn_tx_signature_watcher( Ok(tx_signature) } -fn spawn_signature_checker( - client: Arc, - bundle: Vec, -) { +fn spawn_signature_checker(client: Arc, bundle: Vec) { tokio::spawn(async move { match client.get_signature_statuses(&bundle) { Ok(response) => {