diff --git a/Cargo.lock b/Cargo.lock index a63546cca6..7ab83180d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1194,7 +1194,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -2791,7 +2791,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.4", + "socket2 0.5.10", "system-configuration", "tokio", "tower-service", @@ -4305,7 +4305,7 @@ dependencies = [ "quinn-udp", "rustc-hash 2.1.1", "rustls", - "socket2 0.6.4", + "socket2 0.5.10", "thiserror 2.0.18", "tokio", "tracing", @@ -4342,7 +4342,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.4", + "socket2 0.5.10", "tracing", "windows-sys 0.60.2", ] @@ -5088,6 +5088,16 @@ dependencies = [ "syn 2.0.118", ] +[[package]] +name = "serde_ignored" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115dffd5f3853e06e746965a20dcbae6ee747ae30b543d91b0e089668bb07798" +dependencies = [ + "serde", + "serde_core", +] + [[package]] name = "serde_json" version = "1.0.150" @@ -5371,9 +5381,9 @@ dependencies = [ [[package]] name = "soroban-builtin-sdk-macros" -version = "27.0.1" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b77bc93d930032c487cb1506b6ed166b2af49db76d52678ec4887ac621ecce01" +checksum = "dc470cc875cbdeb5ffb0fcb45017803c94b65075d493f097304b132ab95f353c" dependencies = [ "itertools 0.13.0", "proc-macro2", @@ -5474,12 +5484,12 @@ dependencies = [ [[package]] name = "soroban-env-common" -version = "27.0.1" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b22e9981cdd444f3aa6734bc58d76195bf7eca3ccf1dd432b875af5d02da068" +checksum = "74059594274a1b51d0ec410ef1acd9009a888e73c5f8bdd5577d28ea8766e6f2" dependencies = [ "arbitrary", - "crate-git-revision 0.0.6", + "crate-git-revision 0.0.9", "ethnum", "num-derive", "num-traits", @@ -5493,9 +5503,9 @@ dependencies = [ [[package]] name = "soroban-env-guest" -version = "27.0.1" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b6072f99ca6bf8e8d5b04e05d083dac785e5357d9c0f36a6658f819c2fd7d67" +checksum = "769c70c3273c4cb741046db161e804b91b8df81f9df2013dfb98d65370a716cc" dependencies = [ "soroban-env-common", "static_assertions", @@ -5503,9 +5513,9 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "27.0.1" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c06afd7c75ce150ce53e4d77a77645b18e3fb61856a0ddc42bfcecdc39fa3b9" +checksum = "7d3d108fff17fd4181343e29fd8d81d5053dfc29b337643e3b6c38e750eeb2f7" dependencies = [ "ark-bls12-381", "ark-bn254", @@ -5540,9 +5550,9 @@ dependencies = [ [[package]] name = "soroban-env-macros" -version = "27.0.1" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "647811bdd28a3ec40296987f6635781e5e1141c8f5affbbd53ba12b6295b7bb6" +checksum = "45f63006270b7ddfa604f4a12a43d1f489aa96c280877f24e37a139bb69964af" dependencies = [ "itertools 0.13.0", "proc-macro2", @@ -5559,9 +5569,8 @@ version = "27.1.0" [[package]] name = "soroban-ledger-snapshot" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27ea48b5d5e22c0cbaa370f813111016c9f5a8a6632edb0684c72be6531c4d3a" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "serde", "serde_json", @@ -5573,9 +5582,8 @@ dependencies = [ [[package]] name = "soroban-sdk" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cfa78af0110f0830d3af9db0361b6cdb50507846cedb8725189318134218b80" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "arbitrary", "bytes-lit", @@ -5592,14 +5600,14 @@ dependencies = [ "soroban-ledger-snapshot", "soroban-sdk-macros", "stellar-strkey 0.0.16", + "stellar-xdr", "visibility", ] [[package]] name = "soroban-sdk-macros" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db611bd0acfe5fd348ffdcef16c84090c6ab051f3e325b5ac049a73044a7ee6" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "darling 0.20.11", "heck 0.5.0", @@ -5609,7 +5617,6 @@ dependencies = [ "quote", "sha2 0.10.9", "soroban-env-common", - "soroban-spec", "soroban-spec-rust", "stellar-xdr", "syn 2.0.118", @@ -5617,9 +5624,8 @@ dependencies = [ [[package]] name = "soroban-spec" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8061fe31998fe9fba8fcd7175b3e3ca914a6f6e3bf829fe91fdf7f930b1251d9" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "base64 0.22.1", "sha2 0.10.9", @@ -5630,9 +5636,8 @@ dependencies = [ [[package]] name = "soroban-spec-rust" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2180cddacf3023a439827cb35c0e391ec413b1328173fe7c8c2743fc67b3af9e" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "prettyplease", "proc-macro2", @@ -5729,18 +5734,16 @@ dependencies = [ [[package]] name = "soroban-token-sdk" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52c6f247f1c3383b9fa8f8ab6bf3c6c7b36e893a2fff585bc819cbc89ec193" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "soroban-sdk", ] [[package]] name = "soroban-token-spec" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7417a2ae69b4a6fc52f986c3d501b3bd442ba976a0991f042f81f7ee593e1b30" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "soroban-sdk", "soroban-token-sdk", @@ -5789,9 +5792,8 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stellar-asset-spec" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9943559865bce30221f21f2bdd45352c91c253ddf1002dba413a7a0ffc23945" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "soroban-sdk", "soroban-token-sdk", @@ -5844,8 +5846,7 @@ dependencies = [ [[package]] name = "stellar-rpc-client" version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b65ae2e8788c09fba690afa3b589094fd67ff4d7d5ec4502ec4f2d7d870576" +source = "git+https://github.com/stellar/rs-stellar-rpc-client?rev=e0d44a0b97959820e855eb9058e2114ac390c1fa#e0d44a0b97959820e855eb9058e2114ac390c1fa" dependencies = [ "clap", "hex", @@ -5894,21 +5895,21 @@ dependencies = [ [[package]] name = "stellar-xdr" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ff843326969bdf1ef673dcdba94c08f4a3c8f1e58d6e6ef39b1bd4f749179a" +version = "28.0.0" +source = "git+https://github.com/stellar/rs-stellar-xdr?rev=99a031a6f6a0935f68c073705651bd1addca1fd4#99a031a6f6a0935f68c073705651bd1addca1fd4" dependencies = [ "arbitrary", "base64 0.22.1", "cfg_eval", "clap", - "crate-git-revision 0.0.6", + "crate-git-revision 0.0.9", "escape-bytes", "ethnum", "hex", "rand 0.9.2", "schemars 0.8.22", "serde", + "serde_ignored", "serde_json", "serde_with", "sha2 0.10.9", @@ -7291,7 +7292,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 71f7573e4d..15ec6c5ed5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,30 +44,30 @@ path = "cmd/crates/stellar-ledger" # Dependencies from the rs-stellar-xdr repo: [workspace.dependencies.stellar-xdr] -version = "27.0.0" +version = "28.0.0" # Dependencies from the rs-stellar-env repo: [workspace.dependencies.soroban-env-host] -version = "27.0.1" +version = "28.0.1" # Dependencies from the rs-soroban-sdk repo: [workspace.dependencies.soroban-spec] -version = "27.0.2" +version = "27.0.5" [workspace.dependencies.soroban-spec-rust] -version = "27.0.2" +version = "27.0.5" [workspace.dependencies.soroban-sdk] -version = "27.0.2" +version = "27.0.5" [workspace.dependencies.soroban-token-sdk] -version = "27.0.2" +version = "27.0.5" [workspace.dependencies.stellar-asset-spec] -version = "27.0.2" +version = "27.0.5" [workspace.dependencies.soroban-ledger-snapshot] -version = "27.0.2" +version = "27.0.5" # Dependencies from the rs-stellar-rpc-client repo: [workspace.dependencies.soroban-rpc] @@ -120,6 +120,22 @@ testcontainers = "0.27.2" httpmock = "0.7.0" astral-tokio-tar = "0.6.0" +[patch.crates-io] +# Pending https://github.com/stellar/rs-stellar-xdr/pull/566, which widens the +# user-defined type name limit so that a fully qualified type name fits. +stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "99a031a6f6a0935f68c073705651bd1addca1fd4" } +# Pending https://github.com/stellar/rs-soroban-sdk/pull/1970, which names +# user-defined types in contract specs by their fully qualified path. +soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "5727dc54b5a341d59677329d2dfbcead90bbf877" } +soroban-spec-rust = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "5727dc54b5a341d59677329d2dfbcead90bbf877" } +soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "5727dc54b5a341d59677329d2dfbcead90bbf877" } +soroban-token-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "5727dc54b5a341d59677329d2dfbcead90bbf877" } +stellar-asset-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "5727dc54b5a341d59677329d2dfbcead90bbf877" } +soroban-ledger-snapshot = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "5727dc54b5a341d59677329d2dfbcead90bbf877" } +# Pending https://github.com/stellar/rs-stellar-rpc-client/pull/108, which +# updates the client to stellar-xdr 28. +stellar-rpc-client = { git = "https://github.com/stellar/rs-stellar-rpc-client", rev = "e0d44a0b97959820e855eb9058e2114ac390c1fa" } + [profile.release] overflow-checks = true diff --git a/Makefile b/Makefile index 6e633d8078..397040e81d 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ build: cargo build build-test-wasms: - cargo build --package 'test_*' --profile test-wasms --target wasm32v1-none + SOROBAN_SDK_BUILD_SYSTEM_SUPPORTS_SPEC_SHAKING_V2=1 cargo build --package 'test_*' --profile test-wasms --target wasm32v1-none build-test: build-test-wasms build-fixtures install diff --git a/cmd/crates/soroban-spec-tools/src/contract.rs b/cmd/crates/soroban-spec-tools/src/contract.rs index 2cc1343e75..a7445e6e55 100644 --- a/cmd/crates/soroban-spec-tools/src/contract.rs +++ b/cmd/crates/soroban-spec-tools/src/contract.rs @@ -311,7 +311,7 @@ fn indent(s: &str, n: usize) -> String { .join("\n") } -fn format_name(lib: &StringM<80>, name: &StringM<60>) -> String { +fn format_name(lib: &StringM<80>, name: &StringM<256>) -> String { if lib.is_empty() { sanitize(&name.to_utf8_string_lossy()) } else { diff --git a/cmd/crates/soroban-spec-tools/src/lib.rs b/cmd/crates/soroban-spec-tools/src/lib.rs index a12d5821b8..375c9eaffc 100644 --- a/cmd/crates/soroban-spec-tools/src/lib.rs +++ b/cmd/crates/soroban-spec-tools/src/lib.rs @@ -372,7 +372,7 @@ impl Spec { Ok(val) } - fn parse_udt(&self, name: &StringM<60>, value: &Value) -> Result { + fn parse_udt(&self, name: &StringM<256>, value: &Value) -> Result { let name = &name.to_utf8_string_lossy(); match (self.find(name)?, value) { (ScSpecEntry::UdtStructV0(strukt), Value::Object(map)) => { @@ -649,7 +649,7 @@ impl Spec { /// # Panics /// /// May panic - pub fn udt_to_json(&self, name: &StringM<60>, sc_obj: &ScVal) -> Result { + pub fn udt_to_json(&self, name: &StringM<256>, sc_obj: &ScVal) -> Result { let name = &name.to_utf8_string_lossy(); let udt = self.find(name)?; Ok(match (sc_obj, udt) { @@ -1002,6 +1002,11 @@ pub fn to_json(v: &ScVal) -> Result { .map_err(|_| Error::InvalidValue(Some(ScType::Symbol)))? .to_string(), ), + ScVal::ExecutableTag(v) => Value::String( + std::str::from_utf8(v.as_slice()) + .map_err(|_| Error::InvalidValue(Some(ScType::String)))? + .to_string(), + ), ScVal::Vec(v) => { let values: Result, Error> = v.as_ref().map_or_else( || Ok(vec![]), @@ -1094,6 +1099,14 @@ pub fn to_json(v: &ScVal) -> Result { executable: ContractExecutable::StellarAsset, .. }) => json!({"SAC": true}), + ScVal::ContractInstance(ScContractInstance { + executable: ContractExecutable::ExternalRef(external_ref), + .. + }) => json!({ + "executable_owner": sc_address_to_json(&external_ref.executable_owner), + "tag": std::str::from_utf8(external_ref.tag.as_slice()) + .map_err(|_| Error::InvalidValue(Some(ScType::String)))?, + }), ScVal::LedgerKeyNonce(ScNonceKey { nonce }) => { Value::Number(serde_json::Number::from(*nonce)) } diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/src/contract.rs b/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/src/contract.rs index eac10e5751..8a30558a34 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/src/contract.rs +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/src/contract.rs @@ -96,7 +96,7 @@ impl token::Interface for Token { from: from.clone(), spender: spender.clone(), amount, - expiration_ledger, + live_until_ledger: expiration_ledger, } .publish(&e); } diff --git a/cmd/crates/soroban-test/tests/it/log.rs b/cmd/crates/soroban-test/tests/it/log.rs index d580e52296..f515e3ffd6 100644 --- a/cmd/crates/soroban-test/tests/it/log.rs +++ b/cmd/crates/soroban-test/tests/it/log.rs @@ -30,7 +30,7 @@ fn test_diagnostic_events_logging() { }); let captured_logs = logs.lock().unwrap(); - assert!(captured_logs.iter().any(|log| log.contains(r#"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAADAAAADwAAAAdmbl9jYWxsAAAAAA0AAAAgfKvD/pIJPlRnGd3RKaBZSHfoq/nJbJSYxkVTScSbhuYAAAAPAAAABGRlY3IAAAAB {"in_successful_contract_call":false,"event":{"ext":"v0","contract_id":null,"type_":"diagnostic","body":{"v0":{"topics":[{"symbol":"fn_call"},{"bytes":"7cabc3fe92093e546719ddd129a0594877e8abf9c96c9498c6455349c49b86e6"},{"symbol":"decr"}],"data":"void"}}}}"#))); + assert!(captured_logs.iter().any(|log| log.contains(r#"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAADAAAADwAAAAdmbl9jYWxsAAAAAA0AAAAgfKvD/pIJPlRnGd3RKaBZSHfoq/nJbJSYxkVTScSbhuYAAAAPAAAABGRlY3IAAAAB {"in_successful_contract_call":false,"event":{"ext":"v0","contract_id":null,"type":"diagnostic","body":{"v0":{"topics":[{"symbol":"fn_call"},{"bytes":"7cabc3fe92093e546719ddd129a0594877e8abf9c96c9498c6455349c49b86e6"},{"symbol":"decr"}],"data":"void"}}}}"#))); assert!(captured_logs .iter() .any(|log| log.contains("VM call trapped"))); diff --git a/cmd/soroban-cli/src/commands/contract/arg_parsing.rs b/cmd/soroban-cli/src/commands/contract/arg_parsing.rs index c97cfa551f..db3acbb124 100644 --- a/cmd/soroban-cli/src/commands/contract/arg_parsing.rs +++ b/cmd/soroban-cli/src/commands/contract/arg_parsing.rs @@ -1074,7 +1074,7 @@ mod tests { }; // Build a minimal Spec with a union type: enum MyEnum { Unit } - let union_name: StringM<60> = "MyEnum".try_into().unwrap(); + let union_name: StringM<256> = "MyEnum".try_into().unwrap(); let case_name: StringM<60> = "Unit".try_into().unwrap(); let spec = Spec(Some(vec![ScSpecEntry::UdtUnionV0(ScSpecUdtUnionV0 { doc: StringM::default(), @@ -1123,7 +1123,7 @@ mod tests { ScSpecUdtUnionCaseV0, ScSpecUdtUnionCaseVoidV0, ScSpecUdtUnionV0, StringM, }; - let union_name: StringM<60> = "MyEnum".try_into().unwrap(); + let union_name: StringM<256> = "MyEnum".try_into().unwrap(); let spec = Spec(Some(vec![ScSpecEntry::UdtUnionV0(ScSpecUdtUnionV0 { doc: StringM::default(), lib: StringM::default(), @@ -1190,7 +1190,7 @@ mod tests { use stellar_xdr::{ ScSpecEntry, ScSpecTypeUdt, ScSpecUdtStructFieldV0, ScSpecUdtStructV0, StringM, }; - let struct_name: StringM<60> = name.try_into().unwrap(); + let struct_name: StringM<256> = name.try_into().unwrap(); let fields_xdr: Vec = fields .iter() .map(|(n, t)| ScSpecUdtStructFieldV0 { @@ -1324,7 +1324,7 @@ mod tests { ScSpecUdtUnionV0, StringM, }; - let union_name: StringM<60> = "Choice".try_into().unwrap(); + let union_name: StringM<256> = "Choice".try_into().unwrap(); let spec = Spec(Some(vec![ScSpecEntry::UdtUnionV0(ScSpecUdtUnionV0 { doc: StringM::default(), lib: StringM::default(), @@ -1362,7 +1362,7 @@ mod tests { ScSpecUdtUnionV0, StringM, }; - let union_name: StringM<60> = "OneOf".try_into().unwrap(); + let union_name: StringM<256> = "OneOf".try_into().unwrap(); let spec = Spec(Some(vec![ScSpecEntry::UdtUnionV0(ScSpecUdtUnionV0 { doc: StringM::default(), lib: StringM::default(), diff --git a/cmd/soroban-cli/src/get_spec.rs b/cmd/soroban-cli/src/get_spec.rs index a72069e7c5..3756caefa6 100644 --- a/cmd/soroban-cli/src/get_spec.rs +++ b/cmd/soroban-cli/src/get_spec.rs @@ -28,6 +28,11 @@ pub enum Error { Config(#[from] config::Error), #[error(transparent)] ContractSpec(#[from] contract_spec::Error), + #[error( + "cannot fetch spec for contract because the contract executable is \ + an external reference that does not have a downloadable code binary" + )] + ContractIsExternalRef, } /// @@ -76,5 +81,6 @@ pub async fn get_remote_contract_spec( ContractExecutable::StellarAsset => { soroban_spec::read::parse_raw(stellar_asset_spec::xdr())? } + ContractExecutable::ExternalRef(_) => return Err(Error::ContractIsExternalRef), }) } diff --git a/cmd/soroban-cli/src/log/auth.rs b/cmd/soroban-cli/src/log/auth.rs index fff3a5321f..0509369ed1 100644 --- a/cmd/soroban-cli/src/log/auth.rs +++ b/cmd/soroban-cli/src/log/auth.rs @@ -127,6 +127,15 @@ fn format_create_contract( ContractExecutable::StellarAsset => { let _ = writeln!(result, "{prefix} Executable: StellarAsset"); } + ContractExecutable::ExternalRef(external_ref) => { + let tag = std::str::from_utf8(external_ref.tag.as_ref()).unwrap_or(""); + let _ = writeln!( + result, + "{prefix} Executable: ExternalRef owner={} tag={}", + format_address(&external_ref.executable_owner), + sanitize(tag) + ); + } } if let Some(args) = constructor_args { if !args.is_empty() { diff --git a/cmd/soroban-cli/src/wasm.rs b/cmd/soroban-cli/src/wasm.rs index 406f001a04..6333ae1bc8 100644 --- a/cmd/soroban-cli/src/wasm.rs +++ b/cmd/soroban-cli/src/wasm.rs @@ -13,7 +13,7 @@ use crate::{ network::{Error as NetworkError, Network}, }, utils::{self, rpc::get_remote_wasm_from_hash}, - wasm::Error::{ContractIsStellarAsset, UnexpectedContractToken}, + wasm::Error::{ContractIsExternalRef, ContractIsStellarAsset, UnexpectedContractToken}, }; #[derive(thiserror::Error, Debug)] @@ -47,6 +47,11 @@ pub enum Error { a network built-in asset contract that does not have a downloadable code binary" )] ContractIsStellarAsset, + #[error( + "cannot fetch wasm for contract because the contract executable is \ + an external reference that does not have a downloadable code binary" + )] + ContractIsExternalRef, #[error(transparent)] Network(#[from] NetworkError), } @@ -133,6 +138,7 @@ pub async fn fetch_from_contract( return match &contract.executable { ContractExecutable::Wasm(hash) => Ok(get_remote_wasm_from_hash(&client, hash).await?), ContractExecutable::StellarAsset => Err(ContractIsStellarAsset), + ContractExecutable::ExternalRef(_) => Err(ContractIsExternalRef), }; } Err(UnexpectedContractToken(Box::new(data_entry))) @@ -158,6 +164,7 @@ pub async fn fetch_wasm_hash_from_contract( return match &contract.executable { ContractExecutable::Wasm(hash) => Ok(hash.clone()), ContractExecutable::StellarAsset => Err(ContractIsStellarAsset), + ContractExecutable::ExternalRef(_) => Err(ContractIsExternalRef), }; } Err(UnexpectedContractToken(Box::new(data_entry))) diff --git a/deny.toml b/deny.toml index dd05ae3b5b..b521773797 100644 --- a/deny.toml +++ b/deny.toml @@ -231,7 +231,15 @@ allow-registry = ["https://github.com/rust-lang/crates.io-index"] # List of URLs for allowed Git repositories allow-git = [ # Only used by the unpublished doc-gen crate, temporarily until PR is merged: https://github.com/ConnorGray/clap-markdown/pull/48 - "https://github.com/ConnorGray/clap-markdown?rev=42956b342cef3325d9060fc43995d595e7c8aa66" + "https://github.com/ConnorGray/clap-markdown?rev=42956b342cef3325d9060fc43995d595e7c8aa66", + + # Temporary patches, remove once the following PRs are merged and released: + # https://github.com/stellar/rs-stellar-xdr/pull/566 + "https://github.com/stellar/rs-stellar-xdr?rev=99a031a6f6a0935f68c073705651bd1addca1fd4", + # https://github.com/stellar/rs-soroban-sdk/pull/1970 + "https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877", + # https://github.com/stellar/rs-stellar-rpc-client/pull/108 + "https://github.com/stellar/rs-stellar-rpc-client?rev=e0d44a0b97959820e855eb9058e2114ac390c1fa", ] [sources.allow-org]