Skip to content

Commit

Permalink
Update RPC URL environment variable
Browse files Browse the repository at this point in the history
Replaced INFURA_API_KEY with MAINNET_RPC_URL for consistency and clarity. Updated the test setup to use the new MAINNET_RPC_URL for fetching the RPC URL from the environment variables.
  • Loading branch information
shuhuiluo committed Sep 1, 2024
1 parent 3a91457 commit a40d25b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}

jobs:
lint:
Expand Down
7 changes: 1 addition & 6 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ use once_cell::sync::Lazy;
pub(crate) static BLOCK_NUMBER: Lazy<BlockId> = Lazy::new(|| BlockId::from(17000000));
pub(crate) static RPC_URL: Lazy<Url> = Lazy::new(|| {
dotenv().ok();
format!(
"https://mainnet.infura.io/v3/{}",
std::env::var("INFURA_API_KEY").unwrap()
)
.parse()
.unwrap()
std::env::var("MAINNET_RPC_URL").unwrap().parse().unwrap()
});
pub(crate) static PROVIDER: Lazy<ReqwestProvider> =
Lazy::new(|| ProviderBuilder::new().on_http(RPC_URL.clone()));

0 comments on commit a40d25b

Please sign in to comment.