Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
417 changes: 233 additions & 184 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ version = "26.0.0-rc.1"
# Dependencies from the rs-stellar-rpc-client repo:
[workspace.dependencies.soroban-rpc]
package = "stellar-rpc-client"
version = "26.0.0-rc.1"
version = "26.0.0-rc.2"

# Dependencies from elsewhere shared by crates:
[workspace.dependencies]
Expand Down Expand Up @@ -107,8 +107,6 @@ termcolor = "1.1.3"
termcolor_output = "1.0.1"
ed25519-dalek = ">= 2.1.1"
http = "1.0.0"
jsonrpsee-http-client = "0.20.1"
jsonrpsee-core = "0.20.1"
walkdir = "2.5.0"
toml_edit = "0.22.20"
toml = "0.8.19"
Expand Down
8 changes: 4 additions & 4 deletions cmd/crates/soroban-spec-typescript/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ pub fn generate(spec: &[ScSpecEntry]) -> String {
// Filter out function entries with names that start with "__" and partition the results
for entry in &collected {
match entry {
Entry::Function { name, inputs, .. } if name == "__constructor" => {
if !inputs.is_empty() {
constructor_args = Some(inputs.clone());
}
Entry::Function { name, inputs, .. }
if name == "__constructor" && !inputs.is_empty() =>
{
constructor_args = Some(inputs.clone());
}
_ => {}
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/crates/soroban-test/tests/it/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ fn build_no_error_for_package() {
let cargo_toml_path = dir_path.join("Cargo.toml");
let cargo_toml_path_content = std::fs::read_to_string(&cargo_toml_path).unwrap();
let modified_cargo_toml_content =
format!("{cargo_toml_path_content}\n[profile.release]\noverflow-checks = true\n",);
format!("{cargo_toml_path_content}\n[profile.release]\noverflow-checks = true\n");
std::fs::write(&cargo_toml_path, modified_cargo_toml_content).unwrap();

sandbox
Expand Down Expand Up @@ -876,7 +876,7 @@ fn build_errors_when_overflow_check_only_applied_to_members() {
let member_cargo_toml_path = dir_path.join("contracts").join("add").join("Cargo.toml");
let member_cargo_toml_content = std::fs::read_to_string(&member_cargo_toml_path).unwrap();
let modified_member_content =
format!("{member_cargo_toml_content}\n[profile.release]\noverflow-checks = true\n",);
format!("{member_cargo_toml_content}\n[profile.release]\noverflow-checks = true\n");
std::fs::write(&member_cargo_toml_path, modified_member_content).unwrap();

// Add overflow-checks = true to "add2" member
Expand All @@ -887,7 +887,7 @@ fn build_errors_when_overflow_check_only_applied_to_members() {
.join("Cargo.toml");
let member_2_cargo_toml_content = std::fs::read_to_string(&member_2_cargo_toml_path).unwrap();
let modified_member_2_content =
format!("{member_2_cargo_toml_content}\n[profile.release]\noverflow-checks = true\n",);
format!("{member_2_cargo_toml_content}\n[profile.release]\noverflow-checks = true\n");
std::fs::write(&member_2_cargo_toml_path, modified_member_2_content).unwrap();

sandbox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl Exchange for Emulator {
let resp: Response = HttpClient::new()
.post(&self.url)
.headers(headers)
.timeout(Duration::from_secs(60))
.timeout(Duration::from_mins(1))
.json(&request)
.send()
.await
Expand Down
2 changes: 0 additions & 2 deletions cmd/soroban-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ reqwest = { version = "0.12.7", default-features = false, features = [
"blocking",
"stream",
] }
jsonrpsee-http-client = "0.20.1"
jsonrpsee-core = "0.20.1"
regex = "1.6.0"
wasm-opt = { version = "0.116.1", optional = true }
chrono = { version = "0.4.27", features = ["serde"] }
Expand Down
3 changes: 1 addition & 2 deletions cmd/soroban-cli/src/commands/contract/arg_parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,7 @@ fn parse_argument_with_validation(
// unit variants — from_string in soroban-spec-tools handles both forms correctly.
let is_union_udt = if let ScSpecTypeDef::Udt(udt) = expected_type {
spec.find(&udt.name.to_utf8_string_lossy())
.map(|entry| matches!(entry, ScSpecEntry::UdtUnionV0(_)))
.unwrap_or(false)
.is_ok_and(|entry| matches!(entry, ScSpecEntry::UdtUnionV0(_)))
} else {
false
};
Expand Down
3 changes: 0 additions & 3 deletions cmd/soroban-cli/src/commands/contract/deploy/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ pub enum Error {
#[error("xdr processing error: {0}")]
Xdr(#[from] XdrError),

#[error("jsonrpc error: {0}")]
JsonRpc(#[from] jsonrpsee_core::Error),

#[error("cannot parse salt: {salt}")]
CannotParseSalt { salt: String },

Expand Down
7 changes: 2 additions & 5 deletions cmd/soroban-cli/src/commands/contract/init.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::borrow::Cow;
use std::{
fs::{create_dir_all, metadata, write, Metadata},
fs::{create_dir_all, metadata, write},
io,
path::{Path, PathBuf},
str,
Expand Down Expand Up @@ -158,10 +158,7 @@ impl Runner {
}

fn file_exists(file_path: &Path) -> bool {
metadata(file_path)
.as_ref()
.map(Metadata::is_file)
.unwrap_or(false)
metadata(file_path).is_ok_and(|m| m.is_file())
}

fn create_dir_all(path: &Path) -> Result<(), Error> {
Expand Down
3 changes: 0 additions & 3 deletions cmd/soroban-cli/src/commands/contract/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ pub enum Error {
#[error("xdr processing error: {0}")]
Xdr(#[from] XdrError),

#[error("jsonrpc error: {0}")]
JsonRpc(#[from] jsonrpsee_core::Error),

#[error(transparent)]
Rpc(#[from] rpc::Error),

Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async fn print_network(
"Network"
};

print.globeln(format!("{prefix} {name:?} ({})", network.rpc_url,));
print.globeln(format!("{prefix} {name:?} ({})", network.rpc_url));
print.blankln(format!("protocol {}", version_info.protocol_version));
print.blankln(format!("rpc {}", version_info.version));

Expand Down
14 changes: 6 additions & 8 deletions cmd/soroban-cli/src/commands/snapshot/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,12 @@ impl Cmd {
ScVal::ContractInstance(ScContractInstance {
executable: ContractExecutable::Wasm(hash),
..
}) => {
if !current.wasm_hashes.contains(hash) {
next.wasm_hashes.insert(hash.clone());
print.infoln(format!(
"Adding wasm {} to search",
hex::encode(hash)
));
}
}) if !current.wasm_hashes.contains(hash) => {
next.wasm_hashes.insert(hash.clone());
print.infoln(format!(
"Adding wasm {} to search",
hex::encode(hash)
));
}
ScVal::ContractInstance(ScContractInstance {
executable: ContractExecutable::StellarAsset,
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/config/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl std::fmt::Display for DatedAction {
.map_or_else(|| "SUCCESS".to_string(), |_| "ERROR".to_string()),
Action::Send { response } => response.status.clone(),
};
write!(f, "{id} {} {status} {datetime} {uri} ", a.type_str(),)
write!(f, "{id} {} {status} {datetime} {uri} ", a.type_str())
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/config/network.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use itertools::Itertools;
use jsonrpsee_http_client::HeaderMap;
use phf::phf_map;
use reqwest::header::HeaderMap;
use reqwest::header::{HeaderName, HeaderValue, InvalidHeaderName, InvalidHeaderValue};
use serde::{Deserialize, Serialize};
use serde_json::Value;
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/config/upgrade_check.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::config::locator;
use chrono::{DateTime, Utc};
use jsonrpsee_core::Serialize;
use semver::Version;
use serde::Deserialize;
use serde::Serialize;
use serde_json;
use std::fs;

Expand Down
6 changes: 3 additions & 3 deletions cmd/soroban-cli/src/log/cost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ impl Debug for Cost<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
// TODO: Should we output the footprint here?
writeln!(f, "==================== Cost ====================")?;
writeln!(f, "CPU used: {}", self.0.instructions,)?;
writeln!(f, "Bytes read: {}", self.0.disk_read_bytes,)?;
writeln!(f, "Bytes written: {}", self.0.write_bytes,)?;
writeln!(f, "CPU used: {}", self.0.instructions)?;
writeln!(f, "Bytes read: {}", self.0.disk_read_bytes)?;
writeln!(f, "Bytes written: {}", self.0.write_bytes)?;
writeln!(f, "==============================================")?;
Ok(())
}
Expand Down
18 changes: 8 additions & 10 deletions cmd/soroban-cli/src/log/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,15 @@ pub fn contract_with_spec(events: &[DiagnosticEvent], print: &Print, spec: Optio
},
in_successful_contract_call,
..
} => {
if topics[0] == xdr::ScVal::Symbol(str_to_sc_symbol("log")) {
let status = if in_successful_contract_call {
"Success"
} else {
"Failure"
};
} if topics[0] == xdr::ScVal::Symbol(str_to_sc_symbol("log")) => {
let status = if in_successful_contract_call {
"Success"
} else {
"Failure"
};

let data = serde_json::to_string(&data).unwrap();
print.logln(format!("{contract_id} - {status} - Log: {data}"));
}
let data = serde_json::to_string(&data).unwrap();
print.logln(format!("{contract_id} - {status} - Log: {data}"));
Comment thread
fnando marked this conversation as resolved.
Outdated
}

_ => {}
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/signer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ impl Signer {
TransactionEnvelope::Tx(TransactionV1Envelope { tx, signatures }) => {
let tx_hash = transaction_hash(tx, &network.network_passphrase)?;
self.print
.infoln(format!("Signing transaction: {}", hex::encode(tx_hash),));
.infoln(format!("Signing transaction: {}", hex::encode(tx_hash)));
let decorated_signature = self.sign_tx_hash(tx_hash, tx_env, network).await?;
let mut sigs = signatures.clone().into_vec();
sigs.push(decorated_signature);
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/upgrade_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::error::Error;
use std::io::IsTerminal;
use std::time::Duration;

const MINIMUM_CHECK_INTERVAL: Duration = Duration::from_secs(60 * 60 * 24); // 1 day
const MINIMUM_CHECK_INTERVAL: Duration = Duration::from_hours(24); // 1 day
const CRATES_IO_API_URL: &str = "https://crates.io/api/v1/crates/";
const NO_UPDATE_CHECK_ENV_VAR: &str = "STELLAR_NO_UPDATE_CHECK";

Expand Down
3 changes: 1 addition & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ yanked = "warn"
ignore = [
"RUSTSEC-2024-0436", # paste is no longer maintained
"RUSTSEC-2025-0052", # async-std has been discontinued - used only in test dependencies
"RUSTSEC-2025-0134", # rustls-pemfile has been discontinued - need to update stellar-rpc-client with compatible jsonrpsee (possible other deps too)
"RUSTSEC-2026-0097", # rand 0.8.5 unsound advisory - currently present in Cargo.lock via transitive dependencies such as ark-std and soroban-env-host
"RUSTSEC-2026-0097", # rand 0.8.5 unsound advisory - currently present in Cargo.lock via transitive dependencies such as ark-std and soroban-env-host
]
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
# lower than the range specified will be ignored. Note that ignored advisories
Expand Down
Loading