Skip to content

Commit

Permalink
Remove ScSpecTypeSet support, which was already mostly dead. (#1054)
Browse files Browse the repository at this point in the history
Reflects stellar/rs-stellar-xdr#291 which
reflects stellar/stellar-xdr#136 which addresses
stellar/stellar-xdr#135 which resulted from
#979

This will need updating when
stellar/rs-stellar-xdr#291 merges, before it can
merge.
  • Loading branch information
graydon authored Aug 22, 2023
1 parent da987a9 commit ff71e74
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 27 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ soroban-token-sdk = { version = "0.9.2", path = "soroban-token-sdk" }
[workspace.dependencies.soroban-env-common]
version = "0.0.17"
git = "https://github.com/stellar/rs-soroban-env"
rev = "c2e1c21cf8d44db23a159090e3cbaab741860295"
rev = "00c85906a602b4050b2a49ca1a86860c3812d699"

[workspace.dependencies.soroban-env-guest]
version = "0.0.17"
git = "https://github.com/stellar/rs-soroban-env"
rev = "c2e1c21cf8d44db23a159090e3cbaab741860295"
rev = "00c85906a602b4050b2a49ca1a86860c3812d699"

[workspace.dependencies.soroban-env-host]
version = "0.0.17"
git = "https://github.com/stellar/rs-soroban-env"
rev = "c2e1c21cf8d44db23a159090e3cbaab741860295"
rev = "00c85906a602b4050b2a49ca1a86860c3812d699"

[workspace.dependencies.stellar-strkey]
version = "0.0.7"
Expand All @@ -60,7 +60,7 @@ rev = "e6ba45c60c16de28c7522586b80ed0150157df73"
[workspace.dependencies.stellar-xdr]
version = "0.0.17"
git = "https://github.com/stellar/rs-stellar-xdr"
rev = "2d2526f515a476b1e3df70233a4cf9232287977e"
rev = "e2a9cbf72d94941de1bde6ba34a38e1f49328567"
default-features = false

#[patch."https://github.com/stellar/rs-soroban-env"]
Expand Down
14 changes: 1 addition & 13 deletions soroban-sdk-macros/src/map_type.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use stellar_xdr::{
ScSpecTypeBytesN, ScSpecTypeDef, ScSpecTypeMap, ScSpecTypeOption, ScSpecTypeResult,
ScSpecTypeSet, ScSpecTypeTuple, ScSpecTypeUdt, ScSpecTypeVec,
ScSpecTypeTuple, ScSpecTypeUdt, ScSpecTypeVec,
};
use syn::{
spanned::Spanned, Error, Expr, ExprLit, GenericArgument, Lit, Path, PathArguments, PathSegment,
Expand Down Expand Up @@ -86,18 +86,6 @@ pub fn map_type(t: &Type) -> Result<ScSpecTypeDef, Error> {
element_type: Box::new(map_type(t)?),
})))
}
"Set" => {
let t = match args.as_slice() {
[GenericArgument::Type(t)] => t,
[..] => Err(Error::new(
t.span(),
"incorrect number of generic arguments, expect one for Set<T>",
))?,
};
Ok(ScSpecTypeDef::Set(Box::new(ScSpecTypeSet {
element_type: Box::new(map_type(t)?),
})))
}
"Map" => {
let (k, v) = match args.as_slice() {
[GenericArgument::Type(k), GenericArgument::Type(v)] => (k, v),
Expand Down
4 changes: 0 additions & 4 deletions soroban-spec-rust/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,6 @@ pub fn generate_type_ident(spec: &ScSpecTypeDef) -> TokenStream {
let value_ident = generate_type_ident(&m.value_type);
quote! { soroban_sdk::Map<#key_ident, #value_ident> }
}
ScSpecTypeDef::Set(s) => {
let element_ident = generate_type_ident(&s.element_type);
quote! { soroban_sdk::Set<#element_ident> }
}
ScSpecTypeDef::Tuple(t) => {
let type_idents = t.value_types.iter().map(generate_type_ident);
quote! { (#(#type_idents,)*) }
Expand Down

0 comments on commit ff71e74

Please sign in to comment.