diff --git a/Cargo.lock b/Cargo.lock index 1f25cd1bc..3a08669a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1840,3 +1840,15 @@ name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + +[[patch.unused]] +name = "soroban-env-common" +version = "21.0.2" + +[[patch.unused]] +name = "soroban-env-guest" +version = "21.0.2" + +[[patch.unused]] +name = "soroban-env-host" +version = "21.0.2" diff --git a/Cargo.toml b/Cargo.toml index 4455ba837..cb66b957e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,10 +48,10 @@ features = ["curr"] # git = "https://github.com/stellar/rs-stellar-xdr" # rev = "d0138770652a615e3cd99447f2f2727658c17450" -#[patch."https://github.com/stellar/rs-soroban-env"] -#soroban-env-common = { path = "../rs-soroban-env/soroban-env-common" } -#soroban-env-guest = { path = "../rs-soroban-env/soroban-env-guest" } -#soroban-env-host = { path = "../rs-soroban-env/soroban-env-host/" } +[patch."https://github.com/stellar/rs-soroban-env"] +soroban-env-common = { path = "../rs-soroban-env/soroban-env-common" } +soroban-env-guest = { path = "../rs-soroban-env/soroban-env-guest" } +soroban-env-host = { path = "../rs-soroban-env/soroban-env-host/" } #[patch."https://github.com/stellar/rs-stellar-xdr"] #stellar-xdr = { path = "../rs-stellar-xdr/" } diff --git a/soroban-sdk/Cargo.toml b/soroban-sdk/Cargo.toml index 15b8aaef2..717cc89fe 100644 --- a/soroban-sdk/Cargo.toml +++ b/soroban-sdk/Cargo.toml @@ -48,6 +48,7 @@ proptest = "1.2.0" proptest-arbitrary-interop = "0.1.0" [features] +std = [] alloc = [] testutils = ["soroban-sdk-macros/testutils", "soroban-env-host/testutils", "dep:ed25519-dalek", "dep:arbitrary", "dep:ctor"] docs = [] diff --git a/soroban-sdk/src/lib.rs b/soroban-sdk/src/lib.rs index 18ddb6a4a..fed4c91c4 100644 --- a/soroban-sdk/src/lib.rs +++ b/soroban-sdk/src/lib.rs @@ -48,7 +48,7 @@ compile_error!("'testutils' feature is not supported on 'wasm' target"); // When used in a no_std contract, provide a panic handler as one is required. -#[cfg(all(not(feature = "alloc"), target_family = "wasm"))] +#[cfg(all(not(feature = "alloc"), not(feature = "std"), target_family = "wasm"))] #[panic_handler] fn handle_panic(_: &core::panic::PanicInfo) -> ! { core::arch::wasm32::unreachable() diff --git a/soroban-sdk/src/symbol.rs b/soroban-sdk/src/symbol.rs index 7f11fd3be..b52ff0e93 100644 --- a/soroban-sdk/src/symbol.rs +++ b/soroban-sdk/src/symbol.rs @@ -5,10 +5,10 @@ use super::{ ConversionError, Env, TryFromVal, TryIntoVal, Val, }; -#[cfg(not(target_family = "wasm"))] +//#[cfg(not(target_family = "wasm"))] use super::env::SymbolStr; -#[cfg(not(target_family = "wasm"))] +//#[cfg(not(target_family = "wasm"))] use crate::env::internal::xdr::{ScSymbol, ScVal}; use crate::{ env::MaybeEnv, @@ -135,7 +135,7 @@ impl TryFromVal for Symbol { } } -#[cfg(not(target_family = "wasm"))] +//#[cfg(not(target_family = "wasm"))] impl TryFrom<&Symbol> for ScVal { type Error = ConversionError; fn try_from(v: &Symbol) -> Result { @@ -148,7 +148,7 @@ impl TryFrom<&Symbol> for ScVal { } } -#[cfg(not(target_family = "wasm"))] +//#[cfg(not(target_family = "wasm"))] impl TryFrom for ScVal { type Error = ConversionError; fn try_from(v: Symbol) -> Result { @@ -156,7 +156,7 @@ impl TryFrom for ScVal { } } -#[cfg(not(target_family = "wasm"))] +//#[cfg(not(target_family = "wasm"))] impl TryFromVal for ScVal { type Error = ConversionError; fn try_from_val(_e: &Env, v: &Symbol) -> Result { @@ -164,7 +164,7 @@ impl TryFromVal for ScVal { } } -#[cfg(not(target_family = "wasm"))] +//#[cfg(not(target_family = "wasm"))] impl TryFromVal for Symbol { type Error = ConversionError; fn try_from_val(env: &Env, val: &ScVal) -> Result { @@ -174,7 +174,7 @@ impl TryFromVal for Symbol { } } -#[cfg(not(target_family = "wasm"))] +//#[cfg(not(target_family = "wasm"))] impl TryFromVal for Symbol { type Error = ConversionError; fn try_from_val(env: &Env, val: &ScSymbol) -> Result {