Skip to content

Commit a3f717a

Browse files
authored
Move sepolia URL to constants (#2185)
## Introduced changes <!-- A brief description of the changes --> Reverts changes with .env being required in `cast`, move it to constants. Was needed since contributor PRs are failing because of this ## Checklist <!-- Make sure all of these are complete --> - [x] Linked relevant issue - [x] Updated relevant documentation - [x] Added relevant tests - [ ] Performed self-review of the code - [x] Added changes to `CHANGELOG.md`
1 parent 0af6d8b commit a3f717a

File tree

9 files changed

+4
-33
lines changed

9 files changed

+4
-33
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,7 @@ jobs:
9494
- uses: software-mansion/[email protected]
9595
- uses: software-mansion/setup-universal-sierra-compiler@v1
9696
- name: Run tests
97-
env:
98-
NODE_URL: ${{ secrets.NODE_URL }}
99-
run: |
100-
SEPOLIA_RPC_URL="${NODE_URL}:7070/rpc/v0_7" cargo test --release -p sncast
97+
run: cargo test --release -p sncast
10198

10299
test-conversions:
103100
name: Test Conversions

Cargo.lock

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ tokio-util = "0.7.9"
7474
futures = "0.3.30"
7575
num-bigint = { version = "0.4.4", features = ["rand"] }
7676
walkdir = "2.5.0"
77-
dotenv = "0.15.0"
7877
rand = "0.8.5"
7978
project-root = "0.2.2"
8079
which = "5.0.0"

crates/sncast/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ project-root.workspace = true
5555
tempfile.workspace = true
5656
test-case.workspace = true
5757
fs_extra.workspace = true
58-
dotenv.workspace = true
5958

6059
[[bin]]
6160
name = "sncast"

crates/sncast/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,3 @@ $HOME/.asdf/shims/scarb
145145
```
146146

147147
If you previously installed scarb using official installer, you may need to remove this installation or modify your PATH to make sure asdf installed one is always used.
148-
149-
To run `sncast` tests, it is required to set `SEPOLIA_RPC_URL` environment variable, which is
150-
used to fork the Sepolia testnet network in the devnet tests. This variable can be set in the `.env` file.

crates/sncast/tests/helpers/constants.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pub const ACCOUNT: &str = "user1";
22
pub const ACCOUNT_FILE_PATH: &str = "tests/data/accounts/accounts.json";
3+
pub const SEPOLIA_RPC_URL: &str = "http://188.34.188.184:7070/rpc/v0_7";
34

45
pub const URL: &str = "http://127.0.0.1:5055/rpc";
56
pub const NETWORK: &str = "testnet";

crates/sncast/tests/helpers/devnet.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use crate::helpers::constants::{FORK_BLOCK_NUMBER, SEED, URL};
1+
use crate::helpers::constants::{FORK_BLOCK_NUMBER, SEED, SEPOLIA_RPC_URL, URL};
22
use crate::helpers::fixtures::{
33
deploy_argent_account, deploy_braavos_account, deploy_cairo_0_account, deploy_keystore_account,
4-
from_env,
54
};
65
use ctor::{ctor, dtor};
76
use std::net::TcpStream;
@@ -33,10 +32,6 @@ fn start_devnet() {
3332
}
3433
}
3534

36-
dotenv::dotenv().ok();
37-
let sepolia_rpc_url =
38-
from_env("SEPOLIA_RPC_URL").expect("Failed to get SEPOLIA_RPC_URL environment variable");
39-
4035
Command::new("tests/utils/devnet/starknet-devnet")
4136
.args([
4237
"--port",
@@ -46,7 +41,7 @@ fn start_devnet() {
4641
"--state-archive-capacity",
4742
"full",
4843
"--fork-network",
49-
&sepolia_rpc_url,
44+
SEPOLIA_RPC_URL,
5045
"--fork-block",
5146
&FORK_BLOCK_NUMBER.to_string(),
5247
"--initial-balance",

crates/sncast/tests/helpers/fixtures.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,6 @@ pub fn get_deps_map_from_paths(
448448
deps
449449
}
450450

451-
pub fn from_env(name: &str) -> Result<String, String> {
452-
match env::var(name) {
453-
Ok(value) => Ok(value),
454-
Err(_) => Err(format!("Variable {name} not available in env!")),
455-
}
456-
}
457-
458451
pub fn get_address_from_keystore(
459452
keystore_path: impl AsRef<std::path::Path>,
460453
account_path: impl AsRef<std::path::Path>,

docs/src/development/environment-setup.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ Please make sure you're using Scarb installed via [asdf](https://asdf-vm.com/) -
4343
### Starknet Devnet
4444
To install it run `./scripts/install_devnet.sh`
4545
46-
To run `sncast` tests, it is required to set `SEPOLIA_RPC_URL` environment variable, which is
47-
used to fork the Sepolia testnet network in the devnet tests. This variable can be set in the `.env` file.
48-
4946
### Universal sierra compiler
5047
Install the latest [universal-sierra-compiler](https://github.com/software-mansion/universal-sierra-compiler) version.
5148

0 commit comments

Comments
 (0)