Skip to content

Commit 7a13780

Browse files
resolve spec references by entry id
1 parent d8c08d3 commit 7a13780

9 files changed

Lines changed: 228 additions & 88 deletions

File tree

Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ astral-tokio-tar = "0.6.0"
124124
# Pending https://github.com/stellar/rs-stellar-xdr/pull/568, which adds
125125
# user-defined type ids and the `ScSpecTypeUdtv2` reference type to the
126126
# contract spec.
127-
stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "d7bf0331c0b212b97010b49c06d6da259c89588d" }
127+
stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "2e565108988d9181c26477815e708ade929e67e0" }
128128
# Pending the rs-soroban-sdk change that stamps every user-defined type's spec
129129
# entry with an id and marries references up with entries by id.
130-
soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "db0de82715133c3732d422bdfcbee65f53c5c0c9" }
131-
soroban-spec-rust = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "db0de82715133c3732d422bdfcbee65f53c5c0c9" }
132-
soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "db0de82715133c3732d422bdfcbee65f53c5c0c9" }
133-
soroban-token-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "db0de82715133c3732d422bdfcbee65f53c5c0c9" }
134-
stellar-asset-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "db0de82715133c3732d422bdfcbee65f53c5c0c9" }
135-
soroban-ledger-snapshot = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "db0de82715133c3732d422bdfcbee65f53c5c0c9" }
130+
soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "997dd6dbe9c0ce01a3c4cc940c392e9debab12dd" }
131+
soroban-spec-rust = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "997dd6dbe9c0ce01a3c4cc940c392e9debab12dd" }
132+
soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "997dd6dbe9c0ce01a3c4cc940c392e9debab12dd" }
133+
soroban-token-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "997dd6dbe9c0ce01a3c4cc940c392e9debab12dd" }
134+
stellar-asset-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "997dd6dbe9c0ce01a3c4cc940c392e9debab12dd" }
135+
soroban-ledger-snapshot = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "997dd6dbe9c0ce01a3c4cc940c392e9debab12dd" }
136136
# Pending https://github.com/stellar/rs-stellar-rpc-client/pull/108, which
137137
# updates the client to stellar-xdr 28.
138138
stellar-rpc-client = { git = "https://github.com/stellar/rs-stellar-rpc-client", rev = "e0d44a0b97959820e855eb9058e2114ac390c1fa" }

cmd/crates/soroban-spec-tools/src/contract.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use std::{
66

77
use stellar_xdr::{
88
self as xdr, Limited, Limits, ReadXdr, ScEnvMetaEntry, ScEnvMetaEntryInterfaceVersion,
9-
ScMetaEntry, ScMetaV0, ScSpecEntry, ScSpecFunctionV0, ScSpecUdtEnumV0, ScSpecUdtErrorEnumV0,
10-
ScSpecUdtStructV0, ScSpecUdtUnionV0, StringM, WriteXdr,
9+
ScMetaEntry, ScMetaV0, ScSpecEntry, ScSpecEntryV2Body, ScSpecFunctionV0, ScSpecUdtEnumV0,
10+
ScSpecUdtErrorEnumV0, ScSpecUdtStructV0, ScSpecUdtUnionV0, StringM, WriteXdr,
1111
};
1212

1313
/// Maximum recursion depth allowed when decoding contract spec/meta sections.
@@ -184,6 +184,14 @@ impl Display for Spec {
184184
ScSpecEntry::UdtEnumV0(udt) => write_enum(f, udt)?,
185185
ScSpecEntry::UdtErrorEnumV0(udt) => write_error(f, udt)?,
186186
ScSpecEntry::EventV0(_) => {}
187+
ScSpecEntry::V2(v2) => match &v2.body {
188+
ScSpecEntryV2Body::FunctionV0(func) => write_func(f, func)?,
189+
ScSpecEntryV2Body::UdtUnionV0(udt) => write_union(f, udt)?,
190+
ScSpecEntryV2Body::UdtStructV0(udt) => write_struct(f, udt)?,
191+
ScSpecEntryV2Body::UdtEnumV0(udt) => write_enum(f, udt)?,
192+
ScSpecEntryV2Body::UdtErrorEnumV0(udt) => write_error(f, udt)?,
193+
ScSpecEntryV2Body::EventV0(_) => {}
194+
},
187195
}
188196
}
189197
} else {

0 commit comments

Comments
 (0)