-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove bridge addr constants and parameterize them
- Loading branch information
1 parent
066a86d
commit 81d486e
Showing
8 changed files
with
58 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use aligned_sdk::core::types::Chain; | ||
|
||
use super::constants::{ | ||
ALIGNED_SM_DEVNET_ETH_ADDR, BRIDGE_ACCOUNT_DEVNET_ETH_ADDR, BRIDGE_DEVNET_ETH_ADDR, | ||
}; | ||
|
||
pub fn get_bridge_contract_addr(chain: &Chain) -> Result<String, String> { | ||
match chain { | ||
Chain::Devnet => Ok(BRIDGE_DEVNET_ETH_ADDR.to_owned()), | ||
Chain::Holesky => std::env::var("BRIDGE_HOLESKY_ETH_ADDR") | ||
.map_err(|err| format!("Error getting Bridge contract address: {err}")), | ||
_ => Err("Unimplemented Ethereum contract on selected chain".to_owned()), | ||
} | ||
} | ||
|
||
pub fn get_account_validation_contract_addr(chain: &Chain) -> Result<String, String> { | ||
match chain { | ||
Chain::Devnet => Ok(BRIDGE_ACCOUNT_DEVNET_ETH_ADDR.to_owned()), | ||
Chain::Holesky => std::env::var("BRIDGE_ACCOUNT_HOLESKY_ETH_ADDR") | ||
.map_err(|err| format!("Error getting Account validation contract address: {err}")), | ||
_ => Err("Unimplemented Ethereum contract on selected chain".to_owned()), | ||
} | ||
} | ||
|
||
pub fn get_aligned_sm_contract_addr(chain: &Chain) -> Result<String, String> { | ||
match chain { | ||
Chain::Devnet => Ok(ALIGNED_SM_DEVNET_ETH_ADDR.to_owned()), | ||
Chain::Holesky => std::env::var("ALIGNED_SM_HOLESKY_ETH_ADDR") | ||
.map_err(|err| format!("Error getting Aligned SM contract address: {err}")), | ||
_ => Err("Unimplemented Ethereum contract on selected chain".to_owned()), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod constants; | ||
pub mod contract; | ||
pub mod env; | ||
pub mod wallet; | ||
pub mod wallet_alloy; |