Skip to content

Commit

Permalink
refactor(torii-args): bool values no need for explicit true (#2767)
Browse files Browse the repository at this point in the history
* refactor(torii-args): bool values no need for explicit true

* fmt

* fix test
  • Loading branch information
Larkooo authored Dec 5, 2024
1 parent 0cb5923 commit 7179919
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 0 additions & 3 deletions crates/torii/cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,9 @@ mod test {
"http://0.0.0.0:6060",
"--db-dir",
"/tmp/torii-test2",
"--events.raw",
"false",
"--events.historical",
"a-A",
"--indexing.transactions",
"true",
"--config",
path_str.as_str(),
];
Expand Down
14 changes: 10 additions & 4 deletions crates/torii/cli/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::net::{IpAddr, Ipv4Addr};
use std::str::FromStr;

use anyhow::Context;
use clap::ArgAction;
use serde::ser::SerializeSeq;
use serde::{Deserialize, Serialize};
use starknet::core::types::Felt;
Expand Down Expand Up @@ -102,7 +101,11 @@ pub struct IndexingOptions {
pub blocks_chunk_size: u64,

/// Enable indexing pending blocks
#[arg(long = "indexing.pending", action = ArgAction::Set, default_value_t = true, help = "Whether or not to index pending blocks.")]
#[arg(
long = "indexing.pending",
default_value_t = true,
help = "Whether or not to index pending blocks."
)]
#[serde(default)]
pub pending: bool,

Expand All @@ -127,7 +130,6 @@ pub struct IndexingOptions {
/// Whether or not to index world transactions
#[arg(
long = "indexing.transactions",
action = ArgAction::Set,
default_value_t = false,
help = "Whether or not to index world transactions and keep them in the database."
)]
Expand Down Expand Up @@ -214,7 +216,11 @@ impl IndexingOptions {
#[command(next_help_heading = "Events indexing options")]
pub struct EventsOptions {
/// Whether or not to index raw events
#[arg(long = "events.raw", action = ArgAction::Set, default_value_t = false, help = "Whether or not to index raw events.")]
#[arg(
long = "events.raw",
default_value_t = false,
help = "Whether or not to index raw events."
)]
#[serde(default)]
pub raw: bool,

Expand Down

0 comments on commit 7179919

Please sign in to comment.