From b4175c6dff7e42c7b6340a857c5f7dd37391f8a3 Mon Sep 17 00:00:00 2001 From: Mr-Leshiy Date: Mon, 19 Feb 2024 13:21:28 +0200 Subject: [PATCH 1/4] move registration, v0 and v1 endpoints impl to the legacy mod --- .../bin/src/service/api/legacy/mod.rs | 13 +++++++++++++ .../service/api/{ => legacy}/registration/mod.rs | 0 .../service/api/{ => legacy}/v0/message_post.rs | 0 .../bin/src/service/api/{ => legacy}/v0/mod.rs | 0 .../src/service/api/{ => legacy}/v0/plans_get.rs | 0 .../api/{ => legacy}/v1/account_votes_get.rs | 0 .../api/{ => legacy}/v1/fragments_post.rs | 0 .../api/{ => legacy}/v1/fragments_statuses.rs | 0 .../bin/src/service/api/{ => legacy}/v1/mod.rs | 0 catalyst-gateway/bin/src/service/api/mod.rs | 16 ++++++++-------- 10 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 catalyst-gateway/bin/src/service/api/legacy/mod.rs rename catalyst-gateway/bin/src/service/api/{ => legacy}/registration/mod.rs (100%) rename catalyst-gateway/bin/src/service/api/{ => legacy}/v0/message_post.rs (100%) rename catalyst-gateway/bin/src/service/api/{ => legacy}/v0/mod.rs (100%) rename catalyst-gateway/bin/src/service/api/{ => legacy}/v0/plans_get.rs (100%) rename catalyst-gateway/bin/src/service/api/{ => legacy}/v1/account_votes_get.rs (100%) rename catalyst-gateway/bin/src/service/api/{ => legacy}/v1/fragments_post.rs (100%) rename catalyst-gateway/bin/src/service/api/{ => legacy}/v1/fragments_statuses.rs (100%) rename catalyst-gateway/bin/src/service/api/{ => legacy}/v1/mod.rs (100%) diff --git a/catalyst-gateway/bin/src/service/api/legacy/mod.rs b/catalyst-gateway/bin/src/service/api/legacy/mod.rs new file mode 100644 index 00000000000..ff548bdcd71 --- /dev/null +++ b/catalyst-gateway/bin/src/service/api/legacy/mod.rs @@ -0,0 +1,13 @@ +//! Legacy endpoints + +pub(crate) use registration::RegistrationApi; +pub(crate) use v0::V0Api; +pub(crate) use v1::V1Api; + +mod registration; +mod v0; +mod v1; + +/// Legacy endpoints API +#[allow(dead_code)] +pub(crate) type LegacyApi = (RegistrationApi, V0Api, V1Api); diff --git a/catalyst-gateway/bin/src/service/api/registration/mod.rs b/catalyst-gateway/bin/src/service/api/legacy/registration/mod.rs similarity index 100% rename from catalyst-gateway/bin/src/service/api/registration/mod.rs rename to catalyst-gateway/bin/src/service/api/legacy/registration/mod.rs diff --git a/catalyst-gateway/bin/src/service/api/v0/message_post.rs b/catalyst-gateway/bin/src/service/api/legacy/v0/message_post.rs similarity index 100% rename from catalyst-gateway/bin/src/service/api/v0/message_post.rs rename to catalyst-gateway/bin/src/service/api/legacy/v0/message_post.rs diff --git a/catalyst-gateway/bin/src/service/api/v0/mod.rs b/catalyst-gateway/bin/src/service/api/legacy/v0/mod.rs similarity index 100% rename from catalyst-gateway/bin/src/service/api/v0/mod.rs rename to catalyst-gateway/bin/src/service/api/legacy/v0/mod.rs diff --git a/catalyst-gateway/bin/src/service/api/v0/plans_get.rs b/catalyst-gateway/bin/src/service/api/legacy/v0/plans_get.rs similarity index 100% rename from catalyst-gateway/bin/src/service/api/v0/plans_get.rs rename to catalyst-gateway/bin/src/service/api/legacy/v0/plans_get.rs diff --git a/catalyst-gateway/bin/src/service/api/v1/account_votes_get.rs b/catalyst-gateway/bin/src/service/api/legacy/v1/account_votes_get.rs similarity index 100% rename from catalyst-gateway/bin/src/service/api/v1/account_votes_get.rs rename to catalyst-gateway/bin/src/service/api/legacy/v1/account_votes_get.rs diff --git a/catalyst-gateway/bin/src/service/api/v1/fragments_post.rs b/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_post.rs similarity index 100% rename from catalyst-gateway/bin/src/service/api/v1/fragments_post.rs rename to catalyst-gateway/bin/src/service/api/legacy/v1/fragments_post.rs diff --git a/catalyst-gateway/bin/src/service/api/v1/fragments_statuses.rs b/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_statuses.rs similarity index 100% rename from catalyst-gateway/bin/src/service/api/v1/fragments_statuses.rs rename to catalyst-gateway/bin/src/service/api/legacy/v1/fragments_statuses.rs diff --git a/catalyst-gateway/bin/src/service/api/v1/mod.rs b/catalyst-gateway/bin/src/service/api/legacy/v1/mod.rs similarity index 100% rename from catalyst-gateway/bin/src/service/api/v1/mod.rs rename to catalyst-gateway/bin/src/service/api/legacy/v1/mod.rs diff --git a/catalyst-gateway/bin/src/service/api/mod.rs b/catalyst-gateway/bin/src/service/api/mod.rs index 9392e0d4c39..b99aa95db89 100644 --- a/catalyst-gateway/bin/src/service/api/mod.rs +++ b/catalyst-gateway/bin/src/service/api/mod.rs @@ -6,20 +6,16 @@ use std::net::IpAddr; use gethostname::gethostname; use health::HealthApi; +use legacy::LegacyApi; use local_ip_address::list_afinet_netifas; use poem_openapi::{ContactObject, LicenseObject, OpenApiService, ServerObject}; -use registration::RegistrationApi; use test_endpoints::TestApi; -use v0::V0Api; -use v1::V1Api; use crate::settings::{DocsSettings, API_URL_PREFIX}; mod health; -mod registration; +mod legacy; mod test_endpoints; -mod v0; -mod v1; /// The name of the API const API_TITLE: &str = "Catalyst Gateway"; @@ -62,9 +58,13 @@ const TERMS_OF_SERVICE: &str = /// Create the `OpenAPI` definition pub(crate) fn mk_api( hosts: Vec, settings: &DocsSettings, -) -> OpenApiService<(TestApi, HealthApi, RegistrationApi, V0Api, V1Api), ()> { +) -> OpenApiService<(TestApi, HealthApi, LegacyApi), ()> { let mut service = OpenApiService::new( - (TestApi, HealthApi, RegistrationApi, V0Api, V1Api), + ( + TestApi, + HealthApi, + (legacy::RegistrationApi, legacy::V0Api, legacy::V1Api), + ), API_TITLE, API_VERSION, ) From 2df2ab552773e02ef94952d7be3c3cd45debf033 Mon Sep 17 00:00:00 2001 From: Mr-Leshiy Date: Mon, 19 Feb 2024 13:29:04 +0200 Subject: [PATCH 2/4] update test endpoint --- .../bin/src/service/api/test_endpoints/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/catalyst-gateway/bin/src/service/api/test_endpoints/mod.rs b/catalyst-gateway/bin/src/service/api/test_endpoints/mod.rs index 6bfb6f1a1e7..ac3966f1ba2 100644 --- a/catalyst-gateway/bin/src/service/api/test_endpoints/mod.rs +++ b/catalyst-gateway/bin/src/service/api/test_endpoints/mod.rs @@ -12,7 +12,12 @@ use poem_openapi::{ OpenApi, }; -use crate::{service::common::tags::ApiTags, state::State}; +use crate::{ + service::{ + common::tags::ApiTags, utilities::middleware::schema_validation::schema_version_validation, + }, + state::State, +}; /// Test API Endpoints pub(crate) struct TestApi; @@ -23,6 +28,7 @@ impl TestApi { path = "/test/:id/test/:action", method = "get", operation_id = "testGet", + transform = "schema_version_validation", deprecated )] /// Test Get API From bebd59df327a07a28a1c75e651ec8fac2a634c8a Mon Sep 17 00:00:00 2001 From: Mr-Leshiy Date: Mon, 19 Feb 2024 14:09:53 +0200 Subject: [PATCH 3/4] move common objects to the legacy mod --- .../src/service/api/legacy/registration/mod.rs | 4 ++-- .../src/service/api/legacy/v0/message_post.rs | 2 +- .../bin/src/service/api/legacy/v0/plans_get.rs | 2 +- .../service/api/legacy/v1/account_votes_get.rs | 2 +- .../src/service/api/legacy/v1/fragments_post.rs | 2 +- .../service/api/legacy/v1/fragments_statuses.rs | 2 +- .../bin/src/service/api/legacy/v1/mod.rs | 4 ++-- .../common/objects/{ => legacy}/account_votes.rs | 0 .../service/common/objects/{ => legacy}/block.rs | 0 .../objects/{ => legacy}/delegate_public_key.rs | 0 .../common/objects/{ => legacy}/event_id.rs | 0 .../objects/{ => legacy}/fragment_status.rs | 2 +- .../objects/{ => legacy}/fragments_batch.rs | 0 .../{ => legacy}/fragments_processing_summary.rs | 0 .../service/common/objects/{ => legacy}/hash.rs | 0 .../bin/src/service/common/objects/legacy/mod.rs | 16 ++++++++++++++++ .../objects/{ => legacy}/stake_public_key.rs | 0 .../common/objects/{ => legacy}/vote_plan.rs | 0 .../objects/{ => legacy}/voter_group_id.rs | 0 .../common/objects/{ => legacy}/voter_info.rs | 0 .../objects/{ => legacy}/voter_registration.rs | 0 .../objects/{ => legacy}/voting_public_key.rs | 0 .../bin/src/service/common/objects/mod.rs | 16 ++-------------- 23 files changed, 28 insertions(+), 24 deletions(-) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/account_votes.rs (100%) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/block.rs (100%) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/delegate_public_key.rs (100%) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/event_id.rs (100%) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/fragment_status.rs (94%) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/fragments_batch.rs (100%) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/fragments_processing_summary.rs (100%) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/hash.rs (100%) create mode 100644 catalyst-gateway/bin/src/service/common/objects/legacy/mod.rs rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/stake_public_key.rs (100%) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/vote_plan.rs (100%) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/voter_group_id.rs (100%) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/voter_info.rs (100%) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/voter_registration.rs (100%) rename catalyst-gateway/bin/src/service/common/objects/{ => legacy}/voting_public_key.rs (100%) diff --git a/catalyst-gateway/bin/src/service/api/legacy/registration/mod.rs b/catalyst-gateway/bin/src/service/api/legacy/registration/mod.rs index c45ffddd896..c7e17a4b942 100644 --- a/catalyst-gateway/bin/src/service/api/legacy/registration/mod.rs +++ b/catalyst-gateway/bin/src/service/api/legacy/registration/mod.rs @@ -14,8 +14,8 @@ use crate::{ service::{ common::{ objects::{ - event_id::EventId, voter_registration::VoterRegistration, - voting_public_key::VotingPublicKey, + legacy::event_id::EventId, legacy::voter_registration::VoterRegistration, + legacy::voting_public_key::VotingPublicKey, }, responses::{ resp_2xx::OK, diff --git a/catalyst-gateway/bin/src/service/api/legacy/v0/message_post.rs b/catalyst-gateway/bin/src/service/api/legacy/v0/message_post.rs index cbbc5c5c229..762f763ea83 100644 --- a/catalyst-gateway/bin/src/service/api/legacy/v0/message_post.rs +++ b/catalyst-gateway/bin/src/service/api/legacy/v0/message_post.rs @@ -4,7 +4,7 @@ use poem_extensions::{response, UniResponse::T200}; use poem_openapi::payload::{Binary, Json}; use crate::service::common::{ - objects::fragments_processing_summary::FragmentsProcessingSummary, + objects::legacy::fragments_processing_summary::FragmentsProcessingSummary, responses::{ resp_2xx::OK, resp_4xx::BadRequest, diff --git a/catalyst-gateway/bin/src/service/api/legacy/v0/plans_get.rs b/catalyst-gateway/bin/src/service/api/legacy/v0/plans_get.rs index 6c782a4c453..a8b523fce80 100644 --- a/catalyst-gateway/bin/src/service/api/legacy/v0/plans_get.rs +++ b/catalyst-gateway/bin/src/service/api/legacy/v0/plans_get.rs @@ -8,7 +8,7 @@ use poem_openapi::payload::Json; use crate::{ service::common::{ - objects::vote_plan::VotePlan, + objects::legacy::vote_plan::VotePlan, responses::{ resp_2xx::OK, resp_4xx::BadRequest, diff --git a/catalyst-gateway/bin/src/service/api/legacy/v1/account_votes_get.rs b/catalyst-gateway/bin/src/service/api/legacy/v1/account_votes_get.rs index f5496662ae2..80fd340d537 100644 --- a/catalyst-gateway/bin/src/service/api/legacy/v1/account_votes_get.rs +++ b/catalyst-gateway/bin/src/service/api/legacy/v1/account_votes_get.rs @@ -8,7 +8,7 @@ use poem_openapi::{param::Path, payload::Json}; use crate::{ service::common::{ - objects::account_votes::{AccountId, AccountVote}, + objects::legacy::account_votes::{AccountId, AccountVote}, responses::{ resp_2xx::OK, resp_4xx::BadRequest, diff --git a/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_post.rs b/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_post.rs index a84f687bf43..8ca9eb9fdff 100644 --- a/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_post.rs +++ b/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_post.rs @@ -5,7 +5,7 @@ use poem_openapi::payload::Json; use crate::service::common::{ objects::{ - fragments_batch::FragmentsBatch, fragments_processing_summary::FragmentsProcessingSummary, + legacy::fragments_batch::FragmentsBatch, legacy::fragments_processing_summary::FragmentsProcessingSummary, }, responses::{ resp_2xx::OK, diff --git a/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_statuses.rs b/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_statuses.rs index a57babb6fcf..09350eaf37c 100644 --- a/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_statuses.rs +++ b/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_statuses.rs @@ -6,7 +6,7 @@ use poem_extensions::{response, UniResponse::T200}; use poem_openapi::payload::Json; use crate::service::common::{ - objects::{fragment_status::FragmentStatus, fragments_processing_summary::FragmentId}, + objects::{legacy::fragment_status::FragmentStatus, legacy::fragments_processing_summary::FragmentId}, responses::{ resp_2xx::OK, resp_4xx::BadRequest, diff --git a/catalyst-gateway/bin/src/service/api/legacy/v1/mod.rs b/catalyst-gateway/bin/src/service/api/legacy/v1/mod.rs index d05f5030a15..a3b91a3f19f 100644 --- a/catalyst-gateway/bin/src/service/api/legacy/v1/mod.rs +++ b/catalyst-gateway/bin/src/service/api/legacy/v1/mod.rs @@ -13,8 +13,8 @@ use crate::{ service::{ common::{ objects::{ - account_votes::AccountId, fragments_batch::FragmentsBatch, - fragments_processing_summary::FragmentId, + legacy::account_votes::AccountId, legacy::fragments_batch::FragmentsBatch, + legacy::fragments_processing_summary::FragmentId, }, tags::ApiTags, }, diff --git a/catalyst-gateway/bin/src/service/common/objects/account_votes.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/account_votes.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/account_votes.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/account_votes.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/block.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/block.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/block.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/block.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/delegate_public_key.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/delegate_public_key.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/delegate_public_key.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/delegate_public_key.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/event_id.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/event_id.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/event_id.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/event_id.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/fragment_status.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/fragment_status.rs similarity index 94% rename from catalyst-gateway/bin/src/service/common/objects/fragment_status.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/fragment_status.rs index aef5ceae3e0..0764774b411 100644 --- a/catalyst-gateway/bin/src/service/common/objects/fragment_status.rs +++ b/catalyst-gateway/bin/src/service/common/objects/legacy/fragment_status.rs @@ -2,7 +2,7 @@ use poem_openapi::{types::Example, Object, Union}; -use crate::service::common::objects::{block::BlockDate, hash::Hash}; +use crate::service::common::objects::{legacy::block::BlockDate, legacy::hash::Hash}; #[derive(Object)] #[oai(example = false)] diff --git a/catalyst-gateway/bin/src/service/common/objects/fragments_batch.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/fragments_batch.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/fragments_batch.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/fragments_batch.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/fragments_processing_summary.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/fragments_processing_summary.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/fragments_processing_summary.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/fragments_processing_summary.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/hash.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/hash.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/hash.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/hash.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/legacy/mod.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/mod.rs new file mode 100644 index 00000000000..5dc88ce9d9f --- /dev/null +++ b/catalyst-gateway/bin/src/service/common/objects/legacy/mod.rs @@ -0,0 +1,16 @@ +//! Legacy objects + +pub(crate) mod account_votes; +pub(crate) mod block; +pub(crate) mod delegate_public_key; +pub(crate) mod event_id; +pub(crate) mod fragment_status; +pub(crate) mod fragments_batch; +pub(crate) mod fragments_processing_summary; +pub(crate) mod hash; +pub(crate) mod stake_public_key; +pub(crate) mod vote_plan; +pub(crate) mod voter_group_id; +pub(crate) mod voter_info; +pub(crate) mod voter_registration; +pub(crate) mod voting_public_key; \ No newline at end of file diff --git a/catalyst-gateway/bin/src/service/common/objects/stake_public_key.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/stake_public_key.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/stake_public_key.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/stake_public_key.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/vote_plan.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/vote_plan.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/vote_plan.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/vote_plan.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/voter_group_id.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/voter_group_id.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/voter_group_id.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/voter_group_id.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/voter_info.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/voter_info.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/voter_info.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/voter_info.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/voter_registration.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/voter_registration.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/voter_registration.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/voter_registration.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/voting_public_key.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/voting_public_key.rs similarity index 100% rename from catalyst-gateway/bin/src/service/common/objects/voting_public_key.rs rename to catalyst-gateway/bin/src/service/common/objects/legacy/voting_public_key.rs diff --git a/catalyst-gateway/bin/src/service/common/objects/mod.rs b/catalyst-gateway/bin/src/service/common/objects/mod.rs index 7d358fef953..6eebf89230a 100644 --- a/catalyst-gateway/bin/src/service/common/objects/mod.rs +++ b/catalyst-gateway/bin/src/service/common/objects/mod.rs @@ -1,15 +1,3 @@ //! This module contains common and re-usable objects. -pub(crate) mod account_votes; -pub(crate) mod block; -pub(crate) mod delegate_public_key; -pub(crate) mod event_id; -pub(crate) mod fragment_status; -pub(crate) mod fragments_batch; -pub(crate) mod fragments_processing_summary; -pub(crate) mod hash; -pub(crate) mod stake_public_key; -pub(crate) mod vote_plan; -pub(crate) mod voter_group_id; -pub(crate) mod voter_info; -pub(crate) mod voter_registration; -pub(crate) mod voting_public_key; + +pub(crate) mod legacy; From cd62f13b985cce12e53f8a33095aa59785e9c9fa Mon Sep 17 00:00:00 2001 From: Mr-Leshiy Date: Mon, 19 Feb 2024 14:15:58 +0200 Subject: [PATCH 4/4] move event-db types and quries to the legacy mod --- catalyst-gateway/bin/src/event_db/legacy/mod.rs | 4 ++++ .../bin/src/event_db/{ => legacy}/queries/event/ballot.rs | 2 +- .../bin/src/event_db/{ => legacy}/queries/event/mod.rs | 2 +- .../src/event_db/{ => legacy}/queries/event/objective.rs | 2 +- .../bin/src/event_db/{ => legacy}/queries/event/proposal.rs | 2 +- .../bin/src/event_db/{ => legacy}/queries/event/review.rs | 2 +- .../bin/src/event_db/{ => legacy}/queries/mod.rs | 0 .../bin/src/event_db/{ => legacy}/queries/registration.rs | 2 +- .../bin/src/event_db/{ => legacy}/queries/search.rs | 2 +- .../bin/src/event_db/{ => legacy}/queries/vit_ss/fund.rs | 2 +- .../bin/src/event_db/{ => legacy}/queries/vit_ss/mod.rs | 0 .../bin/src/event_db/{ => legacy}/types/ballot.rs | 2 +- .../bin/src/event_db/{ => legacy}/types/event.rs | 0 catalyst-gateway/bin/src/event_db/{ => legacy}/types/mod.rs | 0 .../bin/src/event_db/{ => legacy}/types/objective.rs | 2 +- .../bin/src/event_db/{ => legacy}/types/proposal.rs | 0 .../bin/src/event_db/{ => legacy}/types/registration.rs | 0 .../bin/src/event_db/{ => legacy}/types/review.rs | 0 .../bin/src/event_db/{ => legacy}/types/search.rs | 0 .../bin/src/event_db/{ => legacy}/types/vit_ss/challenge.rs | 0 .../bin/src/event_db/{ => legacy}/types/vit_ss/fund.rs | 0 .../bin/src/event_db/{ => legacy}/types/vit_ss/goal.rs | 0 .../bin/src/event_db/{ => legacy}/types/vit_ss/group.rs | 0 .../bin/src/event_db/{ => legacy}/types/vit_ss/mod.rs | 0 .../bin/src/event_db/{ => legacy}/types/vit_ss/vote_plan.rs | 0 .../bin/src/event_db/{ => legacy}/types/voting_status.rs | 0 catalyst-gateway/bin/src/event_db/mod.rs | 3 +-- .../bin/src/service/api/legacy/registration/mod.rs | 6 +++--- .../bin/src/service/api/legacy/v1/fragments_post.rs | 4 ++-- .../bin/src/service/api/legacy/v1/fragments_statuses.rs | 2 +- catalyst-gateway/bin/src/service/api/legacy/v1/mod.rs | 6 +++--- .../bin/src/service/common/objects/legacy/event_id.rs | 4 ++-- .../src/service/common/objects/legacy/fragment_status.rs | 2 +- .../bin/src/service/common/objects/legacy/mod.rs | 2 +- .../bin/src/service/common/objects/legacy/voter_group_id.rs | 4 ++-- .../bin/src/service/common/objects/legacy/voter_info.rs | 4 ++-- .../src/service/common/objects/legacy/voter_registration.rs | 6 ++++-- 37 files changed, 36 insertions(+), 31 deletions(-) create mode 100644 catalyst-gateway/bin/src/event_db/legacy/mod.rs rename catalyst-gateway/bin/src/event_db/{ => legacy}/queries/event/ballot.rs (99%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/queries/event/mod.rs (99%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/queries/event/objective.rs (99%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/queries/event/proposal.rs (99%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/queries/event/review.rs (99%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/queries/mod.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/queries/registration.rs (99%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/queries/search.rs (99%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/queries/vit_ss/fund.rs (99%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/queries/vit_ss/mod.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/ballot.rs (96%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/event.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/mod.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/objective.rs (96%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/proposal.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/registration.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/review.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/search.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/vit_ss/challenge.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/vit_ss/fund.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/vit_ss/goal.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/vit_ss/group.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/vit_ss/mod.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/vit_ss/vote_plan.rs (100%) rename catalyst-gateway/bin/src/event_db/{ => legacy}/types/voting_status.rs (100%) diff --git a/catalyst-gateway/bin/src/event_db/legacy/mod.rs b/catalyst-gateway/bin/src/event_db/legacy/mod.rs new file mode 100644 index 00000000000..ba86825873f --- /dev/null +++ b/catalyst-gateway/bin/src/event_db/legacy/mod.rs @@ -0,0 +1,4 @@ +//! Legacy event db queries and types + +pub(crate) mod queries; +pub(crate) mod types; diff --git a/catalyst-gateway/bin/src/event_db/queries/event/ballot.rs b/catalyst-gateway/bin/src/event_db/legacy/queries/event/ballot.rs similarity index 99% rename from catalyst-gateway/bin/src/event_db/queries/event/ballot.rs rename to catalyst-gateway/bin/src/event_db/legacy/queries/event/ballot.rs index 4a8970e0279..da0ffbb5c12 100644 --- a/catalyst-gateway/bin/src/event_db/queries/event/ballot.rs +++ b/catalyst-gateway/bin/src/event_db/legacy/queries/event/ballot.rs @@ -5,7 +5,7 @@ use async_trait::async_trait; use crate::event_db::{ error::Error, - types::{ + legacy::types::{ ballot::{ Ballot, BallotType, GroupVotePlans, ObjectiveBallots, ObjectiveChoices, ProposalBallot, VotePlan, diff --git a/catalyst-gateway/bin/src/event_db/queries/event/mod.rs b/catalyst-gateway/bin/src/event_db/legacy/queries/event/mod.rs similarity index 99% rename from catalyst-gateway/bin/src/event_db/queries/event/mod.rs rename to catalyst-gateway/bin/src/event_db/legacy/queries/event/mod.rs index dc70fe4f38d..362dff5e9ab 100644 --- a/catalyst-gateway/bin/src/event_db/queries/event/mod.rs +++ b/catalyst-gateway/bin/src/event_db/legacy/queries/event/mod.rs @@ -4,7 +4,7 @@ use chrono::{NaiveDateTime, Utc}; use crate::event_db::{ error::Error, - types::event::{ + legacy::types::event::{ Event, EventDetails, EventGoal, EventId, EventRegistration, EventSchedule, EventSummary, VotingPowerAlgorithm, VotingPowerSettings, }, diff --git a/catalyst-gateway/bin/src/event_db/queries/event/objective.rs b/catalyst-gateway/bin/src/event_db/legacy/queries/event/objective.rs similarity index 99% rename from catalyst-gateway/bin/src/event_db/queries/event/objective.rs rename to catalyst-gateway/bin/src/event_db/legacy/queries/event/objective.rs index d8034599e0c..f0e0c8223e3 100644 --- a/catalyst-gateway/bin/src/event_db/queries/event/objective.rs +++ b/catalyst-gateway/bin/src/event_db/legacy/queries/event/objective.rs @@ -3,7 +3,7 @@ use async_trait::async_trait; use crate::event_db::{ error::Error, - types::{ + legacy::types::{ event::EventId, objective::{ Objective, ObjectiveDetails, ObjectiveId, ObjectiveSummary, ObjectiveType, diff --git a/catalyst-gateway/bin/src/event_db/queries/event/proposal.rs b/catalyst-gateway/bin/src/event_db/legacy/queries/event/proposal.rs similarity index 99% rename from catalyst-gateway/bin/src/event_db/queries/event/proposal.rs rename to catalyst-gateway/bin/src/event_db/legacy/queries/event/proposal.rs index d58c5bd4f97..58691c66aad 100644 --- a/catalyst-gateway/bin/src/event_db/queries/event/proposal.rs +++ b/catalyst-gateway/bin/src/event_db/legacy/queries/event/proposal.rs @@ -3,7 +3,7 @@ use async_trait::async_trait; use crate::event_db::{ error::Error, - types::{ + legacy::types::{ event::EventId, objective::ObjectiveId, proposal::{Proposal, ProposalDetails, ProposalId, ProposalSummary, ProposerDetails}, diff --git a/catalyst-gateway/bin/src/event_db/queries/event/review.rs b/catalyst-gateway/bin/src/event_db/legacy/queries/event/review.rs similarity index 99% rename from catalyst-gateway/bin/src/event_db/queries/event/review.rs rename to catalyst-gateway/bin/src/event_db/legacy/queries/event/review.rs index 896406df698..18d247275c4 100644 --- a/catalyst-gateway/bin/src/event_db/queries/event/review.rs +++ b/catalyst-gateway/bin/src/event_db/legacy/queries/event/review.rs @@ -3,7 +3,7 @@ use async_trait::async_trait; use crate::event_db::{ error::Error, - types::{ + legacy::types::{ event::EventId, objective::ObjectiveId, proposal::ProposalId, diff --git a/catalyst-gateway/bin/src/event_db/queries/mod.rs b/catalyst-gateway/bin/src/event_db/legacy/queries/mod.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/queries/mod.rs rename to catalyst-gateway/bin/src/event_db/legacy/queries/mod.rs diff --git a/catalyst-gateway/bin/src/event_db/queries/registration.rs b/catalyst-gateway/bin/src/event_db/legacy/queries/registration.rs similarity index 99% rename from catalyst-gateway/bin/src/event_db/queries/registration.rs rename to catalyst-gateway/bin/src/event_db/legacy/queries/registration.rs index 5198bae0f0b..483661db076 100644 --- a/catalyst-gateway/bin/src/event_db/queries/registration.rs +++ b/catalyst-gateway/bin/src/event_db/legacy/queries/registration.rs @@ -3,7 +3,7 @@ use async_trait::async_trait; use chrono::{NaiveDateTime, Utc}; use crate::event_db::{ - types::{ + legacy::types::{ event::EventId, registration::{Delegation, Delegator, RewardAddress, Voter, VoterGroupId, VoterInfo}, }, diff --git a/catalyst-gateway/bin/src/event_db/queries/search.rs b/catalyst-gateway/bin/src/event_db/legacy/queries/search.rs similarity index 99% rename from catalyst-gateway/bin/src/event_db/queries/search.rs rename to catalyst-gateway/bin/src/event_db/legacy/queries/search.rs index 8110081dac6..af9cc2912d1 100644 --- a/catalyst-gateway/bin/src/event_db/queries/search.rs +++ b/catalyst-gateway/bin/src/event_db/legacy/queries/search.rs @@ -3,7 +3,7 @@ use async_trait::async_trait; use chrono::{NaiveDateTime, Utc}; use crate::event_db::{ - types::{ + legacy::types::{ event::{EventId, EventSummary}, objective::{ObjectiveId, ObjectiveSummary, ObjectiveType}, proposal::{ProposalId, ProposalSummary}, diff --git a/catalyst-gateway/bin/src/event_db/queries/vit_ss/fund.rs b/catalyst-gateway/bin/src/event_db/legacy/queries/vit_ss/fund.rs similarity index 99% rename from catalyst-gateway/bin/src/event_db/queries/vit_ss/fund.rs rename to catalyst-gateway/bin/src/event_db/legacy/queries/vit_ss/fund.rs index dc3088bd472..30c64eb53d3 100644 --- a/catalyst-gateway/bin/src/event_db/queries/vit_ss/fund.rs +++ b/catalyst-gateway/bin/src/event_db/legacy/queries/vit_ss/fund.rs @@ -2,7 +2,7 @@ use async_trait::async_trait; use chrono::{NaiveDateTime, Utc}; use crate::event_db::{ - types::vit_ss::{ + legacy::types::vit_ss::{ challenge::{Challenge, ChallengeHighlights}, fund::{Fund, FundNextInfo, FundStageDates, FundWithNext}, goal::Goal, diff --git a/catalyst-gateway/bin/src/event_db/queries/vit_ss/mod.rs b/catalyst-gateway/bin/src/event_db/legacy/queries/vit_ss/mod.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/queries/vit_ss/mod.rs rename to catalyst-gateway/bin/src/event_db/legacy/queries/vit_ss/mod.rs diff --git a/catalyst-gateway/bin/src/event_db/types/ballot.rs b/catalyst-gateway/bin/src/event_db/legacy/types/ballot.rs similarity index 96% rename from catalyst-gateway/bin/src/event_db/types/ballot.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/ballot.rs index 5030aaa3bdd..46d1d2f56af 100644 --- a/catalyst-gateway/bin/src/event_db/types/ballot.rs +++ b/catalyst-gateway/bin/src/event_db/legacy/types/ballot.rs @@ -1,6 +1,6 @@ //! Ballot types use super::{objective::ObjectiveId, proposal::ProposalId}; -use crate::event_db::types::registration::VoterGroupId; +use crate::event_db::legacy::types::registration::VoterGroupId; #[derive(Debug, Clone, PartialEq, Eq)] /// Objective Choices diff --git a/catalyst-gateway/bin/src/event_db/types/event.rs b/catalyst-gateway/bin/src/event_db/legacy/types/event.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/event.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/event.rs diff --git a/catalyst-gateway/bin/src/event_db/types/mod.rs b/catalyst-gateway/bin/src/event_db/legacy/types/mod.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/mod.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/mod.rs diff --git a/catalyst-gateway/bin/src/event_db/types/objective.rs b/catalyst-gateway/bin/src/event_db/legacy/types/objective.rs similarity index 96% rename from catalyst-gateway/bin/src/event_db/types/objective.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/objective.rs index 94a098f70f9..3ccd708bcc5 100644 --- a/catalyst-gateway/bin/src/event_db/types/objective.rs +++ b/catalyst-gateway/bin/src/event_db/legacy/types/objective.rs @@ -1,7 +1,7 @@ //! Objective Types use serde_json::Value; -use crate::event_db::types::registration::VoterGroupId; +use crate::event_db::legacy::types::registration::VoterGroupId; #[allow(clippy::module_name_repetitions)] #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/catalyst-gateway/bin/src/event_db/types/proposal.rs b/catalyst-gateway/bin/src/event_db/legacy/types/proposal.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/proposal.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/proposal.rs diff --git a/catalyst-gateway/bin/src/event_db/types/registration.rs b/catalyst-gateway/bin/src/event_db/legacy/types/registration.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/registration.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/registration.rs diff --git a/catalyst-gateway/bin/src/event_db/types/review.rs b/catalyst-gateway/bin/src/event_db/legacy/types/review.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/review.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/review.rs diff --git a/catalyst-gateway/bin/src/event_db/types/search.rs b/catalyst-gateway/bin/src/event_db/legacy/types/search.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/search.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/search.rs diff --git a/catalyst-gateway/bin/src/event_db/types/vit_ss/challenge.rs b/catalyst-gateway/bin/src/event_db/legacy/types/vit_ss/challenge.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/vit_ss/challenge.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/vit_ss/challenge.rs diff --git a/catalyst-gateway/bin/src/event_db/types/vit_ss/fund.rs b/catalyst-gateway/bin/src/event_db/legacy/types/vit_ss/fund.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/vit_ss/fund.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/vit_ss/fund.rs diff --git a/catalyst-gateway/bin/src/event_db/types/vit_ss/goal.rs b/catalyst-gateway/bin/src/event_db/legacy/types/vit_ss/goal.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/vit_ss/goal.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/vit_ss/goal.rs diff --git a/catalyst-gateway/bin/src/event_db/types/vit_ss/group.rs b/catalyst-gateway/bin/src/event_db/legacy/types/vit_ss/group.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/vit_ss/group.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/vit_ss/group.rs diff --git a/catalyst-gateway/bin/src/event_db/types/vit_ss/mod.rs b/catalyst-gateway/bin/src/event_db/legacy/types/vit_ss/mod.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/vit_ss/mod.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/vit_ss/mod.rs diff --git a/catalyst-gateway/bin/src/event_db/types/vit_ss/vote_plan.rs b/catalyst-gateway/bin/src/event_db/legacy/types/vit_ss/vote_plan.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/vit_ss/vote_plan.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/vit_ss/vote_plan.rs diff --git a/catalyst-gateway/bin/src/event_db/types/voting_status.rs b/catalyst-gateway/bin/src/event_db/legacy/types/voting_status.rs similarity index 100% rename from catalyst-gateway/bin/src/event_db/types/voting_status.rs rename to catalyst-gateway/bin/src/event_db/legacy/types/voting_status.rs diff --git a/catalyst-gateway/bin/src/event_db/mod.rs b/catalyst-gateway/bin/src/event_db/mod.rs index 55df06e3e8e..6c4a09391f6 100644 --- a/catalyst-gateway/bin/src/event_db/mod.rs +++ b/catalyst-gateway/bin/src/event_db/mod.rs @@ -9,9 +9,8 @@ use tokio_postgres::NoTls; mod config_table; pub(crate) mod error; -pub(crate) mod queries; +pub(crate) mod legacy; pub(crate) mod schema_check; -pub(crate) mod types; /// Database URL Environment Variable name. /// eg: "`postgres://catalyst-dev:CHANGE_ME@localhost/CatalystDev`" diff --git a/catalyst-gateway/bin/src/service/api/legacy/registration/mod.rs b/catalyst-gateway/bin/src/service/api/legacy/registration/mod.rs index c7e17a4b942..73c4047fc6b 100644 --- a/catalyst-gateway/bin/src/service/api/legacy/registration/mod.rs +++ b/catalyst-gateway/bin/src/service/api/legacy/registration/mod.rs @@ -13,9 +13,9 @@ use poem_openapi::{ use crate::{ service::{ common::{ - objects::{ - legacy::event_id::EventId, legacy::voter_registration::VoterRegistration, - legacy::voting_public_key::VotingPublicKey, + objects::legacy::{ + event_id::EventId, voter_registration::VoterRegistration, + voting_public_key::VotingPublicKey, }, responses::{ resp_2xx::OK, diff --git a/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_post.rs b/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_post.rs index 8ca9eb9fdff..fe245c4cb46 100644 --- a/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_post.rs +++ b/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_post.rs @@ -4,8 +4,8 @@ use poem_extensions::{response, UniResponse::T200}; use poem_openapi::payload::Json; use crate::service::common::{ - objects::{ - legacy::fragments_batch::FragmentsBatch, legacy::fragments_processing_summary::FragmentsProcessingSummary, + objects::legacy::{ + fragments_batch::FragmentsBatch, fragments_processing_summary::FragmentsProcessingSummary, }, responses::{ resp_2xx::OK, diff --git a/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_statuses.rs b/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_statuses.rs index 09350eaf37c..b27a3e1ab56 100644 --- a/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_statuses.rs +++ b/catalyst-gateway/bin/src/service/api/legacy/v1/fragments_statuses.rs @@ -6,7 +6,7 @@ use poem_extensions::{response, UniResponse::T200}; use poem_openapi::payload::Json; use crate::service::common::{ - objects::{legacy::fragment_status::FragmentStatus, legacy::fragments_processing_summary::FragmentId}, + objects::legacy::{fragment_status::FragmentStatus, fragments_processing_summary::FragmentId}, responses::{ resp_2xx::OK, resp_4xx::BadRequest, diff --git a/catalyst-gateway/bin/src/service/api/legacy/v1/mod.rs b/catalyst-gateway/bin/src/service/api/legacy/v1/mod.rs index a3b91a3f19f..692ec585362 100644 --- a/catalyst-gateway/bin/src/service/api/legacy/v1/mod.rs +++ b/catalyst-gateway/bin/src/service/api/legacy/v1/mod.rs @@ -12,9 +12,9 @@ use poem_openapi::{ use crate::{ service::{ common::{ - objects::{ - legacy::account_votes::AccountId, legacy::fragments_batch::FragmentsBatch, - legacy::fragments_processing_summary::FragmentId, + objects::legacy::{ + account_votes::AccountId, fragments_batch::FragmentsBatch, + fragments_processing_summary::FragmentId, }, tags::ApiTags, }, diff --git a/catalyst-gateway/bin/src/service/common/objects/legacy/event_id.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/event_id.rs index 9f46922251a..5f47b9f51a7 100644 --- a/catalyst-gateway/bin/src/service/common/objects/legacy/event_id.rs +++ b/catalyst-gateway/bin/src/service/common/objects/legacy/event_id.rs @@ -13,8 +13,8 @@ impl Example for EventId { } } -impl From for crate::event_db::types::event::EventId { +impl From for crate::event_db::legacy::types::event::EventId { fn from(event_id: EventId) -> Self { - crate::event_db::types::event::EventId(event_id.0) + crate::event_db::legacy::types::event::EventId(event_id.0) } } diff --git a/catalyst-gateway/bin/src/service/common/objects/legacy/fragment_status.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/fragment_status.rs index 0764774b411..fbae82f5320 100644 --- a/catalyst-gateway/bin/src/service/common/objects/legacy/fragment_status.rs +++ b/catalyst-gateway/bin/src/service/common/objects/legacy/fragment_status.rs @@ -2,7 +2,7 @@ use poem_openapi::{types::Example, Object, Union}; -use crate::service::common::objects::{legacy::block::BlockDate, legacy::hash::Hash}; +use crate::service::common::objects::legacy::{block::BlockDate, hash::Hash}; #[derive(Object)] #[oai(example = false)] diff --git a/catalyst-gateway/bin/src/service/common/objects/legacy/mod.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/mod.rs index 5dc88ce9d9f..40b61cca759 100644 --- a/catalyst-gateway/bin/src/service/common/objects/legacy/mod.rs +++ b/catalyst-gateway/bin/src/service/common/objects/legacy/mod.rs @@ -13,4 +13,4 @@ pub(crate) mod vote_plan; pub(crate) mod voter_group_id; pub(crate) mod voter_info; pub(crate) mod voter_registration; -pub(crate) mod voting_public_key; \ No newline at end of file +pub(crate) mod voting_public_key; diff --git a/catalyst-gateway/bin/src/service/common/objects/legacy/voter_group_id.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/voter_group_id.rs index ae4f9cb4f46..00b9516d522 100644 --- a/catalyst-gateway/bin/src/service/common/objects/legacy/voter_group_id.rs +++ b/catalyst-gateway/bin/src/service/common/objects/legacy/voter_group_id.rs @@ -19,11 +19,11 @@ impl Example for VoterGroupId { } } -impl TryFrom for VoterGroupId { +impl TryFrom for VoterGroupId { type Error = String; fn try_from( - value: crate::event_db::types::registration::VoterGroupId, + value: crate::event_db::legacy::types::registration::VoterGroupId, ) -> Result { match value.0.as_str() { "rep" => Ok(Self::Rep), diff --git a/catalyst-gateway/bin/src/service/common/objects/legacy/voter_info.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/voter_info.rs index 0115b02f5cc..1a18140e050 100644 --- a/catalyst-gateway/bin/src/service/common/objects/legacy/voter_info.rs +++ b/catalyst-gateway/bin/src/service/common/objects/legacy/voter_info.rs @@ -54,11 +54,11 @@ impl Example for VoterInfo { } } -impl TryFrom for VoterInfo { +impl TryFrom for VoterInfo { type Error = String; fn try_from( - value: crate::event_db::types::registration::VoterInfo, + value: crate::event_db::legacy::types::registration::VoterInfo, ) -> Result { Ok(Self { voting_power: value.voting_power, diff --git a/catalyst-gateway/bin/src/service/common/objects/legacy/voter_registration.rs b/catalyst-gateway/bin/src/service/common/objects/legacy/voter_registration.rs index 756f9c580ab..197436dfd8a 100644 --- a/catalyst-gateway/bin/src/service/common/objects/legacy/voter_registration.rs +++ b/catalyst-gateway/bin/src/service/common/objects/legacy/voter_registration.rs @@ -34,10 +34,12 @@ impl Example for VoterRegistration { } } -impl TryFrom for VoterRegistration { +impl TryFrom for VoterRegistration { type Error = String; - fn try_from(value: crate::event_db::types::registration::Voter) -> Result { + fn try_from( + value: crate::event_db::legacy::types::registration::Voter, + ) -> Result { Ok(Self { voter_info: value.info.try_into()?, as_at: value.as_at,