Skip to content

Commit

Permalink
fix: improve arg name and don't use self.config
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Jul 30, 2024
1 parent 9c02bcf commit 2856eab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion cmd/soroban-cli/src/commands/contract/invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,13 @@ impl NetworkRunnable for Cmd {
config: Option<&config::Args>,
) -> Result<TxnResult<String>, Error> {
let config = config.unwrap_or(&self.config);
eprintln!(
"Invoking contract {} on config {config:#?}...",
self.contract_id
);
let network = config.get_network()?;
tracing::trace!(?network);
let contract_id = self.config.resolve_contract_id(&self.contract_id)?.0;
let contract_id = config.resolve_contract_id(&self.contract_id)?.0;
let spec_entries = self.spec_entries()?;
if let Some(spec_entries) = &spec_entries {
// For testing wasm arg parsing
Expand Down
1 change: 0 additions & 1 deletion cmd/soroban-cli/src/config/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ pub struct Args {

impl Args {
pub fn get(&self, locator: &locator::Args) -> Result<Network, Error> {
println!("{self:#?}");
if let Some(name) = self.network.as_deref() {
if let Ok(network) = locator.read_network(name) {
return Ok(network);
Expand Down
5 changes: 3 additions & 2 deletions cmd/soroban-cli/src/config/sign_with.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ impl Args {
pub async fn sign_soroban_authorizations(
&self,
tx: &Transaction,
ledgers_from_current: u32,
expiration_ledger: u32,
) -> Result<Option<Transaction>, Error> {
Ok(self
.signer()?
.sign_soroban_authorizations(tx, &self.get_network()?, ledgers_from_current)
.sign_soroban_authorizations(tx, &self.get_network()?, expiration_ledger)
.await?)
}

Expand All @@ -111,6 +111,7 @@ impl Args {
}

pub fn get_network(&self) -> Result<Network, Error> {
eprintln!("{self:#?}");
Ok(self.network.get(&self.locator)?)
}

Expand Down

0 comments on commit 2856eab

Please sign in to comment.