Skip to content

Commit

Permalink
fix: remove references to self.config
Browse files Browse the repository at this point in the history
If a config is passed in run_against_rpc_server, it should be used instead of self.config
  • Loading branch information
willemneal committed Apr 16, 2024
1 parent 36ff841 commit 178d088
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/soroban-cli/src/commands/contract/invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ impl Cmd {
&self,
contract_id: [u8; 32],
spec_entries: &[ScSpecEntry],
config: &config::Args,
) -> Result<(String, Spec, InvokeContractArgs, Vec<SigningKey>), Error> {
let spec = Spec(Some(spec_entries.to_vec()));
let mut cmd = clap::Command::new(self.contract_id.clone())
Expand Down Expand Up @@ -203,7 +204,7 @@ impl Cmd {
let cmd = crate::commands::keys::address::Cmd {
name: s.clone(),
hd_path: Some(0),
locator: self.config.locator.clone(),
locator: config.locator.clone(),
};
if let Ok(address) = cmd.public_key() {
s = address.to_string();
Expand Down Expand Up @@ -319,7 +320,7 @@ impl NetworkRunnable for Cmd {
let spec_entries = self.spec_entries()?;
if let Some(spec_entries) = &spec_entries {
// For testing wasm arg parsing
let _ = self.build_host_function_parameters(contract_id, spec_entries)?;
let _ = self.build_host_function_parameters(contract_id, spec_entries, config)?;
}
let client = rpc::Client::new(&network.rpc_url)?;
let account_details = if self.is_view {
Expand Down Expand Up @@ -368,7 +369,7 @@ impl NetworkRunnable for Cmd {

// Get the ledger footprint
let (function, spec, host_function_params, signers) =
self.build_host_function_parameters(contract_id, &spec_entries)?;
self.build_host_function_parameters(contract_id, &spec_entries, config)?;
let tx = build_invoke_contract_tx(
host_function_params.clone(),
sequence + 1,
Expand Down Expand Up @@ -396,7 +397,7 @@ impl NetworkRunnable for Cmd {
let res = client
.send_assembled_transaction(
txn,
&self.config.key_pair()?,
&config.key_pair()?,
&signers,
&network.network_passphrase,
Some(log_events),
Expand Down

0 comments on commit 178d088

Please sign in to comment.