Skip to content
Closed
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
95 changes: 48 additions & 47 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 24 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cmd/crates/soroban-spec-tools/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
17 changes: 15 additions & 2 deletions cmd/crates/soroban-spec-tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ impl Spec {
Ok(val)
}

fn parse_udt(&self, name: &StringM<60>, value: &Value) -> Result<ScVal, Error> {
fn parse_udt(&self, name: &StringM<256>, value: &Value) -> Result<ScVal, Error> {
let name = &name.to_utf8_string_lossy();
match (self.find(name)?, value) {
(ScSpecEntry::UdtStructV0(strukt), Value::Object(map)) => {
Expand Down Expand Up @@ -649,7 +649,7 @@ impl Spec {
/// # Panics
///
/// May panic
pub fn udt_to_json(&self, name: &StringM<60>, sc_obj: &ScVal) -> Result<Value, Error> {
pub fn udt_to_json(&self, name: &StringM<256>, sc_obj: &ScVal) -> Result<Value, Error> {
let name = &name.to_utf8_string_lossy();
let udt = self.find(name)?;
Ok(match (sc_obj, udt) {
Expand Down Expand Up @@ -1002,6 +1002,11 @@ pub fn to_json(v: &ScVal) -> Result<Value, Error> {
.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<Vec<Value>, Error> = v.as_ref().map_or_else(
|| Ok(vec![]),
Expand Down Expand Up @@ -1094,6 +1099,14 @@ pub fn to_json(v: &ScVal) -> Result<Value, Error> {
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))
}
Expand Down
Loading
Loading