Skip to content

Commit

Permalink
fix: linter field name starts with the struct's name
Browse files Browse the repository at this point in the history
  • Loading branch information
bkioshn committed Jan 26, 2024
1 parent 4443ff6 commit 55f1825
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion catalyst-gateway/bin/src/event_db/queries/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl RegistrationQueries for EventDB {
};

Ok(Voter {
voter_info: VoterInfo {
info: VoterInfo {
delegations_power: voter.try_get("delegations_power")?,
delegations_count: voter.try_get("delegations_count")?,
voting_power_saturation,
Expand Down
16 changes: 8 additions & 8 deletions catalyst-gateway/bin/src/event_db/queries/vit_ss/fund.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl VitSSFundQueries for EventDB {
challenges.push(Challenge {
id: row.try_get("id")?,
internal_id: row.try_get("internal_id")?,
challenge_type: row.try_get("challenge_type")?,
c_type: row.try_get("challenge_type")?,
title: row.try_get("title")?,
description: row.try_get("description")?,
rewards_total: row
Expand All @@ -175,7 +175,7 @@ impl VitSSFundQueries for EventDB {
.try_get::<_, Option<i64>>("proposers_rewards")?
.unwrap_or_default(),
fund_id,
challenge_url: row
url: row
.try_get::<_, Option<String>>("challenge_url")?
.unwrap_or_default(),
highlights: row
Expand All @@ -189,7 +189,7 @@ impl VitSSFundQueries for EventDB {
for row in rows {
goals.push(Goal {
id: row.try_get("id")?,
goal_name: row.try_get("goal_name")?,
name: row.try_get("goal_name")?,
fund_id,
});
}
Expand All @@ -198,22 +198,22 @@ impl VitSSFundQueries for EventDB {
let mut groups = Vec::new();
for row in rows {
groups.push(Group {
group_id: row.try_get("group_id")?,
g_id: row.try_get("group_id")?,
token_identifier: row.try_get("token_identifier")?,
fund_id,
});
}

let fund = Fund {
id: fund_id,
fund_name: row.try_get("fund_name")?,
fund_goal: row.try_get("fund_goal")?,
name: row.try_get("fund_name")?,
goal: row.try_get("fund_goal")?,
voting_power_threshold: row.try_get("voting_power_threshold")?,
fund_start_time: row
start_time: row
.try_get::<_, NaiveDateTime>("fund_start_time")?
.and_local_timezone(Utc)
.unwrap(),
fund_end_time: row
end_time: row
.try_get::<_, NaiveDateTime>("fund_end_time")?
.and_local_timezone(Utc)
.unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion catalyst-gateway/bin/src/event_db/types/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub(crate) struct VoterInfo {
/// Voter
pub(crate) struct Voter {
/// Voter info
pub(crate) voter_info: VoterInfo,
pub(crate) info: VoterInfo,
/// As at
pub(crate) as_at: DateTime<Utc>,
/// Last updated
Expand Down
4 changes: 2 additions & 2 deletions catalyst-gateway/bin/src/event_db/types/vit_ss/challenge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ pub(crate) struct Challenge {
// this is used only to retain the original insert order
pub(crate) internal_id: i32,
pub(crate) id: i32,
pub(crate) challenge_type: String,
pub(crate) c_type: String,
pub(crate) title: String,
pub(crate) description: String,
pub(crate) rewards_total: i64,
pub(crate) proposers_rewards: i64,
pub(crate) fund_id: i32,
pub(crate) challenge_url: String,
pub(crate) url: String,
pub(crate) highlights: Option<ChallengeHighlights>,
}
8 changes: 4 additions & 4 deletions catalyst-gateway/bin/src/event_db/types/vit_ss/fund.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ pub(crate) struct FundStageDates {
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct Fund {
pub(crate) id: i32,
pub(crate) fund_name: String,
pub(crate) fund_goal: String,
pub(crate) name: String,
pub(crate) goal: String,
pub(crate) voting_power_threshold: i64,
pub(crate) fund_start_time: DateTime<Utc>,
pub(crate) fund_end_time: DateTime<Utc>,
pub(crate) start_time: DateTime<Utc>,
pub(crate) end_time: DateTime<Utc>,
pub(crate) next_fund_start_time: DateTime<Utc>,
pub(crate) registration_snapshot_time: DateTime<Utc>,
pub(crate) next_registration_snapshot_time: DateTime<Utc>,
Expand Down
2 changes: 1 addition & 1 deletion catalyst-gateway/bin/src/event_db/types/vit_ss/goal.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct Goal {
pub(crate) id: i32,
pub(crate) goal_name: String,
pub(crate) name: String,
pub(crate) fund_id: i32,
}
2 changes: 1 addition & 1 deletion catalyst-gateway/bin/src/event_db/types/vit_ss/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
pub(crate) struct Group {
pub(crate) fund_id: i32,
pub(crate) token_identifier: String,
pub(crate) group_id: String,
pub(crate) g_id: String,
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl TryFrom<crate::event_db::types::registration::Voter> for VoterRegistration

fn try_from(value: crate::event_db::types::registration::Voter) -> Result<Self, Self::Error> {
Ok(Self {
voter_info: value.voter_info.try_into()?,
voter_info: value.info.try_into()?,
as_at: value.as_at,
last_updated: value.last_updated,
is_final: value.is_final,
Expand Down

0 comments on commit 55f1825

Please sign in to comment.