1- use std:: str:: FromStr ;
2-
31use ethers:: types:: { Address , H256 , U256 } ;
42use serde:: { Deserialize , Serialize } ;
53
64use crate :: {
75 forge_interface:: deploy_ecosystem:: input:: InitialDeploymentConfig , traits:: FileConfigTrait ,
8- ContractsConfig , ContractsGenesisConfig ,
6+ ContractsConfig ,
97} ;
108
119#[ derive( Debug , Clone , Serialize , Deserialize ) ]
@@ -16,13 +14,6 @@ pub struct GatewayContractsConfig {
1614 pub create2_factory_salt : H256 ,
1715 pub create2_factory_addr : Option < Address > ,
1816 pub validator_timelock_execution_delay : U256 ,
19- pub genesis_root : H256 ,
20- pub genesis_rollup_leaf_index : U256 ,
21- pub genesis_batch_commitment : H256 ,
22- pub latest_protocol_version : U256 ,
23- pub default_aa_hash : H256 ,
24- pub bootloader_hash : H256 ,
25- pub evm_emulator_hash : Option < H256 > ,
2617 pub avail_l1_da_validator : Option < Address > ,
2718 pub bridgehub_proxy_address : Address ,
2819}
@@ -52,15 +43,14 @@ impl GatewayVotePreparationConfig {
5243 #[ allow( clippy:: too_many_arguments) ]
5344 pub fn new (
5445 initial_deployment_config : & InitialDeploymentConfig ,
55- genesis_input : & ContractsGenesisConfig ,
56- external_contracts_config : & ContractsConfig , // from external context
46+ external_contracts_config : & ContractsConfig ,
5747 era_chain_id : U256 ,
5848 gateway_chain_id : U256 ,
5949 owner_address : Address ,
6050 testnet_verifier : bool ,
6151 is_zk_sync_os : bool ,
6252 refund_recipient : Address ,
63- ) -> anyhow :: Result < Self > {
53+ ) -> Self {
6454 let contracts = GatewayContractsConfig {
6555 governance_security_council_address : Address :: zero ( ) ,
6656 governance_min_delay : U256 :: from ( initial_deployment_config. governance_min_delay ) ,
@@ -70,17 +60,6 @@ impl GatewayVotePreparationConfig {
7060 validator_timelock_execution_delay : U256 :: from (
7161 initial_deployment_config. validator_timelock_execution_delay ,
7262 ) ,
73- genesis_root : H256 :: from_str ( & genesis_input. genesis_root_hash ( ) ?) ?,
74- genesis_rollup_leaf_index : U256 :: from ( genesis_input. rollup_last_leaf_index ( ) ?) ,
75- genesis_batch_commitment : H256 :: from_str ( & genesis_input. genesis_commitment ( ) ?) ?,
76- latest_protocol_version : genesis_input. protocol_semantic_version ( ) ?. pack ( ) ,
77- default_aa_hash : H256 :: from_str ( & genesis_input. default_aa_hash ( ) ?) ?,
78- bootloader_hash : H256 :: from_str ( & genesis_input. bootloader_hash ( ) ?) ?,
79- evm_emulator_hash : genesis_input
80- . evm_emulator_hash ( ) ?
81- . as_ref ( )
82- . map ( |hash| H256 :: from_str ( & hash. to_string ( ) ) )
83- . transpose ( ) ?,
8463 avail_l1_da_validator : external_contracts_config. l1 . avail_l1_da_validator_addr ,
8564 bridgehub_proxy_address : external_contracts_config
8665 . ecosystem_contracts
@@ -91,7 +70,7 @@ impl GatewayVotePreparationConfig {
9170 token_weth_address : initial_deployment_config. token_weth_address ,
9271 } ;
9372
94- Ok ( Self {
73+ Self {
9574 era_chain_id,
9675 owner_address,
9776 testnet_verifier,
@@ -107,6 +86,6 @@ impl GatewayVotePreparationConfig {
10786 . force_deployments_data
10887 . clone ( )
10988 . unwrap_or_default ( ) ,
110- } )
89+ }
11190 }
11291}
0 commit comments