Skip to content

Commit

Permalink
Reformatted the project
Browse files Browse the repository at this point in the history
  • Loading branch information
janlegner committed Jan 11, 2023
1 parent b0c5207 commit 1553348
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
5 changes: 4 additions & 1 deletion client/forwarder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
}

Expand Down
8 changes: 4 additions & 4 deletions server/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}
}
Expand All @@ -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();
}
}

Expand Down
4 changes: 3 additions & 1 deletion server/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
7 changes: 2 additions & 5 deletions server/solana_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ struct SignatureRecord {
signature: Signature,
}
pub fn spawn_tx_signature_watcher(
client: Arc<RpcClient>
client: Arc<RpcClient>,
) -> Result<UnboundedSender<Signature>, Box<dyn Error + Send + Sync>> {
let (tx_signature, rx_signature) = unbounded_channel::<Signature>();

Expand Down Expand Up @@ -194,10 +194,7 @@ pub fn spawn_tx_signature_watcher(
Ok(tx_signature)
}

fn spawn_signature_checker(
client: Arc<RpcClient>,
bundle: Vec<Signature>,
) {
fn spawn_signature_checker(client: Arc<RpcClient>, bundle: Vec<Signature>) {
tokio::spawn(async move {
match client.get_signature_statuses(&bundle) {
Ok(response) => {
Expand Down

0 comments on commit 1553348

Please sign in to comment.