Skip to content

Commit

Permalink
chore: fix grpc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
v3g42 committed Sep 22, 2023
1 parent 2b00401 commit 73981b8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
12 changes: 11 additions & 1 deletion dozer-types/src/ingestion_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct EthFilter {
pub topics: Vec<String>,
}

#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Clone, Hash, JsonSchema, Default)]
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Clone, Hash, JsonSchema)]
pub struct GrpcConfig {
#[serde(default = "default_ingest_host")]
pub host: String,
Expand All @@ -52,6 +52,16 @@ pub struct GrpcConfig {
#[serde(default = "default_grpc_adapter")]
pub adapter: String,
}
impl Default for GrpcConfig {
fn default() -> Self {
Self {
host: default_ingest_host(),
port: default_ingest_port(),
schemas: None,
adapter: default_grpc_adapter(),
}
}
}

fn default_grpc_adapter() -> String {
"default".to_owned()
Expand Down
18 changes: 7 additions & 11 deletions dozer-types/src/models/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct Flags {
pub grpc_web: bool,

/// push events enabled.; Default: true
#[serde(default = "default_true")]
#[serde(default = "default_push_events")]
pub push_events: bool,

/// require authentication to access grpc server reflection service if true.; Default: false
Expand All @@ -34,7 +34,7 @@ impl Default for Flags {
}
}

#[derive(Debug, Serialize, JsonSchema, Deserialize, PartialEq, Eq, Clone)]
#[derive(Debug, Serialize, JsonSchema, Default, Deserialize, PartialEq, Eq, Clone)]
pub struct EnableProbabilisticOptimizations {
/// enable probabilistic optimizations in set operations (UNION, EXCEPT, INTERSECT); Default: false
#[serde(default = "default_false")]
Expand All @@ -48,18 +48,14 @@ pub struct EnableProbabilisticOptimizations {
#[serde(default = "default_false")]
pub in_aggregations: bool,
}
impl Default for EnableProbabilisticOptimizations {
fn default() -> Self {
Self {
in_sets: false,
in_joins: false,
in_aggregations: false,
}
}
}

fn default_true() -> bool {
true
}
fn default_false() -> bool {
false
}

pub fn default_push_events() -> bool {
true
}

0 comments on commit 73981b8

Please sign in to comment.