Skip to content

Commit

Permalink
Impl to env with deployer
Browse files Browse the repository at this point in the history
  • Loading branch information
lima-limon-inc committed Feb 21, 2025
1 parent b6c2bed commit 678a9c2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions crates/l2/utils/config/parse_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ struct Deployer {
sp1_deploy_verifier: bool,
}

impl Deployer {
pub fn to_env(&self) -> String {
let prefix = "DEPLOYER";
format!(
"
{prefix}_ADDRESS={},
{prefix}_PRIVATE_KEY={},
{prefix}_RISC0_CONTRACT_VERIFIER={},
{prefix}_SP1_CONTRACT_VERIFIER={},
{prefix}_SP1_DEPLOY_VERIFIER={},
",
self.address,
self.private_key,
self.risc0_contract_verifier,
self.sp1_contract_verifier,
self.sp1_deploy_verifier
)
}
}

#[derive(Deserialize, Debug)]
struct Eth {
rpc_url: String,
Expand Down Expand Up @@ -60,6 +80,12 @@ struct L2Config {
prover: Prover,
}

impl L2Config {
pub fn to_env(&self) {
println!("{}", self.deployer.to_env());
}
}

pub fn read_toml() {
println!("Hello ARGENTINA");
let file = std::fs::read_to_string("config.toml").unwrap();
Expand Down

0 comments on commit 678a9c2

Please sign in to comment.