Skip to content

Commit

Permalink
chore: fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeRosa committed May 24, 2024
1 parent 087ef61 commit 0c77241
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 27 deletions.
48 changes: 25 additions & 23 deletions catalyst-gateway/bin/src/cardano/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,29 +196,31 @@ async fn process_blocks(

loop {
match follower.next().await {
Ok(chain_update) => match chain_update {
ChainUpdate::Block(data) => {
if blocks_tx.send(data).await.is_err() {
error!("Block indexing task not running");
break;
};
},
ChainUpdate::Rollback(data) => {
let block = match data.decode() {
Ok(block) => block,
Err(err) => {
error!("Unable to decode {network:?} block {err} - skip..");
continue;
},
};

info!(
"Rollback block NUMBER={} SLOT={} HASH={}",
block.number(),
block.slot(),
hex::encode(block.hash()),
);
},
Ok(chain_update) => {
match chain_update {
ChainUpdate::Block(data) => {
if blocks_tx.send(data).await.is_err() {
error!("Block indexing task not running");
break;
};
},
ChainUpdate::Rollback(data) => {
let block = match data.decode() {
Ok(block) => block,
Err(err) => {
error!("Unable to decode {network:?} block {err} - skip..");
continue;
},
};

info!(
"Rollback block NUMBER={} SLOT={} HASH={}",
block.number(),
block.slot(),
hex::encode(block.hash()),
);
},
}
},
Err(err) => {
error!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,11 @@ impl EventDB {
let conn = self.pool.get().await?;

let rows = conn
.query(
SELECT_VOTER_REGISTRATION_SQL,
&[&stake_credential, &network.to_string(), &slot_num],
)
.query(SELECT_VOTER_REGISTRATION_SQL, &[
&stake_credential,
&network.to_string(),
&slot_num,
])
.await?;

let row = rows.first().ok_or(NotFoundError)?;
Expand Down

0 comments on commit 0c77241

Please sign in to comment.