From e9e6ad8841d59999dac8f7ced28652e1f179df76 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Fri, 11 Aug 2023 15:43:25 -0700 Subject: [PATCH] Remove ScSpecTypeSet support, which was already mostly dead. --- Cargo.toml | 2 +- soroban-sdk-macros/src/map_type.rs | 14 +------------- soroban-spec-rust/src/types.rs | 4 ---- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f289a7c8f..fb1b05077 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,7 +60,7 @@ rev = "e6ba45c60c16de28c7522586b80ed0150157df73" [workspace.dependencies.stellar-xdr] version = "0.0.17" git = "https://github.com/stellar/rs-stellar-xdr" -rev = "4876e5eb20016caebbd13bcf6401626dc6073b8e" +rev = "74178ad4c71989c1f8596e2e102c2cc5f252dc17" default-features = false #[patch."https://github.com/stellar/rs-soroban-env"] diff --git a/soroban-sdk-macros/src/map_type.rs b/soroban-sdk-macros/src/map_type.rs index db9e2a290..32d79fedb 100644 --- a/soroban-sdk-macros/src/map_type.rs +++ b/soroban-sdk-macros/src/map_type.rs @@ -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, @@ -86,18 +86,6 @@ pub fn map_type(t: &Type) -> Result { 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", - ))?, - }; - 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), diff --git a/soroban-spec-rust/src/types.rs b/soroban-spec-rust/src/types.rs index 11869cfc5..9222dc7a8 100644 --- a/soroban-spec-rust/src/types.rs +++ b/soroban-spec-rust/src/types.rs @@ -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,)*) }