From c6e5ba26feca6de0d99b12d385df438cabd39fee Mon Sep 17 00:00:00 2001 From: Elizabeth Engelman <4752801+elizabethengelman@users.noreply.github.com> Date: Fri, 20 Sep 2024 16:37:05 -0400 Subject: [PATCH] Use --rpc-header in the rest of the commands --- cmd/crates/soroban-test/src/lib.rs | 1 + cmd/soroban-cli/src/config/network.rs | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/crates/soroban-test/src/lib.rs b/cmd/crates/soroban-test/src/lib.rs index 544e2d59e..373606c67 100644 --- a/cmd/crates/soroban-test/src/lib.rs +++ b/cmd/crates/soroban-test/src/lib.rs @@ -224,6 +224,7 @@ impl TestEnv { config::Args { network: network::Args { rpc_url: Some(self.rpc_url.clone()), + rpc_header: None, network_passphrase: Some(LOCAL_NETWORK_PASSPHRASE.to_string()), network: None, }, diff --git a/cmd/soroban-cli/src/config/network.rs b/cmd/soroban-cli/src/config/network.rs index 32699900c..a395fd9c4 100644 --- a/cmd/soroban-cli/src/config/network.rs +++ b/cmd/soroban-cli/src/config/network.rs @@ -47,6 +47,14 @@ pub struct Args { help_heading = HEADING_RPC, )] pub rpc_url: Option, + /// Optional RPC provider api key headers + #[arg( + long = "rpc-header", + requires = "rpc_url", + env = "STELLAR_RPC_HEADER", + help_heading = HEADING_RPC, + )] + pub rpc_header: Option, /// Network passphrase to sign the transaction sent to the rpc server #[arg( long = "network-passphrase", @@ -79,7 +87,7 @@ impl Args { { Ok(Network { rpc_url, - rpc_header: None, //todo: fix me + rpc_header: self.rpc_header.clone(), network_passphrase, }) } else {