Skip to content

Commit

Permalink
chore: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Sep 8, 2023
1 parent 0ee91ef commit a4732cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
18 changes: 9 additions & 9 deletions abci/src/server/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ where
let mut codec = Codec::new(listener, cancel_token.clone(), &self.runtime);
while !cancel_token.is_cancelled() {
let Some(request) = codec.next() else {
tracing::error!("client terminated stream");
return Ok(())
};

let Some(response) = self.app.handle(request.clone()) else {
// `RequestDispatcher` decided to stop receiving new requests:
info!("ABCI Application is shutting down");
return Ok(());
};
tracing::error!("client terminated stream");
return Ok(());
};

let Some(response) = self.app.handle(request.clone()) else {
// `RequestDispatcher` decided to stop receiving new requests:
info!("ABCI Application is shutting down");
return Ok(());
};

if let Some(crate::proto::abci::response::Value::Exception(ex)) = response.value.clone()
{
Expand Down
12 changes: 9 additions & 3 deletions abci/tests/kvstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ impl Application for KVStoreABCI<'_> {
.collect::<Option<BTreeSet<Operation>>>()
else {
error!("Cannot decode transactions");
return Err(abci::ResponseException {error:"cannot decode transactions".to_string()});
return Err(abci::ResponseException {
error: "cannot decode transactions".to_string(),
});
};

// Mark transactions that should be added to the proposed transactions
Expand All @@ -253,7 +255,9 @@ impl Application for KVStoreABCI<'_> {

let Some(tx_records) = tx_records_encoded else {
error!("cannot encode transactions");
return Err(ResponseException{error:"cannot encode transactions".to_string()});
return Err(ResponseException {
error: "cannot encode transactions".to_string(),
});
};

// Put both local and proposed transactions into staging area
Expand Down Expand Up @@ -286,7 +290,9 @@ impl Application for KVStoreABCI<'_> {
.map(decode_transaction)
.collect::<Option<BTreeSet<Operation>>>()
else {
return Err(ResponseException{error:"cannot decode transactions".to_string()});
return Err(ResponseException {
error: "cannot decode transactions".to_string(),
});
};

let tx_results = tx_results_accept(td_proposed_transactions.len());
Expand Down

0 comments on commit a4732cc

Please sign in to comment.