Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endif
REPOSITORY_BRANCH := "$(shell git rev-parse --abbrev-ref HEAD)"
BUILD_TIMESTAMP ?= $(shell date '+%Y-%m-%dT%H:%M:%S')

SOROBAN_PORT?=8000
STELLAR_PORT?=8000

# The following works around incompatibility between the rust and the go linkers -
# the rust would generate an object file with min-version of 13.0 where-as the go
Expand Down Expand Up @@ -52,7 +52,7 @@ test: build-test
cargo test --workspace --exclude soroban-test --features additional-libs
cargo test -p soroban-test -- --skip integration::

# expects a quickstart container running with the rpc exposed at localhost:SOROBAN_PORT
# expects a quickstart container running with the rpc exposed at localhost:STELLAR_PORT
rpc-test:
cargo test --features it --test it -- integration --test-threads=4

Expand Down
11 changes: 4 additions & 7 deletions cmd/crates/soroban-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,10 @@ impl TestEnv {
}

pub fn new() -> TestEnv {
if let Ok(rpc_url) = std::env::var("SOROBAN_RPC_URL") {
return Self::with_rpc_url(&rpc_url);
}
if let Ok(rpc_url) = std::env::var("STELLAR_RPC_URL") {
return Self::with_rpc_url(&rpc_url);
}
let host_port = std::env::var("SOROBAN_PORT")
let host_port = std::env::var("STELLAR_PORT")
.as_deref()
.ok()
.and_then(|n| n.parse().ok())
Expand All @@ -159,9 +156,9 @@ impl TestEnv {
let mut cmd: Command = self.bin();

cmd.arg(subcommand)
.env("SOROBAN_ACCOUNT", TEST_ACCOUNT)
.env("SOROBAN_RPC_URL", &self.network.rpc_url)
.env("SOROBAN_NETWORK_PASSPHRASE", LOCAL_NETWORK_PASSPHRASE)
.env("STELLAR_ACCOUNT", TEST_ACCOUNT)
.env("STELLAR_RPC_URL", &self.network.rpc_url)
.env("STELLAR_NETWORK_PASSPHRASE", LOCAL_NETWORK_PASSPHRASE)
.env("XDG_CONFIG_HOME", self.dir().join("config").as_os_str())
.env("XDG_DATA_HOME", self.data_dir().as_os_str())
.current_dir(self.dir());
Expand Down
6 changes: 3 additions & 3 deletions cmd/crates/soroban-test/tests/it/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ fn use_env() {
sandbox
.new_assert_cmd("keys")
.env(
"SOROBAN_SECRET_KEY",
"STELLAR_SECRET_KEY",
"SDIY6AQQ75WMD4W46EYB7O6UYMHOCGQHLAQGQTKHDX4J2DYQCHVCQYFD",
)
.arg("add")
Expand All @@ -225,7 +225,7 @@ fn set_default_identity() {
sandbox
.new_assert_cmd("keys")
.env(
"SOROBAN_SECRET_KEY",
"STELLAR_SECRET_KEY",
"SC4ZPYELVR7S7EE7KZDZN3ETFTNQHHLTUL34NUAAWZG5OK2RGJ4V2U3Z",
)
.arg("add")
Expand All @@ -245,7 +245,7 @@ fn set_default_identity() {

sandbox
.new_assert_cmd("env")
.env_remove("SOROBAN_ACCOUNT")
.env_remove("STELLAR_ACCOUNT")
.assert()
.stdout(predicate::str::contains("STELLAR_ACCOUNT=alice"))
.success();
Expand Down
2 changes: 1 addition & 1 deletion cmd/crates/soroban-test/tests/it/integration/cookbook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ fn run_command(
let mut assert = sandbox
.new_assert_cmd(&cmd)
// Cookbook tests are responsible for setting a source account.
.env_remove("SOROBAN_ACCOUNT")
.env_remove("STELLAR_ACCOUNT")
.args(&modified_args)
.assert();
eprintln!("{}", assert.stderr_as_str());
Expand Down
6 changes: 3 additions & 3 deletions cmd/crates/soroban-test/tests/it/integration/dotenv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::util::deploy_hello;

fn write_env_file(e: &TestEnv, contents: &str) {
let env_file = e.dir().join(".env");
let contents = format!("SOROBAN_CONTRACT_ID={contents}");
let contents = format!("STELLAR_CONTRACT_ID={contents}");
std::fs::write(&env_file, &contents).unwrap();
assert_eq!(contents, std::fs::read_to_string(env_file).unwrap());
}
Expand Down Expand Up @@ -33,7 +33,7 @@ async fn current_env_not_overwritten() {
write_env_file(&e, &deploy_hello(&e).await);
e.new_assert_cmd("contract")
.env(
"SOROBAN_CONTRACT_ID",
"STELLAR_CONTRACT_ID",
"CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4",
)
.arg("invoke")
Expand All @@ -54,7 +54,7 @@ async fn cli_args_have_priority() {
write_env_file(e, &id);
e.new_assert_cmd("contract")
.env(
"SOROBAN_CONTRACT_ID",
"STELLAR_CONTRACT_ID",
"CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4",
)
.arg("invoke")
Expand Down
6 changes: 5 additions & 1 deletion cmd/soroban-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ pub async fn main() {
// Map SOROBAN_ env vars to STELLAR_ env vars for backwards compatibility
// with the soroban-cli prior to when the stellar-cli was released.
//
let vars = env_vars::unprefixed();
let mut vars = env_vars::unprefixed();

// Manually add SECRET_KEY so it doesn't leak on `stellar env`.
vars.push("SECRET_KEY");

for var in vars {
let soroban_key = format!("SOROBAN_{var}");
let stellar_key = format!("STELLAR_{var}");
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/keys/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Cmd {
}

fn read_secret(&self, print: &Print) -> Result<Secret, Error> {
if let Ok(secret_key) = std::env::var("SOROBAN_SECRET_KEY") {
if let Ok(secret_key) = std::env::var("STELLAR_SECRET_KEY") {
Ok(Secret::SecretKey { secret_key })
} else if self.secrets.secure_store {
let prompt = "Type a 12/24 word seed phrase:";
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/config/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub enum Error {
HomeDirNotFound,
#[error("Failed read current directory")]
CurrentDirNotFound,
#[error("Failed read current directory and no SOROBAN_CONFIG_HOME is set")]
#[error("Failed read current directory and no STELLAR_CONFIG_HOME is set")]
NoConfigEnvVar,
#[error("Failed to create directory: {path:?}")]
DirCreationFailed { path: PathBuf },
Expand Down
Loading