Skip to content

Commit

Permalink
move version_config out of api into main gateway src
Browse files Browse the repository at this point in the history
  • Loading branch information
nagmo-starkware committed Jul 12, 2023
1 parent 537a674 commit b0fb60c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
5 changes: 1 addition & 4 deletions crates/papyrus_gateway/src/api/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
pub mod v0_3_0;

pub mod version_config;
#[cfg(test)]
mod version_config_test;

use std::collections::HashSet;

use jsonrpsee::{Methods, RpcModule};
Expand All @@ -18,6 +14,7 @@ use self::v0_3_0::JsonRpcV0_3_0Server;
use crate::v0_3_0::deprecated_contract_class::ContractClass as DeprecatedContractClass;
use crate::v0_3_0::state::ContractClass;
use crate::v0_3_0::transaction::Event;
use crate::version_config;

#[derive(Copy, Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub enum Tag {
Expand Down
2 changes: 1 addition & 1 deletion crates/papyrus_gateway/src/gateway_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ use starknet_api::deprecated_contract_class::{
use test_utils::{get_rng, GetTestInstance};
use tower::BoxError;

use crate::api::version_config::{LATEST_VERSION_ID, VERSION_CONFIG};
use crate::api::JsonRpcError;
use crate::middleware::proxy_request;
use crate::test_utils::get_test_gateway_config;
use crate::v0_3_0::deprecated_contract_class::{
ContractClassAbiEntryType, ContractClassAbiEntryWithType,
};
use crate::version_config::{LATEST_VERSION_ID, VERSION_CONFIG};
use crate::{get_block_status, run_server, SERVER_MAX_BODY_SIZE};

#[tokio::test]
Expand Down
3 changes: 3 additions & 0 deletions crates/papyrus_gateway/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ mod middleware;
#[cfg(test)]
mod test_utils;
mod v0_3_0;
mod version_config;
#[cfg(test)]
mod version_config_test;

use std::fmt::Display;
use std::net::SocketAddr;
Expand Down
2 changes: 1 addition & 1 deletion crates/papyrus_gateway/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use hyper::{Body, Request};
use jsonrpsee::core::http_helpers::read_body;
use tower::BoxError;

use crate::api::version_config::{VersionState, LATEST_VERSION_ID, VERSION_CONFIG};
use crate::version_config::{VersionState, LATEST_VERSION_ID, VERSION_CONFIG};
use crate::SERVER_MAX_BODY_SIZE;

/// [`Tower`] middleware intended to proxy method requests to the right version of the API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use assert_matches::assert_matches;
use pretty_assertions::assert_eq;

use super::version_config::VERSION_CONFIG;
use crate::api::version_config::{VersionState, LATEST_VERSION_ID};
use crate::version_config::{VersionState, LATEST_VERSION_ID};

#[tokio::test]
async fn validate_version_configuration() {
Expand Down

0 comments on commit b0fb60c

Please sign in to comment.