From 9778eae9d0c381b3b8a61d1f1fe381619d672715 Mon Sep 17 00:00:00 2001 From: Gianmarco Fraccaroli Date: Mon, 16 Dec 2024 14:38:38 +0100 Subject: [PATCH] minors --- chain/src/main.rs | 5 ++- orm/src/schema.rs | 72 ++++++++++++++++++++++++++------ rustfmt.toml | 1 - shared/src/block_result.rs | 4 +- transactions/src/main.rs | 4 +- transactions/src/services/mod.rs | 2 +- webserver/src/app.rs | 2 +- 7 files changed, 70 insertions(+), 20 deletions(-) diff --git a/chain/src/main.rs b/chain/src/main.rs index 60a4f33e7..a19bf4bf2 100644 --- a/chain/src/main.rs +++ b/chain/src/main.rs @@ -197,7 +197,10 @@ async fn crawling_fn( }; let validators_state_change = block.update_validators_state(); - tracing::debug!("Updating {} validators state", validators_state_change.len()); + tracing::debug!( + "Updating {} validators state", + validators_state_change.len() + ); let addresses = block.bond_addresses(); let bonds = query_bonds(&client, addresses).await.into_rpc_error()?; diff --git a/orm/src/schema.rs b/orm/src/schema.rs index da3f52cc5..4f0c87831 100644 --- a/orm/src/schema.rs +++ b/orm/src/schema.rs @@ -1,51 +1,99 @@ // @generated automatically by Diesel CLI. pub mod sql_types { - #[derive(diesel::query_builder::QueryId, std::fmt::Debug, diesel::sql_types::SqlType)] + #[derive( + diesel::query_builder::QueryId, + std::fmt::Debug, + diesel::sql_types::SqlType, + )] #[diesel(postgres_type(name = "crawler_name"))] pub struct CrawlerName; - #[derive(diesel::query_builder::QueryId, std::fmt::Debug, diesel::sql_types::SqlType)] + #[derive( + diesel::query_builder::QueryId, + std::fmt::Debug, + diesel::sql_types::SqlType, + )] #[diesel(postgres_type(name = "governance_kind"))] pub struct GovernanceKind; - #[derive(diesel::query_builder::QueryId, std::fmt::Debug, diesel::sql_types::SqlType)] + #[derive( + diesel::query_builder::QueryId, + std::fmt::Debug, + diesel::sql_types::SqlType, + )] #[diesel(postgres_type(name = "governance_result"))] pub struct GovernanceResult; - #[derive(diesel::query_builder::QueryId, std::fmt::Debug, diesel::sql_types::SqlType)] + #[derive( + diesel::query_builder::QueryId, + std::fmt::Debug, + diesel::sql_types::SqlType, + )] #[diesel(postgres_type(name = "governance_tally_type"))] pub struct GovernanceTallyType; - #[derive(diesel::query_builder::QueryId, std::fmt::Debug, diesel::sql_types::SqlType)] + #[derive( + diesel::query_builder::QueryId, + std::fmt::Debug, + diesel::sql_types::SqlType, + )] #[diesel(postgres_type(name = "ibc_status"))] pub struct IbcStatus; - #[derive(diesel::query_builder::QueryId, std::fmt::Debug, diesel::sql_types::SqlType)] + #[derive( + diesel::query_builder::QueryId, + std::fmt::Debug, + diesel::sql_types::SqlType, + )] #[diesel(postgres_type(name = "payment_kind"))] pub struct PaymentKind; - #[derive(diesel::query_builder::QueryId, std::fmt::Debug, diesel::sql_types::SqlType)] + #[derive( + diesel::query_builder::QueryId, + std::fmt::Debug, + diesel::sql_types::SqlType, + )] #[diesel(postgres_type(name = "payment_recurrence"))] pub struct PaymentRecurrence; - #[derive(diesel::query_builder::QueryId, std::fmt::Debug, diesel::sql_types::SqlType)] + #[derive( + diesel::query_builder::QueryId, + std::fmt::Debug, + diesel::sql_types::SqlType, + )] #[diesel(postgres_type(name = "token_type"))] pub struct TokenType; - #[derive(diesel::query_builder::QueryId, std::fmt::Debug, diesel::sql_types::SqlType)] + #[derive( + diesel::query_builder::QueryId, + std::fmt::Debug, + diesel::sql_types::SqlType, + )] #[diesel(postgres_type(name = "transaction_kind"))] pub struct TransactionKind; - #[derive(diesel::query_builder::QueryId, std::fmt::Debug, diesel::sql_types::SqlType)] + #[derive( + diesel::query_builder::QueryId, + std::fmt::Debug, + diesel::sql_types::SqlType, + )] #[diesel(postgres_type(name = "transaction_result"))] pub struct TransactionResult; - #[derive(diesel::query_builder::QueryId, std::fmt::Debug, diesel::sql_types::SqlType)] + #[derive( + diesel::query_builder::QueryId, + std::fmt::Debug, + diesel::sql_types::SqlType, + )] #[diesel(postgres_type(name = "validator_state"))] pub struct ValidatorState; - #[derive(diesel::query_builder::QueryId, std::fmt::Debug, diesel::sql_types::SqlType)] + #[derive( + diesel::query_builder::QueryId, + std::fmt::Debug, + diesel::sql_types::SqlType, + )] #[diesel(postgres_type(name = "vote_kind"))] pub struct VoteKind; } diff --git a/rustfmt.toml b/rustfmt.toml index f7a0911e7..6bfc04d34 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -24,7 +24,6 @@ format_macro_matchers = true format_strings = true group_imports = "StdExternalCrate" hard_tabs = false -show_parse_errors = true ignore = [] imports_granularity = "Module" imports_indent = "Block" diff --git a/shared/src/block_result.rs b/shared/src/block_result.rs index ac5f91a69..e6c17483b 100644 --- a/shared/src/block_result.rs +++ b/shared/src/block_result.rs @@ -131,7 +131,7 @@ pub struct SendPacket { #[derive(Debug, Clone)] pub enum TxAttributesType { TxApplied(TxApplied), - SendPacket(SendPacket) + SendPacket(SendPacket), } impl TxAttributesType { @@ -309,4 +309,4 @@ impl BlockResult { }); exit_status.unwrap_or(TransactionExitStatus::Rejected) } -} \ No newline at end of file +} diff --git a/transactions/src/main.rs b/transactions/src/main.rs index 70c15a98f..dd6cdb945 100644 --- a/transactions/src/main.rs +++ b/transactions/src/main.rs @@ -129,8 +129,8 @@ async fn crawling_fn( let ibc_ack_packet = tx_service::get_ibc_ack_packet(&inner_txs); tracing::info!( - "Deserialized {} wrappers, {} inners, {} ibc sequence numbers and {} ibc acks \ - events...", + "Deserialized {} wrappers, {} inners, {} ibc sequence numbers and {} \ + ibc acks events...", wrapper_txs.len(), inner_txs.len(), ibc_sequence_packet.len(), diff --git a/transactions/src/services/mod.rs b/transactions/src/services/mod.rs index 5c0b9ddc2..233652f55 100644 --- a/transactions/src/services/mod.rs +++ b/transactions/src/services/mod.rs @@ -1,4 +1,4 @@ pub mod db; pub mod namada; pub mod tendermint; -pub mod tx; \ No newline at end of file +pub mod tx; diff --git a/webserver/src/app.rs b/webserver/src/app.rs index 935eb0d57..fdbda7c5c 100644 --- a/webserver/src/app.rs +++ b/webserver/src/app.rs @@ -22,7 +22,7 @@ use crate::handler::{ balance as balance_handlers, chain as chain_handlers, crawler_state as crawler_state_handlers, gas as gas_handlers, governance as gov_handlers, ibc as ibc_handler, pk as pk_handlers, - pos as pos_handlers, transaction as transaction_handlers + pos as pos_handlers, transaction as transaction_handlers, }; use crate::state::common::CommonState;