Skip to content
Draft
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
1,841 changes: 1,187 additions & 654 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ keywords = ["soroban", "stellar", "blockchain", "smart-contracts", "testing"]
syn = { version = "2.0", features = ["full"] }
quote = "1.0"
proc-macro2 = "1.0"
soroban-sdk = "23.0.2"
tokio = { version = "1.43.0", features = ["full"] }
stellar-rpc-client = "23.0.1"
stellar-xdr = { version = "23.0.0", features = ["serde", "serde_json"] }
stellar-strkey = "0.0.13"
soroban-sdk = "25.1.0"
tokio = { version = "1.51.0", features = ["rt", "net", "io-util", "time", "macros", "sync"] }
stellar-rpc-client = { git = "https://github.com/warp-driver/rs-stellar-rpc-client", rev="2d081ec7b91406194ce875d0c6d23a8af179d169" } # branch = "wasip2-support"
stellar-xdr = { version = "25.0.0", features = ["serde", "serde_json"] }
stellar-strkey = "0.0.16"
ed25519-dalek = "2.1.1"
sha2 = "0.10.8"
rand = "0.9.0"
Expand All @@ -37,4 +37,4 @@ tempfile = "3.10.1"
# members
soroban-test-helpers = { path = "crates/soroban-test-helpers" }
soroban-rs = { path = "crates/soroban-rs" }
soroban-rs-macros = { path = "crates/soroban-rs-macros", version = "0.2.3" }
soroban-rs-macros = { path = "crates/soroban-rs-macros", version = "0.2.3" }
2 changes: 1 addition & 1 deletion crates/soroban-rs/examples/create_multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use soroban_rs::{Account, AccountConfig, Env, EnvConfigs, Signer};
use std::{env, path::Path};
use stellar_strkey::ed25519::PrivateKey;

#[tokio::main]
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
from_path(Path::new("examples/.env")).ok();

Expand Down
2 changes: 1 addition & 1 deletion crates/soroban-rs/examples/deploy_and_invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use stellar_strkey::ed25519::PrivateKey;
// generates TokenMockClient binding TokenMock contract.
soroban!("fixtures/lib.rs");

#[tokio::main]
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn Error>> {
from_path(Path::new("examples/.env")).ok();

Expand Down
2 changes: 1 addition & 1 deletion crates/soroban-rs/examples/invoke_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use stellar_strkey::{ed25519::PrivateKey, Contract as ContractId};
// generates TokenMockClient binding TokenMock contract.
soroban!("fixtures/lib.rs");

#[tokio::main]
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
from_path(Path::new("examples/.env")).ok();

Expand Down
2 changes: 1 addition & 1 deletion crates/soroban-rs/src/guard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl AuthorizedCallsForContract {
fn count_authorized_calls(&self, invocation: &SorobanAuthorizedInvocation) -> u16 {
let mut count = 0;
if let SorobanAuthorizedFunction::ContractFn(args) = &invocation.function {
if args.contract_address.to_string() == self.contract_id.to_string() {
if args.contract_address.to_string() == self.contract_id.to_string().as_str() {
count += 1;
}
}
Expand Down
4 changes: 4 additions & 0 deletions crates/soroban-rs/src/mock/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ fn mock_transaction_response_impl(response_type: MockResponseType) -> GetTransac
result: Some(create_success_tx_result()),
result_meta: None,
ledger: None,
application_order: None,
fee_bump: None,
tx_hash: None,
created_at: None,
events: stellar_rpc_client::GetTransactionEvents {
contract_events: vec![],
diagnostic_events: vec![],
Expand Down
12 changes: 12 additions & 0 deletions crates/soroban-rs/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ mod tests {
result: None, // This is what we're testing - no result
result_meta: None,
ledger: None,
application_order: None,
fee_bump: None,
tx_hash: None,
created_at: None,
events: stellar_rpc_client::GetTransactionEvents {
contract_events: vec![],
diagnostic_events: vec![],
Expand Down Expand Up @@ -315,6 +319,10 @@ mod tests {
envelope: None,
result_meta: None,
ledger: None,
application_order: None,
fee_bump: None,
tx_hash: None,
created_at: None,
result: Some(TransactionResult {
fee_charged: 100,
result: TransactionResultResult::TxSuccess(vec![].try_into().unwrap()),
Expand Down Expand Up @@ -360,6 +368,10 @@ mod tests {
status: "SUCCESS".to_string(),
envelope: None,
ledger: None,
application_order: None,
fee_bump: None,
tx_hash: None,
created_at: None,
result: Some(TransactionResult {
fee_charged: 100,
result: TransactionResultResult::TxSuccess(vec![].try_into().unwrap()),
Expand Down
20 changes: 20 additions & 0 deletions crates/soroban-rs/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ mod tests {
result: None,
result_meta: None,
ledger: None,
application_order: None,
fee_bump: None,
tx_hash: None,
created_at: None,
events: stellar_rpc_client::GetTransactionEvents {
contract_events: vec![],
diagnostic_events: vec![],
Expand Down Expand Up @@ -209,6 +213,10 @@ mod tests {
result: Some(transaction_result),
result_meta: Some(TransactionMeta::V3(meta_v3)),
ledger: Some(123456), // Example ledger number
application_order: None,
fee_bump: None,
tx_hash: None,
created_at: None,
events: stellar_rpc_client::GetTransactionEvents {
contract_events: vec![],
diagnostic_events: vec![],
Expand Down Expand Up @@ -244,6 +252,10 @@ mod tests {
result: None,
result_meta: None,
ledger: None,
application_order: None,
fee_bump: None,
tx_hash: None,
created_at: None,
events: stellar_rpc_client::GetTransactionEvents {
contract_events: vec![],
diagnostic_events: vec![],
Expand Down Expand Up @@ -294,6 +306,10 @@ mod tests {
result: None,
result_meta: None,
ledger: None,
application_order: None,
fee_bump: None,
tx_hash: None,
created_at: None,
events: stellar_rpc_client::GetTransactionEvents {
contract_events: vec![],
diagnostic_events: vec![],
Expand Down Expand Up @@ -342,6 +358,10 @@ mod tests {
result: Some(transaction_result),
result_meta: Some(TransactionMeta::V3(meta_v3)),
ledger: Some(123456), // Example ledger number
application_order: None,
fee_bump: None,
tx_hash: None,
created_at: None,
events: stellar_rpc_client::GetTransactionEvents {
contract_events: vec![],
diagnostic_events: vec![],
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.85.0"
channel = "1.94.0"
components = ["rustfmt", "clippy"]
17 changes: 17 additions & 0 deletions test_wasi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail

echo "=== Native build ==="
cargo check -p soroban-rs

echo ""
echo "=== Native tests ==="
cargo test -p soroban-rs

echo ""
echo "=== wasip2 build with tls-rustcrypto ==="
rustup target add wasm32-wasip2
RUSTFLAGS="--cfg tokio_unstable" cargo build --target wasm32-wasip2 -p soroban-rs

echo ""
echo "All checks passed."