Skip to content

chore(apollo_deployments): change deployment config overrides to be fns #6367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions crates/apollo_deployments/src/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,27 +206,27 @@ impl ConfigOverride {
#[derive(Debug, Serialize)]
pub struct DeploymentConfigOverride {
#[serde(rename = "base_layer_config.starknet_contract_address")]
starknet_contract_address: &'static str,
chain_id: &'static str,
eth_fee_token_address: &'static str,
starknet_url: &'static str,
strk_fee_token_address: &'static str,
starknet_contract_address: String,
chain_id: String,
eth_fee_token_address: String,
starknet_url: String,
strk_fee_token_address: String,
}

impl DeploymentConfigOverride {
pub const fn new(
starknet_contract_address: &'static str,
chain_id: &'static str,
eth_fee_token_address: &'static str,
starknet_url: &'static str,
strk_fee_token_address: &'static str,
pub fn new(
starknet_contract_address: impl ToString,
chain_id: impl ToString,
eth_fee_token_address: impl ToString,
starknet_url: impl ToString,
strk_fee_token_address: impl ToString,
) -> Self {
Self {
starknet_contract_address,
chain_id,
eth_fee_token_address,
starknet_url,
strk_fee_token_address,
starknet_contract_address: starknet_contract_address.to_string(),
chain_id: chain_id.to_string(),
eth_fee_token_address: eth_fee_token_address.to_string(),
starknet_url: starknet_url.to_string(),
strk_fee_token_address: strk_fee_token_address.to_string(),
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,39 @@ use crate::deployment::{
use crate::deployment_definitions::{Environment, BASE_APP_CONFIG_PATH};
use crate::service::{DeploymentName, ExternalSecret};

const SEPOLIA_INTEGRATION_DEPLOYMENT_CONFIG_OVERRIDE: DeploymentConfigOverride =
fn sepolia_integration_deployment_config_override() -> DeploymentConfigOverride {
DeploymentConfigOverride::new(
"0x4737c0c1B4D5b1A687B42610DdabEE781152359c",
"SN_INTEGRATION_SEPOLIA",
"0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
"https://feeder.integration-sepolia.starknet.io/",
"0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
);
)
}

const FIRST_NODE_NAMESPACE: &str = "apollo-sepolia-integration-0";

fn sepolia_integration_node_0_config_override() -> ConfigOverride {
ConfigOverride::new(
SEPOLIA_INTEGRATION_DEPLOYMENT_CONFIG_OVERRIDE,
sepolia_integration_deployment_config_override(),
create_hybrid_instance_config_override(1, FIRST_NODE_NAMESPACE),
)
}
fn sepolia_integration_node_1_config_override() -> ConfigOverride {
ConfigOverride::new(
SEPOLIA_INTEGRATION_DEPLOYMENT_CONFIG_OVERRIDE,
sepolia_integration_deployment_config_override(),
create_hybrid_instance_config_override(2, FIRST_NODE_NAMESPACE),
)
}
fn sepolia_integration_node_2_config_override() -> ConfigOverride {
ConfigOverride::new(
SEPOLIA_INTEGRATION_DEPLOYMENT_CONFIG_OVERRIDE,
sepolia_integration_deployment_config_override(),
create_hybrid_instance_config_override(3, FIRST_NODE_NAMESPACE),
)
}
fn sepolia_integration_node_3_config_override() -> ConfigOverride {
ConfigOverride::new(
SEPOLIA_INTEGRATION_DEPLOYMENT_CONFIG_OVERRIDE,
sepolia_integration_deployment_config_override(),
create_hybrid_instance_config_override(4, FIRST_NODE_NAMESPACE),
)
}
Expand Down
18 changes: 10 additions & 8 deletions crates/apollo_deployments/src/deployment_definitions/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ use crate::deployment::{
use crate::deployment_definitions::{Environment, BASE_APP_CONFIG_PATH};
use crate::service::DeploymentName;

const TESTING_DEPLOYMENT_CONFIG_OVERRIDE: DeploymentConfigOverride = DeploymentConfigOverride::new(
"0x5FbDB2315678afecb367f032d93F642f64180aa3",
"CHAIN_ID_SUBDIR",
"0x1001",
"https://integration-sepolia.starknet.io/",
"0x1002",
);
fn testing_deployment_config_override() -> DeploymentConfigOverride {
DeploymentConfigOverride::new(
"0x5FbDB2315678afecb367f032d93F642f64180aa3",
"CHAIN_ID_SUBDIR",
"0x1001",
"https://integration-sepolia.starknet.io/",
"0x1002",
)
}

fn testing_instance_config_override() -> InstanceConfigOverride {
InstanceConfigOverride::new(
Expand All @@ -32,7 +34,7 @@ fn testing_instance_config_override() -> InstanceConfigOverride {
}

fn testing_config_override() -> ConfigOverride {
ConfigOverride::new(TESTING_DEPLOYMENT_CONFIG_OVERRIDE, testing_instance_config_override())
ConfigOverride::new(testing_deployment_config_override(), testing_instance_config_override())
}

const TESTING_INGRESS_DOMAIN: &str = "sw-dev.io";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,39 @@ use crate::deployment::{
use crate::deployment_definitions::{Environment, BASE_APP_CONFIG_PATH};
use crate::service::{DeploymentName, ExternalSecret};

const TESTING_ENV_2_DEPLOYMENT_CONFIG_OVERRIDE: DeploymentConfigOverride =
fn testing_env_2_deployment_config_override() -> DeploymentConfigOverride {
DeploymentConfigOverride::new(
"0xA43812F9C610851daF67c5FA36606Ea8c8Fa7caE",
"SN_GOERLI",
"0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
"https://fgw-sn-test-sepolia-2-sepolia.gateway-proxy.sw-dev.io",
"0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
);
)
}

const FIRST_NODE_NAMESPACE: &str = "sequencer-test-sepolia-0";

fn testing_env_2_node_0_config_override() -> ConfigOverride {
ConfigOverride::new(
TESTING_ENV_2_DEPLOYMENT_CONFIG_OVERRIDE,
testing_env_2_deployment_config_override(),
create_hybrid_instance_config_override(1, FIRST_NODE_NAMESPACE),
)
}
fn testing_env_2_node_1_config_override() -> ConfigOverride {
ConfigOverride::new(
TESTING_ENV_2_DEPLOYMENT_CONFIG_OVERRIDE,
testing_env_2_deployment_config_override(),
create_hybrid_instance_config_override(2, FIRST_NODE_NAMESPACE),
)
}
fn testing_env_2_node_2_config_override() -> ConfigOverride {
ConfigOverride::new(
TESTING_ENV_2_DEPLOYMENT_CONFIG_OVERRIDE,
testing_env_2_deployment_config_override(),
create_hybrid_instance_config_override(3, FIRST_NODE_NAMESPACE),
)
}
fn testing_env_2_node_3_config_override() -> ConfigOverride {
ConfigOverride::new(
TESTING_ENV_2_DEPLOYMENT_CONFIG_OVERRIDE,
testing_env_2_deployment_config_override(),
create_hybrid_instance_config_override(4, FIRST_NODE_NAMESPACE),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,39 @@ use crate::deployment::{
use crate::deployment_definitions::{Environment, BASE_APP_CONFIG_PATH};
use crate::service::{DeploymentName, ExternalSecret};

const TESTING_ENV_3_DEPLOYMENT_CONFIG_OVERRIDE: DeploymentConfigOverride =
fn testing_env_3_deployment_config_override() -> DeploymentConfigOverride {
DeploymentConfigOverride::new(
"0xa23a6BA7DA61988D2420dAE9F10eE964552459d5",
"SN_GOERLI",
"0x7c07a3eec8ff611328722c3fc3e5d2e4ef2f60740c0bf86c756606036b74c16",
"https://fgw-sn-test-sepolia-3-sepolia.gateway-proxy.sw-dev.io",
"0x54a93d918d62b2fb62b25e77d9cb693bd277ab7e6fa236e53af263f1adb40e4",
);
)
}

const FIRST_NODE_NAMESPACE: &str = "sequencer-test-3-node-0";

fn testing_env_3_node_0_config_override() -> ConfigOverride {
ConfigOverride::new(
TESTING_ENV_3_DEPLOYMENT_CONFIG_OVERRIDE,
testing_env_3_deployment_config_override(),
create_hybrid_instance_config_override(1, FIRST_NODE_NAMESPACE),
)
}
fn testing_env_3_node_1_config_override() -> ConfigOverride {
ConfigOverride::new(
TESTING_ENV_3_DEPLOYMENT_CONFIG_OVERRIDE,
testing_env_3_deployment_config_override(),
create_hybrid_instance_config_override(2, FIRST_NODE_NAMESPACE),
)
}
fn testing_env_3_node_2_config_override() -> ConfigOverride {
ConfigOverride::new(
TESTING_ENV_3_DEPLOYMENT_CONFIG_OVERRIDE,
testing_env_3_deployment_config_override(),
create_hybrid_instance_config_override(3, FIRST_NODE_NAMESPACE),
)
}
fn testing_env_3_node_3_config_override() -> ConfigOverride {
ConfigOverride::new(
TESTING_ENV_3_DEPLOYMENT_CONFIG_OVERRIDE,
testing_env_3_deployment_config_override(),
create_hybrid_instance_config_override(4, FIRST_NODE_NAMESPACE),
)
}
Expand Down