Skip to content

Commit

Permalink
fix: ensure the default for EventOptions matches the CLAP values
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed Nov 19, 2024
1 parent 523817a commit 680957d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions crates/torii/cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ mod test {
db_dir = "/tmp/torii-test"
[events]
raw = false
raw = true
historical = [
"ns-E",
"ns-EH"
Expand Down Expand Up @@ -291,7 +291,7 @@ mod test {
assert_eq!(torii_args.world_address, Some(Felt::from_str("0x1234").unwrap()));
assert_eq!(torii_args.rpc, Url::parse("http://0.0.0.0:2222").unwrap());
assert_eq!(torii_args.db_dir, Some(PathBuf::from("/tmp/torii-test")));
assert!(!torii_args.events.raw);
assert!(torii_args.events.raw);
assert_eq!(torii_args.events.historical, vec!["ns-E".to_string(), "ns-EH".to_string()]);
assert_eq!(torii_args.indexing.events_chunk_size, 9999);
assert_eq!(torii_args.indexing.blocks_chunk_size, 10240);
Expand Down
8 changes: 1 addition & 7 deletions crates/torii/cli/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl IndexingOptions {
}
}

#[derive(Debug, clap::Args, Clone, Serialize, Deserialize, PartialEq)]
#[derive(Debug, clap::Args, Clone, Serialize, Deserialize, PartialEq, Default)]
#[command(next_help_heading = "Events indexing options")]
pub struct EventsOptions {
/// Whether or not to index raw events
Expand All @@ -229,12 +229,6 @@ pub struct EventsOptions {
pub historical: Vec<String>,
}

impl Default for EventsOptions {
fn default() -> Self {
Self { raw: true, historical: vec![] }
}
}

#[derive(Debug, clap::Args, Clone, Serialize, Deserialize, PartialEq)]
#[command(next_help_heading = "HTTP server options")]
pub struct ServerOptions {
Expand Down

0 comments on commit 680957d

Please sign in to comment.