-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
72 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: "Changelog Workflow" | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] | ||
branches: [main] | ||
|
||
jobs: | ||
# Enforces the update of a changelog file on every pull request | ||
# skipLabel default is "Skip-Changelog" | ||
changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dangoslen/changelog-enforcer@v3 |
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,13 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). | ||
|
||
## Added | ||
|
||
## Changed | ||
|
||
## Removed | ||
|
||
## Fixed |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -1,19 +1,40 @@ | ||
use std::str::FromStr; | ||
use std::{env, path::Path}; | ||
|
||
use alloy::signers::wallet::LocalWallet; | ||
use alloy::{network::Ethereum, providers::ProviderBuilder, rpc::client::RpcClient}; | ||
use async_trait::async_trait; | ||
use c_kzg::KzgSettings; | ||
use da_client_interface::DaConfig; | ||
use url::Url; | ||
use utils::env_utils::get_env_var_or_panic; | ||
|
||
use crate::EthereumDaClient; | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct EthereumDaConfig { | ||
pub rpc_url: String, | ||
pub memory_pages_contract: String, | ||
pub private_key: String, | ||
} | ||
|
||
impl DaConfig for EthereumDaConfig { | ||
#[async_trait] | ||
impl DaConfig<EthereumDaClient> for EthereumDaConfig { | ||
fn new_from_env() -> Self { | ||
Self { | ||
rpc_url: get_env_var_or_panic("ETHEREUM_RPC_URL"), | ||
memory_pages_contract: get_env_var_or_panic("MEMORY_PAGES_CONTRACT_ADDRESS"), | ||
private_key: get_env_var_or_panic("PRIVATE_KEY"), | ||
} | ||
} | ||
async fn build_client(&self) -> EthereumDaClient { | ||
let client = | ||
RpcClient::new_http(Url::from_str(self.rpc_url.as_str()).expect("Failed to parse ETHEREUM_RPC_URL")); | ||
let provider = ProviderBuilder::<_, Ethereum>::new().on_client(client); | ||
let wallet: LocalWallet = env::var("PK").expect("PK must be set").parse().expect("issue while parsing"); | ||
// let wallet: LocalWallet = config.private_key.as_str().parse(); | ||
let trusted_setup = KzgSettings::load_trusted_setup_file(Path::new("./trusted_setup.txt")) | ||
.expect("issue while loading the trusted setup"); | ||
EthereumDaClient { provider, wallet, trusted_setup } | ||
} | ||
} |
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