Skip to content
Merged
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
120 changes: 91 additions & 29 deletions Cargo.lock

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

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ version = "0.9.4"
[workspace.dependencies.soroban-env-host]
version = "0.0.17"
git = "https://github.com/stellar/rs-soroban-env"
rev = "048be90e10dfda6486141f96ea86e32fb91681f4"
rev = "00c85906a602b4050b2a49ca1a86860c3812d699"

[workspace.dependencies.soroban-spec]
version = "0.9.1"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "df9334d4e3a1a2c2e0034cfabb643972d4d7f717"
rev = "ff71e7414acfb56fb347d3745c9e0f2119a3cfeb"
# path = "../rs-soroban-sdk/soroban-spec"

[workspace.dependencies.soroban-spec-rust]
version = "0.9.1"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "df9334d4e3a1a2c2e0034cfabb643972d4d7f717"
rev = "ff71e7414acfb56fb347d3745c9e0f2119a3cfeb"
# path = "../rs-soroban-sdk/soroban-spec-rust"

[workspace.dependencies.soroban-spec-json]
Expand All @@ -45,12 +45,12 @@ path = "./cmd/crates/soroban-spec-tools"
[workspace.dependencies.soroban-sdk]
version = "0.9.1"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "df9334d4e3a1a2c2e0034cfabb643972d4d7f717"
rev = "ff71e7414acfb56fb347d3745c9e0f2119a3cfeb"

[workspace.dependencies.soroban-ledger-snapshot]
version = "0.9.1"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "df9334d4e3a1a2c2e0034cfabb643972d4d7f717"
rev = "ff71e7414acfb56fb347d3745c9e0f2119a3cfeb"

[workspace.dependencies.soroban-cli]
version = "0.9.4"
Expand All @@ -59,7 +59,7 @@ path = "cmd/soroban-cli"
[workspace.dependencies.stellar-xdr]
version = "0.0.17"
git = "https://github.com/stellar/rs-stellar-xdr"
rev = "4876e5eb20016caebbd13bcf6401626dc6073b8e"
rev = "e2a9cbf72d94941de1bde6ba34a38e1f49328567"
default-features = false

[workspace.dependencies]
Expand Down
3 changes: 3 additions & 0 deletions cmd/crates/soroban-spec-json/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ pub fn generate_from_wasm(wasm: &[u8]) -> Result<String, FromWasmError> {
Ok(json)
}

/// # Panics
///
/// If `serde_json::to_string_pretty` fails to serialize the spec entries.
pub fn generate(spec: &[ScSpecEntry]) -> String {
let collected: Vec<_> = spec.iter().map(Entry::from).collect();
serde_json::to_string_pretty(&collected).expect("serialization of the spec entries should not have any failure cases as all keys are strings and the serialize implementations are derived")
Expand Down
4 changes: 0 additions & 4 deletions cmd/crates/soroban-spec-json/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ pub enum Type {
Map { key: Box<Type>, value: Box<Type> },
Option { value: Box<Type> },
Result { value: Box<Type>, error: Box<Type> },
Set { element: Box<Type> },
Vec { element: Box<Type> },
BytesN { n: u32 },
Tuple { elements: Vec<Type> },
Expand Down Expand Up @@ -178,9 +177,6 @@ impl From<&ScSpecTypeDef> for Type {
value: Box::new(Type::from(res.ok_type.as_ref())),
error: Box::new(Type::from(res.error_type.as_ref())),
},
ScSpecTypeDef::Set(set) => Type::Set {
element: Box::new(Type::from(set.element_type.as_ref())),
},
ScSpecTypeDef::Tuple(tuple) => Type::Tuple {
elements: tuple.value_types.iter().map(Type::from).collect(),
},
Expand Down
Loading