Skip to content

Commit ba3b35e

Browse files
committed
fmt
1 parent e08c1d4 commit ba3b35e

File tree

9 files changed

+13
-16
lines changed

9 files changed

+13
-16
lines changed

crates/torii/core/src/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ pub const IPFS_CLIENT_USERNAME: &str = "2EBrzr7ZASQZKH32sl2xWauXPSA";
1313
pub const IPFS_CLIENT_PASSWORD: &str = "12290b883db9138a8ae3363b6739d220";
1414

1515
pub const WORLD_CONTRACT_TYPE: &str = "WORLD";
16-
pub const SQL_FELT_DELIMITER: &str = "/";
16+
pub const SQL_FELT_DELIMITER: &str = "/";

crates/torii/core/src/engine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use tokio::task::JoinSet;
2424
use tokio::time::{sleep, Instant};
2525
use tracing::{debug, error, info, trace, warn};
2626

27+
use crate::constants::LOG_TARGET;
2728
use crate::processors::erc20_legacy_transfer::Erc20LegacyTransferProcessor;
2829
use crate::processors::erc20_transfer::Erc20TransferProcessor;
2930
use crate::processors::erc721_legacy_transfer::Erc721LegacyTransferProcessor;
@@ -44,7 +45,6 @@ use crate::processors::{
4445
};
4546
use crate::sql::{Cursors, Sql};
4647
use crate::types::{Contract, ContractType};
47-
use crate::constants::LOG_TARGET;
4848

4949
type EventProcessorMap<P> = HashMap<Felt, Vec<Box<dyn EventProcessor<P>>>>;
5050

crates/torii/core/src/executor/erc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ use starknet_crypto::Felt;
1313
use tracing::{debug, trace};
1414

1515
use super::{ApplyBalanceDiffQuery, Executor};
16-
use crate::constants::TOKEN_BALANCE_TABLE;
16+
use crate::constants::{IPFS_CLIENT_MAX_RETRY, SQL_FELT_DELIMITER, TOKEN_BALANCE_TABLE};
1717
use crate::sql::utils::{felt_to_sql_string, sql_string_to_u256, u256_to_sql_string, I256};
1818
use crate::types::ContractType;
1919
use crate::utils::fetch_content_from_ipfs;
20-
use crate::constants::{SQL_FELT_DELIMITER, IPFS_CLIENT_MAX_RETRY};
2120

2221
#[derive(Debug, Clone)]
2322
pub struct RegisterErc721TokenQuery {

crates/torii/core/src/sql/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -827,11 +827,7 @@ impl Sql {
827827
Ty::Enum(e) => {
828828
if e.options.iter().all(
829829
|o| {
830-
if let Ty::Tuple(t) = &o.ty {
831-
t.is_empty()
832-
} else {
833-
false
834-
}
830+
if let Ty::Tuple(t) = &o.ty { t.is_empty() } else { false }
835831
},
836832
) {
837833
return Ok(());

crates/torii/core/src/utils.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ use ipfs_api_backend_hyper::{IpfsApi, IpfsClient, TryFromUri};
77
use tokio_util::bytes::Bytes;
88
use tracing::info;
99

10-
use crate::constants::{IPFS_CLIENT_MAX_RETRY, IPFS_CLIENT_PASSWORD, IPFS_CLIENT_URL, IPFS_CLIENT_USERNAME};
10+
use crate::constants::{
11+
IPFS_CLIENT_MAX_RETRY, IPFS_CLIENT_PASSWORD, IPFS_CLIENT_URL, IPFS_CLIENT_USERNAME,
12+
};
1113

1214
pub fn must_utc_datetime_from_timestamp(timestamp: u64) -> DateTime<Utc> {
1315
let naive_dt = DateTime::from_timestamp(timestamp as i64, 0)
@@ -20,8 +22,8 @@ pub fn utc_dt_string_from_timestamp(timestamp: u64) -> String {
2022
}
2123

2224
pub async fn fetch_content_from_ipfs(cid: &str, mut retries: u8) -> Result<Bytes> {
23-
let client =
24-
IpfsClient::from_str(IPFS_CLIENT_URL)?.with_credentials(IPFS_CLIENT_USERNAME, IPFS_CLIENT_PASSWORD);
25+
let client = IpfsClient::from_str(IPFS_CLIENT_URL)?
26+
.with_credentials(IPFS_CLIENT_USERNAME, IPFS_CLIENT_PASSWORD);
2527
while retries > 0 {
2628
let response = client.cat(cid).map_ok(|chunk| chunk.to_vec()).try_concat().await;
2729
match response {

crates/torii/graphql/src/object/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use async_graphql::dynamic::{
33
};
44
use async_graphql::{Name, Result, Value};
55
use tokio_stream::{Stream, StreamExt};
6-
use torii_core::simple_broker::SimpleBroker;
76
use torii_core::constants::SQL_FELT_DELIMITER;
7+
use torii_core::simple_broker::SimpleBroker;
88
use torii_core::types::Event;
99

1010
use super::inputs::keys_input::{keys_argument, parse_keys_argument};

crates/torii/grpc/src/server/subscriptions/entity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ use tokio::sync::mpsc::{
1313
channel, unbounded_channel, Receiver, Sender, UnboundedReceiver, UnboundedSender,
1414
};
1515
use tokio::sync::RwLock;
16+
use torii_core::constants::SQL_FELT_DELIMITER;
1617
use torii_core::error::{Error, ParseError};
1718
use torii_core::simple_broker::SimpleBroker;
18-
use torii_core::constants::SQL_FELT_DELIMITER;
1919
use torii_core::types::OptimisticEntity;
2020
use tracing::{error, trace};
2121

crates/torii/grpc/src/server/subscriptions/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ use tokio::sync::mpsc::{
1313
channel, unbounded_channel, Receiver, Sender, UnboundedReceiver, UnboundedSender,
1414
};
1515
use tokio::sync::RwLock;
16+
use torii_core::constants::SQL_FELT_DELIMITER;
1617
use torii_core::error::{Error, ParseError};
1718
use torii_core::simple_broker::SimpleBroker;
18-
use torii_core::constants::SQL_FELT_DELIMITER;
1919
use torii_core::types::Event;
2020
use tracing::{error, trace};
2121

crates/torii/grpc/src/server/subscriptions/event_message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ use tokio::sync::mpsc::{
1313
channel, unbounded_channel, Receiver, Sender, UnboundedReceiver, UnboundedSender,
1414
};
1515
use tokio::sync::RwLock;
16+
use torii_core::constants::SQL_FELT_DELIMITER;
1617
use torii_core::error::{Error, ParseError};
1718
use torii_core::simple_broker::SimpleBroker;
18-
use torii_core::constants::SQL_FELT_DELIMITER;
1919
use torii_core::types::OptimisticEventMessage;
2020
use tracing::{error, trace};
2121

0 commit comments

Comments
 (0)